/* IRAS Admin Panel - Reference Color Palette */
:root {
  --bg-dark: #21262d;
  --bg-darker: #161b22;
  --bg-sidebar: #0d1117;
  --accent-blue: #3578e5;
  --accent-blue-hover: #4a8ef0;
  --stable: #2ca267;
  --watch: #f7931a;
  --critical: #e04c53;
  --text-primary: #e6edf3;
  --text-muted: #8b949e;
  --border-color: #30363d;
  --modal-bg: #f6f8fa;
  --white: #ffffff;
  /* Detail count cards – light dark background with colored left border */
  --card-bg-light-dark: #1a1e2b;
  --card-border-accent-blue: #3578e5;
  --card-border-accent-green: #2ca267;
  --card-border-accent-cyan: #58a6ff;
  --card-border-accent-red: #e04c53;
  --card-border-accent-orange: #f7931a;
  --card-border-accent-amber: #d4a02c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Host Grotesk", sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

.admin-wrapper {
  height: 100vh;
  scrollbar-width: none;
}

::-webkit-scrollbar {
  display: none;
}

/* Left Sidebar */
.sidebar-left {
  width: 260px;
  min-width: 260px;
  background: var(--bg-darker);
  border-right: 1px solid var(--border-color);
  padding: 1.25rem 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 0 1rem 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.iras-logo {
  width: 36px;
  height: 36px;
  background: var(--accent-blue);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.25rem;
}

.sidebar-brand span {
  font-weight: 700;
  font-size: 1.1rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem 0.75rem 0.75rem;
  color: #b0b7bf;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  border-left: 3px solid transparent;
  margin-left: 0.25rem;
}

.sidebar-nav .nav-item i {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-nav .nav-item:hover,
.sidebar-nav .nav-item.active {
  background: #373e47;
  color: var(--white);
  border-left-color: #3498db;
}

.sidebar-nav .nav-item.has-dropdown {
  justify-content: flex-start;
}

.divider-vertical {
  border-right: 1px solid #707070;
}

/* Main Content */
.main-content-wrapper {
  flex: 1;
  min-width: 0;
  padding: 1.5rem;
  background: var(--bg-dark);
}

header {
  background-color: var(--bg-darker);
}

.top-header {
  padding: 0.75rem 0;
  flex-wrap: wrap;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-eagle {
  width: 40px;
  height: 40px;
  background: var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--accent-blue);
}

.brand-name {
  font-weight: 700;
  font-size: 1rem;
  display: block;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.iras-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background: rgba(53, 120, 229, 0.15);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--accent-blue);
}

.header-center {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  max-width: 600px;
  min-width: 280px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: var(--text-muted);
}

.search-box input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.select-emirates {
  flex-shrink: 0;
}

.form-select-theme {
  appearance: none;
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: "Host Grotesk", sans-serif;
  font-size: 0.9rem;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  cursor: pointer;
  min-width: 140px;
  text-overflow: ellipsis;
  transition: border-color 0.2s, color 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%238b949e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
}

.form-select-theme:hover {
  border-color: var(--accent-blue);
}

.form-select-theme:focus {
  border-color: var(--accent-blue);
  box-shadow: none;
}

input,
button,
textarea,
select {
  outline: none;
}

.form-select-theme option {
  background: var(--bg-darker);
  color: var(--text-primary);
}

.filter-btns {
  display: flex;
  gap: 0.25rem;
}

.filter-btn {
  padding: 0.45rem 0.75rem;
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: var(--white);
}

.filter-btn.icon-only {
  padding: 0.45rem 0.6rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover {
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}

.icon-btn.alert {
  color: var(--watch);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border-color);
}

.btn-settings {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-settings:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* Academic page – Bootstrap tabs as segmented control (dark pill style) */
.nav-tabs-segmented-wrap {
  display: inline-flex;
  padding: 0.5rem;
  background: #252b33;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.nav-tabs-dark {
  display: flex;
  gap: 0;
  border: none;
  margin: 0;
  padding: 0;
}

.nav-tabs-dark .nav-item {
  margin: 0;
}

.nav-tabs-dark .nav-link {
  padding: 0.25rem 1.5rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.nav-tabs-dark .nav-link i {
  font-size: 1.05rem;
  opacity: 0.9;
}

.nav-tabs-dark .nav-link:hover {
  color: var(--text-primary);
  background: transparent;
}

.nav-tabs-dark .nav-link.active {
  color: var(--text-primary);
  background: #2d3748;
  box-shadow: 0 0 0 1px rgba(48, 54, 61, 0.6), 0 1px 2px rgba(0, 0, 0, 0.2);
}

.nav-tabs-dark .nav-link.active i {
  color: var(--accent-blue);
}

.nav-tabs-dark .nav-link:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.page-title {
  font-size: 1.5rem;
  letter-spacing: .96px;
  font-weight: 500;
  margin-bottom: 1rem;
}

/* Map Container – UAE only, larger size */
.map-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  min-height: 40px;
  height: 75vh;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 0;
  cursor: grab;
}

#map:active {
  cursor: grabbing;
}

/* Effect on tile layer: light_nolabels displayed in #21262d style */
.leaflet-tile-pane {
  filter: saturate(10);
}

.map-legend {
  position: absolute;
  bottom: 16px;
  /* left: 16px; */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 17, 23, 0.9);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  display: flex;
  gap: 1rem;
  z-index: 1000;
  border: 1px solid var(--border-color);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.text-stable {
  color: var(--stable) !important;
}

.text-watch {
  color: var(--watch) !important;
}

.text-critical {
  color: var(--critical) !important;
}

/* Map pin – location marker (teardrop, glossy, white ring, shadow) */
.map-pin-wrapper {
  background: none !important;
  border: none !important;
  cursor: pointer;
}

.map-pin-shadow {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translate(-50%, -2px);
  width: 16px;
  height: 6px;
  background: radial-gradient(ellipse 80% 60% at 50% 30%, rgba(120, 120, 120, 0.35) 0%, rgba(80, 80, 80, 0.2) 50%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.map-pin-body {
  position: relative;
  width: 26px;
  height: 38px;
  display: block;
}

.map-pin-svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.map-pin-path {
  transition: filter 0.2s;
}

.map-pin-wrapper:hover .map-pin-path {
  filter: brightness(1.1);
}

.map-pin-dot {
  position: absolute;
  left: 50%;
  top: 11px;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

/* Custom marker status colors (applied via JS --pin-color) */
.marker-stable {
  color: var(--stable);
}

.marker-watch {
  color: var(--watch);
}

.marker-critical {
  color: var(--critical);
}

.marker-default {
  color: var(--accent-blue);
}

/* Charts */
.charts-row {
  margin-top: 0.5rem;
}

.charts-row .col-md-4 {
  display: flex;
  flex-direction: column;
}

/* .charts-row .chart-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
} */

/* Dashboard detail count cards – light dark background with colored left border */
.details-cards-row .col {
  min-width: 140px;
}

.detail-count-card {
  padding: 1rem 1.25rem;
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  border-left-width: 4px;
  border-left-style: solid;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.detail-count-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.detail-count-card--blue {
  border-left-color: var(--card-border-accent-blue);
}

.detail-count-card--green {
  border-left-color: var(--card-border-accent-green);
}

.detail-count-card--cyan {
  border-left-color: var(--card-border-accent-cyan);
}

.detail-count-card--red {
  border-left-color: var(--card-border-accent-red);
}

.detail-count-card--orange {
  border-left-color: var(--card-border-accent-orange);
}

.detail-count-card--amber {
  border-left-color: var(--card-border-accent-amber);
}

.count-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.count-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.count-card-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.count-card-icon {
  flex-shrink: 0;
  opacity: 0.9;
}

.count-card-icon img {
  filter: brightness(10);
}

.chart-card {
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
}

/* Overall Attendance Report – dark themed grouped bar chart */
.overall-stats-chart.card-dark {
  background: linear-gradient(165deg, var(--bg-darker) 0%, #151a22 50%, var(--bg-darker) 100%);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 0.5rem;
  /* box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(48, 54, 61, 0.5); */
}

.stats-chart-title {
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: .96px;
  margin: 0 0 1.5rem;
}

.overall-stats-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 480px;
  height: 480px;
}

.overall-stats-chart-wrap canvas {
  max-width: 100%;
  max-height: 100%;
}

/* Overall Schools Stats – dark card, modern tabs, stacked bar chart */
.overall-schools-stats.card-dark {
  background: linear-gradient(165deg, var(--bg-darker) 0%, #151a22 50%, var(--bg-darker) 100%);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 0.5rem;
}

.schools-stats-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.schools-stats-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  background: rgba(22, 27, 34, 0.85);
  border: 1px solid #334155;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 0.9375rem;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.schools-stats-tab:hover {
  border-color: #475569;
  background-color: #69768a;
}

.schools-stats-tab:hover,
.schools-stats-tab.active {
  color: #fff;
  background: #334155;
}

.schools-stats-tab-icon {
  font-size: 1rem;
  position: relative;
  top: 1px;
  flex-shrink: 0;
}

.schools-stats-tab .icon-health {
  color: #a78bfa;
}

.schools-stats-tab .icon-attendance {
  color: #34d399;
}

.schools-stats-tab .icon-performance {
  color: #58a6ff;
}

.schools-stats-tab .icon-behavior {
  color: #fbbf24;
}

.schools-stats-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 480px;
  height: 480px;
  background: rgba(13, 17, 23, 0.4);
  border-radius: 12px;
  padding: .75rem 0.5rem;
}

.schools-stats-chart-wrap canvas {
  max-width: 100%;
  max-height: 100%;
}

.chart-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.chart-container {
  position: relative;
  height: 200px;
  width: 100%;
}

.pie-chart-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  align-self: center;
}

.pie-chart-wrap canvas {
  max-width: 100%;
  max-height: 100%;
}

.chart-card-pie .pie-chart-row {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-height: 0;
}

.chart-card-pie .pie-legend {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
}

.chart-card-pie .pie-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-primary);
}

.chart-card-pie .pie-legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.chart-card-pie .pie-chart-container {
  position: relative;
  flex-shrink: 0;
  width: 140px;
  height: 140px;
  padding: 0.5rem;
}

.chart-card-pie .pie-chart-container canvas {
  max-width: 100%;
  max-height: 100%;
  width: 100% !important;
  height: auto !important;
}

.footer-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 1rem 0 0;
}

/* Right Sidebar */
.sidebar-right {
  width: 320px;
  min-width: 280px;
  background: var(--bg-darker);
  /* border-left: 1px solid var(--border-color); */
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-radius: 8px;
  /* max-height: 100vh; */
  top: 15px;
  right: 15px;
  bottom: 15px;
  overflow-y: auto;
  z-index: 3;
}

.charts-row.sidebar-right {
  margin: 0;
  left: 15px;
  right: inherit;
  background: var(--bg-dark);
}

.sidebar-card {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem;
  position: relative;
}

.sidebar-card h6 {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.sidebar-card .big-stat {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.sidebar-card .positive {
  color: var(--stable);
  font-size: 0.9rem;
}

.sidebar-card .muted {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sidebar-card.clickable {
  cursor: pointer;
  padding-right: 2rem;
}

.sidebar-card.clickable:hover {
  border-color: var(--accent-blue);
}

.sidebar-card.clickable>i.bi-chevron-right {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-blue);
  font-size: 1rem;
}

/* Schools list – Squad Overview style (dark theme) */
.overview-schools-inner {
  padding: 0;
}

.schools-cards-wrapper {
  width: 100%;
}

/* Schools list page header – static */
.schools-overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 2rem;
  padding-bottom: 0;
}

.schools-overview-head-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.schools-overview-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 1rem;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.schools-overview-head-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.schools-sort-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.schools-sort-select {
  padding: 0.5rem;
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 400;
  cursor: pointer;
  min-width: 110px;
}

.schools-view-toggle {
  display: flex;
  gap: 0.375rem;
}

.schools-view-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.schools-view-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.schools-view-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: var(--white);
}

/* Cards grid – 4 cards per row */
.schools-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 1200px) {
  .schools-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .schools-cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Squad-style card: no border, soft shadow, rounded */
.school-card.squad-style {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: rgba(22, 27, 34, 0.85);
  border: none;
  border-radius: 14px;
  padding: 1.25rem;
  transition: box-shadow 0.2s, transform 0.2s;
}

.school-card.squad-style:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* Card top: avatar + name + pill | web/location/mail icons with tooltips */
.school-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.875rem;
}

.school-card-header-left {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  min-width: 0;
  flex: 1;
}

.school-card-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.school-card-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(33, 38, 45, 0.9);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: default;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.school-card-header-icon:hover {
  color: var(--text-primary);
  background: rgba(48, 54, 61, 0.9);
  border-color: var(--border-color);
}

.school-card-header-icon .bi-globe2 {
  color: #58a6ff;
}

.school-card-header-icon .bi-geo-alt-fill {
  color: var(--stable);
}

.school-card-header-icon .bi-envelope-fill {
  color: var(--watch);
}

.school-card-avatar-wrap {
  flex-shrink: 0;
  border-radius: 50%;
}

.school-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent-blue), #2a5fb8);
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.school-card-avatar .school-card-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.school-card-identity {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.school-card-name {
  color: var(--text-primary);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.25;
}

.school-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.school-card-pill {
  display: inline-flex;
  padding: 0.2rem 0.5rem;
  background: rgba(88, 166, 255, 0.2);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #58a6ff;
}

.school-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  background: rgba(136, 132, 255, 0.2);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #8884ff;
}

/* 2x2 stats grid */
/* 2x2 stat cards – icon left, value + label right (screenshot format) */
.school-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.school-stat-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1rem;
  background: rgba(33, 38, 45, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  min-width: 0;
}

.school-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.school-stat-icon.principal {
  background: rgba(210, 153, 234, 0.25);
  color: #d299ea;
}

.school-stat-icon.teachers {
  background: rgba(88, 166, 255, 0.2);
  color: #58a6ff;
}

.school-stat-icon.students {
  background: rgba(44, 162, 103, 0.25);
  color: var(--stable);
}

.school-stat-icon.admins {
  background: rgba(247, 147, 26, 0.25);
  color: var(--watch);
}

.school-stat-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.school-stat-value {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.school-stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: capitalize;
  margin-top: 0.15rem;
}

.two-stats {
  display: flex;
  gap: 1rem;
}

.btn-open-school {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--accent-blue);
  border: none;
  border-radius: 8px;
  color: var(--white);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: auto;
  transition: background 0.2s;
}

.school-card-footer .btn-open-school {
  color: #58a6ff;
  background: rgba(88, 166, 255, 0.2);
}

.btn-open-school:hover,
.school-card-footer .btn-open-school:hover {
  background: var(--accent-blue-hover);
  color: var(--white);
}

/* School Modal (Dialogue Box) */
.school-modal-dialog {
  max-width: 480px;
}

.school-modal-content {
  background: var(--modal-bg);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  color: #1f2328;
  position: relative;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.btn-close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 6px;
  color: #57606a;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-close-modal:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #1f2328;
}

.school-modal-header {
  padding: 1.25rem 1.5rem 0.5rem;
  border-bottom: none;
}

.school-header-info .school-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #1f2328;
}

.school-header-info .school-name i {
  color: var(--accent-blue);
}

.school-meta {
  font-size: 0.9rem;
  color: #57606a;
  margin-bottom: 0.25rem;
}

.school-meta .separator {
  margin: 0 0.35rem;
}

.last-updated {
  font-size: 0.8rem;
  color: #8b949e;
  margin: 0;
}

.school-modal-body {
  padding: 0 1.5rem 1rem;
}

.school-tabs {
  border-bottom: 1px solid #d0d7de;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.school-tabs .nav-link {
  border: none;
  color: #57606a;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background: transparent;
}

.school-tabs .nav-link:hover {
  color: #1f2328;
}

.school-tabs .nav-link.active {
  color: var(--accent-blue);
  background: rgba(53, 120, 229, 0.1);
}

.quick-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-block {
  background: var(--white);
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
}

.stat-block .stat-label {
  font-size: 0.75rem;
  color: #57606a;
  margin-bottom: 0.25rem;
}

.stat-block .stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2328;
}

.stat-block .stat-sub {
  font-size: 0.8rem;
  color: #57606a;
  margin-top: 0.25rem;
}

.badge-chip {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-chip.stable {
  background: rgba(44, 162, 103, 0.2);
  color: var(--stable);
}

.badge-chip.watch {
  background: rgba(247, 147, 26, 0.2);
  color: var(--watch);
}

.badge-chip.critical {
  background: rgba(224, 76, 83, 0.2);
  color: var(--critical);
}

.detailed-stats {
  font-size: 0.9rem;
  color: #57606a;
  margin-bottom: 1rem;
}

.detailed-stats .muted {
  color: #8b949e;
}

.ai-insight {
  font-size: 0.85rem;
  color: #57606a;
  margin: 0;
  padding: 0.5rem 0;
}

.school-modal-footer {
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid #d0d7de;
}

.btn-view-dashboard {
  width: 100%;
  padding: 0.65rem 1rem;
  background: var(--accent-blue);
  border: none;
  border-radius: 8px;
  color: var(--white);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-view-dashboard:hover {
  background: var(--accent-blue-hover);
  color: var(--white);
}

/* Leaflet popup hide (we use modal instead) */
.leaflet-popup-pane {
  display: none;
}

/* Responsive */
@media (max-width: 1200px) {
  .sidebar-right {
    width: 240px;
    min-width: 240px;
  }
}

@media (max-width: 992px) {
  .admin-wrapper {
    flex-direction: column;
  }

  .sidebar-left {
    width: 100%;
    flex-direction: row;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0;
  }

  .sidebar-right {
    width: 100%;
    max-height: none;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .sidebar-card {
    flex: 1 1 200px;
    max-width: 280px;
  }

  .header-center {
    order: 3;
    max-width: 100%;
    width: 100%;
  }

  .top-header {
    flex-wrap: wrap;
  }

  .map-container {
    min-height: 420px;
    height: 55vh;
  }

  .quick-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Analytics – dark theme (--bg-darker, --text-primary, --border-color) */
.analytics-section {
  margin-bottom: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

.analytics-card {
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
}

.analytics-section .section-header {
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.analytics-section .section-title {
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.analytics-section .section-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

.analytics-section .chart-card {
  height: 100%;
  min-height: 280px;
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
}

.analytics-section .info-table {
  height: 100%;
}

.analytics-section .info-table .table-title {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 1rem;
}

.analytics-section .info-table .analytics-table {
  margin-bottom: 0;
  color: var(--text-primary);
  border-color: var(--border-color);
}

.analytics-section .info-table .analytics-table thead th {
  color: var(--text-primary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  background: rgba(48, 54, 61, 0.5);
}

.analytics-section .info-table .analytics-table tbody tr {
  transition: background 0.2s;
}

.analytics-section .info-table .analytics-table tbody tr:hover {
  background: rgba(48, 54, 61, 0.3);
}

.analytics-section .info-table .analytics-table tbody td {
  vertical-align: middle;
  border-color: var(--border-color);
}

/* Student Performance Heatmap – ApexCharts */
.chart-card-heatmap {
  display: flex;
  flex-direction: column;
  min-height: 320px;
}

.heatmap-header {
  flex-shrink: 0;
}

.chart-card-heatmap .chart-subtitle {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.0625rem;
  flex-shrink: 0;
}

.heatmap-legend {
  flex-shrink: 0;
}

.heatmap-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.heatmap-legend-text {
  color: var(--text-muted);
}

.heatmap-chart-container {
  flex: 1 1 auto;
  min-height: 260px;
  width: 100%;
  max-width: 100%;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  box-sizing: border-box;
  border: 1px solid var(--border-color);
}

@media (min-width: 768px) {
  .heatmap-chart-container {
    min-height: 280px;
    padding: 20px;
  }
}

.heatmap-chart-container .apexcharts-heatmap-rect {
  cursor: pointer;
  transition: filter 0.15s ease;
}

.heatmap-chart-container .apexcharts-heatmap-rect:hover {
  filter: brightness(1.1);
}

.heatmap-chart-container .apexcharts-xaxis-label,
.heatmap-chart-container .apexcharts-yaxis-label {
  fill: var(--text-muted);
}

/* Top Performing Students – title row with menu */
.info-table-top-students .table-title-row {
  margin-bottom: 1rem;
}

.info-table-top-students .table-title {
  margin-bottom: 0;
}

.btn-icon-menu {
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 1rem;
  transition: background 0.2s, color 0.2s;
}

.btn-icon-menu:hover {
  background: rgba(48, 54, 61, 0.5);
  color: var(--text-primary);
}

.analytics-section .info-table .analytics-table .text-success {
  font-weight: 600;
  color: #22c55e !important;
}

/* Legacy heatmap table (kept for any other usage) */
.heatmap-wrapper {
  width: 100%;
  overflow: auto;
}

.heatmap-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.heatmap-table th,
.heatmap-table td {
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  text-align: center;
}

.heatmap-table thead th {
  background: rgba(48, 54, 61, 0.5);
  font-weight: 600;
}

.heatmap-table .heat-light {
  background: rgba(53, 120, 229, 0.25);
}

.heatmap-table .heat-mid {
  background: rgba(53, 120, 229, 0.5);
}

.heatmap-table .heat-dark {
  background: rgba(53, 120, 229, 0.85);
}

/* Live metrics – use detail-count-card; icon for analytics */
.live-metrics-section .analytics-metric-icon {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  color: var(--white);
  font-size: 1.25rem;
  background: linear-gradient(135deg, var(--accent-blue), var(--card-border-accent-cyan));
}

.live-metrics-section .analytics-metric-icon img {
  filter: none;
}

/* Form selects on analytics (dark theme) */
.chart-filters .form-select-theme {
  min-width: 150px;
}

.date-filter .form-select-theme {
  min-width: 130px;
}

.school-outcome-overview-right .outcome-filter-select {
  max-width: 170px;
  flex-shrink: 0;
}

/* Teachers grid & cards – Education Outcomes */
.teachers-grids-outer {
  margin-top: 1.5rem;
}

.teachers-grids-title {
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.teachers-grids-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.teacher-card {
  background: linear-gradient(165deg, var(--bg-darker) 0%, #151a22 50%, var(--bg-darker) 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.teacher-card:hover {
  border-color: var(--accent-blue);
  box-shadow: 0 4px 16px rgba(53, 120, 229, 0.12);
}

/* Policy version table – above card details */
.policy-version-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-darker);
}

.policy-version-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.policy-version-table thead th {
  text-align: left;
  padding: 0.875rem 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.policy-version-table thead th,
.policy-version-table tbody td {
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.policy-version-table tbody td {
  padding: 0.75rem;
}

.policy-version-table tbody tr:last-child td {
  border-bottom: none;
}

.policy-status-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.policy-actions-cell {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.policy-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
}

.policy-action-btn:hover {
  opacity: 0.9;
  background: rgba(255, 255, 255, 0.06);
}

.policy-action-view {
  border-color: rgba(136, 132, 255, 0.6);
  color: #a8a6ff;
}

.policy-action-download {
  border-color: rgba(44, 162, 103, 0.6);
  color: var(--stable);
}

.policy-action-delete {
  border-color: rgba(224, 76, 83, 0.6);
  color: var(--critical);
}

.teacher-card-header {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}

.teacher-avatar-wrap {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--border-color);
  background: var(--bg-dark);
}

.teacher-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.teacher-meta-wrap .teacher-name {
  font-size: .875rem;
}

.teacher-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  min-width: 0;
}

.teacher-meta .teacher-level,
.teacher-meta .teacher-subject {
  font-size: 0.75rem;
  color: var(--text-primary);
  background: rgba(48, 54, 61, 0.5);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.teacher-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.teacher-progress-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.teacher-progress-bar-striped {
  display: flex;
  width: 100%;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
}

.teacher-progress-bar-striped .strip {
  display: block;
  height: 100%;
  min-width: 4px;
  transition: width 0.3s ease;
}

.teacher-progress-bar-striped .strip-excellent {
  background: var(--stable);
}

.teacher-progress-bar-striped .strip-good {
  background: var(--card-border-accent-amber);
}

.teacher-progress-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.teacher-progress-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.teacher-progress-legend .legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.teacher-progress-legend .legend-dot.excellent {
  background: var(--stable);
}

.teacher-progress-legend .legend-dot.good {
  background: var(--card-border-accent-amber);
}

.behaviour-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
}

.behaviour-excellent {
  background: rgba(44, 162, 103, 0.2);
  color: var(--stable);
  border: 1px solid rgba(44, 162, 103, 0.4);
}

.behaviour-good {
  background: rgba(53, 120, 229, 0.2);
  color: var(--accent-blue);
  border: 1px solid rgba(53, 120, 229, 0.4);
}

.behaviour-bad {
  background: rgba(224, 76, 83, 0.2);
  color: var(--critical);
  border: 1px solid rgba(224, 76, 83, 0.4);
}

.behaviour-low {
  background: rgba(210, 160, 44, 0.2);
  color: var(--card-border-accent-amber);
  border: 1px solid rgba(210, 160, 44, 0.4);
}

.behaviour-outstanding {
  color: #8884ff;
  background: rgba(136, 132, 255, 0.2);
  border: 1px solid rgba(136, 132, 255, 0.4);
}

/* .iep-badges-list .behaviour-badge {
  border-color: #363e47;
  color: #b0b7bf;
  background: rgb(54 62 71);
} */

/* Health metrics summary – dark theme */
.health-metrics-summary {
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  height: 100%;
}

.health-metrics-summary .metrics-title {
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.health-metrics-summary .metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.health-metrics-summary .metric-item {
  padding: 0.75rem;
  background: rgba(48, 54, 61, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  transition: background 0.2s;
}

.health-metrics-summary .metric-item:hover {
  background: rgba(48, 54, 61, 0.6);
}

.health-metrics-summary .metric-item .metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.health-metrics-summary .metric-item .metric-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Behavior / metrics cards – dark theme */
.metrics-card-theme {
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.metrics-card-theme .metrics-title {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.metric-box-theme {
  background: rgba(48, 54, 61, 0.4);
  border: 1px solid var(--border-color);
  transition: background 0.2s;
}

.metric-box-theme .metric-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.metric-box-theme .metric-value {
  color: var(--text-primary);
  font-weight: 600;
}

.subject-item-theme {
  background: rgba(48, 54, 61, 0.4);
  border: 1px solid var(--border-color);
  transition: background 0.2s;
}

.subject-item-theme .subject-label {
  color: var(--text-primary);
}

.subject-item-theme .subject-rating {
  color: var(--text-primary);
}

.behavior-item-theme,
.comment-item-theme {
  color: var(--text-primary);
  padding: 0.5rem 0;
}

.behavior-list,
.comments-list {
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

/* Donut center label (87%) */
.chart-container.position-relative {
  position: relative;
}

.donut-center-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  pointer-events: none;
}

/* Donut chart HTML legend */
.donut-legend {
  padding: 0;
}

.donut-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.donut-legend-label {
  font-size: 0.9375rem;
  color: var(--text-primary);
}

/* Badge – bus/status (Excellent=green, Good=blue, Needs Attention=red) */
.badge-bus1 {
  background-color: var(--stable) !important;
  color: #fff !important;
}

.badge-bus2 {
  background-color: var(--accent-blue) !important;
  color: #fff !important;
}

.badge-bus3 {
  background-color: var(--critical) !important;
  color: #fff !important;
}

/* Policy version table */
.file-upload-wrapper {
  position: relative;
}

.file-upload-wrapper #avatar {
  opacity: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  cursor: pointer;
}

.file-upload-wrapper .file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--light-grey-border);
  border-radius: 10px;
  text-align: center;
  color: var(--text-highlight);
  font-size: var(--primary-font-size);
  font-weight: var(--font-medium);
  width: 100%;
  padding: 30px 20px;
  background-color: #fff3;
  transition: background-color .3s, transform .3s;
}

.file-upload-wrapper .file-upload-label .file-text {
  font-size: calc(var(--primary-font-size) * .875);
  opacity: .8;
}

.file-upload-wrapper #progress-container {
  width: 100%;
  height: 10px;
  background-color: #ddd;
  margin-top: 15px;
  border-radius: 5px;
  display: none;
}

.file-upload-wrapper #progress-container #progress-bar {
  height: 100%;
  width: 0%;
  background-color: #4caf50;
  border-radius: 5px;
  transition: width .3s;
}

.file-upload-wrapper .file-info {
  display: none;
  color: var(--text-highlight);
  font-size: calc(var(--primary-font-size) * .875);
  font-weight: var(--font-medium);
  margin-top: .625rem;
}

/* Import New Version modal – Bootstrap, dark theme */
.import-version-modal-dark .modal-content {
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  color: var(--text-primary);
}

.import-version-modal-dark .modal-dialog {
  max-width: 480px;
}

.import-version-modal-body {
  padding: 1.5rem 1.75rem 1.75rem;
  text-align: center;
}

.import-version-modal-title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.import-version-file-upload {
  margin-bottom: 0.75rem;
}

.import-version-file-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 140px;
  padding: 1.5rem 1rem;
  border: 2px dashed var(--border-color);
  border-radius: 10px;
  background: rgba(48, 54, 61, 0.3);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.import-version-file-label:hover,
.import-version-file-label.drag-over {
  border-color: var(--accent-blue);
  background: rgba(53, 120, 229, 0.08);
}

.import-version-folder-icon {
  font-size: 3rem;
  color: var(--accent-blue);
  opacity: 0.9;
}

.import-version-file-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.import-version-file-status {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.import-version-download-sample {
  margin: 0.5rem 0 1.25rem;
}

.import-version-sample-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.2s;
}

.import-version-sample-link:hover {
  color: var(--accent-blue-hover);
}

.import-version-modal-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Version Preview modal – Bootstrap, dark theme */
.version-preview-modal-dark .modal-content {
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  color: var(--text-primary);
}

.version-preview-modal-dark .modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
}

.version-preview-modal-dark .modal-title.version-preview-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

.version-preview-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.version-preview-modal-dark .modal-body {
  padding: 1rem 1.5rem 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.version-preview-info-card {
  background: rgba(48, 54, 61, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
}

.version-preview-card-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.version-preview-card-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.version-preview-status-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.version-preview-status-active {
  background: rgba(53, 120, 229, 0.3);
  color: #a8c7fa;
  border: 1px solid rgba(53, 120, 229, 0.5);
}

.version-preview-status-inactive {
  background: rgba(224, 76, 83, 0.2);
  color: #f0a0a4;
  border: 1px solid rgba(224, 76, 83, 0.4);
}

.version-preview-summary {
  background: linear-gradient(135deg, rgba(53, 120, 229, 0.15) 0%, rgba(48, 54, 61, 0.5) 100%);
  border: 1px solid rgba(53, 120, 229, 0.2);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.version-preview-summary-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.version-preview-summary-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-blue);
}

.version-preview-summary-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.version-preview-modal-dark .version-preview-table {
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--border-color);
  --bs-table-striped-bg: rgba(48, 54, 61, 0.3);
  --bs-table-hover-bg: rgba(48, 54, 61, 0.4);
  color: var(--text-primary);
}

.version-preview-modal-dark .version-preview-table thead th {
  background: rgba(48, 54, 61, 0.6);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
  border-color: var(--border-color);
  padding: 0.6rem 0.75rem;
}

.version-preview-modal-dark .version-preview-table tbody td {
  border-color: var(--border-color);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: #f2f2f2;
}

.version-preview-modal-dark .version-preview-table tbody td code {
  background: rgba(53, 120, 229, 0.2);
  color: var(--accent-blue);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.version-preview-modal-dark .version-preview-table tbody td[dir="rtl"],
.version-preview-modal-dark .version-preview-table tbody td:last-child {
  text-align: right;
  direction: rtl;
}

.version-preview-modal-footer {
  border-top: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  gap: 0.75rem;
}

.secondary-button {
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.secondary-button:hover {
  border-color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
}

.primary-button {
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, #667eea 0%, var(--accent-blue) 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.primary-button:hover {
  opacity: 0.9;
}

.primary-button:disabled {
  background: var(--border-color);
  color: var(--text-muted);
  cursor: not-allowed;
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-blue-hover);
}

/* Academic lists */
.academic-lists-header .search-box {
  max-width: 200px;
}
