/* =========================================================================
   Adamawa State Hospital Management System — Admin Dashboard
   Design tokens & component styles
   Palette  : Deep Sukur Teal + Adamawa Gold
   Type     : Sora (display) / Inter (body)
   Signature: Mandara ridge-line motif (sidebar header + auth hero)
   ========================================================================= */

:root {
  /* ---- Brand colors ---- */
  --ah-teal-900: #082C27;
  --ah-teal-800: #0A3F38;
  --ah-teal-700: #0F5C52;
  --ah-teal-600: #147468;
  --ah-teal-100: #E7F2F0;
  --ah-teal-050: #F3F8F7;

  --ah-gold-600: #B8740A;
  --ah-gold-500: #D98E04;
  --ah-gold-400: #F0A825;
  --ah-gold-100: #FCEACB;

  --ah-danger:  #C0392B;
  --ah-danger-100: #FBE7E4;
  --ah-warning: #D98E04;
  --ah-warning-100: #FCEACB;
  --ah-info:    #2C7DA0;
  --ah-info-100: #E2EFF4;
  --ah-success: #2E8B57;
  --ah-success-100: #E4F3EA;

  --ah-bg:        #F5F7F6;
  --ah-surface:   #FFFFFF;
  --ah-border:    #E1E8E6;
  --ah-text:      #16211F;
  --ah-text-muted:#5B6B68;

  --ah-sidebar-w: 264px;
  --ah-sidebar-w-collapsed: 84px;
  --ah-topbar-h: 72px;

  --ah-radius: 14px;
  --ah-radius-sm: 10px;
  --ah-shadow-sm: 0 1px 2px rgba(10, 63, 56, 0.06);
  --ah-shadow: 0 8px 24px rgba(10, 63, 56, 0.08);
  --ah-shadow-lg: 0 16px 40px rgba(10, 63, 56, 0.14);

  /* Bootstrap variable overrides */
  --bs-body-bg: var(--ah-bg);
  --bs-body-color: var(--ah-text);
  --bs-primary: #0F5C52;
  --bs-primary-rgb: 15, 92, 82;
  --bs-border-radius: 10px;
  --bs-font-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--ah-bg);
  color: var(--ah-text);
  font-size: 0.9375rem;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.font-display {
  font-family: 'Sora', 'Inter', sans-serif;
  color: var(--ah-teal-900);
  letter-spacing: -0.01em;
}

a { color: var(--ah-teal-700); text-decoration: none; }
a:hover { color: var(--ah-teal-800); }

.text-muted { color: var(--ah-text-muted) !important; }
.text-gold { color: var(--ah-gold-600) !important; }
.bg-brand { background: var(--ah-teal-700) !important; }
.text-brand { color: var(--ah-teal-700) !important; }

/* =========================================================================
   Ridge-line signature motif
   ========================================================================= */
.ridge-motif {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  pointer-events: none;
  opacity: 0.55;
}
.ridge-dot {
  animation: ah-pulse 2.4s ease-in-out infinite;
  transform-origin: center;
}
@keyframes ah-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(1.8); }
}
@media (prefers-reduced-motion: reduce) {
  .ridge-dot { animation: none; }
}

/* =========================================================================
   Layout shell
   ========================================================================= */
.ah-shell {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.ah-sidebar {
  width: var(--ah-sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--ah-teal-800) 0%, var(--ah-teal-900) 100%);
  color: #DCEAE7;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  transition: width .2s ease, transform .25s ease;
}
.ah-sidebar-brand {
  position: relative;
  padding: 22px 20px 26px;
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ah-sidebar-brand .brand-row {
  display: flex; align-items: center; gap: 12px; position: relative; z-index: 2;
}
.ah-brand-mark {
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--ah-gold-500);
  display: flex; align-items: center; justify-content: center;
  color: var(--ah-teal-900); font-family: 'Sora',sans-serif; font-weight: 700; font-size: 18px;
  flex-shrink: 0;
}
.ah-sidebar-brand .brand-title {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  line-height: 1.2;
}
.ah-sidebar-brand .brand-sub {
  font-size: 0.72rem;
  color: var(--ah-gold-400);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.ah-nav { padding: 14px 12px; overflow-y: auto; flex: 1; }
.ah-nav-section-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: rgba(220,234,231,0.45);
  padding: 16px 12px 6px;
  font-weight: 600;
}
.ah-nav .nav-link {
  display: flex; align-items: center; gap: 12px;
  color: #C3D9D5;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background .15s ease, color .15s ease;
}
.ah-nav .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; flex-shrink:0; }
.ah-nav .nav-link:hover { background: rgba(255,255,255,0.07); color: #fff; }
.ah-nav .nav-link.active {
  background: var(--ah-gold-500);
  color: var(--ah-teal-900);
  font-weight: 600;
}
.ah-nav .nav-link .badge { margin-left: auto; }

.ah-nav-toggle .ah-caret { transition: transform .18s ease; font-size: 0.7rem; }
.ah-nav-toggle[aria-expanded="true"] .ah-caret { transform: rotate(180deg); }
.ah-nav-toggle.active { color: #fff; }
.ah-subnav { padding-left: 14px; margin-top: 2px; border-left: 1px solid rgba(255,255,255,0.1); margin-left: 22px; }
.ah-subnav .nav-sublink {
  padding: 8px 12px;
  font-size: 0.83rem;
  color: #B6CDC8;
}
.ah-subnav .nav-sublink:hover { color: #fff; background: rgba(255,255,255,0.06); }
.ah-subnav .nav-sublink.active { color: var(--ah-gold-400); font-weight: 600; background: transparent; }

.ah-sidebar-foot {
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.75rem;
  color: rgba(220,234,231,0.55);
}

/* ---- Main column ---- */
.ah-main {
  margin-left: var(--ah-sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left .2s ease;
}

/* ---- Topbar ---- */
.ah-topbar {
  height: var(--ah-topbar-h);
  background: var(--ah-surface);
  border-bottom: 1px solid var(--ah-border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.ah-search {
  position: relative;
  max-width: 340px;
  width: 100%;
}
.ah-search input {
  padding-left: 38px;
  background: var(--ah-bg);
  border: 1px solid var(--ah-border);
}
.ah-search i {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--ah-text-muted);
}
.ah-icon-btn {
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid var(--ah-border);
  background: var(--ah-surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--ah-teal-800);
  position: relative;
}
.ah-icon-btn:hover { background: var(--ah-teal-050); }
.ah-icon-btn .dot {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ah-danger);
  border: 1.5px solid #fff;
}
.ah-user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: 30px;
  border: 1px solid var(--ah-border);
  background: var(--ah-surface);
}
.ah-user-chip img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.ah-user-chip .name { font-size: 0.82rem; font-weight: 600; line-height: 1.1; }
.ah-user-chip .role { font-size: 0.7rem; color: var(--ah-text-muted); }

.ah-content { padding: 26px; flex: 1; }

.ah-sidebar-toggle {
  border: 1px solid var(--ah-border);
  background: var(--ah-surface);
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ah-teal-800);
}

/* =========================================================================
   Page header
   ========================================================================= */
.ah-page-title { font-weight: 700; font-size: 1.5rem; margin-bottom: 2px; }
.ah-breadcrumb { font-size: 0.8rem; color: var(--ah-text-muted); }
.ah-breadcrumb a { color: var(--ah-text-muted); }
.ah-breadcrumb .active { color: var(--ah-teal-700); font-weight: 600; }

/* =========================================================================
   Cards / Stats
   ========================================================================= */
.card {
  border: 1px solid var(--ah-border);
  border-radius: var(--ah-radius);
  box-shadow: var(--ah-shadow-sm);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--ah-border);
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 16px 20px;
}
.card-body { padding: 20px; }

.stat-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
}
.stat-icon {
  width: 48px; height: 48px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; flex-shrink: 0;
}
.stat-icon.teal   { background: var(--ah-teal-100); color: var(--ah-teal-700); }
.stat-icon.gold   { background: var(--ah-gold-100); color: var(--ah-gold-600); }
.stat-icon.info   { background: var(--ah-info-100); color: var(--ah-info); }
.stat-icon.danger { background: var(--ah-danger-100); color: var(--ah-danger); }
.stat-icon.success{ background: var(--ah-success-100); color: var(--ah-success); }

.stat-value { font-family: 'Sora',sans-serif; font-weight: 700; font-size: 1.5rem; line-height:1.1; color: var(--ah-teal-900); }
.stat-label { font-size: 0.8rem; color: var(--ah-text-muted); margin-top: 2px; }
.stat-delta { font-size: 0.76rem; font-weight: 600; }
.stat-delta.up { color: var(--ah-success); }
.stat-delta.down { color: var(--ah-danger); }

/* =========================================================================
   Tables
   ========================================================================= */
.table { --bs-table-bg: transparent; }
.table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ah-text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--ah-border);
  padding: 12px 14px;
  white-space: nowrap;
}
.table tbody td {
  padding: 13px 14px;
  vertical-align: middle;
  border-bottom: 1px solid var(--ah-border);
  font-size: 0.875rem;
}
.table-hover tbody tr:hover { background: var(--ah-teal-050); }
.table-card .card-body { padding: 0; }

.avatar-sm { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.avatar-initial {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--ah-teal-100); color: var(--ah-teal-700);
  font-weight: 700; font-size: 0.8rem; flex-shrink: 0;
}

/* =========================================================================
   Badges / status pills
   ========================================================================= */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 30px;
  font-size: 0.74rem; font-weight: 600;
}
.pill::before { content:''; width:6px; height:6px; border-radius: 50%; background: currentColor; }
.pill-success { background: var(--ah-success-100); color: var(--ah-success); }
.pill-warning { background: var(--ah-warning-100); color: var(--ah-warning); }
.pill-danger  { background: var(--ah-danger-100); color: var(--ah-danger); }
.pill-info    { background: var(--ah-info-100); color: var(--ah-info); }
.pill-neutral { background: #EEF2F1; color: var(--ah-text-muted); }

/* =========================================================================
   Buttons
   ========================================================================= */
.btn { font-weight: 600; font-size: 0.875rem; border-radius: 10px; }
.btn-brand {
  background: var(--ah-teal-700); border-color: var(--ah-teal-700); color: #fff;
}
.btn-brand:hover { background: var(--ah-teal-800); border-color: var(--ah-teal-800); color:#fff; }
.btn-gold {
  background: var(--ah-gold-500); border-color: var(--ah-gold-500); color: var(--ah-teal-900);
}
.btn-gold:hover { background: var(--ah-gold-600); border-color: var(--ah-gold-600); color: var(--ah-teal-900); }
.btn-outline-brand { border-color: var(--ah-teal-700); color: var(--ah-teal-700); }
.btn-outline-brand:hover { background: var(--ah-teal-700); color: #fff; }
.btn-icon { width: 38px; height: 38px; padding:0; display:inline-flex; align-items:center; justify-content:center; }

/* =========================================================================
   Forms
   ========================================================================= */
.form-control, .form-select {
  border-radius: 10px;
  border-color: var(--ah-border);
  font-size: 0.875rem;
  padding: 9px 12px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--ah-teal-600);
  box-shadow: 0 0 0 3px rgba(15,92,82,0.12);
}
.form-label { font-size: 0.82rem; font-weight: 600; color: var(--ah-teal-900); margin-bottom: 6px; }
.form-section-title { font-family:'Sora',sans-serif; font-weight:600; font-size:1rem; color: var(--ah-teal-900); margin-bottom: 4px;}

/* =========================================================================
   Timeline (patient profile)
   ========================================================================= */
.ah-timeline { position: relative; padding-left: 28px; }
.ah-timeline::before {
  content:''; position:absolute; left: 9px; top: 4px; bottom: 4px; width: 2px; background: var(--ah-border);
}
.ah-timeline-item { position: relative; padding-bottom: 22px; }
.ah-timeline-item:last-child { padding-bottom: 0; }
.ah-timeline-item::before {
  content:''; position:absolute; left: -28px; top: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--ah-surface); border: 3px solid var(--ah-teal-600);
}
.ah-timeline-item h6 { margin-bottom: 2px; font-size: 0.86rem; }
.ah-timeline-item .time { font-size: 0.74rem; color: var(--ah-text-muted); }

/* =========================================================================
   Auth pages
   ========================================================================= */
.ah-auth-wrap { min-height: 100vh; display: flex; }
.ah-auth-aside {
  flex: 1.05;
  position: relative;
  background: radial-gradient(120% 120% at 15% 10%, var(--ah-teal-600) 0%, var(--ah-teal-800) 45%, var(--ah-teal-900) 100%);
  color: #fff;
  padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
}
.ah-auth-form { flex: 1; display:flex; align-items:center; justify-content:center; padding: 40px 24px; background: var(--ah-surface); }
.ah-auth-form-inner { width: 100%; max-width: 400px; }
@media (max-width: 991px) { .ah-auth-aside { display: none; } }

/* =========================================================================
   Misc utility
   ========================================================================= */
.kpi-divider { border-left: 1px solid var(--ah-border); }
.section-eyebrow {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ah-gold-600); font-weight: 700; margin-bottom: 6px;
}
.list-clean { list-style: none; margin: 0; padding: 0; }
.progress { height: 8px; border-radius: 30px; background: var(--ah-teal-050); }
.progress-bar { background: var(--ah-teal-600); }

.calendar-cell {
  border: 1px solid var(--ah-border);
  min-height: 92px;
  padding: 6px 8px;
  font-size: 0.78rem;
  vertical-align: top;
}
.calendar-cell .date-num { font-weight: 600; font-size: 0.78rem; color: var(--ah-text-muted); }
.calendar-cell.today { background: var(--ah-teal-050); }
.calendar-cell.today .date-num { color: var(--ah-teal-700); }
.cal-event {
  font-size: 0.68rem; padding: 2px 6px; border-radius: 6px; margin-top: 4px;
  background: var(--ah-teal-100); color: var(--ah-teal-800); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-event.gold { background: var(--ah-gold-100); color: var(--ah-gold-600); }

/* Empty state */
.ah-empty { text-align:center; padding: 56px 24px; color: var(--ah-text-muted); }
.ah-empty i { font-size: 2.4rem; color: var(--ah-teal-100); }

/* Bed grid */
.bed-chip {
  border: 1px solid var(--ah-border);
  border-radius: 10px;
  padding: 10px;
  font-size: 0.75rem;
  text-align: center;
}
.bed-chip .bed-id { font-weight: 700; font-family:'Sora',sans-serif; }
.bed-chip.occupied { background: var(--ah-danger-100); border-color: transparent; }
.bed-chip.available { background: var(--ah-success-100); border-color: transparent; }
.bed-chip.cleaning { background: var(--ah-warning-100); border-color: transparent; }

/* Scrollbar */
.ah-nav::-webkit-scrollbar { width: 5px; }
.ah-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 1199.98px) {
  .ah-sidebar { transform: translateX(-100%); }
  .ah-sidebar.show { transform: translateX(0); box-shadow: var(--ah-shadow-lg); }
  .ah-main { margin-left: 0; }
  .ah-sidebar-backdrop {
    display: none; position: fixed; inset:0; background: rgba(8,44,39,0.45); z-index: 1025;
  }
  .ah-sidebar-backdrop.show { display: block; }
}
@media (max-width: 575.98px) {
  .ah-content { padding: 16px; }
  .ah-topbar { padding: 0 14px; gap: 10px; }
  .ah-search { display: none; }
}

/* Print */
@media print {
  .ah-sidebar, .ah-topbar, .no-print { display: none !important; }
  .ah-main { margin-left: 0 !important; }
}
