 :root{
      --primary:#09b0ff; /* sky blue */
      --secondary:#17c964; /* green */
      --bg:#f6fbff;
      --text:#0f172a;
      --muted:#6b7280;
      --card:#ffffff;
      --danger:#ef4444;
      --warning:#f59e0b;
      --radius:16px;
    }
    *{box-sizing:border-box}
    body{margin:0;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,"Helvetica Neue",Arial,sans-serif;background:var(--bg);color:var(--text)}
    header{
      background:linear-gradient(90deg,var(--primary),var(--secondary));
      color:#fff;padding:20px 24px;display:flex;gap:16px;align-items:center;justify-content:space-between;flex-wrap:wrap
    }
    header h1{margin:0;font-size:clamp(20px,2.6vw,28px)}
    .subtitle{opacity:.9;font-weight:500}
    .container{max-width:1400px;margin:24px auto;padding:0 16px}

    .grid{display:grid;gap:16px}
    @media(min-width:1100px){.grid-3{grid-template-columns:1.1fr 1fr 1fr}}
    @media(min-width:900px){.grid-2{grid-template-columns:1fr 1fr}}

    .card{background:var(--card);border-radius:var(--radius);box-shadow:0 8px 24px rgba(2,8,23,.06);padding:16px}
    .card h3{margin:0 0 12px 0;font-size:18px}

    label{display:block;font-size:12px;color:var(--muted);margin:10px 0 6px}
    input, select, textarea{width:100%;padding:10px 12px;border:1px solid #e5e7eb;border-radius:12px;background:#fff;font-size:14px;outline:none}
    textarea{min-height:80px;resize:vertical}

    .row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
    .row-3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px}

    .btn{appearance:none;border:none;border-radius:14px;padding:10px 14px;font-weight:600;cursor:pointer}
    .btn-primary{background:var(--primary);color:#fff}
    .btn-success{background:var(--secondary);color:#073b1a}
    .btn-ghost{background:#f3f4f6}
    .btn-danger{background:var(--danger);color:#fff}
    .btn-warning{background:var(--warning);color:#111827}
    .btn:disabled{opacity:.6;cursor:not-allowed}

    .toolbar{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
    .search{max-width:320px}
    .pill{display:inline-flex;align-items:center;gap:6px;background:#eef6ff;color:#055; padding:6px 10px;border-radius:999px;font-size:12px}

    .tabs{display:flex;gap:8px;margin:12px 0 4px}
    .tab{padding:10px 14px;border-radius:12px;background:#eef6ff;cursor:pointer;font-weight:600}
    .tab.active{background:#fff;border:1px solid #dbeafe}
    .tabpane.hidden{display:none}

    table{width:100%;border-collapse:separate;border-spacing:0 8px}
    thead th{font-size:12px;color:var(--muted);text-align:left;padding:0 10px}
    tbody tr{background:#fff}
    tbody td{padding:12px 10px;border-top:1px solid #e5e7eb;border-bottom:1px solid #e5e7eb}
    tbody tr td:first-child{border-left:1px solid #e5e7eb;border-top-left-radius:12px;border-bottom-left-radius:12px}
    tbody tr td:last-child{border-right:1px solid #e5e7eb;border-top-right-radius:12px;border-bottom-right-radius:12px}

    .status{font-size:12px;font-weight:700;padding:6px 10px;border-radius:999px;display:inline-block}
    .s-admitted{background:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe}
    .s-ot{background:#fff7ed;color:#9a3412;border:1px solid #fed7aa}
    .s-discharged{background:#ecfdf5;color:#065f46;border:1px solid #a7f3d0}

    /* Bed map */
    /* --- Bed Map Styling --- */
/* --- Bed Map Layout --- */
/* 🌟 Bed Map Layout */
/* 🏥 Ward Container */
.ward-section {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s ease;
}
.ward-section:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.ward-section h3 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
  border-bottom: 2px solid #f3f4f6;
  padding-bottom: 6px;
}

/* 🛏️ Bed Grid */
.bed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

/* 🛏️ Each Bed Card */
.bed {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
.bed:hover {
  transform: translateY(-3px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}
.bed h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}
.bed .meta {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

/* 🟥 Occupied / 🟩 Vacant */
.bed.occupied {
  background: #fee2e2;
  border-color: #fca5a5;
}
.bed.vacant {
  background: #dcfce7;
  border-color: #86efac;
}
.bed.occupied h4 { color: #b91c1c; }
.bed.vacant h4 { color: #065f46; }

@media (max-width: 700px) {
  .bed-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

    /* Modal */
    .modal-backdrop{position:fixed;inset:0;background:rgba(2,8,23,.6);display:none;place-items:center;z-index:40}
    .modal{background:#fff;border-radius:18px;max-width:720px;width:92%;padding:18px}
    .modal header{background:transparent;background-image:none;color:inherit;padding:0;margin:0 0 8px 0}
    .modal footer{display:flex;justify-content:flex-end;gap:10px;margin-top:12px}

    .footer{opacity:.8;font-size:12px;text-align:center;margin:24px 0}

    .backpage{background-color: #b91c1c;color: #e6e9eb; font-size: 16px; margin: 15px; border: none; border-radius: 10px;cursor: pointer;}