@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&display=swap');

:root {
  --primary: #007f82;
  --primary-dark: #005d60;
  --primary-soft: #e7f5f5;
  --gold: #c69c6d;
  --ink: #173336;
  --muted: #698084;
  --line: #dce9e9;
  --surface: #ffffff;
  --bg: #f3f8f8;
  --ok: #1f8a5b;
  --ok-bg: #eaf8f4;
  --warn: #956400;
  --warn-bg: #fff6e7;
  --bad: #c53030;
  --bad-bg: #fff1f1;
  --blue: #2c5e94;
  --blue-bg: #edf4ff;
  --radius: 16px;
  --glass: 1.0;
  --blur: 0px;
  --shadow: 0.04;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 15px;
}

body {
  margin: 0;
  background: radial-gradient(circle at 95% 0, #dff2f2 0, transparent 26%), var(--bg);
  color: var(--ink);
  font-family: 'Tajawal', Tahoma, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.ambient {
  display: none;
}

.app {
  display: flex;
  gap: 18px;
  padding: 18px;
  min-height: 100vh;
}

.glass {
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 4px 18px rgba(10, 63, 65, 0.04);
  border-radius: var(--radius);
}

/* ===================================================
   Sidebar: Exact trainer_followup Light Theme
   =================================================== */
.sidebar {
  width: 265px;
  flex: 0 0 265px;
  height: calc(100vh - 36px);
  position: sticky;
  top: 18px;
  overflow-y: auto;
  color: var(--ink);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 4px 18px rgba(10, 63, 65, 0.04);
  scrollbar-width: thin;
  scrollbar-color: #dce9e9 transparent;
}

.brand {
  padding: 22px 16px 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--primary);
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.brand-text strong {
  display: block;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink);
  font-weight: 800;
}

.brand-text small {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.collapse {
  margin: 10px 16px 0;
  background: #f4f8f7;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.collapse:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

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

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 11px;
  color: #4d5c61;
  text-decoration: none;
  cursor: pointer;
  margin: 3px 0;
  font-size: 14.5px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.sidebar nav a i {
  width: 22px;
  text-align: center;
  font-size: 16px;
  color: #7e9799;
  transition: color 0.15s ease;
}

.sidebar nav a:hover {
  background: #f2f7f7;
  color: var(--primary-dark);
}

.sidebar nav a:hover i {
  color: var(--primary);
}

.sidebar nav a.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 800;
  box-shadow: none;
}

.sidebar nav a.active i {
  color: var(--primary);
}

.sidequote {
  margin: auto 14px 16px;
  padding: 14px 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-line;
  color: var(--muted);
  background: #f7fbfb;
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* Sidebar mini variant */
.sidebar-mini .sidebar {
  width: 78px;
  flex-basis: 78px;
}

.sidebar-mini .brand-text,
.sidebar-mini .sidebar nav span,
.sidebar-mini .sidequote {
  display: none;
}

.sidebar-mini .sidebar nav a {
  justify-content: center;
  padding: 12px 0;
}

.sidebar-mini .brand {
  justify-content: center;
  padding: 18px 0;
}

.sidebar-mini .collapse {
  margin: 8px auto;
}

.sidebar-mini main {
  width: calc(100% - 96px);
}

/* ===================================================
   Main Content Area & Topbar
   =================================================== */
main {
  flex: 1;
  min-width: 0;
}

.topbar {
  min-height: 76px;
  padding: 15px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.crumb {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}

.topbar h1 {
  font-size: 22px;
  margin: 3px 0 0;
  color: var(--ink);
  font-weight: 800;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions select {
  min-width: 190px;
  background: #fff;
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--ink);
}

.author {
  text-align: left;
  line-height: 1.4;
  border-right: 1px solid var(--line);
  padding-right: 12px;
  margin-right: 3px;
}

.author b {
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 700;
}

.author small {
  font-size: 12px;
  color: var(--muted);
}

.iconbtn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--primary);
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.iconbtn:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
}

/* ===================================================
   Views
   =================================================== */
.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeIn 0.15s ease-in-out;
}

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

/* ===================================================
   Hero Header: trainer_followup Signature Banner
   =================================================== */
.hero {
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #ffffff 0%, #f9fcfc 65%, #eef7f6 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  position: relative;
  overflow: hidden;
}

.hero:after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--primary);
}

.hero h2 {
  margin: 6px 0 8px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 800px;
  line-height: 1.75;
  font-size: 14px;
}

.eyebrow {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

/* ===================================================
   Buttons: Crisp & Native to trainer_followup
   =================================================== */
.primary,
.secondary,
.danger-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 700;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.secondary:hover {
  border-color: #b8cccb;
  background: #fbfdfd;
  color: var(--primary-dark);
}

.danger-btn {
  background: #fff;
  color: var(--bad);
  border-color: #ead0d0;
}

.danger-btn:hover {
  border-color: #c95b5b;
  color: #fff;
  background: #a43a3a;
}

.full {
  width: 100%;
  justify-content: center;
}

/* ===================================================
   Stat Cards: Metrics with Accent Stripe
   =================================================== */
.cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  padding: 18px 20px;
  min-height: 114px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 15px;
  position: relative;
  overflow: hidden;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  user-select: none;
}

.stat:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 10px 25px rgba(0, 127, 130, 0.14);
}

.stat.danger-card:hover {
  border-color: var(--bad);
  box-shadow: 0 10px 25px rgba(197, 48, 48, 0.16);
}

.stat:before {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
}

.stat span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.stat .ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 17px;
}

.stat b {
  font-size: 29px;
  color: var(--ink);
  display: block;
  margin-top: 6px;
  font-weight: 850;
  line-height: 1.2;
}

.danger-card:before {
  background: var(--bad);
}

.danger-card .ico {
  background: var(--bad-bg);
  color: var(--bad);
}

.danger-card b {
  color: var(--bad);
}

/* ===================================================
   Grids & Panels
   =================================================== */
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.grid3 {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 18px;
}

.panel {
  padding: 20px 22px;
  margin-bottom: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panelhead,
.sectionhead,
.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sectionhead {
  margin: 6px 0 16px;
}

.sectionhead h2 {
  margin: 3px 0;
  font-size: 22px;
  color: var(--ink);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.link {
  background: none;
  border: 0;
  color: var(--primary);
  cursor: pointer;
  font-weight: 700;
  font-size: 13.5px;
  font-family: inherit;
  padding: 0;
}

.link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ===================================================
   Charts & Bars
   =================================================== */
.bars {
  height: 210px;
  display: flex;
  align-items: end;
  gap: 14px;
  padding: 18px 10px 0;
}

.baritem {
  flex: 1;
  text-align: center;
}

.bar {
  height: var(--h);
  background: linear-gradient(180deg, var(--primary) 0%, #15a3a3 100%);
  border-radius: 8px 8px 2px 2px;
  max-width: 52px;
  margin: auto;
  transition: height 0.3s ease;
}

.baritem b {
  display: block;
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 800;
}

.baritem small {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

/* ===================================================
   Alerts & Notifications
   =================================================== */
.alert {
  padding: 13px 16px;
  margin: 8px 0;
  background: var(--warn-bg);
  border-radius: 11px;
  border: 1px solid #f3dbac;
  border-right: 4px solid var(--warn);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--warn);
  font-weight: 600;
}

.alert.danger {
  background: var(--bad-bg);
  border-color: #f0caca;
  border-right-color: var(--bad);
  color: var(--bad);
}

.successbox {
  padding: 13px 16px;
  border-radius: 11px;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 13px;
  border: 1px solid #c9eadf;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.warningbox {
  padding: 13px 16px;
  border-radius: 11px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 13px;
  margin-top: 12px;
  border: 1px solid #f3dbac;
  line-height: 1.7;
}

.hintbox {
  padding: 13px 16px;
  border: 1px solid var(--line);
  background: #f7fbfb;
  border-radius: 11px;
  color: var(--primary-dark);
  font-size: 13px;
  line-height: 1.7;
}

.quality-strip {
  margin: 0 0 14px;
  display: grid;
  gap: 8px;
}

.quality-strip .successbox,
.quality-strip .warningbox,
.quality-strip .hintbox {
  margin: 0;
}

/* ===================================================
   Upload Zone
   =================================================== */
.upload-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.upload {
  padding: 20px 16px;
  border: 2px dashed #c8d8d7;
  border-radius: 16px;
  background: #fcfefe;
  cursor: pointer;
  min-height: 114px;
  text-align: center;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.upload:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-2px);
}

.upload-icon {
  font-size: 26px;
  color: var(--primary);
  margin-bottom: 7px;
}

.upload b {
  display: block;
  font-size: 13.5px;
  color: var(--ink);
  margin-top: 4px;
  font-weight: 700;
}

.upload small {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 4px;
}

.source-note {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--primary-soft);
  border: 1px solid #c9eadf;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--primary-dark);
}

.source-note span {
  color: #3f686c;
  font-size: 12px;
}

/* ===================================================
   Info Rows & Lists
   =================================================== */
.info-list {
  display: grid;
  gap: 8px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  background: #fbfdfd;
  border-radius: 9px;
  font-size: 13.5px;
  border: 1px solid #edf2f1;
  align-items: center;
}

.info-row span {
  color: var(--muted);
  font-weight: 600;
}

.info-row b {
  color: var(--ink);
  font-weight: 700;
}

.muted,
.empty,
.hint {
  color: var(--muted);
  font-size: 12.5px;
}

.muted {
  padding: 8px;
}

.empty {
  padding: 34px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.hint {
  line-height: 1.7;
}

.ok {
  color: var(--ok);
  font-weight: 700;
}

/* ===================================================
   Form Controls
   =================================================== */
.search,
select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 10px 12px;
  color: var(--ink);
  outline: none;
  font-family: inherit;
  font-size: 13.5px;
  min-height: 42px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search:focus,
select:focus,
input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 127, 130, 0.1);
}

.search {
  min-width: 320px;
}

.filters,
.inline {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}

.inline label,
.controls label,
.formgrid label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.inline input {
  width: 110px;
  margin-right: 6px;
}

/* ===================================================
   Tables: trainer_followup Pure Style
   =================================================== */
.tablewrap {
  overflow-x: auto;
  border: 1px solid #e4ecea;
  border-radius: 13px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 760px;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f2f8f8;
  color: #4e6268;
  font-size: 13px;
  font-weight: 800;
  border-bottom: 1px solid #dfe9e7;
  padding: 13px 15px;
  text-align: right;
  white-space: nowrap;
}

td {
  padding: 13px 15px;
  border-bottom: 1px solid #edf2f1;
  font-size: 13.5px;
  color: #26383e;
  vertical-align: middle;
  background: #fff;
}

tbody tr:nth-child(even) td {
  background: #fbfdfd;
}

tbody tr:hover td {
  background: #eef8f7;
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge-success {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid #c9eadf;
}

.badge-warning {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid #f3dbac;
}

.badge-danger {
  background: var(--bad-bg);
  color: var(--bad);
  border: 1px solid #f0caca;
}

/* Status Dots */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
}

.dot-green {
  background: var(--ok);
}

.dot-red {
  background: var(--bad);
}

.dot-amber {
  background: var(--warn);
}

.dot-gray {
  background: #94a3b8;
}

/* ===================================================
   What-If Simulator
   =================================================== */
.whatif-top {
  padding: 18px 22px;
  display: flex;
  gap: 15px;
  align-items: end;
  margin-bottom: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.step {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 1;
}

.step > b {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  flex-shrink: 0;
}

.step label {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.step select {
  display: block;
  width: 100%;
  margin-top: 5px;
  font-size: 13.5px;
}

.scenario-badge {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border: 1px solid #c9eadf;
  border-radius: 9px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 800;
}

.whatif-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  align-items: start;
}

.controls label {
  display: block;
  margin-bottom: 11px;
  font-size: 13px;
  font-weight: 700;
}

.controls select {
  display: block;
  width: 100%;
  margin-top: 5px;
}

.controls hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

/* Timetable */
.timetable {
  display: grid;
  grid-template-columns: 88px repeat(5, minmax(150px, 1fr));
  gap: 7px;
  overflow: auto;
  min-height: 480px;
  padding: 4px 1px;
}

.dayhead {
  background: #f2f8f8;
  color: var(--primary-dark);
  padding: 12px;
  border-radius: 10px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 800;
  border: 1px solid var(--line);
}

.timehead {
  padding: 11px 8px;
  background: #f7fbfb;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.slot {
  background: #fbfdfd;
  border: 1px solid #e7efed;
  border-radius: 10px;
  min-height: 74px;
  padding: 6px;
  transition: all 0.15s ease;
}

.slot:hover {
  background: #f5faf9;
  border-color: #bfd3cf;
}

.slot.dragover {
  background: var(--primary-soft) !important;
  border: 2px dashed var(--primary) !important;
  box-shadow: 0 0 14px rgba(0, 127, 130, 0.25) !important;
  transform: scale(1.01);
}

.session {
  padding: 10px 12px;
  border-radius: 9px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-right: 4px solid var(--primary);
  min-height: 60px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: element;
  margin-bottom: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.15s ease;
}

.session:hover {
  background: #f5fbfb;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 127, 130, 0.15);
}

.session:active {
  cursor: grabbing !important;
}

.session.dragging {
  cursor: grabbing !important;
  opacity: 0.55;
  transform: scale(0.97);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.selected-session {
  cursor: grab;
  box-shadow: 0 0 0 2.5px var(--primary), 0 6px 16px rgba(0, 127, 130, 0.25) !important;
  background: var(--primary-soft) !important;
}

.session * {
  pointer-events: none;
  -webkit-user-drag: none;
}

.session b,
.session small {
  display: block;
}

.session b {
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.4;
}

.session small {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.45;
  font-weight: 500;
}

.session small i {
  color: var(--primary);
}

/* ===================================================
   Scenarios & Details
   =================================================== */
.scenario {
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  margin: 9px 0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.scenario:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 127, 130, 0.08);
}

.scenario.best {
  border-color: var(--ok);
  background: var(--ok-bg);
  border-width: 1.5px;
}

.scenario.selected-scenario {
  border-color: var(--primary) !important;
  background: var(--primary-soft) !important;
  box-shadow: 0 0 0 2px var(--primary), 0 4px 12px rgba(0, 127, 130, 0.15) !important;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.row b {
  font-size: 14px;
  color: var(--ink);
  font-weight: 800;
}

.score {
  font-size: 19px;
  font-weight: 900;
  color: var(--primary);
}

.scenario-metrics {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.scenario-metrics span {
  font-size: 11.5px;
  background: #f0f4f4;
  padding: 4px 9px;
  border-radius: 7px;
  color: var(--ink);
  font-weight: 600;
}

.score-big {
  font-size: 46px;
  font-weight: 900;
  color: var(--primary);
  text-align: center;
  padding: 8px;
}

.score-big small {
  font-size: 15px;
  color: var(--muted);
}

.button-row {
  display: flex;
  gap: 8px;
  margin-top: 13px;
  flex-wrap: wrap;
}

.suggestion {
  padding: 11px 15px;
  background: #fbfdfd;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: flex;
  justify-content: space-between;
  margin: 7px 0;
  font-size: 13px;
}

.suggestion b {
  color: var(--ink);
  font-weight: 700;
}

.suggestion span {
  color: var(--muted);
}

/* ===================================================
   Reports Grid
   =================================================== */
.report-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.report {
  border: 1px solid var(--line);
  padding: 28px 22px;
  text-align: center;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  background: #fff;
}

.report i {
  font-size: 28px;
  color: var(--primary);
}

.report:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 8px 22px rgba(0, 127, 130, 0.12);
}

/* ===================================================
   Settings
   =================================================== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.formgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  margin-top: 15px;
}

.formgrid input,
.formgrid textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
}

.formgrid input[type=color] {
  height: 42px;
  padding: 3px;
  cursor: pointer;
}

.formgrid input[type=range] {
  padding: 0;
}

.prefix-row,
.trainer-row,
.dept-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 9px;
  align-items: center;
  margin: 9px 0;
}

.trainer-row {
  grid-template-columns: 120px 1fr auto auto;
}

.logo-upload {
  text-align: center;
}

/* ===================================================
   Modals
   =================================================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(16, 37, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 100;
}

.modal.show {
  display: flex;
}

.modalbox {
  width: min(530px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(10, 63, 65, 0.2);
  border: 1px solid var(--line);
}

.modalbox.wide {
  width: min(900px, 100%);
}

.tab-btn {
  padding: 8px 16px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.tab-btn:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: var(--primary);
}

.tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 127, 130, 0.2);
}

.conflict-item-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.conflict-item-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.modalbox.schedule-wide {
  width: min(1220px, 96vw);
  max-height: 94vh;
  padding: 24px;
}

/* ===================================================
   Trainee Schedule Grid (Identical to training-scheduler)
   =================================================== */
.schedule-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1.5px solid #b5dada;
  margin-top: 14px;
  background: #ffffff;
}

.schedule-grid {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  width: 100% !important;
  min-width: 860px;
  background: #ffffff;
  margin-bottom: 0;
}

.schedule-grid th, 
.schedule-grid td {
  border: 1px solid #b5dada !important;
}

.schedule-corner-th {
  background: linear-gradient(180deg, #d8ecec 0%, #cce5e5 100%) !important;
  color: #063134 !important;
  vertical-align: middle !important;
  padding: 14px 10px !important;
  border-left: 2px solid #8fc3c3 !important;
  text-align: center;
}

.schedule-corner-th span {
  font-weight: 800;
  font-size: 1rem;
  color: #063134;
  display: block;
}

.schedule-corner-th small {
  font-size: 0.8rem;
  color: #005d60;
  font-weight: 600;
}

.period-header {
  background: linear-gradient(180deg, #e4f4f4 0%, #d7ecec 100%) !important;
  color: #083235 !important;
  padding: 12px 10px !important;
  vertical-align: middle !important;
  border-bottom: 2px solid #8fc3c3 !important;
  text-align: center;
}

.period-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: #063236;
  margin-bottom: 5px;
}

.period-time-badge {
  display: inline-block;
  background: #ffffff;
  color: #005a5d;
  border: 1px solid #8ec5c5;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 20px;
  box-shadow: 0 1px 4px rgba(0, 80, 85, 0.08);
}

.day-header-cell {
  background: #eef7f7 !important;
  color: #004d50 !important;
  vertical-align: middle !important;
  padding: 14px 8px !important;
  border-left: 2px solid #8fc3c3 !important;
  width: 115px;
  text-align: center;
}

.day-name {
  font-weight: 900;
  font-size: 1.12rem;
  color: #004d50;
  letter-spacing: 0.3px;
}

.period-slot-cell {
  background: #fbfdfd !important;
  vertical-align: top !important;
  padding: 8px !important;
  min-width: 165px;
  width: 18%;
  transition: background 0.15s ease;
}

.period-slot-cell:hover {
  background: #f2f9f8 !important;
}

.empty-slot-marker {
  color: #a0b6b8;
  text-align: center;
  padding: 24px 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.session-card {
  cursor: pointer;
  background: #ffffff !important;
  border: 1.5px solid #a3d3d3 !important;
  border-radius: 11px !important;
  padding: 10px 12px !important;
  margin-bottom: 8px !important;
  box-shadow: 0 2px 6px rgba(0, 70, 75, 0.06) !important;
  position: relative;
  transition: all 0.18s ease !important;
  text-align: right;
}

.session-card:last-child {
  margin-bottom: 0 !important;
}

.session-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 110, 115, 0.16) !important;
  border-color: #007f82 !important;
}

.session-card.session-lab {
  border-right: 5px solid #0284c7 !important;
  border-color: #92cdee !important;
  background: linear-gradient(135deg, #ffffff 80%, #f0f8ff 100%) !important;
}

.session-card.session-theory {
  border-right: 5px solid #007f82 !important;
  border-color: #9ed4d4 !important;
  background: linear-gradient(135deg, #ffffff 80%, #f0f9f8 100%) !important;
}

.session-card.session-conflict {
  border-right: 5px solid var(--bad) !important;
  border-color: #f7b4b4 !important;
  background: linear-gradient(135deg, #ffffff 80%, #fff1f1 100%) !important;
}

.session-course-title {
  font-weight: 800;
  font-size: 0.94rem;
  color: #0f172a !important;
  line-height: 1.35;
}

.session-section-badge {
  font-weight: 800;
  font-size: 0.76rem;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.session-section-badge.badge-teal {
  background: #007f82;
  color: #ffffff;
}

.session-section-badge.badge-blue {
  background: #0284c7;
  color: #ffffff;
}

.session-trainer-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #1e293b;
  font-weight: 700;
  font-size: 0.83rem;
  margin: 5px 0 6px;
}

.session-icon-trainer {
  color: #007f82;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.session-trainer-name {
  color: #1e293b;
}

.session-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px dashed #dbe6e6;
}

.session-room-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.76rem;
  font-weight: 700;
}

.session-icon-room {
  color: #475569;
}

.session-type-badge {
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 800;
}

.session-type-badge.type-lab {
  background: #e0f2fe;
  color: #0369a1;
}

.session-type-badge.type-theory {
  background: #e6f7f5;
  color: #006064;
}

.session-time-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
}

tr.tr-conflict td {
  background: #fff5f5 !important;
}

.modalbox .close {
  position: absolute;
  left: 16px;
  top: 16px;
  border: 0;
  background: #f2f5f5;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 15px;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s ease;
}

.modalbox .close:hover {
  background: var(--bad-bg);
  color: var(--bad);
}

.modalbox label {
  display: block;
  margin: 15px 0;
  font-size: 13px;
  font-weight: 700;
}

.modalbox label input {
  display: block;
  width: 100%;
  margin-top: 5px;
}

/* ===================================================
   Departments & Students
   =================================================== */
.dept-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.dept-card {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: all 0.15s ease;
}

.dept-card:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 18px rgba(0, 127, 130, 0.08);
}

.dept-card.selected {
  outline: 2px solid var(--primary);
  background: var(--primary-soft);
}

.dept-card h3 {
  margin: 4px 0;
  color: var(--ink);
  font-size: 15.5px;
}

.dept-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.student-card {
  padding: 18px;
  margin-bottom: 12px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.student-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.student-head h3 {
  margin: 4px 0;
  color: var(--primary-dark);
  font-size: 15.5px;
}

.chips {
  display: flex;
  gap: 7px;
  align-items: start;
}

.chips span {
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

.student-courses {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.student-courses span {
  background: #fbfdfd;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 11px;
  font-size: 12px;
}

/* ===================================================
   Forecast
   =================================================== */
.forecast-summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.forecast-card {
  padding: 16px 18px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.forecast-card span,
.forecast-card small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.forecast-card b {
  display: block;
  font-size: 28px;
  color: var(--primary);
  margin: 5px 0;
  font-weight: 850;
}

.forecast-card.highlight {
  background: linear-gradient(115deg, #005b5f, #00878a 58%, #15a3a3);
  color: #fff;
  border: 0;
  box-shadow: 0 8px 22px rgba(0, 103, 105, 0.18);
}

.forecast-card.highlight span,
.forecast-card.highlight small,
.forecast-card.highlight b {
  color: #fff;
}

/* ===================================================
   Schedule Levels
   =================================================== */
.level-panel {
  padding: 20px;
}

.level-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.level-metrics {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.level-metrics span {
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #c9eadf;
}

.course-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.course-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12px;
}

.course-chip strong {
  color: var(--primary-dark);
  white-space: nowrap;
}

.course-chip span {
  color: var(--muted);
}

.course-chip em {
  font-style: normal;
  color: var(--bad);
  font-size: 11px;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 8px;
  overflow-x: auto;
}

.day-column {
  min-height: 190px;
  background: #fbfdfd;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.day-body {
  padding: 7px;
}

.day-empty {
  padding: 36px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}

.level-session {
  background: #ffffff;
  border: 1px solid var(--line);
  border-right: 4px solid var(--primary);
  padding: 9px 11px;
  border-radius: 9px;
  margin-bottom: 7px;
}

.level-session b,
.level-session small,
.level-session span,
.level-session em {
  display: block;
}

.level-session b {
  font-size: 12px;
  color: var(--ink);
  font-weight: 800;
}

.level-session small {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.level-session span {
  font-size: 11px;
  margin-top: 3px;
  color: var(--primary-dark);
  font-weight: 700;
}

.level-session em {
  font-style: normal;
  font-size: 10.5px;
  color: #7b8e91;
  margin-top: 3px;
}

/* ===================================================
   Trainer Schedule
   =================================================== */
.trainer-week {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.trainer-day {
  border: 1px solid var(--line);
  background: #fbfdfd;
  border-radius: 12px;
  padding: 10px;
  min-height: 130px;
}

.trainer-day h3 {
  margin: 4px 0 10px;
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 800;
}

.trainer-item {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 6px 0;
  background: #fff;
  border-right: 3px solid var(--primary);
}

.trainer-item b {
  font-size: 12px;
  color: var(--ink);
}

.trainer-item span {
  font-size: 11.5px;
  color: var(--muted);
}

.trainer-item small {
  font-size: 10.5px;
  color: #7b8e91;
}

.trainer-item span,
.trainer-item small {
  display: block;
  margin-top: 2px;
}

.trainer-item.conflict {
  border-right-color: var(--bad);
  background: var(--bad-bg);
}

.trainer-summary {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 12px 0;
  font-size: 13px;
}

.change-report h2 {
  color: var(--ink);
  font-size: 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
}

/* ===================================================
   Footer & Helpers
   =================================================== */
footer {
  padding: 15px 22px;
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.dangerText {
  color: var(--bad) !important;
}

.warningText {
  color: var(--warn) !important;
}

.clickable {
  cursor: pointer;
  text-decoration: underline dotted;
}

/* ===================================================
   Responsive Adjustments
   =================================================== */
@media (max-width: 1200px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .upload-grid { grid-template-columns: repeat(2, 1fr); }
  .forecast-summary { grid-template-columns: repeat(3, 1fr); }
  .whatif-layout { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .level-grid { grid-template-columns: repeat(5, 170px); }
  .source-note { display: block; }
  .source-note span { display: block; margin-top: 6px; }
}

@media (max-width: 950px) {
  .sidebar { width: 78px; flex-basis: 78px; }
  .brand-text,
  .sidebar nav span,
  .sidequote { display: none; }
  .sidebar nav a { justify-content: center; }
  .brand { justify-content: center; }
  .grid2,
  .settings-grid { grid-template-columns: 1fr; }
  .whatif-top { flex-wrap: wrap; }
  .step { min-width: 210px; }
  .dept-grid { grid-template-columns: 1fr; }
  .trainer-week { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .app { padding: 8px; }
  .sidebar { display: none; }
  .topbar { display: block; }
  .top-actions { margin-top: 12px; flex-wrap: wrap; }
  .top-actions select { min-width: 0; flex: 1; }
  .author { text-align: right; border: 0; padding: 0; }
  .hero { display: block; }
  .hero-actions { margin-top: 14px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: 1fr; }
  .upload-grid { grid-template-columns: 1fr; }
  .forecast-summary { grid-template-columns: 1fr 1fr; }
  .sectionhead { display: block; }
  .search { width: 100%; min-width: 0; margin-top: 10px; }
  .report-grid { grid-template-columns: 1fr; }
  .formgrid { grid-template-columns: 1fr; }
  footer { display: block; }
  .whatif-top { display: block; }
  .step { margin-bottom: 10px; }
  .timetable { grid-template-columns: 70px repeat(5, 150px); }
  .trainer-week { grid-template-columns: 1fr; }
}