/* ── CabiNet Design System ─────────────────────────────────── */
/* Extracted from cabinet.jsx mockup                            */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Serif+Display&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Custom Properties ──────────────────────────────────── */
:root {
  --bg: #F6F5F0;
  --card: #FFFFFF;
  --primary: #1B6B5A;
  --primary-light: #E8F3F0;
  --primary-dark: #134D41;
  --accent: #D4A853;
  --accent-light: #FFF8E7;
  --danger: #C4453C;
  --danger-light: #FDE8E6;
  --warning: #E8913A;
  --warning-light: #FFF3E0;
  --success: #2D8F6F;
  --success-light: #E6F7F0;
  --text: #1A1A1A;
  --text-secondary: #6B7280;
  --text-light: #9CA3AF;
  --border: #E8E6E1;
  --border-light: #F0EFE9;
  --shadow: rgba(27, 107, 90, 0.08);
  --radius-card: 12px;
  --radius-btn: 8px;
  --radius-badge: 20px;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ── Reset / Normalize ──────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  line-height: 1.5;
}

body {
  background: var(--bg);
  font-family: var(--font-body);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-dark);
}

button {
  font-family: inherit;
  cursor: pointer;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text);
  line-height: 1.3;
}

/* ── App Layout ─────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* ── Desktop Sidebar (>=1024px) ─────────────────────────────── */
.sidebar {
  width: 240px;
  background: var(--card);
  border-right: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  flex-shrink: 0;
  z-index: 40;
}

.sidebar .logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar .logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(27, 107, 90, 0.2);
  flex-shrink: 0;
}

.sidebar .logo-icon span {
  font-size: 18px;
  color: #fff;
  font-family: var(--font-display);
}

.sidebar .logo-text {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text);
}

.sidebar .logo-role {
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar .nav {
  padding: 12px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sidebar .nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  transition: all 0.15s ease;
  margin-bottom: 2px;
  text-align: left;
  text-decoration: none;
}

.sidebar .nav-item:hover {
  background: var(--border-light);
}

.sidebar .nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.sidebar .nav-item.active svg {
  stroke: var(--primary);
}

.sidebar .nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.sidebar .user-info {
  padding: 16px;
  border-top: 1px solid var(--border-light);
}

.sidebar .user-info .user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.sidebar .user-info .user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar .user-info .user-name {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.sidebar .user-info .user-email {
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--text-light);
}

/* ── Main Content Area ──────────────────────────────────────── */
.main-content {
  margin-left: 240px;
  flex: 1;
  overflow: auto;
  padding: 24px;
}

.main-content-inner {
  max-width: 900px;
  margin: 0 auto;
}

/* ── Mobile Header ──────────────────────────────────────────── */
.mobile-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}

.mobile-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-header .logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mobile-header .logo-icon span {
  font-size: 14px;
  color: #fff;
  font-family: var(--font-display);
}

.mobile-header .page-title {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text);
}

.mobile-header .header-actions {
  display: flex;
  gap: 8px;
}

.mobile-header .header-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Mobile Bottom Nav ──────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1.5px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 8px));
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.bottom-nav .nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 12px;
  position: relative;
  min-width: 44px;
  min-height: 44px;
}

.bottom-nav .nav-tab .icon-wrap {
  position: relative;
}

.bottom-nav .nav-tab svg {
  color: var(--text-light);
}

.bottom-nav .nav-tab.active svg {
  color: var(--primary);
  stroke: var(--primary);
}

.bottom-nav .nav-tab .tab-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav .nav-tab .tab-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 400;
  color: var(--text-light);
}

.bottom-nav .nav-tab.active .tab-label {
  font-weight: 600;
  color: var(--primary);
}

.bottom-nav .nav-tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
}

/* ── Page Header ────────────────────────────────────────────── */
.page-header {
  margin-bottom: 14px;
}

.page-header h2 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0;
  color: var(--text);
}

.page-header p {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-secondary);
  margin: 4px 0 0;
}

.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-header-row h2 {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0;
  color: var(--text);
}

/* ── Stat Cards ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.stats-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-card {
  background: var(--card);
  border-radius: 10px;
  padding: 12px;
  border: 1.5px solid var(--border);
  transition: all 0.2s ease;
}

.stat-card:hover {
  border-color: var(--border);
  box-shadow: 0 4px 16px var(--shadow);
}

.stat-card .stat-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.stat-card .stat-icon.primary { background: rgba(27, 107, 90, 0.08); }
.stat-card .stat-icon.warning { background: rgba(232, 145, 58, 0.08); }
.stat-card .stat-icon.success { background: rgba(45, 143, 111, 0.08); }
.stat-card .stat-icon.accent { background: rgba(212, 168, 83, 0.08); }
.stat-card .stat-icon.danger { background: rgba(196, 69, 60, 0.08); }

.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text);
  line-height: 1.2;
}

.stat-card .stat-label {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Calendar Widget ────────────────────────────────────────── */
.calendar-card {
  background: var(--card);
  border-radius: 14px;
  padding: 18px;
  border: 1.5px solid var(--border);
  align-self: start;
}

.calendar-widget {
  user-select: none;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.calendar-header .month-label {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--text);
}

.calendar-header .cal-nav-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.calendar-header .cal-nav-btn:hover {
  background: var(--border-light);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}

.calendar-grid .day-header {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-light);
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calendar-day {
  position: relative;
  padding: 6px 0;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  transition: all 0.15s ease;
  background: transparent;
  color: var(--text);
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-day:hover {
  background: var(--border-light);
}

.calendar-day.today {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.calendar-day.selected {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.calendar-day.other-month {
  color: var(--text-light);
  opacity: 0.5;
}

.calendar-day.disabled,
.calendar-day.disabled:hover {
  color: var(--text-light);
  opacity: 0.35;
  cursor: default;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 3px,
    var(--border-light) 3px,
    var(--border-light) 4px
  );
  pointer-events: none;
}

.calendar-dot {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
}

.calendar-dot span {
  width: 4px;
  height: 4px;
  border-radius: 2px;
}

.calendar-dot .dot-approved,
.calendar-dot .dot-available { background: var(--primary); }
.calendar-dot .dot-pending { background: var(--warning); }
.calendar-dot .dot-booked { background: var(--accent); }

.selected .calendar-dot span {
  opacity: 0.7;
}

/* ── Full Calendar ──────────────────────────────────────────── */
.full-calendar {
  background: var(--card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  padding: 20px;
}

.fc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 12px;
}

.fc-month-label {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text);
}

.fc-header .cal-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.fc-header .cal-nav-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.fc-legend {
  display: flex;
  gap: 16px;
  padding: 0 0 10px;
  flex-wrap: wrap;
}

.fc-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.fc-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.fc-day-header {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 0 6px;
}

.fc-day {
  position: relative;
  min-height: 68px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 5px 6px;
  cursor: pointer;
  background: var(--card);
  text-align: left;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: var(--font-body);
}

.fc-day:hover:not(.fc-disabled):not(.fc-empty) {
  border-color: var(--primary);
  box-shadow: 0 2px 8px var(--shadow);
}

.fc-day.fc-empty {
  border: none;
  cursor: default;
  min-height: 0;
  background: transparent;
}

.fc-day-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.fc-day.fc-today {
  background: var(--primary-light);
  border-color: var(--primary);
}

.fc-day.fc-today .fc-day-num {
  background: var(--primary);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.fc-day.fc-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.fc-day.fc-selected .fc-day-num {
  color: var(--primary);
  font-weight: 700;
}

.fc-day.fc-disabled,
.fc-day.fc-disabled:hover {
  opacity: 0.35;
  cursor: default;
  background: var(--bg);
  border-style: dashed;
  border-color: var(--border-light);
  pointer-events: none;
  box-shadow: none;
}

.fc-day.fc-disabled .fc-day-num {
  color: var(--text-light);
}

.fc-day-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: auto;
}

.fc-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 13px;
  white-space: nowrap;
}

.fc-badge::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fc-badge-available {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.fc-badge-available::before { background: var(--primary); }

.fc-badge-pending {
  background: var(--warning-light);
  color: #9a5b12;
}
.fc-badge-pending::before { background: var(--warning); }

.fc-badge-approved {
  background: var(--success-light);
  color: var(--primary-dark);
}
.fc-badge-approved::before { background: var(--success); }

/* Mobile dots (hidden on desktop, visible on small screens) */
.fc-day-dots {
  display: none;
  gap: 2px;
  margin-top: auto;
  justify-content: center;
}

.fc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.fc-dot-available { background: var(--primary); }
.fc-dot-pending { background: var(--warning); }
.fc-dot-approved { background: var(--success); }

/* Day detail modal — compact timeline table */
.day-detail-content {
  max-height: 65vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 !important;
}

.tl-table {
  width: 100%;
  border-collapse: collapse;
}

.tl-row {
  border-bottom: 1px solid var(--border-light);
  transition: background 0.1s ease;
}

.tl-row:last-child { border-bottom: none; }
.tl-row:hover { background: var(--bg); }

.tl-row td {
  padding: 7px 12px;
  vertical-align: middle;
  font-size: 13px;
}

.tl-time {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  width: 95px;
}

.tl-who {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tl-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.tl-note {
  width: 100%;
  font-size: 11px;
  color: var(--text-secondary);
}

.tl-act {
  white-space: nowrap;
  text-align: right;
  width: 1%;
}

.tl-act .btn { margin-left: 4px; }

.tl-past { opacity: 0.45; }
.tl-occupied { opacity: 0.6; }
.tl-my { background: var(--primary-light); }
.tl-my:hover { background: rgba(27, 107, 90, 0.1); }

.tl-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
}

.btn-xs {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  min-height: auto;
}

/* ── Responsive Full Calendar ──────────────────────────────── */
@media (max-width: 1024px) {
  .full-calendar { padding: 14px; }
  .fc-day { min-height: 58px; padding: 4px 5px; }
  .fc-badge { font-size: 8px; padding: 1px 4px; }
  .fc-badge::before { width: 3px; height: 3px; }
}

@media (max-width: 767px) {
  .full-calendar { padding: 10px; }
  .fc-header { padding-bottom: 8px; }
  .fc-month-label { font-size: 15px; }
  .fc-grid { gap: 2px; }
  .fc-day {
    min-height: 40px;
    padding: 4px 2px;
    align-items: center;
    border-radius: 6px;
  }
  .fc-day-num { font-size: 11px; margin-bottom: 2px; }
  .fc-day.fc-today .fc-day-num {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }
  .fc-day-badges { display: none; }
  .fc-day-dots { display: flex; }
  .fc-legend { gap: 10px; padding-bottom: 6px; }
  .fc-legend-item { font-size: 10px; gap: 3px; }
  .fc-dot { width: 5px; height: 5px; }
  .tl-row td { padding: 6px 8px; }
  .tl-time { font-size: 11px; width: 80px; }
}

/* ── Day View / Slot List ───────────────────────────────────── */
.day-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.day-view-header .day-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.day-view-header h3 {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.day-view-header .slot-count {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-light);
}

.slots-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slot-item {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  border: 1.5px solid var(--border);
  transition: all 0.2s ease;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
}

.slot-item:hover {
  box-shadow: 0 4px 16px var(--shadow);
}

.slot-available {
  border-color: rgba(27, 107, 90, 0.2);
}

.slot-pending {
  border-color: rgba(232, 145, 58, 0.27);
}

.slot-booked {
  border-color: var(--border);
}

.slot-blocked {
  border-color: rgba(196, 69, 60, 0.2);
  background: var(--border-light);
}

.slot-past {
  opacity: 0.5;
}

.slot-past .slot-time,
.slot-past .slot-info {
  color: var(--text-light);
}

.slot-time {
  min-width: 64px;
  text-align: center;
  padding: 8px 0;
  border-right: 2px solid var(--border);
  margin-right: 2px;
  flex-shrink: 0;
}

.slot-available .slot-time {
  border-right-color: var(--primary);
}

.slot-pending .slot-time {
  border-right-color: var(--warning);
}

.slot-booked .slot-time {
  border-right-color: var(--border);
}

.slot-blocked .slot-time {
  border-right-color: var(--danger);
}

.slot-time .time-value {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.slot-time .time-sep {
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--text-light);
  margin: 4px 0;
}

.slot-time .slot-duration {
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.slot-info {
  flex: 1;
  min-width: 0;
}

.slot-info .slot-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.slot-info .doctor-name {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.slot-info .slot-note {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-light);
  margin: 0;
}

.slot-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  background: var(--card);
  border-radius: 14px;
  padding: 40px;
  border: 1.5px dashed var(--border);
  text-align: center;
}

.empty-state svg {
  margin: 0 auto 12px;
  color: var(--text-light);
}

.empty-state p {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-light);
  margin: 0 0 12px;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.2s ease;
  font-size: 13px;
  padding: 8px 16px;
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn svg {
  flex-shrink: 0;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border-light);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #B33A32;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--border-light);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: #C49A48;
}

.btn-sm {
  font-size: 12px;
  padding: 6px 12px;
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

.btn-lg {
  font-size: 15px;
  padding: 12px 24px;
}

.btn-icon {
  padding: 8px;
}

.btn-icon.btn-sm {
  padding: 6px;
}

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

/* ── Badges / Status Pills ──────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-badge);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-body);
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.badge-available {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(27, 107, 90, 0.2);
}

.badge-pending {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid rgba(232, 145, 58, 0.2);
}

.badge-approved {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(45, 143, 111, 0.2);
}

.badge-rejected {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(196, 69, 60, 0.2);
}

.badge-cancelled {
  background: var(--border-light);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.badge-blocked {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(196, 69, 60, 0.2);
}

.badge-active {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(45, 143, 111, 0.2);
}

.badge-inactive {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(196, 69, 60, 0.2);
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.form-label-sm {
  font-size: 11px;
  margin-bottom: 4px;
}

.form-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: var(--bg);
  box-sizing: border-box;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 107, 90, 0.1);
}

.form-input::placeholder {
  color: var(--text-light);
}

.form-input-sm {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  background: var(--card);
}

.form-select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease;
  background: var(--bg);
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 107, 90, 0.1);
}

.form-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.form-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.form-toggle .toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 12px;
  transition: background 0.2s ease;
}

.form-toggle .toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-toggle input:checked + .toggle-slider {
  background: var(--primary);
}

.form-toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

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

.form-inline {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-panel {
  background: var(--primary-light);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1.5px solid rgba(27, 107, 90, 0.13);
}

.form-panel h3 {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--primary);
}

.form-panel-accent {
  background: var(--accent-light);
  border: 1.5px solid rgba(212, 168, 83, 0.13);
}

.form-panel-accent h3 {
  color: var(--accent);
}

.time-input {
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease;
}

.time-input:focus {
  border-color: var(--primary);
}

/* ── Tables ──────────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1.5px solid var(--border);
}

.table td {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.table tr:hover td {
  background: var(--border-light);
}

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

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Filter bar (bookings page) */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-bar .form-group {
  margin-bottom: 0;
  min-width: 120px;
  flex: 1;
}

.filter-bar .form-input,
.filter-bar .form-select {
  padding: 7px 10px;
  font-size: 12px;
}

.loading-text {
  color: var(--text-light);
  font-size: 13px;
  padding: 16px;
  text-align: center;
}

/* ── Cards (generic) ────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: 12px;
  border: 1.5px solid var(--border);
  overflow: hidden;
}

.card-body {
  padding: 14px 16px;
}

.card-sm {
  border-radius: 12px;
}

.card-sm .card-body {
  padding: 12px 16px;
}

/* ── User / Doctor List Item ────────────────────────────────── */
.user-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-list-item {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.2s ease;
}

.user-list-item:hover {
  box-shadow: 0 4px 16px var(--shadow);
}

.user-list-item.inactive {
  opacity: 0.6;
}

.user-avatar-lg {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.user-avatar-lg.inactive {
  background: var(--border);
}

.user-list-item .user-details {
  flex: 1;
  min-width: 0;
}

.user-list-item .user-details .user-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-list-item .user-details .user-name {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.user-list-item .user-details .user-email {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.user-list-item .user-details .user-specialty {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

.user-list-item .user-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Working Hours ──────────────────────────────────────────── */
/* ── Working Hours Compact ──────────────────────────────────── */
.wh-card {
  background: var(--card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  overflow: hidden;
}

.wh-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.1s ease;
}

.wh-row:last-of-type {
  border-bottom: none;
}

.wh-row:hover {
  background: var(--bg);
}

.wh-row:not(.active) {
  opacity: 0.45;
}

.wh-row:not(.active) .wh-times { display: none; }
.wh-row:not(.active) .wh-off { display: inline; }
.wh-row.active .wh-off { display: none; }

/* Custom toggle switch */
.wh-toggle {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
  display: inline-block;
}

.wh-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.wh-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 10px;
  transition: background 0.2s ease;
}

.wh-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.wh-toggle input:checked + .wh-slider {
  background: var(--primary);
}

.wh-toggle input:checked + .wh-slider::before {
  transform: translateX(16px);
}

/* Day name — short on mobile, full on desktop */
.wh-day {
  font-weight: 700;
  font-size: 13px;
  color: var(--primary);
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.wh-day-full {
  display: none;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  min-width: 90px;
}

.wh-row:not(.active) .wh-day { color: var(--text-light); }
.wh-row:not(.active) .wh-day-full { color: var(--text-light); }

/* Time selects */
.wh-times {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.wh-time-sel {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  width: 72px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239CA3AF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  padding-right: 20px;
}

.wh-time-sel:focus {
  border-color: var(--primary);
  outline: none;
}

.wh-sep {
  color: var(--text-light);
  font-size: 12px;
  flex-shrink: 0;
}

.wh-off {
  font-size: 12px;
  color: var(--text-light);
  font-style: italic;
  margin-left: auto;
}

/* Footer row with duration + save */
.wh-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--bg);
  border-top: 1px solid var(--border-light);
}

.wh-duration {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wh-duration .form-label {
  margin: 0;
  font-size: 12px;
  white-space: nowrap;
}

.wh-duration .form-input {
  padding: 5px 8px;
  font-size: 13px;
}

/* Special days list */
.sd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
}

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

.sd-item:hover { background: var(--bg); }

.sd-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}

.sd-date {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.sd-times {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.sd-note {
  font-size: 12px;
  color: var(--text-light);
  width: 100%;
}

/* Desktop: show full day names */
@media (min-width: 640px) {
  .wh-day { display: none; }
  .wh-day-full { display: inline; }
  .wh-row { padding: 12px 20px; gap: 14px; }
  .wh-time-sel { width: 80px; font-size: 13px; padding: 5px 8px; }
  .wh-footer { padding: 14px 20px; }
  .sd-item { padding: 10px 20px; }
}

@media (max-width: 480px) {
  .wh-row { padding: 8px 12px; gap: 8px; }
  .wh-time-sel { width: 64px; font-size: 12px; padding: 3px 4px; padding-right: 16px; }
  .wh-footer { flex-direction: column; align-items: stretch; gap: 10px; }
  .sd-item { padding: 8px 12px; }
  .sd-info { gap: 6px; }
}

/* Slot Duration Settings */
.slot-settings {
  background: var(--accent-light);
  border-radius: 14px;
  padding: 18px;
  margin-top: 20px;
  border: 1.5px solid rgba(212, 168, 83, 0.13);
}

.slot-settings h3 {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--accent);
}

.slot-settings .options-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.slot-settings .option-label {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-secondary);
}

.slot-settings .option-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--card);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.slot-settings .option-btn.active {
  border-color: var(--accent);
  background: rgba(212, 168, 83, 0.08);
  font-weight: 600;
  color: var(--accent);
}

/* ── Modals ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--card);
  border-radius: 14px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

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

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 16px;
  margin: 0;
  color: var(--text);
}

.modal-header .modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

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

.modal-body {
  padding: 16px 18px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border-light);
}

.modal.modal-lg {
  max-width: 520px;
}

/* Secondary modals opened on top of day detail modal */
#adminBookModal,
#blockSlotModal,
#rejectModal,
#bookModal {
  z-index: 210;
}

/* ── Notification Panel ─────────────────────────────────────── */
.notif-bell {
  position: relative;
  cursor: pointer;
}

.notif-bell .notif-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--card);
}

.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--card);
  border-radius: 14px;
  border: 1.5px solid var(--border);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
  z-index: 150;
  display: none;
}

.notif-panel.open {
  display: block;
}

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

.notif-panel-header h4 {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.notif-panel-header .mark-all-read {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  background: none;
  border: none;
  font-weight: 500;
}

.notif-panel-header .mark-all-read:hover {
  text-decoration: underline;
}

.notif-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.15s ease;
}

.notif-item:hover {
  background: var(--border-light);
}

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

.notif-item.unread {
  background: var(--primary-light);
}

.notif-item.unread:hover {
  background: #d9ece7;
}

.notif-item .notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-item .notif-icon.type-new_booking {
  background: rgba(232, 145, 58, 0.12);
}

.notif-item .notif-icon.type-reminder {
  background: rgba(212, 168, 83, 0.12);
}

.notif-item .notif-icon.type-approved {
  background: rgba(45, 143, 111, 0.12);
}

.notif-item .notif-icon.type-rejected {
  background: rgba(196, 69, 60, 0.12);
}

.notif-item .notif-content {
  flex: 1;
  min-width: 0;
}

.notif-item .notif-text {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text);
  margin: 0;
  font-weight: 400;
  line-height: 1.4;
}

.notif-item.unread .notif-text {
  font-weight: 600;
}

.notif-item .notif-time {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

.notif-item .notif-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 6px;
}

/* Full-page notification list */
.notif-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notif-list .notif-list-item {
  background: var(--card);
  border-radius: 12px;
  padding: 16px;
  border: 1.5px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: all 0.2s ease;
}

.notif-list .notif-list-item.unread {
  background: var(--primary-light);
  border-color: rgba(27, 107, 90, 0.13);
}

/* ── Toast Messages ─────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 20px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  pointer-events: auto;
  animation: toastIn 0.3s ease forwards;
  max-width: 380px;
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

.toast-success {
  background: var(--success);
  color: #fff;
}

.toast-error {
  background: var(--danger);
  color: #fff;
}

.toast-warning {
  background: var(--warning);
  color: #fff;
}

.toast-info {
  background: var(--primary);
  color: #fff;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

/* ── Login Page ─────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: linear-gradient(160deg, var(--bg) 0%, #E8E6DC 50%, var(--primary-light) 100%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(27, 107, 90, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(27, 107, 90, 0.2);
}

.login-logo .logo-icon span {
  font-size: 24px;
  color: #fff;
  font-family: var(--font-display);
}

.login-logo h1 {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text);
  margin: 0;
}

.login-logo p {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-secondary);
  margin: 6px 0 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-footer {
  text-align: center;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-light);
  margin-top: 20px;
}

/* ── Booking List Items ─────────────────────────────────────── */
.booking-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.booking-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.booking-item .booking-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.booking-item .booking-time {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
}

.booking-item .booking-status {
  margin-left: auto;
}

/* ── Loading Spinner ────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 12px;
}

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

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

/* ── Content Grid (calendar + slots) ────────────────────────── */
.content-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
}

/* ── Utility Classes ────────────────────────────────────────── */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-light { color: var(--text-light); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.font-display { font-family: var(--font-display); }
.font-mono { font-family: var(--font-mono); }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }

.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 16px; }
.p-4 { padding: 24px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }

.w-full { width: 100%; }

.hidden { display: none !important; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Doctor Pages: Additional Components ───────────────────── */

/* Card header */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
}

.card-header h3 {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

/* Dashboard grid (calendar + day view side by side) */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

/* Text muted helper */
.text-muted {
  color: var(--text-secondary);
  font-size: 13px;
}

/* Filter tabs */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
  overflow-x: auto;
}

.tab {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.tab:hover {
  color: var(--text);
  background: var(--card);
}

.tab.active {
  background: var(--card);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 3px var(--shadow);
}

/* Form row (two columns) */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Form actions (button row) */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  margin-top: 4px;
}

/* Timeline list (day view) */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border-light);
  background: var(--card);
  transition: all 0.15s ease;
}

.timeline-item:hover {
  border-color: var(--border);
}

.timeline-item.past {
  opacity: 0.5;
}

.timeline-item.occupied {
  background: var(--bg);
}

.timeline-item.my-booking {
  border-color: rgba(27, 107, 90, 0.2);
  background: var(--primary-light);
}

.timeline-time {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  min-width: 100px;
}

.timeline-info {
  flex: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.timeline-note {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 4px 0 0;
  width: 100%;
}

/* Booking list items (schedule page) */
.booking-item-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.booking-item-date {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.booking-item-date strong {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text);
}

.booking-item-date .text-muted {
  font-family: var(--font-mono);
  font-size: 12px;
}

.booking-item-notes {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-secondary);
}

.booking-item-notes small {
  font-weight: 600;
}

.booking-item-actions {
  margin-top: 2px;
  display: flex;
  gap: 6px;
}

.booking-item.past {
  opacity: 0.6;
}

/* Collapsible card header */
.card-header.collapsible {
  cursor: pointer;
  user-select: none;
}

.card-header.collapsible:hover {
  background: var(--border-light);
}

.card-header .collapse-icon {
  transition: transform 0.2s ease;
  color: var(--text-secondary);
}

.card-header.open .collapse-icon {
  transform: rotate(180deg);
}

/* Pagination */
.pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
}

/* Radio labels (language toggle) */
.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  border-radius: 8px;
  transition: background 0.15s ease;
}

.radio-label:hover {
  background: var(--border-light);
}

.radio-label input[type="radio"] {
  accent-color: var(--primary);
}

.lang-toggle {
  display: flex;
  gap: 12px;
}

/* Sidebar language toggle */
.sidebar-lang {
  display: flex;
  gap: 4px;
  padding: 0 20px 12px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 12px;
}

.sidebar-lang .lang-btn {
  flex: 1;
  text-align: center;
  padding: 6px 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  text-decoration: none;
  transition: all 0.15s ease;
  background: transparent;
}

.sidebar-lang .lang-btn:hover {
  background: var(--border-light);
  color: var(--text);
}

.sidebar-lang .lang-btn.active {
  background: var(--primary);
  color: #fff;
}

/* Stat icon overrides for inline styles */
.stat-info {
  display: flex;
  flex-direction: column;
}

/* ── Responsive ─────────────────────────────────────────────── */

/* Tablet: 768px - 1023px */
@media (max-width: 1023px) and (min-width: 768px) {
  .sidebar {
    width: 240px;
    transform: translateX(-240px);
    transition: transform 0.3s ease;
    z-index: 60;
  }

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

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 55;
    display: none;
  }

  .sidebar-overlay.active {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 24px;
    padding-bottom: 80px;
  }

  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card);
    cursor: pointer;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .page-header h2,
  .page-header-row h2 {
    font-size: 20px;
  }
}

/* Mobile: <768px */
@media (max-width: 767px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    transform: translateX(-280px);
    transition: transform 0.3s ease;
    z-index: 60;
  }

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

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 55;
    display: none;
  }

  .sidebar-overlay.active {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 14px;
    padding-bottom: 72px;
  }

  .hidden-mobile {
    display: none !important;
  }

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

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

  .content-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .page-header h2,
  .page-header-row h2 {
    font-size: 20px;
  }

  .slot-item {
    padding: 14px;
  }

  .slot-time {
    min-width: 56px;
  }

  .user-list-item {
    padding: 14px;
  }

  .hours-item {
    padding: 12px 14px;
  }

  .login-page {
    padding: 24px;
  }

  .login-card {
    max-width: 100%;
    padding: 28px;
  }

  .calendar-day {
    padding: 8px 0;
  }

  /* Touch targets */
  .btn {
    min-height: 40px;
  }
  .btn-xs {
    min-height: auto;
  }

  .bottom-nav .nav-tab {
    min-width: 44px;
    min-height: 44px;
  }

  .notif-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 70vh;
    border-radius: 14px 14px 0 0;
  }

  .modal {
    max-width: 100%;
    border-radius: 14px 14px 0 0;
    max-height: 90vh;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
}

/* Desktop: >=1024px */
@media (min-width: 1024px) {
  .mobile-header {
    display: none;
  }

  .bottom-nav {
    display: none;
  }

  .hidden-desktop {
    display: none !important;
  }

  .hamburger {
    display: none;
  }
}

/* ── Scrollbar Styling ──────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

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

/* ── Utility Classes ────────────────────────────────────────── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.w-full { width: 100%; }

/* Alert boxes */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}
.alert-error {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(196, 69, 60, 0.2);
}
.alert-success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(45, 143, 111, 0.2);
}
.alert-warning {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid rgba(232, 145, 58, 0.2);
}

/* ── Print ──────────────────────────────────────────────────── */
@media print {
  .sidebar,
  .mobile-header,
  .bottom-nav,
  .toast-container,
  .modal-overlay {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
    padding: 0;
  }

  body {
    background: #fff;
  }
}
