/* ======================================================================
   MEDETICK UK — STYLE.CSS (consolidated)
   Single stylesheet for every page: login, dashboard, appointment,
   patient-list, add-appointment, add-patient, calendar.
   add-patient.html has no page-specific styles of its own — it uses
   only the base/shared theme layer below.
   ====================================================================== */



/* ======================================================================
   BASE / SHARED THEME — variables, reset, layout, sidebar, header,
   cards, tables, badges, modals, notifications, SweetAlert2 overrides.
   Used by every page.
   ====================================================================== */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --teal: #0ea5e9;
  --teal-light: #f0f9ff;
  --navy: #0f172a;
  --navy-2: #1e293b;
  --navy-3: #334155;
  --sidebar-bg: #0f172a;
  --sidebar-active: rgba(37,99,235,.15);
  --sidebar-hover: rgba(255,255,255,.06);
  --sidebar-text: rgba(255,255,255,.65);
  --sidebar-icon: rgba(255,255,255,.45);
  --header-bg: #ffffff;
  --body-bg: #f1f5f9;
  --card-bg: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #0ea5e9;
  --purple: #8b5cf6;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.12);
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --header-height: 64px;
  --transition: .22s cubic-bezier(.4,0,.2,1);
}

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

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--body-bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===================== SIDEBAR ===================== */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--transition);
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: var(--header-height);
  border-bottom: 1px solid rgba(255,255,255,.06);
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
  transition: padding var(--transition);
}
.sidebar-brand .brand-icon {
  width: 38px; height: 38px; min-width: 38px;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 17px;
  box-shadow: 0 4px 12px rgba(14,165,233,.35);
}
.sidebar-brand .brand-text h4 {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.2px;
}
.sidebar-brand .brand-text span {
  color: rgba(255,255,255,.45);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.sidebar.collapsed .sidebar-brand {
  padding: 0;
  justify-content: center;
}
.sidebar.collapsed .brand-text { display: none; }

/* Sidebar scroll area */
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
}
.sidebar-scroll::-webkit-scrollbar { width: 3px; }

/* Nav items */
.nav-section {
  padding: 0 12px;
  margin-bottom: 4px;
  transition: padding var(--transition);
}
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.3);
  padding: 14px 10px 6px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition);
}
.sidebar.collapsed .nav-section {
  padding: 0 8px;
}
.sidebar.collapsed .nav-section-label { display: none; }

.nav-item { margin-bottom: 1px; }
.nav-link-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 10px;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition), padding var(--transition);
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.sidebar.collapsed .nav-link-item {
  padding: 10px 0;
  justify-content: center;
}
.nav-link-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.nav-link-item.active {
  background: var(--sidebar-active);
  color: #fff;
}
.nav-link-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}
.nav-link-item .nav-icon {
  width: 34px; height: 34px; min-width: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-size: 15px;
  color: var(--sidebar-icon);
  transition: all var(--transition);
  background: rgba(255,255,255,.04);
}
.nav-link-item:hover .nav-icon,
.nav-link-item.active .nav-icon {
  color: var(--primary);
  background: rgba(37,99,235,.15);
}
.nav-link-item .nav-label { flex: 1; }
.nav-link-item .nav-arrow {
  font-size: 11px;
  color: rgba(255,255,255,.3);
  transition: transform var(--transition);
}
.nav-link-item.open .nav-arrow { transform: rotate(90deg); }
.nav-badge {
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 99px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-arrow,
.sidebar.collapsed .nav-badge { display: none; }

/* Sub-menu */
.sub-menu {
  overflow: hidden;
  max-height: 0;
  transition: max-height .35s ease;
}
.sub-menu.open { max-height: 300px; }
.sub-menu .nav-link-item {
  padding-left: 54px;
  font-size: 13px;
  font-weight: 400;
}
.sidebar.collapsed .sub-menu { display: none; }

/* Sidebar footer */
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 12px;
  flex-shrink: 0;
}
.sidebar-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.06);
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  color: rgba(255,255,255,.55);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition), padding var(--transition);
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-toggle-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar.collapsed .sidebar-toggle-btn {
  padding: 10px 0;
  justify-content: center;
}
.sidebar.collapsed .sidebar-toggle-btn span { display: none; }
.sidebar.collapsed .sidebar-toggle-btn i { transform: rotate(180deg); }

/* ===================== HEADER ===================== */
.main-header {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--header-height);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 1030;
  transition: left var(--transition);
  box-shadow: var(--shadow-sm);
}
.main-header.collapsed { left: var(--sidebar-collapsed); }

.breadcrumb-area {
  flex: 1;
}
.page-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}
.page-breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
}
.page-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.page-breadcrumb a:hover { color: var(--primary); }
.page-breadcrumb .sep { font-size: 10px; }

/* Search */
.header-search {
  position: relative;
}
.header-search input {
  width: 240px;
  height: 38px;
  background: var(--body-bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0 12px 0 38px;
  font-size: 13px;
  color: var(--text);
  transition: all .2s;
  font-family: 'Inter', sans-serif;
}
.header-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
  width: 280px;
  background: #fff;
}
.header-search .search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-icon-btn {
  width: 38px; height: 38px;
  background: var(--body-bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .2s;
  position: relative;
  text-decoration: none;
}
.header-icon-btn:hover {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
}
.header-icon-btn .badge-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid #fff;
}

/* User dropdown */
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--body-bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}
.user-menu:hover { background: #fff; border-color: var(--primary); }
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700;
}
.user-info { line-height: 1.3; }
.user-info .user-name { font-size: 13px; font-weight: 600; color: var(--navy); }
.user-info .user-role { font-size: 11px; color: var(--text-muted); }
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 200px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  z-index: 1000;
}
.user-dropdown.show { display: block; }
.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  transition: background .15s;
}
.user-dropdown a:hover { background: var(--body-bg); }
.user-dropdown a i { width: 16px; color: var(--text-muted); }
.user-dropdown .divider { height: 1px; background: var(--border); margin: 4px 0; }
.user-dropdown .danger { color: var(--danger); }
.user-dropdown .danger i { color: var(--danger); }

/* Mobile toggle */
.mobile-toggle {
  display: none;
  width: 38px; height: 38px;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all .2s;
}
.mobile-toggle:hover { background: var(--body-bg); color: var(--navy); }

/* ===================== CONTENT ===================== */
.main-wrapper {
  margin-left: var(--sidebar-width);
  padding-top: var(--header-height);
  min-height: 100vh;
  width: auto;
  transition: margin-left var(--transition);
}
.main-wrapper.collapsed { margin-left: var(--sidebar-collapsed); }

.content-area {
  padding: 24px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}
.content-area .row {
  margin-left: 0;
  margin-right: 0;
  width: 100%;
}
.content-area > .container,
.content-area > .container-fluid {
  width: 100%;
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

/* ===================== CARDS ===================== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-header-custom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
}
.card-header-custom h5 {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-header-custom h5 i { color: var(--primary); }
.card-body-custom { padding: 22px; }

/* KPI Cards */
.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: all .2s;
  cursor: default;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.kpi-icon {
  width: 54px; height: 54px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.kpi-icon.blue { background: #eff6ff; color: var(--primary); }
.kpi-icon.teal { background: #f0f9ff; color: var(--teal); }
.kpi-icon.green { background: #f0fdf4; color: var(--success); }
.kpi-icon.amber { background: #fffbeb; color: var(--warning); }
.kpi-icon.purple { background: #f5f3ff; color: var(--purple); }
.kpi-icon.red { background: #fef2f2; color: var(--danger); }
.kpi-info .kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 4px;
}
.kpi-info .kpi-label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}
.kpi-info .kpi-change {
  font-size: 11.5px;
  font-weight: 600;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.kpi-change.up { color: var(--success); }
.kpi-change.down { color: var(--danger); }

/* ===================== BUTTONS ===================== */
.btn-primary-custom {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 20px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .2s;
  box-shadow: 0 2px 10px rgba(37,99,235,.25);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
}
.btn-primary-custom:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(37,99,235,.35);
  color: #fff;
}
.btn-secondary-custom {
  background: var(--body-bg);
  color: var(--navy);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 9px 20px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .2s;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
}
.btn-secondary-custom:hover { border-color: var(--primary); color: var(--primary); }

.btn-teal-custom {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 20px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .2s;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
}
.btn-teal-custom:hover { transform: translateY(-1px); color: #fff; box-shadow: 0 4px 14px rgba(14,165,233,.35); }

.btn-danger-custom {
  background: #fef2f2;
  color: var(--danger);
  border: 1.5px solid #fecaca;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .2s;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
}
.btn-danger-custom:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-edit-custom {
  background: var(--primary-light);
  color: var(--primary);
  border: 1.5px solid #bfdbfe;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .2s;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
}
.btn-edit-custom:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.btn-book-custom {
  background: linear-gradient(135deg, var(--success), #059669);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all .2s;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
.btn-book-custom:hover { transform: translateY(-1px); color: #fff; box-shadow: 0 3px 12px rgba(16,185,129,.35); }

.btn-view-solid-custom {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all .2s;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
.btn-view-solid-custom:hover { transform: translateY(-1px); color: #fff; box-shadow: 0 3px 12px rgba(37,99,235,.35); }

/* ===================== STATUS BADGES ===================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.status-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-confirmed { background: #f0fdf4; color: #16a34a; }
.badge-vetting { background: #eff6ff; color: #2563eb; }
.badge-pending { background: #fffbeb; color: #d97706; }
.badge-cancelled { background: #fef2f2; color: #dc2626; }
.badge-completed { background: #f5f3ff; color: #7c3aed; }
.badge-report-done { background: #f0fdf4; color: #059669; }
.badge-report-pending { background: #fff7ed; color: #ea580c; }
.badge-scheduled { background: #eff6ff; color: #2563eb; }
.badge-rescheduled { background: #fffbeb; color: #d97706; }
/* Appointment Status workflow (Str::slug() of the exact status label) */
.badge-vetting-required { background: #fffbeb; color: #d97706; }
.badge-vetting-completed { background: #eff6ff; color: #2563eb; }
.badge-booking-confirmed { background: #eef2ff; color: #4f46e5; }
.badge-performed { background: #f5f3ff; color: #7c3aed; }
.badge-reported { background: #f0fdf4; color: #059669; }
.badge-dna { background: #fef2f2; color: #dc2626; }
.badge-report-na { background: #f1f5f9; color: #64748b; }
.badge-nhs { background: #eff6ff; color: #2563eb; }
.badge-private { background: #f0fdf4; color: #16a34a; }
.badge-insurance { background: #fdf2f8; color: #db2777; }
.badge-corporate { background: #f5f3ff; color: #7c3aed; }
.badge-dispatched { background: #f1f5f9; color: #475569; }

/* ===================== INLINE REPORT STATUS (Appointment list) ===================== */
.report-status-inline-select {
  height: 30px;
  min-width: 122px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 0 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  cursor: pointer;
}
.report-status-inline-select:focus { outline: none; border-color: var(--primary); }
.report-status-inline-select:disabled { opacity: .6; cursor: wait; }
.inline-feedback { margin-left: 4px; font-size: 14px; }
.inline-feedback.success { color: #16a34a; }
.inline-feedback.error { color: #dc2626; }

/* ===================== TABLES ===================== */
.table-container {
  overflow-x: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}
div.dataTables_wrapper {
  width: 100%;
}
table.medetick-table {
  width: 100%;
  border-collapse: collapse;
}
table.medetick-table thead tr {
  background: var(--body-bg);
}
table.medetick-table thead th {
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
table.medetick-table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background .15s;
}
table.medetick-table tbody tr:hover { background: #f8fafc; }
/* Appointment list — subtle status-driven row tinting (Yajra setRowClass),
   deliberately limited to Performed/Reported (light green) and Cancelled
   (light red/pink) only — every other status keeps the table's normal
   white/default row background. Kept pale enough that text/badges stay
   fully readable. */
table.medetick-table tbody tr.row-status-success { background: #f0fdf4; }
table.medetick-table tbody tr.row-status-success:hover { background: #dcfce7; }
table.medetick-table tbody tr.row-status-cancelled { background: #fef2f2; }
table.medetick-table tbody tr.row-status-cancelled:hover { background: #fee2e2; }

/* ===================== ACTIONS COLUMN (Appointment list) ===================== */
/* A single Actions dropdown per row — Edit lives inside it as the first
   item, never duplicated as a separate standalone button. The dropdown
   also carries whatever status-specific workflow shortcut applies (Book
   Now / Mark as Performed / Mark as DNA), so the column stays one compact
   control regardless of how many actions are available. */
.btn-actions-dropdown {
  background: var(--primary-light);
  color: var(--primary);
  border: 1.5px solid #bfdbfe;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .2s;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
.btn-actions-dropdown:hover,
.btn-actions-dropdown[aria-expanded="true"] { background: var(--primary); color: #fff; border-color: var(--primary); }
.action-cell .dropdown-menu {
  min-width: 195px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(15,23,42,.14);
}
.action-cell .dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}
.action-cell .dropdown-item i { width: 16px; text-align: center; }
.action-cell .dropdown-item:hover,
.action-cell .dropdown-item:focus { background: var(--body-bg); color: var(--primary); }
.action-cell .dropdown-item.text-success:hover,
.action-cell .dropdown-item.text-success:focus { color: #059669 !important; background: #f0fdf4; }
.action-cell .dropdown-item.text-danger:hover,
.action-cell .dropdown-item.text-danger:focus { color: #dc2626 !important; background: #fef2f2; }
table.medetick-table tbody td {
  padding: 13px 14px;
  font-size: 13.5px;
  color: var(--text);
  vertical-align: middle;
}
table.medetick-table .patient-id-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 13px;
}
table.medetick-table .patient-id-link:hover { text-decoration: underline; }

/* DataTables overrides */
div.dataTables_wrapper .col-sm-12 {
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

div.dataTables_wrapper div.dataTables_length select,
div.dataTables_wrapper div.dataTables_filter input {
  border: 1.5px solid var(--border) !important;
  border-radius: 8px !important;
  padding: 6px 10px !important;
  font-size: 13px !important;
  font-family: 'Inter', sans-serif !important;
  outline: none !important;
}
div.dataTables_wrapper div.dataTables_filter input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1) !important;
}
div.dataTables_wrapper div.dataTables_info { font-size: 13px; color: var(--text-muted); }
div.dataTables_wrapper div.dataTables_paginate .pagination {
  margin: 0 !important;
  display: inline-flex !important;
  gap: 4px !important;
}
div.dataTables_wrapper div.dataTables_paginate .paginate_button {
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
}
div.dataTables_wrapper div.dataTables_paginate .pagination .page-link {
  border-radius: 8px !important;
  border: 1px solid var(--border) !important;
  font-size: 13px !important;
  padding: 6px 12px !important;
  color: var(--text-muted) !important;
  background-color: #fff !important;
  transition: all 0.2s !important;
  box-shadow: none !important;
}
div.dataTables_wrapper div.dataTables_paginate .pagination .page-item.active .page-link {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}
div.dataTables_wrapper div.dataTables_paginate .pagination .page-item:not(.active):hover .page-link {
  background: var(--body-bg) !important;
  color: var(--primary) !important;
  border-color: var(--border) !important;
}
div.dataTables_wrapper div.dataTables_paginate .pagination .page-item.disabled .page-link {
  background: #f8fafc !important;
  color: #94a3b8 !important;
  border-color: var(--border-light) !important;
  cursor: not-allowed !important;
}

/* ===================== FORMS ===================== */
.form-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-section-title i { color: var(--primary); }

.form-label-custom {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-3);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.form-label-custom .req { color: var(--danger); }

.form-control-custom,
.form-select-custom {
  width: 100%;
  height: 42px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-size: 13.5px;
  color: var(--text);
  transition: all .2s;
  font-family: 'Inter', sans-serif;
  appearance: none;
}
.form-control-custom:focus,
.form-select-custom:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
  background: #fff;
}
.form-control-custom.is-invalid,
.form-select-custom.is-invalid {
  border-color: var(--danger) !important;
}
.form-control-custom.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239,68,68,.1) !important;
}
textarea.form-control-custom {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
}
.form-control-readonly {
  background: var(--body-bg) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed;
}
.invalid-feedback-custom {
  display: none;
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}
.is-invalid ~ .invalid-feedback-custom { display: block; }

.select2-container--default .select2-selection--single {
  height: 42px !important;
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  display: flex !important;
  align-items: center !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 42px !important;
  padding-left: 12px !important;
  font-size: 13.5px !important;
  font-family: 'Inter', sans-serif !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 42px !important;
}
.select2-dropdown {
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow) !important;
}
.select2-container--default .select2-results__option--highlighted {
  background: var(--primary) !important;
}
.is-invalid + .select2-container--default .select2-selection--single {
  border-color: var(--danger) !important;
}
.is-invalid + .select2-container--default .select2-selection--single:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* ===================== OVERLAY & MOBILE ===================== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1039;
  backdrop-filter: blur(2px);
}

@media (max-width: 992px) {
  .mobile-toggle { display: flex !important; }
  .header-search { display: none; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition);
    width: var(--sidebar-width) !important;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-wrapper, .main-header { margin-left: 0 !important; left: 0 !important; }
}

@media (max-width: 576px) {
  .content-area { padding: 16px; }
  .user-info { display: none; }
}

/* ===================== MISC ===================== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.filter-bar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.filter-bar .filter-item { flex: 1; min-width: 160px; }
.filter-bar label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  display: block;
  margin-bottom: 5px;
}

.file-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}
.file-preview-item {
  background: var(--body-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 100px;
  text-align: center;
  transition: all .2s;
}
.file-preview-item:hover { border-color: var(--primary); background: var(--primary-light); }
.file-preview-item .file-icon { font-size: 28px; color: var(--primary); }
.file-preview-item .file-name { font-size: 11px; color: var(--text-muted); word-break: break-all; max-width: 90px; }
.file-preview-item .file-actions { display: flex; gap: 6px; }

/* Notification dropdown */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 1000;
}
.notif-dropdown.show { display: block; }
.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}
.notif-header a { font-size: 12px; color: var(--primary); text-decoration: none; font-weight: 500; }
.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-light);
  transition: background .15s;
}
.notif-item:hover { background: var(--body-bg); }
.notif-item.unread { background: #f0f9ff; }
.notif-avatar {
  width: 36px; height: 36px; min-width: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.notif-text .title { font-size: 13px; font-weight: 600; color: var(--navy); }
.notif-text .sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.notif-text .time { font-size: 11px; color: var(--text-light); margin-top: 3px; }
.notif-footer {
  padding: 11px 18px;
  text-align: center;
  border-top: 1px solid var(--border);
}
.notif-footer a {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.notif-footer a:hover { color: var(--primary-dark); }
.notif-list-scroll { max-height: 340px; overflow-y: auto; }

/* ===================== SWEETALERT2 — MEDETICK THEME ===================== */
.swal2-popup {
  border-radius: var(--radius-lg) !important;
  padding: 28px 24px 26px !important;
  font-family: 'Inter', sans-serif !important;
  box-shadow: var(--shadow-lg) !important;
}
.swal2-title {
  font-size: 19px !important;
  font-weight: 800 !important;
  color: var(--navy) !important;
  letter-spacing: -.2px !important;
  padding: 4px 0 0 !important;
}
.swal2-html-container {
  font-size: 13.5px !important;
  color: var(--text-muted) !important;
  line-height: 1.6 !important;
}
.swal2-icon {
  border-width: 3px !important;
  width: 64px !important; height: 64px !important;
  margin: 8px auto 16px !important;
}
.swal2-icon.swal2-success { border-color: rgba(16,185,129,.25) !important; color: var(--success) !important; }
.swal2-icon.swal2-success [class^='swal2-success-line'] { background-color: var(--success) !important; }
.swal2-icon.swal2-success .swal2-success-ring { border-color: rgba(16,185,129,.25) !important; }
.swal2-icon.swal2-error { border-color: var(--danger) !important; color: var(--danger) !important; }
.swal2-icon.swal2-warning { border-color: var(--warning) !important; color: var(--warning) !important; }
.swal2-icon.swal2-info { border-color: var(--info) !important; color: var(--info) !important; }
.swal2-icon.swal2-question { border-color: var(--purple) !important; color: var(--purple) !important; }

.swal2-actions { gap: 10px !important; margin-top: 18px !important; }
.swal2-styled.swal2-confirm {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
  border-radius: 10px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  padding: 11px 24px !important;
  box-shadow: 0 4px 14px rgba(37,99,235,.32) !important;
  transition: all .2s !important;
}
.swal2-styled.swal2-confirm:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37,99,235,.4) !important; }
.swal2-styled.swal2-confirm:focus { box-shadow: 0 0 0 3px rgba(37,99,235,.25) !important; }
.swal2-styled.swal2-deny {
  background: linear-gradient(135deg, var(--danger), #dc2626) !important;
  border-radius: 10px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  padding: 11px 24px !important;
}
.swal2-styled.swal2-cancel {
  background: var(--body-bg) !important;
  color: var(--text-muted) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 10px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  padding: 11px 24px !important;
  box-shadow: none !important;
}
.swal2-styled.swal2-cancel:hover { background: #fff !important; border-color: var(--text-light) !important; }
.swal2-timer-progress-bar { background: var(--primary) !important; }
.swal2-toast {
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-lg) !important;
}
.swal2-toast .swal2-title { font-size: 13.5px !important; }


/* ======================================================================
   PAGE: LOGIN  (medetick-login.html)  — imaging-viewport redesign v1.5
   Left panel is styled as a diagnostic imaging viewport: graticule
   grid, ambient scan sweep, corner ticks and DICOM-style overlay
   metadata carrying the real trust content (CQC / NHS / GDPR / SSL).
   Form side is fully variable-driven, so dark mode needs almost no
   overrides. All form IDs/classes used by main.js are unchanged.
   ====================================================================== */

body.login-body {
  min-height: 100vh;
  display: flex;
  background: var(--body-bg);
  overflow: hidden;
}

/* ===================== LEFT PANEL — VIEWPORT ===================== */
.auth-left {
  width: 52%;
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(37,99,235,.22), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(14,165,233,.16), transparent 55%),
    #0a1524;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px 52px;
  position: relative;
  overflow: hidden;
}

/* Graticule grid — radiology measurement grid, fading at the edges */
.vp-grid {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(to right,  rgba(125,211,252,.055) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(to bottom, rgba(125,211,252,.055) 0 1px, transparent 1px 56px);
  -webkit-mask-image: radial-gradient(120% 120% at 50% 45%, #000 40%, transparent 85%);
          mask-image: radial-gradient(120% 120% at 50% 45%, #000 40%, transparent 85%);
  pointer-events: none;
}

/* Ambient scan sweep — a slow pass down the viewport */
.vp-sweep {
  position: absolute;
  left: 0; right: 0;
  height: 160px;
  top: -160px;
  background: linear-gradient(to bottom,
    transparent,
    rgba(56,189,248,.05) 55%,
    rgba(56,189,248,.16) 98%,
    rgba(125,211,252,.55) 100%);
  animation: vpSweep 9s cubic-bezier(.45,0,.55,1) infinite;
  pointer-events: none;
}
@keyframes vpSweep {
  0%   { transform: translateY(0); opacity: 0; }
  8%   { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translateY(calc(100vh + 160px)); opacity: 0; }
}

/* Corner ticks — DICOM-viewer style brackets */
.vp-tick {
  position: absolute;
  width: 22px; height: 22px;
  border: 1.5px solid rgba(125,211,252,.45);
  pointer-events: none;
}
.vp-tick.tl { top: 18px; left: 18px;   border-right: none; border-bottom: none; }
.vp-tick.tr { top: 18px; right: 18px;  border-left: none;  border-bottom: none; }
.vp-tick.bl { bottom: 18px; left: 18px;  border-right: none; border-top: none; }
.vp-tick.br { bottom: 18px; right: 18px; border-left: none;  border-top: none; }

/* Overlay metadata — quiet caps labels in the free corners */
.vp-meta {
  position: absolute;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: rgba(125,211,252,.55);
  pointer-events: none;
  z-index: 2;
}
.vp-meta.tr { top: 26px; right: 52px; }
.vp-meta.br { bottom: 26px; right: 52px; }

/* Brand logo */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 2;
  position: relative;
}
.brand-logo .logo-icon {
  width: 46px; height: 46px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px;
  box-shadow: 0 4px 18px rgba(14,165,233,.4);
}
.brand-logo .logo-text h2 {
  color: #fff;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.3px;
  margin: 0;
}
.brand-logo .logo-text span {
  color: rgba(148,197,255,.55);
  font-size: 10.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

/* Hero */
.auth-left-hero {
  z-index: 2;
  position: relative;
  max-width: 480px;
}
.hero-kicker {
  display: inline-block;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: #7dd3fc;
  border: 1px solid rgba(125,211,252,.3);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 22px;
}
.auth-left-hero h1 {
  color: #fff;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 46px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -1.2px;
  margin-bottom: 18px;
}
.auth-left-hero h1 span { color: #7dd3fc; }
.auth-left-hero p {
  color: rgba(203,225,255,.6);
  font-size: 15px;
  line-height: 1.75;
  max-width: 400px;
  margin-bottom: 30px;
}

/* Feature points — quiet list, not pills */
.hero-points {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hero-points li {
  display: flex;
  align-items: center;
  gap: 13px;
  color: rgba(226,240,255,.82);
  font-size: 14px;
  font-weight: 500;
}
.hero-points li i {
  width: 32px; height: 32px;
  min-width: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(125,211,252,.28);
  border-radius: 9px;
  color: #7dd3fc;
  font-size: 13px;
  background: rgba(56,189,248,.08);
}

/* Footer */
.auth-left-footer {
  z-index: 2;
  position: relative;
  color: rgba(148,197,255,.35);
  font-size: 12px;
}

/* ===================== RIGHT PANEL — FORM ===================== */
.auth-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  overflow-y: auto;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 42px 40px 36px;
  box-shadow: var(--shadow-lg);
  animation: cardIn .5s cubic-bezier(.22,1,.36,1) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Mobile logo — only on small screens */
.login-logo-mobile {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.logo-icon-sm {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px;
}
.login-logo-mobile span {
  font-size: 16px;
  font-weight: 700;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  color: var(--text);
}

.card-head { margin-bottom: 30px; }
.card-head h2 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 27px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -.5px;
}
.card-head p { color: var(--text-muted); font-size: 14px; margin: 0; }

/* ===================== ERROR ALERT ===================== */
.login-error-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(239,68,68,.08);
  border: 1.5px solid rgba(239,68,68,.3);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  color: var(--danger);
  font-size: 13.5px;
  font-weight: 500;
  animation: shakeX .4s ease;
}
.login-error-alert i { font-size: 16px; flex-shrink: 0; }

@keyframes shakeX {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* ===================== FORM FIELDS ===================== */
/* Standard label+input (avoids the Bootstrap floating-label washout bug) */

.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--navy-3);
  margin-bottom: 8px;
}

.input-wrap { position: relative; }

.field-input {
  width: 100%;
  height: 50px;
  background: var(--body-bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0 48px 0 16px;
  font-size: 14px;
  color: var(--text);
  transition: all .2s;
  font-family: 'Inter', sans-serif;
  outline: none;
}
.field-input::placeholder { color: var(--text-light); }
.field-input:focus {
  border-color: var(--primary);
  background: var(--card-bg);
  box-shadow: 0 0 0 3.5px rgba(37,99,235,.12);
}
.field-input.is-invalid { border-color: var(--danger); }
.field-input.is-invalid:focus { box-shadow: 0 0 0 3.5px rgba(239,68,68,.12); }

/* Checkmark icon inside email input */
.field-check {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--success);
  font-size: 16px;
  display: none;
  pointer-events: none;
}
.field-check.visible { display: block; }

/* Eye toggle button */
.field-eye {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 15px;
  cursor: pointer;
  padding: 4px;
  transition: color .2s;
  display: flex; align-items: center; justify-content: center;
}
.field-eye:hover { color: var(--primary); }

/* Inline error messages */
.field-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 6px;
  display: none;
  align-items: center;
  gap: 5px;
}
.field-error.visible { display: flex; }
.field-error::before {
  content: '\f06a';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 11px;
}

/* Remember / forgot */
.remember-label { font-size: 13px; color: var(--text-muted); }
.forgot-link {
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}
.forgot-link:hover { color: var(--primary-dark); text-decoration: underline; }
.forgot-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===================== SUBMIT BUTTON ===================== */
.btn-login {
  width: 100%;
  height: 52px;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .2px;
  cursor: pointer;
  transition: all .25s;
  box-shadow: 0 4px 18px rgba(37,99,235,.35);
  font-family: 'Inter', sans-serif;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-login:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(14,165,233,.45);
}
.btn-login:active { transform: translateY(0); }
.btn-login:focus-visible { outline: 2.5px solid var(--teal); outline-offset: 3px; }
.btn-login:disabled {
  opacity: .7;
  cursor: not-allowed;
  transform: none;
}

/* Secure badge */
.secure-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 20px;
  flex-wrap: wrap;
}
.secure-badge i { color: var(--success); }

/* ===================== MOTION SAFETY ===================== */
@media (prefers-reduced-motion: reduce) {
  .vp-sweep { animation: none; display: none; }
  .login-card { animation: none; }
  .login-error-alert { animation: none; }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1100px) {
  .auth-left { padding: 40px 36px; }
  .auth-left-hero h1 { font-size: 38px; }
  .vp-meta.tr, .vp-meta.br { right: 36px; }
}
@media (max-width: 768px) {
  .auth-left { display: none; }
  .auth-right { padding: 32px 18px; align-items: flex-start; padding-top: 64px; }
  .login-card { padding: 32px 24px 28px; }
  body.login-body { overflow: auto; }
  .login-logo-mobile { display: flex; }
}


/* ======================================================================
   PAGE: DASHBOARD  (medetick-dashboard.html)
   ====================================================================== */

/* ---- Dashboard extras ---- */
.welcome-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #0ea5e9 100%);
  border-radius: 16px;
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  overflow: hidden;
  position: relative;
}
.welcome-banner::before {
  content:'';
  position:absolute;
  width:300px;height:300px;
  background:rgba(255,255,255,.05);
  border-radius:50%;
  right:-80px;top:-80px;
}
.welcome-banner::after {
  content:'';
  position:absolute;
  width:180px;height:180px;
  background:rgba(14,165,233,.12);
  border-radius:50%;
  right:120px;bottom:-60px;
}
.welcome-text h2 {
  color:#fff;font-size:22px;font-weight:800;margin:0 0 6px;
}
.welcome-text p {
  color:rgba(255,255,255,.65);font-size:13.5px;margin:0;
}
.welcome-actions { display:flex;gap:10px;z-index:2; }
.btn-white {
  background:#fff;color:var(--primary);border:none;
  border-radius:10px;padding:9px 18px;font-size:13px;
  font-weight:600;cursor:pointer;display:inline-flex;
  align-items:center;gap:7px;transition:all .2s;
  font-family:'Inter',sans-serif;text-decoration:none;
}
.btn-white:hover { background:#eff6ff;color:var(--primary-dark); }
.btn-outline-white {
  background:rgba(255,255,255,.12);color:#fff;
  border:1.5px solid rgba(255,255,255,.3);
  border-radius:10px;padding:9px 18px;font-size:13px;
  font-weight:600;cursor:pointer;display:inline-flex;
  align-items:center;gap:7px;transition:all .2s;
  font-family:'Inter',sans-serif;text-decoration:none;
}
.btn-outline-white:hover { background:rgba(255,255,255,.2);color:#fff; }

/* Today's schedule strip */
.schedule-strip {
  background:var(--card-bg);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  overflow:hidden;
  margin-bottom:24px;
}
.schedule-header {
  display:flex;align-items:center;justify-content:space-between;
  padding:16px 20px;border-bottom:1px solid var(--border-light);
}
.schedule-header h6 {
  font-size:14px;font-weight:700;color:var(--navy);margin:0;
  display:flex;align-items:center;gap:8px;
}
.schedule-header h6 i { color:var(--primary); }
.time-slot-row {
  display:flex;align-items:stretch;
  border-bottom:1px solid var(--border-light);
  transition:background .15s;
}
.time-slot-row:last-child { border-bottom:none; }
.time-slot-row:hover { background:#f8fafc; }
.slot-time {
  width:72px;min-width:72px;
  padding:12px 14px;
  font-size:12px;font-weight:600;color:var(--text-muted);
  border-right:1px solid var(--border-light);
  display:flex;align-items:flex-start;
}
.slot-events { flex:1;padding:10px 14px;display:flex;flex-wrap:wrap;gap:6px; }
.appt-chip {
  display:inline-flex;align-items:center;gap:7px;
  background:var(--primary-light);
  border:1px solid #bfdbfe;
  border-left:3px solid var(--primary);
  border-radius:6px;
  padding:6px 10px;
  font-size:12px;
  cursor:pointer;
  transition:all .15s;
  max-width:300px;
}
.appt-chip:hover { background:#dbeafe;border-color:#93c5fd; }
.appt-chip.teal { background:#f0f9ff;border-color:#7dd3fc;border-left-color:var(--teal); }
.appt-chip.green { background:#f0fdf4;border-color:#86efac;border-left-color:var(--success); }
.appt-chip.amber { background:#fffbeb;border-color:#fcd34d;border-left-color:var(--warning); }
.appt-chip.red { background:#fef2f2;border-color:#fca5a5;border-left-color:var(--danger); }
.appt-chip.purple { background:#f5f3ff;border-color:#c4b5fd;border-left-color:var(--purple); }
.chip-name { font-weight:600;color:var(--navy); }
.chip-scan { color:var(--text-muted);font-size:11px; }
.lunch-break {
  background:linear-gradient(90deg,#f1f5f9,#e2e8f0);
  text-align:center;padding:10px;
  font-size:12px;font-weight:600;color:var(--text-muted);
  letter-spacing:.5px;text-transform:uppercase;
  border-bottom:1px solid var(--border-light);
  display:flex;align-items:center;justify-content:center;gap:8px;
}

/* Activity feed */
.activity-item {
  display:flex;gap:12px;padding:12px 0;
  border-bottom:1px solid var(--border-light);
}
.activity-item:last-child { border-bottom:none; }
.activity-dot {
  width:34px;height:34px;min-width:34px;
  border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  font-size:13px;
}
.activity-text .title { font-size:13px;font-weight:600;color:var(--navy); }
.activity-text .sub { font-size:12px;color:var(--text-muted);margin-top:2px; }
.activity-text .time { font-size:11px;color:var(--text-light);margin-top:3px; }

/* Progress bar card */
.progress-custom {
  height:6px;border-radius:99px;background:var(--border);overflow:hidden;margin-top:8px;
}
.progress-fill {
  height:100%;border-radius:99px;
  background:linear-gradient(90deg,var(--primary),var(--teal));
  transition:width .8s ease;
}

/* Quick stats row */
.mini-stat {
  display:flex;align-items:center;justify-content:space-between;
  padding:10px 0;border-bottom:1px solid var(--border-light);
}
.mini-stat:last-child { border-bottom:none; }
.mini-stat .label { font-size:13px;color:var(--text-muted);font-weight:500; }
.mini-stat .value { font-size:14px;font-weight:700;color:var(--navy); }

/* Count-up */
@keyframes fadeUp { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }
.kpi-card { animation:fadeUp .4s ease both; }
.kpi-card:nth-child(1){animation-delay:.05s}
.kpi-card:nth-child(2){animation-delay:.1s}
.kpi-card:nth-child(3){animation-delay:.15s}
.kpi-card:nth-child(4){animation-delay:.2s}
.kpi-card:nth-child(5){animation-delay:.25s}
.kpi-card:nth-child(6){animation-delay:.3s}


/* ======================================================================
   PAGE: APPOINTMENT LIST  (medetick-appointment.html)
   ====================================================================== */

/* Appointment-specific styles */
.appt-drawer {
  position: fixed;
  top: 0; right: -100%;
  width: min(700px, 100vw);
  height: 100vh;
  background: #fff;
  z-index: 1050;
  box-shadow: -8px 0 40px rgba(0,0,0,.15);
  transition: right .35s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
}
.appt-drawer.open { right: 0; }
.appt-drawer-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1049;
  backdrop-filter: blur(2px);
}
.appt-drawer-overlay.show { display: block; }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-header h5 {
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
  margin: 0;
  display: flex; align-items: center; gap: 8px;
}
.drawer-header h5 i { color: var(--primary); }
.drawer-close {
  width: 34px; height: 34px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 15px;
  transition: all .2s;
}
.drawer-close:hover { background: #fef2f2; border-color: #fecaca; color: var(--danger); }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}
.drawer-footer {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

/* Patient info card inside drawer */
.patient-info-strip {
  background: linear-gradient(135deg, #eff6ff, #f0f9ff);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.patient-info-strip .pia {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
  flex-shrink: 0;
}
.patient-info-strip .pid {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 2px;
}
.patient-info-strip .pname {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
}
.patient-info-strip .pmeta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Uploaded files */
.file-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--body-bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  transition: all .2s;
}
.file-list-item:hover { border-color: var(--primary); background: var(--primary-light); }
.file-list-item .finfo {
  display: flex; align-items: center; gap: 10px;
}
.file-list-item .ficon { font-size: 22px; color: var(--primary); }
.file-list-item .fname { font-size: 12.5px; font-weight: 600; color: var(--navy); }
.file-list-item .fsize { font-size: 11px; color: var(--text-muted); }
.file-actions-row { display: flex; gap: 6px; }


/* ======================================================================
   PAGE: PATIENT LIST  (medetick-patient-list.html)
   ====================================================================== */

  .patient-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #eff6ff, #bfdbfe);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: var(--primary);
    flex-shrink: 0;
  }
  .patient-name-cell {
    display: flex; align-items: center; gap: 10px;
  }
  .patient-name-cell .name { font-weight: 600; font-size: 13.5px; color: var(--navy); }


/* ======================================================================
   PAGE: ADD / UPDATE APPOINTMENT  (medetick-add-appointment.html)
   ====================================================================== */

/* ---- Appointment form extras ---- */
.form-section-block {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
}
.form-section-block-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: linear-gradient(90deg, #f8fafc, var(--card-bg));
  border-bottom: 1px solid var(--border-light);
}
.form-section-block-header .section-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.form-section-block-header h6 {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.form-section-block-body { padding: 20px; }

/* Alert banner */
.info-alert {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.info-alert .alert-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 600; color: var(--primary); margin-bottom: 6px;
}
.info-alert p { font-size: 13px; color: var(--navy-3); margin: 0; }
.danger-alert {
  background: #fef2f2; border: 1.5px solid #fecaca;
  border-radius: 8px; padding: 10px 14px; margin-top: 8px;
  font-size: 13px; color: var(--danger); display: flex; align-items: center; gap: 8px;
}

/* Status-conditional sections */
.section-conditional { display: none; }
.section-conditional.visible { display: block; }

/* File upload area */
.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: var(--body-bg);
}
.file-drop-zone:hover,
.file-drop-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.file-drop-zone i { font-size: 34px; color: var(--primary); margin-bottom: 8px; display: block; }
.file-drop-zone p { font-size: 13px; color: var(--text-muted); margin: 0; }
.file-drop-zone strong { color: var(--navy); }

/* Document grid */
.doc-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.doc-card {
  background: var(--body-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  width: 130px;
  overflow: hidden;
  transition: border-color .2s;
}
.doc-card:hover { border-color: var(--primary); }
.doc-card .doc-preview {
  height: 90px;
  display: flex; align-items: center; justify-content: center;
  background: #f8fafc;
}
.doc-card .doc-preview img { width: 100%; height: 100%; object-fit: cover; }
.doc-card .doc-preview i { font-size: 36px; }
.doc-card .doc-info { padding: 8px; }
.doc-card .doc-name { font-size: 11px; font-weight: 600; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-card .doc-size { font-size: 10px; color: var(--text-muted); }
.doc-card .doc-actions { padding: 6px 8px 8px; display: flex; gap: 6px; }

/* Sticky action bar */
.action-bar {
  position: sticky;
  bottom: 0;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  gap: 10px;
  z-index: 100;
  box-shadow: 0 -4px 24px rgba(0,0,0,.06);
}

/* Select2 customisation */
.select2-container { width: 100% !important; }

/* Readonly style */
.field-readonly {
  background: #f8fafc !important;
  color: var(--text-muted) !important;
  cursor: not-allowed !important;
  border-color: var(--border-light) !important;
}

/* Patient strip */
.patient-info-bar {
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
  border: 1.5px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.patient-info-bar .p-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary);
  color: #fff; font-size: 18px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.patient-info-bar .p-id { font-size: 12px; font-weight: 600; color: var(--primary); }
.patient-info-bar .p-name { font-size: 16px; font-weight: 700; color: var(--navy); }
.patient-info-bar .p-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.patient-info-bar .p-badges { display: flex; gap: 6px; margin-top: 6px; }


/* ======================================================================
   PAGE: CALENDAR  (medetick-calendar.html)
   ====================================================================== */

/* ---- Calendar overrides ---- */
.calendar-container {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%;
}
.fc {
  font-family: 'Inter', sans-serif !important;
  width: 100% !important;
}
.fc .fc-toolbar {
  padding: 16px 20px !important;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0 !important;
  background: var(--card-bg);
}
.fc .fc-toolbar-title {
  font-size: 17px !important;
  font-weight: 800 !important;
  color: var(--navy) !important;
  letter-spacing: -.3px;
}
.fc .fc-button {
  background: var(--body-bg) !important;
  border: 1.5px solid var(--border) !important;
  color: var(--navy) !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  font-family: 'Inter', sans-serif !important;
  padding: 6px 14px !important;
  box-shadow: none !important;
  transition: all .2s !important;
}
.fc .fc-button:hover,
.fc .fc-button-active,
.fc .fc-button-primary:not(:disabled).fc-button-active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}
.fc .fc-button .fc-icon { font-size: 14px !important; }
.fc .fc-col-header-cell {
  background: #f8fafc !important;
  padding: 10px 0 !important;
}
.fc .fc-col-header-cell-cushion {
  font-size: 12px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .6px !important;
  color: var(--text-muted) !important;
  text-decoration: none !important;
}
.fc .fc-timegrid-slot {
  height: 32px !important;
  border-color: var(--border-light) !important;
}
.fc .fc-timegrid-slot-label {
  font-size: 11px !important;
  color: var(--text-muted) !important;
  font-weight: 600 !important;
  padding-right: 10px !important;
}
.fc .fc-daygrid-day-number,
.fc .fc-daygrid-day-top { text-decoration: none !important; }
.fc .fc-daygrid-day-number {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--navy) !important;
}
.fc .fc-day-today {
  background: rgba(37, 99, 235, .04) !important;
}
.fc .fc-day-today .fc-daygrid-day-number {
  background: var(--primary) !important;
  color: #fff !important;
  border-radius: 50% !important;
  width: 26px !important; height: 26px !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
}
.fc .fc-scrollgrid { border: none !important; border-top: 1px solid var(--border) !important; }
.fc .fc-scrollgrid td,
.fc .fc-scrollgrid th { border-color: var(--border-light) !important; }
.fc-event {
  border: none !important;
  border-radius: 6px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: filter .15s !important;
  padding: 2px 6px !important;
}
.fc-event:hover { filter: brightness(0.92) !important; }
.fc-event.ev-blue { background: #2563eb !important; color: #fff !important; }
.fc-event.ev-teal { background: #0ea5e9 !important; color: #fff !important; }
.fc-event.ev-green { background: #10b981 !important; color: #fff !important; }
.fc-event.ev-amber { background: #f59e0b !important; color: #fff !important; }
.fc-event.ev-red { background: #ef4444 !important; color: #fff !important; }
.fc-event.ev-purple { background: #8b5cf6 !important; color: #fff !important; }
.fc-event.ev-lunch { background: #94a3b8 !important; color: #fff !important; }
.fc .fc-timegrid-now-indicator-line { border-color: var(--danger) !important; }
.fc .fc-timegrid-now-indicator-arrow { border-top-color: var(--danger) !important; }

/* Sidebar legend */
.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 12.5px;
  color: var(--text);
}
.cal-legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Today's Stats widget */
.stat-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.stat-card-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
}
.stat-card-date {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 9px;
  border-radius: 99px;
}
.stat-total-block {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}
.stat-total-num {
  font-size: 32px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
  letter-spacing: -.5px;
}
.stat-total-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.stat-progress-track {
  height: 7px;
  background: var(--border-light);
  border-radius: 99px;
  overflow: hidden;
  display: flex;
}
.stat-progress-track span {
  height: 100%;
  transition: width .4s ease;
}
.stat-progress-caption {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin: 6px 0 14px;
}
.stat-progress-caption strong { color: var(--navy); font-weight: 700; }
.stat-row-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.stat-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  border-top: 1px solid var(--border-light);
}
.stat-row:first-child { border-top: none; }
.stat-row-dot {
  width: 8px; height: 8px;
  min-width: 8px;
  border-radius: 50%;
}
.stat-row-label {
  flex: 1;
  font-size: 12.5px;
  color: var(--text);
  font-weight: 500;
}
.stat-row-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  min-width: 18px;
  text-align: right;
}

/* Mini calendar in sidebar uses a table */
.mini-cal th {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-muted);
  padding: 4px 2px; text-align: center;
}
.mini-cal td {
  font-size: 12px; font-weight: 500;
  text-align: center; padding: 4px 2px;
  color: var(--navy); cursor: pointer; border-radius: 50%;
}
.mini-cal td:hover { background: var(--primary-light); color: var(--primary); }
.mini-cal td.today { background: var(--primary); color: #fff; border-radius: 50%; }
.mini-cal td.other-month { color: var(--text-light); }

/* Appointment quick-view modal */
.appt-modal-overlay {
  position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:2000;
  display:none;align-items:center;justify-content:center;
  backdrop-filter:blur(3px);
}
.appt-modal-overlay.open { display:flex; }
.appt-modal {
  background:#fff;border-radius:16px;width:460px;max-width:95vw;
  box-shadow:var(--shadow-lg);overflow:hidden;animation:fadeUp .25s ease;
}
.appt-modal-head {
  background:linear-gradient(135deg,var(--primary),var(--teal));
  padding:20px 22px;color:#fff;
  display:flex;align-items:flex-start;justify-content:space-between;
}
.appt-modal-head h5 { font-size:15px;font-weight:700;margin:0 0 4px; }
.appt-modal-head .pid { font-size:12px;opacity:.8; }
.modal-close-btn {
  background:rgba(255,255,255,.2);border:none;border-radius:8px;
  width:30px;height:30px;color:#fff;cursor:pointer;font-size:14px;
  display:flex;align-items:center;justify-content:center;
}
.modal-close-btn:hover { background:rgba(255,255,255,.3); }
.appt-modal-body { padding:20px 22px; }
.info-row {
  display:flex;justify-content:space-between;align-items:center;
  padding:8px 0;border-bottom:1px solid var(--border-light);font-size:13px;
}
.info-row:last-child { border-bottom:none; }
.info-row .lbl { color:var(--text-muted);font-weight:500; }
.info-row .val { color:var(--navy);font-weight:600; }
.appt-modal-foot {
  border-top: 1px solid var(--border);
  padding: 14px 22px;display:flex;gap:10px;
}

/* ======================================================================
   RESPONSIVE DESIGN SYSTEM OVERRIDES (Cascading Overrides)
   ====================================================================== */

@media (max-width: 992px) {
  .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  .content-area {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  .card-header-custom {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .card-header-custom .d-flex {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .breadcrumb-area {
    display: none !important;
  }
  .welcome-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    gap: 16px;
  }
  .welcome-banner::before,
  .welcome-banner::after {
    display: none;
  }
  .welcome-actions {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }
  .welcome-actions .btn-white,
  .welcome-actions .btn-outline-white {
    width: 100%;
    justify-content: center;
  }
  .filter-bar {
    padding: 12px;
    gap: 12px;
    align-items: stretch;
    flex-direction: column;
  }
  .filter-bar .filter-item {
    min-width: 100%;
    width: 100%;
    flex: 1 1 100%;
  }
  .filter-bar > div {
    width: 100%;
    padding-top: 0 !important;
  }
  .filter-bar .btn-primary-custom,
  .filter-bar .btn-secondary-custom {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 576px) {
  .content-area { padding: 16px; }
  .user-info { display: none; }

  .main-header {
    padding: 0 12px;
    gap: 8px;
  }
  .header-actions {
    gap: 4px;
  }
  .user-menu {
    padding: 4px 6px;
    gap: 4px;
  }
  .user-menu i {
    display: none;
  }

  .kpi-card {
    padding: 12px 14px;
    gap: 10px;
  }
  .kpi-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    font-size: 18px;
  }
  .kpi-info .kpi-value {
    font-size: 20px;
  }
  .kpi-info .kpi-label {
    font-size: 11px;
  }

  .card-header-custom {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
  }
  .card-header-custom .d-flex {
    width: 100%;
  }
  .card-header-custom .btn-primary-custom,
  .card-header-custom .btn-secondary-custom {
    width: 100%;
    justify-content: center;
  }
  .card-body-custom {
    padding: 16px;
  }

  .drawer-footer {
    flex-direction: column;
    padding: 12px 16px;
    gap: 8px;
  }
  .drawer-footer button {
    width: 100% !important;
    justify-content: center;
  }
  .patient-info-strip {
    flex-direction: column;
    text-align: center;
    align-items: center;
    padding: 12px;
    gap: 8px;
  }

  div.dataTables_wrapper div.dataTables_length,
  div.dataTables_wrapper div.dataTables_filter {
    text-align: left !important;
    margin-bottom: 10px;
    width: 100%;
  }
  div.dataTables_wrapper div.dataTables_filter input {
    width: 100% !important;
    margin-left: 0 !important;
  }

  /* Pill toggles (Add Staff Form) vertical stacking */
  .pill-toggle-group {
    flex-direction: column;
    width: 100%;
  }
  .pill-toggle-option {
    width: 100%;
    flex: 1 1 auto;
  }

  /* Document lists (Manage Files) stacking layout */
  .doc-mini-row {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
  }
  .doc-mini-info {
    flex: 1 1 200px;
  }
  .doc-mini-actions {
    width: 100%;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
    justify-content: space-between;
  }
}

/* ======================================================================
   PAGE: RADIOGRAPHER  (medetick-radiographer.html)
   ====================================================================== */
.role-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0f9ff, #bae6fd);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--teal);
  flex-shrink: 0;
}
.role-name-cell { display: flex; align-items: center; gap: 10px; }
.role-name-cell .name { font-weight: 600; font-size: 13.5px; color: var(--navy); }
.role-name-cell .sub { font-size: 11.5px; color: var(--text-muted); }

/* ======================================================================
   PAGE: STAFF LIST  (medetick-staff-list.html)
   ====================================================================== */
.staff-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5f3ff, #ddd6fe);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--purple);
  flex-shrink: 0;
}
.staff-name-cell { display: flex; align-items: center; gap: 10px; }
.staff-name-cell .name { font-weight: 600; font-size: 13.5px; color: var(--navy); }
.staff-name-cell .sub { font-size: 11.5px; color: var(--text-muted); }
.staff-id-link { color: var(--primary); font-weight: 600; text-decoration: none; font-size: 13px; }
.staff-id-link:hover { text-decoration: underline; }

/* extra status-badge colour variants (staff type + document status) */
.badge-medical { background: #eff6ff; color: #2563eb; }
.badge-nonmedical { background: #f5f3ff; color: #7c3aed; }
.badge-doc-valid { background: #f0fdf4; color: #16a34a; }
.badge-doc-expiring { background: #fffbeb; color: #d97706; }
.badge-doc-expired { background: #fef2f2; color: #dc2626; }
.badge-doc-none { background: #f1f5f9; color: #64748b; }

/* Documents column mini-summary pill (clickable, opens doc modal) */
.doc-summary-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--body-bg);
  border: 1.5px solid var(--border);
  border-radius: 99px;
  padding: 5px 12px 5px 6px;
  font-size: 12px; font-weight: 600; color: var(--navy);
  cursor: pointer; transition: all .2s;
}
.doc-summary-btn:hover { border-color: var(--primary); color: var(--primary); }
.doc-summary-btn .doc-summary-icon {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 10.5px;
}
.doc-summary-btn.has-expired .doc-summary-icon { background: #fef2f2; color: var(--danger); }
.doc-summary-btn.has-expired { border-color: #fecaca; }
.doc-summary-btn .dot-warn {
  width: 7px; height: 7px; border-radius: 50%; background: var(--danger);
  box-shadow: 0 0 0 2px #fff;
}

/* Document list inside the "View Documents" modal */
.doc-mini-list { display: flex; flex-direction: column; gap: 10px; }
.doc-mini-row {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color .2s;
}
.doc-mini-row.expired { border-color: #fecaca; background: #fef9f9; }
.doc-mini-row .doc-mini-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--body-bg); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.doc-mini-row.expired .doc-mini-icon { background: #fef2f2; color: var(--danger); }
.doc-mini-info { flex: 1; min-width: 0; }
.doc-mini-title { font-size: 13px; font-weight: 600; color: var(--navy); }
.doc-mini-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.doc-mini-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ======================================================================
   PAGE: ADD STAFF  (medetick-add-staff.html)
   ====================================================================== */

/* Segmented pill toggle — used for Gender + Staff Type */
.pill-toggle-group { display: flex; gap: 10px; flex-wrap: wrap; }
.pill-toggle-option {
  flex: 1; min-width: 110px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13.5px; font-weight: 600; color: var(--navy-3);
  cursor: pointer; transition: all .15s; text-align: center;
  background: #fff;
}
.pill-toggle-option input { display: none; }
.pill-toggle-option i { font-size: 13px; color: var(--text-muted); transition: color .15s; }
.pill-toggle-option:hover { border-color: var(--primary); }
.pill-toggle-option.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.pill-toggle-option.active i { color: var(--primary); }
.pill-toggle-group.is-invalid .pill-toggle-option { border-color: var(--danger); }
.pill-toggle-readonly .pill-toggle-option { cursor: not-allowed; opacity: .6; }

/* Appointment create+edit form — the action sidebar (Appointment ID + Save
   button) is much shorter than the multi-card form beside it, which
   otherwise leaves a large empty gap under it as the page scrolls. Sticking
   it under the header keeps it in view alongside the longer form instead. */
.form-sidebar-sticky {
  position: sticky;
  top: calc(var(--header-height) + 16px);
  align-self: flex-start;
}
@media (max-width: 991.98px) {
  .form-sidebar-sticky { position: static; }
}

/* Appointment create/edit — Referral Note info callout */
.info-callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--primary-light);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 16px;
}
.info-callout-icon { color: var(--primary); font-size: 15px; margin-top: 2px; }
.info-callout-title { font-weight: 700; color: var(--primary); font-size: 13.5px; margin-bottom: 4px; }
.info-callout-text { font-size: 13px; color: var(--navy-2); line-height: 1.5; }

/* Appointment create/edit — missing-field reminder banner */
.warning-callout {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 16px;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
}
.warning-callout i { color: var(--danger); }

/* Appointment create/edit — patient summary strip above the form */
.patient-summary-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--card-bg);
  border: 1.5px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.patient-summary-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 700;
  flex-shrink: 0;
}
.patient-summary-meta { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.patient-summary-badges { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }

/* Appointment create/edit — Appointment Summary sidebar list */
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.summary-row:last-child { border-bottom: none; }
.summary-row .summary-label { color: var(--text-muted); }
.summary-row .summary-value { font-weight: 600; color: var(--navy); text-align: right; }

/* Rescheduled-appointment read-only view — a wider two-column variant of
   the same label/value row used in the Appointment Summary sidebar. */
.readonly-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 40px;
}
.readonly-detail-grid .summary-row { align-items: flex-start; }
.readonly-detail-grid .summary-value { text-align: left; }
.readonly-detail-grid .summary-row.full-width { grid-column: 1 / -1; }
@media (max-width: 767.98px) {
  .readonly-detail-grid { grid-template-columns: 1fr; }
}

/* Appointment Summary — Report row View/Download (compact pair, distinct
   from the full-width Quick Actions buttons below). .btn-view-custom has
   no CSS definition anywhere in the app (renders as bare underlined text),
   which is why this pair needs its own style rather than reusing it. */
.summary-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s;
  font-family: 'Inter', sans-serif;
}
.summary-action-btn.view { background: var(--primary-light); color: var(--primary); }
.summary-action-btn.view:hover { background: var(--primary); color: #fff; }
.summary-action-btn.download { background: var(--navy); color: #fff; }
.summary-action-btn.download:hover { background: var(--navy-2); }

/* Appointment create/edit — section card headers with a colored icon box.
   Additive to (doesn't replace) .card-header-custom/h5, which are shared
   by every other module's cards. */
.section-header-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: .4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-icon-box {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.section-icon-box.blue { background: #eff6ff; color: #2563eb; }
.section-icon-box.green { background: #f0fdf4; color: #16a34a; }
.section-icon-box.amber { background: #fffbeb; color: #d97706; }
.section-icon-box.purple { background: #f5f3ff; color: #7c3aed; }

/* Appointment create/edit — file dropzone + uploaded-file grid */
.file-dropzone {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: var(--body-bg);
}
.file-dropzone:hover, .file-dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.file-dropzone-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  font-size: 18px;
}
.file-dropzone-title { font-weight: 700; color: var(--navy); font-size: 14px; margin-bottom: 4px; }
.file-dropzone-hint { font-size: 12px; color: var(--text-muted); }
.file-dropzone input[type="file"] { display: none; }

.file-section-label {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .4px; margin: 18px 0 10px;
  display: flex; align-items: center; gap: 6px;
}
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.file-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
  background: var(--card-bg);
  transition: opacity .15s;
}
.file-card.marked-remove { opacity: .45; }
.file-card-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
  font-size: 16px;
  color: #fff;
}
.file-card-icon.word { background: #2b579a; }
.file-card-icon.pdf { background: #dc2626; }
.file-card-icon.image { background: #0ea5e9; }
.file-card-icon.generic { background: #64748b; }
.file-card-name {
  font-size: 12px; font-weight: 600; color: var(--navy);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-card-size { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.file-card-actions { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.file-card-btn {
  width: 26px; height: 26px;
  border-radius: 6px;
  border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  cursor: pointer;
  text-decoration: none;
}
.file-card-btn.view { background: var(--primary-light); color: var(--primary); }
.file-card-btn.delete { background: #fef2f2; color: #dc2626; }

/* Document repeater rows */
.doc-repeater-row {
  position: relative;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
  background: var(--body-bg);
}
.doc-repeater-row:last-child { margin-bottom: 0; }
.doc-repeater-row .doc-repeater-index {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--text-muted); margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.doc-repeater-remove {
  position: absolute; top: 12px; right: 12px;
  width: 26px; height: 26px; border-radius: 7px;
  background: #fef2f2; color: var(--danger); border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 12px; transition: all .15s;
}
.doc-repeater-remove:hover { background: var(--danger); color: #fff; }
.doc-repeater-row.is-expired {
  border-color: #fecaca;
  background: #fef9f9;
}
.doc-expired-flag {
  display: inline-flex; align-items: center; gap: 5px;
  background: #fef2f2; color: var(--danger);
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 99px;
  margin-left: 8px;
}
.doc-repeater-filename {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px; height: 42px;
  font-size: 13px; color: var(--text-muted);
}
.doc-repeater-filename.has-file { color: var(--navy); font-weight: 500; }
.doc-repeater-filename i { color: var(--primary); }
.add-doc-row-btn {
  width: 100%;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13.5px; font-weight: 600; color: var(--primary);
  cursor: pointer; transition: all .2s;
}
.add-doc-row-btn:hover { background: var(--primary-light); border-color: var(--primary); }

/* Staff ID preview circle (matches patient ID preview pattern) */
.id-preview-circle {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, #f5f3ff, #ddd6fe);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; font-size: 32px; font-weight: 800; color: var(--purple);
}

/* ======================================================================
   PAGE: DOCUMENT & CONTRACTS  (medetick-documents.html)
   ====================================================================== */

/* Grid / Table view toggle */
.view-toggle-group {
  display: flex; gap: 2px;
  background: var(--body-bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}
.view-toggle-btn {
  border: none; background: transparent;
  width: 34px; height: 30px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); cursor: pointer; font-size: 13px;
  transition: all .15s;
}
.view-toggle-btn:hover { color: var(--primary); }
.view-toggle-btn.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-xs); }

/* Repository grid (richer than the compact .doc-card used for attachments) */
.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.repo-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: all .2s;
}
.repo-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.repo-card.is-expired { border-color: #fecaca; background: #fef9f9; }
.repo-card-icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--body-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; margin-bottom: 12px;
}
.repo-card-title { font-size: 13.5px; font-weight: 700; color: var(--navy); line-height: 1.35; margin-bottom: 3px; }
.repo-card-meta { font-size: 11.5px; color: var(--text-muted); margin-bottom: 10px; }
.repo-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-light); }
.repo-card-expiry { font-size: 11px; color: var(--text-muted); }
.repo-card-actions { display: flex; gap: 6px; }
.repo-card-actions button, .repo-card-actions a {
  width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; border: 1.5px solid var(--border); background: #fff;
  color: var(--text-muted); cursor: pointer; transition: all .15s; text-decoration: none;
}
.repo-card-actions button:hover, .repo-card-actions a:hover { border-color: var(--primary); color: var(--primary); }
.repo-card-actions .danger:hover { border-color: var(--danger); color: var(--danger); }

/* File cell inside table view */
.repo-file-cell { display: flex; align-items: center; gap: 10px; }
.repo-file-icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--body-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.repo-file-name { font-weight: 600; font-size: 13px; color: var(--navy); }
.repo-file-size { font-size: 11.5px; color: var(--text-muted); }



/* ======================================================================
   THEME SWITCHER + PAGE LOADER LAYER  (v1.4)
   Appended section — nothing above this line was modified.
   1. Page loader overlay (all pages, theme-aware)
   2. Theme toggle buttons (header icon + floating variant for login)
   3. Dark theme — variable overrides + targeted fixes for the
      hardcoded light surfaces used across components.
   Activated via  html[data-theme="dark"]  (persisted in localStorage,
   bootstrapped by the inline snippet in each page <head> to avoid a
   light-mode flash before main.js loads).
   ====================================================================== */

/* ===================== 1. PAGE LOADER ===================== */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--body-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity .4s ease, visibility .4s ease;
}
.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.loader-logo {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px;
  box-shadow: 0 8px 24px rgba(14,165,233,.35);
  animation: loaderPulse 1.4s ease-in-out infinite;
}
@keyframes loaderPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 24px rgba(14,165,233,.35); }
  50%      { transform: scale(1.06); box-shadow: 0 10px 32px rgba(14,165,233,.5); }
}
.loader-spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: loaderSpin .7s linear infinite;
}
@keyframes loaderSpin { to { transform: rotate(360deg); } }
.loader-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ===================== 2. THEME TOGGLE BUTTONS ===================== */
.theme-toggle-btn i { transition: transform .35s ease; }
.theme-toggle-btn:active i { transform: rotate(140deg); }

/* Floating variant — login page (no header bar there) */
.theme-toggle-float {
  position: fixed;
  top: 18px; right: 18px;
  z-index: 1100;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all .2s;
}
.theme-toggle-float:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: rotate(15deg);
}

/* ===================== 3. DARK THEME ===================== */
html[data-theme="dark"] {
  --primary-light: rgba(37,99,235,.16);
  --teal-light: rgba(14,165,233,.14);
  --navy: #f1f5f9;          /* heading colour token — flipped for dark */
  --navy-2: #e2e8f0;
  --navy-3: #cbd5e1;
  --sidebar-bg: #0a1220;
  --sidebar-active: rgba(37,99,235,.22);
  --sidebar-hover: rgba(255,255,255,.05);
  --header-bg: #131f36;
  --body-bg: #0d1526;
  --card-bg: #131f36;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --border: #263452;
  --border-light: #1b2740;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.3);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 4px 16px rgba(0,0,0,.45);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.6);
  color-scheme: dark;
}

/* ---- Scrollbar ---- */
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #334155; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ---- Header widgets (hardcoded #fff surfaces) ---- */
html[data-theme="dark"] .header-search input { background: var(--body-bg); }
html[data-theme="dark"] .header-search input:focus { background: var(--body-bg); }
html[data-theme="dark"] .header-icon-btn:hover { background: var(--border-light); }
html[data-theme="dark"] .user-menu:hover { background: var(--border-light); }
html[data-theme="dark"] .user-dropdown,
html[data-theme="dark"] .notif-dropdown { background: var(--card-bg); border: 1px solid var(--border); }
html[data-theme="dark"] .notif-avatar { background: rgba(255,255,255,.07) !important; }

/* ---- KPI tint icons ---- */
html[data-theme="dark"] .kpi-icon { background: rgba(255,255,255,.06); }
html[data-theme="dark"] .kpi-icon.blue { background: rgba(37,99,235,.16); }
html[data-theme="dark"] .kpi-icon.teal { background: rgba(14,165,233,.14); }
html[data-theme="dark"] .kpi-icon.purple { background: rgba(139,92,246,.16); }
html[data-theme="dark"] .kpi-icon.red { background: rgba(239,68,68,.14); }
html[data-theme="dark"] .kpi-icon.green { background: rgba(16,185,129,.14); }
html[data-theme="dark"] .kpi-icon.amber,
html[data-theme="dark"] .kpi-icon.orange { background: rgba(245,158,11,.14); }

/* ---- Status badges: keep each variant's text colour, swap the pale
       background for a translucent tint of that same colour ---- */
html[data-theme="dark"] [class*="badge-"]:not(.badge-dot) {
  background: color-mix(in srgb, currentColor 14%, transparent);
}

/* ---- Tables / DataTables ---- */
html[data-theme="dark"] table.medetick-table tbody tr:hover { background: rgba(255,255,255,.03); }
html[data-theme="dark"] table.medetick-table thead th { background: var(--border-light); }
html[data-theme="dark"] table.medetick-table tbody tr.row-status-success { background: rgba(16,185,129,.08); }
html[data-theme="dark"] table.medetick-table tbody tr.row-status-success:hover { background: rgba(16,185,129,.14); }
html[data-theme="dark"] table.medetick-table tbody tr.row-status-cancelled { background: rgba(239,68,68,.08); }
html[data-theme="dark"] table.medetick-table tbody tr.row-status-cancelled:hover { background: rgba(239,68,68,.14); }
html[data-theme="dark"] .report-status-inline-select { background: var(--body-bg); color: var(--text); }
html[data-theme="dark"] .btn-actions-dropdown { background: rgba(37,99,235,.14); color: #93c5fd; border-color: rgba(37,99,235,.35); }
html[data-theme="dark"] .btn-actions-dropdown:hover,
html[data-theme="dark"] .btn-actions-dropdown[aria-expanded="true"] { background: var(--primary); color: #fff; }
html[data-theme="dark"] .action-cell .dropdown-menu { background: var(--card-bg); border-color: var(--border); }
html[data-theme="dark"] .action-cell .dropdown-item { color: var(--text); }
html[data-theme="dark"] .action-cell .dropdown-item:hover { background: var(--border-light); }
html[data-theme="dark"] div.dataTables_wrapper div.dataTables_paginate .pagination .page-item.disabled .page-link {
  background: var(--border-light) !important;
}
html[data-theme="dark"] .dataTables_wrapper .dataTables_length select,
html[data-theme="dark"] .dataTables_wrapper .dataTables_filter input {
  background: var(--body-bg);
  color: var(--text);
  border-color: var(--border);
}

/* ---- Forms ---- */
html[data-theme="dark"] .form-control-custom,
html[data-theme="dark"] .form-select-custom {
  background: var(--body-bg);
}
html[data-theme="dark"] .form-control-custom:focus,
html[data-theme="dark"] .form-select-custom:focus { background: var(--body-bg); }
html[data-theme="dark"] .field-readonly { background: var(--border-light) !important; }
html[data-theme="dark"] .form-check-input { background-color: var(--body-bg); border-color: var(--border); }
html[data-theme="dark"] .form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }

/* ---- Buttons on light surfaces ---- */
html[data-theme="dark"] .btn-white { background: var(--card-bg); color: var(--teal); }
html[data-theme="dark"] .btn-white:hover { background: var(--border-light); color: #fff; }
html[data-theme="dark"] .view-toggle-btn.active { background: var(--border-light); }

/* ---- Misc hardcoded surfaces (chips, modals, alerts, upload areas) ---- */
html[data-theme="dark"] .time-slot-row:hover { background: rgba(255,255,255,.03); }
html[data-theme="dark"] .appt-chip.green { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.35); }
html[data-theme="dark"] .appt-chip.amber { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.35); }
html[data-theme="dark"] .appt-modal { background: var(--card-bg); }
html[data-theme="dark"] .info-alert { background: rgba(37,99,235,.12); }

/* ---- SweetAlert2 ---- */
html[data-theme="dark"] .swal2-popup { background: var(--card-bg) !important; color: var(--text) !important; }
html[data-theme="dark"] .swal2-styled.swal2-cancel:hover { background: var(--border-light) !important; }

/* ---- ApexCharts (dashboard) ---- */
html[data-theme="dark"] .apexcharts-text,
html[data-theme="dark"] .apexcharts-legend-text { fill: var(--text-muted) !important; color: var(--text-muted) !important; }
html[data-theme="dark"] .apexcharts-gridline { stroke: var(--border-light); }
html[data-theme="dark"] .apexcharts-tooltip {
  background: var(--card-bg) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  box-shadow: var(--shadow) !important;
}
html[data-theme="dark"] .apexcharts-tooltip-title {
  background: var(--border-light) !important;
  border-color: var(--border) !important;
}

/* ---- FullCalendar (calendar page) ---- */
html[data-theme="dark"] .fc {
  --fc-border-color: var(--border);
  --fc-page-bg-color: var(--card-bg);
  --fc-neutral-bg-color: var(--border-light);
  --fc-today-bg-color: rgba(37,99,235,.1);
}
html[data-theme="dark"] .fc .fc-col-header-cell { background: var(--border-light) !important; }


  /* ---- DataTables control alignment fix ---- */
        div.dataTables_wrapper div.dataTables_length,
        div.dataTables_wrapper div.dataTables_filter {
            padding: 0 0 14px;
        }

        div.dataTables_wrapper div.dataTables_length label,
        div.dataTables_wrapper div.dataTables_filter label {
            display: inline-flex !important;
            align-items: center;
            gap: 8px;
            margin: 0;
            font-size: 13px;
            font-weight: 500;
            color: var(--text-muted);
            white-space: nowrap;
            float: none;
        }

        div.dataTables_wrapper div.dataTables_length {
            float: left;
        }

        div.dataTables_wrapper div.dataTables_filter {
            float: right;
            text-align: right;
        }

        div.dataTables_wrapper div.dataTables_length select {
            width: auto !important;
            min-width: 64px;
            padding-right: 26px !important;
            background: var(--card-bg);
            color: var(--text);
            cursor: pointer;
        }

        div.dataTables_wrapper div.dataTables_filter input {
            width: 220px !important;
            margin-left: 0 !important;
            background: var(--card-bg);
            color: var(--text);
        }

        /* bottom row: info left, pagination right, vertically centred */
        div.dataTables_wrapper div.dataTables_info {
            float: left;
            padding-top: 16px !important;
        }

        div.dataTables_wrapper div.dataTables_paginate {
            float: right;
            padding-top: 12px !important;
            text-align: right;
        }

        div.dataTables_wrapper::after {
            content: "";
            display: table;
            clear: both;
        }

        /* mobile: stack cleanly */
        @media (max-width: 576px) {

            div.dataTables_wrapper div.dataTables_length,
            div.dataTables_wrapper div.dataTables_filter,
            div.dataTables_wrapper div.dataTables_info,
            div.dataTables_wrapper div.dataTables_paginate {
                float: none;
                text-align: left;
            }

            div.dataTables_wrapper div.dataTables_filter input {
                width: 100% !important;
            }

            div.dataTables_wrapper div.dataTables_paginate .pagination {
                flex-wrap: wrap;
            }
        }

/* ---- Login page ----
   The v1.5 login redesign is fully variable-driven (and the viewport
   panel is dark by design in both themes), so no per-theme overrides
   are needed here. */
