/* ============================================================
   Ebonyi Health-MIS — Global Stylesheet
   ============================================================ */

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

:root {
  --primary:     #005b96;
  --primary-dk:  #003d6b;
  --accent:      #00897b;
  --accent-dk:   #005f57;
  --danger:      #dc3545;
  --warning:     #f0ad00;
  --success:     #198754;
  --info:        #0dcaf0;
  --light:       #f4f7fb;
  --dark:        #1a1a2e;
  --text:        #222;
  --muted:       #6c757d;
  --border:      #dee2e6;
  --white:       #ffffff;
  --radius:      12px;
  --radius-lg:   18px;
  --shadow:      0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.12);
  --sidebar-w:   260px;
  --topbar-h:    64px;
}

body {
  font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
  background: var(--light);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

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

/* ============================================================
   PUBLIC NAVBAR
   ============================================================ */
.top-navbar {
  background: linear-gradient(90deg, var(--primary-dk), var(--accent));
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.top-navbar .navbar-brand {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff !important;
  letter-spacing: 0.3px;
}
.top-navbar .navbar-brand span {
  font-weight: 300;
  opacity: 0.85;
  font-size: 0.95rem;
  display: block;
  line-height: 1;
}
.top-navbar .nav-link { color: rgba(255,255,255,0.9) !important; font-weight: 500; }
.top-navbar .nav-link:hover { color: #fff !important; }
.top-navbar .nav-link.btn-nav {
  background: rgba(255,255,255,0.18);
  border-radius: 20px;
  padding: 6px 18px;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
  background: linear-gradient(135deg, rgba(0,61,107,0.88), rgba(0,95,87,0.82)),
              url('../images/health-bg.png') center/cover no-repeat;
  min-height: 90vh;
  display: flex;
  align-items: center;
  color: #fff;
  padding: 80px 0;
}
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 18px;
  letter-spacing: 0.5px;
}
.hero-title { font-size: 2.8rem; font-weight: 700; line-height: 1.25; }
.hero-subtitle { font-size: 1.08rem; opacity: 0.9; margin: 18px 0 30px; }
.hero-glass {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-lg);
  padding: 30px;
  backdrop-filter: blur(8px);
}
.hero-stat { text-align: center; padding: 12px 0; }
.hero-stat h3 { font-size: 1.8rem; font-weight: 700; }
.hero-stat p  { font-size: 0.82rem; opacity: 0.8; margin: 0; }

/* ============================================================
   COMMON CARDS
   ============================================================ */
.card-mis {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  height: 100%;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card-mis:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.stat-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}
.stat-box.green  { border-color: var(--success); }
.stat-box.amber  { border-color: var(--warning); }
.stat-box.red    { border-color: var(--danger); }
.stat-box.teal   { border-color: var(--accent); }
.stat-box h2 { font-size: 2rem; font-weight: 700; color: var(--primary); margin: 0; }
.stat-box.green h2  { color: var(--success); }
.stat-box.amber h2  { color: var(--warning); }
.stat-box.red h2    { color: var(--danger); }
.stat-box.teal h2   { color: var(--accent); }
.stat-box p  { color: var(--muted); font-size: 0.85rem; margin: 4px 0 0; }
.stat-box .stat-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  float: right;
  margin-top: -5px;
}

/* ============================================================
   DASHBOARD LAYOUT (SIDEBAR)
   ============================================================ */
.mis-layout {
  display: flex;
  min-height: 100vh;
}

.mis-sidebar {
  width: var(--sidebar-w);
  background: var(--dark);
  color: #cdd4e0;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}
.mis-sidebar::-webkit-scrollbar { width: 4px; }
.mis-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo h5 { color: #fff; font-size: 1rem; font-weight: 700; margin: 0; }
.sidebar-logo span { font-size: 0.78rem; color: rgba(255,255,255,0.5); }

.sidebar-section { padding: 14px 16px 4px; }
.sidebar-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}

.sidebar-nav { list-style: none; padding: 0 8px; }
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 8px;
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  margin-bottom: 2px;
}
.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.sidebar-nav li a.active { background: var(--primary); color: #fff; }
.sidebar-nav li a .nav-icon { font-size: 1rem; width: 20px; text-align: center; opacity: 0.8; }
.sidebar-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
}

.sidebar-user {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user .user-name { color: #fff; font-size: 0.88rem; font-weight: 600; }
.sidebar-user .user-role {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  text-transform: capitalize;
}

.mis-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mis-topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
}
.topbar-title { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar-notif {
  position: relative;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.2rem;
}
.topbar-notif .badge-dot {
  position: absolute;
  top: -2px; right: -2px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--white);
}
.topbar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.mis-content { padding: 28px; flex: 1; }

.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 1.5rem; font-weight: 700; color: var(--dark); }
.page-header p  { color: var(--muted); font-size: 0.9rem; margin: 2px 0 0; }
.breadcrumb-mis {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.breadcrumb-mis a { color: var(--primary); }

/* ============================================================
   TABLES
   ============================================================ */
.table-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.table-card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.table-card-header h5 { font-size: 1rem; font-weight: 700; margin: 0; }
.table-card .table-responsive { padding: 0 4px; }
.table-mis { margin: 0; }
.table-mis thead th {
  background: var(--light);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  padding: 12px 16px;
  border: none;
}
.table-mis tbody td { padding: 12px 16px; vertical-align: middle; font-size: 0.9rem; border-color: #f0f0f0; }
.table-mis tbody tr:hover { background: #fafbff; }

/* ============================================================
   FORMS
   ============================================================ */
.form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}
.form-card .section-divider {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin: 24px 0 18px;
}
.form-label { font-weight: 600; font-size: 0.87rem; color: var(--text); margin-bottom: 5px; }
.form-control, .form-select {
  border-radius: var(--radius);
  min-height: 44px;
  border: 1.5px solid var(--border);
  font-size: 0.92rem;
  transition: border-color 0.2s;
  box-shadow: none !important;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,91,150,0.1) !important;
}
textarea.form-control { min-height: 90px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { border-radius: var(--radius); font-weight: 600; font-size: 0.9rem; padding: 9px 20px; }
.btn-primary   { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dk); border-color: var(--primary-dk); }
.btn-success   { background: var(--success); border-color: var(--success); }
.btn-mis-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  border-radius: var(--radius);
}
.btn-mis-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 0.82rem; border-radius: 8px; }
.btn-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* ============================================================
   BADGES & STATUS
   ============================================================ */
.badge-mis {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}
.badge-active    { background: #d4edda; color: #155724; }
.badge-inactive  { background: #f8d7da; color: #721c24; }
.badge-pending   { background: #fff3cd; color: #856404; }
.badge-approved  { background: #d4edda; color: #155724; }
.badge-completed { background: #cff4fc; color: #055160; }
.badge-cancelled { background: #f8d7da; color: #721c24; }
.badge-critical  { background: #f8d7da; color: #721c24; animation: pulse-badge 1.5s infinite; }
.badge-low       { background: #d4edda; color: #155724; }
.badge-medium    { background: #fff3cd; color: #856404; }
.badge-high      { background: #ffe5d0; color: #6e1f00; }
@keyframes pulse-badge { 0%,100%{opacity:1} 50%{opacity:0.6} }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0,40,80,0.9), rgba(0,95,87,0.85)),
              url('../images/health-bg.png') center/cover no-repeat;
  padding: 30px 15px;
}
.auth-panel {
  width: 100%;
  max-width: 460px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo h3 { color: var(--primary-dk); font-weight: 700; font-size: 1.3rem; }
.auth-logo p  { color: var(--muted); font-size: 0.85rem; margin: 2px 0 0; }

/* ============================================================
   RESULT CARDS (self-test)
   ============================================================ */
.result-card { border-radius: var(--radius-lg); padding: 24px; color: #fff; box-shadow: var(--shadow); }
.result-card.low      { background: linear-gradient(135deg, #198754, #20c997); }
.result-card.medium   { background: linear-gradient(135deg, #f0ad00, #fd7e14); color: #1a1a2e; }
.result-card.high     { background: linear-gradient(135deg, #dc3545, #fd7e14); }
.result-card.critical { background: linear-gradient(135deg, #7a0019, #dc3545); }

/* ============================================================
   ALERTS & BANNERS
   ============================================================ */
.page-banner {
  background: linear-gradient(90deg, var(--primary-dk), var(--accent));
  color: #fff;
  padding: 40px 0;
  text-align: center;
}
.page-banner h2 { font-weight: 700; font-size: 1.8rem; }
.page-banner p  { opacity: 0.85; margin: 6px 0 0; }

.alert-mis {
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-mis.info    { background: #e8f4fd; border-left: 4px solid var(--primary); color: var(--primary-dk); }
.alert-mis.success { background: #d4edda; border-left: 4px solid var(--success); color: #155724; }
.alert-mis.warning { background: #fff3cd; border-left: 4px solid var(--warning); color: #856404; }
.alert-mis.danger  { background: #f8d7da; border-left: 4px solid var(--danger); color: #721c24; }

/* ============================================================
   MOBILE TOGGLE
   ============================================================ */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
}
@media (max-width: 992px) {
  .sidebar-toggle { display: flex; }
  .mis-sidebar { transform: translateX(-100%); }
  .mis-sidebar.open { transform: translateX(0); }
  .mis-main { margin-left: 0 !important; }
  .hero-title { font-size: 2rem; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-primary-mis { color: var(--primary) !important; }
.text-accent      { color: var(--accent) !important; }
.bg-primary-mis   { background: var(--primary) !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.gap-6  { gap: 6px; }
.rounded-mis { border-radius: var(--radius) !important; }

/* Chat bubble */
.chat-wrap { max-height: 380px; overflow-y: auto; padding: 10px; background: #f8faff; border-radius: var(--radius); }
.chat-bubble { max-width: 75%; padding: 10px 14px; border-radius: 14px; font-size: 0.9rem; margin-bottom: 8px; }
.chat-bubble.mine { background: #d1e8ff; color: #003060; margin-left: auto; border-bottom-right-radius: 4px; }
.chat-bubble.theirs { background: #fff; color: var(--text); border-bottom-left-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.chat-meta { font-size: 0.72rem; color: var(--muted); margin-top: 3px; }

/* Vitals block */
.vital-item { background: var(--light); border-radius: var(--radius); padding: 12px 16px; text-align: center; }
.vital-item .val { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.vital-item .lbl { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
