:root {
  color-scheme: light;
  --surface: #f8faf9;
  --white: #ffffff;
  --ink: #17202a;
  --muted: #64748b;
  --line: #dfe5ea;
  --brand: #0f8b5f;
  --brand-strong: #0a5f44;
  --brand-soft: rgba(15, 139, 95, 0.1);
  --ocean: #2775b6;
  --maize: #e8b23f;
  --tomato: #d94b3d;
  --shadow-soft: 0 12px 32px rgba(23, 32, 42, 0.08);
  --shadow-hover: 0 18px 42px rgba(23, 32, 42, 0.14);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--surface); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.topbar { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid rgba(15, 139, 95, 0.1); background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(12px); }
.topbar-inner { display: flex; min-height: 76px; width: 100%; max-width: 1680px; align-items: center; gap: 12px; margin: 0 auto; padding: 10px 24px; }
.brand-area, .brand, .top-actions, .header-actions, .panel-title, .nav-card, .side-unit-button, .button, .mini-button, .section-heading, .choice-row, .module-title-row { display: flex; align-items: center; }
.brand-area { flex: 0 0 auto; gap: 12px; min-width: 0; }
.brand { gap: 12px; min-width: 0; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 8px; background: var(--brand); color: #fff; font-size: 14px; font-weight: 900; }
.brand-copy strong, .brand-copy small { display: block; }
.brand-copy strong { font-size: 16px; }
.brand-copy small { color: var(--muted); font-size: 12px; }
.unit-top-nav { display: grid; flex: 1 1 auto; grid-template-columns: repeat(6, minmax(112px, 1fr)); gap: 8px; min-width: 0; }
.nav-card { --accent: var(--brand); --soft: #ecfdf5; min-height: 56px; gap: 8px; justify-content: flex-start; border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); border-radius: 8px; background: linear-gradient(180deg, var(--soft), #fff 78%); color: #344456; padding: 8px 10px; text-align: left; font-size: 12px; font-weight: 900; box-shadow: 0 8px 22px rgba(23, 32, 42, 0.05); transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease; }
.nav-card:hover, .nav-card.is-active { transform: translateY(-3px); border-color: var(--accent); background: var(--soft); box-shadow: var(--shadow-hover); }
.nav-card.is-active { outline: 2px solid color-mix(in srgb, var(--accent) 18%, transparent); }
.nav-unit-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 7px; background: #fff; font-size: 18px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent); }
.nav-unit-text { display: grid; gap: 2px; min-width: 0; }
.nav-unit-text strong, .nav-unit-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-unit-text small { color: var(--muted); font-size: 11px; }
.top-actions { flex: 0 0 auto; gap: 8px; }
.button, .mini-button, .icon-button, .choice-button { border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #334155; font-weight: 800; transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease, transform 160ms ease; }
.button { justify-content: center; min-height: 40px; gap: 8px; padding: 0 14px; font-size: 14px; }
.button:hover, .mini-button:hover, .icon-button:hover, .choice-button:hover { border-color: var(--brand); color: var(--brand); }
.button.primary, .primary-mini, .choice-button.is-active { border-color: var(--brand); background: var(--brand); color: #fff; }
.button.primary:hover, .primary-mini:hover { background: var(--brand-strong); color: #fff; }
.button.white { background: #fff; }
.mini-button { justify-content: center; min-height: 34px; padding: 0 10px; font-size: 12px; }
.icon-button { display: grid; width: 40px; height: 40px; place-items: center; font-size: 18px; }
.mobile-menu { display: none; gap: 4px; }
.mobile-menu span, .mobile-menu::before, .mobile-menu::after { display: block; width: 18px; height: 2px; border-radius: 999px; background: currentColor; content: ""; }
.sidebar { position: fixed; inset: 76px auto 0 0; z-index: 35; display: none; width: 268px; flex-direction: column; border-right: 1px solid rgba(15, 139, 95, 0.1); background: rgba(15, 139, 95, 0.03); padding: 12px; }
body.layout-side .sidebar { display: flex; }
body.layout-side .unit-top-nav { display: none; }
.sidebar-title { display: grid; gap: 2px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 12px; }
.sidebar-title small, .sidebar-footer small { color: var(--muted); font-size: 12px; }
.unit-side-nav { display: grid; gap: 6px; }
.side-unit-button { min-height: 48px; justify-content: space-between; gap: 8px; border: 0; border-radius: 8px; background: transparent; color: #526273; padding: 8px 10px; text-align: left; font-weight: 900; }
.side-unit-button small { color: var(--muted); font-size: 11px; font-weight: 800; }
.side-unit-button:hover, .side-unit-button.is-active { background: var(--brand-soft); color: var(--brand); }
.sidebar-footer { display: grid; gap: 4px; margin-top: auto; border-top: 1px solid rgba(15, 139, 95, 0.12); padding-top: 14px; text-align: center; }
.workspace { width: 100%; max-width: 1680px; min-width: 0; margin: 0 auto; padding: 24px 24px 42px; }
body.layout-side .workspace { padding-left: 292px; }
.page, .module-screen { display: none; }
.page.is-active, .module-screen.is-active { display: block; }
.module-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.module-header h1, .panel h2, .module-card h2 { margin: 0; }
.module-header h1 { font-size: 28px; line-height: 1.15; }
.module-header p, .section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.breadcrumb { display: inline-flex; gap: 4px; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.header-actions { gap: 8px; }
.section-heading { justify-content: space-between; gap: 16px; margin: 4px 0 16px; }
.section-heading h2 { margin: 0; font-size: 22px; }
.module-title-row { gap: 10px; }
.module-title-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 9px; background: var(--module-soft, #ecfdf5); font-size: 24px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--module-accent, var(--brand)) 18%, transparent); }
.unit-card-grid, .metric-grid, .module-grid, .settings-grid, .home-grid, .unit-hub-grid, .unit-info-grid, .unit-module-grid, .filters, .form-grid, .materials-grid { display: grid; gap: 16px; }
.unit-card-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 16px; }
.unit-card, .metric-card, .panel, .module-card, .schedule-list article, .material-card { border: 1px solid rgba(15, 139, 95, 0.2); border-radius: 8px; background: #fff; box-shadow: var(--shadow-soft); }
.unit-card { --accent: var(--brand); --soft: #ecfdf5; display: grid; min-height: 166px; gap: 10px; padding: 16px; text-align: left; background: linear-gradient(180deg, var(--soft), #fff 74%); transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease, background 180ms ease; }
.unit-card:hover, .unit-card.is-active { border-color: var(--accent); background: var(--soft); transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.unit-card h2 { margin: 0; font-size: 22px; }
.unit-card p, .module-card p, .material-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.unit-card-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 8px; background: #fff; font-size: 24px; transition: transform 180ms ease; }
.unit-card:hover .unit-card-icon { transform: scale(1.08); }
.unit-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; color: var(--muted); font-size: 12px; font-weight: 800; }
.unit-status { width: 10px; height: 10px; border-radius: 999px; background: var(--accent); }
.home-grid, .unit-hub-grid { grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr); }
.unit-module-grid { grid-template-columns: repeat(9, minmax(0, 1fr)); margin-bottom: 18px; }
.module-card { --accent: var(--brand); --soft: #ecfdf5; min-height: 172px; padding: 16px; text-align: left; background: linear-gradient(180deg, var(--soft), #fff 76%); transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease, background 180ms ease; }
.module-button { cursor: pointer; }
.module-button:hover, .module-button.is-active, .module-card:hover { border-color: var(--accent); background: var(--soft); transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.module-emoji { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 9px; margin-bottom: 12px; background: #fff; font-size: 25px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent); transition: transform 180ms ease; }
.module-card:hover .module-emoji { transform: scale(1.1); }
.module-card h2 { margin-top: 0; font-size: 18px; }
.card-kicker { color: var(--accent); font-size: 12px; font-weight: 900; }
.static-card { transform: none !important; }
.metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-grid.compact .metric-card { min-height: 132px; }
.metric-card { min-height: 152px; padding: 16px; }
.metric-card small, .metric-card em { display: block; color: var(--muted); font-style: normal; }
.metric-card small { margin-top: 18px; font-size: 13px; }
.metric-card strong { display: block; margin-top: 4px; font-size: 30px; line-height: 1.1; }
.metric-card em { margin-top: 4px; font-size: 12px; font-weight: 700; }
.metric-icon { display: block; width: 40px; height: 40px; border-radius: 8px; }
.metric-icon.brand { background: #ecfdf5; }
.metric-icon.ocean { background: #eff6ff; }
.metric-icon.maize { background: #fffbeb; }
.metric-icon.tomato { background: #fef2f2; }
.panel { min-width: 0; padding: 16px; }
.panel-title { justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-title h2 { color: var(--brand); font-size: 16px; }
.badge { display: inline-flex; min-height: 26px; align-items: center; border-radius: 999px; background: #f1f5f9; color: #475569; padding: 0 10px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.badge.success { background: #ecfdf5; color: var(--brand); }
.badge.warn { background: #fffbeb; color: #a16207; }
.badge.danger { background: #fef2f2; color: var(--tomato); }
.notice-card { display: grid; gap: 5px; border-radius: 8px; background: rgba(15, 139, 95, 0.06); padding: 16px; }
.notice-card span, .notice-card small, .activity-list span, .module-card p, .unit-info-grid span, .schedule-list span, .schedule-list em, .material-card small { color: var(--muted); font-size: 13px; }
.notice-card strong { font-size: 18px; }
.unit-info-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 16px; }
.unit-info-grid div, .activity-list div { border-radius: 8px; background: rgba(15, 139, 95, 0.05); padding: 14px; }
.unit-info-grid strong, .activity-list strong { display: block; margin-top: 4px; font-size: 16px; }
.activity-list, .schedule-list, .form-stack { display: grid; gap: 10px; }
.module-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.module-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
.filters { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
.filters.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.filters label, .field { display: grid; gap: 6px; color: #475569; font-size: 13px; font-weight: 800; }
.filters input, .filters select, .field input, .field select, .field textarea { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); padding: 0 12px; }
.field textarea { min-height: 112px; padding: 10px 12px; resize: vertical; }
.field.wide { grid-column: 1 / -1; }
.available-tests { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.test-card { display: grid; gap: 6px; min-height: 92px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; padding: 14px; text-align: left; }
.test-card:hover { border-color: var(--brand); background: rgba(15, 139, 95, 0.06); }
.test-card span { color: var(--muted); font-size: 13px; }
.evaluation-flow, .create-test-flow { margin-bottom: 16px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 960px; border-collapse: collapse; font-size: 14px; }
th, td { border-bottom: 1px solid #edf2f7; padding: 11px 10px; text-align: left; }
th { color: #64748b; font-size: 12px; font-weight: 900; }
.schedule-list article { display: grid; gap: 5px; padding: 16px; }
.schedule-list em { color: var(--muted); font-style: normal; font-weight: 800; }
.materials-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.material-card { display: grid; gap: 10px; padding: 16px; }
.material-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 8px; background: #eff6ff; font-size: 22px; }
.material-card h3 { margin: 0; font-size: 17px; }
.material-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.switch-row { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 8px 12px; color: #334155; font-size: 14px; font-weight: 800; }
.switch-row + .switch-row, .field + .field { margin-top: 10px; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--brand); }
.inline-actions { justify-content: flex-start; }
.choice-row { gap: 8px; margin-bottom: 14px; }
.choice-button { min-height: 38px; padding: 0 12px; }
.modal { position: fixed; inset: 0; z-index: 60; display: none; place-items: center; background: rgba(15, 23, 42, 0.45); padding: 20px; }
.modal.is-open { display: grid; }
.modal-dialog { width: min(820px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border: 1px solid rgba(15, 139, 95, 0.18); border-radius: 8px; background: #fff; box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28); padding: 18px; }
.modal-dialog.small { width: min(520px, 100%); }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: none; max-width: min(380px, calc(100vw - 36px)); border: 1px solid rgba(15, 139, 95, 0.18); border-radius: 8px; background: #fff; box-shadow: var(--shadow-soft); padding: 12px 14px; color: #334155; font-size: 14px; font-weight: 800; }
.toast.is-visible { display: block; }
.backdrop { position: fixed; inset: 76px 0 0; z-index: 30; display: none; border: 0; background: rgba(15, 23, 42, 0.35); }
@media (max-width: 1480px) { .unit-module-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } .materials-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1280px) { .unit-card-grid, .unit-top-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); } .unit-module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1120px) { .home-grid, .unit-hub-grid, .settings-grid { grid-template-columns: 1fr; } .module-grid, .module-grid.three, .metric-grid, .unit-info-grid, .stats-grid, .materials-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 980px) { .mobile-menu { display: grid; } .topbar-inner { flex-wrap: wrap; padding-inline: 12px; } .unit-top-nav { order: 3; width: 100%; flex-basis: 100%; overflow-x: auto; } .top-actions { margin-left: auto; } .sidebar, body.layout-side .sidebar { display: flex; width: min(288px, 86vw); transform: translateX(-100%); background: #fff; box-shadow: var(--shadow-soft); transition: transform 180ms ease; } body.menu-open .sidebar { transform: translateX(0); } body.menu-open .backdrop { display: block; } .workspace, body.layout-side .workspace { padding: 20px 12px 32px; } }
@media (max-width: 720px) { .brand-mark { display: none; } .top-actions .white { display: none; } .module-header, .section-heading { align-items: stretch; flex-direction: column; } .header-actions { flex-wrap: wrap; } .header-actions .button { flex: 1 1 160px; } .unit-card-grid, .unit-top-nav, .unit-module-grid, .module-grid, .module-grid.three, .metric-grid, .unit-info-grid, .filters, .filters.two, .available-tests, .form-grid, .materials-grid, .stats-grid { grid-template-columns: 1fr; } }

/* V1.1 - Comando RP navigation polish */
.page { display: none; }
.page.is-active { display: block; }
.command-header h1,
.unit-header h1,
.module-screen-header h1 { letter-spacing: 0; }
.unit-header { margin-bottom: 18px; }
.unit-module-grid { align-items: stretch; }
.executive-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.executive-card,
.metric-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #fff, var(--soft));
  border: 1px solid color-mix(in srgb, var(--accent) 24%, #dbe3eb);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.07);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}
.executive-card:hover,
.metric-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
}
.metric-emoji {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--accent);
  font-size: 24px;
  margin-bottom: 14px;
  transition: transform 180ms ease;
}
.metric-card:hover .metric-emoji { transform: scale(1.08); }
.unit-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: 16px;
}
.unit-summary-card,
.module-card,
.nav-card {
  cursor: pointer;
  border-color: color-mix(in srgb, var(--accent) 22%, #dbe3eb);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}
.unit-summary-card {
  min-height: 236px;
  text-align: left;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, #dbe3eb);
  border-radius: 14px;
  padding: 22px;
  background: linear-gradient(180deg, #fff, var(--soft));
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}
.unit-summary-card:hover,
.module-card:hover,
.nav-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--soft) 74%, #fff));
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.13);
}
.unit-card-icon,
.module-emoji {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--soft);
  font-size: 30px;
  margin-bottom: 14px;
  transition: transform 180ms ease;
}
.unit-summary-card:hover .unit-card-icon,
.module-card:hover .module-emoji { transform: scale(1.08) rotate(-2deg); }
.unit-summary-card h2,
.module-card h2 { font-size: 24px; line-height: 1.16; margin: 8px 0 8px; }
.unit-summary-card p,
.module-card p { color: #53657b; margin: 0; }
.unit-summary-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 20px;
}
.unit-summary-metrics span {
  min-width: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.22);
  padding: 9px;
}
.unit-summary-metrics strong,
.unit-summary-metrics small { display: block; }
.unit-summary-metrics small { color: #64748b; font-size: 11px; }
.nav-card.is-active,
.side-unit-button.is-active {
  border-color: var(--accent);
  background: var(--soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}
.module-grid.three { grid-template-columns: repeat(4, minmax(220px, 1fr)); }
.module-content { min-height: 420px; }
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.dashboard-grid.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wide-panel { grid-column: span 2; }
.clean { margin: 6px 0 16px; }
.mini-roster {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mini-roster span {
  border-radius: 999px;
  padding: 8px 11px;
  color: #075e43;
  background: #ecfdf5;
  font-weight: 800;
  font-size: 13px;
}
.row-actions,
.material-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.row-actions button {
  border: 1px solid #dbe3eb;
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 800;
  cursor: pointer;
}
.row-actions button:hover { border-color: #0f8b5f; color: #0f8b5f; }
.table-panel th:first-child,
.table-panel td:first-child { min-width: 110px; }
.table-panel th:nth-child(3),
.table-panel td:nth-child(3) { font-weight: 900; color: #0f172a; }
.available-tests {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.test-card {
  text-align: left;
  border: 1px solid #dbe3eb;
  border-radius: 12px;
  padding: 18px;
  background: #fff;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.test-card:hover { transform: translateY(-3px); border-color: #2775b6; box-shadow: 0 14px 26px rgba(15, 23, 42, 0.1); }
.test-card strong,
.test-card span { display: block; }
.test-card span { color: #64748b; margin-top: 4px; }
.choice-row { flex-wrap: wrap; }
@media (max-width: 1280px) {
  .executive-grid { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
  .module-grid.three { grid-template-columns: repeat(3, minmax(220px, 1fr)); }
}
@media (max-width: 980px) {
  .executive-grid,
  .unit-summary-grid,
  .dashboard-grid,
  .dashboard-grid.two-cols { grid-template-columns: 1fr; }
  .wide-panel { grid-column: span 1; }
  .module-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .available-tests { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .module-grid.three,
  .unit-summary-grid { grid-template-columns: 1fr; }
  .unit-summary-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .unit-summary-card h2,
  .module-card h2 { font-size: 21px; }
}

/* V1.1.1 - premium alignment and dynamic unit administration */
.command-header {
  align-items: center;
  border: 1px solid rgba(124, 58, 237, 0.14);
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff, #f8fafc 58%, #f5f3ff);
  padding: 18px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.07);
}
.command-header h1 { font-size: 32px; }
.unit-header {
  position: relative;
  align-items: center;
  justify-content: center;
  min-height: 128px;
  border: 1px solid rgba(15, 139, 95, 0.12);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, rgba(255,255,255,0.74));
  text-align: center;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  padding: 20px 220px;
}
.unit-header > div:first-child { max-width: 760px; margin: 0 auto; }
.unit-header .breadcrumb { justify-content: center; }
.unit-header .header-actions { position: absolute; right: 18px; bottom: 18px; }
.unit-header h1 { font-size: 34px; }
.unit-header p { font-size: 15px; }
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  margin-bottom: 10px;
}
.card-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--soft) 72%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
  font-size: 21px;
  line-height: 1;
  transition: transform 170ms ease, box-shadow 170ms ease, background 170ms ease;
}
.card-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  text-transform: none;
}
.module-card,
.unit-summary-card {
  min-height: 138px;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--soft) 58%, #fff));
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
  will-change: transform;
}
.module-card h2,
.unit-summary-card h2 { margin: 4px 0 6px; font-size: 19px; }
.module-card p,
.unit-summary-card p { font-size: 13px; line-height: 1.34; }
.module-card:hover,
.unit-summary-card:hover,
.executive-card:hover,
.nav-card:hover {
  cursor: pointer;
  transform: translateY(-6px);
  border-color: var(--accent);
  background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--soft) 82%, #fff));
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.16);
}
.module-card:hover .card-icon,
.unit-summary-card:hover .card-icon,
.executive-card:hover .metric-emoji { transform: scale(1.12) rotate(-2deg); }
.unit-module-grid { grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: 12px; }
.module-grid.three { grid-template-columns: repeat(4, minmax(190px, 1fr)); gap: 12px; }
.unit-summary-grid { grid-template-columns: repeat(3, minmax(240px, 1fr)); gap: 14px; }
.unit-summary-metrics { margin-top: 14px; gap: 6px; }
.unit-summary-metrics span { padding: 7px 8px; }
.executive-grid { grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 12px; }
.executive-card { min-height: 142px; border-radius: 12px; }
.executive-settings-card { text-align: left; }
.metric-card strong { font-size: 24px; }
.metric-card small { margin-top: 10px; }
.metric-emoji { width: 38px; height: 38px; margin-bottom: 8px; }
.general-settings-shell {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
  gap: 16px;
  align-items: start;
}
.admin-list-panel,
.admin-form-panel { min-height: 420px; }
.unit-admin-list { display: grid; gap: 10px; }
.admin-unit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, #dbe3eb);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--soft) 60%, #fff));
  padding: 10px;
}
.admin-unit-row.is-selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent); }
.admin-unit-row > button {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 0 8px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}
.admin-unit-row > button span { grid-row: span 2; font-size: 24px; }
.admin-unit-row > button strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-unit-row > button small { color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row-actions { display: flex; gap: 5px; }
.admin-row-actions button {
  width: 32px;
  height: 32px;
  border: 1px solid #dbe3eb;
  border-radius: 8px;
  background: #fff;
  font-weight: 900;
}
.admin-row-actions button:hover { border-color: var(--accent); color: var(--accent); }
.template-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.template-chip {
  min-height: 36px;
  border: 1px solid #dbe3eb;
  border-radius: 999px;
  background: #fff;
  padding: 0 12px;
  font-weight: 900;
}
.template-chip:hover { border-color: #0f8b5f; color: #0f8b5f; transform: translateY(-2px); }
.unit-admin-form { display: grid; gap: 16px; }
.form-block {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
}
.form-block h3 { margin: 0 0 12px; font-size: 15px; color: #0f172a; }
.module-toggle-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.module-switch { margin: 0 !important; }
.discord-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.empty-state { grid-column: 1 / -1; text-align: center; }
@media (max-width: 1380px) {
  .executive-grid { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
  .unit-module-grid { grid-template-columns: repeat(4, minmax(170px, 1fr)); }
}
@media (max-width: 1080px) {
  .unit-header { padding: 18px; }
  .unit-header .header-actions { position: static; justify-content: center; }
  .general-settings-shell,
  .discord-grid { grid-template-columns: 1fr; }
  .module-toggle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .unit-header h1 { font-size: 26px; }
  .unit-module-grid,
  .module-grid.three,
  .unit-summary-grid,
  .executive-grid,
  .module-toggle-grid { grid-template-columns: 1fr; }
  .card-head { min-height: 34px; }
}

/* V1.1.2 - corporation identity and Discord state */
.topbar-inner { min-height: 92px; }
.brand {
  min-width: min(280px, 28vw);
  border-radius: 14px;
  padding: 6px 8px;
  transition: background 180ms ease, transform 180ms ease;
}
.brand:hover { background: rgba(15, 139, 95, 0.05); transform: translateY(-1px); }
.brand-emblem,
.sidebar-emblem {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(15, 139, 95, 0.16);
  background: linear-gradient(180deg, #fff, #f8fafc);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1);
}
.brand-emblem {
  flex: 0 0 auto;
  width: clamp(62px, 5.6vw, 92px);
  aspect-ratio: 1;
  border-radius: 16px;
}
.brand-emblem img,
.sidebar-emblem img,
.corp-emblem-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7px;
}
.brand-emblem span,
.sidebar-emblem span,
.corp-emblem-preview span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: var(--brand);
  color: #fff;
  font-weight: 950;
  letter-spacing: 0;
}
.brand-emblem span { font-size: clamp(18px, 2.2vw, 30px); }
.brand-copy { min-width: 0; }
.brand-copy strong {
  overflow: hidden;
  max-width: 180px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(15px, 1.2vw, 19px);
}
.brand-copy small { font-weight: 800; }
.top-actions [hidden],
.button[hidden] { display: none !important; }
.sidebar { inset: 92px auto 0 0; }
.backdrop { inset: 92px 0 0; }
.sidebar-title {
  place-items: center;
  gap: 8px;
  text-align: center;
  padding: 14px;
}
.sidebar-emblem {
  width: min(100%, 168px);
  aspect-ratio: 1;
  border-radius: 18px;
}
.sidebar-emblem span { font-size: 34px; }
.corporation-profile-panel {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #fff, #f8fafc 56%, #ecfdf5);
}
.corp-profile-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.36fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}
.corp-preview {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 260px;
  border: 1px solid rgba(15, 139, 95, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  padding: 18px;
  text-align: center;
}
.corp-preview strong { font-size: 20px; line-height: 1.18; }
.corp-preview small { color: var(--muted); font-weight: 800; }
.corp-emblem-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: min(210px, 100%);
  aspect-ratio: 1;
  border: 1px solid rgba(15, 139, 95, 0.18);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}
.corp-emblem-preview span { font-size: 54px; }
.corp-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.corp-form-grid input[type="file"] {
  padding-top: 9px;
}
@media (max-width: 1280px) {
  .brand { min-width: 220px; }
  .brand-copy strong { max-width: 136px; }
}
@media (max-width: 980px) {
  .brand { min-width: 0; }
  .brand-emblem { width: 58px; }
  .corp-profile-grid { grid-template-columns: 1fr; }
  .corp-preview { min-height: 220px; }
}
@media (max-width: 720px) {
  .brand-emblem { width: 52px; display: grid; }
  .brand-copy strong { max-width: 132px; }
  .top-actions .button.white:not([hidden]) { display: flex; }
  .corp-form-grid { grid-template-columns: 1fr; }
  .corp-emblem-preview { width: min(180px, 100%); }
}
/* V1.1.3 - centered general command header */
.command-header {
  position: relative;
  justify-content: center;
  min-height: 124px;
  padding: 22px 220px;
  text-align: center;
}
.command-header > div:first-child {
  width: min(760px, 100%);
  margin: 0 auto;
}
.command-header .breadcrumb {
  justify-content: center;
}
.nav-card[data-nav-id="command"] .nav-unit-text strong {
  white-space: normal;
  line-height: 1.05;
}
.command-header .header-actions {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
}
@media (max-width: 1080px) {
  .command-header {
    min-height: 0;
    padding: 18px;
  }
.command-header .header-actions {
    position: static;
    justify-content: center;
    transform: none;
    margin-top: 12px;
  }
}
/* V1.2 - dark theme and appearance settings */
html[data-theme="dark"] {
  color-scheme: dark;
  --surface: #0b1120;
  --white: #111827;
  --ink: #e5edf8;
  --muted: #94a3b8;
  --line: #263244;
  --brand: #22c58b;
  --brand-strong: #16a06f;
  --brand-soft: rgba(34, 197, 139, 0.14);
  --shadow-soft: 0 16px 42px rgba(0, 0, 0, 0.28);
  --shadow-hover: 0 24px 56px rgba(0, 0, 0, 0.42);
}
html[data-theme="dark"] body {
  background: linear-gradient(180deg, #0b1120, #0d1424 42%, #101827);
  color: var(--ink);
}
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .modal-dialog,
html[data-theme="dark"] .toast,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] body.layout-side .sidebar {
  background: rgba(15, 23, 42, 0.94);
  border-color: rgba(148, 163, 184, 0.18);
  color: var(--ink);
}
html[data-theme="dark"] .topbar { box-shadow: 0 18px 46px rgba(0, 0, 0, 0.22); }
html[data-theme="dark"] .brand:hover { background: rgba(34, 197, 139, 0.08); }
html[data-theme="dark"] .brand-emblem,
html[data-theme="dark"] .sidebar-emblem,
html[data-theme="dark"] .corp-emblem-preview,
html[data-theme="dark"] .nav-unit-icon,
html[data-theme="dark"] .card-icon,
html[data-theme="dark"] .metric-emoji,
html[data-theme="dark"] .material-icon {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12), 0 12px 30px rgba(0, 0, 0, 0.25);
}
html[data-theme="dark"] .brand-emblem span,
html[data-theme="dark"] .sidebar-emblem span,
html[data-theme="dark"] .corp-emblem-preview span { background: #0f8b5f; }
html[data-theme="dark"] .nav-card,
html[data-theme="dark"] .unit-summary-card,
html[data-theme="dark"] .module-card,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .executive-card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .material-card,
html[data-theme="dark"] .schedule-list article,
html[data-theme="dark"] .test-card,
html[data-theme="dark"] .form-block,
html[data-theme="dark"] .switch-row,
html[data-theme="dark"] .sidebar-title,
html[data-theme="dark"] .admin-unit-row,
html[data-theme="dark"] .unit-summary-metrics span,
html[data-theme="dark"] .activity-list div,
html[data-theme="dark"] .unit-info-grid div,
html[data-theme="dark"] .notice-card,
html[data-theme="dark"] .corp-preview,
html[data-theme="dark"] .choice-button,
html[data-theme="dark"] .template-chip,
html[data-theme="dark"] .row-actions button,
html[data-theme="dark"] .admin-row-actions button,
html[data-theme="dark"] .button.white,
html[data-theme="dark"] .mini-button,
html[data-theme="dark"] .icon-button {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(15, 23, 42, 0.96));
  border-color: rgba(148, 163, 184, 0.18);
  color: var(--ink);
}
html[data-theme="dark"] .nav-card:hover,
html[data-theme="dark"] .nav-card.is-active,
html[data-theme="dark"] .module-card:hover,
html[data-theme="dark"] .unit-summary-card:hover,
html[data-theme="dark"] .metric-card:hover,
html[data-theme="dark"] .admin-unit-row.is-selected {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 16%, #111827), #101827);
  border-color: color-mix(in srgb, var(--accent) 64%, #334155);
  box-shadow: var(--shadow-hover);
}
html[data-theme="dark"] .command-header,
html[data-theme="dark"] .unit-header,
html[data-theme="dark"] .corporation-profile-panel {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.98), rgba(15, 23, 42, 0.98) 58%, rgba(34, 197, 139, 0.08));
  border-color: rgba(34, 197, 139, 0.2);
}
html[data-theme="dark"] .module-header p,
html[data-theme="dark"] .section-heading p,
html[data-theme="dark"] .breadcrumb,
html[data-theme="dark"] .brand-copy small,
html[data-theme="dark"] .nav-unit-text small,
html[data-theme="dark"] .sidebar-title small,
html[data-theme="dark"] .sidebar-footer small,
html[data-theme="dark"] .notice-card span,
html[data-theme="dark"] .notice-card small,
html[data-theme="dark"] .activity-list span,
html[data-theme="dark"] .module-card p,
html[data-theme="dark"] .unit-summary-card p,
html[data-theme="dark"] .unit-info-grid span,
html[data-theme="dark"] .schedule-list span,
html[data-theme="dark"] .schedule-list em,
html[data-theme="dark"] .material-card small,
html[data-theme="dark"] .material-card p,
html[data-theme="dark"] .corp-preview small,
html[data-theme="dark"] .test-card span,
html[data-theme="dark"] .metric-card small,
html[data-theme="dark"] .metric-card em,
html[data-theme="dark"] .metric-card b {
  color: var(--muted);
}
html[data-theme="dark"] .panel-title h2,
html[data-theme="dark"] .card-kicker { color: #5ee0aa; }
html[data-theme="dark"] .field,
html[data-theme="dark"] .filters label { color: #cbd5e1; }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .filters input,
html[data-theme="dark"] .filters select,
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea {
  background: #0b1220;
  border-color: rgba(148, 163, 184, 0.22);
  color: var(--ink);
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #64748b; }
html[data-theme="dark"] table { color: var(--ink); }
html[data-theme="dark"] th { color: #a7b4c7; }
html[data-theme="dark"] td { border-bottom-color: rgba(148, 163, 184, 0.14); }
html[data-theme="dark"] .table-panel th:nth-child(3),
html[data-theme="dark"] .table-panel td:nth-child(3) { color: #f8fafc; }
html[data-theme="dark"] .badge { background: rgba(148, 163, 184, 0.14); color: #cbd5e1; }
html[data-theme="dark"] .badge.success { background: rgba(34, 197, 139, 0.14); color: #5ee0aa; }
html[data-theme="dark"] .badge.warn { background: rgba(234, 179, 8, 0.14); color: #facc15; }
html[data-theme="dark"] .badge.danger { background: rgba(248, 113, 113, 0.14); color: #fca5a5; }
html[data-theme="dark"] .modal { background: rgba(2, 6, 23, 0.7); }
html[data-theme="dark"] .backdrop { background: rgba(2, 6, 23, 0.64); }
html[data-theme="dark"] .button.primary,
html[data-theme="dark"] .primary-mini,
html[data-theme="dark"] .choice-button.is-active { background: var(--brand); border-color: var(--brand); color: #04130d; }
html[data-theme="dark"] .button.primary:hover,
html[data-theme="dark"] .primary-mini:hover { background: var(--brand-strong); color: #04130d; }
html[data-theme="dark"] .unit-summary-metrics span,
html[data-theme="dark"] .notice-card,
html[data-theme="dark"] .activity-list div,
html[data-theme="dark"] .unit-info-grid div { background: rgba(15, 23, 42, 0.86); }
.theme-option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.theme-option {
  display: grid;
  gap: 7px;
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 14px;
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}
.theme-option span { font-size: 26px; }
.theme-option strong { font-size: 15px; }
.theme-option small,
.settings-note { color: var(--muted); font-size: 12px; font-weight: 800; }
.theme-option:hover,
.theme-option.is-selected { transform: translateY(-3px); border-color: var(--brand); box-shadow: var(--shadow-hover); }
.theme-option.is-selected { background: var(--brand-soft); }
html[data-theme="dark"] .theme-option {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(15, 23, 42, 0.96));
  border-color: rgba(148, 163, 184, 0.18);
}
html[data-theme="dark"] .theme-option.is-selected { background: rgba(34, 197, 139, 0.12); }
.appearance-panel { grid-column: 1 / -1; }
.settings-note { margin: 12px 0 0; }
.trend-badge {
  display: inline-flex;
  width: max-content;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 950;
}
.trend-badge.up { background: rgba(34, 197, 94, 0.14); color: #16a34a; }
.trend-badge.down { background: rgba(239, 68, 68, 0.14); color: #dc2626; }
.trend-badge.stable { background: rgba(234, 179, 8, 0.16); color: #a16207; }
.metric-card b {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}
html[data-theme="dark"] .trend-badge.up { background: rgba(34, 197, 94, 0.16); color: #4ade80; }
html[data-theme="dark"] .trend-badge.down { background: rgba(248, 113, 113, 0.16); color: #f87171; }
html[data-theme="dark"] .trend-badge.stable { background: rgba(234, 179, 8, 0.16); color: #facc15; }
@media (max-width: 720px) {
  .theme-option-grid { grid-template-columns: 1fr; }
}


/* V1.3 - GIP frontend correction */
.nav-card[data-nav-id="gip"] { min-width: 112px; }
.gip-metric-grid { margin-bottom: 16px; }
.gip-rank-grid,
.gip-course-grid,
.gip-class-grid,
.gip-highlight-row {
  display: grid;
  gap: 12px;
}
.gip-rank-grid { grid-template-columns: repeat(4, minmax(160px, 1fr)); }
.gip-course-grid { grid-template-columns: repeat(3, minmax(240px, 1fr)); }
.gip-class-grid,
.gip-highlight-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gip-rank-card,
.gip-class-grid article,
.gip-highlight-row article {
  display: grid;
  gap: 6px;
  min-height: 112px;
  border: 1px solid color-mix(in srgb, var(--accent, var(--brand)) 22%, var(--line));
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, color-mix(in srgb, #f5f3ff 62%, #fff));
  color: var(--ink);
  padding: 14px;
  text-align: left;
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.gip-rank-card:hover,
.gip-class-grid article:hover,
.gip-highlight-row article:hover,
.gip-course-card:hover {
  transform: translateY(-4px);
  border-color: #7c3aed;
  box-shadow: var(--shadow-hover);
}
.gip-rank-card strong,
.gip-class-grid strong,
.gip-highlight-row strong { font-size: 16px; }
.gip-rank-card span,
.gip-rank-card em,
.gip-class-grid span,
.gip-class-grid em,
.gip-highlight-row span,
.course-meta span,
.video-placeholder {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}
.course-meta { display: grid; gap: 6px; margin-top: 4px; }
.video-player-frame {
  display: grid;
  min-height: 260px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(124, 58, 237, 0.32);
  border-radius: 12px;
  background: rgba(124, 58, 237, 0.06);
  padding: 12px;
}
.video-player-frame video { width: 100%; max-height: 360px; border-radius: 10px; background: #020617; }
.video-player-frame.is-vertical video { width: min(260px, 100%); aspect-ratio: 9 / 16; object-fit: cover; }
.video-player-frame video[src=""] { display: none; }
.video-player-frame video:not([src=""]) + .video-placeholder { display: none; }
html[data-theme="dark"] .gip-rank-card,
html[data-theme="dark"] .gip-class-grid article,
html[data-theme="dark"] .gip-highlight-row article {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(15, 23, 42, 0.96));
  border-color: rgba(148, 163, 184, 0.18);
}
html[data-theme="dark"] .video-player-frame { background: rgba(124, 58, 237, 0.08); border-color: rgba(167, 139, 250, 0.28); }
@media (max-width: 1180px) {
  .gip-rank-grid,
  .gip-course-grid,
  .gip-class-grid,
  .gip-highlight-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .gip-rank-grid,
  .gip-course-grid,
  .gip-class-grid,
  .gip-highlight-row { grid-template-columns: 1fr; }
}

/* V1.4 - auth screens and permission states */
body.auth-mode {
  min-height: 100vh;
  overflow: auto;
}
body.auth-mode .topbar,
body.auth-mode .sidebar,
body.auth-mode .workspace,
body.auth-mode .backdrop {
  display: none !important;
}
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 18% 18%, rgba(34, 197, 139, 0.14), transparent 28%),
    linear-gradient(135deg, #07111f 0%, #0f172a 48%, #06130e 100%);
  color: #f8fafc;
}
.auth-layout {
  width: min(1060px, 100%);
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(340px, 1.05fr);
  gap: 18px;
  align-items: stretch;
}
.auth-hero,
.auth-card {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.88);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}
.auth-hero {
  border-radius: 22px;
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
.auth-emblem {
  width: 118px;
  aspect-ratio: 1;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0f8b5f, #22c58b);
  box-shadow: 0 20px 50px rgba(15, 139, 95, 0.28);
  overflow: hidden;
}
.auth-emblem img { width: 100%; height: 100%; object-fit: cover; }
.auth-emblem span { font-size: 32px; font-weight: 900; color: #fff; }
.auth-hero strong { font-size: 32px; line-height: 1.05; }
.auth-hero span,
.auth-hero p,
.auth-card-head p,
.auth-state span,
.auth-state p { color: #a7b4c7; }
.auth-card {
  border-radius: 22px;
  padding: 30px;
}
.auth-card-head {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}
.auth-card-head h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0;
}
.auth-form {
  display: grid;
  gap: 14px;
}
.auth-form label {
  display: grid;
  gap: 7px;
  color: #cbd5e1;
  font-weight: 800;
  font-size: 13px;
}
.auth-form input {
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.42);
  color: #f8fafc;
  padding: 0 14px;
}
.auth-form input:focus {
  outline: none;
  border-color: #22c58b;
  box-shadow: 0 0 0 4px rgba(34, 197, 139, 0.12);
}
.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.auth-links button {
  border: 0;
  background: transparent;
  color: #5ee0aa;
  cursor: pointer;
  font-weight: 900;
}
.auth-card .button.full { width: 100%; justify-content: center; margin-top: 12px; }
.auth-state {
  display: grid;
  gap: 12px;
}
.auth-state strong { font-size: 20px; }
.auth-state .button { justify-content: center; }
.admin-discord-panel {
  border-color: rgba(34, 197, 139, 0.32);
}
.auth-logout-button { min-width: 72px; }
html[data-theme="light"] .auth-shell {
  background: linear-gradient(135deg, #f8fafc 0%, #eaf7f1 100%);
  color: #0f172a;
}
html[data-theme="light"] .auth-hero,
html[data-theme="light"] .auth-card {
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
}
html[data-theme="light"] .auth-form input {
  background: #fff;
  color: #0f172a;
}
html[data-theme="light"] .auth-hero span,
html[data-theme="light"] .auth-hero p,
html[data-theme="light"] .auth-card-head p,
html[data-theme="light"] .auth-state span,
html[data-theme="light"] .auth-state p { color: #526178; }
@media (max-width: 820px) {
  .auth-shell { padding: 18px; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-hero { padding: 24px; }
  .auth-card { padding: 22px; }
}