/* =========================================================
   ADMINISTRATION.CSS – Modern Admin Portal Theme
   Theme: Premium glassmorphism with teal accent (#0D9488)
   ========================================================= */

/* ================== WELCOME HERO ================== */
.welcome-hero {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 24px;
  min-height: 110px;
}

.welcome-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0D9488 0%, #00685f 60%, #004d46 100%);
  opacity: 0.92;
}

.welcome-hero-bg::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  pointer-events: none;
}

.welcome-hero-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  gap: 16px;
}

.welcome-hero-text {
  flex: 1;
}

.welcome-hero-title {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 4px;
  line-height: 1.2;
}

.welcome-hero-sub {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.72);
  font-weight: 500;
  margin: 0;
}

.welcome-hero-avatar {
  flex-shrink: 0;
}

.hero-avatar-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 0 0 6px rgba(255,255,255,0.08);
}

/* ================== PREMIUM STATS GRID (Elevated Cards) ================== */
.stats-elevated {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}


.stat-elevated-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-elevated-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--stat-accent, #0D9488);
  border-radius: 0 4px 4px 0;
  opacity: 0.6;
}

.stat-elevated-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-lg);
}

.stat-elevated-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--stat-accent, #0D9488) 12%, transparent);
  color: var(--stat-accent, #0D9488);
}

.stat-elevated-icon .material-icons-round {
  font-size: 22px;
}

.stat-elevated-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.stat-elevated-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--on-surface-var);
  white-space: normal;
  line-height: 1.3;
  word-break: break-word;
}

.stat-elevated-value {
  font-family: var(--font-head);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--on-surface);
  line-height: 1.1;
  transition: all 0.3s ease;
}

.stat-elevated-trend {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  color: var(--outline);
  margin-top: 2px;
}

.stat-elevated-trend .material-icons-round {
  font-size: 13px;
}

.stat-elevated-trend.up {
  color: #059669;
}

.stat-elevated-trend.down {
  color: #DC2626;
}

/* ================== DASHBOARD SPLIT ACTIONS ================== */
.dashboard-split-actions {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .dashboard-split-actions {
    grid-template-columns: 1fr;
  }
}

.quick-actions-card {
  padding: 20px;
}

.quick-actions-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--on-surface);
  margin-bottom: 16px;
}

.quick-actions-header .material-icons-round {
  font-size: 18px;
  color: var(--primary-light);
}

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

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: var(--surface-low);
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

.quick-action-btn:hover {
  border-color: var(--outline-var);
  background: var(--surface);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.quick-action-btn:active {
  transform: scale(0.96);
}

.qa-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qa-icon .material-icons-round {
  font-size: 20px;
}

.qa-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--on-surface-var);
  text-align: center;
  line-height: 1.2;
}

/* ================== MODERN LIST TOOLBAR ================== */
.list-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.list-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--outline-var);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  flex: 1;
  min-width: 200px;
  max-width: 400px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.list-search:focus-within {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px var(--primary-soft);
  background: #fff;
}

.list-search .material-icons-round {
  font-size: 18px;
  color: var(--outline);
  flex-shrink: 0;
}

.list-search input {
  border: none;
  background: transparent;
  font-size: 0.9rem;
  flex: 1;
  color: var(--on-surface);
  outline: none;
  font-family: var(--font-body);
}

.list-search input::placeholder {
  color: var(--outline);
}

.list-search-clear {
  background: none;
  border: none;
  color: var(--outline);
  cursor: pointer;
  padding: 2px;
  display: flex;
  transition: color 0.15s;
}

.list-search-clear:hover {
  color: var(--accent-red);
}

.list-search-clear .material-icons-round {
  font-size: 16px;
}

.list-toolbar-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .list-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .list-search {
    max-width: 100%;
  }
  .list-toolbar-actions .btn-primary {
    width: 100%;
    justify-content: center;
  }
}

/* ================== LIST GRID (Card Layout) ================== */
.list-grid {
  display: grid;
  gap: 12px;
}

.doctor-card,
.dept-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s ease;
  animation: cardIn 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
}

.doctor-card:hover,
.dept-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.doctor-card:active,
.dept-card:active {
  transform: scale(0.99);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.doctor-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary-light), var(--tertiary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(13,148,136,0.2);
}

.doctor-card-body,
.dept-card-body {
  flex: 1;
  min-width: 0;
}

.doctor-card-name {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--on-surface);
  display: flex;
  align-items: center;
  gap: 8px;
}

.doctor-card-id {
  font-size: 0.72rem;
  color: var(--outline);
  font-weight: 500;
}

.doctor-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 6px;
}

.doctor-card-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--on-surface-var);
}

.doctor-card-meta-item .material-icons-round {
  font-size: 14px;
  color: var(--outline);
}

.doctor-card-actions,
.dept-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.card-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: var(--surface-low);
  color: var(--on-surface-var);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.card-action-btn .material-icons-round {
  font-size: 18px;
}

.card-action-btn:hover {
  background: var(--primary-soft);
  color: var(--primary-light);
  transform: scale(1.05);
}

.card-action-btn.danger:hover {
  background: rgba(239,68,68,0.1);
  color: #EF4444;
}

.dept-card {
  flex-wrap: wrap;
}

.dept-card-body {
  flex: 1;
  min-width: 200px;
}

.dept-card-name {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--on-surface);
}

.dept-card-desc {
  font-size: 0.8rem;
  color: var(--on-surface-var);
  margin-top: 4px;
  line-height: 1.4;
}

.dept-card-id {
  font-size: 0.7rem;
  color: var(--outline);
  margin-top: 2px;
}

.dept-grid .dept-card:last-child {
  margin-bottom: 0;
}

/* ================== TODAY CARDS (Patients / OPD modals) ================== */
.today-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: cardIn 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}

.today-card:active {
  transform: scale(0.99);
}

.today-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.today-card.expanded .today-card-head {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--surface-mid);
}

.today-card-sno {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--outline);
  flex-shrink: 0;
}

.today-card-name {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--on-surface);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-card-id {
  font-size: 0.72rem;
  background: var(--surface-mid);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  color: var(--primary-light);
  font-weight: 600;
  flex-shrink: 0;
}

.today-card-chevron {
  font-size: 20px;
  color: var(--outline);
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.today-card.expanded .today-card-chevron {
  transform: rotate(180deg);
}

.today-card-body {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
}

.today-card.expanded .today-card-body {
  display: grid;
}

.today-detail {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.today-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--outline);
}

.today-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--on-surface);
}

.today-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--on-surface-var);
  font-size: 0.88rem;
}

.today-loading {
  text-align: center;
  padding: 32px 16px;
  color: var(--on-surface-var);
  font-size: 0.88rem;
}

/* ================== SKELETON CARDS ================== */
.list-skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-card {
  height: 72px;
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, rgba(13,148,136,0.04) 25%, rgba(13,148,136,0.1) 50%, rgba(13,148,136,0.04) 75%);
  background-size: 200% 100%;
  animation: glassShimmer 1.8s ease-in-out infinite;
}

@keyframes glassShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ================== EMPTY STATE ================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
}

.empty-state-icon {
  font-size: 48px;
  color: var(--outline-var);
  margin-bottom: 12px;
}

.empty-state-title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 800;
  color: var(--on-surface);
  margin-bottom: 4px;
}

.empty-state-desc {
  font-size: 0.82rem;
  color: var(--on-surface-var);
}

/* ================== LOGIN STATS MODERN ================== */
.login-stats-modern {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.lsm-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

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

.lsm-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: color-mix(in srgb, var(--lsm-accent, #0D9488) 12%, transparent);
  color: var(--lsm-accent, #0D9488);
  flex-shrink: 0;
}

.lsm-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lsm-value {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--on-surface);
  line-height: 1;
}

.lsm-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--on-surface-var);
}

/* ================== LOGIN TIMELINE ================== */
.login-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-timeline-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
  animation: cardIn 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}

.login-timeline-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.lt-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  width: 40px;
}

.lt-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
}

.lt-avatar.admin { background: linear-gradient(135deg, #7C3AED, #8B5CF6); }
.lt-avatar.reception { background: linear-gradient(135deg, #0D9488, #14b8a6); }

.lt-body {
  flex: 1;
  min-width: 0;
}

.lt-user {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--on-surface);
}

.lt-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--on-surface-var);
}

.lt-meta-item {
  display: flex;
  align-items: center;
  gap: 3px;
}

.lt-meta-item .material-icons-round {
  font-size: 12px;
  color: var(--outline);
}

.lt-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.bottom-nav {
  display: none;
}

/* ================== PREMIUM TAB BAR ================== */
.admin-tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  background: var(--surface-low);
  border-radius: var(--radius-lg);
  border: 1px solid var(--outline-var);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.admin-tab-bar::-webkit-scrollbar { display: none; }

.admin-tab {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--on-surface-var);
  cursor: pointer;
  background: transparent;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.admin-tab:hover {
  color: var(--portal-accent);
  background: rgba(13,148,136,0.04);
}

.admin-tab.active {
  background: #fff;
  color: var(--portal-accent);
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.admin-tab .material-icons-round {
  font-size: 17px;
}

.admin-tab-label {
  display: inline;
}

.admin-tab-pane {
  display: none;
}

.admin-tab-pane.active {
  display: block;
  animation: tabFade 0.3s cubic-bezier(0.4,0,0.2,1);
}

@keyframes tabFade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================== STATUS BADGES ================== */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.badge-status.available {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.badge-status.available::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4);
  animation: badgePulse 2s infinite;
}

.badge-status.busy {
  background: rgba(245, 158, 11, 0.12);
  color: #D97706;
}

.badge-status.busy::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #F59E0B;
  border-radius: 50%;
}

.badge-status.off, .badge-status.inactive {
  background: rgba(107, 114, 128, 0.12);
  color: #6B7280;
}

.badge-status.off::before, .badge-status.inactive::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #6B7280;
  border-radius: 50%;
}

.badge-status.expired {
  background: rgba(107, 114, 128, 0.12);
  color: #6B7280;
}

.badge-status.expired::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #6B7280;
  border-radius: 50%;
}

.badge-status.logged_out {
  background: rgba(245, 158, 11, 0.12);
  color: #D97706;
}

.badge-status.logged_out::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #F59E0B;
  border-radius: 50%;
}

@keyframes badgePulse {
  0% { box-shadow: 0 0 0 0px rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0px rgba(16, 185, 129, 0); }
}

.role-badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.role-badge.admin {
  background: rgba(139, 92, 246, 0.12);
  color: #7C3AED;
}

.role-badge.reception {
  background: rgba(13, 148, 136, 0.12);
  color: #0D9488;
}

/* ================== FILTER SELECT ================== */
.filter-select {
  padding: 8px 14px;
  border: 1.5px solid var(--outline-var);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--on-surface);
  font-size: 0.82rem;
  font-family: var(--font-body);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 40px;
}

.filter-select:focus {
  border-color: var(--portal-accent);
  box-shadow: 0 0 0 3px var(--portal-accent-soft);
}

/* ================== FAB (Floating Action Button) ================== */
.fab {
  display: none;
  position: fixed;
  bottom: calc(76px + var(--safe-bottom));
  right: 20px;
  z-index: 250;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0D9488, #00685f);
  color: #fff;
  border: none;
  box-shadow: 0 4px 20px rgba(13,148,136,0.4);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
  -webkit-tap-highlight-color: transparent;
}

.fab .material-icons-round {
  font-size: 24px;
  transition: transform 0.3s ease;
}

.fab.open .material-icons-round {
  transform: rotate(45deg);
}

.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(13,148,136,0.5);
}

.fab:active {
  transform: scale(0.92);
}

.fab-menu {
  display: none;
  position: fixed;
  bottom: calc(136px + var(--safe-bottom));
  right: 20px;
  z-index: 249;
  flex-direction: column;
  gap: 8px;
  animation: fabMenuIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

.fab-menu.visible {
  display: flex;
}

@keyframes fabMenuIn {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.fab-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border: 1px solid var(--outline-var);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--on-surface);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transition: all 0.2s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.fab-menu-item:hover {
  background: #fff;
  border-color: var(--primary-light);
  color: var(--primary-light);
  transform: translateX(-4px);
}

.fab-menu-item .material-icons-round {
  font-size: 18px;
  color: var(--primary-light);
}

/* ================== RESPONSIVE ================== */

@media (max-width: 768px) {
  .admin-tab-bar {
    gap: 4px;
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
  }

  .admin-tab {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    font-size: 0.78rem;
    gap: 4px;
  }

  .admin-tab.active {
    background: var(--primary-light);
    color: #fff;
    box-shadow: 0 2px 8px rgba(13,148,136,0.25);
  }

  .admin-tab .material-icons-round {
    font-size: 16px;
    flex-shrink: 0;
  }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(60px + var(--safe-bottom, 0px));
    padding-bottom: var(--safe-bottom, 0px);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1.5px solid var(--outline-var);
    z-index: 999;
    box-sizing: border-box;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.06);
  }

  .bottom-nav-item {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--on-surface-var);
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 6px 0;
  }

  .bottom-nav-item .material-icons-round {
    font-size: 20px;
    color: var(--on-surface-var);
    transition: transform 0.2s ease, color 0.2s ease;
  }

  .bottom-nav-item:active {
    background: rgba(13, 148, 136, 0.04);
  }

  .bottom-nav-item.active {
    color: var(--primary-light);
  }

  .bottom-nav-item.active .material-icons-round {
    color: var(--primary-light);
    transform: translateY(-1px) scale(1.05);
  }
  .page-body { padding-bottom: calc(72px + var(--safe-bottom)); }
  .topbar .topbar-search { display: none; }
  .mobile-search-toggle { display: flex; }

  .fab { display: flex; }

  .stats-elevated {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  /* In 2-col grid, last odd card spans both columns */
  .stat-elevated-card:last-child:nth-child(odd) {
    grid-column: span 2 !important;
    flex-direction: row;
    align-items: center;
  }

  /* When spanning full width, restore horizontal layout */
  .stat-elevated-card:last-child:nth-child(odd) .stat-elevated-body {
    flex-direction: column;
  }

  .stat-elevated-card {
    padding: 12px 14px;
    gap: 10px;
    align-items: flex-start;
  }

  .stat-elevated-value {
    font-size: 1.5rem;
  }

  .stat-elevated-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .stat-elevated-icon .material-icons-round {
    font-size: 18px;
  }

  .stat-elevated-label {
    font-size: 0.62rem;
    letter-spacing: 0.03em;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
  }

  .stat-elevated-trend {
    font-size: 0.6rem;
  }

  .stat-elevated-trend .material-icons-round {
    font-size: 11px;
  }

  .welcome-hero {
    margin-bottom: 16px;
    min-height: unset;
  }

  .welcome-hero-content {
    padding: 16px 18px;
  }

  .welcome-hero-title {
    font-size: 1.15rem;
  }

  .welcome-hero-sub {
    font-size: 0.72rem;
  }

  .hero-avatar-ring {
    width: 42px;
    height: 42px;
    font-size: 0.82rem;
  }

  .list-toolbar {
    gap: 8px;
  }

  .list-search {
    padding: 6px 12px;
  }

  .login-stats-modern {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .lsm-card {
    padding: 10px 12px;
    gap: 10px;
  }

  .lsm-value {
    font-size: 1.2rem;
  }

  .lsm-label {
    font-size: 0.6rem;
  }

  .doctor-card, .dept-card {
    padding: 12px 14px;
  }

  .doctor-card-avatar {
    width: 38px;
    height: 38px;
    font-size: 0.75rem;
    border-radius: 12px;
  }

  .login-timeline-card {
    padding: 12px 14px;
  }

  .chart-card-body {
    min-height: 180px !important;
    max-height: 240px !important;
  }
}

@media (max-width: 480px) {
  .welcome-hero-content {
    padding: 12px 14px;
  }

  .welcome-hero-title {
    font-size: 1rem;
  }

  .welcome-hero-sub {
    font-size: 0.68rem;
  }

  .hero-avatar-ring {
    width: 38px;
    height: 38px;
    font-size: 0.75rem;
  }

  /* Tab bar: show icon + short label, allow scroll */
  .admin-tab-bar {
    padding: 3px;
    gap: 3px;
    border-radius: var(--radius-md);
  }

  .admin-tab {
    flex: 1;
    min-width: 0;
    padding: 7px 6px;
    font-size: 0.7rem;
    gap: 3px;
    flex-direction: column;
  }

  .admin-tab .material-icons-round {
    font-size: 18px;
  }

  .admin-tab-label {
    display: none;
  }

  .stats-elevated {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  /* Restore column layout for the spanned card on small screens */
  .stat-elevated-card:last-child:nth-child(odd) {
    grid-column: span 2 !important;
    flex-direction: row;
    align-items: flex-start;
  }

  .stat-elevated-card {
    padding: 10px 10px;
    gap: 8px;
    flex-direction: column;
    align-items: flex-start;
  }

  .stat-elevated-card::before {
    width: 100%;
    height: 3px;
    top: 0;
    left: 0;
    border-radius: 4px 4px 0 0;
  }

  .stat-elevated-value {
    font-size: 1.4rem;
  }

  .stat-elevated-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .stat-elevated-icon .material-icons-round {
    font-size: 16px;
  }

  .stat-elevated-label {
    font-size: 0.6rem;
    letter-spacing: 0.02em;
  }

  .stat-elevated-trend {
    font-size: 0.58rem;
    flex-wrap: wrap;
  }

  .stat-elevated-trend .material-icons-round {
    font-size: 10px;
  }

  .chart-card {
    padding: 12px;
    border-radius: var(--radius-md);
  }

  .chart-card-body {
    min-height: 150px !important;
    max-height: 200px !important;
  }

  .quick-actions-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .quick-action-btn {
    padding: 12px 8px;
  }

  .qa-icon {
    width: 34px;
    height: 34px;
  }

  .qa-icon .material-icons-round {
    font-size: 17px;
  }

  .qa-label {
    font-size: 0.68rem;
  }

  .login-stats-modern {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .lsm-card {
    padding: 8px 10px;
    gap: 8px;
    flex-direction: column;
    align-items: flex-start;
  }

  .lsm-icon {
    width: 32px;
    height: 32px;
    font-size: 17px;
    border-radius: 9px;
  }

  .lsm-value {
    font-size: 1.1rem;
  }

  .lsm-label {
    font-size: 0.56rem;
  }

  .doctor-card, .dept-card {
    padding: 10px 12px;
    gap: 10px;
  }

  .doctor-card-name {
    font-size: 0.85rem;
  }

  .doctor-card-meta-item {
    font-size: 0.7rem;
  }

  .doctor-card-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.7rem;
    border-radius: 10px;
  }

  .card-action-btn {
    width: 32px;
    height: 32px;
  }

  .card-action-btn .material-icons-round {
    font-size: 16px;
  }

  .list-toolbar-actions .btn-primary {
    width: 100%;
    justify-content: center;
  }

  .filter-select {
    width: 100%;
  }

  .list-toolbar {
    flex-direction: column;
  }

  .list-search {
    max-width: 100%;
  }

  .fab {
    width: 48px;
    height: 48px;
    right: 14px;
    bottom: calc(72px + var(--safe-bottom));
  }

  .fab-menu {
    right: 14px;
    bottom: calc(128px + var(--safe-bottom));
  }

  .fab-menu-item {
    padding: 10px 14px;
    font-size: 0.82rem;
  }
}

@media (max-width: 380px) {
  /* Force icon-only tabs on the smallest phones */
  .admin-tab-label { display: none; }

  .admin-tab {
    flex-direction: column;
    padding: 6px 4px;
    gap: 2px;
  }

  .admin-tab .material-icons-round {
    font-size: 20px;
  }

  .stats-elevated {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .stat-elevated-card {
    padding: 8px 10px;
    flex-direction: column;
    gap: 6px;
  }

  .stat-elevated-card:last-child:nth-child(odd) {
    grid-column: span 2 !important;
    flex-direction: column;
    gap: 6px;
  }

  .stat-elevated-value {
    font-size: 1.1rem;
  }

  .stat-elevated-label {
    font-size: 0.56rem;
  }

  .doctor-card, .dept-card {
    padding: 10px 12px;
  }

  .welcome-hero-title {
    font-size: 0.95rem;
  }
}

/* ================== ANNOUNCEMENTS BAR (Upgraded) ================== */
.announcements-bar {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1.5px solid rgba(13,148,136,0.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.announcements-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  cursor: pointer;
  background: rgba(13,148,136,0.04);
  user-select: none;
  transition: background 0.2s;
  min-height: var(--touch-target);
}

.announcements-header:hover {
  background: rgba(13,148,136,0.08);
}

.announcements-header .material-icons-round:first-child {
  color: var(--primary-light);
  font-size: 18px;
}

.announcements-header .toggle-icon {
  margin-left: auto;
  font-size: 18px;
  color: var(--on-surface-var);
  transition: transform 0.25s;
}

.announcements-header .toggle-icon.collapsed {
  transform: rotate(180deg);
}

.announcements-header span:not(.material-icons-round) {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--on-surface);
}

.announcements-body {
  padding: 0 18px 14px;
}

.announcement-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--outline-var);
}

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

.announcement-item h4 {
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--on-surface);
  margin: 0 0 4px;
}

.announcement-item p {
  font-size: 0.8rem;
  color: var(--on-surface-var);
  margin: 0;
  line-height: 1.5;
}

.announcement-item .ann-date {
  font-size: 0.68rem;
  color: var(--outline);
  margin-top: 4px;
}

/* ================== PWA INSTALL BANNER ================== */
.pwa-install-banner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--outline-var);
  padding: 12px 16px calc(12px + var(--safe-bottom));
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
  animation: pwaBannerUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pwa-install-banner.visible { display: flex; }

@keyframes pwaBannerUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.pwa-install-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.pwa-install-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}

.pwa-install-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pwa-install-text strong {
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-install-text span {
  font-size: 0.75rem;
  color: var(--on-surface-var);
}

.pwa-install-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pwa-install-btn {
  background: var(--primary-light);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 20px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 12px rgba(13, 148, 136, 0.30);
  white-space: nowrap;
}

.pwa-install-btn:hover {
  background: var(--primary);
  transform: translateY(-1px);
}

.pwa-install-dismiss {
  background: none;
  border: none;
  color: var(--outline);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.15s;
}

.pwa-install-dismiss:hover { color: var(--accent-red); }

/* ================== OFFLINE INDICATOR ================== */
.offline-indicator {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 600;
  background: rgba(239, 68, 68, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 16px calc(8px + var(--safe-top));
  text-align: center;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: offlineSlideDown 0.3s ease;
}

.offline-indicator.visible { display: flex; }

.offline-indicator .material-icons-round {
  font-size: 16px;
  flex-shrink: 0;
}

@keyframes offlineSlideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (display-mode: standalone) {
  .pwa-install-banner { display: none !important; }
  .topbar { padding-top: calc(0px + var(--safe-top)); }
  .main-content { padding-top: 0; }
  .sidebar { padding-top: var(--safe-top); }
  .fab { bottom: calc(80px + var(--safe-bottom)); }
}

@media (display-mode: window-controls-overlay) {
  .pwa-install-banner { display: none !important; }
  .topbar { height: calc(var(--topbar-h) + 20px); padding-top: 20px; }
}
