:root {
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
    line-height: 1.5;
    color: #172a30;
    background: #f3f6f8;
    --muted: #536773;
    --line: #dce5e9;
    --accent: #096a59;
    --accent-dark: #075244;
    --mint: #e3f4ee;
    --nav: #142c34;
    --radius: 16px;
    --shadow: 0 6px 22px #1e3e5010;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
a { color: var(--accent-dark); }
:focus-visible { outline: 3px solid #198674; outline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.055em; }
h2 { margin: 0 0 18px; font-size: 1.18rem; letter-spacing: -.02em; }
h3 { font-size: 1.04rem; margin: 0; }
p { overflow-wrap: anywhere; }
.wrap { width: min(100%, 1420px); margin-inline: auto; padding: 0 clamp(18px, 4vw, 52px) 42px; min-width: 0; }
.dashboard { display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.top { color: #f4faf9; background: var(--nav); }
.head { position: sticky; top: 0; display: flex; flex-direction: column; min-height: 100dvh; gap: 38px; padding: 28px 18px 20px; }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; font-weight: 760; letter-spacing: -.02em; }
.brand small, .account-name small { display: block; font-size: .76rem; font-weight: 500; color: #b9cdd1; letter-spacing: 0; }
.brand-mark { position: relative; flex: 0 0 39px; height: 39px; border-radius: 11px; background: #a8e4d2; color: #17473f; }
.brand-mark::before { content: ""; position: absolute; inset: 10px; border: 2px solid currentColor; border-radius: 4px; }
.brand-mark::after { content: ""; position: absolute; width: 9px; height: 5px; left: 15px; top: 15px; border-left: 2px solid; border-bottom: 2px solid; transform: rotate(-45deg); }
.admin-nav { display: grid; gap: 5px; }
.admin-nav a { text-decoration: none; color: #cbdbdf; font-size: .9rem; font-weight: 660; padding: 10px 14px; border-radius: 9px; }
.admin-nav a:hover { background: #263e46; color: #fff; }
.admin-nav a[aria-current="page"] { background: #a8e4d2; color: #143e37; }
.account-menu { margin-top: auto; padding-top: 18px; border-top: 1px solid #ffffff27; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; }
.avatar { display: inline-grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; color: #075244; background: var(--mint); font-weight: 750; }
.account-name { font-size: .86rem; overflow-wrap: anywhere; font-weight: 660; }
.account-menu button { grid-column: 1 / -1; justify-self: start; }
.page-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; padding: 38px 0 24px; }
.back-link { display: inline-block; margin-bottom: 9px; text-decoration: none; font-size: .86rem; font-weight: 670; }
.back-link:hover { text-decoration: underline; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; align-items: start; }
.layout.one-column { grid-template-columns: minmax(0, 1fr); }
.layout.management { grid-template-columns: minmax(0, .9fr) minmax(0, 1.5fr); }
.card { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 2.3vw, 27px); box-shadow: var(--shadow); }
.install-card { width: min(100%, 860px); }
.sign-in { display: flex; flex-direction: column; background: radial-gradient(ellipse at top right, #d5eee6, transparent 56%), #f3f6f8; }
.sign-in .head { position: static; min-height: auto; width: min(100%, 1420px); margin: auto; padding: 20px clamp(18px, 4vw, 52px); }
.sign-in .wrap { width: min(100%, 500px); margin-block: auto; }
.sign-in .page-heading { padding-top: 42px; }
.login { display: grid; gap: 18px; }
.editor, .fields { display: grid; gap: 16px; }
.fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: block; font-size: .88rem; font-weight: 650; }
label small { font-size: .77rem; color: var(--muted); font-weight: 500; }
input:not([type=checkbox],[type=radio]), select, textarea { display: block; margin-top: 5px; width: 100%; min-height: 43px; padding: 9px 11px; background: #fff; border: 1px solid #a9bbc3; border-radius: 9px; font: inherit; color: inherit; }
input::placeholder { color: #62727c; }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); margin: 0; width: 17px; height: 17px; flex-shrink: 0; }
input[readonly] { background: #f3f6f8; }
button, .button { display: inline-flex; gap: 8px; align-items: center; justify-content: center; min-height: 42px; padding: 8px 14px; border-radius: 9px; border: 1px solid transparent; background: var(--accent); color: #fff; font: inherit; font-weight: 690; font-size: .88rem; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: var(--accent-dark); }
.secondary { color: var(--accent-dark); background: #fff; border-color: #b9cacb; }
.secondary:hover { background: var(--mint); }
.quiet { background: transparent; color: #f4faf9; border-color: #ffffff38; }
.quiet:hover { background: #263e46; }
fieldset { border: 1px solid var(--line); border-radius: 12px; min-width: 0; margin: 0; padding: 14px; }
legend, summary { font-weight: 700; }
summary { cursor: pointer; color: var(--accent-dark); }
.meta { display: none; }
.editor:has(input[name=provider][value=meta]:checked) .meta { display: block; }
.inline { display: inline-flex; align-items: center; gap: 8px; margin: 4px 12px 4px 0; }
.auto-reply { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.auto-reply .inline { margin-right: 2px; }
.field-help summary { list-style: none; display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid #a9bbc3; border-radius: 50%; font-size: .82rem; }
.field-help summary::-webkit-details-marker { display: none; }
.field-help[open] { flex: 1 0 100%; }
.field-help p { margin: 8px 0 0; font-size: .88rem; color: var(--muted); }
.configuration { border-top: 1px solid var(--line); padding-top: 14px; }
.configuration label { margin-top: 12px; }
.days { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: .86rem; }
.days th, .days td { text-align: left; padding: 4px; }
.days td input { min-width: 0; }
.overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0; }
.overview > div { padding: 14px 18px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.overview dt { color: var(--muted); }
.overview dd { margin: 2px 0 0; font-size: 1.85rem; font-weight: 750; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.clinic-directory { padding: 0; overflow: hidden; }
.directory-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.search-control { flex: 1 1 230px; max-width: 380px; min-width: 0; }
.clinic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 14px; padding: 20px; }
.clinic-grid:empty { display: none; }
.clinic { min-width: 0; border-top: 1px solid var(--line); padding: 14px 0; }
.clinic-tile { display: flex; flex-direction: column; gap: 5px; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.tile-actions { margin-top: auto; padding-top: 10px; }
.section-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: 8px; }
.section-title h3 { min-width: 0; }
.clinic p { margin: 3px 0; }
.clinic details { margin-top: 9px; }
.account-row { display: flex; align-items: center; gap: 9px; }
.detail-form, .new-extra { margin-top: 12px; }
.new-extra { margin-bottom: 18px; }
.extra-notes { white-space: pre-wrap; }
.extra-byline { font-size: .8rem; }
.status { display: inline-flex; align-items: center; gap: 6px; background: #edf1f4; color: #435762; font-size: .75rem; font-weight: 700; border-radius: 50px; padding: 4px 9px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.installed, .status.done { color: #096047; background: var(--mint); }
.status.running, .status.in_progress { color: #244f87; background: #e6efff; }
.status.queued, .status.requested { color: #795014; background: #fff1d9; }
.status.failed { color: #982f2d; background: #fcebe8; }
.muted { color: var(--muted); }
.empty { margin: 0; padding: 24px 20px; }
.alert { color: #095742; background: var(--mint); border-radius: 9px; margin: 0 0 18px; padding: 12px 15px; }
.alert.danger { color: #872e24; background: #fcebe8; }
dt { font-size: .82rem; font-weight: 660; }
dd { margin: 1px 0 12px; }
code { overflow-wrap: anywhere; font-size: .87em; }
@media (max-width: 1000px) {
    .dashboard { grid-template-columns: 204px minmax(0, 1fr); }
    .wrap { padding-inline: 24px; }
    .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
    .dashboard { display: block; }
    .head { position: static; min-height: auto; padding: 12px 18px; gap: 12px; }
    .dashboard .head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
    .admin-nav { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; gap: 5px; }
    .account-menu { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; justify-content: end; }
    .account-menu .avatar { display: none; }
    .page-heading { padding-top: 26px; }
}
@media (max-width: 580px) {
    .layout, .layout.management, .fields { grid-template-columns: minmax(0, 1fr); }
    .wrap { padding-inline: 14px; }
    .account-name { display: none; }
    .days th, .days td { padding-inline: 2px; }
    .days td input { padding-inline: 3px; }
    .overview > div { padding-inline: 12px; }
}

