/* Vazirmatn 5.3.0 — self-hosted under SIL OFL 1.1. */
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("./fonts/vazirmatn-arabic-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("./fonts/vazirmatn-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("./fonts/vazirmatn-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --navy-950: #0d1f2d;
  --navy-900: #122b3d;
  --navy-800: #173d53;
  --slate-700: #3c5263;
  --slate-600: #5d7180;
  --slate-500: #7f909c;
  --slate-300: #cbd5dc;
  --slate-200: #dde5ea;
  --slate-100: #edf2f5;
  --slate-50: #f6f8fa;
  --white: #fff;
  --teal-700: #0d725f;
  --teal-600: #12866f;
  --teal-500: #20a184;
  --teal-100: #dff5ef;
  --gold-700: #b97800;
  --gold-600: #d99006;
  --gold-500: #f2ad13;
  --gold-100: #fff3d4;
  --blue-600: #2d6ca2;
  --blue-100: #e4f0f8;
  --amber-600: #c17815;
  --amber-100: #fff1d3;
  --red-600: #b54444;
  --red-100: #fbe5e5;
  --violet-600: #6e5ca5;
  --shadow-sm: 0 1px 2px rgba(15, 37, 52, .06);
  --shadow-md: 0 10px 30px rgba(15, 37, 52, .08);
  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --sidebar-width: 255px;
  font-family: "Vazirmatn", IRANSansX, "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--navy-950);
  background: var(--slate-50);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }

button { cursor: pointer; }

.date-field input,
input[name="starts_on"],
input[name="ends_on"],
input[data-setting-type="date"] {
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.date-field input:invalid,
input[name="starts_on"]:invalid,
input[name="ends_on"]:invalid,
input[data-setting-type="date"]:invalid {
  border-color: var(--red-600);
  background: var(--red-100);
}

.hidden { display: none !important; }

.eyebrow {
  margin: 0 0 2px;
  color: var(--gold-600);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.muted { color: var(--slate-600); }

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(400px, 42%) 1fr;
  background: var(--white);
}

.login-panel {
  width: min(430px, calc(100% - 64px));
  margin: auto;
  padding: 48px 0;
}

.login-panel h1 {
  margin: 8px 0 8px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.25;
}

.login-panel form { margin-top: 32px; }

.login-wordmark {
  display: block;
  width: 190px;
  height: 215px;
  margin: -20px 0 8px auto;
  object-fit: contain;
  object-position: center;
}

.login-panel label {
  display: grid;
  gap: 7px;
  margin-bottom: 18px;
  color: var(--slate-700);
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  color: var(--navy-950);
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(32, 161, 132, .12);
}

input:disabled, select:disabled, textarea:disabled {
  color: var(--slate-600);
  background: var(--slate-100);
  cursor: not-allowed;
}

.form-error {
  min-height: 23px;
  margin: -7px 0 12px;
  color: var(--red-600);
}

.sidebar-logo {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 5px;
  background: var(--white);
  border-radius: 11px;
}
.sidebar-logo img { width: 100%; height: 100%; object-fit: contain; }

.login-aside {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 18% 8%, rgba(32,161,132,.18), transparent 32%),
    radial-gradient(circle at 90% 90%, rgba(45,108,162,.25), transparent 35%),
    var(--navy-950);
}

.login-aside::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .12;
  background-image:
    linear-gradient(rgba(255,255,255,.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.2) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent);
}

.login-visual {
  position: relative;
  width: min(760px, 86%);
  padding: 90px 50px 50px;
}

.login-visual svg {
  width: 100%;
  filter: drop-shadow(0 16px 40px rgba(0,0,0,.2));
}

.visual-grid { stroke: rgba(255,255,255,.1); stroke-width: 1; fill: none; }
.visual-area { fill: url(#chartFill); }
.visual-line { stroke: #f2ad13; stroke-width: 5; stroke-linecap: round; fill: none; }

.visual-card {
  position: absolute;
  z-index: 2;
  display: grid;
  min-width: 190px;
  padding: 18px 20px;
  color: var(--white);
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(0,0,0,.18);
  backdrop-filter: blur(14px);
}

.visual-card span, .visual-card small { color: rgba(255,255,255,.65); }
.visual-card strong { margin: 2px 0; font-size: 32px; }
.visual-main { top: 0; right: 5%; }
.visual-secondary { bottom: 8%; left: 1%; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 750;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}

.button:active { transform: translateY(1px); }
.button.primary { color: var(--navy-950); background: var(--gold-500); }
.button.primary:hover { background: var(--gold-600); }
.button.secondary { color: var(--navy-900); background: var(--white); border-color: var(--slate-200); }
.button.secondary:hover { border-color: var(--slate-300); background: var(--slate-50); }
.button.ghost { color: var(--slate-700); background: transparent; }
.button.ghost:hover { background: var(--slate-100); }
.button.wide { width: 100%; min-height: 48px; }

.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 9px;
}
.icon-button:hover { background: rgba(255,255,255,.08); }

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  color: rgba(255,255,255,.72);
  background: var(--navy-950);
  box-shadow: -10px 0 35px rgba(15,37,52,.08);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 76px;
  padding: 16px 19px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.sidebar-brand strong { display: block; color: var(--white); font-size: 15px; }
.sidebar-brand span { font-size: 11px; color: rgba(255,255,255,.44); }

.main-nav {
  overflow-y: auto;
  flex: 1;
  padding: 12px 11px 24px;
  scrollbar-width: thin;
}

.nav-caption {
  margin: 19px 12px 7px;
  color: rgba(255,255,255,.32);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 43px;
  padding: 8px 11px;
  color: inherit;
  text-align: right;
  background: transparent;
  border: 0;
  border-radius: 9px;
  transition: color .15s ease, background .15s ease;
}

.nav-item:hover { color: var(--white); background: rgba(255,255,255,.05); }
.nav-item.active { color: var(--white); background: rgba(242,173,19,.16); }
.nav-icon { width: 22px; color: var(--gold-500); font-size: 17px; text-align: center; }

.sidebar-user {
  display: grid;
  grid-template-columns: 38px 1fr 36px;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 13px 15px;
  border-top: 1px solid rgba(255,255,255,.07);
}

.sidebar-user strong { display: block; color: var(--white); font-size: 12px; }
.sidebar-user span { display: block; color: rgba(255,255,255,.4); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; color: var(--navy-950); background: var(--teal-100); border-radius: 50%; font-weight: 900; }

.workspace { min-height: 100vh; margin-right: var(--sidebar-width); }

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 25px;
  background: rgba(246,248,250,.92);
  border-bottom: 1px solid var(--slate-200);
  backdrop-filter: blur(12px);
}

.page-heading { display: flex; align-items: center; gap: 8px; min-width: 180px; }
.page-heading h1 { margin: 0; font-size: 20px; }

.context-controls { display: flex; align-items: end; gap: 9px; }
.compact-field { display: grid; gap: 2px; min-width: 135px; }
.compact-field span { color: var(--slate-500); font-size: 10px; font-weight: 700; }
.compact-field select, .compact-field input { min-height: 39px; padding: 7px 10px; font-size: 12px; }
.date-field { min-width: 132px; }

.page {
  display: none;
  padding: 24px;
  animation: pageIn .2s ease;
}
.page.active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

.global-message {
  margin: 16px 24px 0;
  padding: 10px 13px;
  color: var(--navy-900);
  background: var(--blue-100);
  border: 1px solid #c8ddea;
  border-radius: 10px;
}
.global-message.error { color: var(--red-600); background: var(--red-100); border-color: #efcaca; }

.dashboard-toolbar, .page-actions, .settings-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.freshness-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 45px;
  padding: 7px 12px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
}
.freshness-pill strong, .freshness-pill small { display: block; }
.freshness-pill strong { font-size: 12px; }
.freshness-pill small { color: var(--slate-500); font-size: 10px; }
.status-dot { width: 9px; height: 9px; background: var(--slate-300); border-radius: 50%; box-shadow: 0 0 0 4px var(--slate-100); }
.freshness-pill.fresh .status-dot { background: var(--teal-500); box-shadow: 0 0 0 4px var(--teal-100); }
.freshness-pill.stale .status-dot { background: var(--amber-600); box-shadow: 0 0 0 4px var(--amber-100); }
.toolbar-actions { display: flex; align-items: center; gap: 8px; }
.report-tabs {
  overflow-x: auto;
  display: flex;
  gap: 7px;
  margin: -4px 0 16px;
  padding-bottom: 3px;
  scrollbar-width: thin;
}
.report-tab {
  min-width: max-content;
  min-height: 34px;
  padding: 6px 11px;
  color: var(--slate-600);
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 750;
}
.report-tab:hover { border-color: var(--slate-300); }
.report-tab.active { color: var(--gold-700); background: var(--gold-100); border-color: #f0d89b; }

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

.kpi-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 17px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--slate-300);
}
.kpi-card.green::before { background: var(--teal-500); }
.kpi-card.yellow::before { background: var(--amber-600); }
.kpi-card.red::before, .kpi-card.critical::before { background: var(--red-600); }

.kpi-card-header { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.kpi-card-label { color: var(--slate-600); font-size: 11px; font-weight: 750; }
.kpi-card-value { margin: 11px 0 4px; font-size: clamp(22px, 2.2vw, 31px); font-weight: 850; letter-spacing: -.02em; line-height: 1.2; }
.kpi-card-meta { display: flex; align-items: center; justify-content: space-between; color: var(--slate-500); font-size: 10px; }
.delta { direction: ltr; padding: 2px 6px; background: var(--slate-100); border-radius: 6px; }
.delta.up { color: var(--teal-700); background: var(--teal-100); }
.delta.down { color: var(--red-600); background: var(--red-100); }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}
.status-chip.green { color: var(--teal-700); background: var(--teal-100); }
.status-chip.yellow, .status-chip.orange { color: var(--amber-600); background: var(--amber-100); }
.status-chip.red, .status-chip.critical, .status-chip.fail { color: var(--red-600); background: var(--red-100); }
.status-chip.unknown, .status-chip.neutral { color: var(--slate-600); background: var(--slate-100); }

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

.panel {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.chart-panel { min-height: 385px; padding: 16px; }
.chart-panel.span-2 { grid-column: span 2; min-height: 440px; }
.panel-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 2px 3px 10px; }
.panel-header h2 { margin: 0; font-size: 15px; }
.legend-note { color: var(--slate-500); font-size: 10px; }
.chart { width: 100%; height: 315px; direction: ltr; }
.chart.large { height: 360px; }

.alerts-panel { margin-top: 14px; padding: 16px; }
.count-badge { display: grid; place-items: center; min-width: 26px; height: 26px; color: var(--red-600); background: var(--red-100); border-radius: 8px; font-weight: 850; }
.count-badge.neutral { color: var(--blue-600); background: var(--blue-100); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 12px; text-align: right; border-bottom: 1px solid var(--slate-100); white-space: nowrap; }
th { color: var(--slate-500); font-size: 10px; font-weight: 800; }
td { font-size: 11px; }
tbody tr:hover { background: var(--slate-50); }

.empty-state, .placeholder-panel {
  min-height: 420px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: 45px;
}
.empty-state p, .placeholder-panel p { max-width: 570px; margin: 4px auto 22px; color: var(--slate-600); }
.empty-state h2, .placeholder-panel h2 { margin: 10px 0 0; font-size: 20px; }
.empty-icon { display: grid; place-items: center; width: 58px; height: 58px; color: var(--teal-600); background: var(--teal-100); border-radius: 18px; font-size: 25px; }

.search-box { position: relative; width: min(520px, 100%); }
.search-box span { position: absolute; top: 50%; right: 13px; transform: translateY(-50%); color: var(--slate-500); }
.search-box input { padding-right: 38px; }
.page-actions select { width: 210px; }
.kpi-table-wrap { max-height: calc(100vh - 190px); }
.kpi-table-wrap thead { position: sticky; z-index: 2; top: 0; background: var(--white); }
.formula-cell { max-width: 320px; color: var(--slate-600); white-space: normal; }

.settings-page { padding: 0; }
.settings-layout { min-height: calc(100vh - 77px); display: grid; grid-template-columns: 235px 1fr; }
.settings-nav { padding: 23px 14px; background: var(--white); border-left: 1px solid var(--slate-200); }
.settings-nav-title { padding: 0 10px 14px; }
.settings-nav-title h2 { margin: 0; font-size: 15px; }
.settings-section-button {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--slate-600);
  text-align: right;
  background: transparent;
  border: 0;
  border-radius: 8px;
}
.settings-section-button:hover { background: var(--slate-50); }
.settings-section-button.active { color: var(--gold-700); background: var(--gold-100); font-weight: 800; }
.settings-content { padding: 24px; min-width: 0; }
.settings-toolbar h2 { margin: 0; font-size: 18px; }
.settings-toolbar p { margin: 3px 0 0; color: var(--slate-600); font-size: 11px; }
.dirty-indicator { color: var(--amber-600); font-size: 10px; font-weight: 800; }

.settings-form { display: grid; gap: 13px; }
.setting-group {
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
}
.setting-group-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.setting-group-header h3 { margin: 0; font-size: 14px; }
.setting-group-header p { margin: 2px 0 0; color: var(--slate-500); font-size: 10px; }
.setting-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.setting-field { display: grid; gap: 6px; align-content: start; }
.setting-field.full { grid-column: 1 / -1; }
.setting-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.setting-field label { color: var(--slate-700); font-size: 11px; font-weight: 800; }
.setting-field small { color: var(--slate-500); font-size: 9px; }
.setting-field textarea { min-height: 100px; resize: vertical; direction: ltr; text-align: left; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.source-badge { padding: 2px 6px; color: var(--blue-600); background: var(--blue-100); border-radius: 5px; font-size: 8px; white-space: nowrap; }
.locked-badge { color: var(--slate-600); background: var(--slate-100); }
.secret-state { min-height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: var(--slate-50); border: 1px solid var(--slate-200); border-radius: var(--radius-sm); }
.secret-reference { display: grid; gap: 5px; }

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.admin-panel { min-width: 0; padding: 17px; }
.admin-panel.span-2 { grid-column: span 2; }
.admin-panel > .panel-header { border-bottom: 1px solid var(--slate-100); }
.admin-create {
  margin: 12px 0;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
}
.admin-create summary {
  padding: 10px 13px;
  color: var(--teal-700);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
  user-select: none;
}
.admin-create[open] summary { border-bottom: 1px solid var(--slate-200); }
.compact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 11px;
  padding: 14px;
}
.compact-form.wide-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.compact-form label { display: grid; gap: 4px; color: var(--slate-600); font-size: 10px; font-weight: 750; }
.compact-form label.full { grid-column: 1 / -1; }
.compact-form label small { color: var(--slate-500); font-size: 9px; }
.compact-form input, .compact-form select { min-height: 40px; }
.check-field {
  display: flex !important;
  grid-template-columns: 18px 1fr;
  align-items: center;
  align-self: center;
  min-height: 40px;
}
.check-field input { width: 17px; min-height: 17px; margin: 0; }
.admin-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-table-wrap { max-height: 370px; }
.wrap-cell { min-width: 180px; max-width: 360px; white-space: normal; }
.row-actions { display: flex; align-items: center; gap: 2px; }
.row-actions .button { min-height: 30px; padding: 4px 7px; font-size: 9px; }
.entity-list { display: grid; gap: 7px; margin-top: 11px; }
.entity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--slate-100);
  border-radius: 9px;
}
.entity-row strong, .entity-row small { display: block; }
.entity-row small { color: var(--slate-500); font-size: 9px; }
.entity-tags { display: flex; flex-wrap: wrap; justify-content: end; gap: 5px; }
.entity-tags span {
  padding: 3px 7px;
  color: var(--slate-600);
  background: var(--slate-100);
  border-radius: 6px;
  font-size: 9px;
}
.revision-state { display: inline-flex; padding: 3px 7px; color: var(--slate-600); background: var(--slate-100); border-radius: 6px; font-size: 9px; font-weight: 800; }
.state-published { color: var(--teal-700); background: var(--teal-100); }
.state-approved, .state-validated { color: var(--blue-600); background: var(--blue-100); }
.state-rejected { color: var(--red-600); background: var(--red-100); }
.audit-table-wrap { max-height: calc(100vh - 180px); }
.audit-table-wrap code { font-size: 9px; color: var(--slate-600); }
.plugin-admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  padding-top: 12px;
}
.plugin-admin-card {
  display: grid;
  grid-template-columns: 35px 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 75px;
  padding: 10px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
}
.plugin-admin-card.disabled { opacity: .58; background: var(--slate-50); }
.plugin-admin-card strong, .plugin-admin-card small { display: block; }
.plugin-admin-card strong { font-size: 11px; }
.plugin-admin-card small {
  overflow: hidden;
  color: var(--slate-500);
  font-size: 8px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.plugin-admin-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--gold-700);
  background: var(--gold-100);
  border-radius: 9px;
  font-size: 17px;
}
.switch { position: relative; width: 34px; height: 20px; }
.switch input { position: absolute; width: 1px; height: 1px; min-height: 1px; opacity: 0; }
.switch span { position: absolute; inset: 0; background: var(--slate-300); border-radius: 99px; transition: .15s ease; }
.switch span::after { content: ""; position: absolute; top: 3px; right: 3px; width: 14px; height: 14px; background: var(--white); border-radius: 50%; box-shadow: var(--shadow-sm); transition: .15s ease; }
.switch input:checked + span { background: var(--teal-500); }
.switch input:checked + span::after { transform: translateX(-14px); }
.switch input:disabled + span { cursor: not-allowed; opacity: .7; }

.mobile-only { display: none; }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .date-field { display: none; }
}

@media (max-width: 920px) {
  :root { --sidebar-width: 230px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .context-controls { width: 100%; flex-wrap: wrap; }
  .compact-field { flex: 1; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-grid { grid-template-columns: 1fr; }
  .chart-panel.span-2 { grid-column: span 1; }
  .settings-layout { grid-template-columns: 190px 1fr; }
  .setting-grid { grid-template-columns: 1fr; }
  .compact-form.wide-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plugin-admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .sidebar { transform: translateX(100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .workspace { margin-right: 0; }
  .mobile-only { display: inline-grid; place-items: center; }
  .topbar { padding: 12px 15px; }
  .page { padding: 15px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .dashboard-toolbar, .page-actions, .settings-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions { flex-wrap: wrap; }
  .settings-layout { display: block; }
  .settings-nav { overflow-x: auto; padding: 12px; border: 0; border-bottom: 1px solid var(--slate-200); }
  .settings-nav-title { display: none; }
  #settings-sections { display: flex; gap: 6px; }
  .settings-section-button { min-width: max-content; }
  .settings-content { padding: 15px; }
  .login-screen { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-panel.span-2 { grid-column: span 1; }
  .admin-split { grid-template-columns: 1fr; }
  .compact-form, .compact-form.wide-form { grid-template-columns: 1fr; }
  .compact-form label.full { grid-column: auto; }
  .plugin-admin-grid { grid-template-columns: 1fr; }
}
