@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root,
html[data-theme="light"] {
  --bg: #eef2fc;
  --surface: #ffffff;
  --surface2: #f5f7fe;
  --surface3: #edf1fb;
  --border: #e0e8f4;
  --border2: #d0dcee;
  --text: #0f1e3d;
  --text2: #375080;
  --text3: #7a90b2;
  --accent: #2563eb;
  --accent-lt: rgba(37, 99, 235, .1);
  --accent-glow: rgba(37, 99, 235, .3);
  --sidebar-bg: linear-gradient(180deg, #1e3a8a 0%, #1e2d6b 55%, #151f52 100%);
  --sidebar-text: rgba(255, 255, 255, .65);
  --sidebar-text-act: #ffffff;
  --sidebar-item-act: rgba(255, 255, 255, .18);
  --sidebar-border: rgba(255, 255, 255, .1);
  --sidebar-gold: #d97706;
  --shadow-sm: 0 1px 3px rgba(37, 99, 235, .04), 0 2px 8px rgba(37, 99, 235, .05);
  --shadow: 0 1px 4px rgba(37, 99, 235, .05), 0 4px 20px rgba(37, 99, 235, .07);
  --shadow-md: 0 4px 14px rgba(37, 99, 235, .1), 0 8px 36px rgba(37, 99, 235, .09);
}

html[data-theme="dark"] {
  --bg: #06091a;
  --surface: rgba(255, 255, 255, .08);
  --surface2: rgba(255, 255, 255, .05);
  --surface3: rgba(255, 255, 255, .03);
  --border: rgba(255, 255, 255, .13);
  --border2: rgba(255, 255, 255, .08);
  --text: #ffffff;
  --text2: rgba(255, 255, 255, .7);
  --text3: rgba(255, 255, 255, .4);
  --accent: #60a5fa;
  --accent-lt: rgba(96, 165, 250, .18);
  --accent-glow: rgba(96, 165, 250, .35);
  --sidebar-bg: rgba(255, 255, 255, .06);
  --sidebar-text: rgba(255, 255, 255, .55);
  --sidebar-text-act: #ffffff;
  --sidebar-item-act: rgba(255, 255, 255, .15);
  --sidebar-border: rgba(255, 255, 255, .08);
  --sidebar-gold: #fcd34d;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  font-family: 'Figtree', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 50;
  background: linear-gradient(90deg, #2563eb 0%, #7c3aed 25%, #0891b2 50%, #16a34a 75%, #2563eb 100%);
}

button,
input {
  font: inherit;
}

select {
  font: inherit;
}

.login-body {
  overflow: hidden;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  background: var(--bg);
}

.login-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: linear-gradient(135deg, #0a2540 0%, #1e3a8a 58%, #151f52 100%);
}

.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 32px 32px;
}

.login-brand::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  right: -140px;
  top: -120px;
  background: radial-gradient(circle, rgba(96, 165, 250, .5), transparent 68%);
}

.login-brand-card {
  position: relative;
  z-index: 1;
  max-width: 560px;
  color: #fff;
}

.login-logo-mark {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .2);
  font-size: 36px;
  margin-bottom: 24px;
}

.login-brand .eyebrow {
  color: #fcd34d;
}

.login-brand h1 {
  font-size: clamp(36px, 5vw, 62px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -2px;
  margin-top: 12px;
}

.login-brand p {
  color: rgba(255, 255, 255, .72);
  font-size: 16px;
  max-width: 520px;
  margin-top: 18px;
}

.login-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.login-stats span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  color: rgba(255, 255, 255, .86);
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .14);
  font-size: 12px;
  font-weight: 800;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg);
}

.login-card {
  width: min(430px, 100%);
  position: relative;
  padding: 34px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.login-theme {
  position: absolute;
  top: 18px;
  right: 18px;
}

.login-card h2 {
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -.8px;
  color: var(--text);
}

.login-sub {
  margin-top: 8px;
  color: var(--text2);
  font-size: 13px;
}

.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(220, 38, 38, .1);
  border: 1px solid rgba(220, 38, 38, .24);
  color: #dc2626;
  font-size: 13px;
  font-weight: 700;
}

.login-field {
  display: block;
  margin-top: 18px;
}

.login-field span {
  display: block;
  margin-bottom: 7px;
  color: var(--text3);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-field div {
  position: relative;
}

.login-field i {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 16px;
}

.login-field input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  outline: none;
  transition: .15s;
}

.login-field select {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  outline: none;
  transition: .15s;
}

.login-field input:focus,
.login-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-lt);
}

.login-submit {
  width: 100%;
  margin-top: 22px;
  padding: 13px;
}

.login-hint {
  margin-top: 16px;
  padding: 11px 12px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 12px;
}

.auth-switch {
  margin-top: 16px;
  text-align: center;
  color: var(--text2);
  font-size: 13px;
}

.auth-switch a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .login-brand {
    min-height: 320px;
  }
}

#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 256px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--sidebar-bg);
  box-shadow: 2px 0 16px rgba(0, 0, 0, .18);
  position: relative;
  z-index: 10;
}

html[data-theme="dark"] .sidebar {
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-right: 1px solid rgba(255, 255, 255, .09);
  box-shadow: none;
}

.sidebar-brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.sidebar-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
}

.sidebar-brand-name {
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -.2px;
  line-height: 1.2;
}

.sidebar-brand-sub {
  color: rgba(255, 255, 255, .42);
  font-size: 11px;
}

.sidebar-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .15);
}

.sidebar-role-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sidebar-gold);
}

.sidebar-role-label {
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
}

.sidebar-role-sub {
  color: rgba(255, 255, 255, .4);
  font-size: 11px;
  margin-top: 3px;
}

.sidebar-nav {
  padding: 10px;
  flex: 1;
}

.nav-section-label {
  padding: 8px 10px 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, .35);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  margin: 2px 0;
  border-radius: 8px;
  cursor: pointer;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: all .13s cubic-bezier(.4, 0, .2, 1);
  border: 1px solid transparent;
  user-select: none;
}

.nav-item i {
  font-size: 16px;
  width: 16px;
  text-align: center;
}

.nav-item span {
  flex: 1;
}

.nav-item:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff;
  transform: translateX(2px);
}

.nav-item.active {
  background: var(--sidebar-item-act);
  color: var(--sidebar-text-act);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--sidebar-gold);
}

html[data-theme="dark"] .nav-item.active {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
  border-color: rgba(255, 255, 255, .1);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-trigger {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.profile-trigger:hover .sidebar-avatar,
.profile-trigger:hover.topbar-avatar,
.topbar-avatar.profile-trigger:hover {
  filter: brightness(1.08);
}

.sidebar-avatar,
.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  border: 0;
  padding: 0;
}

button.topbar-avatar {
  cursor: pointer;
}

.profile-modal[hidden] {
  display: none;
}

.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
}

.profile-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.profile-modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  padding: 24px;
}

.profile-modal-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 20px;
}

.profile-modal-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
}

.profile-modal-header h2 {
  font-size: 22px;
  margin: 0;
}

.profile-modal-header p {
  margin: 4px 0 0;
  color: var(--text2);
}

.profile-modal-close {
  border: 0;
  background: var(--surface2);
  color: var(--text2);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
}

.profile-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.profile-detail {
  padding: 14px;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--border2);
}

.profile-detail span {
  display: block;
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-detail strong {
  font-size: 14px;
  line-height: 1.45;
}

.profile-password-panel {
  border-top: 1px solid var(--border2);
  padding-top: 18px;
}

.profile-password-panel h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 16px;
}

.profile-password-note {
  color: var(--text2);
  line-height: 1.5;
}

.sidebar-user-name {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.sidebar-user-role {
  color: rgba(255, 255, 255, .4);
  font-size: 11px;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border);
  flex-shrink: 0;
}

html[data-theme="dark"] .topbar {
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-accent-bar {
  width: 4px;
  height: 18px;
  background: var(--accent);
  border-radius: 2px;
}

.topbar-title {
  font-weight: 800;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -.3px;
}

.topbar-date {
  font-size: 11.5px;
  color: var(--text3);
  font-weight: 600;
}

.topbar-search {
  position: relative;
}

.topbar-search i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 13px;
  pointer-events: none;
}

.topbar-search input {
  padding: 7px 12px 7px 30px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 13px;
  outline: none;
  width: 210px;
  transition: .15s;
}

.topbar-search input:focus {
  border-color: var(--accent);
  width: 240px;
}

.btn-theme-toggle,
.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: all .15s;
}

.btn-theme-toggle,
.btn-ghost {
  padding: 7px 12px;
  border: 1.5px solid var(--border2);
  background: var(--surface2);
  color: var(--text2);
  font-size: 12px;
}

.btn-primary {
  padding: 9px 14px;
  border: 0;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  box-shadow: 0 4px 18px rgba(37, 99, 235, .25);
}

.btn-theme-toggle:hover,
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-lt);
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
}

.page-section {
  display: none;
  animation: fadeIn .22s ease;
}

.page-section.active {
  display: block;
}

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

.hero-card,
.card,
.table-card,
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-card {
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -90px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
}

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.hero-title {
  margin-top: 8px;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -1.3px;
}

.hero-desc {
  max-width: 760px;
  margin-top: 12px;
  color: var(--text2);
  font-size: 15px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.analytics-board {
  margin-bottom: 20px;
  padding: 22px;
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 42%),
    linear-gradient(180deg, var(--surface) 0%, var(--surface2) 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.analytics-board-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.analytics-board-head h2 {
  margin-top: 4px;
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: -0.6px;
  font-weight: 800;
}

.analytics-board-head p {
  margin-top: 6px;
  color: var(--text2);
  max-width: 560px;
}

.analytics-board-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.analytics-highlights {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.analytics-highlight {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.analytics-highlight-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 800;
  color: var(--text3);
}

.analytics-highlight strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.8px;
  color: var(--text);
}

.analytics-highlight-sub {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text2);
}

.analytics-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.analytics-chart-card {
  margin: 0;
  min-width: 0;
}

.analytics-chart-head h3 {
  font-size: 16px;
  font-weight: 800;
}

.analytics-chart-head p {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text3);
}

.analytics-chart-wrap {
  position: relative;
  height: 240px;
  margin-top: 12px;
}

.analytics-chart-wrap-bar {
  height: 260px;
}

.analytics-insight-card h3 {
  margin-bottom: 14px;
}

.analytics-insight-list {
  list-style: none;
  display: grid;
  gap: 14px;
}

.analytics-insight-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
}

.analytics-insight-list i {
  font-size: 20px;
  color: var(--accent);
  margin-top: 2px;
}

.analytics-insight-list strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}

.analytics-insight-list span {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: var(--text2);
}

@media (max-width: 900px) {
  .analytics-highlights,
  .analytics-chart-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.kpi {
  border-radius: 12px;
  padding: 18px;
  border-top: 3px solid var(--accent);
  transition: all .2s;
}

.kpi:hover,
.card:hover,
.table-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.kpi .icon {
  font-size: 23px;
  color: var(--accent);
  margin-bottom: 10px;
}

.kpi .label {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .9px;
  font-weight: 800;
}

.kpi .value {
  color: var(--text);
  font-size: 32px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -1px;
  margin-top: 6px;
}

.kpi .sub {
  color: var(--text3);
  font-size: 12px;
  margin-top: 6px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 16px;
}

.grid-2 > *,
.grid-3 > *,
.bulk-grid > * {
  min-width: 0;
  max-width: 100%;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.card h3,
.table-header h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.1px;
}

.card p {
  color: var(--text2);
  font-size: 13px;
  margin-top: 7px;
}

.notice {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  font-size: 13px;
}

.notice-success {
  border-color: rgba(22, 163, 74, .22);
  background: rgba(22, 163, 74, .08);
  color: #15803d;
}

.notice-error {
  border-color: rgba(220, 38, 38, .24);
  background: rgba(220, 38, 38, .08);
  color: #dc2626;
}

.bulk-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-hint {
  margin: 0 0 12px;
  color: var(--text3);
  font-size: 12px;
}

.form-field-label {
  display: grid;
  gap: 6px;
  color: var(--text3);
  font-size: 12px;
  font-weight: 800;
}

.form-field-label input {
  width: 100%;
}

.form-field-label select {
  width: 100%;
}

.compact-form textarea {
  min-height: 82px;
  resize: vertical;
}

.attendance-report-grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.attendance-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text2);
}

.attendance-summary span {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.attendance-student-list {
  grid-column: 1 / -1;
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.attendance-list-head,
.attendance-student-row {
  display: grid;
  grid-template-columns: 1fr 70px 70px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
}

.attendance-list-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface2);
  color: var(--text3);
  font-weight: 800;
  border-bottom: 1px solid var(--border2);
}

.attendance-student-row {
  border-bottom: 1px solid var(--border2);
}

.attendance-student-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
}

.attendance-empty {
  display: none;
  padding: 18px;
  text-align: center;
  color: var(--text3);
}

.attendance-downloads {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-list {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.checkbox-list-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface2);
  color: var(--text3);
  font-weight: 800;
  border-bottom: 1px solid var(--border2);
}

.checkbox-list-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border2);
  font-weight: 600;
}

.checkbox-list-empty {
  display: none;
  padding: 18px;
  text-align: center;
  color: var(--text3);
}

.multiselect {
  position: relative;
  min-width: 180px;
}

.multiselect-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  text-align: left;
}

.multiselect-toggle span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multiselect-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  min-width: 220px;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
}

.multiselect-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  white-space: nowrap;
}

.multiselect-option:hover {
  background: var(--surface2);
}

.report-filter-card {
  margin-bottom: 16px;
}

.report-filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.report-filter-controls select,
.report-filter-controls input[type="date"] {
  min-width: 220px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  outline: none;
}

.report-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}

.report-filter-hint {
  color: var(--text3);
  font-size: 13px;
  font-weight: 700;
}

.generated-report-message {
  margin-bottom: 16px;
}

.generated-report-detail-header {
  border-top: 1px solid var(--border2);
}

.bulk-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.inline-upload {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

.inline-upload input[type="file"] {
  flex: 1;
  min-width: 210px;
  padding: 9px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
}

.compact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.compact-form input,
.compact-form select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  outline: none;
}

.compact-form button {
  grid-column: 1 / -1;
}

.course-items,
.course-item-row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.course-item-row [data-remove-course-item] {
  grid-column: 1 / -1;
}

.course-pdf-form {
  margin: 0;
}

.course-card-actions {
  display: grid;
  gap: 10px;
  padding: 0 16px 14px;
}

.course-card-actions .btn-danger {
  margin-top: 0;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
}

.course-manage-details {
  border: 1px solid var(--border2);
  border-radius: 10px;
  background: var(--surface2);
  padding: 8px 10px;
}

.course-manage-details summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.course-inline-form {
  grid-template-columns: 1fr;
  margin-top: 10px;
}

.course-edit-items {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.course-edit-items h4 {
  font-size: 12px;
  color: var(--text);
}

.course-edit-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px dashed var(--border2);
  border-radius: 10px;
  background: var(--surface);
}

.course-edit-item .btn-danger {
  width: fit-content;
  margin-top: 0;
}

.course-delete-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text2);
  font-size: 12px;
  font-weight: 800;
}

.course-delete-check input {
  width: auto;
}

.content-upload-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.content-upload-form input,
.content-upload-form select,
.content-upload-form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  outline: none;
}

.content-upload-form textarea {
  grid-column: 1 / -1;
  min-height: 86px;
  resize: vertical;
}

.content-upload-form button {
  grid-column: 1 / -1;
}

.resource-link {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.resource-link:hover {
  text-decoration: underline;
}

.progress-cell {
  min-width: 130px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--surface2);
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #16a34a);
}

.row-update-form {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}

.row-update-form select,
.row-update-form input {
  padding: 7px 9px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  max-width: 130px;
}

.row-update-form input {
  max-width: 76px;
}

.module-card {
  padding: 18px;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
}

.module-card i {
  color: var(--accent);
  font-size: 22px;
}

.module-card h4 {
  margin-top: 10px;
  color: var(--text);
  font-size: 14px;
}

.module-card p {
  color: var(--text2);
  font-size: 12.5px;
}

.volume-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.volume-card {
  min-width: 0;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.volume-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--border2);
  background: linear-gradient(180deg, var(--surface), var(--surface2));
}

.volume-head h3 {
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.15;
  color: var(--text);
}

.volume-head p {
  margin-top: 8px;
  color: var(--text2);
  font-size: 12.5px;
}

.volume-meta {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border2);
}

.volume-lessons {
  max-height: 620px;
  overflow-y: auto;
  padding: 10px;
}

.volume-lesson {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
  margin-bottom: 10px;
}

.lesson-index {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 12px;
}

.volume-lesson h4 {
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.25;
}

.volume-lesson p {
  color: var(--text2);
  font-size: 12px;
  margin-top: 6px;
}

.table-card {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  min-width: 0;
  max-width: 100%;
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.table-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.table-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border2);
  background: var(--surface2);
}

.table-tools input,
.table-tools select {
  min-width: 180px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.table-tools input {
  flex: 1;
  min-width: 240px;
}

.content-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border2);
  background: var(--surface2);
}

.content-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
  transition: .15s;
}

.content-tab span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text3);
}

.content-tab:hover,
.content-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-lt);
}

.content-tab.active span {
  background: var(--accent);
  color: #fff;
}

.content-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text3);
}

.content-search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  outline: none;
}

.content-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-lt);
}

.course-search {
  margin-bottom: 16px;
}

.course-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.course-meta-tags span {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-lt);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.content-row {
  cursor: pointer;
}

.content-row:hover {
  background: var(--accent-lt);
}

.content-viewer {
  margin-top: 18px;
}

.content-viewer-card {
  position: relative;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.content-viewer-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
}

.content-viewer-head {
  padding-right: 42px;
}

.content-viewer-head h3 {
  margin: 12px 0 4px;
  font-size: 22px;
}

.content-viewer-head p,
.content-viewer-body {
  color: var(--text2);
}

.content-viewer-body {
  margin: 14px 0;
  line-height: 1.55;
}

.content-resource-picker {
  display: grid;
  gap: 8px;
  margin: 16px 0 12px;
}

.content-resource-picker label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text3);
}

.content-resource-picker select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  outline: none;
}

.content-viewer-frame {
  overflow: hidden;
  min-height: 220px;
  margin: 16px 0;
  border: 1px solid var(--border2);
  border-radius: 16px;
  background: var(--surface2);
}

.content-preview-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 16px 0;
}

.content-preview-section {
  display: grid;
  gap: 10px;
}

.content-preview-section > h4 {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent-lt);
  color: var(--accent);
}

.content-preview-card {
  overflow: hidden;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: var(--surface2);
  cursor: pointer;
}

.content-preview-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-lt);
}

.content-preview-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border2);
}

.content-preview-card-head h4 {
  margin: 8px 0 0;
}

.content-preview-card p {
  margin: 0;
  padding: 12px;
  color: var(--text2);
}

.content-preview-card-frame {
  min-height: 280px;
  background: var(--surface);
}

.content-preview-card-frame iframe,
.content-preview-card-frame video {
  display: block;
  width: 100%;
  min-height: 280px;
  border: 0;
}

.content-preview-card-frame video {
  background: #000;
}

.content-preview-open {
  margin: 12px;
  width: fit-content;
}

.content-preview-card-empty {
  cursor: default;
}

.content-viewer-frame iframe,
.content-viewer-frame video {
  display: block;
  width: 100%;
  min-height: 520px;
  border: 0;
}

.content-viewer-frame video {
  background: #000;
}

.content-empty {
  padding: 34px;
  text-align: center;
  color: var(--text3);
}

.content-viewer-open {
  width: fit-content;
}

.content-editor {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border2);
}

.content-editor h4 {
  margin: 0 0 12px;
}

.content-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.content-edit-form input,
.content-edit-form select,
.content-edit-form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  outline: none;
}

.content-edit-form textarea {
  grid-column: 1 / -1;
  min-height: 90px;
  resize: vertical;
}

.content-edit-form button {
  width: fit-content;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: #dc2626;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.table-card table,
.table-scroll table {
  width: max-content;
  min-width: 100%;
}

.table-card th,
.table-card td,
.table-scroll th,
.table-scroll td {
  white-space: nowrap;
}

th {
  background: var(--surface2);
  padding: 10px 13px;
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .8px;
  border-bottom: 1px solid var(--border);
}

th[data-sort-key] {
  cursor: pointer;
}

th[data-sort-key]::after {
  content: " ↕";
  color: var(--text3);
  font-weight: 700;
}

td {
  padding: 12px 13px;
  color: var(--text2);
  border-bottom: 1px solid var(--border2);
  vertical-align: middle;
  font-size: 13px;
}

.content-preview {
  max-width: 460px;
  white-space: pre-wrap;
  color: var(--text2);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  line-height: 1.45;
}

tbody tr:hover td {
  background: var(--accent-lt);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.badge-info {
  background: rgba(37, 99, 235, .12);
  color: #2563eb;
}

.badge-success {
  background: rgba(22, 163, 74, .12);
  color: #16a34a;
}

.badge-warn {
  background: rgba(217, 119, 6, .14);
  color: #d97706;
}

.placeholder {
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed var(--border2);
  border-radius: 14px;
  background: var(--surface2);
  padding: 30px;
}

.placeholder i {
  font-size: 40px;
  color: var(--accent);
}

.placeholder h2 {
  margin-top: 10px;
  font-size: 22px;
}

.placeholder p {
  color: var(--text2);
  max-width: 560px;
  margin-top: 8px;
}

.forms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.form-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--border2);
  border-radius: 14px;
  background: var(--surface2);
  min-height: 220px;
}

.form-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-card-head i {
  font-size: 28px;
  color: var(--accent);
}

.form-card h3 {
  font-size: 18px;
  line-height: 1.35;
}

.form-card p {
  flex: 1;
  color: var(--text2);
  font-size: 14px;
  line-height: 1.5;
}

.form-card .btn-primary {
  align-self: flex-start;
}

.form-card-description {
  color: var(--text2);
  font-size: 14px;
  line-height: 1.55;
  min-height: 44px;
}

.form-replace-form textarea,
.forms-upload-form textarea {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--border2);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  resize: vertical;
}

.form-replace-form textarea {
  min-height: 56px;
}

.form-card-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.form-replace-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.file-input-compact span {
  font-size: 12px;
}

.btn-danger-ghost {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.25);
}

.btn-danger-ghost:hover {
  color: #fff;
  background: #dc2626;
  border-color: #dc2626;
}

.forms-upload-panel {
  margin-bottom: 22px;
}

.forms-upload-note {
  color: var(--text2);
  margin-bottom: 14px;
  line-height: 1.5;
}

.forms-upload-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: end;
}

.forms-upload-form .file-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: var(--text2);
}

.forms-upload-form .file-input input[type="file"] {
  width: 100%;
}

.forms-upload-form .btn-primary {
  justify-self: start;
}

.password-reveal {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.password-reveal .password-value,
.password-reveal .password-masked {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.password-reveal .password-toggle {
  padding: 4px 8px;
  font-size: 12px;
}

.trainer-status-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.trainer-inactive-row td {
  opacity: 0.72;
}

@media (max-width: 980px) {
  .sidebar {
    width: 220px;
  }

  .topbar-search {
    display: none;
  }

  .kpi-grid,
  .analytics-highlights,
  .analytics-chart-grid,
  .grid-2,
  .grid-3,
  .volume-grid,
  .bulk-grid,
  .compact-form,
  .content-upload-form {
    grid-template-columns: 1fr;
  }
}
