/* Dent Desk — base styles shared by every page (from the old app.css) */

@font-face {
    font-family: 'Inter DD';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter.woff2') format('woff2');
}

/* colours are the old app's "soft look" values */
:root {
    --ink: #1F2329; --ink2: #3A3F47; --mut: #6B7079; --mut2: #959AA3;
    --line: #E8EAEF; --line2: #F0F1F5; --bg: #FFFFFF; --card: #fff;
    --blue: #2F7DD3; --red: #C2493D; --green: #0F9D8A;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --soft-shadow: 0 1px 2px rgba(16, 24, 40, .03), 0 8px 24px rgba(16, 24, 40, .045);
    --font: 'Inter DD', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box }
html, body {
    margin: 0; background: var(--bg); color: var(--ink);
    font: 14px/1.5 var(--font); letter-spacing: -.005em;
    font-feature-settings: 'cv11', 'ss01', 'ss03'; font-variant-numeric: tabular-nums;
    text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; color: inherit }
a { color: var(--blue); text-decoration: none }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px }
[hidden] { display: none !important }
h1 { margin: 0; font-size: 24px; line-height: 1.2; letter-spacing: -.022em; font-weight: 700; text-wrap: balance }
h2 { margin: 0; font-size: 18px; line-height: 1.3; letter-spacing: -.015em; font-weight: 650 }
h3 { margin: 0; font-size: 16px; line-height: 1.35; letter-spacing: -.01em; font-weight: 650 }
p { margin: 0 }
b, strong, .b { font-weight: 600 }

/* helpers */
.mut { color: var(--mut) } .sm { font-size: 13px } .xs { font-size: 12px }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.stack { display: flex; flex-direction: column; gap: 16px } .gap4 { gap: 4px } .gap12 { gap: 12px }

/* buttons */
.btn {
    height: 40px; padding: 0 14px; border: 1px solid #E4E6EC; border-radius: 12px;
    background: #fff; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1; letter-spacing: -.005em;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    cursor: pointer; white-space: nowrap; text-decoration: none !important;
    transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s, border-color .18s;
}
.btn:hover:not(:disabled) { background: #F7F8FB; border-color: #D9DCE3 }
.btn:active:not(:disabled) { transform: scale(.97) }
.btn:disabled { opacity: .45; cursor: not-allowed }
.btn.primary { background: linear-gradient(180deg, #2A2F37, #1F2329); border-color: #1F2329; color: #fff; box-shadow: 0 1px 1px rgba(16, 24, 40, .08), 0 6px 16px rgba(31, 35, 41, .18) }
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #333943, #24282F); transform: translateY(-1px); box-shadow: 0 2px 2px rgba(16, 24, 40, .08), 0 10px 22px rgba(31, 35, 41, .22) }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(181, 48, 31, .2) }
.btn.danger:hover:not(:disabled) { background: #B03F34; border-color: #B03F34 }
.btn.red { color: var(--red) }
.btn.ghost { border-color: transparent; background: transparent }
.btn.ghost:hover:not(:disabled) { background: rgba(17, 24, 39, .05); border-color: transparent }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 10px }
.btn.big { height: 48px; padding: 0 20px }
.btn.icon { width: 40px; padding: 0 } .btn.sm.icon { width: 32px } .btn.round { border-radius: 50% }
.btn svg { width: 18px; height: 18px; flex: none }
.btn.sm svg { width: 16px; height: 16px }

/* form */
.input {
    width: 100%; height: 40px; border: 1px solid #E3E5EB; border-radius: 12px;
    padding: 0 12px; background: #FCFCFD; font-size: 14px; line-height: 1.4;
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.input:hover { border-color: #D3D6DE }
.input:focus { outline: none; background: #fff; border-color: #8FAAF2; box-shadow: 0 0 0 4px rgba(46, 98, 232, .12) }
.lab { display: block; font-size: 13px; font-weight: 600; color: var(--ink2); margin: 0 0 6px; letter-spacing: -.003em }
.field { min-width: 0 }
.err { color: var(--red); font-size: 13px; font-weight: 500; margin-top: 6px }

/* avatar */
.av { width: 30px; height: 30px; border-radius: 50%; background: #EEEFF2; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: none; overflow: hidden; color: var(--ink2); box-shadow: 0 0 0 3px #fff }

/* layout helpers */
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap }
.row.sp { justify-content: space-between }
.r { text-align: right }
.nowrap { white-space: nowrap }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px }
.grid2 .span2 { grid-column: 1 / -1 }
@media (max-width: 700px) { .grid2 { grid-template-columns: minmax(0, 1fr) } }

/* form extras */
select.input { appearance: auto }
.input.upper { text-transform: uppercase }
.hint { font-size: 12px; color: var(--mut2); margin-top: 5px }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500 }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue) }
.link { background: none; border: 0; padding: 0; color: var(--blue); font-weight: 600; cursor: pointer }
.link:hover { text-decoration: underline }

/* cards and tables */
.card { background: #fff; border: 1px solid #EEF0F4; border-radius: 20px; box-shadow: var(--soft-shadow); padding: 18px 20px; min-width: 0 }
.card.flush { padding: 0; overflow: hidden }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch }
table.tbl { border-collapse: collapse; width: 100% }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--mut); padding: 10px 12px; border-bottom: 1px solid var(--line2); white-space: nowrap }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line2); vertical-align: middle }
.tbl tr:last-child td { border-bottom: 0 }
.tbl tr.click { cursor: pointer; transition: background .15s }
.tbl tr.click:hover td { background: #F7F8FC }

/* tags and notes */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #F0F2F6; color: var(--ink2) }
.tag.green { background: #D5F1EC; color: #0A5A50 }
.tag.red { background: #F9DEDA; color: #7C2A20 }
.note { background: #F6F7F9; border-radius: 14px; padding: 10px 12px; font-size: 13px; color: var(--ink2) }
.note.bad { background: #F9DEDA; color: #6E1F17 }
.note.good { background: #D5F1EC; color: #07463F }

/* page header with a back link: "← Settings" over the title */
.shead { margin: 0 0 12px }
.shead h1 { margin: 2px 0 0; font-size: 24px }
.scrumb { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; color: #6B7280; text-decoration: none !important }
.scrumb svg { width: 14px; height: 14px }
.scrumb:hover { color: #111827 }

/* form pages: <x-section> blocks, a toolbar above, a save bar below */
.toolbar { margin-bottom: 14px }
.ssec { background: #fff; border-radius: 18px; padding: 22px 24px; margin-bottom: 16px; max-width: 1100px; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; box-shadow: 0 0 0 1px rgba(17, 24, 39, .05), 0 8px 24px -18px rgba(30, 58, 100, .3) }
.ssec h3 { margin: 0 0 6px; font-size: 16px }
.ssec p { margin: 0; color: #6B7280; font-size: 13px; line-height: 1.5 }
.ssb { min-width: 0 }
.ssec.danger h3 { color: var(--red) }
.sbar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 12px 16px; margin: 4px 0 16px; max-width: 1100px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(6px); border-radius: 16px; box-shadow: 0 0 0 1px rgba(17, 24, 39, .06), 0 -8px 24px -18px rgba(30, 58, 100, .3) }
.form-errors { max-width: 1100px; margin-bottom: 16px; display: flex; gap: 8px; flex-wrap: wrap }
.note.intro { max-width: 1100px; margin-bottom: 16px }
textarea.input { height: auto; min-height: 72px; padding: 10px 12px; line-height: 1.5; resize: vertical }

@media (max-width: 900px) {
    .ssec { grid-template-columns: 1fr; gap: 12px; padding: 16px }
    .sbar { bottom: calc(64px + env(safe-area-inset-bottom)) }
}

/* colour picker */
.swatches { display: flex; gap: 8px; flex-wrap: wrap }
.swatch { position: relative; width: 30px; height: 30px; border-radius: 9px; background: var(--c); cursor: pointer; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line) }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer }
.swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--ink) }
.swatch:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }

/* small colour marks in tables */
.color-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-right: 8px; vertical-align: middle }

/* Edit / Delete buttons at the end of a table row */
.row-actions { display: flex; gap: 4px; justify-content: flex-end; white-space: nowrap }

/* <x-patient-picker> */
.patient-picker { position: relative }
.picker-results { position: absolute; left: 0; right: 0; top: 44px; z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .12); max-height: 300px; overflow: auto }
.picker-results button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; cursor: pointer; font-size: 13px }
.picker-results button:hover { background: #F3F4F6 }
.picker-empty { padding: 10px 12px; font-size: 13px; color: var(--mut) }

/* <x-admin-approval>: an admin types their username and password on the form */
.approval { border: 1px solid #F3D9A4; background: #FFF8EA; border-radius: 14px; padding: 12px 14px; margin-top: 12px }
.approval-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px }
.approval-head svg { width: 20px; height: 20px; color: #B7791F; flex: none; margin-top: 2px }
