:root {
    --primary: #4f6bff;
    --primary-hover: #3b54e6;
    --primary-soft: #e8ebff;
    --accent: #8b9aff;
    --success: #059669;
    --danger: #e11d48;
    --warning: #d97706;
    --ink: #12141f;
    --ink-muted: #4b5168;
    --gray: #6b7289;
    --line: #e4e7f0;
    --surface: #ffffff;
    --canvas: #f3f4fb;
    --navy: #0e1024;
    --navy-2: #181b36;
    --white: #ffffff;
    --shadow: 0 1px 2px rgba(18, 20, 31, 0.05), 0 10px 28px rgba(18, 20, 31, 0.06);
    --shadow-lg: 0 28px 60px rgba(14, 16, 36, 0.22);
    --radius: 18px;
    --radius-sm: 12px;
    --transition: 200ms cubic-bezier(.2,.7,.2,1);
    --font: "DM Sans", "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--canvas);
    min-height: 100vh;
    color: var(--ink);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; font-weight: 600; }
a:hover { color: var(--primary-hover); }

/* ========== Brand ========== */
.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    letter-spacing: -0.05em;
    font-size: 13px;
    background: linear-gradient(145deg, #8b9aff 0%, #4f6bff 55%, #6d28d9 100%);
    color: #fff;
    box-shadow: 0 10px 24px rgba(79, 107, 255, 0.38), inset 0 1px 0 rgba(255,255,255,0.28);
}

.brand-mark.sm { width: 34px; height: 34px; font-size: 10px; border-radius: 10px; box-shadow: 0 6px 14px rgba(79, 107, 255, 0.35); }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; letter-spacing: -0.03em; color: #fff; }
.brand-text span { font-size: 11px; color: #94a3b8; font-weight: 500; }

/* ========== Auth ========== */
html:has(body.page-auth) {
    height: 100%;
    overflow: hidden;
}

.page-auth {
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(900px 480px at 12% -10%, rgba(79, 107, 255, 0.38), transparent 55%),
        radial-gradient(700px 420px at 100% 110%, rgba(109, 40, 217, 0.28), transparent 50%),
        linear-gradient(165deg, #0e1024 0%, #161936 100%);
}

.auth-shell {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.auth-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at 50% 30%, #000 10%, transparent 72%);
    pointer-events: none;
}

.auth-top {
    position: relative;
    z-index: 1;
    padding: 24px 32px 0;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-lockup .name { font-weight: 750; color: #fff; letter-spacing: -0.03em; font-size: 16px; }
.brand-lockup .tag { color: #94a3b8; font-size: 12px; }

.auth-center {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 20px 40px;
}

.auth-lead {
    text-align: center;
    color: #cbd5e1;
    margin-bottom: 22px;
    max-width: 480px;
}

.auth-lead h2 {
    color: #fff;
    font-size: 34px;
    letter-spacing: -0.045em;
    line-height: 1.1;
    margin-bottom: 8px;
}

.auth-lead p { color: #94a3b8; }

.auth-highlights {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
    justify-content: center;
}

.auth-highlights div,
.auth-brand-meta div {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 10px 14px;
    color: #94a3b8;
    font-size: 12px;
    min-width: 92px;
    text-align: center;
}

.auth-highlights strong,
.auth-brand-meta strong {
    display: block;
    color: #fff;
    font-size: 14px;
    letter-spacing: -0.03em;
    margin-bottom: 2px;
}

.auth-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.auth-shell.home-split {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    height: 100%;
    overflow: hidden;
}

.auth-shell.home-split::before {
    mask-image: radial-gradient(circle at 50% 30%, #000 18%, transparent 78%);
}

.home-align {
    position: relative;
    z-index: 1;
    width: min(1100px, calc(100% - 64px));
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 36px;
    align-items: stretch;
    margin: 0;
    max-height: calc(100vh - 40px);
}

.auth-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 22px;
    padding: 8px 0 0;
    min-height: 100%;
}

.auth-content .brand-lockup .name {
    color: #fff;
    font-size: 18px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.35);
}

.auth-content .brand-lockup .tag {
    color: #d7dcff;
    font-size: 13px;
}

.auth-content .auth-lead {
    text-align: left;
    max-width: 520px;
    margin: 0;
}

.auth-content .auth-lead h2 {
    font-size: clamp(28px, 4vw, 40px);
    max-width: 13ch;
    color: #fff;
    text-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

.auth-content .auth-lead p {
    color: #e8eaf6;
    font-size: 15px;
    line-height: 1.5;
    margin-top: 10px;
    max-width: 400px;
}

.auth-content .auth-highlights {
    justify-content: flex-start;
    margin-top: auto;
}

.auth-content .auth-highlights div {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.22);
    color: #e8eaf6;
    min-width: 96px;
    padding: 10px 12px;
    font-size: 12px;
    backdrop-filter: blur(8px);
}

.auth-content .auth-highlights strong {
    color: #fff;
    font-size: 16px;
}

.auth-shell.home-split .auth-container {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    min-height: 0;
    padding: 0;
    background: transparent;
}

.auth-box,
.auth-card {
    background: #fff;
    padding: 24px 26px 20px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    animation: rise 0.45s ease both;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: #eef0ff;
    border: 1px solid #d8dcff;
    padding: 5px 10px;
    border-radius: 999px;
}

.auth-title { font-size: 24px; font-weight: 750; letter-spacing: -0.045em; text-align: left; margin-bottom: 4px; }
.auth-subtitle { color: var(--ink-muted); text-align: left; margin-bottom: 14px; font-size: 14px; }

.auth-header { text-align: left; margin-bottom: 24px; }
.auth-header h1 { font-size: 30px; font-weight: 750; letter-spacing: -0.045em; margin-bottom: 6px; }
.auth-header p { color: var(--ink-muted); }

.form-group { margin-bottom: 10px; }
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
}
.form-grid .form-group { margin-bottom: 0; }
.form-grid .form-span {
    grid-column: 1 / -1;
}
.form-label,
.auth-form .form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 650;
    font-size: 13px;
    color: #334155;
}

.form-input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #dbe3ee;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    background: #f8fafc;
    color: var(--ink);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-input::placeholder { color: #94a3b8; }

.form-input:hover { border-color: #cbd5e1; background: #fff; }

.form-input:focus {
    outline: none;
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 107, 255, 0.16);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 22px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform var(--transition), background var(--transition), box-shadow var(--transition), border-color var(--transition);
    text-align: center;
    width: 100%;
}

.auth-box .btn { padding: 11px 18px; }
.btn-primary {
    background: linear-gradient(180deg, #6b82ff 0%, #4f6bff 100%);
    color: var(--white);
    box-shadow: 0 10px 22px rgba(79, 107, 255, 0.32);
    margin-top: 4px;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 26px rgba(79, 107, 255, 0.4); }
.btn-success { background: #059669; color: var(--white); box-shadow: 0 6px 14px rgba(5, 150, 105, 0.22); }
.btn-success:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn-danger { background: rgba(255,255,255,0.06); color: #fda4af; border: 1px solid rgba(253,164,175,0.28); }
.btn-danger:hover { background: rgba(255,241,242,0.12); }
.dashboard-content .btn-danger,
.modal-content .btn-danger {
    background: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
}
.dashboard-content .btn-danger:hover,
.modal-content .btn-danger:hover { background: #ffe4e6; }
.btn-secondary { background: rgba(255,255,255,0.08); color: #e2e8f0; border: 1px solid rgba(255,255,255,0.14); }
.btn-secondary:hover { background: rgba(255,255,255,0.14); }
.app-toolbar .btn-secondary,
.dashboard-content .btn-secondary,
.modal-content .btn-secondary {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
}
.app-toolbar .btn-secondary:hover,
.dashboard-content .btn-secondary:hover,
.modal-content .btn-secondary:hover { background: #f8fafc; }
.btn-sm { padding: 8px 14px; font-size: 13px; width: auto; border-radius: 9px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.message {
    padding: 11px 13px;
    border-radius: 11px;
    margin-bottom: 16px;
    display: none;
    font-size: 14px;
}
.message.show { display: block; }
.message.success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.message.error { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }

.error-message, .success-message {
    padding: 11px 13px;
    border-radius: 11px;
    margin-bottom: 16px;
}
.error-message { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }
.success-message { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }

.auth-footer,
.auth-links {
    text-align: left;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}
.auth-footer p,
.auth-links p { color: var(--ink-muted); font-size: 13px; margin-bottom: 4px; }
.auth-links p:last-child { margin-bottom: 0; }

.auth-extra {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    font-size: 13px;
}

/* ========== App shell ========== */
.dashboard-container,
.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 248px 1fr;
    background: var(--canvas);
}

.app-sidebar {
    background: var(--navy);
    color: #e2e8f0;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 22px;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #cbd5e1;
    font-weight: 650;
    font-size: 14px;
    border: 1px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active {
    background: rgba(79, 107, 255, 0.18);
    color: #fff;
    border-color: rgba(139, 154, 255, 0.28);
}

.sidebar-foot {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-foot .btn { width: 100%; }
.sidebar-foot .stat-card { box-shadow: none; }

.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    padding: 22px 28px 0;
}
.app-toolbar h1 { font-size: 26px; letter-spacing: -0.04em; }
.app-toolbar p { color: var(--ink-muted); font-size: 14px; margin-top: 4px; }
.toolbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.dashboard-header {
    display: none;
}
.header-brand { display: flex; align-items: center; gap: 12px; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.dashboard-content { padding: 20px 28px 32px; width: 100%; }

.profile-menu { position: relative; }
.profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    border-radius: 14px;
    padding: 8px 10px;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
    text-align: left;
}
.profile-trigger:hover,
.profile-menu.open .profile-trigger {
    background: rgba(255,255,255,0.12);
    border-color: rgba(139, 154, 255, 0.45);
}
.profile-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #8b9aff, #4f6bff);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}
.profile-trigger-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    line-height: 1.15;
}
.profile-trigger-text strong {
    font-size: 12px;
    font-weight: 700;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-trigger-text small { font-size: 10px; color: #94a3b8; font-weight: 600; }
.profile-caret { color: #94a3b8; font-size: 11px; }
.profile-dropdown {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    right: 0;
    width: auto;
    min-width: 240px;
    background: #fff;
    color: var(--ink);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid #e6edf5;
    padding: 8px;
    z-index: 40;
}
.profile-dropdown-head {
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--gray);
    padding: 8px 10px 6px;
}
.profile-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
}
.profile-row:hover { background: #f8fafc; }
.profile-row-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #eef0ff;
    border: 1px solid #d8dcff;
    flex-shrink: 0;
    font-size: 14px;
}
.profile-row .stat-label { margin-bottom: 2px; }
.profile-row .stat-value { font-size: 13px; word-break: break-all; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.stat-card {
    background: var(--surface);
    padding: 18px 18px 18px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 14px;
    overflow: hidden;
    border: 1px solid #e6edf5;
    position: relative;
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.stat-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 16px;
    bottom: 16px;
    width: 3px;
    border-radius: 99px;
    background: linear-gradient(180deg, #8b9aff, #4f6bff);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #eef0ff, #e4e8ff);
    font-size: 18px;
    border: 1px solid #d8dcff;
}

.stat-info .stat-label {
    color: var(--gray);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 750;
}
.stat-info .stat-value { font-size: 15px; font-weight: 750; letter-spacing: -0.02em; word-break: break-all; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 750;
}
.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.table-container {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid #e6edf5;
}
.table-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: linear-gradient(180deg, #fff, #fbfdff);
}
.table-header h2 { font-size: 16px; letter-spacing: -0.02em; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 13px 18px; text-align: left; border-bottom: 1px solid #eef2f7; }
.data-table th {
    background: #f8fafc;
    font-weight: 750;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-muted);
}
.data-table tr:hover { background: #f5f6ff; }
.data-table tr:last-child td { border-bottom: none; }

.action-buttons { display: flex; gap: 8px; }

.welcome-card {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(420px 180px at 92% -10%, rgba(139, 154, 255, 0.32), transparent 58%),
        radial-gradient(280px 140px at 70% 120%, rgba(109, 40, 217, 0.2), transparent 60%),
        linear-gradient(120deg, #0e1024 0%, #1a1d3d 58%, #2e1b55 100%);
    color: var(--white);
    padding: 28px 30px;
    border-radius: 20px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,0.06);
}
.welcome-card h2 { font-size: 26px; margin-bottom: 6px; letter-spacing: -0.035em; }
.welcome-card p { color: #cbd5e1; max-width: 560px; }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 17, 31, 0.66);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}
.modal-overlay.show { opacity: 1; visibility: visible; }

.modal-content {
    background: var(--white);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: rise 0.28s ease both;
}
.modal-content.wide { max-width: 1180px; }

.data-workspace {
    height: min(92vh, 860px);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f4f5fb;
}
.data-workspace-header {
    background: #fff;
    padding: 16px 20px;
    flex-shrink: 0;
}
.data-workspace-header p {
    color: var(--ink-muted);
    font-size: 13px;
    margin-top: 2px;
}
.data-workspace-actions { display: flex; align-items: center; gap: 8px; }
.data-workspace-body {
    padding: 14px 16px 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}
.data-workspace-body #dataContent,
.data-board {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    flex: 1;
    overflow: hidden;
}
.data-board .metric-strip,
.data-board .filter-bar,
.data-board .pagination-container {
    flex-shrink: 0;
}

.metric-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}
.metric-chip {
    background: #fff;
    border: 1px solid #e6edf5;
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: var(--shadow);
}
.metric-chip span {
    display: block;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 4px;
}
.metric-chip strong {
    font-size: 20px;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { font-size: 17px; letter-spacing: -0.02em; }
.modal-close { background: #f1f5f9; border: none; width: 32px; height: 32px; border-radius: 9px; font-size: 20px; color: var(--gray); cursor: pointer; }
.modal-close:hover { background: #e2e8f0; }
.modal-body { padding: 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

.filter-bar {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: #fff;
    border: 1px solid #e6edf5;
    border-radius: 14px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    flex-shrink: 0;
    padding: 7px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
}
.filter-group.grow { flex: 1; min-width: 180px; }

.filter-group label { font-size: 12px; color: var(--ink-muted); font-weight: 750; white-space: nowrap; }

.filter-select, .filter-input {
    padding: 4px 2px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    min-width: 120px;
    background: transparent;
    font-family: inherit;
    color: var(--ink);
}

.filter-input[type="date"] { min-width: 130px; }
.filter-select:focus, .filter-input:focus { outline: none; }

.sort-btn,
.clear-filter-btn {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}
.clear-filter-btn:hover { border-color: #fda4af; color: #be123c; background: #fff1f2; }

.file-input {
    width: 100%;
    padding: 20px 14px;
    border: 1.5px dashed #c7cdff;
    border-radius: 14px;
    background: #eef0ff;
}
.file-input-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-info { margin-top: 8px; font-size: 13px; color: var(--gray); }

.upload-modal { max-width: 520px; overflow: hidden; }
.upload-modal-header { align-items: flex-start; }
.upload-modal-title { display: flex; align-items: flex-start; gap: 12px; }
.upload-modal-title h2 { margin-bottom: 3px; }
.upload-modal-title p { color: var(--ink-muted); font-size: 13px; font-weight: 500; }
.upload-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #8b9aff, #4f6bff);
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 8px 16px rgba(79, 107, 255, 0.28);
}

.dropzone {
    display: block;
    border: 1.5px dashed #b7bfff;
    border-radius: 16px;
    background: linear-gradient(180deg, #f7f8ff 0%, #eef0ff 100%);
    padding: 22px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.dropzone:hover,
.dropzone.dragover {
    border-color: var(--primary);
    background: #eef0ff;
    box-shadow: 0 0 0 4px rgba(79, 107, 255, 0.12);
}
.dropzone.has-file {
    border-style: solid;
    border-color: #a7f3d0;
    background: #f0fdf4;
    text-align: left;
}
.dropzone-idle { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink-muted); font-size: 13px; }
.dropzone-idle strong { color: var(--ink); font-size: 15px; }
.dropzone-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #fff;
    border: 1px solid #d8dcff;
    margin-bottom: 6px;
    font-size: 20px;
}
.dropzone-file { display: none; font-size: 13px; color: #065f46; font-weight: 650; }
.dropzone.has-file .dropzone-idle { display: none; }
.dropzone.has-file .dropzone-file { display: block; }

.column-info { margin-top: 4px; padding: 12px 14px; background: #f8fafc; border-radius: 12px; font-size: 13px; color: var(--ink-muted); }
.column-info strong { display: block; color: var(--ink); margin-bottom: 8px; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.column-info p { margin-top: 8px; font-size: 12px; }
.column-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.column-chips span {
    background: #eef0ff;
    color: #3730a3;
    border: 1px solid #d8dcff;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
}

.loading { text-align: center; padding: 52px 24px; color: var(--gray); }
.spinner {
    display: inline-block;
    width: 34px;
    height: 34px;
    border: 3px solid #d8dcff;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.no-data { text-align: center; padding: 52px 24px; color: var(--gray); }

.excel-table-wrapper {
    overflow: auto;
    background: #fff;
    border: 1px solid #e6edf5;
    border-radius: 14px;
    min-height: 180px;
    flex: 1 1 auto;
}
.data-board .excel-table-wrapper {
    min-height: 0;
}
.excel-table { width: 100%; border-collapse: collapse; font-size: 13px; border: none; }
.excel-table th, .excel-table td {
    padding: 11px 14px;
    text-align: left;
    border: none;
    border-bottom: 1px solid #eef2f7;
    white-space: nowrap;
}
.excel-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8f9ff;
    color: #4b5168;
    font-weight: 750;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.045em;
    border-bottom: 1px solid #e4e7f0;
}
.excel-table th.num,
.excel-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.excel-table td.num { font-weight: 650; }
.excel-table tr:nth-child(even) { background: #fbfcff; }
.excel-table tr:hover { background: #eef0ff; }
.excel-table thead tr.totals-row td {
    background: #e8ebff;
    border-bottom: 1px solid #c7cdff;
    font-weight: 750;
    color: #312e81;
}
.data-info { padding: 0; text-align: left; font-size: 13px; color: var(--gray); }

.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 4px 0;
    background: transparent;
    border-top: none;
    flex-wrap: wrap;
    gap: 10px;
}

.pagination { display: flex; align-items: center; gap: 4px; }

.page-btn {
    min-width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    border-radius: 9px;
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover:not(:disabled) {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.page-btn.active {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}

.page-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.page-dots { padding: 0 8px; color: var(--gray); }
.page-info { padding: 0 12px; color: var(--gray); font-size: 13px; }

@media (max-width: 900px) {
    .page-auth, .auth-shell { height: auto; max-height: none; overflow: auto; }
    .auth-lead h2 { font-size: 26px; }
    .auth-box, .auth-card { padding: 22px 18px 18px; }
    .auth-highlights { display: none; }
    .auth-shell.home-split { display: flex; height: auto; }
    .home-align { grid-template-columns: 1fr; width: min(420px, calc(100% - 32px)); gap: 16px; max-height: none; margin: 20px 0; }
    .form-grid { grid-template-columns: 1fr; }
    .auth-content { padding: 0; align-items: flex-start; min-height: 0; }
    .auth-content .auth-lead { text-align: left; margin: 0; }
    .auth-content .auth-lead h2 { font-size: 28px; max-width: none; }
    .auth-shell.home-split .auth-container {
        min-height: auto;
        padding: 0 0 36px;
        justify-content: flex-start;
        background: transparent;
    }
}

@media (max-width: 860px) {
    .dashboard-container,
    .app-shell { grid-template-columns: 1fr; }
    .app-sidebar {
        position: sticky;
        top: 0;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
        padding: 12px 14px;
        z-index: 30;
    }
    .sidebar-brand { padding: 0; }
    .sidebar-nav { flex-direction: row; }
    .sidebar-foot {
        margin-top: 0;
        margin-left: auto;
        flex-direction: row;
        border-top: none;
        padding-top: 0;
        align-items: center;
    }
    .profile-dropdown { bottom: auto; top: calc(100% + 8px); left: auto; right: 0; width: 280px; }
    .app-toolbar, .dashboard-content { padding-left: 16px; padding-right: 16px; }
    .app-toolbar { flex-direction: column; align-items: stretch; }
}

@media (max-width: 768px) {
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-group { width: 100%; }
    .filter-select, .filter-input { flex: 1; min-width: 0; }
}
