:root {
    --gray: #64748b;
    --accent: #0891b2;
    --accent-dark: #0e7490;
    --accent-light: rgba(8, 145, 178, 0.14);
    --accent-glow: rgba(8, 145, 178, 0.32);
    --mint: #14b8a6;
    --mint-light: rgba(20, 184, 166, 0.14);
    --pearl: #f0fdfa;
    --dental-gradient: linear-gradient(135deg, #0891b2 0%, #14b8a6 55%, #2dd4bf 100%);
    --dental-gradient-soft: linear-gradient(160deg, rgba(8, 145, 178, 0.12) 0%, rgba(20, 184, 166, 0.08) 100%);
    --primary: var(--accent);
    --primary-dark: var(--accent-dark);
    --primary-light: var(--accent-light);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.12);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --radius: 18px;
    --radius-sm: 12px;
    --app-width: 430px;
}

[data-theme="dark"] {
    --black: #000000;
    --bg: #0b1220;
    --body-bg: #060a12;
    --surface: #111827;
    --surface-elevated: #1e293b;
    --header-bg: rgba(17, 24, 39, 0.94);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.18);
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    --shell-glow: rgba(8, 145, 178, 0.12);
    --desktop-bg: #030712;
    --success: #2dd4bf;
    --success-bg: rgba(45, 212, 191, 0.12);
    --success-text: #5eead4;
    --error-text: #fca5a5;
    --info-text: #67e8f9;
    --warning-text: #fcd34d;
    --danger-text: #fca5a5;
    --hero-end: #0f172a;
    --toggle-bg: var(--surface-elevated);
}

[data-theme="light"] {
    --black: #0f172a;
    --bg: #f8fafc;
    --body-bg: #e2eef5;
    --surface: #ffffff;
    --surface-elevated: #f1f5f9;
    --header-bg: rgba(255, 255, 255, 0.92);
    --text: #0f172a;
    --text-muted: #64748b;
    --border: rgba(100, 116, 139, 0.18);
    --shadow: 0 8px 32px rgba(8, 145, 178, 0.08);
    --shell-glow: rgba(8, 145, 178, 0.1);
    --desktop-bg: linear-gradient(165deg, #dbeafe 0%, #ccfbf1 45%, #e2e8f0 100%);
    --success: #0d9488;
    --success-bg: rgba(13, 148, 136, 0.1);
    --success-text: #0f766e;
    --error-text: #dc2626;
    --info-text: #0891b2;
    --warning-text: #b45309;
    --danger-text: #dc2626;
    --hero-end: #ecfeff;
    --toggle-bg: #f1f5f9;
    --accent-light: rgba(8, 145, 178, 0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: var(--body-bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.25s ease, color 0.25s ease;
}

[data-theme="light"] body {
    background: var(--desktop-bg);
}

.dentiva-app {
    position: relative;
    isolation: isolate;
}

.dentiva-app::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 45% at 50% -5%, rgba(8, 145, 178, 0.14), transparent 55%),
        radial-gradient(circle at 100% 80%, rgba(20, 184, 166, 0.08), transparent 40%);
    pointer-events: none;
    z-index: 0;
}

[data-theme="dark"] .dentiva-app::before {
    background:
        radial-gradient(ellipse 80% 40% at 50% 0%, rgba(8, 145, 178, 0.18), transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(20, 184, 166, 0.1), transparent 45%);
}

.dentiva-app > * {
    position: relative;
    z-index: 1;
}

a {
    color: inherit;
    text-decoration: none;
}

.icon {
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.icon-muted {
    color: var(--gray);
}

.app-shell {
    max-width: var(--app-width);
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 80px var(--shell-glow);
    transition: background-color 0.25s ease;
}

.app-header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 16px;
    transition: background-color 0.25s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.app-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 2px;
    border-radius: 2px;
    background: var(--dental-gradient);
    opacity: 0.55;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
    min-width: 0;
}

.brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--toggle-bg);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.theme-icon {
    display: none;
    line-height: 0;
}

[data-theme="dark"] .theme-icon-moon,
[data-theme="light"] .theme-icon-sun {
    display: flex;
}

.header-user {
    font-size: 0.8rem;
    color: var(--accent-dark);
    background: var(--accent-light);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(8, 145, 178, 0.22);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
    font-weight: 600;
}

.header-user:hover {
    opacity: 0.9;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 16px;
}

.app-main {
    flex: 1;
    padding: 16px;
    padding-bottom: 90px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--app-width);
    background: var(--header-bg);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    z-index: 100;
    transition: background-color 0.25s ease;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 -8px 32px rgba(8, 145, 178, 0.06);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 0.68rem;
    color: var(--gray);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    min-width: 58px;
}

.nav-item .icon {
    transition: color 0.2s;
}

.nav-item.active {
    color: var(--accent);
    background: var(--accent-light);
    box-shadow: inset 0 0 0 1px rgba(8, 145, 178, 0.15);
}

.nav-item.active .icon {
    color: var(--accent);
}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text);
}

.page-subtitle {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.page-title-sm {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: rgba(1, 117, 79, 0.35);
}

.alert-error {
    background: var(--danger-bg);
    color: var(--error-text);
    border-color: rgba(224, 82, 82, 0.3);
}

.alert-info {
    background: var(--accent-light);
    color: var(--info-text);
    border-color: rgba(1, 117, 79, 0.3);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border-color: rgba(201, 162, 39, 0.3);
}

.payment-card-box .payment-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    font-size: 0.9rem;
}

.payment-card-box .payment-info-row:last-of-type {
    border-bottom: none;
}

.payment-card-box .card-number {
    color: var(--accent);
    font-size: 1.05rem;
    letter-spacing: 1px;
}

.receipt-preview {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-elevated);
}

.admin-payment-form {
    margin-top: 12px;
}

.otp-input {
    text-align: center;
    font-size: 1.4rem;
    letter-spacing: 0.4em;
    font-weight: 600;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.announcements-section {
    margin-bottom: 24px;
}

.announcement-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-right: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
}

.announcement-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.announcement-card p {
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.announcement-date {
    margin-top: 10px;
    font-size: 0.78rem;
}

.ticket-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ticket-bubble {
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    border: 1px solid var(--border);
    max-width: 92%;
}

.ticket-bubble-user {
    align-self: flex-end;
    background: var(--accent-light);
    border-color: rgba(1, 117, 79, 0.25);
}

.ticket-bubble-admin {
    align-self: flex-start;
    background: var(--surface);
}

.ticket-bubble-header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--gray);
    margin-bottom: 6px;
}

.ticket-bubble-header strong {
    color: var(--text);
    font-size: 0.8rem;
}

.ticket-bubble p {
    font-size: 0.9rem;
    line-height: 1.7;
    white-space: pre-wrap;
}

.event-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: block;
    transition: transform 0.15s, border-color 0.2s, background-color 0.25s;
}

.event-card:hover {
    border-color: rgba(1, 117, 79, 0.4);
}

.event-card:active {
    transform: scale(0.98);
}

.event-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

.event-card h3 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--gray);
    margin-bottom: 10px;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.event-price {
    font-weight: 700;
    color: var(--accent);
    font-size: 0.95rem;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid rgba(1, 117, 79, 0.3);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid rgba(201, 162, 39, 0.3);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid rgba(224, 82, 82, 0.3);
}

.badge-muted {
    background: rgba(115, 113, 116, 0.15);
    color: var(--gray);
    border: 1px solid var(--border);
}

.badge-info {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .badge-info {
    color: #93c5fd;
}

.online-link-section .online-link-url {
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--gray);
    word-break: break-all;
}

.event-type-fields.is-hidden {
    display: none;
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--gray);
}

.empty-state .icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    margin-bottom: 16px;
    color: var(--accent);
}

.landing-page {
    padding-bottom: 24px;
}

.landing-hero {
    padding-bottom: 24px;
}

.org-search-wrap {
    max-width: 100%;
    margin: 0 auto 20px;
}

.org-search-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.org-search {
    position: relative;
}

.org-search-icon {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    color: var(--gray);
    pointer-events: none;
}

.org-search-input {
    width: 100%;
    padding: 14px 44px 14px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.org-search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.org-search-results {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    z-index: 30;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    max-height: 280px;
    overflow-y: auto;
}

.org-search-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font-family: inherit;
    text-align: right;
    cursor: pointer;
    transition: background-color 0.15s;
}

.org-search-item:last-child {
    border-bottom: 0;
}

.org-search-item:hover,
.org-search-item.is-active {
    background: var(--accent-light);
}

.org-search-item-title {
    font-size: 0.92rem;
    font-weight: 600;
}

.org-search-item-meta {
    font-size: 0.78rem;
    color: var(--gray);
}

.org-search-empty {
    padding: 14px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray);
}

.org-search-hint {
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--gray);
}

.landing-staff-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--gray);
}

.landing-staff-links a {
    color: var(--accent);
    font-weight: 600;
}

.form-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: background-color 0.25s ease;
    overflow: hidden;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--surface-elevated);
    color: var(--text);
    transition: border-color 0.2s, background-color 0.25s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--gray);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group select option {
    background: var(--surface);
}

.form-hint {
    font-size: 0.78rem;
    color: var(--gray);
    margin-top: 4px;
}

.booking-schedule {
    display: grid;
    gap: 12px 16px;
    margin-bottom: 16px;
}

@media (min-width: 520px) {
    .booking-schedule {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

.booking-schedule .form-group {
    margin-bottom: 0;
}

.time-slot-select {
    font-family: 'Vazirmatn', Tahoma, sans-serif !important;
    font-weight: 500;
    letter-spacing: 0.02em;
    direction: rtl;
    text-align: right;
}

.time-slot-select:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.form-error {
    font-size: 0.82rem;
    color: var(--error-text);
    margin-bottom: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-primary {
    background: var(--dental-gradient);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(8, 145, 178, 0.28);
}

.btn-primary:hover {
    filter: brightness(1.05);
    box-shadow: 0 8px 24px rgba(8, 145, 178, 0.35);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-secondary:hover {
    background: var(--accent-light);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid rgba(224, 82, 82, 0.3);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
    width: auto;
}

.btn-group {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.btn-group .btn {
    flex: 1;
}

.detail-hero {
    background: linear-gradient(145deg, var(--surface-elevated) 0%, var(--hero-end) 100%);
    color: var(--text);
    border-radius: var(--radius);
    padding: 24px 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.detail-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
}

.detail-hero h1 {
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.detail-hero .event-meta {
    color: var(--gray);
}

.detail-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    transition: background-color 0.25s ease;
}

.detail-section h2 {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: center;
    border: 1px solid var(--border);
    transition: background-color 0.25s ease;
}

.stat-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-card .label {
    font-size: 0.78rem;
    color: var(--gray);
}

.admin-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.admin-actions .btn {
    width: auto;
    flex: 1;
    min-width: 100px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 500;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--gray);
}

.auth-footer a {
    color: var(--accent);
    font-weight: 600;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

.link-accent {
    color: var(--accent);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: var(--surface);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray);
    transition: all 0.2s;
}

.auth-tab.active {
    background: var(--accent);
    color: #fff;
}

.admin-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.admin-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    transition: border-color 0.2s, background-color 0.25s;
}

.admin-menu-item:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.admin-menu-item .icon {
    color: var(--accent);
}

.admin-bottom-nav .nav-item {
    min-width: 56px;
    font-size: 0.68rem;
    padding: 8px 6px;
}

.header-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--toggle-bg);
    color: var(--text-muted);
    transition: all 0.2s;
}

.header-logout:hover {
    color: var(--danger-text);
    border-color: rgba(224, 82, 82, 0.4);
}

.dashboard-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.dashboard-block-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.dashboard-alerts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.dashboard-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
}

.dashboard-alert-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid rgba(201, 162, 39, 0.3);
}

.dashboard-alert-info {
    background: var(--accent-light);
    color: var(--info-text);
    border: 1px solid rgba(1, 117, 79, 0.3);
}

.admin-menu-item-accent {
    border-color: var(--accent);
    background: var(--accent-light);
}

.admin-menu-item-accent .icon {
    color: var(--accent);
}

.sms-var-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.sms-var-row input,
.sms-var-row select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.88rem;
    background: var(--surface-elevated);
    color: var(--text);
}

@media (min-width: 431px) {
    body {
        background: var(--desktop-bg);
    }

    .app-shell {
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
    }
}

.brand-preview-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    margin-bottom: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-elevated);
}

.brand-preview-logo {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--border);
    background: var(--surface);
}

.brand-preview-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.brand-preview-chip {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
    background: var(--preview-accent, var(--accent));
}

.brand-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-color-row input[type="color"] {
    width: 52px;
    height: 44px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-elevated);
    cursor: pointer;
}

.brand-color-row input[type="text"] {
    flex: 1;
}

.brand-current-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
}

.brand-current-logo img {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
}

.brand-remove-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--gray);
}

/* ── Subscription / plan widgets ── */
.plan-widget {
    background: linear-gradient(135deg, var(--surface) 0%, color-mix(in srgb, var(--accent) 6%, var(--surface)) 100%);
    border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.plan-widget-warn {
    border-color: color-mix(in srgb, var(--warning-text) 35%, var(--border));
    background: linear-gradient(135deg, var(--surface) 0%, var(--warning-bg) 100%);
}

.plan-widget-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.plan-widget-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.plan-widget-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
    flex-shrink: 0;
}

.plan-widget-label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray);
    margin-bottom: 2px;
}

.plan-widget-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
}

.plan-widget-price {
    text-align: left;
    flex-shrink: 0;
}

.plan-widget-price-value {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.plan-widget-price-unit {
    font-size: 0.72rem;
    color: var(--gray);
}

.plan-widget-desc {
    font-size: 0.85rem;
    color: var(--gray);
    margin: -4px 0 12px;
    line-height: 1.6;
}

.plan-widget-pending {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    background: var(--warning-bg);
    color: var(--warning-text);
    font-size: 0.85rem;
}

.plan-metrics {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
}

.plan-metric-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.plan-metric-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}

.plan-metric-value {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray);
}

.plan-metric-value-warn {
    color: var(--warning-text);
}

.plan-metric-value-full {
    color: var(--danger-text);
}

.plan-progress {
    height: 8px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}

.plan-progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.35s ease;
}

.plan-progress-ok {
    background: var(--accent);
}

.plan-progress-warn {
    background: var(--warning-text);
}

.plan-progress-full {
    background: var(--danger-text);
}

.plan-widget-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.plan-widget-hint {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--warning-text);
    margin: 0;
    line-height: 1.5;
}

.plan-widget-hint-muted {
    color: var(--gray);
}

.plan-widget-cta {
    align-self: stretch;
    justify-content: center;
}

.plan-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.plan-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.plan-card-current {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}

.plan-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
}

.plan-card-badge-muted {
    background: var(--border);
    color: var(--gray);
}

.plan-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    padding-top: 4px;
}

.plan-card-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.plan-card-price-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent);
}

.plan-card-price-unit {
    font-size: 0.8rem;
    color: var(--gray);
}

.plan-card-desc {
    font-size: 0.85rem;
    color: var(--gray);
    line-height: 1.6;
    margin: 0;
}

.plan-card-features {
    list-style: none;
    margin: 4px 0 8px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.plan-card-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    color: var(--text);
}

.plan-card-btn {
    width: 100%;
    margin-top: auto;
}

.plan-card-hint {
    font-size: 0.8rem;
    color: var(--gray);
    text-align: center;
    padding: 8px 0;
}

.plan-card-select {
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.plan-card-select input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.plan-card-selected,
.plan-card-select:has(input:checked) {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}

.plan-card-hint-free {
    color: var(--accent);
    font-weight: 600;
}

.plan-select-section {
    margin: 20px 0 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.plan-select-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-select-subtitle {
    font-size: 0.82rem;
    color: var(--gray);
    margin: 0 0 14px;
    line-height: 1.5;
}

@media (min-width: 640px) {
    .plan-cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .plan-widget-footer {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .plan-widget-cta {
        align-self: auto;
        min-width: 180px;
    }
}

/* ── PWA install banner & toast ── */
.pwa-install-banner {
    position: fixed;
    inset-inline: 12px;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    z-index: 1200;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.28s ease, transform 0.28s ease;
    pointer-events: none;
}

.pwa-install-banner.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.pwa-install-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 10px 12px;
    align-items: center;
    padding: 14px 14px 14px 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--surface) 0%, color-mix(in srgb, var(--accent) 8%, var(--surface)) 100%);
    border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
    box-shadow: 0 12px 40px rgba(1, 117, 79, 0.18), 0 4px 16px rgba(0, 0, 0, 0.08);
}

.pwa-install-close {
    position: absolute;
    top: 8px;
    left: 10px;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--gray);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
}

.pwa-install-card {
    position: relative;
}

.pwa-install-icon-wrap {
    grid-row: span 2;
}

.pwa-install-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(1, 117, 79, 0.25);
}

.pwa-install-title {
    display: block;
    font-size: 0.95rem;
    color: var(--text);
}

.pwa-install-text {
    margin: 4px 0 0;
    font-size: 0.78rem;
    line-height: 1.55;
    color: var(--gray);
}

.pwa-install-btn {
    grid-column: 1 / -1;
    width: 100%;
    margin: 0;
    box-shadow: 0 6px 18px rgba(1, 117, 79, 0.25);
}

.pwa-toast {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0px));
    inset-inline: 12px;
    z-index: 1300;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--accent);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 8px 28px rgba(1, 117, 79, 0.35);
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.pwa-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (min-width: 640px) {
    .pwa-install-banner {
        inset-inline: auto;
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(16px);
        width: min(420px, calc(100vw - 24px));
    }

    .pwa-install-banner.is-visible {
        transform: translateX(-50%) translateY(0);
    }

    .pwa-toast {
        inset-inline: auto;
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(-12px);
        width: min(360px, calc(100vw - 24px));
    }

    .pwa-toast.is-visible {
        transform: translateX(-50%) translateY(0);
    }
}

/* ─── تقویم نوبت admin ─── */
.calendar-event {
    display: block;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-elevated);
    text-decoration: none;
    color: inherit;
}

.calendar-event strong {
    display: inline-block;
    margin-left: 8px;
    color: var(--accent);
}

.calendar-event small {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 4px;
}

.calendar-event.status-confirmed { border-right: 3px solid var(--success, #0d9488); }
.calendar-event.status-pending { border-right: 3px solid #eab308; }
.calendar-event.status-cancelled,
.calendar-event.status-no_show { border-right: 3px solid var(--danger, #dc2626); opacity: 0.75; }
.calendar-event.status-completed { border-right: 3px solid #0284c7; }
.calendar-event.status-in_progress { border-right: 3px solid #f97316; }

/* ─── تم دندانپزشکی ─── */
.clinic-hero {
    position: relative;
    margin: -4px -4px 20px;
    padding: 22px 18px 20px;
    border-radius: calc(var(--radius) + 4px);
    overflow: hidden;
    background: var(--dental-gradient);
    color: #fff;
    box-shadow: 0 12px 36px rgba(8, 145, 178, 0.28);
}

.clinic-hero-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.28), transparent 42%),
        radial-gradient(circle at 10% 90%, rgba(255, 255, 255, 0.12), transparent 35%);
    pointer-events: none;
}

.clinic-hero-inner {
    position: relative;
    z-index: 1;
}

.clinic-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 10px;
    backdrop-filter: blur(6px);
}

.clinic-hero-title {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 6px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.clinic-hero-sub {
    font-size: 0.88rem;
    opacity: 0.92;
    line-height: 1.65;
    max-width: 28em;
}

.clinic-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.clinic-hero-stats span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.78rem;
    font-weight: 600;
}

.landing-clinic-hero {
    text-align: center;
}

.landing-clinic-hero .clinic-hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.landing-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.35);
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.doctors-section {
    margin-bottom: 22px;
}

.doctor-grid {
    display: grid;
    gap: 10px;
}

.doctor-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.doctor-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--dental-gradient-soft);
    color: var(--accent);
    flex-shrink: 0;
}

.doctor-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.doctor-info strong {
    font-size: 0.92rem;
    color: var(--text);
}

.doctor-info span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.services-section {
    margin-bottom: 8px;
}

.service-grid {
    display: grid;
    gap: 14px;
}

.service-card {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(8, 145, 178, 0.12);
    border-color: rgba(8, 145, 178, 0.25);
}

.service-card-accent {
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--dental-gradient);
}

.service-card-body {
    padding: 16px 18px 16px 16px;
}

.service-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.service-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--dental-gradient-soft);
    color: var(--accent);
}

.service-card h3 {
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.45;
    margin-bottom: 6px;
    color: var(--text);
}

.service-desc {
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 10px;
}

.service-meta {
    margin-bottom: 12px;
}

.service-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.service-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent-dark);
}

[data-theme="dark"] .service-price {
    color: #67e8f9;
}

.service-footer .btn-sm {
    width: auto;
    flex-shrink: 0;
    padding: 10px 14px;
    font-size: 0.82rem;
    white-space: nowrap;
}

.service-badge {
    font-size: 0.72rem;
}

.service-card.service-cat-preventive { --cat: #10b981; }
.service-card.service-cat-restorative { --cat: #3b82f6; }
.service-card.service-cat-cosmetic { --cat: #a855f7; }
.service-card.service-cat-surgery { --cat: #ef4444; }
.service-card.service-cat-ortho { --cat: #6366f1; }
.service-card.service-cat-implant { --cat: #0891b2; }
.service-card.service-cat-emergency { --cat: #f97316; }
.service-card.service-cat-other { --cat: var(--accent); }

.service-card[class*="service-cat-"] .service-card-accent {
    background: var(--cat, var(--accent));
}

.service-card[class*="service-cat-"] .service-icon-wrap {
    background: color-mix(in srgb, var(--cat, var(--accent)) 14%, transparent);
    color: var(--cat, var(--accent));
}

.booking-service-icon.service-cat-preventive { --cat: #10b981; }
.booking-service-icon.service-cat-restorative { --cat: #3b82f6; }
.booking-service-icon.service-cat-cosmetic { --cat: #a855f7; }
.booking-service-icon.service-cat-surgery { --cat: #ef4444; }
.booking-service-icon.service-cat-ortho { --cat: #6366f1; }
.booking-service-icon.service-cat-implant { --cat: #0891b2; }
.booking-service-icon.service-cat-emergency { --cat: #f97316; }

.booking-card {
    padding: 0;
}

.booking-card-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
    background: var(--dental-gradient-soft);
    border-bottom: 1px solid var(--border);
}

.booking-service-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: var(--surface);
    color: var(--accent);
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.booking-service-icon[class*="service-cat-"] {
    background: color-mix(in srgb, var(--cat, var(--accent)) 12%, var(--surface));
    color: var(--cat, var(--accent));
}

.booking-card-head .page-title {
    font-size: 1.15rem;
    margin-bottom: 2px;
}

.booking-service-name {
    margin-bottom: 4px !important;
    font-weight: 500;
}

.booking-service-price {
    font-size: 0.82rem;
    color: var(--accent-dark);
    font-weight: 700;
}

[data-theme="dark"] .booking-service-price {
    color: #67e8f9;
}

.booking-card form {
    padding: 20px;
}

.booking-card > .alert {
    margin: 16px 20px 0;
}

.booking-card .page-subtitle {
    margin-bottom: 0;
}

.announcement-card {
    border-right-color: var(--mint);
    background: linear-gradient(90deg, var(--surface) 0%, color-mix(in srgb, var(--mint) 6%, var(--surface)) 100%);
}

.empty-state .icon-wrap {
    background: var(--dental-gradient-soft);
    border-color: rgba(8, 145, 178, 0.2);
    color: var(--accent);
}
