:root {
    color-scheme: light;
    --bg: #f4f7fb;
    --panel: #ffffff;
    --ink: #172033;
    --muted: #6b7890;
    --line: #e4eaf2;
    --brand: #0f9f91;
    --brand-dark: #08786f;
    --brand-soft: #e8f8f6;
    --navy: #111c35;
    --danger: #c2414b;
    --success: #087f5b;
    --shadow: 0 10px 30px rgba(26, 45, 79, .07);
}
* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
.shell { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 34px 0 52px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: var(--brand-dark); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2 { margin: 0; letter-spacing: -.025em; }
h1 { font-size: clamp(24px, 3vw, 34px); line-height: 1.15; }
h2 { font-size: 17px; }
.upload, .filter-bar { display: flex; align-items: end; gap: 12px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.upload { align-items: center; box-shadow: none; }
.filter-bar { margin-bottom: 20px; }
.filter-bar label { display: grid; gap: 7px; }
.filter-bar span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
input[type="date"], input[type="text"], input[type="password"], input[type="file"], select { min-height: 42px; padding: 0 12px; color: var(--ink); background: #fbfcfe; border: 1px solid #d9e1ec; border-radius: 9px; font: inherit; }
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(15, 159, 145, .12); }
button, .button-link { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 16px; border: 0; border-radius: 9px; background: var(--brand); color: #fff; font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; transition: transform .2s ease, background .2s ease, box-shadow .2s ease; }
button:hover, .button-link:hover { background: var(--brand-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 7px 16px rgba(15, 159, 145, .2); }
button:disabled { cursor: wait; opacity: .75; }
.secondary { background: #edf1f6; color: var(--ink); }
.secondary:hover { background: #dfe6ef; color: var(--ink); box-shadow: none; }
.notice { margin: 0 0 18px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); font-weight: 700; box-shadow: var(--shadow); }
.success { color: var(--success); }
.error { color: var(--danger); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stats article, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.stats article { position: relative; overflow: hidden; padding: 20px; }
.stats article::after { position: absolute; right: -18px; bottom: -24px; width: 88px; height: 88px; border: 16px solid var(--brand-soft); border-radius: 50%; content: ""; }
.stats span { display: block; position: relative; z-index: 1; margin-bottom: 11px; color: var(--muted); font-size: 12px; font-weight: 700; }
.stats strong { display: block; position: relative; z-index: 1; color: var(--navy); font-size: clamp(20px, 2vw, 25px); letter-spacing: -.03em; }
.grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 18px; margin-bottom: 18px; }
.panel { overflow: hidden; }
.panel h2 { padding: 20px 20px 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px; }
.panel-head h2 { padding: 0; }
.panel-head a { color: var(--brand-dark); font-weight: 750; text-decoration: none; }
.panel-head a:hover { text-decoration: underline; }
.table-wrap { overflow-x: auto; }
.table-wrap table { min-width: 520px; }
.subtitle { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.stats article small { color: var(--muted); font-size: 11px; }
.empty-state { padding: 28px !important; text-align: center; color: var(--muted); }
.note-panel { margin-top: 16px; padding: 14px 18px; color: var(--muted); font-size: 13px; }
.note-panel i { margin-right: 8px; color: var(--brand); }
table { width: 100%; border-collapse: collapse; }
.table-tools { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.table-search { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 330px; color: var(--muted); }
.table-search input { width: 100%; min-height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; }
.table-page-size { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.table-page-size select { min-height: 34px; padding: 0 8px; }
.table-fullscreen-btn { min-height: 34px; margin-left: auto; padding: 0 11px; gap: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 12px; }
.table-fullscreen-btn:hover { background: var(--brand-soft); color: var(--brand-dark); box-shadow: none; }
.table-pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 10px 20px; color: var(--muted); font-size: 12px; }
.table-pager button { min-width: 30px; min-height: 30px; padding: 0; border-radius: 7px; background: #edf1f6; color: var(--ink); }
.table-pager button:disabled { cursor: not-allowed; opacity: .45; }
.panel.table-fullscreen { position: fixed; inset: 16px; z-index: 1200; overflow: auto; background: var(--panel); box-shadow: 0 20px 70px rgba(17, 28, 53, .3); }
.panel.table-fullscreen .table-tools { position: sticky; top: 0; z-index: 2; }
tr[hidden] { display: none; }
th, td { padding: 14px 16px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 13px; }
tbody tr:hover { background: #f8fbfd; }
th { color: var(--muted); background: #f8fafc; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
td:nth-child(n+2), th:nth-child(n+2) { text-align: right; }
.loading-overlay { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(17, 28, 53, .48); backdrop-filter: blur(4px); }
.loading-overlay.show { display: flex; }
.loading-box { display: grid; justify-items: center; gap: 12px; width: min(320px, 100%); padding: 30px; background: var(--panel); border-radius: 16px; box-shadow: 0 20px 60px rgba(17, 28, 53, .25); text-align: center; }
.loading-box span { color: var(--muted); font-size: 14px; }
.spinner { width: 42px; height: 42px; border: 4px solid #d6f2ef; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sidebar { width: 264px; height: 100vh; max-height: 100vh; min-height: 100vh; position: fixed; left: 0; top: 0; z-index: 1000; padding: 24px 16px !important; overflow-y: scroll; overflow-x: hidden; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: rgba(182, 193, 213, .75) var(--navy); background: var(--navy) !important; box-shadow: 8px 0 28px rgba(17, 28, 53, .12); transition: width .25s ease, margin-left .25s ease; }
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(182, 193, 213, .45); border: 2px solid var(--navy); border-radius: 10px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(182, 193, 213, .75); }
.sidebar::before { display: block; width: 42px; height: 4px; margin: 2px 14px 24px; border-radius: 8px; background: var(--brand); content: ""; }
.sidebar.collapsed { width: 0; padding: 0 !important; overflow: hidden; }
.sidebar h4 { padding: 0 14px 20px; color: #fff; font-size: 18px; font-weight: 750; border-bottom: 1px solid rgba(255,255,255,.09); white-space: nowrap; }
.sidebar .nav-link { display: flex; align-items: center; gap: 10px; margin: 5px 0; padding: 12px 14px; border-radius: 10px; color: #b6c1d5 !important; font-size: 14px; font-weight: 650; white-space: nowrap; transition: background .2s ease, color .2s ease, transform .2s ease; }
.sidebar ul, .sidebar li { list-style: none !important; }
.sidebar ul { padding-left: 0; }
.sidebar a, .sidebar a:hover, .sidebar a:focus { text-decoration: none !important; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.08); color: #fff !important; transform: translateX(2px); }
.sidebar .nav-link.active { background: linear-gradient(135deg, var(--brand), #0b8177); color: #fff !important; box-shadow: 0 8px 18px rgba(15, 159, 145, .22); }
.sidebar .nav-link i { width: 20px; flex-shrink: 0; text-align: center; }
.sidebar .nav-group-toggle { width: 100%; justify-content: flex-start; border: 0; text-align: left; }
.sidebar .nav-group-toggle span { flex: 1; }
.sidebar .submenu-chevron { width: auto !important; margin-left: auto; font-size: 10px; transition: transform .2s ease; }
.sidebar .nav-group.open .submenu-chevron { transform: rotate(180deg); }
.sidebar .nav-submenu { display: none; margin: 2px 0 8px 16px; padding: 0 0 0 10px; border-left: 1px solid rgba(182, 193, 213, .22); list-style: none; }
.sidebar .nav-group.open .nav-submenu { display: grid; gap: 2px; }
.sidebar .nav-submenu .nav-link { margin: 2px 0; padding: 10px 12px; font-size: 13px; }
.sidebar hr { opacity: .12; }
.sidebar > ul:last-child { position: sticky; bottom: -24px; z-index: 2; margin-right: -16px; margin-left: -16px; padding: 10px 16px 24px; background: linear-gradient(to bottom, rgba(17,28,53,.72), var(--navy) 28%); }
.sidebar-backdrop { display: none; }
#content { min-height: 100vh; margin-left: 264px; background: var(--bg); transition: margin-left .25s ease; }
#content.sidebar-collapsed { margin-left: 0; }
#sidebarToggle { margin: 18px 0 0 18px !important; width: 42px; min-height: 42px; padding: 0; border-radius: 10px; background: var(--navy) !important; color: #fff !important; box-shadow: 0 8px 18px rgba(17, 28, 53, .16); }
#sidebarToggle:hover { background: var(--brand-dark) !important; color: #fff !important; }
.row.mb-4 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-right: 0; margin-left: 0; }
.col-lg-6 { width: 100%; padding: 0; }
.login-container { min-height: 100vh; padding: 24px; background: radial-gradient(circle at 15% 10%, #2cbeb0 0, transparent 32%), linear-gradient(135deg, #10203e, #08786f); }
.login-box { width: 100%; max-width: 430px; padding: 38px; border: 1px solid rgba(255,255,255,.4); border-radius: 22px; box-shadow: 0 26px 80px rgba(8, 22, 48, .3); }
.login-box h1 { color: var(--brand-dark); }
.login-box .subtitle { color: var(--muted); }
.form-group input { min-height: 46px; border-radius: 10px; }
.btn-login { min-height: 46px; border-radius: 10px; }
@media (max-width: 1050px) { .sidebar { width: 220px; } #content { margin-left: 220px; } .shell { width: min(100% - 36px, 1100px); } }
@media (max-width: 860px) { .topbar, .upload, .filter-bar { align-items: stretch; flex-direction: column; } .stats, .grid, .row.mb-4 { grid-template-columns: 1fr; } .panel { overflow-x: auto; } .filter-bar button, .filter-bar .button-link { width: 100%; } }
@media (max-width: 600px) { .table-tools { align-items: stretch; flex-wrap: wrap; padding: 12px 14px; } .table-search { flex-basis: 100%; max-width: none; } .table-fullscreen-btn { margin-left: 0; } .table-pager { justify-content: flex-start; flex-wrap: wrap; padding: 10px 14px; } }
@media (min-width: 769px) { .sidebar.collapsed { width: 0 !important; min-width: 0 !important; padding: 0 !important; overflow: hidden !important; } #content.sidebar-collapsed { margin-left: 0 !important; } }
@media (max-width: 768px) { .sidebar { width: 0; height: 100vh; max-height: 100vh; padding: 0 !important; } .sidebar:not(.collapsed) { width: 264px; height: 100vh; max-height: 100vh; padding: 24px 16px !important; overflow-y: scroll; } .sidebar-backdrop.show { display: block; position: fixed; inset: 0; z-index: 999; background: rgba(17, 28, 53, .34); backdrop-filter: blur(1px); } #content { margin-left: 0; } .shell { width: min(100% - 28px, 680px); padding: 24px 0 36px; } #sidebarToggle { margin: 12px 0 0 14px !important; } .login-box { padding: 28px 22px; } }
