/* ============================================================
   MASC Care — Elderly Home Operating System
   Shared stylesheet (login + main app)
   ============================================================ */
:root{
  --navy:#0f2a47; --navy2:#163a61; --teal:#0fa3a3; --teal-d:#0b7c7c;
  --gold:#d9a43b; --bg:#eef2f6; --card:#ffffff; --ink:#1d2733; --muted:#67788a;
  --line:#e2e8f0; --green:#1f9d57; --red:#d64545; --amber:#e0902b; --blue:#2f6fed;
  --shadow:0 1px 3px rgba(15,42,71,.08),0 8px 24px rgba(15,42,71,.06);
}
*{box-sizing:border-box}
body{margin:0;font-family:'Segoe UI',system-ui,-apple-system,Roboto,Arial,sans-serif;
  background:var(--bg);color:var(--ink);font-size:14px;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}

/* ---------- Boot splash ---------- */
.boot-splash{position:fixed;inset:0;z-index:9999;background:linear-gradient(155deg,var(--navy),var(--navy2) 58%,#0b7c7c);
  color:#fff;display:flex;align-items:center;justify-content:center;padding:28px;text-align:center;
  transition:opacity .24s ease,visibility .24s ease}
.boot-panel{width:min(320px,100%);display:flex;flex-direction:column;align-items:center;gap:12px}
.boot-mark{width:72px;height:72px;border-radius:18px;background:linear-gradient(135deg,var(--teal),var(--gold));
  display:flex;align-items:center;justify-content:center;color:#08263f;font-weight:900;font-size:28px;box-shadow:0 18px 44px rgba(0,0,0,.22)}
.boot-title{font-size:22px;font-weight:800;margin-top:6px}
.boot-sub{font-size:13px;color:#cfe0f0;line-height:1.45}
.boot-bar{width:180px;height:5px;border-radius:999px;background:rgba(255,255,255,.18);overflow:hidden;margin-top:6px}
.boot-bar span{display:block;width:42%;height:100%;border-radius:999px;background:var(--gold);animation:bootSlide 1.05s ease-in-out infinite}
html.app-ready .boot-splash{opacity:0;visibility:hidden;pointer-events:none}
@keyframes bootSlide{0%{transform:translateX(-110%)}50%{transform:translateX(80%)}100%{transform:translateX(260%)}}

/* ---------- App shell ---------- */
.app{display:flex;min-height:100vh}
.sidebar{width:248px;background:linear-gradient(180deg,var(--navy),var(--navy2));
  color:#cfe0f0;display:flex;flex-direction:column;position:fixed;top:0;bottom:0;left:0;z-index:30}
.nav-backdrop{display:none}
.menu-btn{display:none;border:1px solid var(--line);background:var(--card);color:var(--navy);
  width:40px;height:40px;border-radius:9px;font-size:20px;font-weight:800;align-items:center;justify-content:center}
.brand{display:flex;align-items:center;gap:10px;padding:18px 18px 14px}
.logo{width:40px;height:40px;border-radius:11px;background:linear-gradient(135deg,var(--teal),var(--gold));
  display:flex;align-items:center;justify-content:center;font-weight:800;color:#08263f;font-size:17px;letter-spacing:.5px}
.brand h1{font-size:15px;margin:0;color:#fff;line-height:1.1}
.brand small{color:#86a4c4;font-size:11px}
.nav{padding:8px;overflow-y:auto;flex:1}
.nav .grp{font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:#6f8eb0;padding:14px 12px 6px}
.nav a{display:flex;align-items:center;gap:11px;padding:9px 12px;border-radius:9px;color:#bcd0e6;
  font-weight:500;cursor:pointer;font-size:13.5px;margin-bottom:2px;transition:.15s}
.nav a:hover{background:rgba(255,255,255,.06);color:#fff}
.nav a.active{background:var(--teal);color:#fff;box-shadow:0 3px 10px rgba(15,163,163,.4)}
.ic{width:18px;height:18px;display:inline-block;flex:0 0 auto;color:inherit;vertical-align:middle}
.ic::before{content:'';display:block;width:100%;height:100%;background:currentColor;
  -webkit-mask:var(--icon) center/contain no-repeat;mask:var(--icon) center/contain no-repeat}
.ic[data-icon="dashboard"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='8' rx='1'/%3E%3Crect x='14' y='3' width='7' height='5' rx='1'/%3E%3Crect x='14' y='12' width='7' height='9' rx='1'/%3E%3Crect x='3' y='15' width='7' height='6' rx='1'/%3E%3C/svg%3E")}
.ic[data-icon="residents"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 14c1.5-1.5 3-3.3 3-5.6A5.4 5.4 0 0 0 16.6 3c-1.3 0-2.6.5-3.6 1.4L12 5.4l-1-1A5.4 5.4 0 0 0 1.6 8.4c0 2.3 1.5 4.1 3 5.6L12 21Z'/%3E%3Cpath d='M3.5 12H8l1.5-3 2.5 6 1.5-3H20'/%3E%3C/svg%3E")}
.ic[data-icon="care"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='2' width='8' height='4' rx='1'/%3E%3Cpath d='M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-2'/%3E%3Cpath d='m9 14 2 2 4-5'/%3E%3C/svg%3E")}
.ic[data-icon="vitals"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-4l-3 8L9 4l-3 8H2'/%3E%3C/svg%3E")}
.ic[data-icon="medication"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m10.5 20.5 10-10a5 5 0 0 0-7-7l-10 10a5 5 0 0 0 7 7Z'/%3E%3Cpath d='m8.5 8.5 7 7'/%3E%3C/svg%3E")}
.ic[data-icon="incident"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.7 18.6-8.4-14.2a1.5 1.5 0 0 0-2.6 0L2.3 18.6A1.6 1.6 0 0 0 3.7 21h16.6a1.6 1.6 0 0 0 1.4-2.4Z'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E")}
.ic[data-icon="staff"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.9'/%3E%3Cpath d='M16 3.1a4 4 0 0 1 0 7.8'/%3E%3C/svg%3E")}
.ic[data-icon="rota"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4'/%3E%3Cpath d='M16 2v4'/%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3Cpath d='M8 14h.01'/%3E%3Cpath d='M12 14h.01'/%3E%3Cpath d='M16 14h.01'/%3E%3Cpath d='M8 18h.01'/%3E%3Cpath d='M12 18h.01'/%3E%3C/svg%3E")}
.ic[data-icon="finance"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2Z'/%3E%3Cpath d='M16 7V5a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v2'/%3E%3Cpath d='M18 13h.01'/%3E%3C/svg%3E")}
.ic[data-icon="compliance"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 13c0 5-3.5 7.5-7.7 8.8a1 1 0 0 1-.6 0C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.2-2.5a1.3 1.3 0 0 1 1.6 0C14.5 3.8 17 5 19 5a1 1 0 0 1 1 1Z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E")}
.ic[data-icon="comms"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a4 4 0 0 1-4 4H8l-5 3V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4Z'/%3E%3Cpath d='M8 9h8'/%3E%3Cpath d='M8 13h5'/%3E%3C/svg%3E")}
.ic[data-icon="audit"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='M9 13h6'/%3E%3Cpath d='M9 17h6'/%3E%3C/svg%3E")}
.ic[data-icon="account"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3Cpath d='M7 20c1.1-2 2.8-3 5-3s3.9 1 5 3'/%3E%3C/svg%3E")}
.ic[data-icon="menu"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6h16'/%3E%3Cpath d='M4 12h16'/%3E%3Cpath d='M4 18h16'/%3E%3C/svg%3E")}
.ic[data-icon="search"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E")}
.ic[data-icon="bell"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 21a2 2 0 0 0 3.4 0'/%3E%3Cpath d='M18 8A6 6 0 0 0 6 8c0 7-3 7-3 9h18c0-2-3-2-3-9'/%3E%3C/svg%3E")}
.ic[data-icon="plus"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14'/%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E")}
.ic[data-icon="download"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3Cpath d='M12 15V3'/%3E%3C/svg%3E")}
.ic[data-icon="printer"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9V2h12v7'/%3E%3Cpath d='M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2'/%3E%3Cpath d='M6 14h12v8H6z'/%3E%3C/svg%3E")}
.ic[data-icon="check"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m20 6-11 11-5-5'/%3E%3C/svg%3E")}
.ic[data-icon="copy"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E")}
.ic[data-icon="refresh"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6v5h-5'/%3E%3Cpath d='M4 18v-5h5'/%3E%3Cpath d='M18.5 9a7 7 0 0 0-11.8-2.6L4 9'/%3E%3Cpath d='M5.5 15a7 7 0 0 0 11.8 2.6L20 15'/%3E%3C/svg%3E")}
.ic[data-icon="edit"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E")}
.ic[data-icon="trash"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4h8v2'/%3E%3Cpath d='M19 6l-1 14H6L5 6'/%3E%3Cpath d='M10 11v5'/%3E%3Cpath d='M14 11v5'/%3E%3C/svg%3E")}
.ic[data-icon="undo"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 14 4 9l5-5'/%3E%3Cpath d='M4 9h10a6 6 0 0 1 6 6v1'/%3E%3C/svg%3E")}
.ic[data-icon="eye"]{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E")}
.nav a .ic{width:18px;height:18px}
.nav a .badge{margin-left:auto;background:var(--gold);color:#3a2a06;font-size:10px;font-weight:700;
  padding:1px 7px;border-radius:10px}
.sb-foot{padding:12px 16px;border-top:1px solid rgba(255,255,255,.08);font-size:11px;color:#7e9bbb}
.sb-foot div[style*="margin-top"]{display:none}
.logout-btn{width:100%;margin-top:12px;border:0;background:#fff;color:var(--navy);border-radius:9px;
  padding:11px 14px;font-weight:800;cursor:pointer;text-align:center}
.logout-btn:hover{background:#dcf4f4;color:var(--teal-d)}
.logout-btn.light{background:var(--red);color:#fff;margin-top:18px}
.logout-inline{background:#fbe6e6;color:#b32d2d;border-color:#f2c6c6}
.account-btn{white-space:nowrap}
.notify-btn{position:relative;width:36px;height:36px;border:1px solid var(--line);border-radius:9px;background:var(--card);
  color:var(--navy);font-size:0;font-weight:800;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto}
.notify-btn:hover{border-color:var(--teal);color:var(--teal-d)}
.notify-btn .ic{width:17px;height:17px}
.notify-badge{position:absolute;right:-6px;top:-7px;min-width:18px;height:18px;border-radius:999px;background:var(--red);
  color:#fff;font-size:10px;font-weight:800;display:flex;align-items:center;justify-content:center;padding:0 5px;border:2px solid #fff}
.main{flex:1;margin-left:248px;display:flex;flex-direction:column;min-width:0}
.topbar{background:var(--card);border-bottom:1px solid var(--line);padding:12px 26px;
  display:flex;align-items:center;gap:16px;position:sticky;top:0;z-index:20}
.topbar h2{margin:0;font-size:18px}
.topbar .sub{color:var(--muted);font-size:12px}
.search{margin-left:auto;display:flex;align-items:center;gap:8px;background:var(--bg);
  border:1px solid var(--line);border-radius:9px;padding:7px 12px;width:240px;color:var(--muted)}
.search input{border:0;background:transparent;outline:none;width:100%;font-size:13px;color:var(--ink)}
.who{display:flex;align-items:center;gap:9px}
.avatar{width:34px;height:34px;border-radius:50%;background:linear-gradient(135deg,var(--teal),var(--navy));
  color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px}
.avatar.big{width:58px;height:58px;font-size:20px;flex:0 0 auto}
.who small{display:block;color:var(--muted);font-size:11px}
.content{padding:22px 26px 60px;max-width:1280px;width:100%}

/* ---------- Generic ---------- */
.row{display:flex;gap:16px;flex-wrap:wrap}
.card{background:var(--card);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow)}
.card.pad{padding:18px}
.card h3{margin:0 0 4px;font-size:15px}
.card .ch{display:flex;align-items:center;justify-content:space-between;padding:15px 18px;border-bottom:1px solid var(--line)}
.card .ch h3{margin:0}
.grid{display:grid;gap:16px}
.kpi{flex:1;min-width:180px;padding:16px 18px;display:flex;flex-direction:column;gap:6px}
.kpi .lab{color:var(--muted);font-size:12px;font-weight:600;display:flex;align-items:center;gap:7px}
.kpi .val{font-size:27px;font-weight:800;letter-spacing:-.5px}
.kpi .delta{font-size:11.5px;font-weight:600}
.up{color:var(--green)} .down{color:var(--red)} .flat{color:var(--muted)}
.dot{width:9px;height:9px;border-radius:50%;display:inline-block}
.pill{display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:700;padding:3px 9px;border-radius:20px}
.pill .ic{width:12px;height:12px}
.pill.green{background:#e3f6ec;color:#137a42}
.pill.red{background:#fbe6e6;color:#b32d2d}
.pill.amber{background:#fdf0dc;color:#a96712}
.pill.blue{background:#e6effd;color:#244fb0}
.pill.grey{background:#eef1f5;color:#5a6b7d}
.pill.teal{background:#dcf4f4;color:#0a6e6e}
table{width:100%;border-collapse:collapse}
th{text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);
  padding:11px 16px;border-bottom:1px solid var(--line);font-weight:700;white-space:nowrap}
td{padding:12px 16px;border-bottom:1px solid var(--line);font-size:13.5px;vertical-align:middle}
tr:last-child td{border-bottom:0}
tbody tr:hover{background:#f7fafc}
.mini{font-size:11.5px;color:var(--muted)}
.btn{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--line);background:var(--card);
  color:var(--ink);padding:8px 14px;border-radius:9px;font-weight:600;font-size:13px;cursor:pointer;transition:.15s}
.btn .ic{width:15px;height:15px}
.btn:hover{border-color:var(--teal);color:var(--teal-d)}
.btn.primary{background:var(--teal);border-color:var(--teal);color:#fff}
.btn.primary:hover{background:var(--teal-d);color:#fff}
.btn.gold{background:var(--gold);border-color:var(--gold);color:#3a2a06}
.btn.ghost{background:transparent}
.btn.sm{padding:5px 10px;font-size:12px;border-radius:7px}
.actions{display:flex;gap:9px;flex-wrap:wrap;align-items:center}
.namecell{display:flex;align-items:center;gap:10px}
.rd-av{width:34px;height:34px;border-radius:9px;background:#dcefef;color:#0a6e6e;font-weight:700;
  display:flex;align-items:center;justify-content:center;font-size:12px;flex-shrink:0}
.bar{height:8px;background:#eef1f5;border-radius:6px;overflow:hidden}
.bar > i{display:block;height:100%;border-radius:6px;background:var(--teal)}
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin-bottom:18px;flex-wrap:wrap}
.tabs button{border:0;background:transparent;padding:10px 14px;font-weight:600;color:var(--muted);
  cursor:pointer;border-bottom:2px solid transparent;font-size:13.5px}
.tabs button.active{color:var(--teal-d);border-bottom-color:var(--teal)}
.sec-title{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);margin:22px 0 10px}
.empty{color:var(--muted);text-align:center;padding:26px}
.rota{overflow-x:auto}
.rota table{min-width:760px}
.shift{border-radius:7px;padding:6px 8px;font-size:11.5px;font-weight:600;line-height:1.2;margin:2px 0}
.shift.E,.shift.M{background:#dcf4f4;color:#0a6e6e}
.shift.L{background:#e6effd;color:#244fb0}
.shift.N{background:#ece4fb;color:#5b37b0}
.shift.O{background:#eef1f5;color:#8294a6}
.shift.M,.shift.N,.shift.O{border:1px solid transparent}
select.shift{min-width:72px;border:0;outline:none;cursor:pointer}
.shift small{display:block;font-weight:500;opacity:.8}
.ovl{position:fixed;inset:0;background:rgba(15,42,71,.45);display:none;align-items:flex-start;
  justify-content:center;z-index:60;padding:40px 16px;overflow-y:auto}
.ovl.show{display:flex}
.modal{background:#fff;border-radius:16px;width:560px;max-width:100%;box-shadow:0 20px 60px rgba(0,0,0,.3)}
.modal.wide{width:900px}
.modal .mh{display:flex;align-items:center;justify-content:space-between;padding:18px 22px;border-bottom:1px solid var(--line)}
.modal .mh h3{margin:0;font-size:16px}
.modal .mb{padding:20px 22px;max-height:62vh;overflow-y:auto}
.modal .mf{padding:15px 22px;border-top:1px solid var(--line);display:flex;justify-content:flex-end;gap:10px}
.x{cursor:pointer;color:var(--muted);font-size:22px;line-height:1;border:0;background:none}
.field{margin-bottom:14px}
.field label{display:block;font-size:12px;font-weight:600;color:var(--muted);margin-bottom:5px}
.field input,.field select,.field textarea{width:100%;border:1px solid var(--line);border-radius:9px;
  padding:9px 11px;font-size:13.5px;font-family:inherit;outline:none}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--teal)}
.f2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.report-section{padding-top:4px;margin-top:18px;border-top:1px solid var(--line)}
.report-section:first-of-type{margin-top:0;border-top:0}
.choice-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 16px;margin-bottom:14px}
.choice-grid label{display:flex;align-items:flex-start;gap:8px;font-size:13px;line-height:1.35;color:var(--ink)}
.choice-grid input{width:16px;height:16px;margin:1px 0 0;accent-color:var(--teal);flex:0 0 auto}
.report-summary{line-height:1.55;white-space:pre-wrap}
.chk{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;border-bottom:1px solid var(--line)}
.chk:last-child{border-bottom:0}
.chk input{margin-top:3px;width:17px;height:17px;accent-color:var(--teal)}
.chk .t{font-weight:600}
.chk .d{font-size:12px;color:var(--muted)}
.legalbox{background:#fffaf0;border:1px solid #f0e2c0;border-radius:10px;padding:12px 14px;font-size:12.5px;color:#6b5a2e}
.viewas-banner{margin-bottom:16px;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.msg{display:flex;gap:12px;padding:13px 0;border-bottom:1px solid var(--line)}
.msg:last-child{border-bottom:0}
.msg .av2{width:36px;height:36px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;
  justify-content:center;font-weight:700;color:#fff;font-size:13px}
.msg .bd{flex:1}
.msg .meta{font-size:11px;color:var(--muted)}
.composer{display:flex;gap:10px;margin-top:14px}
.composer input{flex:1;border:1px solid var(--line);border-radius:10px;padding:10px 12px;outline:none}
.notification-list{display:flex;flex-direction:column;gap:10px}
.push-control{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px;margin-bottom:14px;border:1px solid var(--line);border-radius:8px;background:#f7fafc}
.push-control-copy{display:flex;flex-direction:column;gap:3px;min-width:0}
.push-control-copy span{font-size:12px;line-height:1.4;color:var(--muted)}
.push-control .btn{flex:0 0 auto}
.notice{border:1px solid var(--line);border-radius:10px;padding:12px;background:#fff}
.notice.unread{border-color:#b8e7e7;background:#f0fbfb}
.notice-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.notice-title{font-weight:800}
.notice-body{margin-top:7px;line-height:1.45;white-space:pre-wrap}
.notice-actions{margin-top:10px;display:flex;gap:8px;flex-wrap:wrap}
.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(20px);background:var(--navy);
  color:#fff;padding:12px 20px;border-radius:11px;font-weight:600;font-size:13px;opacity:0;
  pointer-events:none;transition:.3s;z-index:90;box-shadow:0 10px 30px rgba(0,0,0,.3)}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.hide{display:none!important}
.twocol{display:grid;grid-template-columns:2fr 1fr;gap:16px}
@media(max-width:1000px){.twocol{grid-template-columns:1fr}}
.timeline{position:relative;padding-left:20px}
.timeline .ev{position:relative;padding:0 0 16px 14px;border-left:2px solid var(--line)}
.timeline .ev:last-child{border-left-color:transparent}
.timeline .ev::before{content:'';position:absolute;left:-7px;top:2px;width:12px;height:12px;
  border-radius:50%;background:var(--teal);border:2px solid #fff}
.timeline .ev .tt{font-size:11px;color:var(--muted)}
.infogrid{display:grid;grid-template-columns:1fr 1fr;gap:10px 22px}
.infogrid .k{font-size:11px;color:var(--muted);font-weight:600}
.infogrid .v{font-size:13.5px;margin-bottom:2px}
.donut{--p:0;width:120px;height:120px;border-radius:50%;
  background:conic-gradient(var(--teal) calc(var(--p)*1%),#eef1f5 0);display:flex;
  align-items:center;justify-content:center;position:relative}
.donut::after{content:attr(data-l);position:absolute;width:84px;height:84px;background:#fff;border-radius:50%;
  display:flex;align-items:center;justify-content:center;font-weight:800;font-size:20px}
.account-head{display:flex;gap:14px;align-items:center}

/* ---------- Main operational workspace ---------- */
.module-workspace{display:grid;gap:14px;min-width:0}
.module-workspace>.row,.dashboard-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(175px,1fr));gap:12px}
.module-workspace>.twocol,.dashboard-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.module-workspace>.card,.module-workspace .card{border-radius:8px;box-shadow:0 5px 16px rgba(15,42,71,.055)}
.module-workspace .card.pad{padding:16px}
.module-workspace .card .ch{min-height:58px;padding:12px 15px;background:#fff}
.module-workspace .card .ch>div{min-width:0}
.module-workspace .card .ch h3{font-size:14px}
.module-workspace .card .ch>div>span{display:block;margin-top:2px;color:var(--muted);font-size:11.5px;line-height:1.35}
.module-workspace .legalbox{border-radius:8px}
.module-workspace>.actions:first-child,.section-actionbar{min-height:50px;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:var(--card);display:flex;align-items:center;gap:9px;flex-wrap:wrap;box-shadow:0 3px 10px rgba(15,42,71,.04)}
.module-workspace .tabs{margin:0;padding:4px;border:1px solid var(--line);border-radius:8px;background:var(--card)}
.module-workspace .tabs button{border-radius:6px;border-bottom:0;min-height:35px;padding:8px 12px}
.module-workspace .tabs button.active{background:#eefafa;color:var(--teal-d)}
.module-workspace .sec-title{margin:16px 0 8px}

/* Dashboard */
.dashboard-brief{min-height:88px;padding:15px 16px;border:1px solid var(--line);border-left:4px solid var(--teal);border-radius:8px;background:var(--card);box-shadow:0 5px 16px rgba(15,42,71,.05);display:flex;justify-content:space-between;align-items:center;gap:16px}
.dashboard-brief-copy{display:flex;flex-direction:column;gap:2px}.dashboard-brief-copy>span{color:var(--teal-d);font-size:10.5px;font-weight:800;text-transform:uppercase;letter-spacing:.05em}.dashboard-brief-copy h3{margin:0;font-size:17px}.dashboard-brief-copy small{color:var(--muted);font-size:11.5px}
.dashboard-brief-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap}
.dashboard-action{min-height:35px;padding:7px 10px;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--ink);font:inherit;font-size:11.5px;font-weight:700;display:inline-flex;align-items:center;gap:6px;cursor:pointer;white-space:nowrap}
.dashboard-action .ic{width:15px;height:15px;color:var(--teal-d)}.dashboard-action:hover{border-color:var(--teal);color:var(--teal-d)}
.dashboard-metrics .kpi{min-width:0;padding:14px;border-radius:8px}.dashboard-metrics .kpi .val{font-size:25px}.dashboard-metrics .kpi .delta:empty{display:none}
.dashboard-panel{overflow:hidden}.dashboard-shift-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.dashboard-shift-grid>div{min-height:112px;padding:14px;border-right:1px solid var(--line);display:flex;flex-direction:column;align-items:flex-start;gap:6px}.dashboard-shift-grid>div:last-child{border-right:0}.dashboard-shift-grid strong{font-size:26px;line-height:1}.dashboard-shift-grid small{font-size:11px;color:var(--muted)}
.dashboard-training-body{display:flex;align-items:center;gap:18px;padding:16px}.dashboard-training-body .donut{width:96px;height:96px;flex:0 0 auto}.dashboard-training-body .donut::after{width:68px;height:68px;font-size:17px}.dashboard-training-body>div:last-child{display:flex;flex-direction:column;gap:4px}.dashboard-training-body strong{font-size:19px}.dashboard-training-body small{font-size:11.5px;color:var(--muted);line-height:1.45}
.dashboard-list{display:flex;flex-direction:column}.dashboard-list>button{min-height:58px;padding:10px 14px;border:0;border-bottom:1px solid var(--line);background:#fff;color:var(--ink);font:inherit;display:flex;align-items:center;gap:8px;text-align:left;cursor:pointer}.dashboard-list>button:last-child{border-bottom:0}.dashboard-list>button:hover{background:#f8fbfc}.dashboard-list-main{min-width:0;flex:1;display:flex;flex-direction:column;gap:2px}.dashboard-list-main strong{font-size:12.5px}.dashboard-list-main small{font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dashboard-empty{padding:24px 14px;color:var(--muted);font-size:12px;text-align:center}

/* Resident directory */
.section-actionbar{justify-content:space-between}.section-actionbar>.actions{margin-left:auto}.section-actionbar>.mini{white-space:nowrap}
.section-actionbar-search{height:35px;min-width:230px;flex:1;max-width:390px;display:flex;align-items:center;gap:7px;border:1px solid var(--line);border-radius:7px;background:#f8fafc;padding:0 10px}.section-actionbar-search .ic{width:15px;height:15px;color:var(--muted)}.section-actionbar-search input{width:100%;border:0;outline:0;background:transparent;color:var(--ink);font:inherit;font-size:12.5px}
.resident-filterbar{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:12px 14px;border:1px solid var(--line);border-radius:8px;background:#fff;box-shadow:0 3px 10px rgba(15,42,71,.04)}.resident-filterbar .field{margin:0}.resident-filterbar label{font-size:10.5px}.resident-filterbar select{height:35px;font-size:12px}.resident-filter-clear{align-self:end;justify-self:start}
.resident-directory{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:12px}.resident-directory-card{min-width:0;border:1px solid var(--line);border-radius:8px;background:#fff;box-shadow:0 4px 13px rgba(15,42,71,.045);overflow:hidden}.resident-directory-card:hover{border-color:#b8d8d9}.resident-card-head{padding:14px;display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.resident-card-head .namecell{min-width:0}.resident-card-head .namecell>div:last-child{min-width:0}.resident-card-head strong{font-size:13.5px}.resident-card-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.resident-card-meta>span{min-height:56px;padding:10px 14px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);display:flex;flex-direction:column;justify-content:center;gap:3px;min-width:0}.resident-card-meta>span:nth-child(2n){border-right:0}.resident-card-meta>span:nth-last-child(-n+2){border-bottom:0}.resident-card-meta small{font-size:10px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.04em}.resident-card-meta strong{font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.resident-card-meta .pill{width:max-content}.resident-card-actions{padding:11px 14px;display:flex;align-items:center;gap:7px;flex-wrap:wrap}.resident-directory-empty{padding:24px;border:1px dashed var(--line);border-radius:8px;text-align:center;color:var(--muted);font-size:12px}

/* Clinical, operational and governance views */
.module-care>.card:first-of-type{border-left:4px solid var(--teal)}
.module-care .twocol{grid-template-columns:minmax(0,1.4fr) minmax(300px,.85fr)}
.module-care .twocol>.card:first-child>div:last-child>div{padding-left:15px!important;padding-right:15px!important}
.module-vitals .twocol{align-items:stretch}.module-vitals .twocol>.card:first-child{border-top:3px solid var(--teal)}.module-vitals .twocol>.card:last-child{border-top:3px solid #2f6fed}.module-vitals .field textarea{min-height:92px}
.module-vitals .card:has(table),.module-mar .card,.module-rota .card,.module-finance .card:has(table),.module-audit .card:has(table),.module-hr .card:has(table),.module-account .card:has(table),.module-incidents .card:has(table){overflow-x:auto}
.module-mar>.legalbox{border-left:4px solid #5b37b0}.module-mar .card .ch{background:#fbfaff}
.module-incidents>.actions:first-child{border-left:4px solid #e0902b}.module-incidents .tabs{position:sticky;top:60px;z-index:11}.module-incidents .card .ch{background:#fffdf8}
.module-hr>.actions:first-child{border-left:4px solid #2f6fed}.module-hr .card .ch{background:#f9fbff}
.module-rota>.actions:first-child{border-left:4px solid #5b37b0}.module-rota .rota{border-top:3px solid #5b37b0}
.module-finance>.row{grid-template-columns:repeat(auto-fit,minmax(185px,1fr))}.module-finance>.twocol{grid-template-columns:minmax(0,1.45fr) minmax(290px,.85fr)}.module-finance .kpi:first-child{border-top:3px solid var(--teal)}.module-finance .kpi:last-child{border-top:3px solid #d9a43b}.module-finance .card .ch{background:#fffdf8}
.module-compliance>.card:first-child{border-left:4px solid #2f6fed}.module-compliance .chk{min-height:64px}.module-compliance .card .ch{background:#f9fbff}
.module-comms .twocol{grid-template-columns:minmax(0,1.25fr) minmax(300px,.9fr)}.module-comms .card:first-child{border-top:3px solid var(--teal)}.module-comms .card:last-child{border-top:3px solid #2f6fed}.module-comms .composer{padding-top:10px;border-top:1px solid var(--line)}
.module-audit>.card:first-child{border-left:4px solid #67788a}.module-audit>.actions{padding:0 2px}.module-audit .card .ch{background:#fafbfc}
.module-account .twocol{grid-template-columns:minmax(0,1.3fr) minmax(290px,.7fr)}.module-account .logout-btn.light{min-height:48px;margin-top:18px}.module-account .card .ch{background:#f8fbfc}

/* ---------- Owner workspace ---------- */
.owner-workspace{display:flex;flex-direction:column;gap:14px;min-width:0}
.owner-commandbar{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:2px 2px 0}
.owner-commandbar>div{display:flex;flex-direction:column;gap:2px;min-width:0}
.owner-commandbar strong{font-size:15px;color:var(--ink)}
.owner-commandbar span{font-size:11.5px;color:var(--muted)}
.owner-tabs{position:sticky;top:60px;z-index:12;display:flex;gap:4px;padding:5px;background:rgba(246,248,251,.96);border:1px solid var(--line);border-radius:10px;box-shadow:0 4px 14px rgba(15,42,71,.06);overflow-x:auto;scrollbar-width:none}
.owner-tabs::-webkit-scrollbar{display:none}
.owner-tabs button{border:0;background:transparent;color:var(--muted);border-radius:7px;min-height:38px;padding:8px 13px;display:inline-flex;align-items:center;justify-content:center;gap:7px;font:inherit;font-size:12.5px;font-weight:700;white-space:nowrap;cursor:pointer;flex:1}
.owner-tabs button .ic{width:15px;height:15px}
.owner-tabs button:hover{background:#fff;color:var(--teal-d)}
.owner-tabs button.active{background:#fff;color:var(--teal-d);box-shadow:0 1px 4px rgba(15,42,71,.12)}
.owner-view{display:grid;gap:14px;min-width:0}
.owner-metrics,.owner-account-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.owner-account-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}
.owner-metric{min-width:0;min-height:102px;padding:14px;border:1px solid var(--line);border-left:3px solid #8294a6;border-radius:8px;background:var(--card);display:flex;align-items:flex-start;gap:11px;text-align:left;color:var(--ink);font:inherit;cursor:pointer;box-shadow:0 4px 12px rgba(15,42,71,.05)}
.owner-metric:hover{border-color:#b6c7d8;transform:translateY(-1px)}
.owner-metric.amber{border-left-color:#e0902b}.owner-metric.red{border-left-color:#d94b4b}.owner-metric.teal{border-left-color:var(--teal)}.owner-metric.blue{border-left-color:#2f6fed}
.owner-metric-icon{width:31px;height:31px;border-radius:7px;background:#eef3f8;color:var(--navy);display:flex;align-items:center;justify-content:center;flex:0 0 auto}
.owner-metric-icon .ic{width:16px;height:16px}
.owner-metric-copy{display:flex;flex-direction:column;gap:1px;min-width:0}
.owner-metric-copy>span{font-size:11.5px;color:var(--muted);font-weight:700}
.owner-metric-copy strong{font-size:23px;line-height:1.15}
.owner-metric-copy small{font-size:11px;color:var(--muted);line-height:1.35;overflow-wrap:anywhere}
.owner-overview-grid{display:grid;grid-template-columns:minmax(280px,.8fr) minmax(0,1.4fr);gap:14px}
.owner-panel{overflow:hidden;border-radius:8px;min-width:0}
.owner-panel-head{min-height:60px;padding:13px 15px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:12px}
.owner-panel-head>div{min-width:0}
.owner-panel-head h3{font-size:14px;margin:0 0 2px}
.owner-panel-head>div>span{display:block;font-size:11.5px;color:var(--muted);line-height:1.35}
.owner-panel-body{padding:15px}
.owner-priority-list,.owner-note-list,.owner-account-list,.owner-record-list,.owner-sensitive-list,.owner-status-list,.owner-count-list,.owner-flag-list{display:flex;flex-direction:column;min-width:0}
.owner-priority-row{min-height:62px;padding:11px 14px;border:0;border-bottom:1px solid var(--line);background:#fff;display:grid;grid-template-columns:10px 1fr auto;align-items:center;gap:10px;text-align:left;color:var(--ink);font:inherit;cursor:pointer}
.owner-priority-row:last-child{border-bottom:0}.owner-priority-row:hover{background:#f7fafc}
.owner-priority-row>span:nth-child(2){display:flex;flex-direction:column;min-width:0}
.owner-priority-row strong{font-size:12.5px}.owner-priority-row small{font-size:11px;color:var(--muted);margin-top:2px}
.owner-priority-dot{width:8px;height:8px;border-radius:50%;background:#8294a6}.owner-priority-dot.red{background:#d94b4b}.owner-priority-dot.amber{background:#e0902b}.owner-priority-dot.green{background:#25a65a}
.owner-priority-view{font-size:11px;font-weight:700;color:var(--teal-d)}
.owner-note-row{padding:12px 14px;border-bottom:1px solid var(--line);display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:12px}
.owner-note-row:last-child{border-bottom:0}
.owner-note-main{display:flex;flex-direction:column;gap:3px;min-width:0}
.owner-note-main strong{font-size:12.5px;line-height:1.4;overflow-wrap:anywhere}
.owner-row-kicker{font-size:10px;color:var(--teal-d);font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.owner-row-actions{display:flex;align-items:center;gap:7px}
.owner-quick-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}
.owner-quick-grid button{min-height:88px;padding:14px;border:0;border-right:1px solid var(--line);background:#fff;color:var(--ink);display:flex;align-items:flex-start;gap:11px;text-align:left;font:inherit;cursor:pointer}
.owner-quick-grid button:last-child{border-right:0}.owner-quick-grid button:hover{background:#f7fafc}
.owner-quick-grid button>.ic{width:19px;height:19px;color:var(--teal-d);flex:0 0 auto}
.owner-quick-grid button>span{display:flex;flex-direction:column;gap:4px;min-width:0}.owner-quick-grid strong{font-size:12.5px}.owner-quick-grid small{font-size:11px;color:var(--muted);line-height:1.35}
.owner-panel-head-wrap{flex-wrap:wrap}
.owner-segmented{display:inline-flex!important;gap:3px;padding:3px;border:1px solid var(--line);border-radius:8px;background:var(--bg)}
.owner-segmented button{min-width:78px;height:31px;padding:5px 10px;border:0;border-radius:6px;background:transparent;color:var(--muted);font:inherit;font-size:11.5px;font-weight:700;cursor:pointer}
.owner-segmented button.active{background:#fff;color:var(--teal-d);box-shadow:0 1px 3px rgba(15,42,71,.12)}
.owner-filterbar,.owner-selectionbar,.owner-exportbar{padding:11px 14px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.owner-selectionbar{background:#f8fafc;justify-content:space-between}
.owner-selectionbar label{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:11.5px;font-weight:700}
.owner-selectionbar input,.owner-select input,.owner-switch input{accent-color:var(--teal);width:16px;height:16px}
.owner-search{height:35px;min-width:240px;flex:1;display:flex;align-items:center;gap:7px;border:1px solid var(--line);border-radius:8px;background:#fff;padding:0 10px}
.owner-search .ic{width:15px;height:15px;color:var(--muted)}
.owner-search input{width:100%;border:0;outline:0;background:transparent;color:var(--ink);font:inherit;font-size:12.5px}
.owner-record-head,.owner-record-row{display:grid;align-items:center;gap:12px;min-width:0}
.owner-record-head{padding:8px 14px;background:#f7fafc;border-bottom:1px solid var(--line);font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}
.owner-vital-head,.owner-vital-row{grid-template-columns:24px 145px 160px minmax(220px,1fr) 145px 72px}
.owner-audit-head,.owner-audit-row{grid-template-columns:24px 145px 150px 210px minmax(200px,1fr)}
.owner-record-row{padding:12px 14px;border-bottom:1px solid var(--line);font-size:12px}
.owner-record-row:last-child{border-bottom:0}.owner-record-row:hover{background:#f9fbfc}
.owner-select{align-self:start;padding-top:2px}
.owner-record-when{font-size:11px;color:var(--muted);line-height:1.4}
.owner-record-person,.owner-record-detail{display:flex;flex-direction:column;gap:3px;min-width:0}
.owner-record-person strong,.owner-record-detail strong{font-size:12px;overflow-wrap:anywhere}
.owner-record-person span,.owner-record-detail span{font-size:11px;color:var(--muted);line-height:1.4;overflow-wrap:anywhere}
.owner-record-by{font-size:11.5px;overflow-wrap:anywhere}.owner-record-action{justify-self:end}
.owner-mobile-label{display:none;font-size:9.5px!important;text-transform:uppercase;letter-spacing:.04em;font-weight:800;color:var(--muted);margin-bottom:2px}
.owner-pager{min-height:51px;padding:9px 14px;border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:10px;color:var(--muted);font-size:11.5px}
.record-pager{min-height:51px;padding:9px 14px;border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:10px;color:var(--muted);font-size:11.5px}
.btn:disabled{opacity:.45;cursor:not-allowed;pointer-events:none}
.owner-empty{padding:24px 14px;color:var(--muted);text-align:center;font-size:12px}
.owner-account-row{padding:12px 14px;border-bottom:1px solid var(--line);display:grid;grid-template-columns:minmax(190px,1.5fr) minmax(130px,1fr) auto minmax(130px,1fr);align-items:center;gap:12px;font-size:12px}
.owner-account-row:last-child{border-bottom:0}.owner-span-two{grid-column:span 2}
.owner-panel-note{padding:11px 14px;background:#fffaf0;border-top:1px solid #f0e2c0;color:#6b5a2e;font-size:11.5px;line-height:1.45}
.owner-sensitive-row{padding:12px 14px;border-bottom:1px solid var(--line);display:grid;grid-template-columns:145px 170px minmax(0,1fr);align-items:start;gap:12px}
.owner-sensitive-row:last-child{border-bottom:0}
.owner-sensitive-row .owner-record-detail{flex-direction:row;align-items:flex-start;flex-wrap:wrap}
.owner-sensitive-row .owner-record-detail span:last-child{width:100%}
.owner-danger-panel{border-color:#efc8c8}.owner-danger-panel .owner-panel-head{background:#fffafa}
.owner-danger-button{border-color:#e5a9a9!important;color:#a82929!important;background:#fff!important}
.owner-system-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.owner-status-row{padding:11px 14px;border-bottom:1px solid var(--line);display:grid;grid-template-columns:70px minmax(0,1fr);align-items:start;gap:10px}
.owner-status-row:last-child{border-bottom:0}.owner-status-row>div{display:flex;flex-direction:column;gap:2px}.owner-status-row strong{font-size:12px}.owner-status-row span{font-size:11px;color:var(--muted);line-height:1.4}
.owner-exportbar{border-top:1px solid var(--line);border-bottom:0;background:#f8fafc}
.owner-count-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
.owner-count-row{min-height:43px;padding:10px 14px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:11.5px}
.owner-count-row:nth-child(odd){border-right:1px solid var(--line)}.owner-count-row strong{font-size:14px}
.owner-flag-row{padding:12px 14px;border-bottom:1px solid var(--line);display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:14px}
.owner-flag-row:last-child{border-bottom:0}.owner-flag-row>div{display:flex;flex-direction:column;gap:3px;min-width:0}.owner-flag-row strong{font-size:12.5px}.owner-flag-row>div>span,.owner-flag-row small{font-size:11px;color:var(--muted);line-height:1.35}
.owner-switch{display:flex;align-items:center;gap:7px;font-size:11.5px;font-weight:700;color:var(--ink)}

/* ---------- Auth pages (login / landing) ---------- */
.auth-wrap{min-height:100vh;display:grid;grid-template-columns:1.1fr 1fr}
@media(max-width:860px){.auth-wrap{grid-template-columns:1fr}.auth-side{display:none}}
.auth-side{background:linear-gradient(150deg,var(--navy),var(--teal-d));color:#fff;padding:48px;display:flex;flex-direction:column;justify-content:space-between}
.auth-side .logo{width:54px;height:54px;font-size:22px;border-radius:14px}
.auth-side h2{font-size:30px;line-height:1.2;margin:24px 0 12px;max-width:420px}
.auth-side p{color:#cfe0f0;max-width:420px;line-height:1.6}
.auth-feats{display:flex;flex-direction:column;gap:14px;margin-top:26px}
.auth-feats div{display:flex;gap:12px;align-items:flex-start;color:#e7f0fa;font-size:14px}
.auth-feats .fi{width:30px;height:30px;border-radius:8px;background:rgba(255,255,255,.14);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.auth-feats .fi .ic{width:16px;height:16px}
.auth-side .foot{font-size:12px;color:#9fbad6}
.auth-main{display:flex;align-items:center;justify-content:center;padding:40px 24px}
.auth-card{width:380px;max-width:100%}
.auth-card h1{font-size:23px;margin:0 0 4px}
.auth-card .lead{color:var(--muted);margin:0 0 24px}
.auth-card .field input{padding:11px 13px}
.auth-row{display:flex;justify-content:space-between;align-items:center;margin:6px 0 18px;font-size:12.5px}
.auth-row a{color:var(--teal-d);font-weight:600}
.btn-block{width:100%;justify-content:center;padding:12px;font-size:14.5px}
.role-select{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin-bottom:16px}
.role-select label{border:1px solid var(--line);border-radius:10px;padding:10px;cursor:pointer;font-size:12.5px;font-weight:600;text-align:center;transition:.15s}
.role-select input{display:none}
.role-select input:checked + span{}
.role-select label:has(input:checked){border-color:var(--teal);background:#dcf4f4;color:var(--teal-d)}
.divider{display:flex;align-items:center;gap:12px;color:var(--muted);font-size:12px;margin:20px 0}
.divider::before,.divider::after{content:'';flex:1;height:1px;background:var(--line)}
.demo-creds{background:var(--bg);border:1px dashed var(--line);border-radius:10px;padding:12px 14px;font-size:12px;color:var(--muted);margin-top:18px;line-height:1.7}
.demo-creds code{background:#fff;border:1px solid var(--line);border-radius:5px;padding:1px 6px;color:var(--ink)}

/* ---------- Mobile app shell ---------- */
@media(max-width:900px){
  body{font-size:13px}
  .app{display:block;min-height:100vh}
  .sidebar{width:min(84vw,310px);transform:translateX(-102%);transition:transform .2s ease;box-shadow:8px 0 28px rgba(15,42,71,.22)}
  body.nav-open .sidebar{transform:translateX(0)}
  .nav-backdrop{position:fixed;inset:0;background:rgba(15,42,71,.42);z-index:25}
  body.nav-open .nav-backdrop{display:block}
  .main{margin-left:0;min-height:100vh}
  .topbar{padding:10px 12px;gap:10px;align-items:center}
  .menu-btn{display:inline-flex;flex:0 0 auto}
  .topbar h2{font-size:16px}
  .topbar .sub{font-size:11px;max-width:170px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .search{display:none}
  .who{margin-left:auto;min-width:0}
  .who .avatar{width:31px;height:31px}
  .who strong{max-width:92px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .notify-btn{width:34px;height:34px}
  .account-btn{display:none}
  .content{padding:14px 12px 48px;max-width:100%;overflow-x:hidden}
  .row{gap:10px}
  .kpi{min-width:calc(50% - 5px);padding:12px}
  .kpi .val{font-size:22px}
  .card{border-radius:10px}
  .card.pad{padding:14px}
  .card .ch{padding:12px 14px;gap:10px;align-items:flex-start;flex-direction:column}
  .card:has(table){overflow-x:auto}
  .card table{min-width:620px}
  th,td{padding:10px 12px}
  .actions{display:flex;gap:8px;overflow-x:auto;padding-bottom:3px}
  .actions .btn{white-space:nowrap}
  .infogrid{grid-template-columns:1fr}
  .f2{grid-template-columns:1fr}
  .choice-grid{grid-template-columns:1fr}
  .modal{width:100%;border-radius:12px}
  .modal .mb{max-height:70vh}
  .modal .mf{flex-wrap:wrap}
  .modal .mf .btn{flex:1;justify-content:center}
  .role-select{grid-template-columns:1fr}
  .auth-main{padding:28px 18px}
  .auth-side{display:none}
  .auth-card{width:100%}
  .account-head{align-items:flex-start}
  .module-workspace{gap:12px}
  .module-workspace>.row,.dashboard-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .module-workspace>.twocol,.dashboard-grid{grid-template-columns:1fr;gap:12px}
  .module-care .twocol,.module-finance>.twocol,.module-comms .twocol,.module-account .twocol{grid-template-columns:1fr}
  .module-workspace .card .ch{padding:12px;min-height:56px}
  .module-workspace>.actions:first-child,.section-actionbar{padding:9px 10px}
  .module-workspace .tabs{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}.module-workspace .tabs::-webkit-scrollbar{display:none}.module-workspace .tabs button{white-space:nowrap;flex:0 0 auto}
  .dashboard-brief{padding:13px;align-items:flex-start;flex-direction:column}.dashboard-brief-actions{justify-content:flex-start;width:100%;overflow-x:auto;flex-wrap:nowrap;padding-bottom:2px}.dashboard-action{flex:0 0 auto}
  .dashboard-shift-grid>div{min-height:96px;padding:12px}.dashboard-shift-grid strong{font-size:22px}.dashboard-training-body{padding:14px}
  .section-actionbar{align-items:stretch;flex-direction:column}.section-actionbar-search{max-width:none;min-width:0;width:100%}.section-actionbar>.actions{margin-left:0;overflow:visible}.section-actionbar>.actions .btn{flex:1;justify-content:center}.section-actionbar>.mini{white-space:normal}
  .resident-filterbar{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;padding:11px}.resident-filter-clear{grid-column:1/-1;justify-self:stretch}.resident-filter-clear.btn{justify-content:center}
  .resident-directory{grid-template-columns:1fr;gap:10px}.resident-card-head{padding:13px}.resident-card-meta>span{padding:9px 13px}.resident-card-actions{padding:10px 13px}
  .owner-tabs{top:55px}
  .owner-tabs button{flex:0 0 auto;min-width:88px}
  .owner-metrics,.owner-account-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .owner-metric{min-height:96px;padding:11px;gap:9px}
  .owner-overview-grid,.owner-system-grid{grid-template-columns:1fr}
  .owner-quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .owner-quick-grid button:nth-child(2){border-right:0}.owner-quick-grid button:nth-child(-n+2){border-bottom:1px solid var(--line)}
  .owner-record-head{display:none}
  .owner-record-row{margin:0;display:grid;border-radius:0;align-items:start}
  .owner-vital-row{grid-template-columns:25px minmax(0,1fr) auto;gap:8px 10px}
  .owner-vital-row .owner-select{grid-row:1 / span 4;grid-column:1}
  .owner-vital-row .owner-record-when{grid-column:2 / 4;grid-row:1}
  .owner-vital-row .owner-record-person{grid-column:2;grid-row:2}
  .owner-vital-row .owner-record-action{grid-column:3;grid-row:2;align-self:start}
  .owner-vital-row .owner-record-detail{grid-column:2 / 4;grid-row:3;padding-top:3px}
  .owner-vital-row .owner-record-by{grid-column:2 / 4;grid-row:4}
  .owner-audit-row{grid-template-columns:25px minmax(0,1fr);gap:7px 10px}
  .owner-audit-row .owner-select{grid-row:1 / span 4;grid-column:1}
  .owner-audit-row .owner-record-when,.owner-audit-row .owner-record-person,.owner-audit-row .owner-record-detail,.owner-audit-row .owner-record-by{grid-column:2}
  .owner-mobile-label{display:block}
  .owner-account-row{grid-template-columns:minmax(0,1fr) auto;gap:9px 12px;align-items:start}
  .owner-account-row>div:nth-of-type(n+2){grid-column:1 / 3}
  .owner-account-row>.owner-record-when{grid-column:1 / 3}
  .owner-account-row .owner-span-two{grid-column:1 / 3}
  .owner-sensitive-row{grid-template-columns:1fr;gap:7px}
  .owner-sensitive-row .owner-record-detail{flex-direction:column}
  .owner-note-row{grid-template-columns:minmax(0,1fr) auto;gap:9px}
  .owner-note-row .owner-row-actions{grid-column:1 / 3}
  .owner-panel-head{padding:12px}
  .owner-filterbar,.owner-selectionbar,.owner-exportbar{padding:10px 12px}
  .owner-search{min-width:0;flex:1 1 180px}
  .owner-count-list{grid-template-columns:1fr}
  .owner-count-row:nth-child(odd){border-right:0}
}

@media(max-width:520px){
  .kpi{min-width:100%}
  .topbar .sub{max-width:138px}
  .who{gap:0}
  .who .avatar,.who .user-copy{display:none}
  .btn{padding:8px 11px}
  .push-control{align-items:stretch;flex-direction:column}
  .push-control .btn{justify-content:center;width:100%}
  .land-hero{padding-top:42px}
  .module-workspace>.row,.dashboard-metrics{grid-template-columns:1fr}
  .module-dashboard .dashboard-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.module-dashboard .dashboard-metrics .kpi{min-width:0;min-height:128px;padding:12px}.module-dashboard .dashboard-metrics .kpi .val{font-size:20px;overflow-wrap:anywhere}
  .dashboard-brief-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible;padding-bottom:0}.dashboard-action{min-width:0;width:100%;justify-content:flex-start;white-space:normal}
  .dashboard-brief-copy h3{font-size:16px}.dashboard-shift-grid>div{padding:10px}.dashboard-shift-grid .pill{font-size:9.5px;padding:3px 6px}.dashboard-list>button{padding:10px 12px}
  .module-care>.card:first-of-type>div:first-child{align-items:stretch!important;flex-direction:column}.module-care>.card:first-of-type .actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible}.module-care>.card:first-of-type .actions select{grid-column:1/-1;width:100%}.module-care>.card:first-of-type .actions .btn{min-width:0;justify-content:center;white-space:normal}
  .resident-card-meta{grid-template-columns:1fr 1fr}.resident-card-actions .btn{flex:1;justify-content:center}.resident-card-actions .btn.ghost{flex:0 0 auto}
  .owner-commandbar{padding-top:0}
  .owner-commandbar .btn{width:38px;height:38px;padding:0;justify-content:center;font-size:0}
  .owner-commandbar .btn .ic{width:16px;height:16px}
  .owner-tabs{margin:0 -2px}
  .owner-tabs button{min-width:82px;padding:8px 10px}
  .owner-metric-icon{display:none}
  .owner-metric{min-height:88px}
  .owner-metric-copy strong{font-size:21px}
  .owner-quick-grid button{min-height:92px;padding:12px 10px;gap:8px}
  .owner-quick-grid button>.ic{width:17px;height:17px}
  .owner-panel-head-wrap{align-items:flex-start}
  .owner-panel-head-wrap>.pill{margin-left:0}
  .owner-selectionbar{align-items:stretch;flex-direction:column}
  .owner-selectionbar .btn{justify-content:center;width:100%}
  .owner-filterbar .owner-search{flex-basis:100%}
  .owner-filterbar .btn{flex:1;justify-content:center}
  .owner-pager{align-items:stretch;flex-direction:column}
  .owner-pager .actions{width:100%;overflow:visible}
  .owner-pager .btn{flex:1;justify-content:center}
  .record-pager{align-items:stretch;flex-direction:column}
  .record-pager .actions{width:100%;overflow:visible}
  .record-pager .btn{flex:1;justify-content:center}
  .owner-flag-row{grid-template-columns:minmax(0,1fr) auto;gap:9px}
  .owner-flag-row .owner-switch{grid-column:1 / 3}
}
.alert{background:#fbe6e6;color:#b32d2d;border-radius:9px;padding:10px 12px;font-size:12.5px;font-weight:600;margin-bottom:14px;display:none}
.alert.show{display:block}
.alert.ok{background:#e3f6ec;color:#137a42}
