@font-face {
    font-family: "Plus Jakarta Sans";
    src: url("fonts/plus-jakarta-sans.ttf") format("truetype");
    font-weight: 400 800;
    font-display: swap;
}

:root {
    --navy: #111c34;
    --blue: #285be8;
    --blue-dark: #1e49c4;
    --ink: #18243b;
    --muted: #5e6d85;
    --line: #e0e6ef;
    --surface: #f4f6fb;
    --white: #fff;
    --sidebar: 248px;
    font: 500 14px/1.55 "Plus Jakarta Sans", system-ui, sans-serif;
    color: var(--ink);
    background: var(--surface);
}

* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, strong { font-weight: 750; }
a { color: var(--blue-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }
:focus-visible { outline: 3px solid #7191ff; outline-offset: 3px; }
summary { cursor: pointer; }
img.icon { display: inline-block; vertical-align: middle; flex: 0 0 auto; }
.skip-link { position: fixed; z-index: 50; top: 12px; left: 12px; background: white; border-radius: 8px; padding: 10px 16px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.sidebar {
    position: fixed;
    z-index: 5;
    inset: 0 auto 0 0;
    width: var(--sidebar);
    display: flex;
    flex-direction: column;
    background: var(--navy);
    color: var(--white);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 23px 18px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand strong { display: block; font-size: 15px; line-height: 1.35; }
.brand small, .account small { display: block; color: #adbbd5; font-size: 11px; margin-top: 2px; }
.brand-icon { display: grid; place-items: center; width: 41px; height: 41px; flex-shrink: 0; border-radius: 12px; background: #315ff1; }
.brand-icon .icon { filter: invert(1); }
.sidebar nav { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 4px 12px 16px; scrollbar-width: thin; }
.nav-group + .nav-group { margin-top: 17px; }
.nav-heading { padding: 0 10px 5px; font-size: 10px; color: #aab9d2; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 7px 10px; color: #d6dfef; border-radius: 8px; min-height: 36px; font-size: 13px; }
.nav-link .icon { width: 16px; height: 16px; filter: invert(1); opacity: .78; }
.nav-link:hover { background: #1e2e4c; text-decoration: none; }
.nav-link.is-active { color: white; background: #28449a; font-weight: 750; }
.sidebar-bottom { display: flex; gap: 10px; align-items: center; border-top: 1px solid #30405d; padding: 14px 13px; }
.avatar { flex: 0 0 auto; display: grid; place-items: center; width: 35px; height: 35px; background: #2b4190; color: white; border-radius: 50%; font-weight: 750; font-size: 11px; }
.avatar.light { background: #e7eeff; color: #264cad; }
.account { flex: 1; min-width: 0; color: white; }
.account strong, .account small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: block; }
.account strong { font-size: 12px; }
.account-panel { max-width: 500px; }
.account-panel > * + * { margin-top: 12px; }
.icon-button { border: 0; background: transparent; border-radius: 8px; padding: 7px; display: grid; place-items: center; }
.sidebar .icon-button .icon { filter: invert(1); }
.sidebar .icon-button:hover { background: #293d63; }
.workspace { margin-left: var(--sidebar); }
.topbar { height: 65px; display: flex; align-items: center; gap: 12px; padding: 0 clamp(16px, 3vw, 42px); background: white; border-bottom: 1px solid var(--line); }
.breadcrumb, .top-date { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); }
.breadcrumb strong { color: var(--ink); }
.breadcrumb .icon { height: 15px; width: 15px; opacity: .5; }
.top-date { margin-left: auto; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; white-space: nowrap; }
.top-date .icon { width: 15px; height: 15px; opacity: .65; }
.menu-toggle, .menu-backdrop { display: none; }
.main-content { max-width: 1640px; margin: 0 auto; padding: 26px clamp(16px, 3vw, 42px) 44px; min-width: 0; }
.main-content > * + * { margin-top: 20px; }
.page-heading h1 { font-size: clamp(27px, 3vw, 35px); line-height: 1.22; letter-spacing: -.04em; }
.page-heading p { margin-top: 5px; color: var(--muted); }

.welcome {
    color: #fff;
    background: radial-gradient(ellipse at 90% 55%, #274da7 0%, transparent 64%), #172c55;
    border: 1px solid #24416f;
    border-radius: 16px;
    padding: clamp(20px, 4vw, 35px);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
}
.welcome-label { display: flex; gap: 7px; align-items: center; color: #dfebff; font-weight: 700; font-size: 12px; }
.welcome-label .icon { filter: invert(1); width: 17px; height: 17px; }
.welcome h2 { font-size: clamp(24px, 3vw, 36px); letter-spacing: -.045em; margin: 8px 0 3px; }
.welcome p { color: #d8e3f7; }
.welcome a.welcome-action { color: #183a83; background: #fff; }
.welcome a.welcome-action .icon { filter: none; }
.welcome a.welcome-action:hover { background: #edf2ff; }
.panel { border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 2px 3px #1a2c4d07; background: var(--white); padding: 20px; min-width: 0; }
.panel + .panel { margin-top: 15px; }
.panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.panel-header h2 { font-size: 17px; letter-spacing: -.02em; }
.panel-header p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.panel-header > .icon { opacity: .57; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(145px, 100%), 1fr)); gap: 14px; }
.metric.panel { margin: 0; display: flex; flex-direction: column; color: inherit; padding: 15px; }
.metric:hover { text-decoration: none; }
a.metric:hover { box-shadow: 0 5px 16px #17314a14; border-color: #aebfe9; }
.metric-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.metric-top > .icon { width: 16px; height: 16px; opacity: .35; }
.metric-icon { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; background: #e5edff; }
.metric-icon .icon { width: 18px; height: 18px; opacity: .8; }
.metric-icon.violet { background: #ede7ff; }
.metric-icon.teal { background: #dcf3ef; }
.metric-icon.amber { background: #fcf0d8; }
.metric-number { font-size: 29px; font-weight: 800; letter-spacing: -.05em; }
.metric .muted { font-size: 12px; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: 12px; margin: 0; }
.summary-grid div { background: #f3f6fd; border-radius: 9px; padding: 12px; }
.summary-grid dt { color: var(--muted); font-size: 12px; }
.summary-grid dd { margin: 2px 0 0; font-size: 21px; font-weight: 750; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; gap: 16px; }
.dashboard-grid .panel { margin: 0; }
.chart { width: 100%; display: block; }
.chart-details { font-size: 12px; color: var(--muted); }
.text-link { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 750; }
.text-link .icon { width: 14px; height: 14px; }
.empty { display: grid; place-items: center; text-align: center; gap: 10px; color: var(--muted); min-height: 118px; padding: 16px; }
.empty > .icon { opacity: .5; width: 25px; height: 25px; }
.list-clean { list-style: none; margin: 0; padding: 0; }
.list-clean li { padding: 9px 0; display: flex; align-items: center; gap: 9px; }
.list-clean li + li { border-top: 1px solid var(--line); }
.list-clean li div { flex: 1; min-width: 0; }
.list-clean strong { font-size: 13px; overflow-wrap: anywhere; }
.list-clean small { display: block; color: var(--muted); }
.date-tile { background: #ebf1ff; color: #254b9f; border-radius: 8px; padding: 6px; font-size: 11px; font-weight: 750; }

.notice { padding: 12px 14px; background: #e9f8f1; color: #115f44; border: 1px solid #b7e2d2; border-radius: 9px; }
.notice.error, .notice.danger { background: #fff0f1; border-color: #f6bfc4; color: #8a2035; }
.notice.info { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; background: #eaf0ff; border-color: #c9d8fc; color: #234596; }
.notice a { font-weight: 750; text-decoration: underline; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 14px; background: var(--blue); color: #fff; border: 1px solid transparent; border-radius: 8px; min-height: 40px; line-height: 1.4; font-size: 13px; font-weight: 750; }
.btn:hover { background: var(--blue-dark); text-decoration: none; }
.btn .icon { filter: invert(1); width: 15px; height: 15px; }
.btn.secondary { background: white; color: var(--ink); border-color: #cbd5e3; }
.btn.secondary:hover { background: #eef3ff; }
.btn.danger { background: #971d36; }
.btn.secondary .icon { filter: none; }
.stack { display: grid; gap: 15px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); align-items: end; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 0 0 14px; }
.toolbar:last-child { margin: 12px 0 0; }
.field { display: flex; flex-direction: column; gap: 5px; color: #23304b; font-size: 13px; font-weight: 700; min-width: 0; }
input:not([type=checkbox], [type=radio], [type=hidden]), select, textarea { max-width: 100%; min-height: 39px; margin: 0; background: white; color: var(--ink); border: 1px solid #bdc9db; padding: 7px 10px; border-radius: 7px; }
textarea { min-height: 75px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #67768e; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
thead { background: #eff3fa; color: #364763; }
td, th { padding: 10px 11px; vertical-align: top; overflow-wrap: anywhere; }
tr + tr, tbody tr { border-top: 1px solid var(--line); }
tbody tr:hover { background: #f8faff; }
tbody td form { margin-bottom: 8px; }
.badge { display: inline-flex; padding: 3px 7px; border-radius: 6px; background: #e9effb; color: #36517b; font-size: 11px; font-weight: 750; }
.muted { color: var(--muted); }
dialog { width: min(540px, calc(100% - 30px)); max-height: 90dvh; overflow: auto; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 16px 50px #0d173e50; padding: 22px; }
dialog::backdrop { background: #131e37a8; }

.auth { min-height: 100vh; background: radial-gradient(ellipse at 18% 20%, #284980 0%, transparent 53%), #131e37; }
.auth-main { display: grid; min-height: 100vh; place-items: center; padding: 20px; }
.auth-card { background: white; border: 1px solid #e1e9f8; border-radius: 18px; width: min(100%, 438px); padding: clamp(20px, 6vw, 35px); box-shadow: 0 22px 75px #06091d40; }
.auth-card > * + * { margin-top: 19px; }
.auth-brand { padding: 0 0 18px; border-bottom: 1px solid var(--line); }
.auth-brand small { color: var(--muted); }
.auth .page-heading h1 { font-size: 28px; }
.auth .page-heading p { font-size: 13px; }
.auth-link { text-align: center; font-weight: 750; font-size: 13px; }
.auth input, .auth .btn { min-height: 43px; }

@media (max-width: 1030px) {
    :root { --sidebar: 212px; }
    .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
    .sidebar { width: min(80vw, 248px); visibility: hidden; transform: translateX(-100%); transition: transform .18s ease, visibility .18s; }
    .app.menu-open .sidebar { visibility: visible; transform: none; box-shadow: 4px 0 45px #111c3461; }
    .app.menu-open { overflow: hidden; }
    .app.menu-open .menu-backdrop { display: block; position: fixed; z-index: 4; inset: 0; border: 0; background: #101a3470; }
    .app.menu-open .topbar { position: relative; z-index: 6; background: transparent; border-color: transparent; pointer-events: none; }
    .app.menu-open .topbar .breadcrumb, .app.menu-open .topbar .top-date { visibility: hidden; }
    .app.menu-open .menu-toggle { pointer-events: auto; margin-left: auto; order: 2; background: white; }
    .workspace { margin-left: 0; }
    .menu-toggle { display: grid; }
    .topbar { height: 54px; }
    .panel { padding: 14px; }
    .main-content { padding-top: 19px; }
}
@media (max-width: 420px) {
    .top-date { display: none; }
    .panel-header { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
@media print {
    .sidebar, .topbar, .skip-link, .toolbar, .no-print, .btn, .notice { display: none !important; }
    body, :root { background: white; }
    .workspace { margin: 0; }
    .main-content, .panel { padding: 0; }
    .panel, .table-wrap { border: 0; box-shadow: none; overflow: visible; }
    th, td { padding: 5px; }
    tr { break-inside: avoid; }
}
