:root {
    --brand-teal: #267d8e;
    --brand-teal-dark: #1e6573;
    --brand-teal-light: #e8f4f6;
    --brand-teal-soft: #d4ebee;
    --brand-charcoal: #2d3748;
    --brand-grey: #718096;
    --brand-bg: #f4f8f9;
    --brand-white: #ffffff;
    --brand-border: #d9e5e8;
    --brand-danger: #c53030;
    --brand-warning: #c05621;
    --brand-success: #276749;
    --shadow-sm: 0 1px 2px rgba(45, 55, 72, 0.06);
    --shadow-md: 0 8px 24px rgba(38, 125, 142, 0.10);
    --radius: 14px;
    --sidebar-width: 260px;
    --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    background: var(--brand-bg);
    color: var(--brand-charcoal);
    min-height: 100%;
}

a { color: var(--brand-teal); text-decoration: none; }
a:hover { color: var(--brand-teal-dark); }

.app-shell {
    display: flex;
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(38, 125, 142, 0.08), transparent 28%),
        linear-gradient(180deg, #f7fbfc 0%, #eef5f7 100%);
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1f6d7c 0%, #267d8e 45%, #1b5f6c 100%);
    color: white;
    padding: 1.25rem 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 8px 0 30px rgba(38, 125, 142, 0.18);
    z-index: 20;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    margin-bottom: 1rem;
}

.brand-top {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
}

.brand img {
    width: 100%;
    max-width: 190px;
    height: auto;
    background: white;
    border-radius: 12px;
    padding: 0.65rem 0.75rem;
    box-shadow: var(--shadow-sm);
}

.sidebar-close,
.mobile-bar,
.sidebar-overlay {
    display: none;
}

.sidebar-logout {
    background: rgba(255,255,255,0.12) !important;
    color: white !important;
    border-color: rgba(255,255,255,0.2) !important;
}

.brand-tag {
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.85;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 0.95rem;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.88);
    font-weight: 600;
    transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.16);
    color: white;
}

.nav-link.active {
    box-shadow: inset 3px 0 0 #fff;
}

.nav-icon {
    width: 1.15rem;
    text-align: center;
    opacity: 0.95;
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.main {
    flex: 1;
    min-width: 0;
    padding: 1.5rem 1.75rem 2rem;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.page-title h1 {
    margin: 0;
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    color: var(--brand-charcoal);
    letter-spacing: -0.02em;
}

.page-title p {
    margin: 0.35rem 0 0;
    color: var(--brand-grey);
    font-size: 0.95rem;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    border: 1px solid var(--brand-border);
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    box-shadow: var(--shadow-sm);
    max-width: 100%;
}

.user-chip strong { display: block; font-size: 0.9rem; }
.user-chip span {
    display: block;
    font-size: 0.75rem;
    color: var(--brand-grey);
    word-break: break-all;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: none;
    border-radius: 10px;
    padding: 0.7rem 1.1rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--brand-teal);
    color: white;
}
.btn-primary:hover { background: var(--brand-teal-dark); color: white; }

.btn-secondary {
    background: white;
    color: var(--brand-charcoal);
    border: 1px solid var(--brand-border);
}
.btn-secondary:hover { background: var(--brand-teal-light); }

.btn-danger {
    background: #fff5f5;
    color: var(--brand-danger);
    border: 1px solid #feb2b2;
}
.btn-danger:hover { background: #fed7d7; }

.btn-sm { padding: 0.45rem 0.75rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

.card {
    background: white;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-body { padding: 1.25rem; }
.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--brand-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.card-header h2,
.card-header h3 {
    margin: 0;
    font-size: 1.05rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    position: relative;
    overflow: hidden;
    background: white;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    padding: 1.15rem 1.2rem;
    box-shadow: var(--shadow-sm);
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -18px;
    top: -18px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--brand-teal-light);
}

.stat-label {
    color: var(--brand-grey);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.stat-value {
    margin-top: 0.45rem;
    font-size: 1.85rem;
    font-weight: 750;
    color: var(--brand-teal);
    position: relative;
    z-index: 1;
}

.stat-meta {
    margin-top: 0.35rem;
    color: var(--brand-grey);
    font-size: 0.82rem;
    position: relative;
    z-index: 1;
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: end;
    padding: 1rem;
}

.filters-compact {
    grid-template-columns: 2fr 1fr auto;
}

.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-grey);
}

.form-control {
    width: 100%;
    border: 1px solid var(--brand-border);
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
    font: inherit;
    color: var(--brand-charcoal);
    background: white;
    outline: none;
    transition: 0.15s ease;
}

.form-control:focus {
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 3px rgba(38, 125, 142, 0.15);
}

textarea.form-control { resize: vertical; min-height: 90px; }

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
}

table.data-table th,
table.data-table td {
    padding: 0.9rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--brand-border);
    vertical-align: middle;
}

table.data-table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-grey);
    background: #f8fbfc;
    white-space: nowrap;
}

table.data-table tr:hover td { background: #f9fcfd; }

.table-scroll-hint {
    display: none;
    font-size: 0.78rem;
    color: var(--brand-grey);
    padding: 0.65rem 1rem 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-enquiry { background: #edf2f7; color: #4a5568; }
.badge-confirmed { background: #e6fffa; color: #234e52; }
.badge-progress { background: var(--brand-teal-light); color: var(--brand-teal-dark); }
.badge-review { background: #fefcbf; color: #744210; }
.badge-completed { background: #c6f6d5; color: #22543d; }
.badge-cancelled { background: #fed7d7; color: #822727; }

.alert {
    border-radius: 12px;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}
.alert-success { background: #f0fff4; border-color: #9ae6b4; color: #22543d; }
.alert-danger { background: #fff5f5; border-color: #feb2b2; color: #822727; }

.grid-2 {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1rem;
}

.grid-2-equal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(45, 55, 72, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 1rem;
}

.modal-backdrop.open { display: flex; }

.modal {
    width: 100%;
    max-width: 560px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    max-height: 92vh;
    overflow: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--brand-border);
}

.modal-header h2 { margin: 0; font-size: 1.15rem; }
.modal-body { padding: 1.25rem; }
.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}
.modal-actions .btn { flex: 1; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.form-stack { display: flex; flex-direction: column; gap: 0.9rem; }

.quote-box {
    max-width: 720px;
    margin: 0 auto;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0;
    color: var(--brand-grey);
    font-size: 0.92rem;
}

.calc-total {
    border-top: 1px solid var(--brand-border);
    margin-top: 0.75rem;
    padding-top: 0.9rem;
    font-size: 1.1rem;
    color: var(--brand-charcoal);
    font-weight: 700;
}

.calc-total strong {
    font-size: 1.7rem;
    color: var(--brand-teal);
}

.ref-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--brand-grey);
}

.ref-grid p {
    margin: 0 0 0.5rem;
    color: var(--brand-charcoal);
    font-weight: 700;
}

.ref-grid ul {
    margin: 0;
    padding-left: 1rem;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 15% 20%, rgba(38, 125, 142, 0.18), transparent 35%),
        radial-gradient(circle at 85% 80%, rgba(38, 125, 142, 0.12), transparent 30%),
        linear-gradient(135deg, #f7fbfc, #e7f2f4 50%, #f4f8f9);
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: white;
    border-radius: 20px;
    border: 1px solid var(--brand-border);
    box-shadow: var(--shadow-md);
    padding: 2rem 1.75rem;
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.login-logo img {
    max-width: 260px;
    width: 100%;
}

.login-card h1 {
    margin: 0 0 0.35rem;
    text-align: center;
    font-size: 1.4rem;
}

.login-card .subtitle {
    text-align: center;
    color: var(--brand-grey);
    margin-bottom: 1.5rem;
}

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--brand-grey);
}

.actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.pagination {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
    padding: 1rem 1.25rem;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.55rem;
    border-radius: 8px;
    border: 1px solid var(--brand-border);
    color: var(--brand-charcoal);
    background: white;
    font-size: 0.85rem;
}

.pagination .active span,
.pagination a:hover {
    background: var(--brand-teal);
    border-color: var(--brand-teal);
    color: white;
}

.deadline-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--brand-border);
}
.deadline-item:last-child { border-bottom: none; }
.deadline-item strong { display: block; }
.deadline-item span { color: var(--brand-grey); font-size: 0.85rem; }

.invoice-sheet {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--brand-border);
    box-shadow: var(--shadow-md);
}

.invoice-hero {
    background: linear-gradient(135deg, #1f6d7c, #267d8e 55%, #3194a6);
    color: white;
    padding: 1.75rem 2rem;
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: center;
}

.invoice-hero img {
    background: white;
    border-radius: 12px;
    padding: 0.55rem 0.7rem;
    max-width: 220px;
}

.invoice-meta {
    text-align: right;
}

.invoice-meta .label {
    opacity: 0.8;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.invoice-meta .number {
    font-size: 1.6rem;
    font-weight: 750;
    margin-top: 0.2rem;
}

.invoice-body { padding: 2rem; }

.invoice-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.party-box h4 {
    margin: 0 0 0.5rem;
    color: var(--brand-teal);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
}

.party-box p { margin: 0.2rem 0; color: var(--brand-charcoal); }

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.invoice-table th {
    background: var(--brand-teal-light);
    color: var(--brand-teal-dark);
    text-align: left;
    padding: 0.85rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.invoice-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--brand-border);
}

.invoice-total-wrap {
    display: flex;
    justify-content: flex-end;
}

.invoice-total {
    min-width: 260px;
    background: linear-gradient(180deg, #f7fbfc, #eef6f7);
    border: 1px solid var(--brand-border);
    border-radius: 14px;
    padding: 1rem 1.2rem;
}

.invoice-total .row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.45rem;
    color: var(--brand-grey);
}

.invoice-total .grand {
    margin-top: 0.6rem;
    padding-top: 0.7rem;
    border-top: 2px solid var(--brand-teal);
    color: var(--brand-charcoal);
    font-weight: 750;
    font-size: 1.15rem;
}

.invoice-total .grand span:last-child {
    color: var(--brand-teal);
    font-size: 1.4rem;
}

.invoice-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--brand-border);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--brand-grey);
    font-size: 0.85rem;
}

.invoice-arc {
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--brand-teal), transparent);
    border-radius: 999px;
    margin: 1.25rem 0;
}

@media print {
    .sidebar,
    .topbar,
    .mobile-bar,
    .sidebar-overlay,
    .no-print,
    .table-scroll-hint { display: none !important; }
    .main { padding: 0; }
    .app-shell { display: block; background: white; }
    .invoice-sheet { box-shadow: none; border: none; }
}

@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2 { grid-template-columns: 1fr; }
    .ref-grid { grid-template-columns: 1fr 1fr; }
    .main { padding: 1.25rem; }
}

@media (max-width: 900px) {
    .mobile-bar {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin: -0.25rem 0 1rem;
        padding-bottom: 0.85rem;
        border-bottom: 1px solid var(--brand-border);
        position: sticky;
        top: 0;
        z-index: 25;
        background: rgba(247, 251, 252, 0.92);
        backdrop-filter: blur(8px);
    }

    .mobile-logo {
        height: 38px;
        width: auto;
        background: white;
        border-radius: 8px;
        padding: 0.25rem 0.45rem;
        border: 1px solid var(--brand-border);
    }

    .mobile-bar-spacer { flex: 1; }

    .menu-toggle {
        width: 42px;
        height: 42px;
        border: 1px solid var(--brand-border);
        border-radius: 12px;
        background: white;
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        cursor: pointer;
        box-shadow: var(--shadow-sm);
        flex-shrink: 0;
    }

    .menu-toggle span {
        display: block;
        width: 18px;
        height: 2px;
        background: var(--brand-teal);
        border-radius: 999px;
        transition: 0.2s ease;
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(45, 55, 72, 0.45);
        opacity: 0;
        visibility: hidden;
        transition: 0.2s ease;
        z-index: 40;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        height: 100dvh;
        width: min(300px, 86vw);
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        z-index: 50;
        overflow-y: auto;
    }

    .sidebar-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        right: 0;
        top: 0;
        width: 36px;
        height: 36px;
        border: 1px solid rgba(255,255,255,0.25);
        border-radius: 10px;
        background: rgba(255,255,255,0.12);
        color: white;
        cursor: pointer;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }

    .main {
        width: 100%;
        padding: 1rem 0.9rem 1.5rem;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
        margin-bottom: 1rem;
    }

    .topbar-right {
        justify-content: space-between;
        width: 100%;
    }

    .page-title p {
        font-size: 0.88rem;
        line-height: 1.45;
    }

    .user-chip {
        border-radius: 12px;
        padding: 0.55rem 0.75rem;
        flex: 1;
        min-width: 0;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .stat-card { padding: 1rem; }
    .stat-value { font-size: 1.45rem; }

    .filters {
        grid-template-columns: 1fr !important;
        padding: 0.9rem !important;
    }

    .filters .form-group .btn {
        width: 100%;
    }

    .form-row,
    .invoice-parties,
    .grid-2-equal,
    .ref-grid {
        grid-template-columns: 1fr;
    }

    .card-header {
        flex-direction: column;
        align-items: stretch;
    }

    .card-header .btn {
        width: 100%;
    }

    .table-scroll-hint { display: block; }

    table.data-table {
        min-width: 640px;
    }

    table.data-table.mobile-cards {
        min-width: 0;
        border: 0;
    }

    table.data-table.mobile-cards thead {
        display: none;
    }

    table.data-table.mobile-cards,
    table.data-table.mobile-cards tbody,
    table.data-table.mobile-cards tr,
    table.data-table.mobile-cards td {
        display: block;
        width: 100%;
    }

    table.data-table.mobile-cards tr {
        background: white;
        border: 1px solid var(--brand-border);
        border-radius: 14px;
        margin: 0 0.85rem 0.85rem;
        padding: 0.35rem 0;
        box-shadow: var(--shadow-sm);
        overflow: hidden;
    }

    table.data-table.mobile-cards tr:hover td {
        background: transparent;
    }

    table.data-table.mobile-cards td {
        border: 0;
        border-bottom: 1px solid #eef3f5;
        padding: 0.7rem 0.95rem;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 1rem;
    }

    table.data-table.mobile-cards td:last-child {
        border-bottom: 0;
    }

    table.data-table.mobile-cards td::before {
        content: attr(data-label);
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--brand-grey);
        flex: 0 0 38%;
        padding-top: 0.15rem;
    }

    table.data-table.mobile-cards td[data-label=""] {
        display: block;
    }

    table.data-table.mobile-cards td[data-label=""]::before {
        display: none;
    }

    table.data-table.mobile-cards .actions {
        width: 100%;
    }

    table.data-table.mobile-cards .actions .btn,
    table.data-table.mobile-cards .actions form {
        flex: 1;
    }

    table.data-table.mobile-cards .actions form .btn {
        width: 100%;
    }

    .modal-backdrop {
        padding: 0.5rem;
        align-items: flex-end;
    }

    .modal {
        max-width: 100%;
        max-height: 94vh;
        max-height: 94dvh;
        border-radius: 18px 18px 12px 12px;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-actions .btn {
        width: 100%;
    }

    .calc-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .calc-total {
        flex-direction: row;
        align-items: center;
        width: 100%;
    }

    .deadline-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .invoice-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem;
    }

    .invoice-meta {
        text-align: left;
        width: 100%;
    }

    .invoice-hero img {
        max-width: 180px;
    }

    .invoice-body {
        padding: 1.15rem;
    }

    .invoice-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .invoice-total-wrap {
        justify-content: stretch;
    }

    .invoice-total {
        width: 100%;
        min-width: 0;
    }

    .invoice-footer {
        flex-direction: column;
    }

    .pagination {
        justify-content: center;
        flex-wrap: wrap;
        padding: 0.85rem;
    }

    .login-page {
        padding: 1rem;
        align-items: stretch;
    }

    .login-card {
        padding: 1.4rem 1.1rem;
        border-radius: 16px;
        margin: auto 0;
    }

    .login-logo img {
        max-width: 210px;
    }
}

@media (max-width: 900px) {
    .card:has(.mobile-cards) .table-scroll-hint {
        display: none;
    }
}

@media (max-width: 560px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 1.7rem;
    }

    .user-chip span {
        display: none;
    }

    .btn {
        min-height: 42px;
    }

    .btn-sm {
        min-height: 36px;
    }
}
