@font-face {
    font-family: 'Vazirmatn';
    src: url('/assets/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-soft: #f1f3f5;
    --surface-tint: #fbfcfe;
    --text: #18202a;
    --muted: #697586;
    --line: #dfe4ea;
    --line-strong: #cfd7e3;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #15803d;
    --danger: #b91c1c;
    --radius-sm: 14px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius: var(--radius-md);
    --shadow-soft: 0 10px 24px rgba(15, 23, 42, .05);
    --shadow: 0 16px 40px rgba(15, 23, 42, .08);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, .14);
    --space-1: 8px;
    --space-2: 12px;
    --space-3: 16px;
    --space-4: 20px;
    --space-5: 24px;
    --space-6: 30px;
    --text-lg: clamp(1.75rem, 3vw, 2.35rem);
    --text-md: 1.18rem;
    --text-sm: .95rem;
    --text-xs: .84rem;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Vazirmatn, IRANSans, Tahoma, Arial, sans-serif;
    line-height: 1.65;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body.site-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.site-layout > :not(.site-header):not(.site-footer):not(script):not(.notification-gate) {
    flex: 1 0 auto;
}

body:has(.notification-gate:not(.is-hidden)) {
    overflow: hidden;
}

body.jalali-picker-open {
    overflow: hidden;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

.eyebrow {
    margin: 0 0 8px !important;
    color: var(--primary) !important;
    font-weight: 800;
    font-size: .79rem;
    letter-spacing: .03em;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 120;
    background: rgba(246, 247, 249, .88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(207, 215, 227, .7);
}

.site-header-inner,
.site-footer-inner {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
    min-height: 78px;
}

.site-brand {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.site-brand strong {
    font-size: 1rem;
    line-height: 1.4;
}

.site-brand span {
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.6;
}

.site-nav-toggle {
    display: none;
    width: auto;
    margin: 0;
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 14px;
    box-shadow: none;
}

.site-nav-toggle-lines {
    display: inline-grid;
    gap: 5px;
}

.site-nav-toggle-lines span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform .15s ease, opacity .15s ease;
}

.site-header.is-nav-open .site-nav-toggle-lines span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.site-header.is-nav-open .site-nav-toggle-lines span:nth-child(2) {
    opacity: 0;
}

.site-header.is-nav-open .site-nav-toggle-lines span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.site-nav a {
    padding: 9px 12px;
    border-radius: 999px;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 800;
    transition: background .15s ease, color .15s ease;
}

.site-nav a:hover,
.site-nav a.is-active {
    background: #fff;
    color: var(--primary-dark);
}

.site-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    align-items: center;
}

.site-header-actions .button {
    width: auto;
    margin: 0;
}

.site-account-menu {
    position: relative;
}

.site-account-trigger {
    min-width: 148px;
}

.site-account-dropdown {
    position: absolute;
    left: 0;
    top: calc(100% + 10px);
    min-width: 220px;
    padding: 8px;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow);
    display: grid;
    gap: 4px;
}

.site-account-dropdown[hidden] {
    display: none !important;
}

.site-account-dropdown a {
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--text);
    font-size: .84rem;
    font-weight: 700;
    line-height: 1.5;
}

.site-account-dropdown a:hover {
    background: #f8fafc;
    color: var(--primary-dark);
}

.site-footer {
    margin-top: auto;
    padding: 28px 0 34px;
    border-top: 1px solid var(--line-strong);
    background: linear-gradient(180deg, rgba(255, 255, 255, .36) 0%, rgba(255, 255, 255, .7) 100%);
}

.site-footer-inner {
    display: block;
}

.site-footer-copy {
    margin: 0;
    color: var(--muted);
    font-size: .84rem;
    text-align: center;
    line-height: 1.9;
}

.content-section {
    display: grid;
    gap: 22px;
    margin-top: 32px;
}

.section-title {
    margin: 0;
    font-size: clamp(1.08rem, 1.45vw, 1.34rem);
    line-height: 1.35;
    letter-spacing: -.02em;
}

.section-copy {
    margin: -6px 0 0;
    color: var(--muted);
    font-size: .86rem;
    line-height: 1.9;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(260px, .92fr);
    align-items: center;
    gap: 28px;
}

.hero-copy {
    display: grid;
    gap: 10px;
}

.hero-media {
    margin: 0;
    min-width: 0;
}

.hero-media img {
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.hero-actions .button {
    width: auto;
    margin: 0;
}

.info-card,
.faq-item {
    background: transparent;
    border: 0;
    border-top: 1px solid var(--line-strong);
    border-radius: 0;
    box-shadow: none;
}

.info-card,
.faq-item {
    display: grid;
    gap: 8px;
    padding: 18px;
}

.info-card strong,
.faq-item strong {
    font-size: 1rem;
    line-height: 1.55;
}

.info-card p,
.faq-item p,
.info-card span {
    margin: 0;
    color: var(--muted);
    font-size: .84rem;
    line-height: 1.9;
}

.service-showcase {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.service-side-stack {
    display: grid;
    gap: 0;
}

.service-feature,
.address-band {
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    min-width: 0;
}

.service-feature {
    display: grid;
    gap: 12px;
    padding: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    box-shadow: var(--shadow-soft);
}

.service-feature-main {
    align-content: space-between;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, .08), transparent 55%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.service-feature-accent {
    align-content: space-between;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, .08), transparent 35%),
        linear-gradient(180deg, #0f172a 0%, #1f2937 100%);
    border-color: rgba(148, 163, 184, .24);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .22);
}

.service-feature-kicker {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(37, 99, 235, .1);
    color: var(--primary-dark);
    font-size: .72rem;
    font-weight: 800;
    line-height: 1.4;
}

.service-feature p {
    margin: 0;
    color: var(--muted);
    font-size: .84rem;
    line-height: 1.9;
}

.service-feature-meta {
    color: var(--primary-dark);
    font-size: .76rem;
    font-weight: 800;
    line-height: 1.8;
}

.service-feature-actions {
    display: flex;
    justify-content: flex-start;
}

.service-feature-actions .button {
    width: auto;
    margin: 0;
}

.service-feature strong {
    font-size: .95rem;
    line-height: 1.7;
}

.service-feature-accent .service-feature-kicker {
    background: rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .92);
}

.service-feature-accent strong {
    color: #fff;
}

.service-feature-accent p {
    color: rgba(255, 255, 255, .78);
}

.service-feature-accent .service-feature-meta {
    color: rgba(255, 255, 255, .62);
}

.service-feature-accent .button {
    background: #fff;
    color: var(--primary-light);
    box-shadow: none;
}

.service-feature-accent .button:hover {
    background: #f8fafc;
    color: var(--primary-light);
}

.address-band {
    display: grid;
    gap: 8px;
    padding: 20px 22px;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .04), transparent 60%),
        linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
    box-shadow: var(--shadow-soft);
}

.address-band p {
    margin: 0;
    color: var(--text);
    font-size: .9rem;
    line-height: 1.95;
}

.faq-stack {
    display: grid;
    gap: 0;
}

.faq-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 18px 0;
}

.faq-item strong {
    font-size: .9rem;
    line-height: 1.75;
}

.faq-item:first-child {
    border-top: 0;
    padding-top: 0;
}

.auth-page,
.patient-shell,
.admin-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 28px auto 36px;
    min-width: 0;
}

.auth-page {
    min-height: calc(100vh - 64px);
    display: grid;
    place-items: center;
}

.auth-card,
.patient-card,
.patient-hero,
.admin-hero,
.panel,
.notification-gate-card {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    min-width: 0;
}

.auth-card {
    width: min(440px, 100%);
    padding: 30px;
}

.auth-card-wide {
    width: min(520px, 100%);
}

.auth-card h1,
.patient-hero h1,
.admin-hero h1 {
    margin: 0;
    font-size: clamp(1.44rem, 2vw, 1.78rem);
    line-height: 1.22;
    letter-spacing: -.03em;
    font-weight: 900;
}

.auth-card h1 {
    font-size: clamp(1.46rem, 2.2vw, 1.86rem);
}

.auth-card label,
.form-grid label,
.field-grid label {
    display: grid;
    gap: 8px;
}

.auth-card form {
    display: grid;
    gap: 16px;
}

.auth-card label {
    margin-top: 0;
}

.auth-help {
    color: var(--muted);
    font-size: var(--text-sm);
    line-height: 1.75;
    margin: 0;
}

.auth-context {
    display: grid;
    gap: 0;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
    margin-top: 14px;
}

.auth-panel[hidden] {
    display: none !important;
}

.auth-panel {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.auth-panel.is-active {
    animation: authPanelEnter .2s ease;
}

.auth-panel-copy {
    margin-top: 0;
    margin-bottom: 2px;
}

.auth-panel-copy strong {
    display: block;
    font-size: .9rem;
    line-height: 1.55;
    color: var(--muted);
}

.auth-help-strong {
    color: var(--text);
    font-weight: 800;
}

.inline-auth-form {
    margin-top: 0;
}

@keyframes authPanelEnter {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card span,
.form-grid label span,
.form-grid legend,
.field-grid span,
.date-filter label {
    color: var(--muted);
    font-size: var(--text-xs);
    font-weight: 700;
    line-height: 1.45;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    padding: 11px 14px;
    outline: none;
    line-height: 1.45;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.select-shell,
.jalali-date-input {
    position: relative;
    display: grid;
    gap: 8px;
}

.select-shell {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, transform .15s ease;
}

.select-shell:hover {
    border-color: rgba(37, 99, 235, .18);
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
}

.select-shell select {
    appearance: none;
    min-height: 48px;
    padding-inline-start: 14px;
    padding-inline-end: 44px;
    background: transparent;
    border: 0;
    box-shadow: none;
    font-weight: 700;
    color: var(--text);
}

.select-shell.has-value {
    border-color: rgba(37, 99, 235, .18);
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
}

.select-shell-caret {
    position: absolute;
    inset-inline-end: 14px;
    top: 50%;
    width: 10px;
    height: 10px;
    border-inline-end: 2px solid #8a96a8;
    border-bottom: 2px solid #8a96a8;
    transform: translateY(-60%) rotate(-45deg);
    pointer-events: none;
}

.jalali-date-shell {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.jalali-date-shell:focus-within,
.select-shell:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.jalali-date-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    background: #eef4ff;
    color: var(--primary-dark);
    font-size: .74rem;
    font-weight: 800;
    white-space: nowrap;
}

.jalali-date-input input[data-jalali-display] {
    cursor: pointer;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0 2px;
}

.jalali-date-button {
    width: auto;
    margin-top: 0;
    min-height: 40px;
    padding: 9px 14px;
    border-radius: 12px;
    font-size: .8rem;
    white-space: nowrap;
}

.jalali-picker-popover {
    position: fixed;
    inset: 0;
    z-index: 240;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(15, 23, 42, .2);
    backdrop-filter: blur(4px);
}

.jalali-picker-popover[hidden] {
    display: none !important;
}

.jalali-picker-sheet {
    width: min(560px, 100%);
    max-height: min(88vh, 860px);
    overflow: visible;
    padding: 16px;
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    box-shadow: var(--shadow-lg);
}

.jalali-picker-sheet>strong[data-jalali-title] {
    display: block;
    margin-bottom: 10px;
    font-size: var(--text-sm);
    line-height: 1.45;
    font-weight: 900;
}

.jalali-picker-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
    margin-bottom: 14px;
}

.jalali-picker-field {
    display: grid;
    gap: 6px;
}

.jalali-picker-field span {
    color: var(--muted);
    font-size: .73rem;
    font-weight: 800;
    line-height: 1.45;
}

.jalali-picker-select-shell,
.jalali-picker-dropdown {
    min-width: 0;
}

.jalali-picker-dropdown {
    position: relative;
}

.jalali-picker-trigger {
    width: 100%;
    min-height: 44px;
    padding: 10px 40px 10px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
    color: var(--text);
    font-size: .84rem;
    font-weight: 700;
    line-height: 1.5;
    justify-content: flex-start;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.jalali-picker-trigger:hover {
    border-color: rgba(37, 99, 235, .18);
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
}

.jalali-picker-trigger[aria-expanded="true"] {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.jalali-picker-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 2;
    display: grid;
    gap: 4px;
    max-height: 220px;
    padding: 8px;
    overflow: auto;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
}

.jalali-picker-menu[hidden] {
    display: none !important;
}

.jalali-picker-option {
    width: 100%;
    padding: 9px 10px;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.5;
    justify-content: flex-start;
    box-shadow: none;
}

.jalali-picker-option:hover {
    background: #f7faff;
    color: var(--primary-dark);
}

.jalali-picker-option.is-active {
    background: #eef4ff;
    color: var(--primary-dark);
}

.jalali-picker-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.jalali-picker-actions .button {
    min-width: 120px;
}

.jalali-picker-grid {
    display: none;
}

textarea {
    resize: vertical;
    direction: rtl;
    text-align: right;
    line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.jalali-date-input input[data-jalali-display]:focus,
.select-shell select:focus {
    border-color: transparent;
    box-shadow: none;
}

button,
.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: var(--primary);
    color: #fff;
    border-radius: 14px;
    padding: 11px 16px;
    font-size: var(--text-sm);
    font-weight: 800;
    line-height: 1.35;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .16);
    transition: background .15s ease, transform .15s ease, box-shadow .15s ease, border-color .15s ease, color .15s ease;
}

.button-secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: none;
}

.button-secondary:hover {
    background: #f8fafc;
    border-color: rgba(37, 99, 235, .18);
    color: var(--primary-dark);
}



button:not(.button-secondary):active,
.button:not(.button-secondary):active {
    transform: translateY(1px);
    box-shadow: 0 6px 14px rgba(29, 78, 216, .16);
}

.auth-card button,
.patient-card button {
    width: 100%;
    margin-top: 0;
}

.flash {
    margin: 16px 0 18px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line-strong);
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
    font-size: var(--text-sm);
    line-height: 1.65;
    box-shadow: var(--shadow-soft);
}

.auth-card>.flash:first-of-type {
    margin-top: 16px;
}

.flash-success {
    border-color: #bbf7d0;
    background: linear-gradient(180deg, #f8fff9 0%, #eefcf2 100%);
    color: var(--success);
}

.flash-danger {
    border-color: #fecaca;
    background: linear-gradient(180deg, #fff9f9 0%, #fef1f1 100%);
    color: var(--danger);
}

.toast-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1400;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 36px));
    pointer-events: none;
}

.app-toast {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line-strong);
    background: #fff;
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px);
    opacity: 0;
    transition: opacity var(--transition), transform var(--transition);
    pointer-events: auto;
}

.app-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.app-toast-success {
    border-color: #bbf7d0;
    background: linear-gradient(180deg, #f8fff9 0%, #eefcf2 100%);
    color: var(--success);
}

.app-toast-danger {
    border-color: #fecaca;
    background: linear-gradient(180deg, #fff9f9 0%, #fef1f1 100%);
    color: var(--danger);
}

.app-toast-message {
    font-size: .84rem;
    font-weight: 700;
    line-height: 1.7;
}

.app-toast-close {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, .08);
    background: rgba(255, 255, 255, .72);
    color: inherit;
    box-shadow: none;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    min-width: 0;
}

.notification-gate {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, .52);
    backdrop-filter: blur(5px);
}

.notification-gate.is-hidden {
    display: none;
}

.notification-gate-card {
    width: min(460px, 100%);
    padding: 26px;
}

.notification-gate-card h2 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.4;
}

.notification-gate-text,
.notification-gate-status {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: var(--text-sm);
    line-height: 1.7;
}

.notification-gate-button {
    width: 100%;
    margin-top: 18px;
}

.patient-hero {
    display: grid;
    gap: 2px;
    padding: 32px var(--space-6) 28px;
    margin-bottom: 18px;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, .06), transparent 32%),
        linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
}

.patient-hero p,
.admin-hero p,
.panel-head p {
    color: var(--muted);
    margin: 8px 0 0;
    font-size: .86rem;
    line-height: 1.85;
}

.patient-card {
    padding: var(--space-5);
}

.auth-required-card,
.patient-create-box {
    display: grid;
    gap: 14px;
}

.account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.account-actions-spaced {
    margin: 16px 0 24px;
}

.auth-required-card h2 {
    margin: 0;
    font-size: var(--text-md);
}

.auth-required-card p {
    margin: 0;
    color: var(--muted);
    font-size: var(--text-sm);
    line-height: 1.7;
}

.patient-steps-form {
    display: grid;
    gap: 24px;
}

.stepper {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.stepper-item {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 14px 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .04);
    color: var(--muted);
    position: relative;
    text-align: center;
}

.stepper-item.is-active,
.stepper-item.is-done {
    color: var(--text);
}

.stepper-item.is-active {
    border-color: rgba(37, 99, 235, .24);
    background: #f4f8ff;
}

.stepper-item.is-done {
    border-color: rgba(21, 128, 61, .18);
    background: #f3fcf6;
}

.stepper-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #e9eef5;
    color: var(--text);
    font-size: .84rem;
    font-weight: 800;
    flex: 0 0 auto;
    position: relative;
    z-index: 1;
}

.stepper-item.is-active .stepper-number {
    background: var(--primary);
    color: #fff;
}

.stepper-item.is-done .stepper-number {
    background: var(--success);
    color: #fff;
}

.stepper-label {
    font-size: var(--text-xs);
    font-weight: 800;
    line-height: 1.35;
}

.form-step {
    display: grid;
    gap: 20px;
}

.form-step[hidden] {
    display: none !important;
}

.step-head h2 {
    margin: 0;
    font-size: clamp(1.1rem, 1.35vw, 1.22rem);
    line-height: 1.3;
    letter-spacing: -.01em;
    font-weight: 900;
}

.step-head p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.78;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.patient-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.patient-toggle input {
    width: auto;
}

.patient-create-box {
    padding: 16px;
    border: 1px dashed var(--line);
    border-radius: 16px;
    background: #fbfcfd;
}

.account-patients-grid {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
    gap: 20px;
}

.patient-directory-form {
    display: grid;
    gap: 18px;
}

.patient-directory-list {
    display: grid;
    gap: 12px;
}

.patient-selector {
    display: grid;
    gap: 16px;
}

.patient-choice-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.patient-choice-tab {
    width: 100%;
    background: #fff;
    color: var(--text);
    border: 1px solid var(--line);
}

.patient-choice-tab:hover {
    background: #f8fafc;
}

.patient-choice-tab.is-active {
    background: #eef4ff;
    color: var(--primary-dark);
    border-color: rgba(37, 99, 235, .22);
}

.patient-choice-panel {
    display: grid;
    gap: 14px;
}

.patient-choice-panel[hidden] {
    display: none !important;
}

.inline-note,
.field-hint,
.char-counter {
    color: var(--muted);
    font-size: var(--text-xs);
    line-height: 1.7;
}

.inline-note {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
}

.complaint-help {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fbfcfd;
}

.complaint-help p {
    margin: 0;
    color: var(--muted);
    font-size: var(--text-xs);
    line-height: 1.9;
}

.field-error,
.step-error {
    color: var(--danger);
    font-size: var(--text-xs);
    line-height: 1.7;
    font-weight: 700;
}

.step-error {
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(185, 28, 28, .14);
    border-radius: 12px;
    background: linear-gradient(180deg, #fff8f8 0%, #fef2f2 100%);
}

.char-counter {
    text-align: left;
    direction: ltr;
}

.summary-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.summary-file-list span {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--primary-dark);
    font-size: var(--text-xs);
    font-weight: 700;
}

.file-picker {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.file-picker-shell {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px dashed #b7c5d9;
    border-radius: 18px;
    background: linear-gradient(180deg, #fcfdff 0%, #f6f9fd 100%);
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.file-picker-shell:hover,
.file-picker-shell:focus-within {
    border-color: rgba(37, 99, 235, .28);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .08);
    background: linear-gradient(180deg, #ffffff 0%, #f3f7ff 100%);
}

.file-picker-shell input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-picker-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.file-picker-copy strong {
    font-size: .92rem;
    line-height: 1.6;
}

.file-picker-copy small {
    color: var(--muted);
    font-size: var(--text-xs);
    line-height: 1.8;
}

.file-picker-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    background: #eef4ff;
    color: var(--primary-dark);
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}

.file-picker.is-filled .file-picker-shell {
    border-style: solid;
    border-color: rgba(37, 99, 235, .24);
}

.file-picker.is-filled .file-picker-action {
    background: #e7f6ec;
    color: var(--success);
}

.attachment-preview-list[hidden] {
    display: none !important;
}

.attachment-preview-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.attachment-preview-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    padding: 12px;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfcfd;
    overflow: hidden;
}

.attachment-preview-thumb {
    display: grid;
    place-items: center;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    min-width: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #eef4ff;
    box-sizing: border-box;
}

.attachment-preview-thumb img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-preview-thumb span {
    color: var(--primary-dark);
    font-size: 1.2rem;
    font-weight: 800;
}

.attachment-preview-meta {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.attachment-preview-name {
    font-size: var(--text-xs);
    font-weight: 700;
    line-height: 1.7;
    word-break: break-word;
}

.attachment-preview-size {
    color: var(--muted);
    font-size: .74rem;
    line-height: 1.5;
}

.attachment-preview-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 7px 10px;
    border-radius: 12px;
    background: #fff;
    color: var(--danger);
    border: 1px solid rgba(185, 28, 28, .18);
    font-size: .76rem;
    font-weight: 800;
    box-sizing: border-box;
    white-space: normal;
}

.attachment-preview-remove:hover {
    background: #fff5f5;
    color: var(--danger);
}

@media (min-width: 1100px) {
    .attachment-preview-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.consultation-date-list,
.consultation-admin-list {
    display: grid;
    gap: 12px;
}

.consultation-date-item {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, transform .15s ease;
}

.consultation-date-item input {
    position: absolute;
    inset: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.consultation-date-mark {
    width: 18px;
    height: 18px;
    border: 2px solid #b8c4d4;
    border-radius: 999px;
    background: #fff;
    box-shadow: inset 0 0 0 4px #fff;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.consultation-date-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.consultation-date-copy strong {
    font-size: .98rem;
    line-height: 1.5;
    letter-spacing: -.01em;
}

.consultation-date-copy em {
    color: var(--muted);
    font-size: .78rem;
    font-style: normal;
    font-weight: 700;
    line-height: 1.7;
}

.consultation-date-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--primary-dark);
    font-size: .76rem;
    font-weight: 800;
    white-space: nowrap;
}

.consultation-date-item:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, .2);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}

.consultation-date-item input:checked~.consultation-date-mark {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: inset 0 0 0 4px #fff;
}

.consultation-date-item input:checked~.consultation-date-state {
    background: #e7f0ff;
}

.consultation-date-item:has(input:checked) {
    border-color: rgba(37, 99, 235, .28);
    background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .09);
}

.consultation-date-item.is-disabled {
    opacity: .55;
    cursor: not-allowed;
}

.consultation-date-item.is-disabled .consultation-date-state {
    background: #f3f4f6;
    color: var(--muted);
}

.rules-box {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fbfcfd;
}

.rules-box span {
    color: var(--muted);
    font-size: var(--text-xs);
    font-weight: 800;
}

.rules-box p {
    margin: 0;
    line-height: 1.8;
    font-size: var(--text-sm);
}

.patient-directory-item {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fbfcfd;
}

.patient-directory-item strong {
    font-size: 1rem;
    line-height: 1.5;
}

.account-history-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.account-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

.account-tab {
    width: auto;
    margin: 0;
    padding: 10px 14px;
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    border: 1px solid var(--line);
    font-size: var(--text-xs);
    font-weight: 800;
    box-shadow: none;
}

.account-tab:hover {
    background: #f8fafc;
    border-color: rgba(37, 99, 235, .16);
    color: #fff;
    box-shadow: none;
}

.account-tab.is-active {
    background: #eef4ff;
    color: var(--primary-dark);
    border-color: rgba(37, 99, 235, .22);
}

.account-tab.is-active:hover {
    background: #fff;
    color: var(--primary-dark);
    border-color: rgba(37, 99, 235, .28);
    box-shadow: none;
}

.account-tab-panel[hidden] {
    display: none !important;
}

.account-tab-panel .step-head h2 {
    margin-bottom: 12px;
}

.history-list {
    display: grid;
    gap: 14px;
}

.history-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(208, 215, 229, .8);
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    box-shadow: 0 6px 18px rgba(15, 22, 35, .04);
}

.history-card-head,
.history-meta,
.history-thread-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.history-meta,
.history-thread-head {
    color: var(--muted);
    font-size: var(--text-xs);
    font-weight: 700;
    line-height: 1.7;
}

.history-mini-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    color: var(--muted);
    font-size: .77rem;
    font-weight: 700;
}

.history-mini-meta span {
    display: inline-flex;
    align-items: center;
    padding: 6px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    line-height: 1.5;
}

.history-card-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.history-subject,
.history-text {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.9;
}

.history-thread {
    display: grid;
    gap: 10px;
    padding-top: 4px;
}

.history-thread>span {
    color: var(--muted);
    font-size: var(--text-xs);
    font-weight: 800;
}

.history-thread-item {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.history-thread-item p {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.9;
    white-space: pre-wrap;
}

.patient-directory-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
    font-size: var(--text-xs);
    font-weight: 700;
}

.consultation-admin-item {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.consultation-admin-head,
.consultation-admin-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.consultation-admin-meta {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.7;
}

.admin-item-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.consultation-admin-subject,
.consultation-admin-text {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.8;
}

.consultation-message-preview {
    display: grid;
    gap: 6px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
}

.consultation-message-preview span {
    color: var(--muted);
    font-size: var(--text-xs);
    font-weight: 800;
}

.consultation-message-preview p {
    margin: 0;
    font-size: var(--text-xs);
    line-height: 1.9;
}

.attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.attachment-audio-item {
    display: grid;
    gap: 8px;
    width: min(100%, 320px);
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}

.attachment-audio-item audio {
    width: 100%;
}

.attachment-list a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    font-size: var(--text-xs);
    font-weight: 700;
    text-decoration: none;
    min-width: 0;
    max-width: 100%;
    word-break: break-word;
}

.attachment-list a:hover {
    border-color: rgba(37, 99, 235, .24);
    color: var(--primary-dark);
}

.attachment-audio-item a {
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 0;
}

.voice-recorder-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "head status"
        "actions actions";
    gap: 8px 10px;
    padding: 12px 14px;
    border: 1px dashed #b7c5d9;
    border-radius: 18px;
    background: linear-gradient(180deg, #fcfdff 0%, #f6f9fd 100%);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.voice-recorder-card:hover,
.voice-recorder-card:focus-within {
    border-color: rgba(37, 99, 235, .28);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .06);
    background: linear-gradient(180deg, #ffffff 0%, #f4f8fe 100%);
}

.voice-recorder-head {
    grid-area: head;
    display: grid;
    gap: 2px;
    align-content: center;
}

.voice-recorder-head strong {
    font-size: .88rem;
    font-weight: 800;
    line-height: 1.6;
}

.voice-recorder-head p,
.voice-recorder-status {
    margin: 0;
    color: var(--muted);
    font-size: var(--text-xs);
    line-height: 1.7;
}

.voice-recorder-actions {
    grid-area: actions;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.voice-recorder-timer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 12px;
    border: 1px solid rgba(183, 197, 217, .9);
    background: rgba(255, 255, 255, .82);
    color: #355070;
    font-size: .78rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.voice-recorder-status {
    grid-area: status;
    display: inline-flex;
    align-items: center;
    justify-self: end;
    align-self: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .82);
    border: 1px solid rgba(183, 197, 217, .72);
    white-space: nowrap;
}

[data-voice-recorder-toggle].is-recording {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.admin-note-cell {
    display: grid;
    gap: 8px;
    min-width: 220px;
    white-space: normal;
    max-width: 420px;
}

.admin-note-cell p {
    margin: 0;
    color: var(--text);
    font-size: var(--text-xs);
    line-height: 1.8;
}

.admin-detail-button {
    width: auto;
    margin: 0;
    white-space: nowrap;
    min-height: 38px;
    padding: 9px 12px;
    font-size: .78rem;
}

.admin-context-button {
    display: inline-grid;
    align-items: center;
    justify-items: start;
    gap: 2px;
    min-width: 148px;
    white-space: normal;
    text-align: right;
    line-height: 1.35;
}

.admin-context-button-title {
    font-size: .78rem;
    font-weight: 800;
}

.admin-context-button-subtitle {
    font-size: .68rem;
    font-weight: 600;
    color: var(--muted);
}

.admin-patient-link {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--text) 18%, transparent);
}

.admin-patient-link:hover {
    color: var(--text);
    border-bottom-color: color-mix(in srgb, var(--text) 42%, transparent);
}

tr.is-selected-row {
    background: color-mix(in srgb, var(--surface-strong) 58%, white);
}

.patient-profile-grid {
    margin-top: 0;
    padding: 20px 22px 22px;
    gap: 16px;
}

.patient-profile-id strong {
    letter-spacing: .08em;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    unicode-bidi: plaintext;
}

.patient-record-list {
    display: grid;
    gap: 16px;
}

.patient-record-section {
    display: grid;
    gap: 0;
}

.patient-record-list-shell {
    padding: 20px 22px 22px;
}

.patient-profile-panel-head {
    padding: 20px 22px 16px;
}

.patient-profile-panel-head h2 {
    line-height: 1.34;
}

.patient-records-head {
    margin-bottom: 2px;
}

.patient-record-card {
    display: grid;
    gap: 16px;
}

.admin-detail-drawer[hidden] {
    display: none !important;
}

.admin-detail-drawer {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: grid;
    place-items: center;
    padding: 20px;
}

.admin-detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .48);
    backdrop-filter: blur(5px);
}

.admin-detail-panel {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    max-height: min(88vh, 920px);
    overflow: auto;
    padding: 22px;
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--shadow-lg);
}

.admin-detail-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.admin-detail-panel-head strong {
    display: block;
    font-size: 1.08rem;
    line-height: 1.5;
}

.admin-detail-panel-head p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: var(--text-xs);
}

.admin-detail-close {
    width: auto;
    margin: 0;
}

.admin-detail-content {
    padding-top: 18px;
}

.admin-detail-stack {
    display: grid;
    gap: 16px;
}

.admin-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.admin-detail-grid div,
.admin-detail-block {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fbfcfd;
}

.admin-detail-grid span,
.admin-detail-block span {
    color: var(--muted);
    font-size: var(--text-xs);
    font-weight: 800;
}

.admin-detail-grid strong {
    font-size: var(--text-sm);
    line-height: 1.7;
}

.admin-detail-block p {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.9;
    white-space: pre-wrap;
    word-break: break-word;
}

.message-timeline {
    display: grid;
    gap: 10px;
}

.message-timeline-item {
    display: grid;
    gap: 8px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.message-timeline-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: var(--text-xs);
}

.message-timeline-head strong {
    color: var(--text);
    font-size: var(--text-xs);
}

.message-timeline-item p {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.9;
    white-space: pre-wrap;
}

.consultation-reply-form {
    display: grid;
    gap: 12px;
}

.consultation-reply-form button {
    width: max-content;
    min-width: 160px;
}

.appointment-days {
    display: grid;
    gap: 14px;
}

.appointment-day {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
    overflow: hidden;
    min-width: 0;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .04);
}

.appointment-day-head {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #fbfcfe 0%, #f7fafc 100%);
}

.appointment-day-head div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.appointment-day-head strong {
    font-size: 1.02rem;
    line-height: 1.45;
    letter-spacing: -.01em;
}

.appointment-day-head span {
    color: var(--muted);
    font-size: .76rem;
    font-weight: 700;
    line-height: 1.7;
}

.slots {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
}

.slot {
    position: relative;
    min-width: 0;
}

.slot input {
    position: absolute;
    inset: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.slot label {
    display: grid;
    gap: 6px;
    min-height: 90px;
    align-content: end;
    padding: 12px 12px 11px;
    border: 1px solid #e7ebf0;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    cursor: pointer;
    position: relative;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background .15s ease;
}

.slot label:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, .18);
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
}

.slot input:checked+label {
    border-color: rgba(37, 99, 235, .28);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .09);
    background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
}

.slot-marker {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 16px;
    height: 16px;
    border: 2px solid #b8c4d4;
    border-radius: 999px;
    background: #fff;
    box-shadow: inset 0 0 0 4px #fff;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.slot input:checked+label .slot-marker {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: inset 0 0 0 4px #fff;
}

.slot-time {
    font-size: .92rem;
    font-weight: 800;
    line-height: 1.45;
    letter-spacing: -.01em;
}

.slot-meta {
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.45;
}

.slot-price {
    font-size: .82rem;
    font-weight: 700;
}

.slot-badge {
    position: absolute;
    top: 12px;
    left: 10px;
}

.slot-disabled {
    opacity: .5;
}

.terms {
    display: flex;
    align-items: center;
    gap: 10px;
}

.terms input {
    width: auto;
}

.selection-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.selection-summary>div {
    display: grid;
    gap: 6px;
    padding: 15px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.selection-summary span {
    display: block;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 800;
    line-height: 1.6;
}

.selection-summary strong {
    display: block;
    margin-top: 0;
    font-size: .94rem;
    line-height: 1.75;
    font-weight: 800;
    word-break: break-word;
}

.summary-breakdown {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.8;
}

.mock-payment-card {
    display: grid;
    gap: 20px;
}

.step-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-top: 4px;
}

.step-actions>* {
    flex: 1 1 0;
    margin-top: 0 !important;
}

.admin-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    padding: 30px;
    margin-bottom: 20px;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .05), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
}

.admin-actions {
    display: flex;
    align-items: stretch;
    gap: 12px;
    flex-wrap: wrap;
}

.logout {
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--muted);
    font-weight: 800;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.logout:hover {
    border-color: rgba(37, 99, 235, .2);
    background: #f8fbff;
    color: var(--primary-dark);
}

.date-filter {
    min-width: 320px;
    max-width: 100%;
}

.date-filter label {
    display: block;
    margin-bottom: 8px;
}

.date-filter .jalali-date-input {
    min-width: 220px;
}

.date-filter .jalali-date-button {
    width: 100%;
    margin-top: 0;
}

.date-hint {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: .88rem;
    font-weight: 700;
}

.date-filter>div {
    display: flex;
    gap: 10px;
    align-items: end;
}

.grid {
    display: grid;
    grid-template-columns: minmax(320px, 440px) 1fr;
    gap: 24px;
    align-items: start;
}

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
    box-shadow: var(--shadow-soft);
}

.admin-tab {
    width: auto;
    margin-top: 0 !important;
    background: transparent;
    color: var(--muted);
    border: 1px solid transparent;
    box-shadow: none;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 14px;
}

.admin-tab:hover {
    background: #f8fafc;
}

.admin-tab.is-active {
    background: #eef4ff;
    color: var(--primary-dark);
    border-color: rgba(37, 99, 235, .18);
}

.admin-tab-panel[hidden] {
    display: none !important;
}

.grid>* {
    min-width: 0;
}

.panel {
    overflow: hidden;
    border-radius: 24px;
}

.panel-head {
    padding: 22px 24px 20px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #fcfdff 0%, #f8fafd 100%);
}

.panel-head h2 {
    margin: 0;
    font-size: clamp(1.06rem, 1.25vw, 1.18rem);
    line-height: 1.28;
    letter-spacing: -.015em;
    font-weight: 900;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    padding: 24px;
}

.simple-schedule-form {
    padding: 24px;
}

.schedule-settings {
    display: grid;
    gap: 18px;
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(180deg, #fcfdff 0%, #f8fbfd 100%);
}

.schedule-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.slot-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.slot-pill {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    min-height: 42px;
}

.slot-pill input,
.date-select-row input {
    width: auto;
}

.simple-schedule-list {
    display: grid;
    gap: 18px;
}

.schedule-day {
    border: 1px solid var(--line);
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.schedule-day-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: linear-gradient(180deg, #fbfcfe 0%, #f7fafc 100%);
    border-bottom: 1px solid var(--line);
}

.schedule-day-head h3 {
    margin: 0;
    font-size: .98rem;
    line-height: 1.35;
}

.date-select-row {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
}

.schedule-day-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 18px 16px;
}

.weekdays {
    grid-column: 1 / -1;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.weekdays label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-soft);
    border-radius: 999px;
    padding: 8px 12px;
}

.weekdays input {
    width: auto;
}

.full {
    grid-column: 1 / -1;
}

.actions {
    display: flex;
    justify-content: flex-start;
}

.table-wrap {
    overflow: auto;
    max-width: 100%;
    border-top: 1px solid var(--line);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: 15px 16px;
    text-align: right;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

td[data-label="شرح / پیوست"] {
    white-space: normal;
}

th {
    background: #fbfcfd;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .01em;
}

tbody tr:hover {
    background: #f9fbfe;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.badge {
    display: inline-flex;
    width: max-content;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: .68rem;
    line-height: 1.25;
    font-style: normal;
    font-weight: 800;
    letter-spacing: .01em;
    border: 1px solid transparent;
}

.badge.ok {
    color: var(--success);
    background: #dcfce7;
    border-color: rgba(21, 128, 61, .08);
}

.badge.off {
    color: var(--danger);
    background: #fee2e2;
    border-color: rgba(185, 28, 28, .08);
}

.schedule-day-head .badge:not(.ok):not(.off) {
    color: var(--muted);
    background: var(--surface-soft);
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 30px 24px;
    grid-column: 1 / -1;
    font-size: var(--text-sm);
    line-height: 1.8;
    border: 1px dashed var(--line-strong);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
}

@media (min-width: 1280px) {

    .patient-shell,
    .admin-shell {
        width: min(1280px, calc(100% - 48px));
    }
}

@media (max-width: 1100px) {
    .grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 920px) {

    .site-header-inner,
    .site-footer-inner {
        width: min(100% - 24px, 1280px);
    }

    .site-footer-inner,
    .service-showcase {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .site-header-inner {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "brand brand"
            "actions toggle";
        align-items: center;
        gap: 12px;
        padding: 14px 0;
        min-height: 0;
    }

    .site-brand {
        grid-area: brand;
    }

    .site-nav-toggle {
        display: inline-flex;
        grid-area: toggle;
        justify-self: end;
    }

    .site-header-actions {
        grid-area: actions;
        justify-content: flex-start;
        align-items: center;
        min-width: 0;
    }

    .site-nav {
        position: absolute;
        top: calc(100% + 10px);
        right: 10px;
        left: 10px;
        display: none;
        grid-template-columns: 1fr;
        padding: 10px;
        border: 1px solid var(--line-strong);
        border-radius: 22px;
        background: rgba(250, 252, 254, .98);
        box-shadow: var(--shadow);
        backdrop-filter: blur(10px);
    }

    .site-header {
        position: relative;
    }

    .site-footer-block {
        display: grid;
        gap: 8px;
        align-items: start;
    }

    .site-header.is-nav-open .site-nav {
        display: grid;
    }

    .site-nav a {
        width: 100%;
        text-align: right;
    }

    .site-account-menu {
        position: static;
        width: auto;
        min-width: 0;
    }

    .site-account-trigger {
        min-width: 132px;
    }

    .site-account-dropdown {
        top: calc(100% + 10px);
        right: 10px;
        left: 10px;
        min-width: 0;
        padding: 10px;
        border-radius: 22px;
        background: rgba(250, 252, 254, .98);
        backdrop-filter: blur(10px);
    }

    .service-side-stack {
        grid-template-columns: 1fr;
    }

    .admin-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .logout {
        align-self: flex-start;
    }

    .date-filter {
        min-width: 0;
    }

    .date-filter form,
    .date-filter {
        width: 100%;
    }

    .field-grid {
        grid-template-columns: 1fr;
    }

    .account-patients-grid {
        grid-template-columns: 1fr;
    }

    .appointment-day-head div {
        align-items: flex-start;
        flex-direction: column;
    }

    .schedule-settings-grid {
        grid-template-columns: 1fr;
    }

    .selection-summary {
        grid-template-columns: 1fr;
    }

    .patient-choice-tabs {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 620px) {
    .site-header {
        position: relative;
    }

    .site-header-inner {
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-areas: "brand actions toggle";
        gap: 10px;
        align-items: center;
        padding: 10px 0;
    }

    .site-nav-toggle {
        width: 44px;
        height: 44px;
    }

    .service-showcase {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .service-feature-actions .button {
        width: 100%;
    }

    .site-brand {
        min-width: 0;
    }

    .site-brand strong {
        font-size: .92rem;
        line-height: 1.35;
    }

    .site-brand span {
        display: none;
    }

    .site-header-actions {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        align-items: center;
        justify-content: flex-end;
        min-width: 0;
    }

    .site-header-actions .button,
    .hero-actions .button {
        width: auto;
        margin: 0;
        text-align: center;
    }

    .site-header-actions>.button:not(.button-secondary) {
        display: none;
    }

    .site-account-trigger {
        min-width: 104px;
        padding-inline: 12px;
    }

    .hero-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .site-footer {
        margin-top: 28px;
        padding: 24px 0 28px;
    }

    .auth-page,
    .patient-shell,
    .admin-shell {
        width: min(100% - 20px, 1180px);
        margin: 16px auto;
    }

    .admin-hero,
    .patient-hero,
    .patient-card,
    .panel-head,
    .form-grid,
    .simple-schedule-form {
        padding: 18px;
    }

    .service-feature,
    .faq-item {
        padding: 18px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .date-filter {
        display: grid;
        gap: 10px;
    }

    .date-filter label {
        margin-bottom: 0;
    }

    .date-filter>div {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        align-items: stretch;
    }

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

    .jalali-picker-toolbar {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .jalali-picker-popover {
        padding: 12px;
    }

    .jalali-picker-sheet {
        width: 100%;
        max-height: 92vh;
        padding: 14px;
        border-radius: 18px;
    }

    .jalali-picker-actions {
        flex-direction: column-reverse;
    }

    .jalali-picker-actions .button {
        width: 100%;
        min-width: 0;
    }

    .patient-hero {
        gap: 2px;
    }

    .stepper-item {
        justify-items: center;
        text-align: center;
        padding: 10px 8px;
        gap: 6px;
    }

    .stepper-number {
        width: 24px;
        height: 24px;
        font-size: .76rem;
    }

    .slots {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 10px;
    }

    .appointment-day-head,
    .schedule-day-head,
    .date-select-row,
    .schedule-day-meta {
        padding-left: 14px;
        padding-right: 14px;
    }

    .schedule-settings {
        padding: 14px;
    }

    .slot-pills {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .slot-pill {
        justify-content: center;
        padding: 10px 12px;
        min-width: 0;
    }

    .terms {
        align-items: flex-start;
        gap: 8px;
    }

    .terms span {
        line-height: 1.55;
        font-size: var(--text-sm);
    }

    .step-head h2 {
        font-size: 1.04rem;
    }

    .step-head p {
        font-size: .84rem;
        line-height: 1.8;
    }

    .consultation-date-item {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }

    .consultation-date-state {
        grid-column: 2;
        justify-self: start;
        margin-top: 2px;
    }

    .actions button,
    .date-filter button,
    .logout {
        width: 100%;
    }

    .toast-stack {
        top: 12px;
        right: 12px;
        width: min(340px, calc(100vw - 24px));
    }

    .app-toast {
        padding: 13px 14px;
        border-radius: 14px;
        gap: 10px;
    }

    .app-toast-message {
        font-size: .81rem;
        line-height: 1.72;
    }

    .admin-tabs {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        padding: 8px;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
    }

    .admin-tabs::-webkit-scrollbar {
        display: none;
    }

    .admin-tab {
        width: auto;
        min-width: max-content;
        flex: 0 0 auto;
        padding: 10px 13px;
        scroll-snap-align: start;
    }

    .account-actions {
        flex-direction: column;
    }

    .account-actions .button {
        width: 100%;
    }

    .step-actions {
        flex-direction: column;
    }

    .step-actions .button,
    .step-actions button {
        width: 100%;
        min-height: 50px;
        padding: 13px 18px;
        border-radius: 14px;
    }

    .date-filter,
    .date-filter input,
    .date-filter>div,
    .admin-actions,
    .schedule-settings,
    .simple-schedule-list,
    .schedule-day,
    .panel,
    .table-wrap {
        min-width: 0;
        max-width: 100%;
    }

    table,
    thead,
    tbody,
    tr,
    td {
        display: block;
    }

    table {
        min-width: 0;
    }

    thead {
        display: none;
    }

    tbody {
        padding: 10px;
    }

    tbody tr {
        display: grid;
        gap: 0;
        margin-bottom: 12px;
        border: 1px solid var(--line);
        border-radius: 16px;
        background: #fff;
        overflow: hidden;
        box-shadow: 0 6px 18px rgba(15, 23, 42, .04);
    }

    tbody tr:hover {
        background: #fff;
    }

    td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 14px;
        white-space: normal;
    }

    td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: .76rem;
        font-weight: 800;
        flex: 0 0 auto;
        line-height: 1.6;
    }

    td>* {
        min-width: 0;
    }

    td.empty {
        justify-content: center;
        border-style: dashed;
    }

    td.empty::before {
        content: none;
    }

    .weekdays {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .consultation-admin-item {
        gap: 12px;
        padding: 15px;
        border-radius: 18px;
    }

    .consultation-admin-head,
    .consultation-admin-meta,
    .admin-item-actions {
        align-items: flex-start;
    }

    .consultation-admin-head {
        flex-direction: column;
    }

    .consultation-admin-meta {
        gap: 8px 12px;
    }

    .admin-item-actions {
        width: 100%;
        justify-content: space-between;
    }

    .admin-detail-button {
        width: auto;
        min-width: 0;
    }

    .admin-context-button {
        width: auto;
        min-width: 0;
    }

    .consultation-reply-form button {
        width: 100%;
        min-width: 0;
    }

    .admin-note-cell {
        min-width: 0;
        max-width: none;
        gap: 6px;
    }

    .admin-note-cell .attachment-list {
        gap: 6px;
    }

    .attachment-list a {
        max-width: 100%;
    }

    td[data-label] .admin-detail-button,
    td[data-label] .badge {
        margin-inline-start: auto;
    }

    td[data-label] .admin-context-button {
        width: 100%;
        justify-items: end;
        text-align: right;
    }

    .admin-shell .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: rgba(59, 91, 219, .28) transparent;
    }

    .admin-shell .table-wrap table {
        display: table;
        width: 100%;
        min-width: 720px;
    }

    .admin-shell .table-wrap thead {
        display: table-header-group;
    }

    .admin-shell .table-wrap thead th {
        position: sticky;
        top: 0;
        z-index: 1;
        white-space: nowrap;
        background: #f8faff;
        box-shadow: inset 0 -1px 0 var(--line);
    }

    .admin-shell .table-wrap tbody {
        display: table-row-group;
        padding: 0;
    }

    .admin-shell .table-wrap tr {
        display: table-row;
        margin-bottom: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .admin-shell .table-wrap td,
    .admin-shell .table-wrap th {
        display: table-cell;
    }

    .admin-shell .table-wrap td {
        gap: 0;
        padding: 13px 16px;
        white-space: nowrap;
        vertical-align: middle;
    }

    .admin-shell .table-wrap td:last-child,
    .admin-shell .table-wrap td:nth-last-child(2) {
        white-space: normal;
    }

    .admin-shell .table-wrap .badge,
    .admin-shell .table-wrap .admin-patient-link,
    .admin-shell .table-wrap .button {
        white-space: nowrap;
    }

    .admin-shell .table-wrap .admin-context-button {
        min-width: 132px;
    }

    .admin-shell .table-wrap td::before {
        content: none;
    }

    .admin-shell .table-wrap td.empty {
        display: table-cell;
        justify-content: normal;
        text-align: center;
        white-space: normal;
    }

    .admin-detail-drawer {
        padding: 12px;
    }

    .admin-detail-panel {
        width: 100%;
        max-height: 92vh;
        padding: 16px;
        border-radius: 18px;
    }

    .admin-detail-panel-head {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
        padding-bottom: 14px;
    }

    .admin-detail-close {
        align-self: flex-start;
    }

    .admin-detail-content {
        padding-top: 14px;
    }

    .admin-detail-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .admin-detail-grid div,
    .admin-detail-block {
        padding: 13px 14px;
    }

    .message-timeline-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .history-card {
        padding: 16px;
        gap: 12px;
    }

    .history-card-head {
        gap: 8px;
    }

    .history-card-actions {
        width: 100%;
        justify-content: space-between;
    }

    .history-card-actions .button {
        min-width: 0;
    }

    .history-mini-meta {
        gap: 8px;
    }

    .patient-record-list-shell,
    .patient-profile-grid {
        padding: 18px;
    }

    .patient-profile-panel-head {
        padding: 18px 18px 14px;
    }

    .attachment-preview-card {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        padding: 12px;
    }

    .attachment-preview-thumb {
        min-height: 84px;
    }

    .voice-recorder-card {
        padding: 14px;
        gap: 10px;
    }

    .voice-recorder-card {
        grid-template-columns: 1fr;
        grid-template-areas:
            "head"
            "actions"
            "status";
    }

    .voice-recorder-card .button {
        min-width: 0;
    }

    .voice-recorder-status {
        justify-self: center;
    }
}

@media (max-width: 420px) {

    .auth-page,
    .patient-shell,
    .admin-shell {
        width: min(100% - 16px, 1180px);
        margin: 12px auto;
    }

    .auth-card,
    .patient-hero,
    .patient-card,
    .admin-hero,
    .panel {
        border-radius: 14px;
    }

    .patient-hero,
    .admin-hero,
    .panel-head,
    .simple-schedule-form,
    .patient-card {
        padding: 14px;
    }

    .stepper-label {
        font-size: .7rem;
        line-height: 1.2;
    }

    .slot-pills {
        grid-template-columns: 1fr;
    }

    .badge {
        font-size: .72rem;
    }

    .admin-tabs {
        margin-inline: -2px;
        padding-inline: 6px;
    }

    .admin-tab {
        padding: 9px 12px;
        font-size: .74rem;
    }

    .toast-stack {
        top: 10px;
        right: 8px;
        width: min(320px, calc(100vw - 16px));
    }

    .app-toast {
        padding: 12px 13px;
    }

    .admin-shell .table-wrap td,
    .admin-shell .table-wrap th {
        padding: 11px 12px;
    }

    .admin-shell .table-wrap table {
        min-width: 680px;
    }

    .admin-shell .table-wrap .admin-context-button {
        min-width: 124px;
    }

    td {
        gap: 8px;
        padding: 11px 12px;
    }

    td::before {
        font-size: .72rem;
    }

    .consultation-admin-item {
        padding: 14px;
    }

    .consultation-admin-meta {
        font-size: .75rem;
    }

    .consultation-admin-subject,
    .consultation-admin-text,
    .admin-detail-block p,
    .message-timeline-item p {
        font-size: .86rem;
    }

    .admin-detail-panel {
        padding: 14px;
        border-radius: 16px;
    }

    .history-card {
        padding: 14px;
    }

    .patient-record-list-shell,
    .patient-profile-grid,
    .patient-profile-panel-head {
        padding-left: 14px;
        padding-right: 14px;
    }
}

/* ============================================================
   مدرن‌سازی سایت دکتر کیانی‌فر — فقط CSS Override
   بدون تغییر DOM
   ============================================================ */

/* ── 1. Design Tokens ─────────────────────────────────────── */
:root {
    --bg: #f5f6fa;
    --surface: #ffffff;
    --surface-soft: #f0f2f8;
    --surface-tint: #fafbff;

    --text: #0f1623;
    --muted: #5a6478;
    --line: #e4e8f0;
    --line-strong: #d0d7e5;

    --primary: #3b5bdb;
    --primary-dark: #2f4ac4;
    --primary-light: #edf2ff;
    --primary-glow: rgba(59, 91, 219, .14);

    --success: #0f7a4a;
    --success-bg: #e6f9f0;
    --danger: #c0392b;
    --danger-bg: #fef0ef;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius: var(--radius-md);

    --shadow-soft: 0 2px 12px rgba(15, 22, 35, .06);
    --shadow: 0 4px 24px rgba(15, 22, 35, .09);
    --shadow-lg: 0 12px 48px rgba(15, 22, 35, .13);
    --shadow-primary: 0 6px 20px rgba(59, 91, 219, .22);

    --transition: .18s cubic-bezier(.4, 0, .2, 1);
}

/* ── 2. Body & Base ───────────────────────────────────────── */
body {
    background: var(--bg);
    font-feature-settings: "kern" 1, "liga" 1;
    -webkit-font-smoothing: antialiased;
}

/* ── 3. Header — Glassmorphism ────────────────────────────── */
.site-header {
    background: rgba(250, 251, 255, .82);
    backdrop-filter: blur(20px) saturate(1.6);
}

.site-brand strong {
    font-size: 1.02rem;
    font-weight: 900;
    letter-spacing: -.02em;
    background: linear-gradient(135deg, var(--primary-dark) 0%, #6b8ef5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-brand span {
    color: var(--muted);
    font-size: .77rem;
    font-weight: 600;
}

.site-nav a {
    font-weight: 700;
    font-size: .81rem;
    letter-spacing: -.01em;
    border-radius: 999px;
    transition: background var(--transition), color var(--transition), transform var(--transition);
}

.site-nav a:hover {
    background: rgba(59, 91, 219, .09);
    color: var(--primary);
    transform: translateY(-1px);
}

.site-nav a.is-active {
    background: var(--primary-light);
    color: var(--primary);
    box-shadow: 0 0 0 1px rgba(59, 91, 219, .18);
}

/* ── 4. Buttons ───────────────────────────────────────────── */
button,
.button {
    font-weight: 800;
    letter-spacing: -.01em;
    border-radius: 12px;
    transition:
        background var(--transition),
        transform var(--transition),
        box-shadow var(--transition),
        border-color var(--transition),
        color var(--transition);
    position: relative;
    overflow: hidden;
}

button:not(.button-secondary):not(.site-nav-toggle):not(.jalali-date-button):not(.jalali-picker-trigger):not(.jalali-picker-option):not(.patient-choice-tab):not(.account-tab):not(.admin-tab):not(.logout):not(.attachment-preview-remove),
a.button:not(.button-secondary) {
    background: var(--primary);
    box-shadow: var(--shadow-primary);
    color: var(--primary-light);
}

button:not(.button-secondary):not(.site-nav-toggle):not(.jalali-date-button):not(.jalali-picker-trigger):not(.jalali-picker-option):not(.patient-choice-tab):not(.account-tab):not(.admin-tab):not(.logout):not(.attachment-preview-remove):hover,
a.button:not(.button-secondary):hover {
    background: var(--primary-dark);
    box-shadow: 0 8px 28px rgba(47, 74, 196, .32);
    transform: translateY(-1px);
    color: var(--primary-light);
}

button:not(.button-secondary):not(.jalali-picker-trigger):not(.jalali-picker-option):active,
.button:not(.button-secondary):active {
    transform: translateY(0px) scale(.98);
    box-shadow: 0 2px 8px rgba(59, 91, 219, .2);
}

.button-secondary {
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    font-weight: 700;
    transition: all var(--transition);
}

.button-secondary:hover {
    border-color: rgba(59, 91, 219, .3);
    background: var(--primary-light);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* ── 5. Hero Section ──────────────────────────────────────── */
.patient-hero {
    padding: 36px 32px 30px;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(ellipse 70% 80% at 95% 15%, rgba(59, 91, 219, .07) 0%, transparent 55%),
        radial-gradient(ellipse 50% 60% at 5% 85%, rgba(107, 142, 245, .05) 0%, transparent 50%),
        linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%);
    border: 1px solid rgba(208, 215, 229, .7);
    box-shadow: var(--shadow-soft);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.patient-hero::before {
    content: '';
    position: absolute;
    top: -40px;
    left: -40px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(59, 91, 219, .06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.patient-hero h1 {
    font-size: clamp(1.5rem, 2.2vw, 1.9rem);
    font-weight: 900;
    letter-spacing: -.03em;
    color: var(--text);
    line-height: 1.2;
}

.eyebrow {
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: none;
    color: var(--primary);
    margin: 0 0 6px !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.eyebrow::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── 6. Cards ─────────────────────────────────────────────── */
.auth-card,
.patient-card,
.notification-gate-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow);
}

.patient-card {
    padding: 26px;
    background: linear-gradient(160deg, #ffffff 0%, #fafcff 100%);
}

/* ── 7. Service Feature Cards ─────────────────────────────── */
.service-feature {
    border-radius: 20px;
    border: 1px solid var(--line-strong);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.service-feature:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: rgba(59, 91, 219, .2);
}

.service-feature-main {
    background:
        radial-gradient(ellipse 80% 60% at 90% 10%, rgba(59, 91, 219, .07) 0%, transparent 55%),
        linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.service-feature-accent {
    background: linear-gradient(145deg, #1a2547 0%, #414f6f 55%, #161f38 100%);
    border-color: rgba(100, 130, 220, .2);
    box-shadow: 0 20px 50px rgba(10, 15, 35, .25);
}

.service-feature-accent:hover {
    border-color: rgba(100, 130, 220, .4);
    box-shadow: 0 24px 60px rgba(10, 15, 35, .3);
}

.service-feature-kicker {
    border-radius: 8px;
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: .04em;
    padding: 4px 10px;
    min-height: 26px;
    background: rgba(59, 91, 219, .1);
    color: var(--primary);
}

.service-feature-accent .service-feature-kicker {
    background: rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .9);
}

.service-feature strong {
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: -.02em;
}

/* ── 8. Form Inputs ───────────────────────────────────────── */
input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
select,
textarea {
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    padding: 11px 14px;
    font-size: .93rem;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

input:not([type="radio"]):not([type="checkbox"]):not([type="file"]):hover,
select:hover,
textarea:hover {
    border-color: rgba(59, 91, 219, .22);
    background: #fdfeff;
}

input:not([type="radio"]):not([type="checkbox"]):not([type="file"]):focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    outline: none;
    background: #fff;
}

.select-shell {
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #ffffff;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.select-shell:hover {
    border-color: rgba(59, 91, 219, .22);
}

.select-shell:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.select-shell select {
    font-weight: 600;
}

.jalali-date-shell {
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #ffffff;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.jalali-date-shell:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.jalali-date-icon {
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 9px;
    font-weight: 800;
    font-size: .71rem;
}

/* ── 9. Stepper ───────────────────────────────────────────── */
.stepper {
    gap: 10px;
}

.stepper-item {
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    padding: 14px 10px 12px;
    transition: all var(--transition);
    box-shadow: var(--shadow-soft);
}

.stepper-item.is-active {
    border-color: rgba(59, 91, 219, .3);
    background: linear-gradient(160deg, #f5f8ff 0%, #eef3ff 100%);
    box-shadow: 0 0 0 3px var(--primary-glow), var(--shadow-soft);
}

.stepper-item.is-done {
    border-color: rgba(15, 122, 74, .2);
    background: linear-gradient(160deg, #f3fef8 0%, #e8f9f0 100%);
}

.stepper-number {
    width: 30px;
    height: 30px;
    font-size: .82rem;
    font-weight: 900;
    border-radius: 50%;
    background: #eceff5;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .06);
    transition: all var(--transition);
}

.stepper-item.is-active .stepper-number {
    background: var(--primary);
    box-shadow: 0 3px 10px rgba(59, 91, 219, .35);
}

.stepper-item.is-done .stepper-number {
    background: var(--success);
    box-shadow: 0 3px 10px rgba(15, 122, 74, .3);
}

.stepper-label {
    font-size: .73rem;
    font-weight: 800;
    letter-spacing: -.005em;
}

/* ── 10. Appointment Slots ────────────────────────────────── */
.appointment-day {
    border-radius: 18px;
    border: 1px solid var(--line);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: box-shadow var(--transition);
}

.appointment-day:hover {
    box-shadow: var(--shadow);
}

.appointment-day-head {
    padding: 14px 18px;
    background: linear-gradient(180deg, #fafcff 0%, #f5f8ff 100%);
    border-bottom: 1px solid var(--line);
}

.appointment-day-head strong {
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: -.02em;
}

.slot label {
    border-radius: 14px;
    border: 1px solid #e8ecf4;
    background: #ffffff;
    transition: all var(--transition);
    box-shadow: var(--shadow-soft);
}

.slot label:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 91, 219, .25);
    box-shadow: 0 6px 18px rgba(59, 91, 219, .1);
}

.slot input:checked+label {
    border-color: var(--primary);
    background: linear-gradient(160deg, #f5f8ff 0%, #eef3ff 100%);
    box-shadow: 0 0 0 3px var(--primary-glow), 0 6px 18px rgba(59, 91, 219, .1);
}

.slot input:checked+label .slot-marker {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: inset 0 0 0 3px #fff, 0 2px 6px rgba(59, 91, 219, .4);
}

.slot-time {
    font-size: .95rem;
    font-weight: 900;
    letter-spacing: -.02em;
}

.slot-meta {
    font-size: .76rem;
    font-weight: 600;
}

/* ── 11. Badges ───────────────────────────────────────────── */
.badge {
    font-size: .69rem;
    font-weight: 800;
    letter-spacing: .02em;
    border-radius: 8px;
    padding: 4px 9px;
}

.badge.ok {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(15, 122, 74, .15);
}

.badge.off {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(192, 57, 43, .15);
}

/* ── 12. FAQ Items ────────────────────────────────────────── */
.faq-item {
    padding: 20px 0;
    border-top: 1px solid var(--line);
    transition: all var(--transition);
}

.faq-item strong {
    font-size: .92rem;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--text);
    line-height: 1.55;
    display: block;
    margin-bottom: 4px;
}

.faq-item p {
    color: var(--muted);
    font-size: .84rem;
    line-height: 1.85;
}

/* ── 13. Address Band ─────────────────────────────────────── */
.address-band {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 16px;
    border-radius: 18px;
    border: 1px solid var(--line-strong);
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(59, 91, 219, .04) 0%, transparent 45%),
        linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    box-shadow: var(--shadow-soft);
    transition: box-shadow var(--transition), transform var(--transition);
}

.address-band:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.address-copy {
    display: grid;
    gap: 14px;
    min-width: 0;
    padding: 0;
}

.address-band p {
    font-size: .9rem;
    line-height: 2;
    margin: 0;
}

.address-map-actions {
    display: flex;
    justify-content: flex-start;
}

.address-map-actions .button {
    width: auto;
    margin: 0;
}

@media (max-width: 720px) {
    .account-history-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .address-copy,
    .address-band p {
        grid-column: auto;
        grid-row: auto;
    }
}

/* ── 14. Section Titles ───────────────────────────────────── */
.section-title {
    font-size: clamp(1.1rem, 1.5vw, 1.35rem);
    font-weight: 900;
    letter-spacing: -.03em;
    color: var(--text);
}

.step-head h2 {
    font-size: clamp(1.1rem, 1.4vw, 1.2rem);
    font-weight: 900;
    letter-spacing: -.025em;
}

.step-head p {
    font-size: .87rem;
    color: var(--muted);
    line-height: 1.75;
}

/* ── 15. Patient Selector ─────────────────────────────────── */
.patient-choice-tab {
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    font-weight: 700;
    font-size: .84rem;
    transition: all var(--transition);
    box-shadow: var(--shadow-soft);
}

.patient-choice-tab:hover {
    border-color: rgba(59, 91, 219, .2);
    background: var(--primary-light);
    color: var(--primary);
}

.patient-choice-tab.is-active {
    background: linear-gradient(160deg, #eef3ff 0%, #e4ecff 100%);
    color: var(--primary);
    border-color: rgba(59, 91, 219, .28);
    box-shadow: 0 0 0 3px var(--primary-glow), var(--shadow-soft);
}

/* ── 16. File Picker ──────────────────────────────────────── */
.file-picker-shell {
    border-radius: 14px;
    border: 1.5px dashed rgba(59, 91, 219, .2);
    background: linear-gradient(180deg, #fafcff 0%, #f5f8ff 100%);
    transition: all var(--transition);
}

.file-picker-shell:hover,
.file-picker-shell:focus-within {
    border-color: rgba(59, 91, 219, .45);
    background: linear-gradient(180deg, #ffffff 0%, #eef3ff 100%);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.file-picker-action {
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 10px;
    font-weight: 800;
    font-size: .77rem;
}

/* ── 17. Consultation Date Items ──────────────────────────── */
.consultation-date-item {
    border-radius: 16px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
    transition: all var(--transition);
    box-shadow: var(--shadow-soft);
}

.consultation-date-item:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 91, 219, .22);
    box-shadow: 0 8px 24px rgba(59, 91, 219, .1);
}

.consultation-date-item:has(input:checked) {
    border-color: var(--primary);
    background: linear-gradient(160deg, #f5f8ff 0%, #eef3ff 100%);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.consultation-date-mark {
    border: 2px solid #c5cdd8;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    transition: all var(--transition);
}

.consultation-date-item input:checked~.consultation-date-mark {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: inset 0 0 0 3px #fff, 0 2px 6px rgba(59, 91, 219, .4);
}

.consultation-date-state {
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 9px;
    font-size: .73rem;
    font-weight: 800;
}

/* ── 18. Summary Cards ────────────────────────────────────── */
.selection-summary>div {
    border-radius: 14px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    padding: 14px 16px;
    box-shadow: var(--shadow-soft);
    transition: all var(--transition);
}

.selection-summary>div:hover {
    border-color: rgba(59, 91, 219, .18);
    box-shadow: var(--shadow);
}

.selection-summary span {
    font-size: .73rem;
    font-weight: 800;
    color: var(--muted);
    letter-spacing: .01em;
}

.selection-summary strong {
    font-size: .93rem;
    font-weight: 800;
    letter-spacing: -.01em;
}

/* ── 19. Account Tabs ─────────────────────────────────────── */
.account-tab {
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: .8rem;
    font-weight: 800;
    color: var(--muted);
    transition: all var(--transition);
}

.account-tab:hover {
    background: var(--primary-light);
    border-color: rgba(59, 91, 219, .2);
    color: var(--primary);
}

.account-tab.is-active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: rgba(59, 91, 219, .3);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ── 20. Admin Panel ──────────────────────────────────────── */
.admin-hero {
    border-radius: var(--radius-lg);
    padding: 28px 30px;
    margin-bottom: 22px;
    background:
        radial-gradient(ellipse 65% 70% at 10% 15%, rgba(59, 91, 219, .05) 0%, transparent 55%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-soft);
}

.admin-hero h1 {
    font-weight: 900;
    letter-spacing: -.03em;
    font-size: clamp(1.4rem, 2vw, 1.75rem);
}

.admin-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-content: end;
    gap: 12px;
    width: min(100%, 340px);
    margin-inline-start: auto;
    align-self: center;
}

.date-filter {
    min-width: 0;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.date-filter label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
}

.date-filter > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 124px;
    align-items: center;
    gap: 8px;
}

.date-filter > div > label {
    display: block;
    min-width: 0;
    margin: 0;
}

.date-filter > div > label > span:empty {
    display: none;
}

.date-filter .jalali-date-input {
    width: 100%;
    min-width: 0;
}

.date-filter select {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 48px;
    padding: 0 30px 0 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65);
    font-size: .84rem;
    transition: border-color .15s ease, box-shadow .15s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #8a96a8 50%),
        linear-gradient(135deg, #8a96a8 50%, transparent 50%),
        linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
    background-position:
        calc(100% - 16px) calc(50% - 3px),
        calc(100% - 10px) calc(50% - 3px),
        0 0;
    background-size:
        6px 6px,
        6px 6px,
        100% 100%;
    background-repeat: no-repeat;
}

.date-filter select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.date-filter .jalali-date-shell {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 48px;
}

.date-filter .jalali-date-icon {
    min-width: 48px;
    padding-inline: 10px;
}

.date-filter .jalali-date-button {
    min-height: 36px;
    padding-inline: 12px;
}

.date-filter-auto .jalali-date-button {
    display: none;
}

.date-filter-auto .jalali-date-shell {
    grid-template-columns: auto minmax(0, 1fr);
    cursor: pointer;
}

.date-filter-auto [data-jalali-display] {
    cursor: pointer;
}

.date-filter button,
.admin-actions .logout {
    min-height: 46px;
}

.admin-actions .logout {
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.admin-tabs {
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #ffffff;
    padding: 5px;
    box-shadow: var(--shadow-soft);
    gap: 4px;
}

.admin-tab {
    border-radius: 12px;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: -.01em;
    border: 1px solid transparent;
    transition: all var(--transition);
    min-height: 40px;
    padding: 9px 14px;
}

.admin-tab:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.admin-tab.is-active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: rgba(59, 91, 219, .22);
    box-shadow: 0 1px 4px rgba(59, 91, 219, .12);
}

@media (max-width: 980px) {
    .admin-hero {
        align-items: stretch;
        gap: 18px;
    }

    .admin-actions {
        grid-template-columns: 1fr;
        width: 100%;
        align-items: stretch;
    }

    .date-filter > div {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 132px;
        align-items: stretch;
    }
}

@media (max-width: 720px) {
    .admin-hero {
        padding: 22px 18px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .hero-media {
        order: 2;
    }

    .admin-actions {
        gap: 10px;
    }

    .date-filter {
        padding: 12px;
        border-radius: 16px;
    }
}

@media (max-width: 560px) {
    .date-filter > div {
        grid-template-columns: 1fr;
    }

    .date-filter > div > label,
    .date-filter select {
        grid-column: auto;
    }
}

/* ── 21. Admin Panel Cards ────────────────────────────────── */
.panel {
    border-radius: 20px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.panel-head {
    padding: 20px 24px 18px;
    background: linear-gradient(180deg, #fafcff 0%, #f7f9ff 100%);
    border-bottom: 1px solid var(--line);
}

.panel-head h2 {
    font-weight: 900;
    letter-spacing: -.025em;
    font-size: 1.05rem;
}

/* ── 22. Tables ───────────────────────────────────────────── */
.table-wrap {
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(248, 250, 255, .65) 0%, rgba(255, 255, 255, 0) 26px);
}

table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

th {
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .025em;
    color: var(--muted);
    background: #f8faff;
    padding: 14px 16px;
    line-height: 1.45;
    text-align: right;
    box-shadow: inset 0 -1px 0 rgba(208, 215, 229, .7);
}

td {
    padding: 15px 16px;
    font-size: .88rem;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    line-height: 1.65;
    background: rgba(255, 255, 255, .92);
}

tbody tr {
    transition: background var(--transition);
}

tbody tr:hover {
    background: #f7f9ff;
}

tbody tr:hover td {
    background: #f7f9ff;
}

.admin-patient-link {
    font-weight: 800;
    color: var(--text);
    transition: color var(--transition);
}

.admin-patient-link:hover {
    color: var(--primary);
}

.admin-context-button {
    width: 100%;
    min-width: 144px;
    padding: 12px 14px;
    display: grid;
    justify-items: start;
    gap: 4px;
    text-align: right;
    border-radius: 14px;
    box-shadow: none;
}

.admin-context-button-title {
    font-size: .81rem;
    font-weight: 900;
    line-height: 1.4;
}

.admin-context-button-subtitle {
    font-size: .72rem;
    line-height: 1.55;
    color: var(--muted);
}

.admin-detail-button {
    min-height: 0;
}

.admin-shell td:last-child,
.admin-shell td:nth-last-child(2) {
    width: 1%;
}

/* ── 23. Admin Detail Drawer ──────────────────────────────── */
.admin-detail-panel {
    border-radius: 22px;
    border: 1px solid var(--line-strong);
    background: #fff;
    box-shadow: var(--shadow-lg);
}

.admin-detail-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 20px;
    margin-bottom: 4px;
}

.admin-detail-panel-head > div {
    display: grid;
    align-content: center;
    gap: 4px;
    min-width: 0;
}

.admin-detail-panel-head strong {
    display: block;
    font-size: 1.06rem;
    font-weight: 900;
    letter-spacing: -.02em;
    line-height: 1.45;
}

.admin-detail-grid div,
.admin-detail-block {
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fafbff;
    padding: 14px 16px;
}

.admin-detail-grid span,
.admin-detail-block span {
    font-size: .71rem;
    font-weight: 800;
    letter-spacing: .03em;
    color: var(--muted);
}

.admin-detail-grid strong {
    font-size: .88rem;
    font-weight: 700;
    line-height: 1.6;
}

.admin-detail-block p,
.admin-detail-block .attachment-list,
.admin-detail-block form {
    margin-top: 10px;
}

.admin-detail-stack {
    display: grid;
    gap: 16px;
}

/* ── 24. Consultation Admin Items ─────────────────────────── */
.consultation-admin-item {
    border-radius: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
    box-shadow: var(--shadow-soft);
    padding: 20px;
    transition: all var(--transition);
}

.consultation-admin-item:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
    border-color: rgba(59, 91, 219, .15);
}

/* ── 25. Flash Messages ───────────────────────────────────── */
.flash {
    border-radius: 14px;
    font-size: .88rem;
    font-weight: 600;
    box-shadow: var(--shadow-soft);
}

.flash-success {
    background: var(--success-bg);
    border-color: rgba(15, 122, 74, .2);
    color: var(--success);
}

.flash-danger {
    background: var(--danger-bg);
    border-color: rgba(192, 57, 43, .2);
    color: var(--danger);
}

/* ── 26. Complaint Help Box ───────────────────────────────── */
.complaint-help {
    border-radius: 12px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #fafcff 0%, #f5f8ff 100%);
    padding: 14px 16px;
}

.complaint-help p {
    font-size: .82rem;
    line-height: 1.85;
    color: var(--muted);
}

/* ── 27. Notification Gate ────────────────────────────────── */
.notification-gate {
    background: rgba(15, 22, 35, .55);
    backdrop-filter: blur(8px);
}

.notification-gate-card {
    border-radius: 22px;
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-lg);
    padding: 28px;
}

.notification-gate-card h2 {
    font-weight: 900;
    letter-spacing: -.03em;
    font-size: 1.32rem;
}

.notification-gate-button {
    border-radius: 12px;
    font-weight: 800;
}

/* ── 28. Footer ───────────────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, .7) 100%);
    margin-top: 48px;
}

.site-footer-copy {
    font-size: .82rem;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: .01em;
}

/* ── 29. Inline Note / Field Hint ─────────────────────────── */
.inline-note {
    border-radius: 10px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #f9faff 100%);
    font-size: .81rem;
    font-weight: 600;
    color: var(--muted);
    padding: 10px 14px;
}

/* ── 30. Rules Box ────────────────────────────────────────── */
.rules-box {
    border-radius: 14px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #fafcff 0%, #f5f8ff 100%);
    padding: 16px;
}

.rules-box span {
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .03em;
    color: var(--muted);
}

/* ── 31. Patient Directory Items ──────────────────────────── */
.patient-directory-item {
    border-radius: 14px;
    border: 1px solid var(--line);
    background: linear-gradient(160deg, #ffffff 0%, #fafcff 100%);
    padding: 16px 18px;
    transition: all var(--transition);
    box-shadow: var(--shadow-soft);
}

.patient-directory-item:hover {
    border-color: rgba(59, 91, 219, .2);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.patient-directory-item strong {
    font-weight: 800;
    font-size: .98rem;
    letter-spacing: -.01em;
}

.patient-directory-meta span {
    font-size: .75rem;
    font-weight: 700;
    color: var(--muted);
    background: var(--primary-light);
    padding: 3px 8px;
    border-radius: 6px;
}

/* ── 32. Schedule Day ─────────────────────────────────────── */
.schedule-day {
    border-radius: 16px;
    border: 1px solid var(--line);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: box-shadow var(--transition);
}

.schedule-day:hover {
    box-shadow: var(--shadow);
}

.schedule-day-head {
    background: linear-gradient(180deg, #fafcff 0%, #f5f8ff 100%);
    border-bottom: 1px solid var(--line);
}

.schedule-day-head h3 {
    font-weight: 900;
    font-size: .96rem;
    letter-spacing: -.02em;
}

/* ── 33. Slot Pills (Admin Schedule) ─────────────────────── */
.slot-pill {
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: .82rem;
    font-weight: 700;
    padding: 9px 16px;
    transition: all var(--transition);
    box-shadow: var(--shadow-soft);
}

.slot-pill:hover {
    border-color: rgba(59, 91, 219, .2);
    background: var(--primary-light);
}

.slot-pill:has(input:checked) {
    background: var(--primary-light);
    border-color: rgba(59, 91, 219, .3);
    color: var(--primary);
}

/* ── 34. Terms Checkbox ───────────────────────────────────── */
.terms span {
    font-size: .88rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.6;
}

/* ── 35. Logout Button ────────────────────────────────────── */
.logout {
    border-radius: 12px;
    border: 1px solid var(--line);
    font-size: .84rem;
    font-weight: 800;
    color: var(--muted);
    transition: all var(--transition);
}

.logout:hover {
    border-color: rgba(59, 91, 219, .25);
    background: var(--primary-light);
    color: var(--primary);
    transform: translateY(-1px);
}

/* ── 36. Date Filter ──────────────────────────────────────── */
.date-filter label {
    font-size: .8rem;
    font-weight: 800;
    color: var(--muted);
    letter-spacing: .02em;
}

/* ── 37. Char Counter & Field Error ──────────────────────── */
.char-counter {
    font-size: .77rem;
    font-weight: 600;
    color: var(--muted);
}

.field-error,
.step-error {
    font-size: .78rem;
    font-weight: 700;
    color: var(--danger);
    border-radius: 10px;
}

.step-error {
    background: var(--danger-bg);
    border: 1px solid rgba(192, 57, 43, .15);
    padding: 10px 14px;
}

/* ── 38. Attachment Preview ───────────────────────────────── */
.attachment-preview-card {
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fafbff;
    transition: all var(--transition);
    box-shadow: var(--shadow-soft);
}

.attachment-preview-card:hover {
    box-shadow: var(--shadow);
    border-color: rgba(59, 91, 219, .18);
}

.attachment-preview-thumb {
    border-radius: 9px;
    background: var(--primary-light);
}

.attachment-preview-thumb span {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 900;
}

.attachment-preview-remove {
    border-radius: 9px;
    font-size: .75rem;
    font-weight: 800;
    border: 1px solid rgba(192, 57, 43, .18);
    background: #fff;
    color: var(--danger);
    transition: all var(--transition);
}

.attachment-preview-remove:hover {
    background: var(--danger-bg);
}

/* ── 39. Admin Detail Button ──────────────────────────────── */
.admin-detail-button {
    border-radius: 10px;
    font-size: .77rem;
    font-weight: 800;
}

/* ── 40. History Cards ────────────────────────────────────── */
.history-card {
    border-radius: 16px;
    border: 1px solid var(--line);
    background: linear-gradient(160deg, #ffffff 0%, #fafcff 100%);
    box-shadow: var(--shadow-soft);
    transition: all var(--transition);
}

.history-card:hover {
    box-shadow: var(--shadow);
    border-color: rgba(59, 91, 219, .15);
    transform: translateY(-1px);
}

.history-thread-item {
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #ffffff;
}

/* ── 41. Jalali Picker ────────────────────────────────────── */
.jalali-picker-sheet {
    border-radius: 22px;
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-lg);
    background: #ffffff;
}

.jalali-picker-popover {
    background: rgba(15, 22, 35, .22);
    backdrop-filter: blur(6px);
}

.jalali-date-button {
    border-radius: 10px;
    font-size: .78rem;
    font-weight: 800;
}

/* ── 42. Attachment List (links) ──────────────────────────── */
.attachment-list a {
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: .76rem;
    font-weight: 700;
    transition: all var(--transition);
}

.attachment-list a:hover {
    border-color: rgba(59, 91, 219, .25);
    background: var(--primary-light);
    color: var(--primary);
}

/* ── 43. Summary File List Tags ───────────────────────────── */
.summary-file-list span {
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: .72rem;
    font-weight: 800;
    padding: 4px 10px;
}

/* ── 44. Patient Create Box ───────────────────────────────── */
.patient-create-box {
    border-radius: 14px;
    border: 1.5px dashed rgba(59, 91, 219, .18);
    background: linear-gradient(160deg, #fafcff 0%, #f5f8ff 100%);
}

/* ── 45. Final Shared Polish ─────────────────────────────── */
.auth-page,
.patient-shell,
.admin-shell {
    width: min(1200px, calc(100% - 36px));
    margin: 32px auto 42px;
}

.auth-card,
.patient-card,
.panel,
.notification-gate-card {
    border-radius: 24px;
    border-color: rgba(208, 215, 229, .88);
    box-shadow: 0 10px 30px rgba(15, 22, 35, .07);
}

.auth-card {
    padding: 32px;
}

.auth-card-wide {
    width: min(540px, 100%);
}

.patient-card {
    padding: 28px;
}

.patient-hero,
.admin-hero {
    padding: 34px 30px 28px;
    margin-bottom: 28px;
}

.patient-hero h1,
.admin-hero h1,
.auth-card h1 {
    line-height: 1.16;
}

.patient-hero p,
.admin-hero p,
.panel-head p,
.auth-help {
    line-height: 1.82;
}

.panel-head {
    padding: 22px 24px 20px;
}

.panel-head h2 {
    line-height: 1.3;
}

.auth-card form,
.field-grid,
.form-grid {
    gap: 18px;
}

.auth-card label,
.form-grid label,
.field-grid label {
    gap: 9px;
}

.auth-card span,
.form-grid label span,
.form-grid legend,
.field-grid span,
.date-filter label {
    font-weight: 800;
    line-height: 1.5;
}

input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
select,
textarea {
    min-height: 50px;
    padding: 12px 15px;
    line-height: 1.55;
}

textarea {
    min-height: 132px;
}

.select-shell select {
    min-height: 50px;
}

.jalali-date-shell {
    min-height: 52px;
    padding: 6px 7px;
}

.jalali-date-icon,
.jalali-date-button {
    min-height: 42px;
}

.step-head {
    display: grid;
    gap: 8px;
    margin-bottom: 4px;
}

.step-head h2 {
    margin: 0 0 2px;
    line-height: 1.28;
}

.step-head p {
    margin: 0;
    line-height: 1.82;
}

.step-actions {
    gap: 14px;
    margin-top: 30px;
    padding-top: 2px;
}

.rules-box,
.selection-summary,
.complaint-help,
.auth-context,
.file-picker-shell,
.patient-create-box {
    border-radius: 16px;
}

/* ── 46. Responsive fine-tuning ───────────────────────────── */
@media (max-width: 620px) {
    .patient-hero {
        padding: 22px 18px 20px;
    }

    .admin-hero,
    .patient-card,
    .panel-head {
        padding: 18px;
    }

    .service-feature {
        padding: 18px;
    }

    .stepper-item {
        padding: 10px 8px;
    }
}

/* ── 47. Focus Visible ────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ── 48. Smooth scrolling ─────────────────────────────────── */
html {
    scroll-behavior: smooth;
}

/* ── 49. Selection color ──────────────────────────────────── */
::selection {
    background: rgba(59, 91, 219, .15);
    color: var(--primary-dark);
}

/* ── 50. Final Contrast & Accessibility Pass ─────────────── */
.button-secondary {
    color: #223044;
}

.flash,
.app-toast-message,
.history-mini-meta span,
.attachment-list a,
.admin-context-button-subtitle,
.patient-directory-meta span,
.history-meta,
.history-thread-head,
.step-head p,
.patient-hero p,
.admin-hero p,
.panel-head p,
.auth-help,
.complaint-help p,
.inline-note,
.site-footer-copy,
.rules-box span,
.admin-detail-grid span,
.admin-detail-block span {
    color: #566275;
}

.field-error,
.step-error {
    font-weight: 800;
}

.badge {
    letter-spacing: 0;
}

.badge.ok {
    color: #0d6b41;
}

.badge.off {
    color: #8f2c23;
}

.history-mini-meta span,
.attachment-list a {
    line-height: 1.5;
}

.attachment-list a {
    color: #243246;
    font-weight: 800;
}

.attachment-list a:hover {
    border-color: rgba(59, 91, 219, .28);
    background: var(--primary-light);
    color: var(--primary-dark);
}

:focus-visible {
    outline-offset: 3px;
}

button:focus-visible,
a:focus-visible {
    outline-offset: 3px;
}
