@font-face {
    font-family: Vazirmatn;
    src: url("../vendor/vazirmatn/Vazirmatn.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

:root {
    color-scheme: light;
    --ink: #17292e;
    --muted: #536970;
    --muted-deep: #41575e;
    --accent: #0b7669;
    --accent-dark: #065c52;
    --accent-soft: #e5f4ef;
    --page: #f5f7f9;
    --white: #fff;
    --line: #e2e9ed;
    --line-soft: #edf1f3;
    --radius: 19px;
    --control-radius: 11px;
    --sidebar-width: 240px;
    --shadow: 0 2px 5px #223c4610;
    --stage-slate: #8c9eaf;
    --stage-blue: #63a2ed;
    --stage-amber: #e5ab57;
    --stage-violet: #a495e6;
    --stage-mint: #24a98c;
    --bs-body-font-family: Vazirmatn, Tahoma, sans-serif;
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--page);
}

* { box-sizing: border-box; }
body { margin: 0; font: 400 1rem/1.65 var(--bs-body-font-family); color: var(--ink); background: var(--page); }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, dl, dd { margin: 0; }
small { font-size: .8125rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #158775; outline-offset: 3px; }
.main-content:focus { outline: none; }
::selection { background: #bceadd; color: #073e36; }

.icon { width: 21px; height: 21px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.skip-link { position: fixed; inset: 10px 10px auto auto; z-index: 30; transform: translateY(-150%); padding: .65rem 1rem; background: var(--white); border: 1px solid var(--line); border-radius: 9px; }
.skip-link:focus { transform: translateY(0); }
.surface { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); white-space: nowrap; }
.brand img { flex-shrink: 0; }
.brand strong { display: block; font-size: 1.27rem; line-height: 1.28; font-weight: 850; color: var(--ink); }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: .75rem; }

.sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; display: flex; flex-direction: column; width: var(--sidebar-width); padding: 25px 17px 16px; border-inline-end: 1px solid var(--line); background: var(--white); z-index: 6; overflow-y: auto; }
.sidebar > .brand { padding: 0 10px 25px; min-height: 75px; border-bottom: 1px solid var(--line-soft); }
.sidebar-menu { display: grid; gap: 6px; margin-top: 23px; }
.menu-caption { margin: 0 12px 4px; font-size: .75rem; font-weight: 650; color: var(--muted); }
.sidebar .nav-link { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 12px; border: 0; border-radius: 10px; color: var(--muted-deep); font-size: .925rem; font-weight: 560; text-align: start; background: transparent; transition: background .18s, color .18s; }
.sidebar .nav-link:hover { background: #f1f6f5; color: var(--accent-dark); }
.sidebar .nav-link.is-active { color: var(--accent-dark); font-weight: 760; background: var(--accent-soft); }
.sidebar .nav-link.is-active .icon { stroke-width: 2; }
.sidebar-bottom { margin-top: auto; padding-top: 22px; }
.user-link { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); padding: 9px; border-radius: 12px; color: var(--ink); min-width: 0; transition: background .18s; }
.user-link:hover { background: var(--page); }
.user-link > .icon { width: 15px; height: 15px; color: var(--muted); }
.user-label { flex: 1; min-width: 0; }
.user-label strong, .user-label small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-label strong { font-size: .865rem; font-weight: 750; }
.user-label small { color: var(--muted); }
.sidebar .logout-button { width: 100%; margin-top: 7px; }
.sidebar .logout-button:hover { background: #fff1f0; color: #a63b42; }

.workspace { margin-inline-start: var(--sidebar-width); min-width: 0; }
.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1536px; margin: auto; padding: 0 32px; height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.topbar-title, .topbar-actions, .topbar-date { display: flex; align-items: center; }
.topbar-title { gap: 10px; color: var(--muted); font-size: .875rem; }
.topbar-title strong { color: var(--ink); font-weight: 720; }
.topbar-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--accent-dark); background: var(--accent-soft); }
.topbar-icon .icon { width: 17px; height: 17px; }
.crumb-divider { color: #80939a; }
.topbar-actions { gap: 11px; }
.topbar-date { gap: 7px; padding-inline: 6px; color: var(--muted-deep); font-size: .875rem; white-space: nowrap; }
.topbar-date .icon { width: 17px; height: 17px; color: var(--accent); }
.mobile-brand, .mobile-avatar, .bottom-nav, .mobile-logout { display: none !important; }
.main-content { max-width: 1536px; margin-inline: auto; padding: 27px 32px 40px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.page-heading > div { min-width: 0; }
.page-heading h1 { font-size: clamp(1.65rem, 2.65vw, 2.12rem); font-weight: 850; line-height: 1.38; overflow-wrap: anywhere; }
.page-heading p { color: var(--muted); margin-top: 4px; font-size: .9375rem; }

.action { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 41px; padding: 7px 14px; border: 1px solid transparent; border-radius: var(--control-radius); font-size: .875rem; font-weight: 700; line-height: 1.5; text-align: center; white-space: nowrap; transition: background .18s, color .18s, border-color .18s, box-shadow .18s; }
.action .icon { width: 18px; height: 18px; }
.action-primary { color: var(--white); background: var(--accent); border-color: var(--accent); box-shadow: 0 3px 6px #0b766924; }
.action-primary:hover, .action-primary:active { color: var(--white); background: var(--accent-dark); border-color: var(--accent-dark); }
.action-secondary { color: var(--muted-deep); background: #fff; border-color: #dbe5e9; }
.action-secondary:hover { color: var(--accent-dark); background: #f3f9f7; border-color: #b9d9d0; }
.action-soft { color: var(--accent-dark); background: var(--accent-soft); }
.action-soft:hover { color: var(--accent-dark); background: #d8eee7; }
.action-danger { color: #a33542; background: #fff0f1; }
.action-danger:hover { color: #8d2632; background: #fbe1e6; }
.action-glass { color: #f5fffc; border-color: #ffffff4a; background: #ffffff17; }
.action-glass:hover { color: #fff; border-color: #ffffff8a; background: #ffffff28; }

.icon-button, .page-button { display: inline-grid; place-items: center; flex: 0 0 auto; min-width: 39px; min-height: 39px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--muted-deep); transition: background .18s, color .18s, border-color .18s; }
.icon-button .icon, .page-button .icon { width: 18px; height: 18px; }
.icon-button:hover, .page-button:hover { color: var(--accent-dark); border-color: #c4dfd7; background: #eaf6f2; }
.avatar { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; overflow: hidden; border-radius: 12px; background: #dff1eb; color: #096255; object-fit: cover; font-weight: 820; }
.avatar > img { width: 100%; height: 100%; object-fit: cover; }
.tile-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border-radius: 12px; background: var(--tone-bg, var(--accent-soft)); color: var(--tone-text, var(--accent-dark)); }
.tone-mint { --tone-bg: #e6f6ee; --tone-text: #157154; --tone-dot: var(--stage-mint); }
.tone-blue { --tone-bg: #eaf3ff; --tone-text: #245eae; --tone-dot: var(--stage-blue); }
.tone-rose { --tone-bg: #fcecf1; --tone-text: #a13f64; --tone-dot: #e98bad; }
.tone-violet { --tone-bg: #f1edff; --tone-text: #6248a6; --tone-dot: var(--stage-violet); }
.tone-amber { --tone-bg: #fff4df; --tone-text: #855910; --tone-dot: var(--stage-amber); }
.tone-slate { --tone-bg: #edf2f6; --tone-text: #475d70; --tone-dot: var(--stage-slate); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; width: fit-content; min-height: 26px; padding: 3px 9px; color: var(--tone-text); background: var(--tone-bg); border-radius: 7px; white-space: nowrap; font-size: .8125rem; line-height: 1.4; font-weight: 700; }
.status-dot, .legend-dot { display: inline-block; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--tone-dot); }
.legend-dot { width: 9px; height: 9px; }

.welcome { position: relative; display: flex; align-items: center; isolation: isolate; overflow: hidden; min-height: 206px; margin-bottom: 17px; padding: 24px 29px; border: 1px solid #205f56; border-radius: 21px; background: radial-gradient(ellipse at 10% 28%, #256b5b 0%, transparent 67%), linear-gradient(110deg, #195d51, #123f3a 65%, #123d3a); color: #fff; box-shadow: 0 5px 16px #15433d19; }
.welcome-content { z-index: 1; }
.welcome-date { display: inline-flex; align-items: center; gap: 7px; color: #daf3eb; font-size: .8125rem; font-weight: 590; }
.welcome-date .icon { width: 15px; height: 15px; }
.welcome h2 { margin-top: 4px; font-size: clamp(1.55rem, 2.85vw, 2.2rem); font-weight: 850; line-height: 1.35; }
.welcome p { margin-top: 3px; color: #e6f4ef; font-size: .9375rem; }
.welcome .action { margin-top: 13px; min-height: 37px; }
.welcome-art { position: absolute; inset-block: 0; inset-inline-end: 0; width: 49%; pointer-events: none; }
.welcome-art::before, .login-art::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(#f1fffb35 1px, transparent 1px); background-size: 17px 17px; mask-image: radial-gradient(ellipse at center, #000, transparent 74%); }
.welcome-orbit, .login-orbit { position: absolute; border: 1px solid #d3fff330; border-radius: 50%; transform: translate(-50%, -50%); left: 48%; top: 54%; }
.orbit-one { width: 240px; height: 240px; }
.orbit-two { width: 315px; height: 315px; }
.orbit-three { width: 395px; height: 395px; }

.art-float { position: absolute; display: grid; border: 1px solid #d0fff45b; border-radius: 15px; box-shadow: 0 15px 35px #071f2a44; }
.art-main { z-index: 1; left: 29%; top: 20%; width: 43%; height: 61%; padding: 12px; grid-template-rows: 20px 1fr; gap: 6px; background: linear-gradient(150deg, #d6fcf41f, #d0fff409), #29685e; transform: rotate(-10deg); }
.art-head { display: flex; align-items: center; justify-content: space-between; }
.art-head span:first-child { width: 37%; height: 7px; border-radius: 8px; background: #d7fff0ab; }
.art-head span:last-child { width: 16px; height: 16px; border-radius: 50%; border: 4px solid #d9fff1b0; }
.art-chart { display: flex; direction: ltr; justify-content: center; align-items: end; gap: 7%; height: 100%; border-bottom: 1px solid #e2fff148; }
.art-chart i { height: var(--bar); width: 10%; border-radius: 4px 4px 0 0; background: linear-gradient(#b7f6df, #63ccaf91); }
.art-chart i:nth-child(1) { --bar: 25%; }
.art-chart i:nth-child(2) { --bar: 47%; }
.art-chart i:nth-child(3) { --bar: 37%; }
.art-chart i:nth-child(4) { --bar: 66%; }
.art-chart i:nth-child(5) { --bar: 57%; }
.art-chart i:nth-child(6) { --bar: 88%; }
.art-small { z-index: 2; left: 65%; top: 47%; width: 17%; min-width: 59px; height: 38%; padding: 8px; background: #def7ee; transform: rotate(10deg); color: #247a66; }
.art-small .icon { width: 19px; height: 19px; stroke-width: 2; }
.art-small i { height: 4px; margin-top: 4px; width: 75%; border-radius: 8px; background: #79b8a9; }
.art-small i:last-child { width: 52%; background: #9bcabd; }
.art-check { z-index: 2; left: 22%; top: 22%; width: 37px; height: 37px; place-items: center; border-radius: 11px; background: #aee8d6; color: #126654; transform: rotate(-13deg); }
.art-check .icon { stroke-width: 2.4; }

.channel-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 17px; }
.channel-card { padding: 15px 16px 14px; }
.channel-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.today-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border: 1px solid #e5ebee; background: #f7f9fa; color: var(--muted); border-radius: 7px; font-size: .8125rem; white-space: nowrap; }
.today-pill strong { color: var(--accent-dark); }
.channel-value { display: flex; align-items: baseline; gap: 6px; margin-top: 9px; }
.channel-value strong { font-size: 1.78rem; line-height: 1.2; font-weight: 820; }
.channel-value span { color: var(--muted); font-size: .75rem; }
.channel-card h2 { margin-top: 3px; font-size: .9rem; line-height: 1.5; font-weight: 660; color: var(--muted-deep); }

.analytics-grid { display: grid; grid-template-columns: minmax(0, 1.63fr) minmax(0, 1fr); gap: 15px; margin-bottom: 17px; }
.analytics-card { padding: 17px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 11px; }
.section-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.section-title > div { min-width: 0; }
.section-title .tile-icon { width: 40px; height: 40px; border-radius: 11px; }
.section-title .tile-icon .icon { width: 19px; height: 19px; }
.section-title h2 { font-size: 1.035rem; font-weight: 800; line-height: 1.5; }
.section-title p { margin-top: 1px; color: var(--muted); font-size: .8125rem; line-height: 1.6; }
.range-switch { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); background: #f5f8f9; border-radius: 9px; }
.range-switch a { padding: 5px 7px; border-radius: 6px; color: var(--muted-deep); font-size: .8125rem; font-weight: 650; white-space: nowrap; }
.range-switch a:hover { color: var(--accent-dark); }
.range-switch .is-active { color: var(--accent-dark); background: #fff; box-shadow: 0 1px 4px #223d4c1a; }
.activity-chart { margin-top: 20px; --axis-width: 31px; }
.chart-area { display: flex; direction: ltr; height: 146px; }
.chart-axis { width: var(--axis-width); padding-block: 5px 4px; color: var(--muted); display: flex; flex-direction: column; justify-content: space-between; font-size: .75rem; line-height: 1; flex-shrink: 0; text-align: left; }
.chart-plot { position: relative; flex: 1; min-width: 0; }
.chart-plot canvas { display: block; width: 100%; height: 100%; }
.chart-labels { display: grid; direction: ltr; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 5px 0 0 var(--axis-width); color: var(--muted); font-size: .75rem; text-align: center; }
.chart-labels span { direction: rtl; white-space: nowrap; }
.chart-tooltip { position: absolute; min-width: 79px; padding: 5px 8px; border-radius: 8px; background: #153d38; color: #fff; pointer-events: none; font-size: .75rem; white-space: nowrap; text-align: center; }
.stage-summary { display: grid; grid-template-columns: minmax(98px, .86fr) minmax(130px, 1fr); gap: 15px; align-items: center; min-height: 164px; margin-top: 15px; }
.stage-ring { display: grid; place-items: center; width: min(100%, 135px); aspect-ratio: 1; margin: auto; padding: 13px; border-radius: 50%; background: var(--ring); }
.ring-center { display: grid; place-content: center; width: 100%; height: 100%; border-radius: 50%; text-align: center; background: var(--white); }
.ring-center strong { font-size: 1.7rem; line-height: 1.15; font-weight: 820; }
.ring-center span { color: var(--muted); font-size: .8125rem; }
.stage-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.stage-list li { display: flex; justify-content: space-between; align-items: center; gap: 6px; color: var(--muted-deep); font-size: .8125rem; }
.stage-list strong { color: var(--ink); font-weight: 760; }
.stage-legend { display: flex; align-items: center; gap: 7px; }

.recent-card { padding: 17px 17px 5px; }
.activity-list { margin-top: 12px; }
.activity-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(105px, .85fr) minmax(82px, .7fr); align-items: center; gap: 9px; min-height: 62px; padding-block: 7px; border-top: 1px solid var(--line-soft); }
.activity-clinic { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.activity-clinic strong, .activity-clinic small { display: block; }
.activity-clinic strong { font-size: .875rem; font-weight: 720; overflow-wrap: anywhere; line-height: 1.45; }
.activity-clinic small { color: var(--muted); }
.activity-clinic .tile-icon { width: 35px; height: 35px; border-radius: 10px; }
.activity-clinic .icon { width: 17px; height: 17px; }
.activity-row time { color: var(--muted); font-size: .8125rem; text-align: end; }
.empty-state { display: grid; justify-items: center; align-content: center; gap: 10px; min-height: 220px; padding: 24px 15px; text-align: center; }
.empty-state h3 { font-size: 1rem; font-weight: 750; }
.empty-state p { color: var(--muted); }
.error-page { max-width: 560px; margin: 9vh auto; }
.error-page h1 { font-size: 1.55rem; font-weight: 800; }

.records-card { overflow: hidden; }
.record-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px; }
.list-filters { display: flex; align-items: center; gap: 7px; min-width: 0; }
.filter-search { width: min(25vw, 265px); }
.list-filters .form-select { min-width: 128px; width: auto; }
.data-table { width: 100%; margin: 0; border-collapse: collapse; text-align: start; }
.data-table th, .data-table td { padding: 10px 12px; border-top: 1px solid var(--line-soft); text-align: start; }
.data-table tr > :first-child { padding-inline-start: 17px; }
.data-table tr > :last-child { padding-inline-end: 17px; }
.data-table thead { color: var(--muted-deep); background: #f7f9fa; font-size: .8125rem; }
.data-table thead th { white-space: nowrap; font-weight: 720; }
.data-table tbody { font-size: .875rem; }
.data-table tbody tr:hover { background: #fafcfb; }
.clinic-name { width: 24%; min-width: 160px; }
.clinic-name a { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 760; line-height: 1.5; overflow-wrap: anywhere; }
.clinic-name a:hover { color: var(--accent-dark); }
.clinic-avatar { width: 35px; height: 35px; border-radius: 10px; color: var(--tone-text); background: var(--tone-bg); }
.clinic-handle { display: inline-block; max-width: 115px; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted-link { color: var(--muted-deep); }
.muted-link:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.cell-empty { color: var(--muted); }
.row-actions { display: flex; align-items: center; gap: 5px; }
.row-actions .icon-button { min-width: 34px; min-height: 34px; border-radius: 8px; }
.row-actions .icon-button .icon { width: 17px; height: 17px; }
.pagination-bar { display: flex; justify-content: space-between; align-items: center; gap: 7px; min-height: 69px; border-top: 1px solid var(--line-soft); padding: 10px 17px; color: var(--muted); font-size: .8125rem; }
.page-controls { display: flex; gap: 4px; }
.page-button { min-width: 32px; min-height: 34px; }
.page-button.is-active { background: var(--accent-soft); border-color: #c4dfd7; color: var(--accent-dark); font-weight: 800; }

.form-card { padding: 18px; }
.clinic-form { max-width: 970px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.field { display: grid; gap: 5px; min-width: 0; align-content: start; }
.field-wide { grid-column: 1 / -1; }
.field > label, .field > legend { color: var(--ink); font-size: .875rem; font-weight: 700; margin: 0; }
.field > legend { float: none; margin-bottom: 2px; }
.required-mark, .field-validation-error, .form-alert { color: #a72f43; }
.field-validation-error { font-size: .8125rem; }
.form-alert { padding: 8px 11px; margin-top: 11px; border: 1px solid #f3ced5; border-radius: 9px; background: #fff4f5; font-size: .875rem; }
.form-alert ul, ul.form-alert { list-style: none; padding: 8px 11px; margin-bottom: 0; }
.form-alert ul { padding: 0; }
.validation-summary-valid, .field-validation-valid { display: none; }
.form-control, .form-select { width: 100%; min-height: 43px; padding: 8px 11px; border: 1px solid #dbe4e8; border-radius: var(--control-radius); font-size: 1rem; line-height: 1.45; color: var(--ink); background-color: #fff; }
.form-control::placeholder { color: #60757c; }
input.form-control[dir="ltr"], .input-password .form-control { text-align: start; }
.form-select { padding-inline-end: 31px; background-position: left 9px center; }
.form-control:focus, .form-select:focus { border-color: #429984; color: var(--ink); background-color: #fff; box-shadow: 0 0 0 3px #0b766923; }
.form-control.input-validation-error, .form-select.input-validation-error { border-color: #c95a6a; }
textarea.form-control { resize: vertical; }
.form-footer { display: flex; justify-content: end; align-items: center; gap: 7px; margin-top: 17px; padding-top: 13px; border-top: 1px solid var(--line); }
.input-icon, .input-password { position: relative; }
.input-icon > .icon { position: absolute; inset-inline-start: 11px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .form-control { padding-inline-start: 36px; }
.input-password .form-control { padding-inline-end: 42px; }
.plain-icon { position: absolute; inset-inline-end: 3px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 37px; height: 37px; color: var(--muted); background: transparent; border: 0; border-radius: 8px; }
.plain-icon:hover { background: #edf5f2; color: var(--accent-dark); }
.plain-icon .icon { width: 18px; height: 18px; }
.date-caption { min-height: 20px; color: var(--muted); line-height: 1.4; }
.date-caption:empty { display: none; }

.back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 5px; color: var(--muted-deep); font-size: .875rem; font-weight: 650; }
.back-link .icon { width: 16px; height: 16px; }
.detail-name { display: flex; align-items: center; gap: 11px; }
.detail-name > div { min-width: 0; }
.detail-name .clinic-avatar { width: 49px; height: 49px; font-size: 1.3rem; border-radius: 13px; }
.detail-name .status-pill { margin-top: 4px; }
.detail-tabs { display: flex; gap: 6px; width: fit-content; max-width: 100%; margin-bottom: 13px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #edf2f4; }
.detail-tabs a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 5px 11px; border-radius: 8px; color: var(--muted-deep); font-size: .875rem; font-weight: 700; }
.detail-tabs a.is-active { color: var(--accent-dark); background: var(--white); box-shadow: var(--shadow); }
.detail-tabs .icon { width: 17px; height: 17px; }
.tab-count { color: var(--accent-dark); background: var(--accent-soft); border-radius: 5px; padding-inline: 5px; font-size: .75rem; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 17px; }
.detail-grid > div { min-width: 0; padding: 11px 12px; background: #f7f9fa; border: 1px solid var(--line-soft); border-radius: 11px; }
.detail-grid dt, .detail-note h3 { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--muted-deep); font-size: .875rem; font-weight: 670; }
.detail-grid dt .icon, .detail-note .icon { width: 16px; height: 16px; color: var(--accent); }
.detail-grid dd { margin-top: 4px; overflow-wrap: anywhere; font-size: .9375rem; font-weight: 620; }
.detail-grid a { display: inline-block; }
.detail-note { margin-top: 14px; padding: 11px 12px; border-radius: 11px; border: 1px solid var(--line); }
.detail-note p, .history-note { white-space: pre-line; overflow-wrap: anywhere; }
.detail-note p { margin-top: 4px; }
.table-channel { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.table-channel .tile-icon { width: 31px; height: 31px; border-radius: 9px; }
.table-channel .icon { width: 16px; height: 16px; }
.history-table th, .history-table td { max-width: 340px; }
.history-table time { white-space: nowrap; }

.panel-dialog { width: min(94vw, 550px); max-height: min(88dvh, 750px); margin: auto; padding: 0; overflow: auto; border: 1px solid #d5e1e4; border-radius: 19px; background: #fff; box-shadow: 0 20px 100px #142e4073; color: var(--ink); }
.panel-dialog::backdrop { background: #102c37a0; backdrop-filter: blur(3px); }
.panel-dialog[open] { animation: surface-in .2s ease-out; }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.dialog-body { display: grid; gap: 13px; padding: 16px; }
.dialog-body .form-grid { margin-top: 0; }
.panel-dialog .form-footer { margin-top: 0; padding: 11px 16px; }
.channel-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.channel-option { position: relative; }
.channel-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.option-body { height: 100%; display: grid; gap: 4px; justify-items: center; align-content: center; padding: 7px 3px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted-deep); font-size: .875rem; font-weight: 650; text-align: center; cursor: pointer; }
.option-body:hover { background: #f2f8f6; }
.option-body .tile-icon { width: 31px; height: 31px; border-radius: 8px; }
.option-body .icon { width: 17px; height: 17px; }
.channel-option input:checked + .option-body { border-color: #1a8c77; background: #e8f6f1; color: var(--accent-dark); }
.channel-option input:focus-visible + .option-body { outline: 3px solid #158775; outline-offset: 2px; }

.kanban-tools { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 11px; }
.board-total, .kanban-tools p { display: flex; align-items: center; gap: 6px; color: var(--muted-deep); font-size: .875rem; }
.board-total { white-space: nowrap; padding: 5px 9px; background: #e9f2f1; border-radius: 8px; color: var(--accent-dark); font-weight: 700; }
.kanban-tools .icon { width: 17px; height: 17px; }
.board-hint-mobile, .board-jump { display: none; }
.board { display: grid; grid-template-columns: repeat(5, minmax(205px, 1fr)); align-items: start; gap: 10px; overflow-x: auto; overscroll-behavior-inline: contain; padding-bottom: 9px; scrollbar-color: #b9cdcf transparent; }
.board-column { min-width: 0; min-height: 203px; padding: 9px; border: 1px solid var(--line); border-radius: 15px; background: #edf2f4; transition: background .18s, border-color .18s; scroll-margin-block: 70px; }
.board-column.is-target { border-color: #198a73; background: #dff2ec; }
.column-header { display: flex; align-items: center; gap: 6px; margin-bottom: 9px; min-height: 32px; padding: 4px 6px; border-radius: 8px; background: var(--tone-bg); color: var(--tone-text); }
.column-header h2 { flex: 1; font-size: .875rem; font-weight: 820; line-height: 1.4; }
.column-count { padding: 1px 7px; border-radius: 6px; background: #fff9; font-size: .75rem; font-weight: 760; }
.board-cards { display: grid; gap: 7px; }
.board-card { min-width: 0; padding: 8px; border: 1px solid #dce5e9; border-radius: 11px; background: var(--white); box-shadow: var(--shadow); cursor: grab; transition: opacity .18s; }
.board-card.is-dragging, .board-card.is-busy { opacity: .48; }
.board-card-heading { display: flex; align-items: center; gap: 6px; }
.board-card-heading .avatar { width: 30px; height: 30px; border-radius: 8px; }
.board-card-name { flex: 1; color: var(--ink); font-size: .875rem; font-weight: 750; overflow-wrap: anywhere; line-height: 1.5; }
.drag-handle { color: #698088; }
.drag-handle .icon { width: 15px; height: 15px; }
.board-phone { display: flex; align-items: center; gap: 5px; margin: 5px 1px; font-size: .8125rem; }
.board-phone .icon, .last-action .icon { width: 14px; height: 14px; }
.board-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 5px; padding: 5px 0; color: var(--muted); font-size: .8125rem; }
.last-action { display: flex; align-items: center; gap: 4px; }
.move-menu { border-top: 1px solid var(--line-soft); }
.move-menu summary { display: flex; align-items: center; gap: 4px; min-height: 32px; color: var(--muted-deep); font-size: .8125rem; cursor: pointer; list-style: none; }
.move-menu summary::-webkit-details-marker { display: none; }
.move-menu summary .icon { width: 14px; height: 14px; }
.move-menu summary .icon:last-child { margin-inline-start: auto; transition: transform .18s; }
.move-menu[open] summary .icon:last-child { transform: rotate(180deg); }
.move-form { display: grid; gap: 5px; padding-bottom: 3px; }
.move-form .form-select { min-height: 37px; font-size: .875rem; }
.move-form .action { min-height: 34px; }
.board-empty { margin: 5px 0; padding: 14px 4px; color: var(--muted); text-align: center; font-size: .8125rem; }
.board-add { display: flex; justify-content: center; align-items: center; gap: 5px; margin-top: 8px; padding: 7px 3px; text-align: center; border: 1px dashed #b5cccf; border-radius: 8px; color: var(--accent-dark); font-size: .8125rem; font-weight: 680; }
.board-add:hover { background: #e4f2ee; border-color: #69a79b; }
.board-add .icon { width: 15px; height: 15px; }
.board-feedback { position: fixed; inset-inline-end: 16px; bottom: 18px; z-index: 7; padding: 8px 13px; border: 1px solid #bddbd1; border-radius: 10px; background: #fff; color: var(--accent-dark); box-shadow: var(--shadow); }
.board-feedback.is-error { color: #a33542; border-color: #f1c4cd; }

.report-filters { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 17px; margin-bottom: 15px; }
.report-filter-fields { display: flex; align-items: center; gap: 8px; }
.report-filter-fields .form-control { min-width: 132px; }
.report-filter-fields .action { margin-top: 2px; }
.report-alert { display: flex; align-items: center; gap: 7px; }
.admin-filter, .admin-row-actions { display: flex; align-items: center; gap: 7px; }
.admin-filter .form-select { min-width: 0; }
.admin-row-actions { flex-wrap: wrap; }
.admin-mobile-link { display: none; }
.report-analytics .chart-area { height: 155px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(250px, 1fr); gap: 15px; align-items: start; }
.settings-main { display: grid; gap: 15px; }
.profile-preview { display: grid; justify-items: center; gap: 3px; padding: 18px 7px; }
.profile-photo { width: 82px; height: 82px; margin-bottom: 3px; border: 1px solid #cee5dd; border-radius: 25px; font-size: 1.65rem; color: var(--accent-dark); }
.profile-preview strong, .profile-handle { overflow-wrap: anywhere; }
.profile-handle { color: var(--muted); font-size: .875rem; }
.photo-form { display: grid; gap: 8px; }
.photo-picker { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 44px; padding: 4px; border: 1px solid var(--line); border-radius: var(--control-radius); }
.photo-picker:focus-within { border-color: #429984; box-shadow: 0 0 0 3px #0b766923; }
.photo-picker .action { min-height: 32px; padding: 3px 7px; cursor: pointer; }
.photo-picker span { min-width: 0; overflow: hidden; color: var(--muted); font-size: .8125rem; text-overflow: ellipsis; white-space: nowrap; }
.picture-card form + form { margin-top: 7px; }
.picture-card form .action { width: 100%; }
.panel-toast { position: fixed; z-index: 10; inset-inline-end: 17px; bottom: 17px; display: flex; align-items: center; gap: 8px; padding: 7px 8px; max-width: calc(100vw - 34px); background: #fff; border: 1px solid #b8dcd0; border-radius: 12px; box-shadow: 0 7px 24px #22493c2b; color: var(--accent-dark); font-size: .875rem; font-weight: 710; animation: surface-in .2s ease-out; }
.toast-icon { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; background: var(--accent-soft); }
.toast-icon .icon { width: 17px; height: 17px; }
.panel-toast .icon-button { min-width: 31px; min-height: 31px; border: 0; }
@keyframes surface-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.guest-body { min-height: 100dvh; background: #eff6f3; }
.login-shell { display: grid; grid-template-columns: minmax(430px, 1fr) minmax(380px, 1.05fr); min-height: 100dvh; max-width: 1700px; margin: auto; padding: 16px; }
.login-content { display: grid; justify-items: center; align-items: center; padding: 34px 21px; }
.login-form-wrap { width: min(100%, 410px); }
.login-form-wrap .brand { margin-bottom: 33px; }
.login-form-wrap .brand strong { font-size: 1.45rem; }
.login-form-wrap .brand small { font-size: .8125rem; }
.login-heading { margin-bottom: 22px; }
.login-heading h1 { font-size: clamp(1.55rem, 2.85vw, 2.03rem); line-height: 1.45; font-weight: 860; }
.login-heading p { margin-top: 5px; color: var(--muted-deep); font-size: .9375rem; }
.login-form { display: grid; gap: 12px; }
.login-form .form-control { min-height: 49px; }
.login-form .form-alert { margin-top: 0; }
.check-line { display: flex; align-items: center; gap: 7px; width: fit-content; color: var(--muted-deep); font-size: .875rem; cursor: pointer; }
.check-line .form-check-input { margin: 0; width: 18px; height: 18px; cursor: pointer; }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.login-submit { min-height: 48px; font-size: .9375rem; }
.login-art { position: relative; isolation: isolate; display: grid; align-content: center; justify-items: center; gap: 32px; overflow: hidden; min-height: 540px; padding: 25px; border-radius: 26px; color: #fff; background: radial-gradient(ellipse at 34% 18%, #2e7867, transparent 63%), linear-gradient(156deg, #1a584d, #123d39 76%); }
.login-art::before { opacity: .8; mask-image: radial-gradient(ellipse at 48% 41%, #000, transparent 75%); }
.login-illustration { position: relative; width: min(100%, 430px); height: 265px; }
.login-illustration .art-main { left: 22%; top: 9%; width: 58%; height: 79%; grid-template-rows: 26px 29px 1fr; padding: 15px; gap: 10px; }
.art-lines { display: grid; align-content: center; gap: 5px; }
.art-lines i { height: 4px; width: 38%; background: #d4fff767; border-radius: 5px; }
.art-lines i:nth-child(2) { width: 28%; }
.art-lines i:nth-child(3) { width: 33%; }
.login-illustration .art-small { left: 70%; top: 55%; width: 23%; height: 37%; }
.login-illustration .art-check { left: 13%; top: 17%; width: 46px; height: 46px; }
.login-orbit { left: 49%; top: 42%; }
.login-orbit-one { width: 316px; height: 316px; }
.login-orbit-two { width: 406px; height: 406px; }
.login-orbit-three { width: 500px; height: 500px; }
.login-art-copy { position: relative; text-align: center; }
.login-art-copy h2 { font-size: clamp(1.32rem, 2.6vw, 2.08rem); font-weight: 850; }
.login-art-copy p { margin-top: 6px; color: #ddf3ed; }

@media (max-width: 1099px) {
    .admin-mobile-link { display: inline-grid; }
    .sidebar, .topbar-title { display: none; }
    .workspace { margin-inline-start: 0; }
    .topbar { position: sticky; top: 0; z-index: 5; }
    .topbar-inner { height: 61px; padding-inline: 20px; }
    .mobile-brand { display: inline-flex !important; }
    .mobile-avatar { display: inline-grid !important; width: 37px; height: 37px; }
    .main-content { padding: 19px 20px calc(89px + env(safe-area-inset-bottom)); }
    .bottom-nav { position: fixed; z-index: 6; inset: auto 0 0; display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; max-width: 620px; margin-inline: auto; padding: 5px max(6px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); background: #fffffff7; border: 1px solid var(--line); border-radius: 16px 16px 0 0; box-shadow: 0 -3px 20px #193d5021; backdrop-filter: blur(10px); }
    .bottom-link { display: grid; justify-items: center; align-content: center; gap: 1px; min-height: 51px; padding: 2px; border-radius: 9px; color: var(--muted-deep); font-size: .75rem; font-weight: 650; white-space: nowrap; }
    .bottom-icon { display: grid; place-items: center; width: 39px; height: 27px; border-radius: 9px; }
    .bottom-icon .icon { width: 19px; height: 19px; }
    .bottom-link.is-active { color: var(--accent-dark); font-weight: 820; }
    .bottom-link.is-active .bottom-icon { background: var(--accent-soft); }
    .panel-toast, .board-feedback { bottom: calc(73px + env(safe-area-inset-bottom)); }
    .mobile-logout { display: block !important; }
    .board { grid-template-columns: repeat(5, minmax(208px, 1fr)); scroll-snap-type: inline proximity; }
    .board-column { scroll-snap-align: start; }
    .board-jump { display: flex; gap: 5px; overflow-x: auto; padding: 3px 3px 8px; }
    .board-jump a:hover { color: var(--tone-text); box-shadow: inset 0 0 0 1px var(--tone-dot); }
}

@media (max-width: 800px) {
    .history-table tbody .admin-row-actions { grid-column: 1 / -1; }
    .history-table .table-channel { white-space: normal; overflow-wrap: anywhere; }
    .analytics-grid { grid-template-columns: 1fr; gap: 11px; }
    .stage-summary { grid-template-columns: minmax(90px, .7fr) minmax(130px, 1fr); gap: 14px; min-height: 143px; }
    .stage-list { padding-inline-end: 9px; }
    .activity-chart { margin-top: 15px; }
    .record-toolbar { align-items: stretch; flex-direction: column; gap: 10px; }
    .list-filters > .filter-search { flex: 1; width: auto; }
    .clinic-table thead, .history-table thead, .report-table thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
    .clinic-table, .clinic-table tbody, .history-table, .history-table tbody, .report-table, .report-table tbody { display: block; }
    .clinic-table tbody, .history-table tbody, .report-table tbody { display: grid; gap: 8px; padding: 0 10px 10px; }
    .clinic-table tbody tr, .history-table tbody tr, .report-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 9px; border: 1px solid var(--line); border-radius: 11px; padding: 9px; }
    .clinic-table tbody tr > *, .history-table tbody tr > *, .report-table tbody tr > * { min-width: 0; max-width: none; padding: 0; border: 0; }
    .clinic-table .clinic-name { width: auto; grid-column: 1 / -1; }
    .clinic-table [data-label], .history-table [data-label], .report-table [data-label] { display: grid; align-content: start; justify-items: start; gap: 2px; color: var(--ink); }
    .clinic-table [data-label]::before, .history-table [data-label]::before, .report-table [data-label]::before { content: attr(data-label); font-size: .8125rem; color: var(--muted); }
    .clinic-table .clinic-actions { align-self: end; justify-self: end; }
    .clinic-handle { max-width: 100%; }
    .history-table tbody th, .report-table tbody th, .history-note { grid-column: 1 / -1; }
    .clinic-table tbody th, .history-table tbody th, .report-table tbody th { margin-bottom: 2px; padding-bottom: 5px; border-bottom: 1px solid var(--line-soft); }
    .settings-grid { grid-template-columns: 1fr; }
    .picture-card { grid-row: 1; }
    .login-shell { grid-template-columns: 1fr; min-height: 100dvh; padding: 0; }
    .login-art { display: none; }
    .login-content { padding: 24px 19px; }
    .login-form-wrap { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
    .login-form-wrap .brand { margin-bottom: 21px; }
}

@media (max-width: 575px) {
    .topbar-inner { height: 55px; padding-inline: max(11px, env(safe-area-inset-right)) max(11px, env(safe-area-inset-left)); }
    .topbar-actions { gap: 7px; }
    .topbar-date { display: none; }
    .topbar-search { min-width: 36px; min-height: 36px; }
    .main-content { padding: 13px 11px calc(77px + env(safe-area-inset-bottom)); }
    .page-heading { align-items: start; gap: 8px; margin-bottom: 12px; }
    .page-heading h1 { font-size: 1.52rem; }
    .page-heading p { margin-top: 2px; font-size: .875rem; }
    .page-heading > .action { gap: 4px; min-height: 38px; padding: 5px 8px; margin-top: 2px; }
    .page-heading > .action .icon { width: 16px; height: 16px; }
    .welcome { min-height: 161px; padding: 14px 12px; margin-bottom: 10px; border-radius: 15px; }
    .welcome-content { max-width: 78%; }
    .welcome h2 { font-size: 1.55rem; line-height: 1.4; }
    .welcome p { font-size: .875rem; }
    .welcome .action { min-height: 35px; margin-top: 9px; }
    .welcome-art { width: 51%; opacity: .66; transform: translateX(-7%); }
    .art-main { width: 62%; top: 25%; height: 55%; left: 13%; padding: 7px; gap: 3px; grid-template-rows: 16px 1fr; }
    .art-check { left: 7%; top: 24%; width: 29px; height: 29px; border-radius: 8px; }
    .art-check .icon { width: 17px; height: 17px; }
    .art-small { left: 61%; top: 52%; height: 32%; min-width: 43px; padding: 5px; }
    .art-small .icon { width: 15px; height: 15px; }
    .channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
    .channel-card { padding: 9px; border-radius: 14px; }
    .channel-card .tile-icon { width: 36px; height: 36px; border-radius: 10px; }
    .channel-card .icon { width: 19px; height: 19px; }
    .channel-value { margin-top: 5px; }
    .channel-value strong { font-size: 1.53rem; }
    .channel-card h2 { font-size: .875rem; }
    .today-pill { padding: 2px 5px; }
    .surface { border-radius: 14px; }
    .analytics-grid { margin-bottom: 10px; gap: 8px; }
    .analytics-card { padding: 10px; }
    .section-title { gap: 6px; }
    .section-title h2 { font-size: 1rem; }
    .section-title .tile-icon { width: 34px; height: 34px; border-radius: 9px; }
    .section-title .tile-icon .icon { width: 17px; height: 17px; }
    .section-heading { gap: 6px; }
    .stage-ring { width: min(100%, 112px); padding: 10px; }
    .chart-labels-dense span:nth-child(even) { visibility: hidden; }
    .chart-labels { font-size: .75rem; }
    .recent-card { padding: 10px 9px 3px; }
    .recent-card .action { min-height: 35px; padding: 4px 6px; font-size: .8125rem; }
    .activity-row { grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, auto); gap: 4px; }
    .activity-clinic { gap: 5px; }
    .activity-row .status-pill { padding-inline: 5px; gap: 3px; font-size: .75rem; }
    .activity-row time { font-size: .75rem; }
    .list-filters { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
    .filter-search { grid-column: 1 / -1; }
    .list-filters .form-select { width: 100%; }
    .record-toolbar, .form-card { padding: 10px; }
    .form-grid, .detail-grid { gap: 7px; }
    .form-card .form-grid { grid-template-columns: 1fr; }
    .form-control, .form-select { min-height: 45px; }
    .detail-name { gap: 7px; }
    .detail-name .clinic-avatar { width: 42px; height: 42px; }
    .detail-heading > .action { align-self: end; }
    .dialog-body { gap: 10px; padding: 10px; }
    .dialog-header { padding: 10px; }
    .panel-dialog .form-footer { padding: 9px 10px; }
    .channel-options { gap: 4px; }
    .option-body { font-size: .8125rem; }
    .kanban-tools { align-items: start; margin-bottom: 6px; }
    .kanban-tools p { font-size: .8125rem; }
    .board-hint-desktop, .drag-handle { display: none; }
    .board-hint-mobile { display: inline; }
    .board { grid-template-columns: repeat(5, minmax(215px, 82%)); gap: 7px; scroll-snap-type: inline mandatory; }
    .board-card { cursor: auto; }
    .move-menu summary, .board-add { min-height: 39px; }
    .report-filters { flex-direction: column; align-items: stretch; padding: 10px; gap: 7px; }
    .report-filter-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .report-filter-fields .form-control { min-width: 0; }
    .report-filter-fields .action { grid-column: 1 / -1; }
}

@media (max-width: 360px) {
    .channel-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

