:root {
    --bg: #eef2f8;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e2e8f0;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #1d4ed8;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --accent: #0ea5e9;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --violet: #7c3aed;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.1);
    --radius: 14px;
    --sidebar-width: 272px;
    --sidebar-collapsed-width: 76px;
    --cell-width: 140px;
    --header-height: 42px;
    --sidebar-bg: #0c1222;
    --sidebar-border: rgba(255, 255, 255, 0.06);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'DM Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.app-shell { display: flex; min-height: 100vh; }

/* ─── Sidebar ─── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    border-right: 1px solid var(--sidebar-border);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    transition: width 0.25s ease;
    overflow: hidden;
}
.sidebar.is-collapsed { width: var(--sidebar-collapsed-width); }

.sidebar-toggle {
    position: absolute;
    top: 22px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--sidebar-border);
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    cursor: pointer;
    display: grid;
    place-items: center;
    z-index: 10;
    transition: all 0.2s;
}
.sidebar-toggle:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.sidebar.is-collapsed .sidebar-toggle { right: 50%; transform: translateX(50%); top: 18px; }

.brand-text { overflow: hidden; white-space: nowrap; transition: opacity 0.2s; }
.sidebar.is-collapsed .brand-text,
.sidebar.is-collapsed .nav-section-label,
.sidebar.is-collapsed .nav-label,
.sidebar.is-collapsed .user-meta,
.sidebar.is-collapsed .btn-signout .nav-label { opacity: 0; width: 0; overflow: hidden; }
.sidebar.is-collapsed .brand { justify-content: center; margin-bottom: 24px; }
.sidebar.is-collapsed .nav-link { justify-content: center; padding: 11px; }
.sidebar.is-collapsed .user-card { justify-content: center; padding: 10px; }
.sidebar.is-collapsed .btn-signout { justify-content: center; padding: 10px; }
.sidebar.is-collapsed .sidebar-top { padding: 56px 10px 16px; }
.sidebar.is-collapsed .sidebar-footer { padding: 14px 10px; }
.sidebar-top { padding: 28px 20px 20px; }
.sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #0ea5e9, #f59e0b);
}

.brand {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 32px;
    padding: 0 4px;
}
.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #0ea5e9 100%);
    display: grid;
    place-items: center;
    color: #fff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
    flex-shrink: 0;
}
.brand-title {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.brand-sub {
    color: #64748b;
    font-size: 0.78rem;
    margin-top: 2px;
}

.nav-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #475569;
    padding: 0 12px;
    margin-bottom: 10px;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #94a3b8;
    text-decoration: none;
    padding: 11px 14px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    position: relative;
}
.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.06);
}
.nav-link.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(14, 165, 233, 0.12));
    color: #fff;
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.15);
}
.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: linear-gradient(180deg, #3b82f6, #0ea5e9);
    border-radius: 0 3px 3px 0;
    margin-left: -1px;
}

.nav-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    transition: background 0.2s;
}
.nav-icon-dashboard { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.nav-icon-register { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.nav-icon-users { background: rgba(167, 139, 250, 0.15); color: #a78bfa; }
.nav-link.active .nav-icon-dashboard { background: rgba(59, 130, 246, 0.3); color: #93c5fd; }
.nav-link.active .nav-icon-register { background: rgba(16, 185, 129, 0.3); color: #6ee7b7; }
.nav-link.active .nav-icon-users { background: rgba(167, 139, 250, 0.3); color: #c4b5fd; }

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--sidebar-border);
    background: rgba(0, 0, 0, 0.2);
}

.user-card {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    border: 1px solid var(--sidebar-border);
}
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: linear-gradient(135deg, #334155, #1e293b);
    border: 2px solid rgba(59, 130, 246, 0.4);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: #93c5fd;
    flex-shrink: 0;
}
.user-meta { min-width: 0; }
.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role-badge {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-signout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-signout:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* ─── Main content ─── */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 28px 32px;
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    transition: margin-left 0.25s ease, width 0.25s ease;
}
body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}
.page-title { font-size: 1.75rem; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.02em; }
.page-subtitle { color: var(--muted); margin: 0; font-size: 0.95rem; }

/* ─── Dashboard hero ─── */
.dashboard-hero {
    position: relative;
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 45%, #0ea5e9 100%);
    border-radius: 20px;
    padding: 36px 40px;
    margin-bottom: 28px;
    overflow: hidden;
    color: #fff;
    box-shadow: 0 20px 50px rgba(29, 78, 216, 0.3);
}
.dashboard-hero-content { position: relative; z-index: 2; max-width: 560px; }
.dashboard-eyebrow {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.75);
    margin: 0 0 8px;
}
.dashboard-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 10px;
    letter-spacing: -0.03em;
    line-height: 1.2;
}
.dashboard-lead {
    margin: 0 0 24px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    line-height: 1.6;
}
.dashboard-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.dashboard-hero-graphic {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 45%;
    pointer-events: none;
}
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.5;
}
.hero-orb-1 { width: 200px; height: 200px; background: #f59e0b; right: 60px; top: -40px; }
.hero-orb-2 { width: 160px; height: 160px; background: #a78bfa; right: 180px; bottom: -30px; }
.hero-orb-3 { width: 120px; height: 120px; background: #34d399; right: 20px; bottom: 30px; opacity: 0.35; }

/* ─── Stat cards (colored) ─── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}
.stat-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border-radius: 16px;
    padding: 22px;
    border: 1px solid transparent;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.stat-card-body { min-width: 0; }
.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.75;
}
.stat-value {
    font-size: 1.65rem;
    font-weight: 700;
    margin-top: 4px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.stat-value-sm { font-size: 1.15rem; }

.stat-card-blue {
    background: linear-gradient(145deg, #eff6ff, #dbeafe);
    border-color: #bfdbfe;
    color: #1e40af;
}
.stat-card-blue .stat-card-icon { background: #2563eb; color: #fff; }

.stat-card-emerald {
    background: linear-gradient(145deg, #ecfdf5, #d1fae5);
    border-color: #a7f3d0;
    color: #065f46;
}
.stat-card-emerald .stat-card-icon { background: #059669; color: #fff; }

.stat-card-violet {
    background: linear-gradient(145deg, #f5f3ff, #ede9fe);
    border-color: #ddd6fe;
    color: #5b21b6;
}
.stat-card-violet .stat-card-icon { background: #7c3aed; color: #fff; }

.stat-card-amber {
    background: linear-gradient(145deg, #fffbeb, #fef3c7);
    border-color: #fde68a;
    color: #92400e;
}
.stat-card-amber .stat-card-icon { background: #d97706; color: #fff; }

/* ─── Dashboard grid ─── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
    align-items: start;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-accent { border-top: 3px solid #2563eb; }
.card-body { padding: 24px; }

.card-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.card-heading h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}
.card-heading-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
}
.card-heading-icon-blue { background: #dbeafe; color: #2563eb; }

.steps-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}
.steps-list li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    color: #475569;
    line-height: 1.55;
    font-size: 0.94rem;
}
.step-num {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.steps-list code {
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    color: #1e40af;
}

.quick-actions { display: grid; gap: 12px; }
.quick-action {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 14px;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow);
}
.quick-action:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-lg);
}
.quick-action-icon {
    width: 50px;
    height: 50px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.quick-action-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 3px; }
.quick-action-desc { font-size: 0.82rem; opacity: 0.8; }

.quick-action-primary {
    background: linear-gradient(135deg, #eff6ff, #fff);
    border-color: #bfdbfe;
    color: #1e40af;
}
.quick-action-primary .quick-action-icon { background: #2563eb; color: #fff; }

.quick-action-success {
    background: linear-gradient(135deg, #ecfdf5, #fff);
    border-color: #a7f3d0;
    color: #065f46;
}
.quick-action-success .quick-action-icon { background: #059669; color: #fff; }

.quick-action-violet {
    background: linear-gradient(135deg, #f5f3ff, #fff);
    border-color: #ddd6fe;
    color: #5b21b6;
}
.quick-action-violet .quick-action-icon { background: #7c3aed; color: #fff; }

/* ─── Buttons ─── */
.btn {
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: .2s;
    text-decoration: none;
}
.btn-lg { padding: 13px 22px; font-size: 0.95rem; border-radius: 12px; }
.btn-sm { padding: 7px 12px; font-size: 0.86rem; }
.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(29, 78, 216, 0.35);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.dashboard-hero .btn-primary {
    background: #fff;
    color: #1d4ed8;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.dashboard-hero .btn-primary:hover { background: #f8fafc; }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: #f59e0b; color: #1f2937; }
.btn-ghost { background: transparent; color: #cbd5e1; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.toolbar {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.search-box {
    flex: 1; min-width: 220px; max-width: 360px;
    display: flex; align-items: center; gap: 8px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 10px; padding: 8px 12px;
}
.search-box input {
    border: none; background: transparent; outline: none; width: 100%;
    font: inherit;
}
.toolbar-hint {
    color: var(--muted); font-size: 0.9rem; margin: 0;
}

.register-wrap { display: grid; grid-template-columns: 280px 1fr; gap: 16px; }
.panel {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
}
.panel-header {
    padding: 14px 16px; border-bottom: 1px solid var(--border);
    font-weight: 600; background: var(--surface-2);
}
.panel-body { padding: 14px 16px; max-height: calc(100vh - 280px); overflow: auto; }

.lock-list { display: grid; gap: 8px; }
.lock-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border: 1px dashed var(--border);
    border-radius: 8px; background: #fff; cursor: grab;
}
.lock-item.locked { border-style: solid; background: #eff6ff; }
.lock-item.drag-over { border-color: var(--primary); }
.lock-toggle {
    width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border);
    background: #fff; cursor: pointer;
}
.lock-toggle.active { background: #dbeafe; color: var(--primary); }

.grid-shell {
    position: relative;
    height: calc(100vh - 250px);
    min-height: 480px;
    overflow: hidden;
    border-top: 1px solid var(--border);
}
.grid-scroll {
    width: 100%; height: 100%;
    overflow: auto;
    position: relative;
}
.grid-table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: max-content;
    font-size: 0.82rem;
}
.grid-table th, .grid-table td {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 0;
    min-width: var(--cell-width);
    max-width: var(--cell-width);
    height: 36px;
    background: #fff;
    vertical-align: middle;
}
.grid-table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f1f5f9;
    font-weight: 600;
    box-shadow: 0 1px 0 var(--border);
}
.th-inner, .td-inner {
    padding: 8px 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.th-inner .col-letter {
    display: block; font-size: 0.68rem; color: var(--muted); font-weight: 500;
}
.th-inner .col-label {
    display: block;
    font-size: 0.78rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.grid-table tbody tr.data-row {
    cursor: pointer;
    transition: background 0.15s ease;
}
.empty-grid-cell {
    padding: 48px 20px !important;
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
    max-width: none !important;
    min-width: 100% !important;
}
.grid-table tbody tr.data-row:not(.selected):hover td {
    background: #f8fafc;
}
.grid-table tbody tr.data-row.selected td {
    background: #dbeafe !important;
    box-shadow: inset 0 0 0 2px #3b82f6;
    font-weight: 700;
}
.grid-table td.calc-col { background: #f0fdf4; }
.grid-table th.calc-col { background: #dcfce7; z-index: 11; }
.grid-table tbody tr.data-row.selected td.calc-col {
    background: #bfdbfe !important;
}
.grid-table tfoot tr.totals-row td {
    background: #f8fafc;
    font-weight: 700;
    border-top: 2px solid #94a3b8;
}
.grid-table tfoot tr.totals-row td.calc-col {
    background: #dcfce7;
}
.grid-table tfoot .footer-cell {
    color: #14532d;
}

.badge {
    display: inline-flex; padding: 4px 10px; border-radius: 999px;
    font-size: 0.75rem; font-weight: 600;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-muted { background: #e2e8f0; color: #475569; }

/* ─── Blocking overlay ─── */
[x-cloak] { display: none !important; }

.blocking-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    cursor: wait;
}
.blocking-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px 48px;
    text-align: center;
    min-width: 320px;
    max-width: 420px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}
.blocking-spinner {
    width: 52px;
    height: 52px;
    border: 4px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 0.8s linear infinite;
}
.blocking-title { margin: 0 0 8px; font-size: 1.25rem; font-weight: 700; color: #0f172a; }
.blocking-phase { margin: 0 0 6px; color: #334155; font-size: 0.88rem; font-weight: 600; }
.blocking-stats {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 700;
}
.blocking-stats-count { color: #2563eb; }
.blocking-stats-sep { color: #94a3b8; margin: 0 4px; font-weight: 500; }
.blocking-message { margin: 0 0 16px; color: #64748b; font-size: 0.92rem; }
.blocking-progress-track {
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
}
.blocking-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #0ea5e9);
    border-radius: 999px;
    transition: width 0.4s ease;
}
.blocking-percent { font-weight: 800; color: #2563eb; font-size: 2rem; margin: 4px 0 12px; line-height: 1; }
.blocking-percent-label { font-size: 0.78rem; color: #94a3b8; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.blocking-hint { margin: 12px 0 0; font-size: 0.78rem; color: #94a3b8; }
.blocking-stop { margin-top: 16px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Register full width + column locks in header ─── */
.register-full { padding: 0 0 0 0; }
.register-full .grid-shell {
    height: calc(100vh - 280px);
    min-height: 500px;
}
.register-wrap { display: grid; grid-template-columns: 280px 1fr; gap: 16px; }

.th-inner-lockable {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 6px 8px !important;
}
.th-label-wrap { flex: 1; min-width: 0; overflow: hidden; }
.col-label { display: block; font-size: 0.78rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.col-lock-btn {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: #94a3b8;
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;
    transition: all 0.15s;
}
.col-lock-btn:hover { border-color: #2563eb; color: #2563eb; }
.col-lock-btn.is-locked {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1d4ed8;
}
.col-locked { background: #f0f7ff !important; }
.col-drag-handle {
    flex-shrink: 0;
    color: #94a3b8;
    font-size: 0.75rem;
    cursor: grab;
    line-height: 1;
    padding-top: 2px;
}
th.drag-over-col { outline: 2px dashed #2563eb; outline-offset: -2px; }

.btn.disabled, .btn:disabled, label.disabled { opacity: 0.5; pointer-events: none; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }

.auth-page {
    min-height: 100vh; display: grid; place-items: center;
    background: radial-gradient(circle at top right, #dbeafe, transparent 40%), var(--bg);
}
.auth-card {
    width: min(420px, 92vw); background: #fff; border-radius: 18px;
    box-shadow: var(--shadow); padding: 32px; border: 1px solid var(--border);
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; }
.form-control {
    width: 100%; border: 1px solid var(--border); border-radius: 10px;
    padding: 11px 12px; font: inherit;
}
.form-error { color: var(--danger); font-size: 0.85rem; margin-top: 6px; }

.pagination-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2);
}
.loading-overlay {
    position: absolute; inset: 0; background: rgba(255,255,255,.72);
    display: grid; place-items: center; z-index: 30; font-weight: 600;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1100px) {
    .register-wrap { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-hero { padding: 28px 24px; }
    .dashboard-title { font-size: 1.5rem; }
    .dashboard-hero-graphic { display: none; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main-content { margin-left: 0; width: 100%; padding: 20px 16px; }
    .stats-row { grid-template-columns: 1fr; }
}

.uploads-card { margin-bottom: 16px; }
.uploads-card-header { padding: 16px 20px 0; }
.uploads-card-title { margin: 0 0 4px; font-size: 1rem; font-weight: 700; }
.uploads-card-subtitle { margin: 0 0 12px; color: var(--muted); font-size: 0.88rem; }
.uploads-table-wrap { overflow-x: auto; padding: 0 20px 16px; }
.uploads-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.uploads-table th,
.uploads-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}
.uploads-table th {
    color: var(--muted);
    font-weight: 600;
    background: var(--surface-2);
}
.uploads-row-active { background: #eff6ff; }
.uploads-filename { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uploads-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.upload-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.upload-modal-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}
.upload-modal-title { margin: 0 0 6px; font-size: 1.15rem; font-weight: 700; }
.upload-modal-subtitle { margin: 0 0 16px; color: var(--muted); font-size: 0.9rem; }
.upload-modal-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.upload-field { display: grid; gap: 6px; font-size: 0.85rem; font-weight: 600; }
.upload-field select {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
}
.upload-period-warning {
    margin: 0 0 12px;
    color: #b45309;
    font-size: 0.85rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 10px 12px;
}
.upload-file-btn { width: 100%; justify-content: center; margin-bottom: 10px; }
.upload-modal-cancel { width: 100%; }
