@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #2dd4a0;
  --primary-dim: rgba(45, 212, 160, 0.15);
  --accent: #facc15;
  --bg: #0f172a;
  --bg-2: #0a0f1a;
  --sidebar: #0b1224;
  --card: rgba(30, 41, 59, 0.6);
  --card-solid: #1e293b;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-faint: #64748b;
  --border: rgba(45, 212, 160, 0.25);
  --border-soft: rgba(255, 255, 255, 0.08);
  --success: #2dd4a0;
  --warn: #facc15;
  --danger: #f87171;
  --info: #60a5fa;
  --radius: 14px;
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', sans-serif;
  background: radial-gradient(ellipse at top, #1e293b 0%, var(--bg) 50%, var(--bg-2) 100%);
  background-attachment: fixed;
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  line-height: 1.55;
}

button { font-family: inherit; }

/* ───────── LOGIN ───────── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
}

.login-back {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  background: var(--card-solid);
  border: 1.5px solid var(--border);
  color: var(--primary);
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
  z-index: 10;
}

.login-back:hover {
  background: var(--primary-dim);
  transform: translateX(-3px);
}

.topbar-back-btn {
  background: var(--primary-dim);
  border: 1.5px solid var(--border);
  color: var(--primary);
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.topbar-back-btn:hover {
  background: var(--primary);
  color: #0f172a;
  transform: translateX(-3px);
}

.login-card {
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  max-width: 560px;
  width: 100%;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  text-align: center;
  animation: floatUp 0.5s ease;
}

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

.login-brand .brand-icon {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
}

.login-brand h1 {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-brand p {
  color: var(--text-dim);
  margin: 0.2rem 0 2rem;
}

.login-prompt {
  color: var(--text);
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.demo-tag {
  background: var(--accent);
  color: #0f172a;
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-weight: 700;
  margin-left: 0.4rem;
  letter-spacing: 0.5px;
}

.role-grid {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.role-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.2rem;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text);
  transition: all 0.2s;
}

.role-card:hover {
  background: var(--primary-dim);
  border-color: var(--primary);
  transform: translateX(4px);
}

.role-emoji {
  font-size: 2.2rem;
  width: 56px;
  height: 56px;
  background: var(--primary-dim);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.role-name {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.1rem;
}

.role-desc {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.login-foot {
  color: var(--text-faint);
  font-size: 0.85rem;
  margin: 0;
}

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

.login-foot a:hover { text-decoration: underline; }

/* ───────── APP SHELL ───────── */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  transition: grid-template-columns 0.3s ease;
}

.app-shell.collapsed {
  grid-template-columns: var(--sidebar-w-collapsed) 1fr;
}

/* ───────── SIDEBAR ───────── */
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 1.2rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-top {
  padding: 0 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 1rem;
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 1.1rem;
}

.sb-icon { font-size: 1.5rem; }

.sb-collapse {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-dim);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.sb-collapse:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.app-shell.collapsed .sb-collapse { transform: rotate(180deg); }

.sb-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0 0.8rem;
}

.sb-link {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.15s;
  width: 100%;
}

.sb-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.sb-link.active {
  background: var(--primary-dim);
  color: var(--primary);
}

.sb-link-icon { font-size: 1.2rem; flex-shrink: 0; }

.sb-bottom {
  padding: 1rem 0.8rem 0;
  border-top: 1px solid var(--border-soft);
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sb-user {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.sb-avatar {
  width: 38px;
  height: 38px;
  background: var(--primary-dim);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.sb-userinfo { min-width: 0; }

.sb-username {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-userrole {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: capitalize;
}

.sb-logout {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-dim);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.sb-logout:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* Collapsed sidebar */
.app-shell.collapsed .sb-name,
.app-shell.collapsed .sb-link-text,
.app-shell.collapsed .sb-userinfo {
  display: none;
}

.app-shell.collapsed .sb-link,
.app-shell.collapsed .sb-user {
  justify-content: center;
}

/* ───────── MAIN AREA ───────── */
.main-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
}

.page-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.topbar-actions { display: flex; gap: 0.8rem; align-items: center; }

.topbar-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.topbar-link:hover { color: var(--primary); }

/* ───────── PAGE ───────── */
.page {
  padding: 2rem;
  animation: fadeIn 0.3s ease;
}

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

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.section-title {
  margin: 0;
  color: var(--text);
  font-size: 1.3rem;
}

/* ───────── BUTTONS ───────── */
.btn-primary, .btn-secondary, .btn-ghost, .btn-icon {
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #22b387);
  color: #0f172a;
  padding: 0.7rem 1.4rem;
  box-shadow: 0 6px 20px rgba(45, 212, 160, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(45, 212, 160, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--border);
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
}

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

.btn-icon {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  justify-content: center;
}

.btn-icon:hover { background: rgba(45, 212, 160, 0.1); color: var(--primary); }
.btn-icon.danger:hover { background: rgba(248, 113, 113, 0.1); color: var(--danger); }

/* ───────── KPI CARDS ───────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.3rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  backdrop-filter: blur(10px);
  transition: all 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border);
}

.kpi-icon {
  font-size: 1.8rem;
  width: 50px;
  height: 50px;
  background: var(--primary-dim);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-label {
  color: var(--text-dim);
  font-size: 0.82rem;
  margin-bottom: 0.2rem;
}

.kpi-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text);
}

/* ───────── DASHBOARD GRID ───────── */
.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1000px) {
  .dash-grid { grid-template-columns: 1fr; }
}

.panel {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(10px);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.panel h2, .panel h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text);
}

/* ───────── SCHEDULE LIST ───────── */
.schedule-list, .queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.sched-item, .queue-item {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s;
}

.sched-item:hover, .queue-item:hover {
  border-color: var(--border);
  background: rgba(15, 23, 42, 0.7);
}

.sched-time {
  background: var(--primary-dim);
  color: var(--primary);
  font-weight: 700;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  font-size: 0.88rem;
  min-width: 64px;
  text-align: center;
}

.sched-info { flex: 1; min-width: 0; }
.sched-name { font-weight: 600; color: var(--text); }
.sched-reason { font-size: 0.85rem; color: var(--text-dim); }

.queue-num {
  background: var(--accent);
  color: #0f172a;
  font-weight: 800;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.queue-info { flex: 1; }
.queue-name { font-weight: 600; }
.queue-doc { font-size: 0.82rem; color: var(--text-dim); }

.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-dim);
  font-style: italic;
}

/* ───────── TABLES ───────── */
.search-wrap {
  display: flex;
  gap: 0.6rem;
  flex: 1;
  max-width: 480px;
}

.search-wrap input, .search-wrap select,
.appt-filters input, .appt-filters select {
  flex: 1;
  background: rgba(15, 23, 42, 0.6);
  border: 1.5px solid var(--border-soft);
  border-radius: 8px;
  color: var(--text);
  padding: 0.65rem 0.9rem;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.search-wrap input:focus, .search-wrap select:focus,
.appt-filters input:focus, .appt-filters select:focus {
  outline: none;
  border-color: var(--primary);
}

.appt-filters { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.table-wrap {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(10px);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.data-table thead {
  background: rgba(15, 23, 42, 0.5);
  border-bottom: 1px solid var(--border-soft);
}

.data-table th {
  text-align: left;
  padding: 0.9rem 1.1rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  font-weight: 600;
}

.data-table td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
  font-size: 0.92rem;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(45, 212, 160, 0.03); }

.row-actions {
  display: flex;
  gap: 0.3rem;
}

/* ───────── BADGES ───────── */
.badge {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-scheduled { background: var(--primary-dim); color: var(--primary); }
.badge-in_queue { background: rgba(250, 204, 21, 0.15); color: var(--accent); }
.badge-completed { background: rgba(96, 165, 250, 0.15); color: var(--info); }
.badge-cancelled { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
.badge-paid { background: var(--primary-dim); color: var(--primary); }
.badge-pending { background: rgba(250, 204, 21, 0.15); color: var(--accent); }

/* ───────── PRESCRIPTIONS GRID ───────── */
.rx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.rx-card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.3rem;
  backdrop-filter: blur(10px);
  position: relative;
}

.rx-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.8rem;
}

.rx-patient { font-weight: 700; color: var(--text); }
.rx-date { font-size: 0.82rem; color: var(--text-dim); }

.rx-diagnosis {
  background: var(--primary-dim);
  color: var(--primary);
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.85rem;
  display: inline-block;
  margin-bottom: 0.8rem;
}

.rx-meds {
  list-style: none;
  padding: 0;
  margin: 0 0 0.8rem;
  border-top: 1px solid var(--border-soft);
  padding-top: 0.8rem;
}

.rx-meds li {
  padding: 0.4rem 0;
  font-size: 0.88rem;
  color: var(--text);
}

.rx-meds li strong { color: var(--accent); }

.rx-notes {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-style: italic;
  border-top: 1px solid var(--border-soft);
  padding-top: 0.7rem;
}

.rx-delete {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
}

/* ───────── BILLING ───────── */
.bill-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.bill-stat {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.3rem;
  text-align: center;
  backdrop-filter: blur(10px);
}

.bill-stat.paid { border-color: rgba(45, 212, 160, 0.3); }
.bill-stat.pending { border-color: rgba(250, 204, 21, 0.3); }

.bill-label {
  display: block;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.bill-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
}

.bill-stat.paid .bill-value { color: var(--success); }
.bill-stat.pending .bill-value { color: var(--accent); }
.bill-stat.total .bill-value { color: var(--text); }

.inv-total {
  display: flex;
  justify-content: space-between;
  padding: 1rem;
  background: var(--primary-dim);
  border-radius: 10px;
  margin: 1rem 0 1.5rem;
  font-weight: 600;
}

.inv-total-amt {
  color: var(--primary);
  font-size: 1.3rem;
  font-weight: 800;
}

/* ───────── REPORTS ───────── */
.reports-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1000px) {
  .reports-grid { grid-template-columns: 1fr; }
}

.chart-wrap {
  position: relative;
  height: 280px;
  margin-top: 1rem;
}

/* ───────── MODAL ───────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
  overflow-y: auto;
}

.modal[hidden] { display: none; }

.modal-content {
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2.2rem;
  max-width: 500px;
  width: 100%;
  position: relative;
  animation: slideUp 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content.modal-lg { max-width: 700px; }

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

.modal-content h2 {
  margin: 0 0 1.3rem;
  color: var(--primary);
}

.modal-close {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.7rem;
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.form-row { margin-bottom: 1.1rem; }

.form-row.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.form-row label {
  display: block;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1.5px solid var(--border-soft);
  border-radius: 8px;
  color: var(--text);
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  resize: vertical;
}

.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.form-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: flex-end;
  margin-top: 1.4rem;
}

/* Med row in prescription modal */
.med-row {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1fr auto;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.med-row input {
  background: rgba(15, 23, 42, 0.6);
  border: 1.5px solid var(--border-soft);
  border-radius: 6px;
  color: var(--text);
  padding: 0.5rem 0.7rem;
  font-family: inherit;
  font-size: 0.9rem;
  width: 100%;
}

.med-row .remove-btn {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-faint);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1rem;
}

.med-row .remove-btn:hover { color: var(--danger); border-color: var(--danger); }

.inv-item-row {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* ───────── PROFILE MODAL ───────── */
.profile-head {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-soft);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #0f172a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  flex-shrink: 0;
}

.profile-meta h2 { margin: 0 0 0.3rem; color: var(--text); font-size: 1.5rem; }
.profile-meta .profile-id { color: var(--text-dim); font-size: 0.88rem; }

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.profile-field {
  background: rgba(15, 23, 42, 0.4);
  border-radius: 8px;
  padding: 0.8rem;
}

.profile-field .label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.3rem;
}

.profile-field .value { color: var(--text); font-weight: 500; }

.profile-section h3 {
  margin: 1.5rem 0 0.8rem;
  font-size: 1rem;
  color: var(--primary);
}

.profile-tx-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-tx-item {
  background: rgba(15, 23, 42, 0.4);
  border-radius: 8px;
  padding: 0.8rem;
  font-size: 0.88rem;
}

.profile-tx-item .tx-date { color: var(--text-dim); font-size: 0.78rem; }

/* ───────── TOAST ───────── */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--card-solid);
  border: 1px solid var(--primary);
  color: var(--text);
  padding: 0.9rem 1.4rem;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  z-index: 2000;
  animation: toastIn 0.3s ease;
  font-weight: 500;
}

.toast[hidden] { display: none; }

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

/* ───────── RESPONSIVE ───────── */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    width: 260px;
    z-index: 200;
    transition: left 0.3s ease;
  }
  .sidebar.mobile-open { left: 0; box-shadow: 10px 0 30px rgba(0,0,0,0.4); }
  .mobile-menu-btn { display: block; }
  .sb-collapse { display: none; }
  .app-shell.collapsed { grid-template-columns: 1fr; }
  .app-shell.collapsed .sidebar .sb-name,
  .app-shell.collapsed .sidebar .sb-link-text,
  .app-shell.collapsed .sidebar .sb-userinfo { display: block; }
  .reports-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .page { padding: 1.2rem; }
  .topbar { padding: 0.8rem 1.2rem; }
  .login-card { padding: 2rem 1.5rem; }
  .modal-content { padding: 1.6rem 1.3rem; }
  .form-row.split { grid-template-columns: 1fr; }
  .bill-summary { grid-template-columns: 1fr; }
  .med-row { grid-template-columns: 1fr; }
  .toast { left: 1rem; right: 1rem; bottom: 1rem; }
}
