@font-face {
  font-family: "Vazirmatn";
  src: url("/demo-academy/static/fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("/demo-academy/static/fonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("/demo-academy/static/fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("/demo-academy/static/fonts/Vazirmatn-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-canvas: #F1F5F9;
  --bg-surface: #FFFFFF;
  --bg-sidebar: #0F172A;
  --bg-sidebar-hover: #1E293B;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --border-color: #E2E8F0;
  --amber: #F59E0B;
  --amber-dark: #D97706;
  --cobalt: #2563EB;
  --cobalt-dark: #1D4ED8;
  --emerald: #10B981;
  --crimson: #EF4444;
  --cyan: #06B6D4;
  --radius: 12px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Vazirmatn", Tahoma, sans-serif;
  background: var(--bg-canvas);
  color: var(--text-main);
  font-size: 13.5px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

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

/* Sidebar */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  color: #F8FAFC;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  border-left: 1px solid #1E293B;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 20px;
  border-bottom: 1px solid #1E293B;
  margin-bottom: 16px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--amber), #EA580C);
  color: #0F172A;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand-logo svg {
  width: 24px;
  height: 24px;
}
.brand-title {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.2px;
}
.brand-sub {
  font-size: 11px;
  color: #94A3B8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #CBD5E1;
  cursor: pointer;
  text-align: right;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: #FFFFFF;
}
.nav-item.is-active {
  background: rgba(245, 158, 11, 0.16);
  color: var(--amber);
  font-weight: 700;
}
.nav-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
}

.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid #1E293B;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.date-pill {
  background: #1E293B;
  color: #CBD5E1;
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 8px;
  text-align: center;
}

/* Main Area */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar-title-group h1 {
  font-size: 18px;
  font-weight: 800;
}
.topbar-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box input {
  width: 260px;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 9px;
  background: #F8FAFC;
  outline: none;
}
.search-box input:focus {
  border-color: var(--cobalt);
  background: #fff;
}

.view-container {
  padding: 20px 24px;
  flex: 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s, background 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn-full { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-primary { background: var(--cobalt); color: #fff; }
.btn-primary:hover { background: var(--cobalt-dark); }
.btn-amber { background: var(--amber); color: #0F172A; font-weight: 700; }
.btn-amber:hover { background: var(--amber-dark); color: #fff; }
.btn-emerald { background: var(--emerald); color: #fff; }
.btn-danger { background: var(--crimson); color: #fff; }
.btn-outline { background: #fff; border-color: var(--border-color); color: var(--text-main); }
.btn-outline:hover { background: #F8FAFC; }

/* Cards & Grids */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 22px;
  font-weight: 800;
}
.kpi-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 16px;
}
.grid-bays {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.bay-card {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  background: #F8FAFC;
}
.bay-card.is-busy {
  border-right: 4px solid var(--amber);
  background: #FFFBEB;
}
.bay-card.is-free {
  border-right: 4px solid var(--emerald);
  background: #ECFDF5;
}
.bay-name {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
}

/* Authentic Iranian License Plate */
.ir-plate {
  display: inline-flex;
  align-items: stretch;
  direction: ltr;
  border: 1.5px solid #1E293B;
  border-radius: 6px;
  background: #FFFFFF;
  overflow: hidden;
  font-weight: 800;
  font-size: 13px;
  color: #0F172A;
  height: 28px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.ir-plate-flag {
  background: #1D4ED8;
  color: #fff;
  width: 18px;
  font-size: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}
.ir-plate-main {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
}
.ir-plate-iran {
  border-left: 1.5px solid #1E293B;
  padding: 0 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
}
.ir-plate-iran small {
  font-size: 7px;
  color: #475569;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}
th {
  background: #F8FAFC;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-muted);
}
tr:hover td {
  background: #F8FAFC;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}
.badge-info { background: #DBEAFE; color: #1E40AF; }
.badge-amber { background: #FEF3C7; color: #92400E; }
.badge-purple { background: #EDE9FE; color: #5B21B6; }
.badge-emerald { background: #D1FAE5; color: #065F46; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-slate { background: #F1F5F9; color: #334155; }

/* Schematic Layout */
.schematic-workspace {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
  align-items: start;
}
.car-blueprint-svg {
  width: 100%;
  height: auto;
  display: block;
}
.schematic-title {
  font-family: "Vazirmatn", sans-serif;
  font-size: 12px;
  font-weight: 700;
  fill: #475569;
}
.panel-lbl {
  font-family: "Vazirmatn", sans-serif;
  font-size: 11px;
  font-weight: 700;
  fill: #1E293B;
  pointer-events: none;
}
.panel-lbl-sm {
  font-family: "Vazirmatn", sans-serif;
  font-size: 9.5px;
  font-weight: 600;
  fill: #1E293B;
  pointer-events: none;
}
.panel-lbl-xs {
  font-family: "Vazirmatn", sans-serif;
  font-size: 8px;
  font-weight: 700;
  fill: #1E293B;
  pointer-events: none;
}
.schematic-micron {
  font-family: "Vazirmatn", sans-serif;
  font-size: 9.5px;
  font-weight: 800;
  fill: #0F172A;
  pointer-events: none;
}
.car-panel {
  cursor: pointer;
  transition: opacity 0.15s, filter 0.15s;
}
.car-panel:hover {
  opacity: 0.85;
  filter: brightness(0.96);
}
.car-panel.is-selected {
  filter: drop-shadow(0 0 6px rgba(15, 23, 42, 0.35));
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 8px;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
}
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.2);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form-group.full {
  grid-column: 1 / -1;
}
.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}
.form-control {
  padding: 8px 10px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  background: #fff;
  outline: none;
}
.form-control:focus {
  border-color: var(--cobalt);
}

.plate-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  direction: ltr;
}
.plate-input-row input, .plate-input-row select {
  text-align: center;
  font-weight: 700;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-backdrop.hidden {
  display: none;
}
.modal-card {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 820px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
}
.modal-body {
  padding: 18px;
  overflow-y: auto;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}
.toast {
  background: #0F172A;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  border-right: 4px solid var(--amber);
}

/* Print */
.print-area {
  display: none;
}
@media print {
  * {
    print-color-adjust: exact !important;
    -webkit-print-color-adjust: exact !important;
  }
  body {
    background: #FFFFFF !important;
  }
  .app-shell, .modal-backdrop, .toast-container {
    display: none !important;
  }
  .print-area {
    display: block !important;
    padding: 12px;
    color: #000;
  }
  .car-blueprint-svg {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }
}
