:root {
  --ink: #102a32;
  --teal: #0f4c5c;
  --teal-deep: #0b3a46;
  --teal-soft: #e6f2f4;
  --gold: #d4a017;
  --gold-soft: #f8edd0;
  --paper: #f3f1ea;
  --card: #fffcf7;
  --line: #d7d1c4;
  --danger: #b42318;
  --ok: #2f6f4e;
  --muted: #5b6b70;
  --sidebar: 272px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 28px;
  --shadow-soft: 0 8px 24px rgba(16, 42, 50, .04);
  --shadow-lift: 0 18px 50px rgba(16, 42, 50, .08);
  --space-section: clamp(4.5rem, 8vw, 7.5rem);
  --font-display: 'Manrope', 'IBM Plex Sans Arabic', sans-serif;
  --font-body: 'Inter', 'IBM Plex Sans Arabic', sans-serif;
  --font-latin: 'Manrope', 'Inter', sans-serif;
  --font-arabic: 'IBM Plex Sans Arabic', 'Tajawal', sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Tajawal', sans-serif;
  background: var(--paper);
  color: var(--ink);
  margin: 0;
}

html[lang="en"] .app-shell,
html[lang="en"] .app-shell button,
html[lang="en"] .app-shell input,
html[lang="en"] .app-shell select,
html[lang="en"] .app-shell textarea {
  font-family: var(--font-body);
}
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
  width: var(--sidebar);
  background: linear-gradient(180deg, var(--teal-deep), #072830);
  color: #eef6f7;
  padding: 1.25rem 1rem 2rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.brand {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: .7rem;
  align-items: center;
  margin: 0 0 .9rem;
  padding: .7rem .7rem .72rem;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(240,212,138,.16), rgba(255,255,255,.04));
  box-shadow: inset 0 0 0 1px rgba(240,212,138,.34);
  text-decoration: none;
  color: inherit;
}
.brand:hover { color: #fff; }
.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: block;
  box-shadow: 0 0 0 1px rgba(240,212,138,.55), 0 8px 14px rgba(0,0,0,.22);
}
.brand-copy { min-width: 0; display: flex; flex-direction: column; gap: .28rem; }
.brand-line { display: flex; align-items: center; justify-content: space-between; gap: .35rem; }
.brand-product {
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1;
  color: #fff;
  letter-spacing: -0.03em;
}
.brand-meta { display: flex; align-items: center; gap: .38rem; min-width: 0; }
.brand-name {
  font-weight: 700;
  font-size: .84rem;
  line-height: 1.2;
  color: #f0d48a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-dot { width: 3px; height: 3px; border-radius: 50%; background: rgba(240,212,138,.75); flex: 0 0 3px; }
.brand-sub { font-size: .72rem; color: rgba(238,246,247,.62); white-space: nowrap; }
.nav-label {
  margin: 1rem .6rem .35rem; font-size: .72rem; letter-spacing: .08em;
  opacity: .55; text-transform: uppercase;
}
.side-nav a {
  display: flex; align-items: center; gap: .7rem;
  color: #d7e6e9; text-decoration: none;
  padding: .55rem .75rem; border-radius: 10px; margin-bottom: .2rem;
}
.side-nav a i { opacity: .85; }
.side-nav a:hover, .side-nav a.active {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.side-nav a.active { background: rgba(212,160,23,.18); color: #f8edd0; }

.app-main { flex: 1; min-width: 0; }
.app-navbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem 1.6rem .4rem; gap: 1rem;
}
.page-title { font-size: 1.45rem; font-weight: 800; margin: 0; }
.page-sub { color: var(--muted); font-size: .9rem; }
.nav-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; justify-content: flex-end; }
.school-chip, .year-chip, .user-chip {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: .4rem .85rem;
  display: flex; align-items: center; gap: .5rem;
}
.school-chip {
  background: var(--teal-soft);
  border-color: #c5dde2;
  color: var(--teal-deep);
}
.school-chip i { color: var(--teal); }
.school-chip strong { font-size: .98rem; }
.user-chip small { display: block; color: var(--muted); font-size: .75rem; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--teal); color: #fff; display: grid; place-items: center; font-weight: 700;
}
.app-content { padding: 1rem 1.6rem 2.5rem; }

.card-soft {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 8px 24px rgba(16,42,50,.04);
}
.dash-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-bottom: .9rem; }
.dash-kpi { display: flex; align-items: center; gap: .75rem; padding: .85rem .95rem; }
.dash-kpi > i {
  width: 2.15rem; height: 2.15rem; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); font-size: 1rem;
}
.dash-kpi .label { color: var(--muted); font-size: .78rem; line-height: 1.3; }
.dash-kpi .value { font-size: 1.45rem; font-weight: 800; color: var(--teal); line-height: 1.05; margin-top: .08rem; }
.dash-meter { height: 3px; margin-top: .4rem; border-radius: 99px; background: #e7e2d6; overflow: hidden; }
.dash-meter span { display: block; height: 100%; background: var(--teal); }
.dash-main { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(200px, .72fr); gap: .8rem; margin-bottom: .8rem; align-items: start; }
.dash-card { padding: 1rem 1.05rem 1.05rem; }
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .7rem; }
.dash-head h2, .dash-card > h2 { margin: 0; font-size: .98rem; font-weight: 800; }
.dash-card > h2 { margin-bottom: .35rem; }
.dash-empty { margin: .15rem 0 .75rem; }
.dash-actions { display: flex; flex-direction: column; gap: .5rem; }
.dash-go {
  display: flex; align-items: center; gap: .65rem;
  padding: .72rem .9rem; border-radius: 14px; text-decoration: none; font-weight: 700;
  border: 1px solid transparent;
}
.dash-go i { font-size: 1.05rem; }
.dash-go.is-teal { background: var(--teal); color: #fff; }
.dash-go.is-gold { background: var(--gold); color: #2a2108; }
.dash-go.is-ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.dash-go.is-teal:hover { color: #fff; background: #0c3d4a; }
.dash-go.is-gold:hover { color: #2a2108; background: #c09112; }
.dash-go.is-ghost:hover { color: var(--ink); background: #fff; }
.dash-split { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.dash-row {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .6rem 0; border-bottom: 1px solid #ece7dc;
}
.dash-row:last-child { border-bottom: 0; padding-bottom: 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1rem; }
.kpi {
  padding: 1.1rem 1.2rem;
}
.kpi .label { color: var(--muted); font-size: .85rem; }
.kpi .value { font-size: 1.8rem; font-weight: 800; color: var(--teal); }
.kpi .hint { font-size: .8rem; color: var(--muted); }

.table { --bs-table-bg: transparent; }
.table thead th {
  background: var(--teal-soft); color: var(--teal-deep);
  font-weight: 700; border-bottom: 0; white-space: nowrap;
}
.btn-primary {
  --bs-btn-bg: var(--teal);
  --bs-btn-border-color: var(--teal);
  --bs-btn-hover-bg: #0c3d4a;
  --bs-btn-hover-border-color: #0c3d4a;
}
.btn-gold {
  background: var(--gold); border-color: var(--gold); color: #2a2108; font-weight: 700;
}
.btn-gold:hover { background: #c09112; color: #2a2108; }
.btn-ghost {
  background: transparent; border: 1px solid var(--line); color: var(--ink);
}
.badge-soft { background: var(--teal-soft); color: var(--teal); }
.badge-gold { background: var(--gold-soft); color: #7a5b10; }
.badge-danger-soft { background: #f8d7da; color: var(--danger); }
.badge-ok { background: #d8f3e2; color: var(--ok); }

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.page-head .btn { white-space: nowrap; flex-shrink: 0; }
.page-lede { margin: 0 0 1rem; }
.print-title { display: none; }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; }

.schedule-wrap { overflow: auto; }
.schedule-table {
  width: 100%; border-collapse: collapse; min-width: 1100px;
  background: #fff; font-size: .88rem;
}
.schedule-table th, .schedule-table td {
  border: 1px solid #c9c2b4; text-align: center; padding: .28rem;
}
.schedule-table thead th { background: #0f4c5c; color: #fff; }
.schedule-table .day-head { background: #163e48; }
.schedule-table .teacher-col { background: #f8edd0; font-weight: 700; min-width: 140px; text-align: start; padding-inline: .6rem; }
.schedule-table .head-row { background: #efe6cf; font-weight: 800; }
.cell-lesson { background: #eef7f4; cursor: pointer; }
.cell-lesson.locked { background: #f8edd0; }
.cell-empty { background: #fff; }
.cell-lesson a { color: inherit; text-decoration: none; font-weight: 700; }
.footnotes { margin-top: .8rem; color: var(--muted); font-size: .9rem; }

.auth-body {
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, #1a5c6c, #072830 55%);
  display: grid; place-items: center; padding: 2rem;
}
.auth-card {
  width: min(420px, 100%);
  background: #fffcf7; border-radius: 24px; padding: 2rem;
  box-shadow: 0 20px 50px rgba(0,0,0,.2);
}
.auth-card h1 { font-weight: 800; color: var(--teal); }

.form-section { padding: 1.25rem; margin-bottom: 1rem; }
.help { color: var(--muted); font-size: .85rem; }
.conflict-item { border-inline-start: 4px solid var(--danger); }

.howto-banner { background: linear-gradient(180deg, #fffdf8, #fffcf7); }
.howto-steps { padding-inline-start: 1.1rem; }
.howto-steps li { margin-bottom: .45rem; }

.week-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  min-width: 720px;
}
.week-grid th, .week-grid td {
  border: 1px solid #c9c2b4;
  text-align: center;
  vertical-align: middle;
  padding: .55rem .4rem;
}
.week-grid thead th {
  background: #0f4c5c;
  color: #fff;
  height: 52px;
  font-weight: 800;
}
.week-grid .period-col {
  width: 84px;
  background: #f8edd0;
  color: #102a32;
  font-weight: 800;
}
.week-grid td.is-drop { outline: 2px solid var(--teal); outline-offset: -2px; background: #e7f6f1; }
.week-grid td[draggable="true"] { cursor: grab; }
.cell-link { color: inherit; text-decoration: none; display: block; }
.cell-link:hover { color: inherit; }
.week-grid .cell-filled { background: #eef7f4; }
.week-grid .cell-empty { background: #fff; }
.week-grid .cell-off { background: #eeeae2; color: #8a8376; }
.cell-main { font-weight: 800; color: var(--teal); line-height: 1.3; }
.cell-sub { font-size: .82rem; color: var(--muted); margin-top: .2rem; }
.cell-code { font-weight: 800; font-size: .92rem; }

.dept-grid { min-width: 980px; }
.dept-grid td, .dept-grid .period-num {
  min-width: 54px;
  width: 54px;
  height: 54px;
  padding: .2rem;
}
.code-hint { position: relative; background: linear-gradient(180deg, #f0faf7, #fff); border: 1px solid #c5e8dc; }
.code-hint-close {
  position: absolute;
  top: .55rem;
  inset-inline-end: .55rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  line-height: 1;
}
.code-hint-close:hover { background: rgba(15, 76, 92, .08); color: var(--teal); }
.code-hint-icon { font-size: 1.5rem; color: var(--teal); line-height: 1; }
.code-examples { display: flex; flex-wrap: wrap; gap: .5rem .75rem; }
.code-example {
  display: inline-block;
  background: #fff;
  border: 1px solid #d8ebe4;
  border-radius: 10px;
  padding: .35rem .65rem;
  font-size: .85rem;
}

.hub-doors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}
.hub-door {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 2px solid #d8ebe4;
  border-radius: 18px;
  padding: 1.35rem 1.2rem;
  min-height: 168px;
  transition: border-color .15s, background .15s, transform .15s, box-shadow .15s;
}
.hub-door:hover {
  border-color: var(--teal);
  background: #f0faf7;
  color: inherit;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 76, 92, .12);
}
.hub-door-kicker {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  font-size: .85rem;
  display: grid;
  place-items: center;
  margin-bottom: .55rem;
}
.hub-door-kicker-gold { background: #b8860b; }
.hub-door-title { font-size: 1.05rem; color: var(--teal); }
.hub-door-count {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--teal);
  line-height: 1.1;
  margin: .15rem 0 .1rem;
}
.picker-toolbar {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
}
.picker-toolbar .form-control { max-width: 280px; }
.picker-head { display: flex; gap: .75rem; align-items: flex-start; }
.picker-num {
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: .95rem;
}
.picker-num-gold { background: #b8860b; }

.dept-grid-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .6rem;
}
.dept-pick-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--teal);
  color: #fff;
  border-radius: 12px;
  padding: .75rem .85rem;
  transition: transform .15s, box-shadow .15s;
}
.dept-pick-card:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 76, 92, .25);
}
.dept-pick-title { display: block; font-weight: 800; font-size: .92rem; line-height: 1.35; }
.dept-pick-hint { display: block; font-size: .75rem; opacity: .85; margin-top: .2rem; }

.grade-block { margin-top: 0; padding-top: 0; border-top: 0; }
.grade-block + .grade-block { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px dashed #ddd5c8; }
.grade-block-title {
  font-size: .95rem;
  font-weight: 800;
  color: var(--teal);
  margin-bottom: .65rem;
}

.class-grid-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: .55rem;
}
.class-pick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 2px solid #d8ebe4;
  border-radius: 14px;
  padding: .7rem .5rem .55rem;
  min-height: 96px;
  transition: border-color .15s, background .15s, transform .15s;
}
.class-pick-card:hover {
  border-color: var(--teal);
  background: #f0faf7;
  transform: translateY(-2px);
  color: inherit;
}
.class-pick-code {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--teal);
  line-height: 1.1;
}
.class-pick-label {
  font-size: .78rem;
  color: var(--muted);
  margin-top: .15rem;
}
.teacher-grid-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .55rem;
}
.teacher-pick-card {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .7rem .8rem;
}
.teacher-pick-card:hover {
  border-color: var(--teal);
  background: #f0faf7;
  color: inherit;
}
.teacher-pick-card strong { color: var(--teal); }

.class-title-banner {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.class-title-code {
  flex: 0 0 auto;
  min-width: 72px;
  padding: .65rem .85rem;
  border-radius: 14px;
  background: var(--teal);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
}

.teacher-row-label {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  text-align: start;
}
.teacher-code {
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  display: grid;
  place-items: center;
  line-height: 1;
  font-family: inherit;
  letter-spacing: 0;
}
.teacher-code-sm {
  width: 1.75rem;
  height: 1.75rem;
  font-size: .95rem;
  display: inline-grid;
}
.teacher-code-missing {
  background: #c9c3b8;
  color: #5c574f;
  font-size: .85rem;
}
.teacher-row-names strong { display: block; line-height: 1.3; }
.teacher-row-note {
  display: block;
  font-size: .72rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: .15rem;
  line-height: 1.35;
}
.dept-legend {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  background: #fffdf8;
  border: 1px solid #e8dfd0;
  border-radius: 12px;
}
.dept-legend-title { font-weight: 800; color: var(--teal); margin-bottom: .35rem; }
.dept-legend-table th { background: #f8edd0; font-size: .85rem; }
.dept-legend-table td { font-size: .85rem; vertical-align: middle; }
.dept-legend-compact { font-size: .85rem; color: var(--muted); }

.dept-grid .teacher-col {
  position: sticky;
  inset-inline-start: 0;
  z-index: 2;
  min-width: 240px;
  width: 240px;
  box-shadow: -6px 0 8px rgba(16,42,50,.04);
}
html[dir="ltr"] .dept-grid .teacher-col {
  box-shadow: 6px 0 8px rgba(16,42,50,.04);
}
.dept-grid .teacher-col a { color: inherit; text-decoration: none; }

.scenario-step {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.scenario-step:last-child { border-bottom: 0; }
.scenario-step .num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--teal); color: #fff; font-weight: 800;
  display: grid; place-items: center; flex-shrink: 0;
}

.cell-add { opacity: 0; }
.schedule-table td:hover .cell-add { opacity: 1; }
.coverage-hero {
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
}
.coverage-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: .45rem;
}
.coverage-hero-top .btn { flex-shrink: 0; }
.coverage-kicker {
  font-weight: 800;
  color: var(--teal);
  font-size: .95rem;
}
.coverage-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .85rem;
  margin-bottom: 1rem;
}
.coverage-stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: .9rem 1rem;
}
.coverage-stat .label {
  display: block;
  color: var(--muted);
  font-size: .8rem;
  margin-bottom: .15rem;
}
.coverage-stat strong {
  display: block;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--teal);
  line-height: 1.2;
}
.coverage-stat small {
  color: var(--muted);
  font-size: .78rem;
}
.coverage-stat.is-alert {
  border-color: #efc2c2;
  background: #fff8f8;
}
.coverage-stat.is-alert strong { color: var(--danger); }
.coverage-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding: 1rem 1.15rem;
  margin-bottom: .85rem;
  flex-wrap: wrap;
}
.coverage-filters {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  flex: 1;
}
.coverage-field {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  min-width: 160px;
}
.coverage-field span {
  font-size: .8rem;
  font-weight: 700;
  color: var(--teal-deep);
}
.coverage-field-teacher { min-width: 220px; flex: 1; }
.coverage-pills {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  margin-bottom: .85rem;
}
.coverage-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .35rem .8rem;
  font-size: .85rem;
  font-weight: 700;
}
.coverage-pill span { color: var(--muted); font-weight: 500; font-size: .78rem; }
.coverage-pill:hover { border-color: var(--teal); color: var(--teal); }
.coverage-pill.is-active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.coverage-pill.is-active span { color: #d7e6e9; }
.coverage-summary { margin-bottom: 1.1rem; }
.coverage-day { margin-bottom: 1.6rem; }
.coverage-day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: .75rem;
}
.coverage-day-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--teal-deep);
  margin: 0;
}
.coverage-teacher-grid {
  display: grid;
  gap: .9rem;
}
.coverage-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(16,42,50,.04);
  overflow: hidden;
}
.coverage-card.is-focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,160,23,.22);
}
.coverage-card.is-cancelled { opacity: .62; }
.coverage-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.1rem .85rem;
  border-bottom: 1px solid #efe8da;
}
.coverage-teacher { display: flex; gap: .75rem; align-items: center; min-width: 0; }
.coverage-avatar {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--teal); color: #fff;
  display: grid; place-items: center;
  font-weight: 800; flex-shrink: 0;
}
.coverage-teacher-name {
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 .1rem;
}
.coverage-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .25rem;
}
.coverage-table { font-size: .9rem; min-width: 760px; }
.coverage-table tbody tr.is-uncovered { background: #fff8f8; }
.coverage-actions { white-space: nowrap; }
.coverage-actions .btn, .coverage-actions form { margin-inline-start: .2rem; }
.coverage-card-foot {
  display: flex;
  justify-content: flex-end;
  gap: .4rem;
  padding: .7rem 1rem;
  border-top: 1px solid #efe8da;
  background: #fffdf8;
}
.coverage-card-empty { padding: 1rem 1.1rem; }
.coverage-empty {
  text-align: center;
  padding: 2.4rem 1.5rem;
}
.coverage-empty-icon {
  font-size: 2rem;
  color: var(--teal);
  margin-bottom: .6rem;
}
.coverage-why { width: min(420px, 100%); }
.coverage-why-text { line-height: 1.85; color: var(--ink); }
.coverage-why-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-top: 1rem;
}
.coverage-why-grid div {
  background: var(--teal-soft);
  border-radius: 12px;
  padding: .7rem .8rem;
}
.coverage-why-grid small {
  display: block;
  color: var(--muted);
  font-size: .75rem;
  margin-bottom: .15rem;
}

.week-slider { margin-bottom: .85rem; }
.week-slider-head {
  display: flex;
  align-items: baseline;
  gap: .65rem;
  margin-bottom: .45rem;
  flex-wrap: wrap;
}
.week-slider-head strong { color: var(--teal); font-size: 1.05rem; }
.week-note {
  flex: 1 0 100%;
  background: var(--gold-soft);
  color: #7a5b10;
  border-radius: 10px;
  padding: .4rem .75rem;
  font-size: .85rem;
  font-weight: 600;
}
.week-slider-row {
  display: flex;
  align-items: center;
  gap: .4rem;
}
.week-slider-btn {
  flex: 0 0 36px;
  width: 36px;
  height: 64px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--teal);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.week-slider-btn:hover { background: var(--teal-soft); }
.week-slider-btn:disabled { opacity: .35; cursor: default; }
.week-slider-track {
  display: flex;
  gap: .4rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
  padding: .15rem .15rem .25rem;
}
.week-slider-track::-webkit-scrollbar { display: none; }
.week-strip {
  display: flex;
  gap: .45rem;
  overflow: auto;
  margin-bottom: .85rem;
  padding-bottom: .2rem;
}
.week-pill {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .5rem .75rem;
  min-width: 132px;
  font-size: .82rem;
  position: relative;
  flex: 0 0 auto;
  scroll-margin-inline: 1.25rem;
}
.week-pill span {
  color: var(--muted);
  font-size: .75rem;
  white-space: nowrap;
}
.week-pill em {
  margin-top: .35rem;
  align-self: flex-start;
  font-style: normal;
  background: var(--gold-soft);
  color: #7a5b10;
  font-weight: 700;
  font-size: .72rem;
  line-height: 1.2;
  border-radius: 999px;
  padding: .15rem .5rem;
  white-space: nowrap;
}
.week-pill.is-active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 76, 92, .18);
}
.week-pill.is-active span { color: #d7e6e9; }
.week-pill.is-active em { background: rgba(255, 255, 255, .16); color: #fff; }
.board-bar { margin-bottom: .85rem; }
.board-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}
.board-title h1 {
  font-size: 1.35rem;
  margin: .15rem 0 0;
  color: var(--ink);
}
.board-back {
  color: var(--muted);
  text-decoration: none;
  font-size: .92rem;
}
.board-back:hover { color: var(--teal); }
.board-status {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
}
.board-more { position: relative; }
.board-more summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: .35rem .75rem;
  font-weight: 700;
  color: var(--teal);
}
.board-more summary::-webkit-details-marker { display: none; }
.board-more-panel {
  position: absolute;
  z-index: 5;
  inset-inline-end: 0;
  top: calc(100% + .35rem);
  width: min(18rem, 80vw);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
  padding: .85rem;
  display: grid;
  gap: .75rem;
}
.board-more-panel form { display: grid; gap: .4rem; }
.board-command {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .85rem;
}
.board-look {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  min-width: 0;
}
.board-look .form-select { width: auto; min-width: 11rem; max-width: 22rem; }
.board-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.schedule-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
}
.view-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.view-switch a {
  padding: .35rem .8rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
}
.view-switch a.is-active { background: var(--teal); color: #fff; }
.pick-row {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .85rem;
}
.pick-row a {
  text-decoration: none;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 999px;
  padding: .2rem .65rem;
  font-size: .82rem;
  font-weight: 700;
}
.change-legend {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .75rem;
  font-size: .85rem;
  color: var(--muted);
}
.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #fff5f5;
  border-inline-start: 3px solid var(--danger);
}
.cell-changed {
  background: #fff5f5 !important;
  border-inline-start: 3px solid var(--danger);
  position: relative;
}
.cell-changed::after {
  content: '';
  position: absolute;
  top: 4px;
  inset-inline-start: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
}
.cell-changed .cell-main, .cell-changed .cell-code { color: var(--danger); }
.cell-uncovered { box-shadow: inset 0 0 0 1.5px #e39a9a; }
.cell-gap { color: var(--danger); font-weight: 800; font-size: .75rem; }
.cell-prev {
  font-size: .7rem;
  color: var(--muted);
  text-decoration: line-through;
  margin-top: .15rem;
}
.cell-removed {
  background: repeating-linear-gradient(-45deg, #fff5f5, #fff5f5 6px, #f8eaea 6px, #f8eaea 12px) !important;
}
.data-tabs, .report-tabs, .settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: 1rem;
}
.data-tabs a, .report-tabs a, .settings-tabs a {
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .3rem .8rem;
  font-weight: 700;
  font-size: .88rem;
}
.teacher-code-lg {
  flex: 0 0 auto;
  width: auto;
  min-width: 2.4rem;
  padding: 0 .4rem;
  font-size: .82rem;
}
.ex-mark { color: var(--danger); font-weight: 800; }
.legend-abbrev {
  color: var(--ink);
  font-weight: 700;
  font-size: .92rem;
}
.side-group .side-sub {
  padding: .1rem 0 .35rem .35rem;
}
.side-sub a {
  font-size: .82rem;
  padding: .32rem .75rem .32rem 1.15rem;
}
.weight-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
}
.weight-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.weight-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid #eee6d8;
}
.weight-value {
  min-width: 3rem;
  font-weight: 800;
  color: var(--teal);
}
.weight-number {
  max-width: 5.5rem;
}
.policy-form { display: flex; flex-direction: column; gap: 1rem; }
.policy-card { padding: 1.15rem 1.25rem 1rem; }
.policy-card-head {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  margin-bottom: 1rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid #eee6d8;
}
.policy-form-foot {
  display: flex;
  justify-content: flex-start;
  padding-bottom: .5rem;
}
.how-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.how-step {
  background: #f7f4ee;
  border-radius: 12px;
  padding: .85rem .95rem;
}
.how-step strong { display: block; margin-bottom: .3rem; }
.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  justify-content: flex-end;
}
.choice { margin: 0; }
.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice span {
  display: inline-block;
  border: 1px solid #e4d9c8;
  background: #fff;
  border-radius: 999px;
  padding: .38rem .75rem;
  cursor: pointer;
  font-weight: 650;
  line-height: 1.2;
}
.choice input:checked + span {
  background: var(--teal, #0f6e6e);
  color: #fff;
  border-color: var(--teal, #0f6e6e);
}
.choice input:focus-visible + span {
  outline: 2px solid var(--teal, #0f6e6e);
  outline-offset: 2px;
}
.priority-summary {
  margin-top: .9rem;
  font-weight: 650;
}
.exp-easing { min-width: 11rem; }
.easy-rule {
  display: grid;
  grid-template-columns: 1fr;
  gap: .4rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.easy-rule:last-child { border-bottom: 0; padding-bottom: .15rem; }
.easy-rule .form-select { width: 100%; max-width: 24rem; }
.school-check { cursor: pointer; align-items: center; }
.school-check .form-check-input { width: 1.15rem; height: 1.15rem; margin: 0; }
.day-row.is-off { opacity: .62; }
.day-count { max-width: 7rem; }
.day-count-field { max-width: 18rem; }
.priority-bars { display: flex; flex-direction: column; gap: .75rem; }
.priority-bar-row {
  display: grid;
  grid-template-columns: minmax(8rem, 16rem) minmax(4rem, 1fr) auto;
  gap: .65rem;
  align-items: center;
}
.priority-bar {
  height: .55rem;
  background: #efe8dc;
  border-radius: 999px;
  overflow: hidden;
}
.priority-bar > span {
  display: block;
  height: 100%;
  background: var(--teal, #0f6e6e);
  border-radius: inherit;
}
.priority-chip { margin-inline-start: .4rem; }
.weight-controls {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.weight-controls .form-range {
  flex: 1;
  min-width: 140px;
}
.exp-year-input {
  width: 5.25rem;
  min-width: 5.25rem;
  max-width: 5.25rem;
  text-align: center;
}
.exp-weight-cell { min-width: 260px; }
.policy-card td:has(.exp-year-input) {
  width: 6rem;
  white-space: nowrap;
}
.weight-custom.is-disabled { opacity: .45; pointer-events: none; }
.data-tabs a.is-active, .report-tabs a.is-active, .settings-tabs a.is-active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

@media (max-width: 860px) {
  .how-steps { grid-template-columns: 1fr; }
  .choice-group { justify-content: flex-start; }
  .priority-bar-row { grid-template-columns: 1fr; }
  .weight-row { grid-template-columns: 1fr; }
}
.staff-form { display: flex; flex-direction: column; gap: 1rem; }
.staff-dir-toolbar {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  padding: .85rem 1rem;
  margin-bottom: 1.1rem;
}
.staff-dir-toolbar .form-control { flex: 1; min-width: 200px; max-width: 360px; }
.staff-dir-toolbar .form-select { width: auto; min-width: 140px; max-width: 200px; }
.staff-dir-kicker {
  font-size: .95rem;
  font-weight: 800;
  color: var(--teal);
  margin: 0 0 .65rem;
}
.staff-dir-group + .staff-dir-group { margin-top: 1.25rem; }
.staff-dir-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .7rem;
}
.staff-dir-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: .9rem 1rem .8rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
.staff-dir-card.is-inactive { opacity: .62; }
.staff-dir-card-top {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
}
.staff-dir-card-top > div { min-width: 0; }
.staff-letter {
  flex: 0 0 2.2rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
  background: var(--teal);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.staff-dir-name {
  display: block;
  font-weight: 800;
  color: var(--teal);
  text-decoration: none;
  line-height: 1.35;
}
.staff-dir-name:hover { color: var(--teal-deep); }
.staff-dir-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .75rem;
  color: var(--muted);
  font-size: .82rem;
}
.staff-dir-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: auto;
}
.staff-dir-actions form { display: inline; }
.form-block + .form-block { margin-top: 1.15rem; }
.form-block h3 {
  margin: 0 0 .35rem;
  color: var(--teal);
  font-size: .98rem;
  font-weight: 800;
  line-height: 1.55;
}
.room-name-preview {
  margin: .9rem 0 0;
  padding: .75rem 1rem;
  border-radius: 12px;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-weight: 700;
}
.pick-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .4rem 0;
  border-bottom: 1px solid var(--line);
}
.pick-count {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  white-space: nowrap;
}
.pick-line:not(.is-on) .pick-count { display: none; }
.pick-count select {
  width: 9.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: .2rem .35rem;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.chip-check {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .28rem .7rem;
  background: #fff;
  cursor: pointer;
  margin: 0;
}
.chip-check input { margin: 0; }
.chip-check:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-weight: 700;
}
.subject-group + .subject-group { margin-top: .85rem; }
.subject-group[hidden] { display: none !important; }
.easy-fold {
  margin-top: 1rem;
  border-top: 1px solid #eee6d8;
  padding-top: .85rem;
}
.easy-fold-card {
  margin-top: 0;
  border-top: 0;
  padding-top: 1.15rem;
}
.easy-fold > summary {
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  list-style: none;
}
.easy-fold > summary::-webkit-details-marker { display: none; }
.easy-fold[open] > summary { margin-bottom: .85rem; }
.duty-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px auto;
  gap: .5rem;
  margin-bottom: .5rem;
  align-items: center;
}
.avail-table th, .avail-table td { text-align: center; }
.avail-table th:first-child, .avail-table td:first-child { text-align: start; }
.staff-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .85rem 1rem;
}
.staff-facts small {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  margin-bottom: .15rem;
}
.staff-facts strong { font-size: .98rem; }
.staff-overview { display: flex; flex-direction: column; gap: 1rem; }

@media (max-width: 860px) {
  .duty-row { grid-template-columns: 1fr; }
  .staff-dir-toolbar .form-control,
  .staff-dir-toolbar .form-select { max-width: none; flex: 1; }
}
.modal .form-section {
  padding: 0;
  margin: 0;
  background: transparent;
  box-shadow: none;
}
.exempt-form { display: flex; flex-direction: column; gap: .95rem; }
.exempt-lede { margin: 0; color: var(--muted); line-height: 1.6; }
.exempt-label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 .4rem;
}
.exempt-kind { border: 0; padding: 0; margin: 0; min-width: 0; }
.exempt-types { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.exempt-type {
  display: flex;
  gap: .55rem;
  align-items: flex-start;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .6rem .7rem;
  background: #fff;
  cursor: pointer;
}
.exempt-type input { margin-top: .25rem; flex: 0 0 auto; }
.exempt-type strong { display: block; font-size: .9rem; color: var(--ink); }
.exempt-type small { display: block; color: var(--muted); font-size: .75rem; line-height: 1.45; margin-top: .12rem; }
.exempt-type:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.exempt-type:has(input:checked) strong { color: var(--teal-deep); }
.exempt-dates { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.exempt-panel { background: #f7f4ee; border-radius: 12px; padding: .8rem .9rem; }
.exempt-private {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  margin: .65rem 0 0;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.exempt-private strong { display: block; font-size: .9rem; }
.exempt-private small { display: block; color: var(--muted); font-size: .75rem; margin-top: .1rem; }
.exempt-actions { display: flex; justify-content: flex-end; gap: .5rem; }
@media (max-width: 640px) {
  .exempt-types, .exempt-dates { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .kpi-grid, .dash-kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-main, .dash-split { grid-template-columns: 1fr; }
  .coverage-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .coverage-hero-top, .coverage-card-head, .coverage-toolbar { flex-direction: column; align-items: stretch; }
  .coverage-card-meta { align-items: flex-start; }
  .coverage-why-grid { grid-template-columns: 1fr; }
}

.side-plan {
  flex: 0 0 auto;
  padding: .12rem .46rem .14rem;
  border-radius: 999px;
  background: rgba(240,212,138,.14);
  color: #f0d48a;
  line-height: 1;
}
.side-plan strong { font-size: .66rem; font-weight: 800; letter-spacing: .06em; line-height: 1; }
.side-lock { margin-inline-start: auto; font-size: .75rem; color: #f0d48a; }
.sub-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .1rem .55rem;
  font-size: .72rem;
  font-weight: 700;
  background: rgba(255,255,255,.14);
  color: inherit;
}
.sub-pill.is-active, .sub-pill.is-paid { background: #e5f6ef; color: #0d6b45; }
.sub-pill.is-grace, .sub-pill.is-ending, .sub-pill.is-pending, .sub-pill.is-issued { background: #fff4d6; color: #8a6810; }
.sub-pill.is-readOnly, .sub-pill.is-suspended, .sub-pill.is-void, .sub-pill.is-none, .sub-pill.is-trialEnded { background: #fde8e6; color: #9b2c2c; }
.sub-pill.is-trial { background: #e5f6ef; color: #0d6b45; }
.sub-pill.is-comp { background: rgba(240,212,138,.2); color: #f0d48a; }
.card-soft .sub-pill.is-comp { background: #f8edd0; color: #8a6810; }
.sub-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.16); margin-top: .45rem; overflow: hidden; }
.sub-bar span { display: block; height: 100%; background: #f0d48a; }
.sub-bar-wide { background: #e7eef0; }
.sub-bar-wide span { background: #0f4c5c; }
.sub-banner.d-none { display: none; }
.sub-banner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin: 0 0 1rem;
  padding: .75rem 1rem;
  border-radius: 12px;
  background: #fff8e8;
  color: #6d5210;
  border: 1px solid #ead7a2;
}
.sub-banner-actions { display: flex; align-items: center; gap: .35rem; flex: 0 0 auto; }
.sub-banner a { color: #0f4c5c; font-weight: 700; white-space: nowrap; }
.sub-banner.is-readOnly, .sub-banner.is-suspended, .sub-banner.is-trialEnded { background: #fdecec; color: #8d2b2b; border-color: #f3c7c7; }
.sub-banner.is-trial { background: #e8f6ef; color: #0d6b45; border-color: #b7e0c8; }
.sub-price { font-weight: 800; color: #0f4c5c; }
.sub-includes { padding-inline-start: 1.1rem; margin: 0; }
.sub-includes li { margin: .2rem 0; }
.is-current-plan { outline: 2px solid #d4a017; }
.sub-now {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem 1.5rem;
  align-items: center;
  padding: 1.15rem 1.3rem;
  margin-bottom: 1.35rem;
  border-inline-start: 3px solid #d4a017;
}
.sub-now-kicker { font-size: .78rem; color: var(--muted); margin-bottom: .15rem; }
.sub-now-name { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem .6rem; }
.sub-now-name h2 { margin: 0; font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; }
.sub-now-when { margin: .4rem 0 .55rem; color: #3e565c; }
.sub-now-actions { display: flex; flex-direction: column; gap: .45rem; min-width: 9.5rem; }
.sub-now-actions .btn { width: 100%; }
.sub-block-title { font-size: 1rem; font-weight: 800; margin: 0 0 .7rem; }
.sub-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1.35rem; }
.plan-switch { margin-bottom: 1.35rem; }
.plan-switch .sub-block-title { margin-bottom: .25rem; }
.plan-switch .help { margin: 0 0 .85rem; }
.plan-switch .sub-choice-grid { margin-bottom: 0; }
.plan-switch-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: .9rem;
}
.plan-switch-actions .btn { min-width: 9.5rem; }
.sub-choice {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: .9rem .95rem .85rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e3ebed;
  box-shadow: 0 8px 24px rgba(16,42,50,.04);
  color: inherit;
  text-decoration: none;
}
.sub-choice:hover { border-color: #0f4c5c; color: inherit; }
.sub-choice.is-current { border-color: #d4a017; box-shadow: inset 0 0 0 1px #d4a017, 0 8px 24px rgba(16,42,50,.04); }
.sub-choice-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.sub-choice h3 { margin: 0; font-size: 1.05rem; font-weight: 800; }
.sub-choice-price { font-weight: 800; color: #0f4c5c; }
.sub-rates { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.sub-rate {
  padding: .4rem .5rem;
  border-radius: 10px;
  background: #f4f8f9;
}
.sub-rate span { display: block; font-size: .7rem; color: var(--muted); }
.sub-rate strong { display: block; margin-top: .1rem; color: #0f4c5c; font-size: .86rem; line-height: 1.3; }
.sub-choice-go { font-size: .78rem; font-weight: 700; color: #8a6810; }
.sub-split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: .8rem; }
.sub-split .card-soft { padding: 1rem 1.05rem; }
.sub-split h2 { font-size: .95rem; font-weight: 800; margin: 0 0 .7rem; }
@media (max-width: 980px) {
  .sub-now, .sub-choice-grid, .sub-split { grid-template-columns: 1fr; }
  .sub-now-actions { flex-direction: row; flex-wrap: wrap; min-width: 0; }
  .sub-now-actions .btn { width: auto; }
  .plan-switch-actions .btn { width: 100%; }
}
.invoice-sheet {
  background: #fff;
  color: #17343c;
  border: 1px solid #d7e4e8;
  border-radius: 18px;
  padding: 1.6rem;
  box-shadow: 0 10px 30px rgba(15,76,92,.06);
}
.invoice-top, .invoice-parties, .invoice-totals { display: flex; justify-content: space-between; gap: 1.5rem; }
.invoice-brand { display: flex; gap: .8rem; align-items: center; }
.invoice-brand img { width: 54px; height: 54px; }
.invoice-id { text-align: end; }
.invoice-kicker { color: #8a6810; font-weight: 800; letter-spacing: .08em; font-size: .75rem; }
.invoice-number { font-size: 1.35rem; font-weight: 800; color: #0f4c5c; }
.invoice-parties { margin: 1.4rem 0; }
.invoice-parties h2, .invoice-bank h2 { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: #8a6810; }
.invoice-lines { width: 100%; border-collapse: collapse; }
.invoice-lines th, .invoice-lines td { padding: .7rem .2rem; border-bottom: 1px solid #e6eef0; }
.invoice-lines th:last-child, .invoice-lines td:last-child { text-align: end; }
.invoice-totals { flex-direction: column; align-items: flex-end; margin-top: 1rem; }
.invoice-totals div { display: flex; justify-content: space-between; gap: 2rem; min-width: 220px; }
.invoice-totals .is-total { font-size: 1.15rem; color: #0f4c5c; }
.invoice-bank { margin-top: 1.4rem; padding: 1rem; border-radius: 12px; background: #f7fbfb; }
.invoice-bank dl { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem 1rem; margin: 0; }
.invoice-bank dt { font-size: .75rem; color: #5d7378; }
.invoice-bank dd { margin: 0; font-weight: 700; }
.invoice-stamp {
  margin-top: 1.2rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  border: 3px solid #0f4c5c;
  color: #0f4c5c;
  border-radius: 12px;
  padding: .45rem 1rem;
  font-weight: 800;
  letter-spacing: .12em;
}
.invoice-stamp.is-paid { border-color: #0d6b45; color: #0d6b45; }
.invoice-stamp.is-issued { border-color: #8a6810; color: #8a6810; }
.invoice-stamp.is-void { border-color: #9b2c2c; color: #9b2c2c; }
.invoice-stamp small { letter-spacing: 0; font-weight: 600; }

.setup {
  padding: 1.15rem 1.2rem 1.2rem;
  margin-bottom: 1rem;
}
.setup-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.setup h2 {
  margin: 0 0 .25rem;
  color: var(--teal);
  font-size: 1.15rem;
  font-weight: 800;
}
.setup-progress {
  color: var(--gold);
  font-size: .95rem;
  white-space: nowrap;
}
.setup-bar {
  height: 6px;
  margin: .9rem 0 1rem;
  overflow: hidden;
  border-radius: 99px;
  background: var(--teal-soft);
}
.setup-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}
.setup-steps {
  list-style: none;
  display: grid;
  gap: .65rem;
  margin: 0;
  padding: 0;
}
.setup-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: .75rem;
  align-items: center;
  padding: .7rem .8rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.setup-step.is-done { background: var(--teal-soft); }
.setup-num {
  display: grid;
  width: 1.85rem;
  height: 1.85rem;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
}
.setup-step.is-done .setup-num {
  background: var(--gold);
  color: var(--ink);
}
.setup-copy strong { display: block; }
.setup-count {
  color: var(--muted);
  font-size: .85rem;
}
.setup-done {
  padding: .7rem .9rem;
}
.setup-done-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.setup.is-dismissed {
  padding: 0;
  margin-bottom: .35rem;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.setup-show {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .85rem;
  text-decoration: underline;
  text-underline-offset: .18em;
}
.data-empty {
  padding: 2.4rem 1.4rem;
  text-align: center;
}
.data-empty h2 {
  margin-bottom: .4rem;
  color: var(--teal);
  font-size: 1.25rem;
  font-weight: 800;
}
@media (max-width: 720px) {
  .setup-head, .setup-done-row { flex-direction: column; align-items: flex-start; }
  .setup-step { grid-template-columns: auto minmax(0, 1fr); }
  .setup-count, .setup-step .btn { grid-column: 2; justify-self: start; }
}

.driver-popover.hessaty-tour {
  direction: inherit;
  min-width: 260px;
  max-width: 340px;
  padding: 1.05rem 1.1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  font-family: "IBM Plex Sans Arabic", Tajawal, Inter, sans-serif;
  text-align: start;
  box-shadow: 0 18px 50px rgba(16, 42, 50, .18);
}
.driver-popover.hessaty-tour .driver-popover-title {
  color: var(--teal);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.45;
  padding-inline-end: 1.6rem;
}
.driver-popover.hessaty-tour .driver-popover-description {
  margin-top: .35rem;
  color: var(--ink);
  font-size: .92rem;
  line-height: 1.65;
}
.driver-popover.hessaty-tour .driver-popover-close-btn {
  color: var(--muted);
}
[dir="rtl"] .driver-popover.hessaty-tour .driver-popover-close-btn {
  right: auto;
  left: 0;
}
.driver-popover.hessaty-tour .driver-popover-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: .9rem;
}
.driver-popover.hessaty-tour .driver-popover-navigation-btns {
  display: flex;
  gap: .4rem;
}
.driver-popover.hessaty-tour .driver-popover-progress-text {
  color: var(--gold);
  font-size: .8rem;
  font-weight: 700;
}
.driver-popover.hessaty-tour .driver-popover-footer-btn {
  border: 0;
  border-radius: 999px;
  padding: .35rem .85rem;
  font-weight: 700;
  text-shadow: none;
}
.driver-popover.hessaty-tour .driver-popover-next-btn {
  background: var(--teal);
  color: #fff;
}
.driver-popover.hessaty-tour .driver-popover-prev-btn {
  background: transparent;
  color: var(--teal);
  border: 1px solid var(--line);
}
.driver-popover.hessaty-tour .driver-popover-arrow {
  border-color: var(--card);
}
@media (max-width: 640px) {
  .driver-popover.hessaty-tour {
    min-width: 0;
    max-width: calc(100vw - 1.5rem);
  }
}
@media (prefers-reduced-motion: reduce) {
  .driver-overlay,
  .driver-overlay-animated,
  .driver-popover.hessaty-tour {
    transition: none !important;
    animation: none !important;
  }
}
