/* ============================================================
   SMS Admin Panel — Custom CSS
   Student Management System v2.0
   ============================================================ */

/* ── ROOT VARIABLES ── */
:root {
  --sms-primary: #3b7ddd;
  --sms-primary-dark: #2d68c7;
  --sms-success: #28a745;
  --sms-danger: #dc3545;
  --sms-warning: #ffc107;
  --sms-info: #17a2b8;
  --sms-purple: #6f42c1;
  --sms-orange: #fd7e14;
  --sms-teal: #20c997;
  --sidebar-bg: #1a2035;
  --sidebar-hover: #0f1629;
  --card-radius: 12px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,.12);
  --transition: all 0.2s ease;
}

/* ── BASE ── */
* { box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; font-size: 14px; background: #f4f6fb; }

/* ── SIDEBAR LAYOUT ── */
.main-sidebar {
  background: var(--sidebar-bg) !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  overflow: visible !important;
  position: fixed !important;
  width: 260px !important;
}
/* Override AdminLTE's hardcoded calc(100% - 57px) so flex controls height */
.main-sidebar .sidebar {
  height: auto !important;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: visible !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
  padding-bottom: 16px;
}
.main-sidebar .sidebar::-webkit-scrollbar { width: 5px; }
.main-sidebar .sidebar::-webkit-scrollbar-track { background: transparent; }
.main-sidebar .sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
.main-sidebar .sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

/* ── LOGO HEADER ── */
.sms-logo-header {
  flex-shrink: 0;
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sms-logo-link {
  display: block;
  text-decoration: none !important;
}
.sms-logo-link:hover { opacity: 0.95; }

/* White card holding the logo image */
#sidebar-logo-wrap {
  width: 100%;
  padding: 10px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  box-sizing: border-box;
}
.sms-sidebar-logo {
  display: block;
  width: 100%;
  height: auto;
  max-height: 90px;
  object-fit: contain;
  object-position: center;
}

/* Text fallback brand */
.sms-brand-text-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
}
.sms-text-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #e2e8f0;
}
.sms-text-logo > .fas {
  font-size: 28px;
  color: var(--sms-primary);
}
.sms-text-logo-main {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.sms-text-logo-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  line-height: 1.2;
}

/* ── MODE SWITCHER (custom dropdown, blue pill) ── */
/* Sits between logo header and .sidebar — flex child of .main-sidebar */
.sms-mode-wrap {
  padding: 8px 10px 4px;
  flex-shrink: 0;
}
.sms-mode-btn {
  display: flex !important;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.08) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 8px !important;
  padding: 9px 12px !important;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
  color: #e2e8f0 !important;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: none;
}
.sms-mode-btn:hover {
  background: rgba(255,255,255,0.13) !important;
  border-color: rgba(255,255,255,0.25) !important;
  color: #fff !important;
}
.sms-mode-btn .fas { font-size: 13px; color: #94a3b8 !important; flex-shrink: 0; }
.sms-mode-btn .fa-layer-group { color: #60a5fa !important; font-size: 15px !important; }
.sms-mode-btn .sms-mode-globe { color: #38bdf8 !important; font-size: 12px !important; }
.sms-mode-btn > span { flex: 1; color: #e2e8f0 !important; }
.sms-mode-chevron {
  font-size: 10px;
  opacity: 0.75;
  transition: transform 0.2s ease;
}
/* Dropdown — position:fixed so it escapes overflow containers */
.sms-mode-dropdown {
  display: none;
  position: fixed;
  background: #1e2a42;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.55);
  overflow: hidden;
  z-index: 99999;
}
.sms-mode-dropdown.open { display: block; }
.sms-mode-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sms-mode-option:last-child { border-bottom: none; }
.sms-mode-option:hover { background: rgba(255,255,255,0.07); color: #fff; }
.sms-mode-option.active {
  background: rgba(59,125,221,0.2);
  color: #60a5fa;
  font-weight: 600;
}
.sms-mode-option .fas { font-size: 13px; width: 16px; text-align: center; color: #64748b; }
.sms-mode-option.active .fas { color: #60a5fa; }

/* ── NAVIGATION ITEMS & LINKS ── */
.main-sidebar .sidebar > nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: visible;
  margin-top: 0 !important;
}

.nav-sidebar {
  padding: 2px 0 !important;
}

.nav-sidebar > .nav-item {
  margin: 0 !important;
}

.nav-sidebar > .nav-item > .nav-link {
  padding: 11px 16px !important;
  color: #cbd5e1 !important;
  transition: var(--transition);
  font-size: 13.5px;
  font-weight: 500;
  border-left: none;
  border-radius: 0 !important;
}

.nav-sidebar > .nav-item > .nav-link:hover {
  background: rgba(255,255,255,0.06) !important;
  color: #fff !important;
}

.nav-sidebar > .nav-item > .nav-link.active {
  background: transparent !important;
  color: #cbd5e1 !important;
  border-left: none !important;
  border-radius: 0 !important;
  margin-right: 0 !important;
}

.nav-sidebar > .nav-item > .nav-link.active:hover {
  background: rgba(255,255,255,0.06) !important;
}

/* Special styling for Dashboard link */
.nav-sidebar > .nav-item:first-child > .nav-link,
.nav-sidebar > .nav-item:first-of-type > .nav-link {
  background: linear-gradient(135deg, #3b7ddd, #2d68c7) !important;
  color: #fff !important;
  border-radius: 8px !important;
  margin: 4px 8px 8px !important;
  padding: 10px 14px !important;
  font-weight: 600;
}

/* Nav icons */
.nav-icon {
  width: 16px !important;
  text-align: center;
  margin-right: 10px !important;
  font-size: 14px;
  color: currentColor;
}

/* Nav link text */
.nav-link p {
  margin: 0 !important;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  flex: 1;
}

/* Badge positioning in nav links */
.nav-link .badge {
  margin-left: auto !important;
  font-size: 10px !important;
  padding: 2px 8px !important;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Expand/collapse arrow */
.nav-link .right {
  margin-left: 8px !important;
  font-size: 11px;
  opacity: 0.6;
  transition: var(--transition);
  flex-shrink: 0;
}

.nav-link:hover .right {
  opacity: 1;
}

/* Treeview items */
.nav-treeview {
  padding-left: 0 !important;
  background: transparent;
  margin: 0 !important;
  display: none;
}

.nav-item.menu-open > .nav-treeview {
  display: block;
}

.nav-treeview > .nav-item {
  margin: 0 !important;
  border-left: none;
}

.nav-treeview > .nav-item > .nav-link {
  padding: 8px 16px 8px 36px !important;
  font-size: 13px;
  color: #94a3b8 !important;
}

.nav-treeview > .nav-item > .nav-link:hover {
  background: rgba(59,125,221,0.08) !important;
  color: #cbd5e1 !important;
}

.nav-treeview > .nav-item > .nav-link.active {
  background: transparent !important;
  color: #cbd5e1 !important;
  border-left: none;
  border-radius: 0;
  margin-right: 0;
}

/* Section headers */
.nav-header {
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 1.2px !important;
  color: #475569 !important;
  padding: 12px 16px 6px !important;
  text-transform: uppercase;
  margin-top: 4px !important;
  margin-bottom: 2px !important;
}

/* ── RESPONSIVE SIDEBAR ── */

/* Tablet: collapse by default, show on toggle */
@media (max-width: 991.98px) {
  .main-sidebar { width: 250px !important; }
  /* When sidebar is mini on mobile, show full width overlay */
  .sidebar-open .main-sidebar { transform: translateX(0) !important; }
}

/* Mobile */
@media (max-width: 767.98px) {
  #sidebar-logo-wrap { margin: 8px 8px 4px; padding: 6px 8px; }
  .sms-sidebar-logo { max-height: 56px; }
  .sms-brand-text-wrap { height: 54px; padding: 0 10px; }
  .sms-brand-text-wrap .brand-text { font-size: 15px; }
  .main-sidebar .sidebar { padding-bottom: 60px; }
}

/* Mini sidebar (collapsed) */
.sidebar-mini.sidebar-collapse .sms-brand-link { overflow: hidden; }
.sidebar-mini.sidebar-collapse #sidebar-logo-wrap {
  width: calc(100% - 10px);
  margin: 6px 5px 4px;
  padding: 5px;
}
.sidebar-mini.sidebar-collapse .sms-sidebar-logo {
  max-height: 36px;
}
.sidebar-mini.sidebar-collapse .sms-brand-text-wrap { display: none !important; }
.sidebar-mini.sidebar-collapse #sidebar-logo-wrap[style*="display:none"],
.sidebar-mini.sidebar-collapse #sidebar-logo-wrap[style*="display: none"] { display: flex !important; }
/* When collapsed and no logo, show initials */
.sidebar-mini.sidebar-collapse .sms-brand-link .brand-text { display: none; }

/* ── TOPBAR ── */
.main-header { box-shadow: 0 2px 10px rgba(0,0,0,.08) !important; }
.main-header .navbar-search-block { background: #fff; }

/* ── KPI CARDS ── */
.kpi-card {
  border-radius: var(--card-radius);
  border: none;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
  position: relative;
}
.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.kpi-card .card-body { padding: 20px 24px; }
.kpi-card .kpi-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1px;
}
.kpi-card .kpi-label { font-size: 13px; font-weight: 500; opacity: 0.85; }
.kpi-card .kpi-icon {
  font-size: 48px;
  opacity: 0.15;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}
.kpi-card .kpi-trend {
  font-size: 12px;
  margin-top: 6px;
  font-weight: 500;
}
.kpi-card .kpi-trend .up { color: rgba(255,255,255,0.9); }
.kpi-card .kpi-trend .down { color: rgba(255,100,100,0.9); }

/* KPI Color Variants */
.kpi-blue { background: linear-gradient(135deg, #3b7ddd, #2d68c7); color: #fff; }
.kpi-green { background: linear-gradient(135deg, #28a745, #1e7e34); color: #fff; }
.kpi-red { background: linear-gradient(135deg, #dc3545, #c82333); color: #fff; }
.kpi-orange { background: linear-gradient(135deg, #fd7e14, #e8680a); color: #fff; }
.kpi-purple { background: linear-gradient(135deg, #6f42c1, #5a32a3); color: #fff; }
.kpi-teal { background: linear-gradient(135deg, #20c997, #17a589); color: #fff; }
.kpi-yellow { background: linear-gradient(135deg, #ffc107, #d39e00); color: #fff; }
.kpi-dark { background: linear-gradient(135deg, #343a40, #23272b); color: #fff; }

/* ── CARDS ── */
.card {
  border-radius: var(--card-radius) !important;
  border: none !important;
  box-shadow: var(--shadow-sm) !important;
}
.card-header {
  background: #fff !important;
  border-bottom: 1px solid #f0f3f8 !important;
  font-weight: 600;
  font-size: 14px;
  padding: 16px 20px !important;
  border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
}
.card-header .card-title { font-weight: 700; font-size: 15px; margin: 0; }
.card-body { padding: 20px !important; }

/* ── TABLES ── */
.table thead th {
  background: #f8fafc;
  border-top: none;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  padding: 10px 14px;
  white-space: nowrap;
}
.table tbody tr:hover { background: #f8fbff; }
.table td { vertical-align: middle !important; padding: 10px 14px !important; font-size: 13.5px; }
.table-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e2e8f0;
}
.avatar-initials {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  font-size: 12px; font-weight: 700; color: #fff;
}
.dataTables_wrapper .dataTables_filter input { border-radius: 6px; border: 1px solid #e2e8f0; }
.dataTables_wrapper .dataTables_length select { border-radius: 6px; border: 1px solid #e2e8f0; }

/* ── BUTTONS ── */
.btn { border-radius: 8px !important; font-weight: 500; font-size: 13px; }
.btn-sm { padding: 5px 12px !important; font-size: 12px; }
.btn-xs { padding: 2px 8px !important; font-size: 11px; border-radius: 6px !important; }
.btn-action { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px !important; }

/* ── BADGES ── */
.badge {
  font-size: 10px !important;
  font-weight: 700 !important;
  padding: 2px 8px !important;
  border-radius: 4px !important;
  letter-spacing: 0.3px !important;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  height: 20px;
}

.badge-pill { border-radius: 20px !important; }

/* Badge color variants */
.badge-primary { background: #3b7ddd !important; color: #fff !important; }
.badge-success { background: #28a745 !important; color: #fff !important; }
.badge-danger { background: #dc3545 !important; color: #fff !important; }
.badge-warning { background: #ffc107 !important; color: #212529 !important; }
.badge-info { background: #17a2b8 !important; color: #fff !important; }
.badge-secondary { background: #6c757d !important; color: #fff !important; }
.badge-light { background: #f0fff4 !important; color: #22543d !important; }

/* ── LIVE BADGE ── */
.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f0fff4; color: #22543d;
  border: 1px solid #c6f6d5;
  border-radius: 20px; padding: 4px 12px;
  font-size: 12px; font-weight: 600;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #48bb78;
  animation: pulse-live 1.5s infinite;
}
@keyframes pulse-live {
  0%, 100% { box-shadow: 0 0 0 0 rgba(72,187,120,0.6); }
  50% { box-shadow: 0 0 0 5px rgba(72,187,120,0); }
}

/* ── MODALS ── */
.modal-content { border-radius: 12px !important; border: none !important; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.modal-header { border-radius: 12px 12px 0 0 !important; padding: 16px 20px; }
.modal-footer { border-top: 1px solid #f0f3f8; padding: 12px 20px; }

/* ── FORMS ── */
.form-control {
  border-radius: 8px !important;
  border: 1px solid #e2e8f0;
  font-size: 14px;
  transition: var(--transition);
}
.form-control:focus { border-color: var(--sms-primary); box-shadow: 0 0 0 3px rgba(59,125,221,0.15); }
.form-group label { font-weight: 600; font-size: 13px; color: #374151; margin-bottom: 6px; }
.form-group label .required { color: var(--sms-danger); }
.input-group-text { border-radius: 8px 0 0 8px !important; background: #f8fafc; border-color: #e2e8f0; }
.select2-container--bootstrap4 .select2-selection--single { height: 38px !important; }

/* ── MULTI-STEP FORM ── */
.step-wizard {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 32px;
}
.step-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: #94a3b8;
}
.step-item .step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: #e2e8f0; color: #64748b;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  transition: var(--transition);
}
.step-item.active .step-num { background: var(--sms-primary); color: #fff; }
.step-item.completed .step-num { background: var(--sms-success); color: #fff; }
.step-item.active { color: var(--sms-primary); }
.step-item.completed { color: var(--sms-success); }
.step-connector {
  flex: 1; height: 2px; background: #e2e8f0; margin: 0 8px;
  max-width: 80px;
}
.step-connector.done { background: var(--sms-success); }
.step-panel { display: none; }
.step-panel.active { display: block; }

/* ── ATTENDANCE SCANNER ── */
.scanner-container {
  background: #0f172a; border-radius: 16px;
  overflow: hidden; position: relative;
}
.scanner-frame {
  position: relative; width: 100%; padding-bottom: 75%;
}
.scanner-frame #qr-reader { position: absolute; inset: 0; }
.scanner-overlay {
  position: absolute; inset: 0;
  pointer-events: none;
}
.scanner-corner {
  position: absolute; width: 40px; height: 40px;
  border-color: var(--sms-success); border-style: solid;
}
.scanner-corner.tl { top: 20%; left: 20%; border-width: 3px 0 0 3px; }
.scanner-corner.tr { top: 20%; right: 20%; border-width: 3px 3px 0 0; }
.scanner-corner.bl { bottom: 20%; left: 20%; border-width: 0 0 3px 3px; }
.scanner-corner.br { bottom: 20%; right: 20%; border-width: 0 3px 3px 0; }
.scanner-line {
  position: absolute; left: 20%; right: 20%;
  height: 2px; background: var(--sms-success);
  box-shadow: 0 0 10px var(--sms-success);
  animation: scan-line 2s linear infinite;
}
@keyframes scan-line {
  0% { top: 20%; }
  100% { top: 80%; }
}

.scan-result-card {
  border-radius: 12px; overflow: hidden;
  animation: slideInUp 0.3s ease;
}
@keyframes slideInUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── ENTRY/EXIT LOG FEED ── */
.live-feed { max-height: 420px; overflow-y: auto; }
.live-feed-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid #f1f5f9;
  transition: var(--transition);
  animation: feedIn 0.4s ease;
}
@keyframes feedIn {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.live-feed-item:hover { background: #f8fbff; }
.feed-entry { border-left: 3px solid var(--sms-success); }
.feed-exit { border-left: 3px solid var(--sms-danger); }
.feed-absent { border-left: 3px solid var(--sms-warning); }
.feed-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.feed-info { flex: 1; }
.feed-info strong { font-size: 13.5px; display: block; }
.feed-info small { color: #64748b; font-size: 12px; }
.feed-time { font-size: 11px; color: #94a3b8; white-space: nowrap; }
.feed-badge { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 20px; }

/* ── ID CARD DESIGNER ── */
.card-designer-workspace {
  background: #f1f5f9;
  padding: 32px;
  border-radius: 12px;
  min-height: 500px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 32px;
}
.card-canvas-wrapper {
  position: relative;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  border-radius: 12px;
  overflow: hidden;
  cursor: crosshair;
}
.card-field {
  position: absolute;
  cursor: move;
  user-select: none;
  border: 2px dashed transparent;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 12px;
}
.card-field:hover { border-color: rgba(59,125,221,0.6); background: rgba(59,125,221,0.05); }
.card-field.selected { border-color: var(--sms-primary); background: rgba(59,125,221,0.1); }
.field-handle { cursor: move; }
.field-palette { display: flex; flex-direction: column; gap: 8px; }
.field-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 8px;
  background: #fff; border: 1px solid #e2e8f0;
  font-size: 13px; font-weight: 500; cursor: grab;
  transition: var(--transition);
}
.field-pill:hover { border-color: var(--sms-primary); color: var(--sms-primary); box-shadow: var(--shadow-sm); }
.field-pill:active { cursor: grabbing; }

/* ── OCCUPANCY GAUGE ── */
.occupancy-bar {
  height: 8px; border-radius: 4px;
  background: #e2e8f0; overflow: hidden;
}
.occupancy-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }

/* ── REPORTS PAGE ── */
.report-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px; padding: 20px;
  cursor: pointer; transition: var(--transition);
  background: #fff;
}
.report-card:hover {
  border-color: var(--sms-primary);
  box-shadow: 0 4px 12px rgba(59,125,221,0.15);
  transform: translateY(-2px);
}
.report-card .report-icon {
  width: 50px; height: 50px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 12px;
}

/* ── CHART CONTAINERS ── */
.chart-container { position: relative; }
.chart-container canvas { max-height: 280px; }

/* ── SEARCH RESULTS ── */
.search-results-dropdown {
  position: absolute; top: 100%; left: 0; right: 0;
  background: #fff; border-radius: 8px; z-index: 9999;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  border: 1px solid #e2e8f0;
  max-height: 340px; overflow-y: auto;
}
.search-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; text-decoration: none; color: #1e293b;
  border-bottom: 1px solid #f1f5f9; transition: var(--transition);
}
.search-result-item:hover { background: #f8fbff; color: var(--sms-primary); }
.search-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }

/* ── PAGE PRELOADER ── */
#page-preloader {
  position: fixed; inset: 0; background: #fff;
  z-index: 99999; display: flex;
  flex-direction: column; align-items: center; justify-content: center;
}
.preloader-inner { text-align: center; }

/* ── LOADING OVERLAY ── */
#loading-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 99998;
  align-items: center; justify-content: center;
}
#loading-overlay.active {
  display: flex !important;
}
#loading-overlay.d-none {
  display: none !important;
}
.loading-spinner { background: #fff; border-radius: 12px; padding: 32px 48px; text-align: center; }

/* ── PROFILE TABS ── */
.profile-header {
  background: linear-gradient(135deg, #1a2035, #2d3858);
  border-radius: 12px 12px 0 0; padding: 32px;
}
.profile-photo {
  width: 90px; height: 90px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.2);
  object-fit: cover;
}
.profile-initials {
  width: 90px; height: 90px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 700; color: #fff;
}
.nav-tabs .nav-link { font-size: 13.5px; font-weight: 600; color: #64748b; border: none; padding: 10px 16px; }
.nav-tabs .nav-link.active { color: var(--sms-primary); border-bottom: 3px solid var(--sms-primary); background: transparent; }
.nav-tabs { border-bottom: 2px solid #e2e8f0; }

/* Profile Info & Card Sections */
.profile-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.profile-info-item {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13.5px;
  align-items: flex-start;
}
.profile-info-item:last-child {
  border-bottom: none;
}
.profile-info-label {
  width: 200px;
  font-weight: 600;
  color: #475569;
  flex-shrink: 0;
}
.profile-info-value {
  color: #1e293b;
  flex: 1;
}

/* Profile Completeness */
.profile-completeness .progress {
  height: 10px;
  border-radius: 5px;
  background-color: #e2e8f0;
}
.profile-completeness .progress-bar {
  background-color: var(--sms-success);
}
.profile-completeness .progress-text {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

/* Activity Timeline */
.activity-timeline {
  position: relative;
  padding-left: 25px;
  list-style: none;
  margin-top: 20px;
}
.activity-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 5px;
  bottom: 5px;
  width: 2px;
  background: #e2e8f0;
}
.timeline-item {
  position: relative;
  margin-bottom: 24px;
}
.timeline-item:last-child {
  margin-bottom: 0;
}
.timeline-icon {
  position: absolute;
  left: -25px;
  top: 0;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}
.timeline-item-success .timeline-icon { border-color: var(--sms-success); color: var(--sms-success); background: #f0fff4; }
.timeline-item-info .timeline-icon { border-color: var(--sms-info); color: var(--sms-info); background: #e8f7f9; }
.timeline-item-warning .timeline-icon { border-color: var(--sms-warning); color: var(--sms-warning); background: #fffaf0; }
.timeline-item-danger .timeline-icon { border-color: var(--sms-danger); color: var(--sms-danger); background: #fdf2f2; }
.timeline-body {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
}
.timeline-body p { margin-bottom: 4px; color: #374151; }
.timeline-body p strong { color: #1e293b; }
.timeline-time {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 6px;
  display: block;
}

/* ── QR CODE DISPLAY ── */
.qr-wrapper {
  background: #fff; border-radius: 12px;
  padding: 16px; display: inline-block;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.qr-wrapper img { width: 160px; height: 160px; display: block; }

/* ── TIMETABLE / CALENDAR ── */
.fc { font-family: 'Inter', sans-serif; }
.fc-toolbar-title { font-size: 18px !important; font-weight: 700 !important; }
.fc-button { border-radius: 8px !important; font-size: 13px !important; font-weight: 600 !important; }
.fc-event { border-radius: 6px !important; border: none !important; font-size: 12px !important; padding: 2px 6px !important; }

/* ── STATS ROW IN MODALS ── */
.stat-box {
  text-align: center; padding: 16px;
  background: #f8fafc; border-radius: 8px;
  border: 1px solid #e2e8f0;
}
.stat-box .stat-value { font-size: 24px; font-weight: 700; color: var(--sms-primary); }
.stat-box .stat-label { font-size: 12px; color: #64748b; margin-top: 2px; }

/* ── RESPONSIVE FIXES ── */
@media (max-width: 768px) {
  .kpi-card .kpi-value { font-size: 24px; }
  .content-header .page-title { font-size: 18px; }
  .card-designer-workspace { flex-direction: column; padding: 16px; }
  .step-wizard { flex-wrap: wrap; gap: 8px; }
}

/* ── PRINT STYLES ── */
@media print {
  .main-sidebar, .main-header, .main-footer, .control-sidebar,
  .btn, .dataTables_length, .dataTables_filter, .dataTables_paginate,
  .no-print { display: none !important; }
  .content-wrapper { margin: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ── UTILITIES ── */
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.rounded-lg { border-radius: 12px !important; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.cursor-pointer { cursor: pointer; }
.opacity-50 { opacity: 0.5; }
.border-dashed { border-style: dashed !important; }
.bg-gradient-primary { background: linear-gradient(135deg, #3b7ddd, #2d68c7) !important; }
.bg-gradient-success { background: linear-gradient(135deg, #28a745, #1e7e34) !important; }
.bg-gradient-danger { background: linear-gradient(135deg, #dc3545, #c82333) !important; }
.bg-gradient-info { background: linear-gradient(135deg, #17a2b8, #117a8b) !important; }
