/* HFaMaS shared theme: gives the account, sign-in, owner workspace, team and staff pages the same look as the landing page.
   Loaded after app.css. Palette and shapes follow assets/landing.css (ink #123452, blue #0875ed, green #008762, amber, violet). */
:root{
  --ink:#123452;--text:#24435c;--muted:#516778;--line:#dbe8f1;--bg:#f4f8fb;--white:#fff;
  --blue:#0875ed;--blue-dark:#0765b6;--blue-soft:#eef7ff;--blue-line:#1284ed;
  --green:#008762;--green-dark:#006b4e;--green-soft:#e7f6ef;
  --amber:#d47b00;--amber-soft:#fff3df;--violet:#814ad3;--violet-soft:#f2eaff;
  --red:#a8332b;--red-soft:#fdeceb;--navy:#063c62;--teal:#104c67;
}
body{font-family:Arial,Helvetica,sans-serif;background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased}
a{color:var(--blue-dark)}a:hover{color:var(--blue)}
h1,h2,h3{color:var(--ink);letter-spacing:-.4px}

/* Brand: same wordmark as the landing page */
.brand{font-size:25px;font-weight:700;letter-spacing:-1px;color:var(--navy);gap:8px}
.brand .brand-glyph{font-size:34px;font-weight:400;color:#009eae;line-height:1}
.brand .byline{background:none;border-radius:0;font-size:10px;font-weight:400;letter-spacing:0;color:var(--muted);border-left:1px solid var(--line);padding-left:10px;margin-left:6px;line-height:1.25;white-space:normal;max-width:70px}
.sidebar .brand{font-size:22px;margin:0 4px}
.sidebar .brand .brand-glyph{font-size:30px}

/* Buttons: pills */
.button,button.primary,button.secondary,.primary,.secondary{border-radius:30px;padding:12px 22px;font-size:13px;font-weight:600;transition:background .2s,transform .2s,box-shadow .2s}
.primary{background:var(--blue);border-color:var(--blue);color:#fff}
.primary:hover{background:var(--blue-dark);border-color:var(--blue-dark);color:#fff;box-shadow:0 8px 20px rgba(8,117,237,.25)}
.secondary{background:var(--blue-soft);border-color:var(--blue-line);color:var(--blue-dark)}
.secondary:hover{background:#dcefff;color:var(--blue-dark)}
.text-button{color:var(--blue-dark)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid rgba(8,117,237,.35);outline-offset:2px}
button:disabled{opacity:.6}

/* Public pages (sign in, sign up, reset, confirm) */
body:has(.landing.auth-only),body:has(.public-header){background:linear-gradient(180deg,#eef7ff 0,#fff 420px)}
.public-header{background:transparent;border-bottom:0;padding:24px 28px;max-width:1170px}
.public-header>a:not(.brand){color:var(--blue-dark);font-weight:700;font-size:13px;border:1px solid var(--blue-line);background:var(--blue-soft);border-radius:30px;padding:11px 20px}
.landing.auth-only{max-width:500px;margin:26px auto 60px;padding:0 20px}
.auth{border-radius:24px;padding:38px;box-shadow:0 24px 60px rgba(18,52,82,.10);border:1px solid #cfe3f3}
.auth h2{font-size:34px;font-weight:500;letter-spacing:-1.4px;margin:14px 0 6px;color:var(--ink)}
.auth>p{color:var(--muted);font-size:14px}
.eyebrow{display:inline-block;background:var(--green-soft);color:var(--green);padding:7px 13px;border-radius:999px;font-size:10px;font-weight:700;letter-spacing:1.4px}
.eyebrow:before{content:"";display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--green);margin-right:8px;vertical-align:1px}
.auth .primary.wide{width:100%;margin-top:6px;padding:15px 22px}
.hint{color:var(--muted)}

/* Forms */
label{color:var(--ink)}
input,select,textarea{border:1px solid #c9dcea;border-radius:12px;padding:13px 14px;background:#fff;color:var(--ink)}
input:focus,select:focus,textarea:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(8,117,237,.15);outline:0}
input::placeholder{color:#8aa0b2}
.facility-type{border-radius:14px;border-color:var(--line)}
.facility-type:has(input:checked){background:var(--blue-soft);border-color:var(--blue)}
.facility-types legend{color:var(--ink)}

/* Cards and layout */
.card{border:1px solid var(--line);border-radius:20px;box-shadow:0 10px 30px rgba(18,52,82,.05)}
.topbar{background:#fff;border-bottom:1px solid var(--line);color:var(--muted)}
.profile b{background:linear-gradient(135deg,var(--blue),#009eae);color:#fff}
.page-title h1{font-size:34px;font-weight:500;letter-spacing:-1.4px;color:var(--ink)}
.page-title p{color:var(--muted)}
.section-title h2{color:var(--ink)}
.section-title a{color:var(--blue-dark)}
.empty>span{color:var(--blue)}

/* Sidebar */
.sidebar{background:#fff;border-right:1px solid var(--line)}
.organisation{border-color:var(--line)}
.avatar{background:linear-gradient(135deg,#eaf3ff,#def7f3);color:var(--teal)}
.nav-label{color:#7a93a8}
nav a{color:var(--muted);border-radius:12px;font-weight:600}
nav a:hover{background:var(--blue-soft);color:var(--blue-dark)}
nav a.active{background:var(--blue-soft);color:var(--blue-dark);box-shadow:inset 3px 0 0 var(--blue)}
.rate{background:linear-gradient(135deg,#eef7ff,#e7f6ef);border-color:#cfe3f3;border-radius:14px;color:var(--muted)}
.rate strong{color:var(--teal)}

/* Metrics: one accent colour each, like the landing page's department cards */
.metric{border-radius:18px;border:1px solid var(--line);border-top:4px solid var(--blue);box-shadow:0 8px 24px rgba(18,52,82,.05)}
.metric:nth-child(2){border-top-color:var(--green)}
.metric:nth-child(3){border-top-color:var(--amber)}
.metric:nth-child(4){border-top-color:var(--violet)}
.metric span{color:var(--muted)}
.metric strong{color:var(--ink)}
.metric.balance{background:linear-gradient(135deg,#0875ed,#104c67);border-color:transparent;color:#fff}
.metric.balance span,.metric.balance small,.metric.balance a{color:#d9ecff}
.metric.balance strong{color:#fff}

/* Tables, pills, status, alerts */
th{background:#f4f8fb;color:#5f7a90;border-color:var(--line)}
td{border-color:#e9f1f7}
.pill{background:var(--blue-soft);color:var(--blue-dark)}
.status,.status-ready{background:var(--green-soft);color:var(--green)}
.status-failed{background:var(--red-soft);color:var(--red)}
.status-provisioning,.status-pending{background:var(--amber-soft);color:#a65a00}
.hospital{border-radius:18px}
.hospital-icon{background:var(--blue-soft);color:var(--blue-dark);border-radius:12px}
.alert{background:var(--green-soft);border-color:#bfe6d4;color:#0b6b4d;border-radius:14px}
.alert.error{background:var(--red-soft);border-color:#f5cfc7;color:var(--red)}
.alert a{color:inherit;text-decoration:underline}
.payment-row,.table-wrap{border-color:var(--line)}

/* Team screen extras */
.ops-account{background:#f4f8fb;border:1px solid #e3edf4;border-radius:14px}
.ops-facility{border-top-color:#e3edf4}
.workspace.ops .topbar .brand{color:var(--navy)}

/* Setup progress dialog */
.setup-progress{border-radius:24px}
.setup-progress-track span{background:linear-gradient(90deg,var(--blue),#009eae)}

footer{color:var(--muted)}

@media(max-width:720px){
  .brand{font-size:21px}.brand .brand-glyph{font-size:28px}.brand .byline{display:none}
  .public-header{padding:16px 18px}.public-header>a:not(.brand){padding:9px 14px;font-size:12px}
  .auth{padding:26px 22px;border-radius:20px}.auth h2{font-size:28px}
  .page-title h1{font-size:28px}
}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}

/* Team lead chat screen */
.chat-metrics{grid-template-columns:repeat(3,1fr)}
.chats{display:grid;grid-template-columns:340px 1fr;gap:0;background:#fff;border:1px solid var(--line);border-radius:20px;overflow:hidden;min-height:560px;box-shadow:0 10px 30px rgba(18,52,82,.05)}
.chat-list{border-right:1px solid var(--line);display:flex;flex-direction:column;max-height:720px}
.chat-search{padding:14px 14px 6px}.chat-search input{margin:0;padding:11px 14px;border-radius:30px;background:#f4f8fb}
.chat-filters{display:flex;gap:6px;padding:6px 14px 10px;flex-wrap:wrap}.chat-filters a{font-size:11px;font-weight:700;color:var(--muted);padding:6px 12px;border-radius:30px;border:1px solid var(--line)}
.chat-filters a.active{background:var(--blue-soft);color:var(--blue-dark);border-color:var(--blue-line)}
.thread-items{overflow-y:auto;flex:1}
.thread{display:flex;gap:11px;align-items:flex-start;padding:13px 14px;border-top:1px solid #edf3f8;color:var(--ink)}
.thread:hover{background:#f7fbff}.thread.active{background:var(--blue-soft);box-shadow:inset 3px 0 0 var(--blue)}
.avatar-s{display:grid;place-items:center;min-width:36px;height:36px;border-radius:50%;background:linear-gradient(135deg,#eaf3ff,#def7f3);color:var(--teal);font-weight:700}
.thread-main{display:flex;flex-direction:column;min-width:0;flex:1}.thread-main strong{font-size:13px}.thread-main small{font-size:11px;color:var(--muted)}
.thread-main em{font-style:normal;font-size:12px;color:#5f7a90;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}
.thread-meta{display:flex;flex-direction:column;align-items:flex-end;gap:5px;font-size:10px;color:var(--muted)}
.flag{background:var(--amber-soft);color:#a65a00;border-radius:20px;padding:2px 8px;font-size:9px}
.chat-empty{padding:18px}
.chat-view{display:flex;flex-direction:column;background:#f4f8fb;min-width:0}
.chat-placeholder{margin:auto;text-align:center;color:var(--muted);padding:40px}
.chat-head{display:flex;gap:14px;align-items:center;justify-content:space-between;padding:14px 18px;background:#fff;border-bottom:1px solid var(--line)}
.chat-head div{display:flex;flex-direction:column;min-width:0;flex:1}.chat-head small{color:var(--muted);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-head .back{display:none;font-size:12px;font-weight:700}
.chat-context{display:flex;gap:6px;flex-wrap:wrap;padding:10px 18px;background:#fff;border-bottom:1px solid var(--line)}
.chip{font-size:11px;background:var(--blue-soft);color:var(--blue-dark);border-radius:30px;padding:4px 10px}.chip.warn{background:var(--amber-soft);color:#a65a00}
.chat-messages{flex:1;overflow-y:auto;padding:18px;max-height:560px;display:flex;flex-direction:column;gap:10px}
.earlier{align-self:center;font-size:12px;font-weight:700}
.day{align-self:center;font-size:10px;color:var(--muted);background:#e6eef5;border-radius:20px;padding:3px 12px;margin:6px 0}
.msg{max-width:78%;display:flex;flex-direction:column;gap:3px}
.msg .who{font-size:10px;color:var(--muted);font-weight:700;letter-spacing:.4px}.msg time{font-size:10px;color:#8aa0b2;align-self:flex-end}
.bubble{white-space:pre-wrap;word-wrap:break-word;overflow-wrap:anywhere;padding:10px 14px;border-radius:16px;font-size:13px;line-height:1.45}
.msg.client{align-self:flex-start}.msg.client .bubble{background:#fff;border:1px solid var(--line);border-top-left-radius:4px;color:var(--ink)}
.msg.bot{align-self:flex-end;align-items:flex-end}.msg.bot .bubble{background:var(--blue);color:#fff;border-top-right-radius:4px}
.msg.human{align-self:flex-end;align-items:flex-end}.msg.human .bubble{background:var(--green);color:#fff;border-top-right-radius:4px}
.msg.system{align-self:center;max-width:92%;align-items:center}.msg.system .bubble{background:var(--amber-soft);color:#7a4a00;font-size:12px;border-radius:12px}
.msg.tool{align-self:center;max-width:92%;align-items:center}.msg.tool .bubble{background:#e8eff5;color:#35566f;font:11px/1.4 Consolas,Menlo,monospace;border-radius:10px}
.chat-foot{padding:10px 18px;font-size:11px;color:var(--muted);background:#fff;border-top:1px solid var(--line)}
@media(max-width:900px){
  .chat-metrics{grid-template-columns:1fr}
  .chats{grid-template-columns:1fr;min-height:0}.chats.has-open .chat-list{display:none}.chats:not(.has-open) .chat-view{display:none}
  .chat-head .back{display:inline}.chat-head{flex-wrap:wrap}.msg{max-width:90%}
}
