:root {
  --text: #182a38;
  --text-muted: #637786;
  --bg: #f2f5f2;
  --surface: #ffffff;
  --surface-hover: #f1f6f4;
  --border: #dce7e2;
  --primary: #117c68;
  --primary-hover: #0c6656;
  --primary-soft: #e2f3ee;
  --danger: #bd4650;
  --danger-hover: #9f3540;
  --danger-soft: #fff0ef;
  --danger-text: #963941;
  --app-gradient:
    radial-gradient(ellipse at 88% 0%, #e4f3ed 0%, transparent 34%),
    linear-gradient(180deg, #f7f9f6 0%, #eef3f0 100%);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 8px #1b392b0c, 0 1px 2px #1b392b08;
  --shadow-md: 0 16px 38px #19382a16, 0 4px 12px #19382a0a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text: #e8f0eb;
    --text-muted: #a1b5ac;
    --bg: #111c1a;
    --surface: #192724;
    --surface-hover: #22332e;
    --border: #30443c;
    --primary: #55c2a4;
    --primary-hover: #76d5b9;
    --primary-soft: #203d35;
    --danger: #ff9295;
    --danger-hover: #ffb0b0;
    --danger-soft: #452a2c;
    --danger-text: #ffc5c5;
    --app-gradient:
      radial-gradient(ellipse at 88% 0%, #193b32 0%, transparent 38%),
      linear-gradient(180deg, #111c1a 0%, #121e1b 100%);
    --shadow-sm: 0 2px 8px #00000022, 0 1px 2px #0000001a;
    --shadow-md: 0 16px 38px #00000032, 0 4px 12px #00000020;
  }
}

:root[data-theme="dark"] {
  --text: #e8f0eb;
  --text-muted: #a1b5ac;
  --bg: #111c1a;
  --surface: #192724;
  --surface-hover: #22332e;
  --border: #30443c;
  --primary: #55c2a4;
  --primary-hover: #76d5b9;
  --primary-soft: #203d35;
  --danger: #ff9295;
  --danger-hover: #ffb0b0;
  --danger-soft: #452a2c;
  --danger-text: #ffc5c5;
  --app-gradient:
    radial-gradient(ellipse at 88% 0%, #193b32 0%, transparent 38%),
    linear-gradient(180deg, #111c1a 0%, #121e1b 100%);
  --shadow-sm: 0 2px 8px #00000022, 0 1px 2px #0000001a;
  --shadow-md: 0 16px 38px #00000032, 0 4px 12px #00000020;
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

html {
  background: var(--bg);
}

body {
  color: var(--text);
  background: var(--app-gradient);
  background-attachment: fixed;
  font-family: Inter, "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app .app-layout {
  min-height: 100svh;
}

#app .app-header {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: 272px;
  height: 100svh;
  align-items: stretch;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0;
  padding: 30px 18px 20px;
  color: #eef6f3;
  background:
    radial-gradient(ellipse at 10% 0%, #2c6652 0%, transparent 38%),
    linear-gradient(165deg, #173b34 0%, #142e2d 48%, #10262a 100%);
  border: 0;
  border-right: 1px solid #ffffff12;
  box-shadow: 12px 0 38px #102c2010;
  backdrop-filter: none;
}

#app .app-brand {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: #f4faf6;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.025em;
}

#app .app-brand::before {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid #a9d4c022;
  border-radius: 13px;
  background-color: #e5c780;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 7v13'/%3E%3Cpath d='M3 5.5A2.5 2.5 0 0 1 5.5 3H12v17H5.5A2.5 2.5 0 0 0 3 22.5z'/%3E%3Cpath d='M21 5.5A2.5 2.5 0 0 0 18.5 3H12v17h6.5a2.5 2.5 0 0 1 2.5 2.5z'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 22px;
  box-shadow: 0 8px 18px #071b182c;
  content: "";
}

#app .menu-toggle {
  display: none;
}

#app .app-collapsible {
  display: flex;
  width: 100%;
  min-height: 0;
  flex: 1;
  align-items: stretch;
  flex-direction: column;
  gap: 20px;
  order: 0;
  margin: 28px 0 0;
  padding: 0;
  border: 0;
}

#app .app-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-content: stretch;
  gap: 6px;
}

#app .app-nav a {
  position: relative;
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 13px;
  padding: 9px 12px;
  color: #b4c8c0;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 570;
  text-decoration: none;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

#app .app-nav a::before {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  background-color: currentColor;
  content: "";
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

#app .app-nav a::after {
  display: none;
}

#app .app-nav a:hover {
  color: #ffffff;
  background: #ffffff0d;
  border-color: #ffffff12;
  transform: translateX(2px);
}

#app .app-nav a.router-link-active {
  color: #fff;
  background: linear-gradient(105deg, #3a8c6b42, #2a695747);
  border-color: #a4dac333;
  box-shadow: inset 3px 0 #80c9a8, 0 7px 18px #071e191f;
}

#app .app-nav a.router-link-active::before {
  color: #a3e0c0;
}

#app .app-nav a[href="/presenca"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18M9 15l2 2 4-4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18M9 15l2 2 4-4'/%3E%3C/svg%3E");
}

#app .app-nav a[href="/relatorios"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19V5M4 19h17'/%3E%3Crect x='7' y='12' width='3' height='5' rx='1'/%3E%3Crect x='13' y='8' width='3' height='9' rx='1'/%3E%3Crect x='19' y='4' width='3' height='13' rx='1'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19V5M4 19h17'/%3E%3Crect x='7' y='12' width='3' height='5' rx='1'/%3E%3Crect x='13' y='8' width='3' height='9' rx='1'/%3E%3Crect x='19' y='4' width='3' height='13' rx='1'/%3E%3C/svg%3E");
}

#app .app-nav a[href="/relatorios/frequencia"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12h4l3-8 4 16 3-8h4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12h4l3-8 4 16 3-8h4'/%3E%3C/svg%3E");
}

#app .app-nav a[href="/admin/secretarios"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='10' cy='7' r='4'/%3E%3Cpath d='M20 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='10' cy='7' r='4'/%3E%3Cpath d='M20 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
}

#app .app-nav a[href="/admin/turmas"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 7v14M3 18V5a2 2 0 0 1 2-2h7v18H5a2 2 0 0 0-2 2zM21 18V5a2 2 0 0 0-2-2h-7v18h7a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 7v14M3 18V5a2 2 0 0 1 2-2h7v18H5a2 2 0 0 0-2 2zM21 18V5a2 2 0 0 0-2-2h-7v18h7a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
}

#app .app-nav a[href="/admin/alunos"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m22 10-10-5-10 5 10 5 10-5z'/%3E%3Cpath d='M6 12v5c3 3 9 3 12 0v-5M22 10v6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m22 10-10-5-10 5 10 5 10-5z'/%3E%3Cpath d='M6 12v5c3 3 9 3 12 0v-5M22 10v6'/%3E%3C/svg%3E");
}

#app .app-nav a[href="/atividade"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 2.64-6.36L3 8'/%3E%3Cpath d='M3 3v5h5M12 7v5l3 2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 2.64-6.36L3 8'/%3E%3Cpath d='M3 3v5h5M12 7v5l3 2'/%3E%3C/svg%3E");
}

#app .app-nav a[href="/sede"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18M5 21V7l7-4 7 4v14M9 21v-7h6v7M9 9h.01M15 9h.01'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18M5 21V7l7-4 7 4v14M9 21v-7h6v7M9 9h.01M15 9h.01'/%3E%3C/svg%3E");
}

#app .app-nav a[href="/master"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-11V5l-8-3-8 3v6c0 7 8 11 8 11z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-11V5l-8-3-8 3v6c0 7 8 11 8 11z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
}

#app .app-user {
  align-items: center;
  gap: 12px;
  padding: 16px 8px 4px;
  color: #b4c8c0;
  border-top: 1px solid #ffffff20;
  font-size: 13px;
}

#app .app-user-name {
  overflow: hidden;
  max-width: 100%;
  color: #eff7f2;
  font-weight: 600;
  text-overflow: ellipsis;
}

#app .app-user .btn-link {
  color: #a9d6c0;
  font-size: 13px;
}

#app .app-user .btn-link:hover {
  color: #fff;
}

#app .app-user .theme-toggle {
  color: #e8c979;
  background: #ffffff10;
  border-color: #ffffff24;
}

#app .app-user .theme-toggle:hover {
  color: #fff;
  background: #ffffff1c;
}

#app .app-user .sync-badge {
  color: #b4c8c0;
}

#app .app-main {
  min-height: 100svh;
  margin-left: 272px;
  padding: 1px 0 32px;
}

#app .page {
  width: min(100%, 1480px);
  padding: clamp(26px, 4vw, 52px) clamp(22px, 4vw, 56px);
}

#app .page > h1,
#app .report-header h1 {
  margin-bottom: 10px;
  color: var(--text);
  font-size: clamp(27px, 3vw, 36px);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 1.15;
}

#app .page > h1 + p,
#app .page > h1 + .subtitle,
#app .report-header p {
  color: var(--text-muted);
  font-size: 14px;
}

#app h3 {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

#app .card {
  margin-bottom: 22px;
  padding: clamp(18px, 2.3vw, 26px);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

#app .card-grid {
  gap: 16px;
}

#app .card-grid .card {
  margin-bottom: 0;
}

#app .card-grid .card:hover,
#app .card:hover {
  border-color: color-mix(in srgb, var(--primary) 26%, var(--border));
  box-shadow: var(--shadow-md);
}

#app .kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr));
  gap: 14px;
  margin: 24px 0;
}

#app .kpi-row > * {
  min-width: 0;
}

#app .kpi-card {
  position: relative;
  min-height: 116px;
  overflow: hidden;
  gap: 9px;
  padding: 20px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--kpi-color) 9%, var(--surface)), var(--surface) 72%);
  border: 1px solid color-mix(in srgb, var(--kpi-color) 18%, var(--border));
  border-left: 0;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

#app .kpi-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--kpi-color);
  content: "";
}

#app .kpi-card::after {
  position: absolute;
  top: -35px;
  right: -25px;
  width: 110px;
  height: 110px;
  border: 1px solid color-mix(in srgb, var(--kpi-color) 14%, transparent);
  border-radius: 50%;
  box-shadow:
    0 0 0 14px color-mix(in srgb, var(--kpi-color) 5%, transparent),
    0 0 0 29px color-mix(in srgb, var(--kpi-color) 3%, transparent);
  content: "";
  pointer-events: none;
}

#app .kpi-label {
  font-size: 10px;
  letter-spacing: 0.09em;
}

#app .kpi-value {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 760;
  letter-spacing: -0.045em;
}

#app .btn-primary,
#app .btn-secondary,
#app .theme-toggle,
#app .menu-toggle {
  border-radius: 11px;
}

#app .btn-primary {
  min-height: 44px;
  background: linear-gradient(135deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 76%, #155044) 100%);
  box-shadow: 0 7px 16px color-mix(in srgb, var(--primary) 22%, transparent);
  font-weight: 650;
}

#app .btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
  box-shadow: 0 10px 22px color-mix(in srgb, var(--primary) 28%, transparent);
}

#app .btn-secondary {
  min-height: 40px;
  background: var(--surface);
  font-weight: 600;
}

#app .btn-secondary:hover {
  color: var(--primary);
}

#app .form-field {
  margin-bottom: 18px;
}

#app .form-field label {
  margin-bottom: 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 680;
}

#app .form-field input,
#app .form-field select,
#app .form-field textarea,
#app .search-input {
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: inset 0 1px 2px #17392b08;
}

#app .form-field input:focus,
#app .form-field select:focus,
#app .form-field textarea:focus,
#app .search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 13%, transparent);
}

#app .table-scroll {
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

#app .data-table {
  border: 0;
}

#app .data-table th {
  padding: 13px 14px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg) 84%, var(--surface));
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.09em;
}

#app .data-table td {
  padding: 13px 14px;
  font-size: 13px;
}

#app .data-table tbody tr:nth-child(2n) {
  background: color-mix(in srgb, var(--bg) 46%, var(--surface));
}

#app .data-table tbody tr:hover {
  background: color-mix(in srgb, var(--primary-soft) 64%, var(--surface));
}

#app .data-table th:last-child {
  background: color-mix(in srgb, var(--bg) 84%, var(--surface));
}

#app .data-table td:last-child {
  background: var(--surface);
}

#app .data-table tbody tr:nth-child(2n) td:last-child {
  background: color-mix(in srgb, var(--bg) 46%, var(--surface));
}

#app .data-table tbody tr:hover td:last-child {
  background: color-mix(in srgb, var(--primary-soft) 64%, var(--surface));
}

#app :is(button, a, input, select, textarea):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 44%, transparent);
  outline-offset: 3px;
}

#app :is(button, a) svg {
  flex: 0 0 auto;
  transition: transform 180ms cubic-bezier(.2, .8, .2, 1);
}

#app :is(button, a):hover svg {
  transform: scale(1.08);
}

#app .page :is(button, a) > svg {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 1.15em;
  color: currentColor;
  vertical-align: middle;
}

#app .page :is(button, a):hover > svg {
  transform: translateY(-1px) scale(1.08) rotate(-3deg);
}

#app svg path,
#app svg line,
#app svg polyline,
#app svg polygon {
  stroke-linecap: round;
  stroke-linejoin: round;
}

#app .auth-layout {
  background:
    radial-gradient(ellipse at 14% 12%, #5d9e8180 0%, transparent 35%),
    radial-gradient(ellipse at 88% 88%, #dfbd7055 0%, transparent 34%),
    linear-gradient(145deg, #102622 0%, #174c42 54%, #143b3c 100%);
}

#app .auth-badge {
  background: linear-gradient(145deg, #278c71, #14614f);
}

#app .auth-brand {
  color: var(--primary);
}

#app .auth-card .btn-primary {
  background: linear-gradient(135deg, #198c71, #116b5a);
}

#app .auth-card .btn-primary:hover {
  background: linear-gradient(135deg, #137a64, #0c5c4e);
}

@media (min-width: 900px) {
  #app .app-header {
    position: fixed;
    inset: 0 auto 0 0;
    width: 272px;
    height: 100svh;
    flex-wrap: nowrap;
  }

  #app .app-collapsible {
    display: flex !important;
  }
}

@media (max-width: 899px) {
  #app .app-header {
    position: sticky;
    inset: auto;
    z-index: 40;
    display: flex;
    width: 100%;
    height: auto;
    min-height: 64px;
    align-items: center;
    flex-direction: row;
    gap: 12px;
    padding: 11px 16px;
    color: var(--text);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 18px #16324d0a;
    backdrop-filter: blur(14px);
  }

  #app .app-brand {
    color: var(--text);
    font-size: 14px;
  }

  #app .app-brand::before {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  #app .menu-toggle {
    display: flex;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-color: var(--border);
    background: var(--surface);
  }

  #app .menu-icon,
  #app .menu-icon::before,
  #app .menu-icon::after {
    background: var(--text);
  }

  #app .app-collapsible {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    z-index: 42;
    display: none;
    width: 100%;
    max-height: calc(100svh - 70px);
    overflow-y: auto;
    gap: 14px;
    margin: 0;
    padding: 14px 16px 18px;
    background: var(--surface);
    border: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  #app .app-collapsible.open {
    display: flex;
  }

  #app .app-nav {
    flex-direction: column;
    gap: 4px;
  }

  #app .app-nav a {
    min-height: 44px;
    padding: 9px 11px;
    color: var(--text-muted);
  }

  #app .app-nav a:hover {
    color: var(--text);
    background: var(--surface-hover);
    border-color: transparent;
    transform: none;
  }

  #app .app-nav a.router-link-active {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: transparent;
    box-shadow: inset 3px 0 var(--primary);
  }

  #app .app-nav a.router-link-active::before {
    color: var(--primary);
  }

  #app .app-user {
    padding: 12px 2px 0;
    border-color: var(--border);
    color: var(--text-muted);
  }

  #app .app-user-name {
    color: var(--text);
  }

  #app .app-user .theme-toggle {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
  }

  #app .app-user .theme-toggle:hover {
    color: var(--primary);
    background: var(--surface-hover);
  }

  #app .app-main {
    margin-left: 0;
  }
}

@media (max-width: 639px) {
  #app .page {
    padding: 24px 16px 32px;
  }

  #app .card {
    padding: 17px;
    border-radius: 15px;
  }

  #app .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  #app .kpi-card {
    min-width: 0;
    min-height: 98px;
    padding: 15px;
  }

  #app .kpi-value {
    font-size: 26px;
  }

  #app .table-scroll {
    margin: 0 -17px;
    padding: 0 17px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  #app .data-table {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
  }

  #app .auth-card {
    border-radius: 20px;
  }
}

@media print {
  #app .app-main {
    margin-left: 0;
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  #app *,
  #app *::before,
  #app *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-reduced-motion: no-preference) {
  #app .app-header {
    animation: ebdSidebarEnter 520ms cubic-bezier(.16, 1, .3, 1) both;
  }

  #app .app-nav a {
    animation: ebdNavEnter 480ms cubic-bezier(.16, 1, .3, 1) both;
  }

  #app .app-nav a:nth-child(2) { animation-delay: 35ms; }
  #app .app-nav a:nth-child(3) { animation-delay: 70ms; }
  #app .app-nav a:nth-child(4) { animation-delay: 105ms; }
  #app .app-nav a:nth-child(5) { animation-delay: 140ms; }
  #app .app-nav a:nth-child(6) { animation-delay: 175ms; }
  #app .app-nav a:nth-child(7) { animation-delay: 210ms; }
  #app .app-nav a:nth-child(8) { animation-delay: 245ms; }
  #app .app-nav a:nth-child(9) { animation-delay: 280ms; }

  #app .app-main > .page {
    animation: ebdScreenEnter 620ms cubic-bezier(.16, 1, .3, 1) both;
  }

  #app .app-main > .page > h1,
  #app .app-main > .page > .report-header {
    animation: ebdHeadingEnter 560ms cubic-bezier(.16, 1, .3, 1) both;
  }

  #app .app-main > .page > .card,
  #app .app-main > .page .split-layout > *,
  #app .app-main > .page .card-grid > *,
  #app .app-main > .page .kpi-row > * {
    animation: ebdPanelEnter 620ms cubic-bezier(.16, 1, .3, 1) both;
  }

  #app .app-main > .page .data-table tbody tr {
    animation: ebdRowEnter 400ms cubic-bezier(.16, 1, .3, 1) both;
  }

  #app .app-main > .page .data-table tbody tr:nth-child(2) { animation-delay: 30ms; }
  #app .app-main > .page .data-table tbody tr:nth-child(3) { animation-delay: 60ms; }
  #app .app-main > .page .data-table tbody tr:nth-child(4) { animation-delay: 90ms; }
  #app .app-main > .page .data-table tbody tr:nth-child(5) { animation-delay: 120ms; }
  #app .app-main > .page .data-table tbody tr:nth-child(6) { animation-delay: 150ms; }
  #app .app-main > .page .data-table tbody tr:nth-child(7) { animation-delay: 180ms; }
  #app .app-main > .page .data-table tbody tr:nth-child(8) { animation-delay: 210ms; }
}

@keyframes ebdSidebarEnter {
  from { opacity: 0; transform: translate3d(-12px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes ebdNavEnter {
  from { opacity: 0; transform: translate3d(-8px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes ebdScreenEnter {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes ebdHeadingEnter {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes ebdPanelEnter {
  from { opacity: 0; transform: translate3d(0, 18px, 0) scale(.99); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes ebdRowEnter {
  from { opacity: 0; transform: translate3d(0, 6px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
