/* Robust clinic app: shared look.
   The tokens and components down to "components from the previews" are copied from rb-ops
   design/preview/common.css, the binding design standard (AGENTS.md, "Design standard"). Change the look
   there first, then here. Everything after that block is built from the same tokens. */

/* ---------------------------------------------------------------- tokens (from the previews) */
:root{
  /* owner's refinements 2026-11-18: page 10% darker; text and greys about 20% darker; surfaces a little
     darker; buttons about 5% darker (--btn). The previews used: page #d8d8d5, canvas #f4f3ef, card #f9f8f5,
     line #ebe9e3, ink2 #5d5d63, ink3 #9a9a9f. */
  --page:#c2c2bf; --canvas:#f3f2ee; --card:#f8f7f4; --white:#fdfcfa; --line:#e3e0d9; --btn:#f6f4f0;
  /* 2026-11-18 later: the front layer was made 40% brighter again (an active sports centre) */
  --hover:#fde3db; --hover-ink:#c43f22; --outline:#f2b9aa;
  --ink:#111113; --ink2:#4a4a4f; --ink3:#7b7b80;
  --coral:#ef5a3a; --coral-soft:#fde7df; --coral-ink:#d9482a;
  --green:#2fb163; --green-soft:#e0f4e7; --blue:#4c86f0; --blue-soft:#e4edfd;
  --violet:#8a63e6; --violet-soft:#ece5fb; --amber:#e9a13b; --amber-soft:#fbeed6;
  --grey:#8b8b90; --grey-soft:#efeeea;
  --shadow:0 1px 2px rgba(20,20,20,.04),0 8px 24px rgba(20,20,20,.05);
}
*{box-sizing:border-box;margin:0;padding:0}
/* the page colour underneath the gradient, so the frame stays grey however long the page is (owner, 2026-11-18) */
html{-webkit-text-size-adjust:100%;background:var(--page)}
body{display:flow-root;font-family:'Red Hat Display',-apple-system,BlinkMacSystemFont,system-ui,sans-serif;color:var(--ink);font-size:15px;font-weight:525;min-height:100vh;
  background:radial-gradient(1200px 900px at 30% 20%,#cfcfcc,var(--page)) fixed;-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit;color:inherit}
button{background:none;border:0;cursor:pointer}
a{color:inherit;text-decoration:none}

/* The app sits on a large rounded canvas, as in the previews (1736 x 1256 at 92 px on a 1920 screen). */
.app{position:relative;margin:24px auto;width:calc(100% - 48px);max-width:1872px;min-height:calc(100vh - 48px);border-radius:12px;
  /* a soft colour wash from the top, the way Spotify tints a page from its main colour (owner, 2026-11-18) */
  background:radial-gradient(900px 420px at 12% -6%, rgba(239,90,58,.16), transparent 70%), radial-gradient(800px 380px at 88% -8%, rgba(138,99,230,.12), transparent 70%), linear-gradient(180deg, #f8e9e3 0, var(--canvas) 460px);
  box-shadow:0 0 0 3px rgba(255,255,255,.75),0 40px 80px rgba(0,0,0,.14);padding:28px 54px 40px}

/* ---------------------------------------------------------------- components from the previews */
.top{display:flex;align-items:center;justify-content:space-between;height:48px;margin-bottom:34px;gap:16px}
.logo{display:flex;align-items:center}.logo img{height:46px;width:auto;display:block}
.search{width:400px;height:46px;background:var(--white);border-radius:8px;box-shadow:var(--shadow);display:flex;align-items:center;padding:0 5px;gap:10px;color:var(--ink3);font-size:13.5px;cursor:text}
.search .dot{flex:none;width:36px;height:36px;border-radius:50%;background:var(--coral);display:grid;place-items:center;color:#fff}
.search span{flex:1;white-space:nowrap;overflow:hidden;text-align:left}.search kbd{font:630 10px 'Red Hat Display';background:#f0efeb;border-radius:6px;padding:3px 6px;color:var(--ink3)}
.tools{display:flex;gap:12px;align-items:center}
.tools .rb{width:51px;height:51px}   /* 10% larger (owner, 2026-11-18) */
.prof{display:flex;flex-direction:column;align-items:center;text-align:center;padding:14px 12px 10px}
.rb{width:46px;height:46px;border-radius:50%;background:var(--btn);box-shadow:var(--shadow);display:grid;place-items:center;flex:none;position:relative}
.card{background:var(--card);border-radius:8px;box-shadow:var(--shadow);border:1px solid rgba(255,255,255,.9);padding:22px}
.w{background:var(--white);border-radius:8px;box-shadow:0 1px 2px rgba(20,20,20,.04),0 4px 14px rgba(20,20,20,.04)}
h1{font-size:28px;font-weight:630;letter-spacing:-.5px}h2{font-size:19px;font-weight:630;letter-spacing:-.2px}h3{font-size:16px;font-weight:630}
.sub{color:var(--ink2);font-size:14.5px;margin-top:5px;font-weight:525}
.mut{color:var(--ink3)}.sm{font-size:12px}.xs{font-size:11px}
.row{display:flex;align-items:center}.sp{justify-content:space-between}.gap{gap:10px}.col{display:flex;flex-direction:column}
.btn{height:42px;padding:0 18px;border-radius:8px;background:var(--btn);box-shadow:var(--shadow);display:inline-flex;align-items:center;gap:8px;font-weight:630;font-size:13.5px;white-space:nowrap;cursor:pointer}
.btn.k{background:#0b0b0d;color:#fff}.btn.s{height:32px;padding:0 14px;font-size:12px}
.pill{display:inline-flex;align-items:center;height:22px;padding:0 9px;border-radius:8px;font-size:11px;font-weight:735;white-space:nowrap}
.p-c{background:var(--coral-soft);color:var(--coral-ink)}.p-g{background:var(--green-soft);color:#1f9550}.p-b{background:var(--blue-soft);color:#3a6fd6}
.p-v{background:var(--violet-soft);color:#7248d6}.p-a{background:var(--amber-soft);color:#c47f12}.p-n{background:#efeeea;color:var(--ink2)}
.av{border-radius:50%;display:grid;place-items:center;font-weight:735;flex:none;letter-spacing:.2px}
/* Icons in the style of Apple's app icons (owner, 2026-11-18): rounded gradient tiles, white symbols */
.tile{display:grid;place-items:center;flex:none;position:relative;overflow:hidden;background:linear-gradient(165deg,var(--t1),var(--t2));color:var(--t2);
  box-shadow:0 1px 1.5px rgba(0,0,0,.10),0 6px 14px -6px var(--t2),inset 0 1px 0 rgba(255,255,255,.38)}
.tile::before{content:'';position:absolute;inset:0;background:linear-gradient(180deg,rgba(255,255,255,.24),rgba(255,255,255,0) 55%);pointer-events:none}
.tile svg{position:relative;filter:drop-shadow(0 1px 1px rgba(0,0,0,.14))}
.t-dashboard{--t1:#6aa1ff;--t2:#3f63f2}.t-appointments{--t1:#ff8a6a;--t2:#ec4b2a}.t-front-desk{--t1:#ffc35e;--t2:#f08d16}
.t-patients{--t1:#4fd8b2;--t2:#0f9f7b}.t-billing{--t1:#63b2ff;--t2:#2d70ea}.t-reports{--t1:#b597ff;--t2:#7647df}
.t-accounts{--t1:#5ddc88;--t2:#1ea34c}.t-hr{--t1:#ff92ba;--t2:#de4279}.t-leads{--t1:#4fd3f0;--t2:#1590c6}.t-chat{--t1:#5ee08a;--t2:#16a34a}.t-settings{--t1:#a7a7b0;--t2:#5d5d66}
#view h1{display:flex;align-items:center;gap:12px}
.ic{width:38px;height:38px;border-radius:28%;display:grid;place-items:center;flex:none;box-shadow:0 1px 1px rgba(0,0,0,.08),inset 0 1px 0 rgba(255,255,255,.35)}
.ic.c{background:linear-gradient(165deg,#ff8a6a,#ec4b2a);color:#fff}.ic.b{background:linear-gradient(165deg,#63b2ff,#2d70ea);color:#fff}.ic.v{background:linear-gradient(165deg,#b597ff,#7647df);color:#fff}.ic.g{background:linear-gradient(165deg,#5ddc88,#1ea34c);color:#fff}.ic.a{background:linear-gradient(165deg,#ffc35e,#f08d16);color:#fff}
svg{display:block}
.up{color:var(--green);font-size:12px;font-weight:735}.dn{color:var(--green);font-size:12px;font-weight:735}
.num{font-size:27px;font-weight:630;letter-spacing:-.6px}
/* previous / next arrows: a 40px round target (owner, 2026-11-18) */
/* summary tiles: larger labels and figures (owner, 2026-11-18) */
.kp5 .card .sm,.kt .sm,.kl{font-size:15px!important;color:var(--ink2)!important;font-weight:630}
.kp5 .num,.kt .num,.acc-kpi .num{font-size:33px!important;margin:8px 0 4px}
.acc-kpi{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-top:20px}.acc-kpi .card{padding:20px 22px}
.acc-lay{display:grid;grid-template-columns:1fr 420px;gap:20px;margin-top:20px;align-items:start}
.tbl.pl tr.sec td{font-size:11px;text-transform:uppercase;letter-spacing:.5px;color:var(--ink3);font-weight:735;padding-top:20px;border-top:0}
.tbl.pl tr.tot td{border-top:1.5px solid #c9c7c0}.tbl.pl tr.net td{border-top:2px solid var(--ink);font-size:15px}
@media (max-width:1200px){.acc-kpi{grid-template-columns:1fr 1fr}.acc-lay{grid-template-columns:1fr}}
.stepper{padding:0 4px!important;gap:2px}
.rangep{gap:8px;padding:0 6px 0 12px!important}.rangep input{border:0;background:none;font:inherit;color:inherit;outline:0;width:128px}.rangep .btn{height:32px;box-shadow:none}
.step{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;flex:none;color:var(--ink)}
.step:hover{background:var(--hover);color:var(--hover-ink)}
.bar{height:5px;border-radius:3px;background:#ecebe6;overflow:hidden}.bar i{display:block;height:100%;border-radius:3px}

/* ---------------------------------------------------------------- app additions, same tokens */
.btn:hover{box-shadow:0 1px 2px rgba(20,20,20,.06),0 10px 26px rgba(20,20,20,.09)}
.btn.k:hover{background:#2a2a2f}
.btn[disabled],.btn.off{opacity:.45;pointer-events:none}
.btn.danger{color:var(--coral-ink)}
.rb:hover,.search:hover{box-shadow:0 1px 2px rgba(20,20,20,.06),0 10px 26px rgba(20,20,20,.09)}
.dn.bad,.up.bad{color:var(--coral-ink)}
.link{cursor:pointer}.link:hover{color:var(--ink)}
.clickable{cursor:pointer;transition:box-shadow .15s}.clickable:hover{box-shadow:0 1px 2px rgba(20,20,20,.06),0 10px 26px rgba(20,20,20,.08)}
:focus-visible{outline:2.5px solid var(--coral);outline-offset:2px}
.badge{position:absolute;top:6px;right:6px;min-width:17px;height:17px;padding:0 5px;border-radius:8px;background:var(--coral);color:#fff;font-size:10px;font-weight:735;display:grid;place-items:center}
.seg{display:inline-flex;align-items:center;height:42px;padding:0 5px;gap:2px;border-radius:8px;background:var(--btn);box-shadow:var(--shadow)}
.seg button{height:34px;padding:0 14px;border-radius:8px;font-size:13.5px;font-weight:630;color:var(--ink2);white-space:nowrap}
.seg button.on{background:var(--ink);color:#fff;font-size:13px}
.seg button:not(.on):hover{color:var(--ink)}
.empty{padding:26px 10px;text-align:center;color:var(--ink3);font-size:13.5px;line-height:1.55}
.skel{background:linear-gradient(90deg,#efeee9,#f7f6f2,#efeee9);background-size:200% 100%;animation:sk 1.2s infinite;border-radius:8px}
@keyframes sk{to{background-position:-200% 0}}

/* Navigation launcher (the grid button) and other pop-overs */
.pop{position:absolute;z-index:40;background:var(--card);border-radius:8px;box-shadow:0 1px 2px rgba(20,20,20,.06),0 24px 60px rgba(20,20,20,.16);border:1px solid rgba(255,255,255,.9);padding:16px}
.launch{width:344px;display:grid;grid-template-columns:repeat(3,1fr);gap:6px}   /* 20% smaller (owner, 2026-11-18) */
.pop:has(> .launch){padding:12px}
.launch a{display:flex;flex-direction:column;align-items:center;gap:8px;padding:12px 6px 11px;border-radius:10px;font-size:12px;font-weight:630;text-align:center}
.launch a:hover,.launch a.on{background:var(--white);box-shadow:0 1px 2px rgba(20,20,20,.04),0 4px 14px rgba(20,20,20,.05)}
.launch .tile{transition:transform .15s ease}.launch a:hover .tile{transform:translateY(-1px) scale(1.04)}
.menu{min-width:220px;padding:8px}
.menu button,.menu a{display:flex;width:100%;align-items:center;gap:10px;height:40px;padding:0 12px;border-radius:8px;font-size:13.5px;font-weight:630;text-align:left}
.menu button:hover,.menu a:hover{background:var(--white)}
.menu hr{border:0;border-top:1px solid var(--line);margin:6px 4px}

/* Search palette */
.veil{position:fixed;inset:0;z-index:60;background:rgba(30,30,32,.28);backdrop-filter:blur(2px);display:flex;align-items:flex-start;justify-content:center;padding:9vh 16px 16px;overflow:auto}
.palette{width:620px;max-width:100%;padding:12px}
.palette .search{width:100%;box-shadow:none;background:var(--white)}
.palette input{flex:1;border:0;outline:0;background:none;font-size:15px;color:var(--ink);min-width:0}
.hits{margin-top:8px;max-height:56vh;overflow:auto}
.hit{display:flex;align-items:center;gap:12px;padding:9px 12px;border-radius:8px;cursor:pointer}
.hit.on,.hit:hover{background:var(--white)}
.hit small{display:block;color:var(--ink3);font-size:11.5px;margin-top:2px}

/* Dialogs */
.sheet{width:560px;max-width:100%;padding:24px 26px 22px;border-radius:8px}
.sheet.wide{width:860px}.sheet.xwide{width:1120px}
.sheet .hd{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}
.sheet .ft{display:flex;justify-content:flex-end;gap:10px;margin-top:22px;flex-wrap:wrap}
.sheet .ft .grow{flex:1}

/* Form fields */
[hidden]{display:none!important}
.fields{display:grid;grid-template-columns:1fr 1fr;gap:14px 16px}
.fields .full{grid-column:1/-1}
.fld{display:flex;flex-direction:column;gap:6px;min-width:0}
.fld>span{font-size:12px;font-weight:630;color:var(--ink2)}
.fld>span em{font-style:normal;color:var(--coral)}
.in{height:44px;border-radius:8px;background:var(--white);border:1px solid #e6e4de;padding:0 14px;font-size:14px;font-weight:525;outline:0;width:100%;
  transition:border-color .15s, box-shadow .15s}
textarea.in{height:auto;min-height:92px;padding:12px 14px;line-height:1.5;resize:vertical}
select.in{appearance:none;padding-right:34px;background:var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239a9a9f' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center}
.in:focus{border-color:var(--ink3);box-shadow:0 0 0 4px rgba(23,23,26,.05)}
.in[aria-invalid=true]{border-color:var(--coral)}
.hint{font-size:11.5px;color:var(--ink3);line-height:1.45}
.err{font-size:12px;color:var(--coral-ink);font-weight:630}
.chk{display:flex;align-items:center;gap:10px;font-size:14px;cursor:pointer;min-height:30px}
.chk input{appearance:none;width:22px;height:22px;border-radius:7px;border:2px solid #d6d4ce;background:var(--white);display:grid;place-items:center;flex:none;cursor:pointer}
.chk input:checked{background:var(--ink);border-color:var(--ink)}
.chk input:checked::after{content:"";width:10px;height:6px;border:2.5px solid #fff;border-top:0;border-right:0;transform:rotate(-45deg) translate(1px,-1px)}
.chk input[type=radio]{border-radius:50%}

/* Tables (lists of invoices, staff, settings) */
.tbl{width:100%;border-collapse:collapse;font-size:13.5px}
.tbl th{font-size:11px;font-weight:735;color:var(--ink3);text-align:left;padding:0 12px 10px;letter-spacing:.3px;text-transform:uppercase}
.tbl td{padding:12px;border-top:1px solid var(--line);vertical-align:middle}
.tbl tr.clickable:hover td{background:var(--white)}
.tbl td.r,.tbl th.r{text-align:right}
.scroll{overflow:auto}

/* Signature pad */
.sig{position:relative;height:190px;border-radius:8px;background:var(--white);border:1.5px dashed #d8d6cf;touch-action:none}
.sig canvas{position:absolute;inset:0;width:100%;height:100%;border-radius:8px;cursor:crosshair}
.sig .lbl{position:absolute;left:18px;bottom:14px;font-size:11px;color:var(--ink3);pointer-events:none}
.sig .line{position:absolute;left:18px;right:18px;bottom:36px;border-top:1.5px solid #e2e0da;pointer-events:none}
.sig img{display:block;width:100%;height:100%;object-fit:contain}

/* Buttons: light-red outline; light-red highlight on hover (owner, 2026-11-18) */
.btn,.seg,.rb,.mapctl>button,.mapctl .grp{border:1px solid var(--outline)}
.btn:hover,.rb:hover,.mapctl button:hover{background:var(--hover);color:var(--hover-ink);border-color:var(--coral)}
.btn.k:hover{background:var(--coral);color:#fff;border-color:var(--coral)}
.seg button:not(.on):hover{background:var(--hover);color:var(--hover-ink)}
.seg button.on:hover{background:var(--coral)}
.btn button:hover,[data-step]:hover,[data-month]:hover,[data-day]:hover{color:var(--hover-ink)}
.link:hover,a.link:hover,.sm.mut.link:hover{color:var(--hover-ink);text-decoration:underline}
.chk:hover input{border-color:var(--coral)}
.chk:hover{color:var(--hover-ink)}
.launch a:hover{background:var(--hover);color:var(--hover-ink)}
.menu button:hover,.menu a:hover,.hit:hover,.hit.on{background:var(--hover);color:var(--hover-ink)}
.mapctl .grp button+button{border-top-color:var(--outline)}

/* 3D body map: map-style controls (Google Maps / Apple Maps) */
.mapctl{position:absolute;right:14px;bottom:14px;display:flex;flex-direction:column;gap:8px;align-items:flex-end}
.mapctl>button,.mapctl .grp{background:var(--white);box-shadow:var(--shadow);border-radius:8px}
.mapctl>button{width:40px;height:40px;display:grid;place-items:center}
.mapctl .grp{display:flex;flex-direction:column;overflow:hidden}
.mapctl .grp button{width:40px;height:38px;display:grid;place-items:center}
.mapctl .grp button+button{border-top:1px solid var(--line)}
.mapctl button:hover{background:var(--btn)}
.mapctl [data-needle]{transition:transform .12s linear}
:fullscreen{background:var(--canvas)}

/* Toasts */
.toasts{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);z-index:80;display:flex;flex-direction:column;gap:8px;align-items:center}
.toast{background:var(--ink);color:#fff;border-radius:8px;padding:12px 20px;font-size:13.5px;font-weight:630;box-shadow:0 16px 40px rgba(0,0,0,.2);max-width:520px;animation:up .2s}
.toast.bad{background:var(--coral-ink)}
@keyframes up{from{transform:translateY(8px);opacity:0}}

/* Sign-in */
.login{max-width:440px;margin:0 auto;padding-top:120px}
.login .card{padding:34px 34px 30px}
.login .logo img{height:58px;margin:0 auto 26px}

/* Tabs on a record page: the same pill switch as Day / Week / Month */
.tabs{margin:18px 0 0}

/* Printing (receipts, the session sheet, forms) */
.print-only{display:none}
@media print{
  body{background:#fff}
  .app{margin:0;width:auto;max-width:none;min-height:0;box-shadow:none;border-radius:0;padding:0;background:#fff}
  .top,.no-print,.toasts,.veil{display:none!important}
  .print-only{display:block}
  .card{box-shadow:none;border:1px solid #ddd}
}

/* ---------------------------------------------------------------- smaller screens
   At desktop size every screen matches its preview exactly. Below that the same components reflow. */
@media (max-width:1700px){
  .app{margin:28px auto;width:calc(100% - 56px);min-height:calc(100vh - 56px);padding:24px 32px 32px;border-radius:8px}
}
@media (max-width:1180px){
  .search{width:auto;flex:1;max-width:400px}
}
@media (max-width:820px){
  .app{margin:0;width:100%;border-radius:0;padding:16px 16px 28px;min-height:100vh;box-shadow:none}
  .top{margin-bottom:20px;height:auto}
  .logo img{height:34px}
  .search kbd,.search span{display:none}
  .search{flex:none;width:46px;padding:0 5px}
  .fields{grid-template-columns:1fr}
  .launch{width:calc(100vw - 32px)}
  .sheet{padding:20px 18px}
  /* Apple-style sheets on phones: windows rise from the bottom, full width, with room for the home bar */
  .veil{align-items:flex-end;padding:0}
  .sheet,.sheet.wide,.sheet.xwide{width:100%;max-height:94vh;max-height:94dvh;overflow:auto;border-radius:16px 16px 0 0;padding-bottom:calc(22px + env(safe-area-inset-bottom))}
  .sheet .ft{flex-wrap:wrap}
  .app{padding-top:max(16px,env(safe-area-inset-top));padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
}
/* Touch screens: at least 44 px to tap, as Apple recommends */
@media (pointer:coarse){
  .btn{min-height:44px}.btn.s{min-height:38px}.seg button{min-height:40px}
  .in,select.in{min-height:44px;font-size:16px}   /* 16 px stops iPhone Safari zooming into fields */
}
/* Safari: full-height screens that ignore the moving address bar */
@supports (height:100dvh){ .app{min-height:calc(100dvh - 48px)} body{min-height:100dvh} @media (max-width:820px){ .app{min-height:100dvh} } }
