/* =========================================================
   MedCard – Medical Theme (white / light-blue)
   ========================================================= */

:root {
  --primary:      #1a6faf;
  --primary-dark: #145a8e;
  --primary-light:#e8f4fd;
  --accent:       #2196f3;
  --success:      #2ecc71;
  --warning:      #f39c12;
  --danger:       #e74c3c;
  --info:         #17a2b8;
  --text:         #2c3e50;
  --text-muted:   #7f8c8d;
  --border:       #d0e4f0;
  --bg:           #f0f6fc;
  --bg-white:     #ffffff;
  --sidebar-w:    250px;
  --header-h:     60px;
  --radius:       8px;
  --shadow:       0 2px 8px rgba(26,111,175,.12);
  --shadow-md:    0 4px 16px rgba(26,111,175,.18);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

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

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c0d9ea; border-radius: 3px; }

/* =========================================================
   LOGIN PAGE
   ========================================================= */
.login-body {
  background: linear-gradient(135deg, #1a6faf 0%, #0d4a7a 50%, #1565c0 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-container { padding: 20px; width: 100%; max-width: 420px; }

.login-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  padding: 48px 40px;
}

.login-logo { text-align: center; margin-bottom: 36px; }
.login-logo-icon { font-size: 48px; color: var(--primary); margin-bottom: 12px; }
.login-title { font-size: 28px; font-weight: 700; color: var(--primary-dark); margin-bottom: 4px; }
.login-subtitle { color: var(--text-muted); font-size: 13px; }

.login-form .form-group { margin-bottom: 20px; }
.login-form label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--text); }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 40px; }
.btn-eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 16px; color: var(--text-muted);
  padding: 2px;
}

.login-error {
  color: var(--danger); font-size: 13px; margin-bottom: 12px;
  min-height: 18px; text-align: center;
}

.login-footer { text-align: center; margin-top: 24px; color: var(--text-muted); }

/* =========================================================
   APP LAYOUT
   ========================================================= */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: #0d4a7a;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform .25s;
}

.sidebar-brand {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-brand .brand-icon { font-size: 24px; }
.sidebar-brand .brand-name { font-size: 18px; font-weight: 700; }
.sidebar-brand .brand-sub { font-size: 11px; opacity: .7; margin-top: 1px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }

.nav-section { padding: 8px 20px 4px; font-size: 11px; text-transform: uppercase;
               letter-spacing: .08em; opacity: .5; font-weight: 600; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; color: rgba(255,255,255,.8);
  cursor: pointer; transition: all .15s;
  border-left: 3px solid transparent;
  user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active {
  background: rgba(255,255,255,.12); color: #fff;
  border-left-color: #64b5f6;
}
.nav-item .nav-icon { font-size: 18px; width: 22px; text-align: center; }
.nav-item .nav-label { font-size: 13px; }

.sidebar-user {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: 13px;
}
.sidebar-user .user-name { font-weight: 600; margin-bottom: 2px; }
.sidebar-user .user-role { opacity: .65; font-size: 12px; }
.btn-logout {
  margin-top: 10px; width: 100%;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  color: #fff; padding: 7px; border-radius: var(--radius); cursor: pointer;
  font-size: 13px; transition: background .15s;
}
.btn-logout:hover { background: rgba(255,255,255,.2); }

/* ── Main content ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.topbar-toggle {
  display: none; background: none; border: none; font-size: 22px;
  cursor: pointer; color: var(--text); margin-right: 12px;
}
.topbar-title { font-size: 18px; font-weight: 700; color: var(--primary-dark); flex: 1; }
.topbar-date { color: var(--text-muted); font-size: 13px; }

.page-content { padding: 24px; flex: 1; }

/* ── Page header ── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
}
.page-header h2 { font-size: 20px; color: var(--primary-dark); }

/* =========================================================
   COMPONENTS
   ========================================================= */

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius);
  border: none; cursor: pointer; font-size: 13px; font-weight: 500;
  transition: all .15s; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover   { background: var(--primary-dark); }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover   { background: #27ae60; }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-warning:hover   { background: #e67e22; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover    { background: #c0392b; }
.btn-outline   { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline:hover   { background: var(--primary-light); }
.btn-secondary { background: #ecf0f1; color: var(--text); }
.btn-secondary:hover { background: #dfe6e9; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { padding: 6px; }

/* ── Cards ── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}
.card-header h3 { font-size: 15px; font-weight: 600; color: var(--primary-dark); }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); }

/* ── Form elements ── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 13px; }
.form-group .hint { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="email"],
select,
textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid #c5d8e8; border-radius: var(--radius);
  font-size: 13px; color: var(--text);
  background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(33,150,243,.12);
}
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }

.form-row { display: grid; gap: 12px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* ── Filters bar ── */
.filters-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  background: #fff; padding: 14px 16px;
  border-radius: var(--radius); border: 1px solid var(--border);
  margin-bottom: 16px;
}
.filters-bar .form-group { margin-bottom: 0; flex: 1; min-width: 140px; }
.filters-bar label { font-size: 12px; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--primary-light); color: var(--primary-dark);
  padding: 10px 14px; text-align: left; font-size: 12px;
  font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 2px solid var(--border);
}
tbody tr {
  border-bottom: 1px solid #eef3f7;
  transition: background .1s;
}
tbody tr:hover { background: #f8fbfe; }
tbody td { padding: 10px 14px; font-size: 13px; }
tbody tr:last-child { border-bottom: none; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-green   { background: #d4edda; color: #155724; }
.badge-yellow  { background: #fff3cd; color: #856404; }
.badge-red     { background: #f8d7da; color: #721c24; }
.badge-blue    { background: #cce5ff; color: #004085; }
.badge-gray    { background: #e9ecef; color: #495057; }
.badge-teal    { background: #d1ecf1; color: #0c5460; }

/* ── Alerts ── */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 13px; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 8px;
}
.alert-warning { background: #fff3cd; border: 1px solid #ffc107; color: #856404; }
.alert-danger  { background: #f8d7da; border: 1px solid #f5c6cb; color: #721c24; }
.alert-success { background: #d4edda; border: 1px solid #c3e6cb; color: #155724; }
.alert-info    { background: #cce5ff; border: 1px solid #b8daff; color: #004085; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px; opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: #fff; border-radius: 12px; box-shadow: var(--shadow-md);
  width: 100%; max-width: 560px; max-height: 90vh;
  display: flex; flex-direction: column;
  transform: translateY(10px); transition: transform .2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-lg { max-width: 760px; }
.modal-header {
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 16px; color: var(--primary-dark); }
.modal-close {
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--text-muted); line-height: 1; padding: 2px 6px; border-radius: 4px;
}
.modal-close:hover { background: #f0f0f0; }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ── Tabs ── */
.tabs { border-bottom: 2px solid var(--border); display: flex; gap: 2px; margin-bottom: 20px; flex-wrap: wrap; }
.tab-btn {
  padding: 10px 18px; border: none; background: none;
  cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all .15s; white-space: nowrap;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Stats cards row ── */
.stats-row { display: grid; gap: 16px; margin-bottom: 20px; }
.stats-row.cols-4 { grid-template-columns: repeat(4, 1fr); }
.stats-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.stat-card {
  background: #fff; border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
}
.stat-icon { font-size: 28px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--primary-dark); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ── Guest cards (dashboard) ── */
.guests-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.guest-card {
  background: #fff; border-radius: var(--radius);
  border: 2px solid var(--border); padding: 16px;
  cursor: pointer; transition: all .15s;
  display: flex; flex-direction: column; gap: 8px;
}
.guest-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.guest-card.has-card { border-color: #b2dfdb; background: #f0fdf9; }
.guest-card.no-card  { border-color: #ffe082; background: #fffde7; }
.guest-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.guest-name { font-weight: 600; font-size: 14px; }
.guest-room { font-size: 12px; color: var(--text-muted); }
.guest-dates { font-size: 12px; color: var(--text-muted); }
.guest-card-footer { display: flex; align-items: center; justify-content: space-between; }

/* ── Procedure calendar ── */
.proc-calendar { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.proc-day {
  min-width: 160px; flex: 0 0 160px;
  background: #fff; border-radius: var(--radius);
  border: 1px solid var(--border); padding: 10px;
}
.proc-day-header {
  font-size: 11px; font-weight: 700; color: var(--primary-dark);
  text-align: center; padding-bottom: 8px;
  border-bottom: 1px solid var(--border); margin-bottom: 8px;
}
.proc-day.today .proc-day-header {
  background: var(--primary-light); border-radius: 4px;
  color: var(--primary); padding: 4px 6px;
}
.proc-item {
  padding: 6px 8px; border-radius: 4px; margin-bottom: 6px;
  font-size: 12px; border-left: 3px solid;
  cursor: pointer; transition: opacity .1s;
}
.proc-item:hover { opacity: .85; }
.proc-item.pending  { border-color: var(--warning); background: #fff8e1; }
.proc-item.done     { border-color: var(--success); background: #f0fff4; }
.proc-item.cancelled{ border-color: #bdc3c7; background: #f8f9fa; color: var(--text-muted); }
.proc-item-name { font-weight: 500; }
.proc-item-cat  { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ── Vitals display ── */
.vitals-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.vital-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--primary-light); border-radius: 20px;
  padding: 3px 10px; font-size: 12px; color: var(--primary-dark);
}
.vital-label { font-weight: 600; }

/* ── Lab results ── */
.lab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.lab-field {
  background: var(--primary-light); border-radius: var(--radius);
  padding: 10px 12px;
}
.lab-field-name { font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
.lab-field-value { font-size: 16px; font-weight: 600; color: var(--primary-dark); }
.lab-field-unit { font-size: 11px; color: var(--text-muted); }

/* ── Note entry ── */
.note-entry {
  background: #f8fbfe; border-radius: var(--radius);
  border: 1px solid var(--border); padding: 14px 16px;
  margin-bottom: 12px;
}
.note-meta {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px; font-size: 12px; color: var(--text-muted);
}
.note-author { font-weight: 600; color: var(--primary-dark); }
.note-text { font-size: 13px; white-space: pre-wrap; }

/* ── Report tables ── */
.report-summary { display: flex; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.report-num { text-align: center; }
.report-num .num { font-size: 24px; font-weight: 700; color: var(--primary-dark); }
.report-num .lbl { font-size: 11px; color: var(--text-muted); }

/* ── Loading / empty states ── */
.loading {
  display: flex; align-items: center; justify-content: center;
  padding: 40px; color: var(--text-muted); font-size: 14px; gap: 10px;
}
.spinner {
  width: 22px; height: 22px; border: 2px solid #e0e0e0;
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center; padding: 48px 20px; color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: .4; }
.empty-state p { font-size: 14px; }

/* ── Print ── */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; }
  .tabs { display: none; }
  .tab-pane { display: block !important; }
  body { background: #fff !important; font-size: 12px; }
}

/* ── Overlay sidebar (mobile) ── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  z-index: 190;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1200px) {
  .stats-row.cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; }
  .main-content { margin-left: 0; }
  .topbar-toggle { display: block; }
  .form-row.cols-3 { grid-template-columns: 1fr 1fr; }
  .form-row.cols-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .page-content { padding: 14px; }
  .stats-row.cols-4, .stats-row.cols-3 { grid-template-columns: 1fr 1fr; }
  .form-row.cols-2, .form-row.cols-3, .form-row.cols-4 { grid-template-columns: 1fr; }
  .login-card { padding: 32px 24px; }
  .modal { max-height: 95vh; }
  .filters-bar { flex-direction: column; }
  .filters-bar .form-group { min-width: 100%; }
}

/* ── Misc utils ── */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.fw-bold { font-weight: 700; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.w-full { width: 100%; }

/* ── Med card header strip ── */
.card-status-strip {
  height: 5px; border-radius: var(--radius) var(--radius) 0 0;
}
.card-status-strip.active    { background: var(--success); }
.card-status-strip.discharged{ background: var(--text-muted); }

/* ── Timeline ── */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-dot {
  position: absolute; left: -20px; top: 3px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary); border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--primary);
}

/* ── Prescription card ── */
.rx-card {
  background: #f8fbfe; border: 1px solid #d0e4f0;
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 10px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.rx-info { flex: 1; }
.rx-name { font-weight: 600; color: var(--primary-dark); font-size: 14px; }
.rx-details { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.rx-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── Catalog item ── */
.catalog-item {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.catalog-cat { display: inline-block; background: var(--primary-light); color: var(--primary-dark);
               padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }

/* ═══ PROFESSIONAL OVERHAUL STYLES ═══ */

/* Card action bar */
.card-action-bar { background:#1e3a5f; color:#fff; padding:10px 16px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; border-radius:8px 8px 0 0; margin-bottom:0; }
.card-action-bar .btn-ghost { background:rgba(255,255,255,.15); color:#fff; border:1px solid rgba(255,255,255,.3); font-size:12px; padding:5px 12px; }
.card-action-bar .btn-ghost:hover { background:rgba(255,255,255,.28); }
.card-action-bar .btn-danger { background:#dc2626; color:#fff; border:none; font-size:12px; padding:5px 12px; }
.patient-name-badge { font-size:14px; font-weight:600; margin-left:4px; }
.card-action-bar .spacer { flex:1; min-width:8px; }

/* Patient title two-column grid */
.pt-grid { display:grid; grid-template-columns:1fr 1fr; border:1px solid var(--border); border-radius:0 0 8px 8px; overflow:hidden; margin-bottom:16px; border-top:none; }
.pt-col { padding:16px; }
.pt-col + .pt-col { border-left:1px solid var(--border); background:var(--bg2); }
.pt-col-hdr { background:#2d5a9e; color:#fff; font-size:10px; text-transform:uppercase; letter-spacing:1px; font-weight:700; padding:6px 16px; margin:-16px -16px 12px; }
.pt-field { margin-bottom:7px; display:flex; gap:6px; align-items:baseline; flex-wrap:wrap; }
.pt-label { font-size:10px; color:var(--text3); text-transform:uppercase; letter-spacing:.5px; min-width:95px; flex-shrink:0; }
.pt-value { font-size:13px; font-weight:500; }

/* Diagnosis table */
.diag-table td { font-size:13px; vertical-align:middle; }
.diag-table tr:last-child td { border-bottom:none; }
.diag-table tr:hover td { background:var(--bg2); }

/* Dashboard today banner */
.today-banner { display:flex; gap:1px; background:var(--border); border-radius:10px; overflow:hidden; margin-bottom:20px; }
.today-stat { flex:1; background:var(--bg1); padding:18px 12px; text-align:center; transition:.2s; }
.today-stat:hover { background:var(--bg2); }
.today-num { font-size:38px; font-weight:800; line-height:1; }
.today-lbl { font-size:11px; color:var(--text3); margin-top:4px; text-transform:uppercase; letter-spacing:.5px; }

/* Special notes compact chips */
.special-notes-row { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.note-chip { padding:4px 12px; border-radius:20px; font-size:12px; display:flex; align-items:center; gap:5px; font-weight:500; }
.note-chip.ok  { background:#f0fdf4; color:#16a34a; border:1px solid #bbf7d0; }
.note-chip.warn{ background:#fef2f2; color:#dc2626; border:1px solid #fecaca; }
.note-chip.info{ background:#eff6ff; color:#2563eb; border:1px solid #bfdbfe; }

/* Card detail tabs connected to action bar */
.card-detail-wrap { background:var(--bg1); border-radius:8px; overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,.08); margin-bottom:16px; }

/* ═══ MOBILE / TABLET ADAPTIVE ═══ */
@media (max-width: 768px) {
  .sidebar { width: 220px; transform: translateX(-100%); transition: transform .25s; position:fixed; z-index:100; height:100%; top:0; }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,.3); }
  .main-content { margin-left: 0 !important; padding: 8px; }
  .pt-grid { grid-template-columns: 1fr; }
  .pt-col + .pt-col { border-left: none; border-top: 1px solid var(--border); }
  .card-action-bar { border-radius: 6px; margin-bottom: 8px; padding: 8px 10px; }
  .card-action-bar .patient-name-badge { font-size:12px; max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .today-banner { flex-wrap: wrap; }
  .today-stat { min-width: 45%; }
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr !important; }
  table { font-size: 12px; }
  .page-header h2 { font-size: 16px; }
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap !important; }
  .tab-btn { white-space: nowrap; font-size: 12px; padding: 6px 10px; }
  .cabinet-proc-card { flex-direction: column; }
  .modal { max-width: 95vw !important; margin: 8px; }
  .modal-body { padding: 12px; }
}

@media (max-width: 480px) {
  .today-num { font-size: 28px; }
  .card-header { flex-direction: column; align-items: flex-start; gap: 6px; }
  .card-action-bar .btn-ghost { font-size: 11px; padding: 4px 8px; }
  .card-action-bar .spacer { display: none; }
}

/* Mobile menu toggle button */
.mobile-menu-btn {
  display: none;
  position: fixed; top: 12px; left: 12px; z-index: 200;
  background: #1e3a5f; color: #fff; border: none; border-radius: 6px;
  width: 40px; height: 40px; font-size: 18px; cursor: pointer;
  align-items: center; justify-content: center;
}
@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }
  .mobile-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.4); z-index:99; }
  .mobile-overlay.visible { display:block; }
}
