/* ================================================
   Hospital Patient Registration System — Styles
   Freetown General Hospital, Sierra Leone
   Mkokwing University · Semester 6 · 2026
   ================================================ */

/* ── RESET & BASE ── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Poppins', sans-serif;
  background: #f0f4f8;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-size: 14px;
}

/* ── TOPBAR ── */
.topbar {
  background: #1a3a5c;
  color: #fff;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.topbar-logo .icon-box {
  background: #e74c3c;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.notif-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  position: relative;
}
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #e74c3c;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.12);
  border-radius: 25px;
  padding: 5px 14px 5px 5px;
}
.user-avatar {
  width: 30px;
  height: 30px;
  background: #3498db;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}
.user-name { font-size: 13px; font-weight: 500; }

/* ── LAYOUT ── */
.app-body { display: flex; flex: 1; }

/* ── SIDEBAR ── */
.sidebar {
  width: 220px;
  background: linear-gradient(180deg, #1a3a5c 0%, #0f2540 100%);
  color: #fff;
  min-height: calc(100vh - 56px);
  padding: 20px 0;
  flex-shrink: 0;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 24px;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active {
  background: rgba(52,152,219,0.25);
  color: #fff;
  border-left-color: #3498db;
}
.nav-icon { font-size: 20px; width: 26px; text-align: center; }

/* ── MAIN ── */
.main { flex: 1; padding: 24px; overflow-y: auto; }
.page { display: none; }
.page.active { display: block; }

/* ── PAGE HEADER ── */
.page-header { margin-bottom: 22px; }
.page-header h1 { font-size: 22px; font-weight: 700; color: #1a3a5c; }
.page-header p { color: #7f8c8d; font-size: 13px; margin-top: 3px; }

/* ── STAT CARDS ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #e8f4fd; }
.stat-icon.green  { background: #eafaf1; }
.stat-icon.orange { background: #fef9e7; }
.stat-icon.purple { background: #f5eef8; }
.stat-info .val   { font-size: 28px; font-weight: 700; color: #1a3a5c; line-height: 1; }
.stat-info .lbl   { font-size: 12px; color: #7f8c8d; margin-top: 4px; }
.stat-info .sub   { font-size: 11px; color: #3498db; font-weight: 600; margin-top: 2px; }

/* ── QUICK ACTIONS ── */
.qa-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.qa-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.qa-top { display: flex; align-items: center; gap: 12px; width: 100%; }
.qa-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.qa-icon.teal   { background: #1abc9c; color: #fff; }
.qa-icon.olive  { background: #27ae60; color: #fff; }
.qa-icon.violet { background: #8e44ad; color: #fff; }
.qa-title { font-size: 15px; font-weight: 700; color: #1a3a5c; }
.qa-desc  { font-size: 12px; color: #7f8c8d; line-height: 1.5; }
.qa-btn {
  width: 100%;
  padding: 9px;
  border: none;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.qa-btn:hover { opacity: 0.88; }
.qa-btn.teal   { background: #1abc9c; color: #fff; }
.qa-btn.olive  { background: #27ae60; color: #fff; }
.qa-btn.violet { background: #8e44ad; color: #fff; }

/* ── SECTION CARDS ── */
.section-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  margin-bottom: 20px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title  { font-size: 15px; font-weight: 700; color: #e74c3c; }
.view-all-btn {
  background: none;
  border: 1.5px solid #bdc3c7;
  border-radius: 7px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: all 0.2s;
}
.view-all-btn:hover { background: #1a3a5c; color: #fff; border-color: #1a3a5c; }

/* ── TABLE ── */
.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #ecf0f1;
}
table         { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
thead tr      { background: #f8f9fa; }
th {
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  color: #555;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1.5px solid #ecf0f1;
  white-space: nowrap;
}
td {
  padding: 11px 14px;
  border-bottom: 1px solid #f2f2f2;
  color: #333;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td      { background: #f8fbff; }
.empty-td { text-align: center; color: #aaa; padding: 32px !important; font-size: 13px; }

/* ── BADGES ── */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.b-green  { background: #eafaf1; color: #1e8449; }
.b-blue   { background: #e8f4fd; color: #1a5276; }
.b-orange { background: #fef9e7; color: #9a6908; }
.b-red    { background: #fdedec; color: #922b21; }

/* ── FORM ── */
.form-card {
  background: #fff;
  border-radius: 14px;
  padding: 26px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.fsection {
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1.5px solid #f0f0f0;
}
.fsection:last-of-type { border-bottom: none; margin-bottom: 0; }
.fsection-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #3498db;
  margin-bottom: 14px;
}
.fgrid        { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fgrid.three  { grid-template-columns: 1fr 1fr 1fr; }
.fg           { display: flex; flex-direction: column; gap: 5px; }
.fg.full      { grid-column: 1 / -1; }
.fg label {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.fg input,
.fg select,
.fg textarea {
  padding: 10px 13px;
  border: 1.5px solid #dce1e7;
  border-radius: 9px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: #333;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  background: #fff;
}
.fg input:focus,
.fg select:focus,
.fg textarea:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52,152,219,0.12);
}
.fg textarea { resize: vertical; min-height: 80px; }

/* ── BUTTONS ── */
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.btn {
  padding: 10px 24px;
  border-radius: 9px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.btn-primary { background: #1a3a5c; color: #fff; }
.btn-primary:hover {
  background: #0f2540;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26,58,92,0.25);
}
.btn-success       { background: #27ae60; color: #fff; }
.btn-success:hover { background: #1e8449; }
.btn-ghost         { background: #fff; color: #555; border: 1.5px solid #dce1e7; }
.btn-ghost:hover   { background: #f8f9fa; }
.btn-danger        { background: #e74c3c; color: #fff; font-size: 12px; padding: 7px 14px; }
.btn-danger:hover  { background: #c0392b; }
.btn-sm            { font-size: 12px; padding: 6px 13px; }

/* ── ALERTS ── */
.alert {
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.alert-success { background: #eafaf1; color: #1e8449; border: 1px solid #a9dfbf; }
.alert-error   { background: #fdedec; color: #922b21; border: 1px solid #f5b7b1; }

/* ── SEARCH ROW ── */
.search-row { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; }
.search-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid #dce1e7;
  border-radius: 9px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  outline: none;
}
.search-row input:focus { border-color: #3498db; }
.search-row select {
  padding: 10px 13px;
  border: 1.5px solid #dce1e7;
  border-radius: 9px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  outline: none;
  min-width: 160px;
}

/* ── REPORT BARS ── */
.bar-row     { margin-bottom: 14px; }
.bar-meta    { display: flex; justify-content: space-between; font-size: 13px; color: #555; margin-bottom: 5px; font-weight: 500; }
.bar-track   { height: 10px; background: #f0f0f0; border-radius: 5px; overflow: hidden; }
.bar-fill    { height: 100%; border-radius: 5px; transition: width 0.6s ease; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }

/* ── MODAL ── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  max-width: 580px;
  width: 93%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title  { font-size: 18px; font-weight: 700; color: #1a3a5c; }
.modal-close {
  background: #f0f0f0;
  border: none;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
}
.modal-close:hover { background: #e74c3c; color: #fff; }
.drow {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 13.5px;
}
.drow:last-child { border-bottom: none; }
.dlbl { color: #7f8c8d; font-weight: 500; }
.dval { color: #1a3a5c; font-weight: 600; text-align: right; max-width: 60%; }

/* ── SETTINGS ── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.setting-section {
  background: #fff;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.setting-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: #1a3a5c;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid #f0f0f0;
}

/* ── FOOTER ── */
.footer {
  background: #1a3a5c;
  color: rgba(255,255,255,0.5);
  text-align: center;
  font-size: 11px;
  padding: 10px;
  margin-top: auto;
}
.footer span { color: #3498db; font-weight: 600; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .sidebar          { display: none; }
  .stat-grid        { grid-template-columns: 1fr 1fr; }
  .qa-grid          { grid-template-columns: 1fr; }
  .report-grid      { grid-template-columns: 1fr; }
  .settings-grid    { grid-template-columns: 1fr; }
}
