/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Font */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Primary Colors from ATLAS */
  --primary-color: #16A085;
  --primary-hover: #138D75;
  --secondary-color: #48BB78;
  --danger-color: #F56565;
  --warning-color: #ED8936;
  --info-color: #4299E1;
  --success-color: #38C77D;

  /* Background Colors */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8F9FA;
  --bg-tertiary: #E9ECEF;
  --sidebar-bg: #2C3E50;
  --sidebar-active: #16A085;

  /* Text Colors */
  --text-primary: #2D3748;
  --text-secondary: #718096;
  --text-tertiary: #A0AEC0;
  --text-white: #FFFFFF;

  /* Border Colors */
  --border-color: #E2E8F0;
  --border-light: #EDF2F7;

  /* Layout */
  --sidebar-width: 260px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.12);
}

body {
  font-family: var(--font-main);
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 14px;
}

/* Layout */
.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--text-white);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: white;
  overflow: hidden;
}

.logo-icon img { width: 100%; height: 100%; display: block; }

.logo-text {
  font-size: 16px;
  font-weight: 600;
  color: white;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.nav-section {
  margin-bottom: 20px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 20px;
  margin-bottom: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
  font-size: 14px;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-white);
}

.nav-link.active {
  background: var(--sidebar-active);
  color: var(--text-white);
}

/* Collapsible nav toggle */
.nav-link-toggle {
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  justify-content: flex-start;
}

.nav-chevron {
  width: 16px;
  height: 16px;
  margin-left: auto;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.nav-link-toggle.open .nav-chevron {
  transform: rotate(180deg);
}

.nav-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.nav-submenu.open {
  max-height: 300px;
}

.nav-link-sub {
  padding-left: 50px !important;
  font-size: 13px !important;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.user-details {
  flex: 1;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: white;
}

.user-role {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 24px;
  max-width: calc(100vw - var(--sidebar-width));
  background: var(--bg-secondary);
}

/* Page Header */
.page-header {
  margin-bottom: 24px;
  background: transparent;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.header-stats {
  display: flex;
  gap: 40px;
  align-items: center;
}

.header-stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 36px;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1;
}

.stat-number.unscheduled {
  color: var(--text-secondary);
}

.stat-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 6px;
}

/* Filters Container */
.filters-container {
  background: var(--bg-primary);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  position: relative;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.filter-item {
  display: flex;
  flex-direction: column;
}

.filter-item label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.filter-input,
.filter-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all 0.2s;
  height: 38px;
}

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(22, 160, 133, 0.1);
}

.clear-filters-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.clear-filters-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-secondary);
}

/* Timetable Version Box */
.timetable-version {
  background: #2C3E50;
  color: var(--text-white);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.version-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px;
}

.version-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.version-label {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.version-value {
  font-size: 18px;
  font-weight: 700;
  color: white;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: fit-content;
}

.status-generated {
  background: var(--success-color);
  color: white;
}

/* Day Section */
.day-section {
  margin-bottom: 24px;
}

.day-header {
  background: var(--bg-primary);
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
}

.day-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-count {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Class Cards */
.class-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.class-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 16px;
  transition: all 0.2s;
  cursor: pointer;
  box-shadow: var(--shadow-card);
}

.class-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-color);
}

.card-time {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.card-time svg {
  width: 14px;
  height: 14px;
  stroke: var(--text-tertiary);
}

.card-time-value {
  background: var(--bg-tertiary);
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 12px;
}

.card-subject {
  margin-bottom: 14px;
}

.subject-badge {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

.subject-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.card-info {
  display: grid;
  gap: 8px;
}

.card-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.card-info-row svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: var(--text-tertiary);
}

/* Loading State */
.loading-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-primary);
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-primary);
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.modal-content {
  background: var(--bg-primary);
  border-radius: 12px;
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content-lg {
  max-width: 960px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-tertiary);
  border-radius: 50%;
  font-size: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
}

.modal-close:hover {
  background: var(--border-color);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.schedule-list {
  display: grid;
  gap: 12px;
}

.schedule-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--border-light);
  min-width: 0;
  overflow: hidden;
}

.schedule-time-badge {
  background: var(--primary-color);
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  height: fit-content;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lecture-number-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: var(--primary-color);
  font-weight: 800;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  margin-right: 6px;
  min-width: 24px;
}

.schedule-details {
  flex: 1;
  min-width: 0;
}

.schedule-subject {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.status-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.status-taken {
  background: #d1fae5;
  color: #065f46;
}

.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.schedule-meta {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  line-height: 1.5;
}

.schedule-meta span {
  white-space: nowrap;
}

/* ─── Hours Summary (Cards) ────────────────────────── */
.hours-summary {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.hours-item {
  flex: 1;
  text-align: center;
  padding: 6px 4px;
  border-radius: 6px;
}

.hours-allotted {
  background: #f1f5f9;
}

.hours-taken {
  background: #d1fae5;
}

.hours-pending {
  background: #fef3c7;
}

/* Positive pending hours (> 0) — flag in red */
.hours-pending-red {
  background: #fee2e2;
}

.hours-pending-red .hours-value,
.hours-pending-red .hours-label {
  color: #b91c1c;
}

.hours-value {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.hours-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-top: 2px;
}

.lecture-number-badge.badge-na {
  background: #e2e8f0;
  color: #94a3b8;
}

/* ─── Lecture Breakdown (Faculty Card) ──────────────── */
.lecture-breakdown {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.breakdown-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.breakdown-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-primary);
  padding: 4px 8px;
  background: var(--bg-secondary);
  border-radius: 6px;
}

.breakdown-class {
  font-weight: 600;
  min-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breakdown-subject {
  flex: 1;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breakdown-count {
  background: var(--primary-color);
  color: white;
  font-size: 11px;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  padding: 0 6px;
  flex-shrink: 0;
}

/* ─── Modal Lecture Summary ─────────────────────────── */
.modal-lecture-summary {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  overflow: hidden;
  min-width: 0;
}

.summary-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.summary-total {
  font-size: 20px;
  font-weight: 800;
  color: #166534;
}

.summary-label {
  font-size: 13px;
  font-weight: 500;
  color: #4ade80;
}

.summary-table {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-x: auto;
}

.summary-table-header {
  display: grid;
  grid-template-columns: minmax(100px, 1.2fr) minmax(100px, 1.5fr) 60px 60px 70px 70px 76px;
  gap: 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  white-space: nowrap;
  min-width: 0;
}

.summary-table-row {
  display: grid;
  grid-template-columns: minmax(100px, 1.2fr) minmax(100px, 1.5fr) 60px 60px 70px 70px 76px;
  gap: 8px;
  padding: 8px 10px;
  font-size: 12.5px;
  background: white;
  border-radius: 6px;
  align-items: center;
  min-width: 0;
}

.summary-table-row span:first-child {
  font-weight: 600;
  color: var(--text-primary);
  white-space: normal;
  word-break: break-word;
}

.summary-table-row span:nth-child(2) {
  color: var(--text-secondary);
  white-space: normal;
  word-break: break-word;
}

.summary-count-badge {
  background: #16a34a;
  color: white;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  padding: 2px 8px;
  border-radius: 10px;
  width: fit-content;
  justify-self: end;
}

/* Tabs */
.tabs-container {
  display: flex;
  gap: 4px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-primary);
  padding: 16px 20px 0;
  border-radius: 8px 8px 0 0;
  border: 1px solid var(--border-light);
  border-bottom: none;
}

.tab-button {
  padding: 10px 20px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  border-radius: 6px 6px 0 0;
}

.tab-button:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.tab-button.active {
  color: var(--primary-color);
  background: transparent;
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-color);
}

.tab-content {
  display: none;
  background: var(--bg-primary);
  padding: 24px;
  border-radius: 0 0 8px 8px;
  border: 1px solid var(--border-light);
  border-top: none;
}

.tab-content.active {
  display: block;
}

/* Unscheduled Items */
.unscheduled-list {
  background: var(--bg-primary);
}

.unscheduled-items {
  display: grid;
  gap: 12px;
}

.unscheduled-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  transition: all 0.2s;
}

.unscheduled-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-color);
}

.unscheduled-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.unscheduled-details {
  flex: 1;
}

.unscheduled-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.unscheduled-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.unscheduled-reason {
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  display: inline-block;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .class-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

@media (max-width: 1024px) {
  .sidebar {
    width: 220px;
  }
  
  .main-content {
    margin-left: 220px;
  }
  
  .filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
    max-width: 100vw;
    padding: 16px;
  }
  
  .header-top {
    flex-direction: column;
    gap: 16px;
  }
  
  .header-stats {
    width: 100%;
    justify-content: space-around;
  }
  
  .filter-grid {
    grid-template-columns: 1fr;
  }
  
  .class-cards-grid {
    grid-template-columns: 1fr;
  }
  
  .version-info {
    grid-template-columns: 1fr 1fr;
  }
  
  .page-title {
    font-size: 24px;
  }
  
  .stat-number {
    font-size: 28px;
  }
}

/* School Color Variations */
.subject-badge[data-school="7"],
.class-card[data-school="7"] .subject-badge { 
  background: #E12A7B; 
}

.subject-badge[data-school="8"],
.class-card[data-school="8"] .subject-badge { 
  background: #009FE0; 
}

.subject-badge[data-school="11"],
.class-card[data-school="11"] .subject-badge { 
  background: #ED1A3B; 
}

.subject-badge[data-school="13"],
.class-card[data-school="13"] .subject-badge { 
  background: #ED1A3B; 
}

.subject-badge[data-school="16"],
.class-card[data-school="16"] .subject-badge { 
  background: #CC5500; 
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--text-secondary);
}

/* Feedback Button */
.feedback-btn {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 8px 16px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  z-index: 100;
}

.feedback-btn:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--text-secondary);
}

/* Timetable Cards Container */
.timetable-cards {
  display: grid;
  gap: 16px;
}

/* ─── Infra Dashboard: Right Sidebar ─────────────────────── */
.infra-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background: #1e293b;
  color: #e2e8f0;
  z-index: 1100;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
}

.infra-sidebar.open {
  transform: translateX(0);
}

.infra-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.infra-sidebar-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: white;
  margin: 0;
}

.sidebar-toggle-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.15s;
}

.sidebar-toggle-close:hover {
  color: white;
  background: rgba(255,255,255,0.1);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ─── School Chips ───────────────────────────────────────── */
.school-chips {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.school-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  width: 100%;
}

.school-chip:hover {
  background: rgba(255,255,255,0.05);
  color: #e2e8f0;
  border-color: rgba(255,255,255,0.2);
}

.school-chip.palette-selected {
  background: rgba(16,185,129,0.15);
  color: #34d399;
  border-color: rgba(16,185,129,0.3);
}

.chip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.infra-sidebar-actions {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-action-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.15s;
}

.sidebar-action-link:hover {
  background: rgba(255,255,255,0.05);
  color: #e2e8f0;
}

/* ─── Infra Filter Grid ──────────────────────────────────── */
.infra-filter-grid {
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1400px) {
  .infra-filter-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .infra-filter-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ─── Filter Toggles Row ─────────────────────────────────── */
.filter-toggles {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 12px;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

.toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

/* ─── Gantt Chart ────────────────────────────────────────── */
.gantt-container {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow-x: auto;
  box-shadow: var(--shadow-card);
}

.gantt-header {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 10;
  min-width: 0;
}

.gantt-room-header {
  width: 180px;
  min-width: 180px;
  padding: 14px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-right: 1px solid var(--border-color);
  display: flex;
  align-items: center;
}

.gantt-timeline-header {
  flex: 1;
  display: flex;
  min-width: 0;
}

.gantt-hour {
  flex: 1;
  padding: 14px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-align: center;
  border-right: 1px solid var(--border-light);
}

.gantt-hour:last-child {
  border-right: none;
}

.gantt-row {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
  min-width: 0;
}

.gantt-row:hover {
  background: rgba(241,245,249,0.5);
}

.gantt-row:last-child {
  border-bottom: none;
}

.gantt-room-info {
  width: 180px;
  min-width: 180px;
  padding: 14px 16px;
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fafbfc;
  position: relative;
  z-index: 6;
}

.gantt-room-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.gantt-room-detail {
  font-size: 11px;
  color: var(--text-tertiary);
}

.gantt-timeline {
  flex: 1;
  position: relative;
  min-height: 84px;
  min-width: 0;
  overflow: hidden;
}

.gantt-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
}

.gantt-grid-line {
  flex: 1;
  border-right: 1px solid var(--border-light);
}

.gantt-grid-line:last-child {
  border-right: none;
}

.gantt-schedule {
  position: absolute;
  top: 5px;
  bottom: 5px;
  border-radius: 6px;
  padding: 6px 10px;
  color: white;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
  z-index: 5;
  min-width: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.gantt-schedule:hover {
  opacity: 0.92;
  transform: scaleY(1.04);
  z-index: 6;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

.gantt-schedule .schedule-time {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.gantt-schedule .schedule-title {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  line-height: 1.3;
}

.gantt-schedule .schedule-info {
  font-size: 10px;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.gantt-available {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--success-color);
  font-weight: 500;
}

/* ─── Gantt Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
  .gantt-room-header,
  .gantt-room-info {
    width: 120px;
    min-width: 120px;
    padding: 8px 10px;
  }

  .gantt-room-name {
    font-size: 11px;
  }

  .gantt-room-detail {
    font-size: 10px;
  }

  .infra-sidebar {
    width: 260px;
  }

  .gantt-hour {
    padding: 10px 2px;
    font-size: 9px;
  }

  .gantt-schedule .schedule-title {
    font-size: 10px;
  }

  .gantt-schedule .schedule-time,
  .gantt-schedule .schedule-info {
    font-size: 8px;
  }
}

@media (max-width: 480px) {
  .gantt-room-header,
  .gantt-room-info {
    width: 90px;
    min-width: 90px;
    padding: 6px 8px;
  }

  .gantt-room-name {
    font-size: 10px;
  }
}

/* ════════════════════════════════════════════════════════════
   COMPREHENSIVE MOBILE RESPONSIVE STYLES
   ════════════════════════════════════════════════════════════ */

/* ─── Tablet breakpoint (1024px) ───────────────────────── */
@media (max-width: 1024px) {
  .filters-container {
    padding: 16px;
  }

  .filter-toggles {
    flex-wrap: wrap;
    gap: 12px;
  }

  .modal-content,
  .modal-content-lg {
    max-width: 95vw;
  }
}

/* ─── Mobile breakpoint (768px) ────────────────────────── */
@media (max-width: 768px) {
  /* ── Page content padding ── */
  .p-\[32px\] {
    padding: 16px !important;
  }

  /* ── Modal adjustments ── */
  .modal-overlay {
    padding: 12px;
  }

  .modal-content,
  .modal-content-lg {
    max-width: 100%;
    max-height: 95vh;
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-header h2 {
    font-size: 15px;
  }

  .modal-body {
    padding: 14px;
  }

  /* ── Schedule items ── */
  .schedule-item {
    flex-direction: column;
    gap: 10px;
  }

  .schedule-time-badge {
    align-self: flex-start;
    font-size: 11px;
    padding: 5px 10px;
    white-space: normal;
    line-height: 1.4;
  }

  .schedule-subject {
    font-size: 13px;
  }

  .schedule-meta {
    font-size: 11px;
    gap: 2px 8px;
  }

  .schedule-meta span {
    white-space: normal;
  }

  .summary-table-header,
  .summary-table-row {
    grid-template-columns: minmax(80px, 1fr) minmax(80px, 1.2fr) 48px 48px 56px 56px 48px;
    gap: 6px;
    font-size: 11px;
    padding: 6px 8px;
  }

  .summary-total {
    font-size: 18px;
  }

  .modal-lecture-summary {
    padding: 12px;
  }

  /* ── Tabs responsive ── */
  .tabs-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 12px 0;
    gap: 0;
  }

  .tab-button {
    padding: 8px 14px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .tab-content {
    padding: 16px;
  }

  /* ── Unscheduled items ── */
  .unscheduled-item {
    flex-direction: column;
    gap: 12px;
  }

  .unscheduled-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  /* ── Filter toggles ── */
  .filter-toggles {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* ── Feedback button ── */
  .feedback-btn {
    top: auto;
    bottom: 16px;
    right: 16px;
    top: initial;
  }

  /* ── Buttons ── */
  .btn {
    padding: 8px 16px;
    font-size: 13px;
  }

  /* ── Loading & empty states ── */
  .loading-state,
  .empty-state {
    padding: 40px 16px;
  }

  .empty-icon {
    font-size: 36px;
  }

  .empty-state h3 {
    font-size: 16px;
  }

  /* ── Card adjustments ── */
  .class-card {
    padding: 14px;
  }

  .subject-name {
    font-size: 14px;
  }

  .card-info-row {
    font-size: 12px;
  }

  /* ── Day section ── */
  .day-header {
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
  }

  .day-title {
    font-size: 16px;
  }

  /* ── Timetable version box ── */
  .timetable-version {
    padding: 16px;
  }

  .version-info {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  /* ── Filters container ── */
  .filters-container {
    padding: 12px;
  }

  .clear-filters-btn {
    position: static;
    margin-top: 12px;
  }
}

/* ─── Small mobile breakpoint (480px) ──────────────────── */
@media (max-width: 480px) {
  .class-cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .version-info {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .day-header {
    padding: 10px 12px;
  }

  .day-title {
    font-size: 14px;
  }

  .class-card {
    padding: 12px;
  }

  .card-time-value {
    font-size: 11px;
  }

  .modal-header h2 {
    font-size: 16px;
  }

  .modal-overlay {
    padding: 8px;
  }

  .modal-body {
    padding: 12px;
  }

  .schedule-time-badge {
    font-size: 10.5px;
    padding: 4px 8px;
  }

  .lecture-number-badge {
    font-size: 10px;
    padding: 1px 5px;
    min-width: 20px;
    margin-right: 4px;
  }

  .schedule-subject {
    font-size: 12.5px;
  }

  .schedule-meta {
    font-size: 10.5px;
  }

  .summary-table-header,
  .summary-table-row {
    grid-template-columns: minmax(60px, 1fr) minmax(60px, 1fr) 42px 42px 50px 50px 42px;
    font-size: 10.5px;
    padding: 5px 6px;
  }

  .summary-total {
    font-size: 16px;
  }

  .summary-label {
    font-size: 11px;
  }

  /* ── Infra filter ── */
  .infra-filter-grid {
    grid-template-columns: 1fr;
  }

  /* ── Tabs ── */
  .tab-button {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* ════════════════════════════════════════════════════════════
   MEETING BOOKING STYLES
   ════════════════════════════════════════════════════════════ */

/* ─── Meeting Form ──────────────────────────────────────── */
.meeting-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: all 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.form-control::placeholder {
  color: var(--text-tertiary);
}

textarea.form-control {
  resize: vertical;
  min-height: 70px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

/* ─── Meeting Status Message ────────────────────────────── */
.meeting-status-msg {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}

.meeting-status-msg.success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.meeting-status-msg.error {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ─── Meetings List ─────────────────────────────────────── */
.meetings-list-container {
  display: grid;
  gap: 10px;
}

.meeting-card {
  display: flex;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  transition: all 0.2s;
  box-shadow: var(--shadow-card);
}

.meeting-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-color);
}

.meeting-card-time {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.meeting-time-badge {
  background: #1e293b;
  color: white;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.meeting-type-badge {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.meeting-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}

.meeting-card-room {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.meeting-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  align-items: center;
}

.meeting-card-reason {
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 2px 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
}

.meeting-card-description {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.4;
}

.meeting-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
  padding-left: 12px;
}

.meeting-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border-light, #e2e8f0);
  background: white;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-secondary, #64748b);
}

.meeting-action-btn:hover {
  background: var(--bg-tertiary, #f1f5f9);
}

.meeting-edit-btn:hover {
  color: #3b82f6;
  border-color: #3b82f6;
}

.meeting-delete-btn:hover {
  color: #ef4444;
  border-color: #ef4444;
}

.meeting-status-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
}

/* ─── Meeting Mobile ────────────────────────────────────── */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .meeting-card {
    flex-direction: column;
    gap: 10px;
  }

  .meeting-card-time {
    flex-direction: row;
    align-items: center;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .meeting-card {
    padding: 12px;
  }

  .meeting-card-room {
    font-size: 14px;
  }
}

/* ─── Gantt Meeting Block ───────────────────────────────── */
.gantt-meeting {
  border: 2px dashed rgba(255, 255, 255, 0.5);
}

/* ─── Gantt Exam Block ──────────────────────────────────── */
.gantt-exam {
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.35);
}

/* ─── Searchable Select Dropdown ─────────────────────────── */
.searchable-select {
  position: relative;
}

.searchable-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 8px 8px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.searchable-select.open .searchable-dropdown {
  display: block;
}

.searchable-select.open .searchable-input {
  border-radius: 8px 8px 0 0;
}

.searchable-option {
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-primary);
  transition: background 0.15s;
}

.searchable-option:hover,
.searchable-option.highlighted {
  background: rgba(16, 185, 129, 0.08);
}

.searchable-option.selected {
  background: rgba(16, 185, 129, 0.15);
  font-weight: 600;
}

.searchable-no-results {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: center;
}

/* ─── Multi-Room Select Component ───────────────────────── */
.multi-room-select {
  position: relative;
}

.multi-room-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 8px 8px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.multi-room-select.open .multi-room-dropdown {
  display: block;
}

.multi-room-select.open .form-control {
  border-radius: 8px 8px 0 0;
}

.multi-room-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-primary);
  transition: background 0.15s;
}

.multi-room-option:hover {
  background: rgba(16, 185, 129, 0.08);
}

.multi-room-option.checked {
  background: rgba(16, 185, 129, 0.12);
}

.multi-room-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #10b981;
  cursor: pointer;
  pointer-events: none;
}

.multi-room-option span {
  flex: 1;
}

.selected-rooms-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.room-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 16px;
  font-size: 0.75rem;
  color: #065f46;
  font-weight: 500;
}

.room-chip-remove {
  background: none;
  border: none;
  color: #065f46;
  font-size: 14px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.room-chip-remove:hover {
  opacity: 1;
}

/* ─── Conflict Preview ──────────────────────────────────── */
.conflict-preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px 8px 0 0;
  margin-bottom: 0;
}

#conflictPreview .booking-results-list {
  border-radius: 0 0 8px 8px;
  border-top: none;
}

.conflict-preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 0 0;
}

.conflict-preview-actions .btn {
  padding: 8px 18px;
  font-size: 0.82rem;
}

/* ─── Booking Results List ──────────────────────────────── */
.booking-results-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-top: 4px;
}

.booking-result-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  border-bottom: 1px solid #f1f5f9;
}

.booking-result-item:last-child {
  border-bottom: none;
}

.booking-result-item.success {
  background: rgba(16, 185, 129, 0.04);
}

.booking-result-item.conflict {
  background: rgba(239, 68, 68, 0.04);
}

.result-icon {
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.result-icon.success {
  color: #10b981;
}

.result-icon.conflict {
  color: #ef4444;
}

.result-room {
  font-weight: 600;
  color: #1e293b;
  min-width: 80px;
}

.result-date {
  color: #64748b;
  min-width: 90px;
}

.result-msg {
  color: #64748b;
  flex: 1;
  text-align: right;
}

/* ─── Infra Analytics Section ────────────────────────────── */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.analytics-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.analytics-card-header {
  padding: 16px 20px 0;
}

.analytics-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 2px 0;
}

.analytics-card-subtitle {
  font-size: 0.7rem;
  color: #94a3b8;
}

.analytics-card-body {
  padding: 12px 16px 16px;
  height: 220px;
  position: relative;
}

.analytics-card-body-donut {
  height: 240px;
}

@media (max-width: 768px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytics-card-body {
    height: 200px;
  }

  .analytics-card-body-donut {
    height: 220px;
  }
}

@media (min-width: 769px) and (max-width: 1200px) {
  .analytics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ─── Analytics Table ────────────────────────────────────── */
.analytics-table {
  width: 100%;
  border-collapse: collapse;
}

.analytics-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #e2e8f0;
}

.analytics-table td {
  padding: 10px 14px;
  font-size: 0.8rem;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
}

.analytics-table tr:hover td {
  background: #f8fafc;
}

.analytics-table th:last-child,
.analytics-table td:last-child {
  min-width: 160px;
}

.analytics-bar-bg {
  flex: 1;
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  overflow: hidden;
}

.analytics-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ═══ Infra Analytics (ia-) Dashboard ═══════════════════════ */

/* Stats Bar */
.ia-stats-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

.ia-stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 10px;
  flex: 1;
  min-width: 120px;
}

.ia-stat-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ia-stat-icon svg {
  width: 15px;
  height: 15px;
}

.ia-stat-label {
  font-size: 0.6rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.ia-stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
}

.ia-stat-divider {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,0.08);
  flex-shrink: 0;
}

/* 3-column row */
.ia-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* Card */
.ia-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
}

.ia-card-hdr {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 12px 6px;
  gap: 6px;
  flex-wrap: wrap;
}

.ia-card-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.ia-card-sub {
  font-size: 0.62rem;
  color: #94a3b8;
}

.ia-card-tag {
  font-size: 0.6rem;
  font-weight: 600;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.ia-card-body {
  flex: 1;
  padding: 8px 12px 10px;
}

/* Legend */
.ia-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6rem;
  color: #94a3b8;
  flex-wrap: wrap;
}

.ia-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
  margin-left: 6px;
}

/* Mini rings container */
.ia-mini-rings {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: flex-start;
}

/* Building bars */
.ia-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}

.ia-bar-label {
  font-size: 0.68rem;
  font-weight: 500;
  color: #334155;
  width: 100px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ia-bar-track {
  flex: 1;
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}

.ia-bar-bg-bar {
  height: 100%;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.ia-bar-fill-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.ia-bar-pct {
  font-size: 0.68rem;
  font-weight: 700;
  color: #334155;
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}

/* Table */
.ia-table {
  width: 100%;
  border-collapse: collapse;
}

.ia-table th {
  padding: 5px 8px;
  text-align: left;
  font-size: 0.6rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #e2e8f0;
}

.ia-table td {
  padding: 5px 8px;
  font-size: 0.72rem;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
}

.ia-table tr:hover td {
  background: #f8fafc;
}

/* Sub-sections */
.ia-sub-section {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
}

.ia-sub-section:last-child {
  border-bottom: none;
}

.ia-sub-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.ia-sub-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: #1e293b;
}

/* Badges */
.ia-badge {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.ia-badge-green {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.ia-badge-blue {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Room list */
.ia-room-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ia-room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px solid #f8fafc;
}

.ia-room-item:last-child {
  border-bottom: none;
}

.ia-room-name {
  font-size: 0.72rem;
  font-weight: 500;
  color: #1e293b;
}

.ia-room-meta {
  font-size: 0.6rem;
  color: #94a3b8;
}

.ia-room-empty {
  font-size: 0.7rem;
  color: #94a3b8;
  text-align: center;
  padding: 8px 0;
}

.ia-room-more {
  font-size: 0.65rem;
  color: #3b82f6;
  text-align: center;
  padding: 4px 0;
  font-weight: 500;
}

/* Status pill */
.ia-status-pill {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 1024px) {
  .ia-row-3 {
    grid-template-columns: 1fr 1fr;
  }
  .ia-row-3 > :last-child {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .ia-row-3 {
    grid-template-columns: 1fr;
  }
  .ia-row-3 > :last-child {
    grid-column: span 1;
  }
  .ia-stats-bar {
    gap: 4px;
    padding: 8px;
  }
  .ia-stat-item {
    padding: 2px 6px;
    min-width: 100px;
  }
  .ia-stat-divider {
    display: none;
  }
  .ia-stat-value {
    font-size: 0.9rem;
  }
}