:root {
    --ink: #10212b;
    --muted: #607486;
    --bg: #f2f6f7;
    --surface: #ffffff;
    --line: #e1eaee;
    --line-strong: #cfdde2;
    --brand: #0f766e;
    --brand-dark: #0b5b55;
    --brand-soft: #e6f4f2;
    --accent: #d97706;
    --danger: #b91c1c;
    --success: #15803d;
    --info: #1d4ed8;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16, 33, 43, .05), 0 8px 24px -18px rgba(16, 33, 43, .35);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--brand-dark);
}

h1, h2, h3, h4 {
    letter-spacing: -.02em;
}

.shell {
    display: flex;
    min-height: 100vh;
}

/* ---------- sidebar ---------- */

.sidebar {
    width: 254px;
    flex: 0 0 254px;
    background: linear-gradient(180deg, #0d3b37 0%, #082a28 100%);
    color: #e7f2f0;
    padding: 22px 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    color: inherit;
    padding: 0 6px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .12);
    display: grid;
    place-items: center;
    color: #ffffff;
    flex: 0 0 40px;
}

.brand-mark .icon {
    width: 22px;
    height: 22px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.brand-text strong {
    font-size: 16px;
    letter-spacing: -.01em;
}

.brand-text small {
    font-size: 11.5px;
    color: rgba(231, 242, 240, .62);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 10px;
    color: rgba(231, 242, 240, .72);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, .07);
    color: #ffffff;
}

.nav-item.active {
    background: rgba(255, 255, 255, .14);
    color: #ffffff;
}

.nav-item .icon {
    width: 18px;
    height: 18px;
    opacity: .85;
}

.nav-badge {
    margin-left: auto;
    background: #f59e0b;
    color: #3b2604;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
}

.sidebar-foot {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, .12);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.signout {
    background: none;
    border: 0;
    color: rgba(231, 242, 240, .55);
    font: inherit;
    font-size: 12.5px;
    cursor: pointer;
    text-align: left;
    padding: 4px 11px;
}

.signout:hover {
    color: #ffffff;
}

/* ---------- main ---------- */

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.content {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 30px 34px 70px;
}

.banner {
    padding: 10px 18px;
    font-size: 13.5px;
    text-align: center;
}

.banner-warn {
    background: #fef3c7;
    color: #92400e;
    border-bottom: 1px solid #fde68a;
}

.banner a {
    color: #92400e;
    font-weight: 600;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.page-head h1 {
    font-size: 27px;
    margin: 0 0 3px;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .13em;
    font-size: 11px;
    font-weight: 700;
    color: var(--brand);
    margin: 0 0 4px;
}

.subtitle {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
}

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ---------- buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 9px;
    border: 1px solid transparent;
    padding: 8px 14px;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    white-space: nowrap;
}

.btn .icon {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--brand);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--brand-dark);
    color: #ffffff;
}

.btn-secondary {
    background: #ffffff;
    border-color: var(--line-strong);
    color: var(--ink);
}

.btn-secondary:hover {
    background: #f4f9f8;
    border-color: #b9d2ce;
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
}

.btn-ghost:hover {
    background: #e9f0f1;
    color: var(--ink);
}

.btn-danger {
    background: #fee2e2;
    color: var(--danger);
}

.btn-danger:hover {
    background: #fecaca;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12.5px;
    border-radius: 7px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ---------- surfaces ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.card + .card {
    margin-top: 18px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.card-head h2,
.card-head h3 {
    margin: 0;
    font-size: 15.5px;
    font-weight: 650;
}

.card-sub {
    color: var(--muted);
    font-size: 12.5px;
    margin: 2px 0 0;
}

.grid {
    display: grid;
    gap: 16px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    margin-bottom: 20px;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.stat-value {
    font-size: 29px;
    font-weight: 650;
    letter-spacing: -.03em;
    line-height: 1.15;
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

.stat-note {
    color: var(--muted);
    font-size: 12.5px;
    margin-top: 2px;
}

.stat-note a {
    color: var(--brand-dark);
    font-weight: 600;
    text-decoration: none;
}

/* ---------- forms ---------- */

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 12px;
    min-width: 0;
}

.field > label,
.field-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #3c4c57;
}

input, select, textarea {
    font: inherit;
    font-size: 14px;
    color: var(--ink);
    background: #ffffff;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    padding: 8px 10px;
    width: 100%;
    transition: border-color .12s ease, box-shadow .12s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, .14);
}

textarea {
    min-height: 76px;
    resize: vertical;
}

input[type="checkbox"] {
    width: auto;
    accent-color: var(--brand);
}

.form-row {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    align-items: start;
}

.form-row.tight {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: #3c4c57;
    margin-bottom: 12px;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.inline-form .field {
    margin-bottom: 0;
    flex: 1 1 140px;
}

.hint {
    font-size: 12px;
    color: var(--muted);
}

.error-text {
    color: var(--danger);
    font-size: 13px;
    font-weight: 500;
}

/* ---------- tables ---------- */

.table-wrap {
    overflow-x: auto;
}

table.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    background: #f8fbfb;
    white-space: nowrap;
}

.table td {
    padding: 11px 10px;
    border-bottom: 1px solid #eef4f5;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: #f8fcfb;
}

.table tbody tr.selected {
    background: var(--brand-soft);
}

.table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.table .nowrap {
    white-space: nowrap;
}

.table tfoot td {
    font-weight: 650;
    border-bottom: 0;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.row-link {
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
}

.row-link:hover {
    color: var(--brand-dark);
}

.sub-line {
    color: var(--muted);
    font-size: 12px;
}

/* ---------- badges / chips ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 650;
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
}

.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-accent { background: #ffedd5; color: #c2410c; }
.badge-muted { background: #eef2f4; color: #51626d; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f6f6;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    color: #3c4c57;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    display: inline-block;
    flex: 0 0 8px;
}

/* ---------- misc ---------- */

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-variant-numeric: tabular-nums; }
.strong { font-weight: 650; }
.right { text-align: right; }
.center { text-align: center; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

.alert {
    padding: 10px 13px;
    border-radius: 9px;
    font-size: 13.5px;
    margin: 10px 0;
    border: 1px solid transparent;
}

.alert-danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.alert-info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

.empty {
    padding: 26px 18px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed #d6e3e6;
    border-radius: 12px;
    background: #fbfdfd;
    font-size: 13.5px;
}

.chip-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.date-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    padding: 3px;
}

.date-nav .btn {
    padding: 6px 9px;
}

.date-nav .current {
    font-weight: 650;
    font-size: 14px;
    padding: 0 8px;
    min-width: 150px;
    text-align: center;
}

/* ---------- diary ---------- */

.diary-wrap {
    overflow-x: auto;
}

.diary {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.diary th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fbfb;
    border-bottom: 1px solid var(--line);
    padding: 9px 8px;
    font-size: 12px;
    text-align: left;
    color: #3c4c57;
}

.diary th.dentist-col {
    border-left: 1px solid var(--line);
}

.dentist-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dentist-head strong {
    font-size: 12.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dentist-head small {
    color: var(--muted);
    font-size: 11px;
}

.diary td.time-cell {
    width: 74px;
    padding: 4px 8px;
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    border-bottom: 1px solid #f0f5f6;
    vertical-align: top;
    white-space: nowrap;
}

.diary td.slot-cell {
    border-left: 1px solid #eef4f5;
    border-bottom: 1px solid #f0f5f6;
    padding: 3px;
    vertical-align: top;
    min-width: 150px;
    height: 44px;
}

.sheet-appt {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 2px 0;
    padding: 5px 8px;
    border-left: 3px solid var(--brand);
    border-radius: 6px;
    background: #f2fbfa;
    font-size: 12px;
    line-height: 1.35;
}

.sheet-appt strong { font-size: 12.5px; }
.sheet-appt span { color: var(--muted); font-size: 11.5px; }

.slot-empty {
    width: 100%;
    min-height: 36px;
    border: 1px dashed transparent;
    border-radius: 7px;
    background: transparent;
    color: transparent;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
}

.slot-empty:hover {
    border-color: #a7d3ce;
    color: var(--brand);
    background: #f4fbfa;
}

.appt-card {
    display: block;
    width: 100%;
    text-align: left;
    font: inherit;
    border: 1px solid #dde9e8;
    border-left-width: 4px;
    background: #f4faf9;
    border-radius: 8px;
    padding: 5px 7px;
    cursor: pointer;
    color: var(--ink);
    font-size: 12px;
    line-height: 1.25;
}

.appt-card:hover {
    background: #e9f6f4;
}

.appt-card .who {
    font-weight: 650;
    font-size: 12.5px;
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.appt-card .meta {
    color: var(--muted);
    font-size: 11px;
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.appt-card.pending {
    border-style: dashed;
    background: #fffaf0;
}

.appt-card.finished {
    opacity: .72;
}

.diary-footnote {
    margin-top: 10px;
    font-size: 12px;
    color: var(--muted);
}

/* ---------- patients / tabs ---------- */

.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab {
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    padding: 10px 14px;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
}

.tab:hover {
    color: var(--ink);
}

.tab.active {
    color: var(--brand-dark);
    border-color: var(--brand);
}

.patient-banner {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 15px;
    flex: 0 0 44px;
}

.alert-strip {
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #78350f;
}

/* ---------- online request review ---------- */

.review {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfdfd;
    padding: 16px 18px;
}

.review-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.alert-strip.danger {
    border-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.kv {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 9px 16px;
    margin: 0;
    font-size: 13.5px;
}

.kv dt {
    color: var(--muted);
    font-weight: 600;
}

.kv dd {
    margin: 0;
}

/* ---------- tooth chart ---------- */

.tooth-quadrants {
    display: grid;
    gap: 18px;
}

.tooth-row {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
}

.tooth-row.lower {
    direction: rtl;
}

.tooth {
    aspect-ratio: 1 / 1;
    border: 1px solid #d7e2e6;
    background: #ffffff;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    color: var(--ink);
    cursor: pointer;
    padding: 2px;
    direction: ltr;
}

.tooth:hover {
    border-color: #9ecfc9;
    background: #f6fcfb;
}

.tooth.issue {
    border-color: #f3b4af;
    background: #fff6f5;
}

.tooth.selected {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}

.tooth .cond {
    font-size: 8.5px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .02em;
    line-height: 1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tooth.issue .cond {
    color: #b91c1c;
}

.quad-label {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* ---------- public booking ---------- */

.public-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(1200px 500px at 10% -10%, #d9f0ed 0%, transparent 60%),
        radial-gradient(900px 400px at 100% 0%, #e8eefb 0%, transparent 55%),
        #f4f8f8;
}

.public-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 28px;
    max-width: 1040px;
    width: 100%;
    margin: 0 auto;
}

.brand-public {
    color: var(--ink);
    padding: 0;
}

.brand-public .brand-mark {
    background: var(--brand);
    color: #fff;
}

.brand-public .brand-text small {
    color: var(--muted);
}

.public-nav {
    display: flex;
    gap: 16px;
    font-size: 13.5px;
    font-weight: 600;
}

.public-nav a {
    color: #3c4c57;
    text-decoration: none;
}

.public-nav a:hover {
    color: var(--brand-dark);
}

.public-content {
    flex: 1;
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    padding: 12px 28px 48px;
}

.public-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    border-top: 1px solid var(--line);
    padding: 16px 28px;
    max-width: 1040px;
    width: 100%;
    margin: 0 auto;
    color: var(--muted);
    font-size: 12.5px;
}

.hero {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 24px;
    align-items: center;
    margin: 8px 0 24px;
}

.hero h1 {
    font-size: 34px;
    line-height: 1.15;
    margin: 6px 0 10px;
}

.hero p {
    color: var(--muted);
    font-size: 15px;
    margin: 0;
}

.hero-card {
    background: linear-gradient(160deg, #0f766e 0%, #0b4e49 100%);
    color: #e9f7f4;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 24px 60px -34px rgba(11, 78, 73, .8);
}

.hero-card h3 {
    margin: 0 0 4px;
    font-size: 16px;
    color: #ffffff;
}

.hero-card p {
    margin: 0;
    color: rgba(233, 247, 244, .78);
    font-size: 13px;
}

.hero-lines {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.hero-line {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 13px;
    color: rgba(233, 247, 244, .9);
}

.hero-line .icon {
    width: 17px;
    height: 17px;
    opacity: .85;
}

.slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
    gap: 7px;
}

.slot-btn {
    border: 1px solid var(--line-strong);
    background: #ffffff;
    border-radius: 9px;
    padding: 8px 6px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.slot-btn:hover {
    border-color: var(--brand);
    color: var(--brand-dark);
}

.slot-btn.selected {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
}

.steps {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--muted);
}

.step span {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #e9efef;
    color: #51626d;
    display: grid;
    place-items: center;
    font-size: 11.5px;
    font-weight: 700;
}

.step.active {
    color: var(--ink);
    font-weight: 600;
}

.step.active span {
    background: var(--brand);
    color: #fff;
}

.success-mark {
    width: 58px;
    height: 58px;
    border-radius: 999px;
    background: #dcfce7;
    color: #15803d;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
}

.success-mark .icon {
    width: 30px;
    height: 30px;
}

.reference {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 24px;
    letter-spacing: .14em;
    font-weight: 700;
    background: #f1f7f7;
    border: 1px dashed #b9d6d1;
    border-radius: 10px;
    padding: 10px 16px;
    display: inline-block;
}

/* ---------- auth ---------- */

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(900px 500px at 20% 0%, #d9f0ed 0%, transparent 60%),
        #f2f6f7;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 30px 80px -50px rgba(16, 33, 43, .6);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 22px;
}

.auth-brand .brand-mark {
    background: var(--brand);
    color: #ffffff;
}

.auth-brand strong {
    font-size: 17px;
    display: block;
    line-height: 1.2;
}

.auth-brand small {
    color: var(--muted);
    font-size: 11.5px;
}

.auth-card h1 {
    font-size: 23px;
    margin: 0 0 4px;
}

.auth-card .muted {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 13.5px;
}

.auth-note {
    margin: 18px 0 0;
    font-size: 12.5px;
    color: var(--muted);
    text-align: center;
}

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .shell { flex-direction: column; }
    .sidebar {
        width: 100%;
        flex: none;
        height: auto;
        position: static;
        flex-direction: column;
        gap: 12px;
    }
    .nav {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .sidebar-foot {
        margin-top: 0;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .content { padding: 20px 16px 50px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .diary { min-width: 640px; }
    .public-content { padding: 12px 16px 40px; }
}

/* ---------- print ---------- */

@media print {
    body { background: #fff; }
    .sidebar, .banner, .no-print, .public-head, .public-foot { display: none !important; }
    .content, .public-content {
        max-width: none;
        padding: 0;
    }
    .card {
        border: none;
        box-shadow: none;
        padding: 0;
    }
    .table th { background: #fff; }
    a { color: inherit; text-decoration: none; }
    .diary-wrap { overflow: visible; }
    .diary { min-width: 0; }
    .diary th { position: static; }
    .sheet-appt { background: #fff; border: 1px solid #d8e2e4; break-inside: avoid; }
}

/* ---------- public booking: language switch and Sorani (RTL) ---------- */

.public-nav {
    align-items: center;
    flex-wrap: wrap;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding-inline-start: 8px;
    border-inline-start: 1px solid var(--line-strong);
}

.lang-switch button {
    background: none;
    border: 0;
    border-radius: 7px;
    padding: 3px 8px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #3c4c57;
    cursor: pointer;
}

.lang-switch button:hover {
    background: #e9f0f1;
    color: var(--brand-dark);
}

.lang-switch button.active {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.public-shell[dir="rtl"] {
    font-family: "Segoe UI", "Noto Naskh Arabic", "Noto Kufi Arabic", Tahoma, "Geeza Pro", sans-serif;
}

.public-shell[dir="rtl"] h1,
.public-shell[dir="rtl"] h2,
.public-shell[dir="rtl"] h3,
.public-shell[dir="rtl"] h4 {
    letter-spacing: normal;
}

.public-shell[dir="rtl"] .eyebrow {
    letter-spacing: normal;
    text-transform: none;
}

.public-shell[dir="rtl"] .reference {
    direction: ltr;
    unicode-bidi: isolate;
}

.public-shell[dir="rtl"] .kv {
    grid-template-columns: 110px minmax(0, 1fr);
}

.public-shell[dir="rtl"] .slot-btn {
    line-height: 1.35;
}

.public-shell[dir="rtl"] .hero h1 {
    line-height: 1.35;
}

@media (max-width: 640px) {
    .public-nav {
        gap: 10px;
    }

    .lang-switch {
        padding-inline-start: 6px;
    }
}
