:root {
    --bg-1: #eef1ff;
    --bg-2: #f5efff;
    --panel: rgba(255, 255, 255, 0.76);
    --panel-border: rgba(126, 138, 189, 0.25);
    --text: #2b2f3a;
    --muted: #6f768a;
    --accent: #6c7bff;
    --accent-strong: #5666f6;
    --accent-soft: rgba(108, 123, 255, 0.18);
    --mint: #77d3a6;
    --danger: #e76f6f;
    --shadow: 0 18px 40px rgba(30, 41, 82, 0.16);
    --radius-xl: 22px;
    --radius-lg: 16px;
    --radius-pill: 999px;
    /* Responsive layout scale */
    --container-max: clamp(980px, 90vw, 1280px);
    --gutter: clamp(14px, 3vw, 28px);
    --page-top: clamp(16px, 2.6vw, 28px);
    --page-bottom: clamp(44px, 6vw, 72px);
    --card-pad: clamp(16px, 2.2vw, 26px);
    --section-gap: clamp(16px, 2.4vw, 28px);
    --shadow-soft: 0 12px 28px rgba(30, 41, 82, 0.14);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Plus Jakarta Sans", "Segoe UI", Tahoma, sans-serif;
    color: var(--text);
    background: linear-gradient(160deg, var(--bg-1), var(--bg-2));
    min-height: 100vh;
    font-size: clamp(15px, 0.35vw + 14px, 17px);
}

body::before,
body::after {
    content: "";
    position: fixed;
    width: 420px;
    height: 420px;
    z-index: 0;
    background: radial-gradient(circle at top, rgba(108, 123, 255, 0.25), transparent 70%);
    filter: blur(10px);
}

body::before {
    top: -140px;
    left: -140px;
}

body::after {
    bottom: -180px;
    right: -140px;
    background: radial-gradient(circle at center, rgba(119, 211, 166, 0.22), transparent 70%);
}

h1,
h2,
h3,
h4 {
    font-family: "Sora", "Plus Jakarta Sans", sans-serif;
    margin: 0 0 8px;
}

p {
    margin: 0;
}

a {
    color: inherit;
}

.page {
    position: relative;
    z-index: 1;
    padding: var(--page-top) var(--gutter) var(--page-bottom);
}

.topbar {
    position: sticky;
    top: 16px;
    z-index: 5;
}

/* NAVBAR DESKTOP */

.nav-shell {
    max-width: 1120px;              /* lock nav width on big screens[web:26][web:47] */
    width: 100%;
    margin: 0 auto;
    padding: clamp(10px, 1.5vw, 14px) clamp(14px, 2vw, 20px);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: clamp(12px, 2vw, 20px);
    backdrop-filter: blur(22px) saturate(1.25);
    -webkit-backdrop-filter: blur(22px) saturate(1.25);
}

.brand {
    font-weight: 700;
    font-size: 1.02rem;
    letter-spacing: 0.3px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.brand-accent {
    color: var(--accent-strong);
}

.nav-links {
    display: flex;
    gap: clamp(8px, 1.5vw, 12px);
    flex: 1;
    justify-content: center;
    flex-wrap: nowrap;          /* single row */
    min-width: 0;
    overflow: hidden;
}

.nav-links a {
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: clamp(0.9rem, 0.2vw + 0.82rem, 0.95rem);
    color: var(--muted);
    transition: all 0.2s ease;
    white-space: nowrap;
    flex: 0 1 auto;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.nav-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nav-toggle-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.nav-toggle-btn {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.7);
    box-shadow: var(--shadow);
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
}

.nav-toggle-btn span {
    display: block;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: var(--muted);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.6);
    padding: 6px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--panel-border);
}

.nav-user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-menu {
    position: relative;
}

.profile-menu summary {
    list-style: none;
    cursor: pointer;
}

.profile-menu summary::-webkit-details-marker {
    display: none;
}

.profile-menu .chevron {
    display: none;
}

.profile-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 140px;
    padding: 8px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow);
}

.profile-menu[open] .profile-dropdown {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

@media (min-width: 769px) {
    .profile-dropdown {
        display: none !important;
    }
}

.logout-inline {
    display: inline-flex;
}

.nav-auth {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-auth .btn {
    white-space: nowrap;
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6c7bff, #8fd3ff);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    color: #fff;
    font-weight: 700;
}

.chevron {
    font-size: 0.8rem;
    color: var(--muted);
}

.page-content {
    margin-top: 32px;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
}

/* HERO */

.hero {
    margin-top: 12px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: clamp(20px, 3vw, 36px);
    align-items: center;
}

.hero-copy {
    max-width: 520px;
}

.hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-strong);
    margin-bottom: 8px;
}

.hero-title {
    font-size: clamp(2rem, 3vw, 3rem);
    margin-bottom: 12px;
}

.hero-subtitle {
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 20px;
}

.hero-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-preview {
    padding: 22px;
    min-height: 320px;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.preview-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-lg);
    background: rgba(108, 123, 255, 0.08);
    border: 1px solid var(--panel-border);
    margin-bottom: 12px;
}

.preview-table {
    display: grid;
    gap: 8px;
}

.preview-row {
    display: grid;
    grid-template-columns: 1.1fr 1.4fr 1fr 0.8fr;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(168, 176, 212, 0.35);
    font-size: 0.85rem;
    color: var(--muted);
}

.preview-row span:last-child {
    text-align: right;
    font-weight: 600;
    color: var(--text);
}

/* CHIPS */

.feature-row {
    margin-top: 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.feature-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--panel-border);
    color: var(--muted);
    font-weight: 600;
}

.feature-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: rgba(108, 123, 255, 0.2);
    color: var(--accent-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

/* PANELS / FORMS / AUTH */

.page-center {
    display: flex;
    justify-content: center;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-xl);
    padding: var(--card-pad);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    animation: rise 0.6s ease both;
}

.form-panel {
    width: min(520px, 100%);
}

.auth-shell {
    display: flex;
    justify-content: center;
    padding: 12px 0 24px;
}

.auth-card {
    width: min(460px, 100%);
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    padding: var(--card-pad);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    animation: rise 0.6s ease both;
}

.auth-tabs {
    display: flex;
    width: fit-content;
    gap: 8px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--panel-border);
    padding: 6px;
    border-radius: var(--radius-pill);
    margin: 0 auto 18px;
}

.auth-tab {
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--muted);
    padding: 6px 18px;
    border-radius: var(--radius-pill);
    transition: all 0.2s ease;
}

.auth-tab.active {
    color: #fff;
    background: linear-gradient(135deg, #7f8bff, #9bb0ff);
    box-shadow: 0 10px 18px rgba(108, 123, 255, 0.25);
}

.auth-title {
    text-align: center;
    margin-bottom: 6px;
}

.auth-subtitle {
    text-align: center;
    color: var(--muted);
    margin-bottom: 18px;
}

.auth-footer {
    text-align: center;
    color: var(--muted);
    margin-top: 12px;
}

/* HEADERS / FILTERS */

.panel-header {
    margin-bottom: clamp(14px, 2vw, 18px);
}

.panel-subtitle {
    color: var(--muted);
    font-size: 0.95rem;
}

.muted {
    color: var(--muted);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(14px, 2vw, 20px);
    margin-bottom: clamp(18px, 2.6vw, 24px);
}

.page-header.centered {
    justify-content: center;
    text-align: center;
}

.total-pill {
    background: rgba(255, 255, 255, 0.6);
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--panel-border);
    font-weight: 600;
}

.form-grid {
    display: grid;
    gap: 12px;
}

label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

input,
select {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(168, 176, 212, 0.6);
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108, 123, 255, 0.2);
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* BUTTONS */

.btn {
    border: none;
    cursor: pointer;
    padding: 12px 18px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #6c7bff, #8f9dff);
    color: #fff;
    box-shadow: 0 10px 20px rgba(108, 123, 255, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.75);
    color: var(--text);
    border: 1px solid var(--panel-border);
}

.btn-danger {
    background: #f27b7b;
    color: #fff;
}

.btn-ghost {
    background: rgba(108, 123, 255, 0.12);
    color: var(--accent-strong);
    border: 1px solid rgba(108, 123, 255, 0.3);
    padding: 10px 16px;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
}

/* FILTER BAR */

.filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(12px, 2vw, 18px);
    flex-wrap: wrap;
    margin-bottom: clamp(18px, 2.6vw, 24px);
}

.filter-group {
    display: flex;
    gap: clamp(8px, 1.6vw, 12px);
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--panel-border);
    transition: all 0.2s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent-soft);
    color: var(--accent-strong);
    border-color: rgba(108, 123, 255, 0.4);
}

.custom-filter {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.8vw, 12px);
    flex-wrap: wrap;
    margin-left: auto;
}

.custom-filter--inline {
    flex-wrap: nowrap;
}

.date-field {
    display: flex;
    align-items: center;
    gap: 6px;
}

.custom-filter label {
    text-transform: none;
    font-size: 0.85rem;
    letter-spacing: 0;
    margin: 0;
}

.custom-filter input {
    padding: 8px 10px;
    width: clamp(140px, 12vw, 180px);
}

/* STATS / CHARTS */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--section-gap);
    margin-bottom: clamp(20px, 3vw, 28px);
}

.stat-card {
    background: rgba(255, 255, 255, 0.78);
    border-radius: var(--radius-lg);
    padding: var(--card-pad);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow);
    animation: rise 0.6s ease both;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 6px;
}

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

.stat-meta {
    font-size: 0.85rem;
    color: var(--muted);
}

.accent-card {
    background: linear-gradient(140deg, rgba(108, 123, 255, 0.18), rgba(119, 211, 166, 0.2));
}

.trend.green {
    color: #4a8f6b;
    font-weight: 600;
}

.trend.red {
    color: #d17a7a;
    font-weight: 600;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--section-gap);
}

.chart-card,
.summary-card {
    background: rgba(255, 255, 255, 0.82);
    border-radius: var(--radius-lg);
    border: 1px solid var(--panel-border);
    padding: var(--card-pad);
    box-shadow: var(--shadow);
    min-height: clamp(260px, 30vw, 360px);
    display: flex;
    flex-direction: column;
    animation: rise 0.6s ease both;
}

.chart-card canvas {
    flex: 1;
    max-height: 260px;
}

.summary-card p {
    margin-top: 12px;
    color: var(--muted);
    line-height: 1.5;
}

.full-width {
    margin-top: 24px;
    min-height: 320px;
    width: 100%;
}

.chart-card.full-width canvas {
    max-height: 300px;
}

/* INSIGHTS & TABLE */

.insight-section {
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--section-gap);
}

.insight-card {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    padding: var(--card-pad);
    box-shadow: var(--shadow);
}

.insight-card h4 {
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--muted);
}

.table-card {
    margin-top: 24px;
    padding: var(--card-pad);
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(0.88rem, 0.3vw + 0.8rem, 0.98rem);
}

.table thead {
    background: rgba(108, 123, 255, 0.08);
}

.table th,
.table td {
    padding: 12px 10px;
    text-align: left;
}

.table tbody tr {
    border-bottom: 1px solid rgba(168, 176, 212, 0.3);
}

.table tbody tr:hover {
    background: rgba(108, 123, 255, 0.06);
}

.row-actions {
    display: flex;
    gap: 8px;
}

/* MISC */

.text-link {
    color: var(--accent-strong);
    text-decoration: none;
    font-weight: 600;
}

.text-link.danger {
    color: var(--danger);
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: rgba(108, 123, 255, 0.12);
    color: var(--accent-strong);
    font-size: 0.82rem;
    font-weight: 600;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(108, 123, 255, 0.25);
    background: rgba(108, 123, 255, 0.08);
    color: var(--accent-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.icon-btn svg {
    width: 16px;
    height: 16px;
}

.icon-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(108, 123, 255, 0.2);
}

.icon-btn.danger {
    border-color: rgba(231, 111, 111, 0.4);
    background: rgba(231, 111, 111, 0.15);
    color: #d65d5d;
}

.flash-container {
    margin-bottom: 16px;
}

.flash {
    padding: 10px 14px;
    border-radius: var(--radius-lg);
    margin-bottom: 10px;
    font-weight: 600;
}

.flash-success {
    background: rgba(119, 211, 166, 0.2);
    color: #3f7e5f;
}

.flash-warning {
    background: rgba(245, 185, 113, 0.22);
    color: #9a6b2d;
}

.flash-danger,
.flash-error {
    background: rgba(231, 111, 111, 0.2);
    color: #b65a5a;
}

.category-form {
    display: grid;
    gap: 12px;
}

.category-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.category-row input {
    flex: 1;
    min-width: 220px;
}

.reassign-info {
    background: rgba(108, 123, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 12px;
    margin-bottom: 16px;
    color: var(--muted);
}

/* ANIMATION */

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RESPONSIVE BREAKPOINTS */

/* Tablet and below (<= 900px) */
@media (max-width: 900px) {
    :root {
        --container-max: 100%;
    }

    .page {
        padding: 16px 14px var(--page-bottom);
    }

    .nav-shell {
        max-width: 100%;
        gap: 12px;
        padding: 10px 14px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-preview {
        order: 2;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .row-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .custom-filter--inline {
        flex-wrap: wrap;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .chart-grid {
        grid-template-columns: 1fr;
    }
}

/* Medium screens (<= 1080px) */
@media (max-width: 1080px) {
    .nav-shell {
        gap: 10px;
        padding: 8px 12px;
    }

    .brand {
        font-size: 0.95rem;
        gap: 4px;
    }

    .nav-links {
        gap: 6px;
        justify-content: center;
    }

    .nav-links a {
        padding: 6px 10px;
        font-size: 0.82rem;
    }

    .nav-actions {
        gap: 8px;
    }

    .nav-user {
        padding: 4px 8px;
        gap: 6px;
    }

    .nav-user-name {
        font-size: 0.82rem;
        max-width: 120px;
    }

    .avatar {
        width: 26px;
        height: 26px;
        font-size: 0.68rem;
    }

    .nav-auth .btn {
        padding: 6px 10px;
        font-size: 0.82rem;
    }
}

/* Mobile layout (<= 768px) */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .page {
        padding: 16px 14px 44px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .preview-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 6px;
    }

    .preview-row span:last-child {
        text-align: left;
    }

    /* Compact 2-row nav */
    .nav-shell {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        row-gap: 6px;
        column-gap: 10px;
        padding: 10px 12px 6px;
        border-radius: 18px;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.6));
        border: 1px solid rgba(255, 255, 255, 0.5);
        box-shadow: 0 12px 28px rgba(30, 41, 82, 0.18);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .brand {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
    }

    .nav-actions {
        grid-column: 2;
        grid-row: 1;
        margin-left: 0;
        justify-self: end;
        gap: 8px;
    }

    .nav-toggle-btn {
        display: none;
    }

    .nav-user {
        max-width: 100%;
        padding: 4px 6px;
        gap: 6px;
    }

    .nav-user .avatar {
        width: 26px;
        height: 26px;
        font-size: 0.68rem;
    }

    .nav-user-name {
        display: none;
    }

    .profile-menu .chevron {
        display: inline;
    }

    .logout-inline {
        display: none;
    }

    .nav-auth .btn {
        padding: 6px 10px;
        font-size: 0.82rem;
        min-width: 78px;
        text-align: center;
    }

    .nav-links {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        align-items: center;
        padding: 6px 2px 4px;
        gap: 8px;
        border-top: 1px solid var(--panel-border);
    }

    .nav-links a {
        font-size: 0.88rem;
        padding: 8px 12px;
        white-space: nowrap;
    }

    .nav-links::-webkit-scrollbar {
        height: 0;
    }

    /* Filters */
    .filters {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .filter-group {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .filter-btn {
        padding: 6px 10px;
        font-size: 0.82rem;
        border-radius: 14px;
        white-space: nowrap;
    }

    .custom-filter {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
        gap: 8px;
        flex-wrap: wrap;
    }

    .date-field {
        flex: 1 1 140px;
    }

    .custom-filter input {
        width: 100%;
        padding: 8px 10px;
    }

    .custom-filter--inline {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .custom-filter--inline .date-field {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .custom-filter--inline .btn {
        grid-column: 1 / -1;
        justify-self: start;
    }

    /* Auth */
    .auth-tabs {
        width: 100%;
    }

    .auth-tab {
        flex: 1;
        text-align: center;
        white-space: nowrap;
    }

    /* Charts & cards */
    .chart-card,
    .summary-card {
        min-height: 260px;
        animation-duration: 0.35s;
    }

    .chart-card canvas {
        width: 100% !important;
        max-height: 220px;
    }

    .full-width {
        min-height: 280px;
    }

    /* Table -> cards */
    .table thead {
        display: none;
    }

    .table,
    .table tbody,
    .table tr,
    .table td {
        display: block;
        width: 100%;
    }

    .table tr {
        background: rgba(255, 255, 255, 0.82);
        border: 1px solid var(--panel-border);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow);
        padding: 10px 12px;
        margin-bottom: 12px;
    }

    .table tbody tr:hover {
        background: rgba(255, 255, 255, 0.9);
    }

    .table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 4px;
    }

    .table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--muted);
        margin-right: 12px;
    }

    .row-actions {
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .form-panel {
        width: 100%;
    }

    input,
    select,
    button,
    .btn {
        font-size: 16px;
    }

    .panel,
    .stat-card,
    .chart-card,
    .summary-card,
    .insight-card {
        padding: 18px;
        box-shadow: 0 10px 24px rgba(30, 41, 82, 0.14);
    }
}

/* Small mobile (<= 480px) */
@media (max-width: 480px) {
    .page {
        padding: 14px 12px 40px;
    }

    .nav-shell {
        padding: 8px 10px 6px;
    }

    .nav-links a {
        font-size: 0.85rem;
    }

    .filter-btn {
        font-size: 0.78rem;
        padding: 6px 8px;
    }

    .custom-filter--inline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .custom-filter--inline .date-field label {
        font-size: 0.8rem;
    }

    .panel,
    .stat-card,
    .chart-card,
    .summary-card,
    .insight-card,
    .auth-card {
        padding: 16px;
        box-shadow: 0 8px 18px rgba(30, 41, 82, 0.12);
    }
}

/* Extra: ensure desktop nav stays centered */
@media (min-width: 1024px) {
    .nav-actions {
        margin-left: auto;
        flex-shrink: 0;
    }

    .nav-links {
        justify-content: center;
    }
}
