:root { color-scheme: light; --sidebar-width: 216px; --sidebar-rail-width: 64px; }
* { box-sizing: border-box; }
html { min-width: 320px; background: #f8fafc; }
body { margin: 0; min-height: 100dvh; }
input:not([type=checkbox]):not([type=radio]):focus, select:focus, textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgb(59 130 246 / .13);
}
button:focus-visible, a:focus-visible, summary:focus-visible, input[type=checkbox]:focus-visible {
  outline: 2px solid #3b82f6; outline-offset: 3px;
}
body.admin-shell { background: #f6f8fc; color: #334155; }
#sidebar { width: var(--sidebar-width); height: 100dvh; border-color: #e8edf5; translate: none; transform: none; visibility: visible; transition: width .22s ease; }
#sidebar .nav-link { border-radius: 9px; min-height: 40px; font-size: 13px; white-space: nowrap; }
#sidebar .nav-link.active { background: #2563eb; box-shadow: 0 3px 8px rgb(37 99 235 / .16); }
#sidebar .nav-section { font-size: 10px; letter-spacing: .1em; }
#sidebar > div:first-child { height: 58px; padding: 4px 10px; }
#sidebar > div:first-child { justify-content: center; }
.sidebar-brand { display: flex; flex: 1; min-width: 0; align-items: center; justify-content: center; }
.sidebar-brand img { display: block; width: 78px; max-width: 100%; height: 50px; object-fit: contain; }
#sidebar nav { padding: 8px 12px 20px; }
#sidebar-close { margin-left: auto; padding: 6px; flex-shrink: 0; color: #64748b; border-radius: 8px; cursor: pointer; }
#sidebar-close:hover { background: #f1f5f9; }
#sidebar-overlay { z-index: 40; background: rgb(15 23 42 / .35); backdrop-filter: blur(2px); }
#sidebar { z-index: 50; }
#app-content { min-width: 0; width: calc(100% - var(--sidebar-rail-width)); margin-left: var(--sidebar-rail-width); transition: margin-left .22s ease, width .22s ease; }
#app-content > header { min-height: 58px; padding-inline: 16px; gap: 10px; box-shadow: 0 1px 3px rgb(15 23 42 / .03); border-color: #e8edf5; }
#mobile-sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; }
#app-content > main { min-width: 0; padding: 16px; }
.content-navigation { margin-bottom: 12px; }
.router-form-navigation { max-width: 1120px; margin-inline: auto; }
.content-back { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 9px; margin-left: -9px; color: #64748b; border-radius: 8px; font-size: 12px; font-weight: 500; }
.content-back:hover { background: #eaf0fa; color: #2563eb; }
.admin-shell .form-input { min-height: 38px; padding-block: 8px; font-size: 13px; border-radius: 9px; box-shadow: none; }
.admin-shell .form-label { font-size: 12px; margin-bottom: 5px; }
.admin-shell .btn-primary, .admin-shell .btn-secondary, .admin-shell .btn-danger { min-height: 36px; padding-block: 8px; font-size: 12px; border-radius: 9px; }
.router-form-page { max-width: 1120px; margin-inline: auto; }
.router-form-page #router-form { gap: 14px; display: flex; flex-direction: column; }
.router-form-page #router-form > * { margin-block: 0; }
.router-form-page .card { padding: 18px; }
.router-form-page .card > h2 { font-size: 12px; margin-bottom: 14px; }
.router-form-page .grid { gap: 14px 18px; }
.router-form-page code { overflow-wrap: anywhere; }
.router-list-page .router-filters { padding: 16px; margin-bottom: 16px; }
.router-list-page .router-filters > div:first-child { margin-bottom: 14px; }
.router-list-page .router-empty-header { padding: 20px; gap: 16px; }
.router-list-page .router-empty-header h2 { font-size: 16px; }
.router-list-page .router-steps > div { padding: 18px; gap: 12px; }
.admin-shell .card, .admin-shell .stat-card { min-width: 0; border: 1px solid #e7ecf3; border-radius: 14px; box-shadow: 0 2px 5px rgb(15 23 42 / .025); }
.admin-shell .stat-card { padding: 16px; }
.dashboard-stats { gap: 12px; margin-bottom: 16px; }
.dashboard-stats .stat-card > div:first-child { margin-bottom: 10px; }
.dashboard-stats .stat-card > div:first-child > div { width: 36px; height: 36px; border-radius: 11px; }
.dashboard-stats .stat-card > p:first-of-type { font-size: 26px; line-height: 1.2; letter-spacing: -.04em; }
.dashboard-stats .stat-card > p:last-child { font-size: 12px; }
.dashboard-actions { gap: 12px; margin-bottom: 16px; }
.dashboard-actions > a { padding: 14px; gap: 12px; }
.dashboard-actions > a > div:first-child { width: 38px; height: 38px; border-radius: 11px; }
.dashboard-actions > a > div:nth-child(2) { min-width: 0; }
.dashboard-actions > a > svg { flex-shrink: 0; }
.dashboard-chart { padding: 20px; margin-bottom: 16px; }
.chart-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chart-filters > div { flex: 1 1 130px; min-width: 0; }
.chart-filters select { width: 100%; max-width: 100%; min-height: 36px; }
#chart-wrapper { height: 240px; min-width: 0; }
#chart-status { color: #64748b; font-size: 12px; margin-top: 10px; }
#chart-status[data-error=true] { color: #dc2626; }
.sidebar-compact #sidebar { width: var(--sidebar-rail-width); }
.sidebar-compact #sidebar .nav-label, .sidebar-compact #sidebar-close { display: none; }
.sidebar-compact #sidebar > div:first-child { justify-content: center; padding-inline: 6px; }
.sidebar-compact .sidebar-brand img { width: 42px; height: 34px; }
.sidebar-compact #sidebar nav { padding-inline: 8px; }
.sidebar-compact #sidebar .nav-link { justify-content: center; padding-inline: 0; gap: 0; }
.sidebar-compact #sidebar .nav-link svg { width: 19px; height: 19px; }
.sidebar-compact #sidebar .nav-section { height: 12px; margin: 10px 5px 3px; padding: 0; font-size: 0; border-top: 1px solid #edf1f6; }
@media (min-width: 1024px) {
  #sidebar { transform: translateX(0); visibility: visible; }
  #sidebar-close { display: none; }
  #app-content { margin-left: var(--sidebar-width); width: calc(100% - var(--sidebar-width)); }
  .sidebar-collapsed #app-content { margin-left: var(--sidebar-rail-width); width: calc(100% - var(--sidebar-rail-width)); }
}
@media (max-width: 1023px) { .sidebar-open { overflow: hidden; } }
@media (max-width: 639px) {
  :root { --sidebar-rail-width: 52px; }
  #app-content > main { padding: 12px 10px; }
  #app-content > header { padding: 8px; gap: 4px; }
  #app-content header h1 { font-size: 13px; }
  #app-content header h1 + p { display: none; }
  #mobile-sidebar-toggle { min-width: 32px; padding: 4px; }
  #profile-menu-toggle { padding-inline: 4px; }
  .sidebar-compact #sidebar nav { padding-inline: 5px; }
  .router-form-page .card { padding: 14px; }
  .admin-shell input.form-input, .admin-shell select.form-input, .admin-shell textarea.form-input { font-size: 16px; }
  #app-content header nav { display: none; }
  .dashboard-stats { gap: 10px; }
  .dashboard-stats .stat-card > div:first-child { flex-wrap: wrap; gap: 4px; }
  .admin-shell .stat-card { padding: 12px; }
  .dashboard-stats .stat-card > div:first-child > span { font-size: 10px; padding-left: 5px; padding-right: 5px; }
  .dashboard-chart { padding: 16px 12px; }
  #chart-wrapper { height: 210px; }
  .chart-filters { width: 100%; }
}
.login-shell { min-height: 100dvh; background: white; }
.login-brand { display: flex; justify-content: center; margin-bottom: 20px; }
.login-brand img { display: block; width: 156px; height: 104px; object-fit: contain; }
@media (max-width: 399px) {
  .dashboard-stats .stat-card > div:first-child > span { display: none; }
  .dashboard-stats .stat-card > div:first-child > div { width: 32px; height: 32px; }
  .dashboard-stats .stat-card > p:first-of-type { font-size: 24px; }
}
.login-banner { min-height: 100dvh; }
.login-panel { min-height: 100dvh; padding: 32px 24px; }
.login-shell input[type=email], .login-shell input[type=password], .login-shell input[type=text] { font-size: 16px; border-radius: 12px; padding-top: 12px; padding-bottom: 12px; }
.login-shell input[type=checkbox] { accent-color: #2563eb; }
#togglePwd { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; right: 8px; border-radius: 8px; }
@media (min-width: 768px) { .login-panel { padding: 40px 32px; } }
@media (max-width: 767px) { .login-panel { justify-content: center; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
