/* ==========================================================================
   سبک‌های اختصاصی هر صفحه
   ========================================================================== */

/* ============================================================== صفحه ورود */
.auth-screen {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* در فلکس، فرزند با margin:auto کشیده نمی‌شود و عرض max-width می‌گیرد؛
       با center کردن محور عمودی (کراس) و align-self:stretch روی فرزند،
       عرض واقعاً از viewport تبعیت می‌کند. */
    align-items: center;
    box-sizing: border-box;
    padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
    background:
        radial-gradient(900px 420px at 100% -10%, var(--brand-100), transparent 60%),
        radial-gradient(700px 380px at 0% 110%, var(--brand-50), transparent 65%),
        var(--bg);
}

.auth-wrap {
    /* 100% منهای padding افقی والد (box-sizing:border-box) */
    width: 100%;
    max-width: 420px;
    min-width: 0;
    flex: 0 1 auto;
}

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
    text-align: center;
}

.auth-logo {
    width: 74px;
    height: 74px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    background: linear-gradient(150deg, var(--brand-500), var(--brand-700));
    color: var(--on-brand);
    box-shadow: 0 18px 34px -18px var(--brand-600);
}

.auth-logo .icon {
    width: 36px;
    height: 36px;
    stroke-width: 1.6;
}

.auth-brand h1 {
    font-size: 1.28rem;
}

.auth-brand p {
    color: var(--text-muted);
    font-size: .86rem;
}

.auth-card {
    padding: 22px 18px 18px;
    min-width: 0;
}

.auth-card .field+.field {
    margin-top: 14px;
}

.auth-footer {
    margin-top: 18px;
    text-align: center;
    color: var(--text-subtle);
    font-size: .76rem;
}

.alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 11px 13px;
    border-radius: var(--radius);
    background: var(--danger-50);
    color: var(--danger-500);
    font-size: .84rem;
    font-weight: 500;
    margin-bottom: 14px;
}

.alert-info {
    background: var(--info-50);
    color: var(--info-500);
}

.alert .icon {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.demo-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: .78rem;
    color: var(--text-subtle);
    margin-top: 12px;
}

.demo-hint code {
    font-family: var(--font-num);
    background: var(--surface-3);
    padding: 1px 6px;
    border-radius: 6px;
    color: var(--text-muted);
}

/* ============================================================== صفحه خانه */
.status-card {
    position: relative;
    padding: 18px;
    border-radius: var(--radius-lg);
    color: #fff;
    /* گرادیان ثابت با کنتراست بالا در هر دو تم: در دارک‌مود --brand-500 روشن
       است و متن سفید روی آن خوانا نمی‌شود. */
    background: linear-gradient(150deg, #2e9e73, #115c42);
    box-shadow: 0 18px 34px -24px rgba(0, 0, 0, .55);
    overflow: hidden;
    margin-top: 4px;
}

.status-card::after {
    content: "";
    position: absolute;
    inset-inline-end: -40px;
    top: -60px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
}

.status-card.status-break {
    background: linear-gradient(150deg, #d9902b, #a0620b);
    box-shadow: 0 18px 34px -24px rgba(0, 0, 0, .55);
}

.status-card.status-off {
    background: linear-gradient(150deg, #616f6a, #39443f);
    box-shadow: 0 18px 34px -24px rgba(0, 0, 0, .55);
}

.status-card.status-none {
    background: linear-gradient(150deg, #6b7884, #414b55);
    box-shadow: 0 18px 34px -24px rgba(0, 0, 0, .55);
}

.status-top {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.status-dot {
    position: relative;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    flex: 0 0 auto;
}

.status-dot::after {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .55);
    animation: pulse 2.2s ease-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(.7);
        opacity: .9;
    }

    80%,
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.status-label {
    font-size: .74rem;
    opacity: .85;
}

.status-value {
    font-size: 1.12rem;
    font-weight: 700;
}

.status-meta {
    position: relative;
    z-index: 1;
    margin-top: 12px;
    font-size: .8rem;
    opacity: .92;
}

.status-card .btn {
    position: relative;
    z-index: 1;
    margin-top: 14px;
    --btn-bg: rgba(255, 255, 255, .17);
    --btn-bd: rgba(255, 255, 255, .28);
    --btn-fg: #fff;
    backdrop-filter: blur(6px);
    min-height: 42px;
    font-size: .88rem;
}

/* کارت راهنمای موقعیت مکانی بالای صفحه خانه */
.loc-hint {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.loc-hint strong { font-size: .88rem; }
.loc-hint p { margin-top: 2px; line-height: 1.5; }

.loc-hint-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--info-50);
    color: var(--info-500);
}

.loc-hint-icon .icon { width: 20px; height: 20px; }

/* تایل‌ها */
.tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 14px;
}

.tile {
    position: relative;
    display: block;
    min-width: 0;
    padding: 38px 14px 13px;   /* فضای بالا برای نوار وضعیت فوری */
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: transform .14s var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
    overflow: hidden;
}

.tile:active {
    transform: scale(.975);
}

.tile-icon {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    margin-bottom: 10px;
    flex: 0 0 auto;
}

.tile-icon .icon {
    width: 22px;
    height: 22px;
}

.tile-title {
    font-size: .88rem;
    font-weight: 700;
}

.tile-meta {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 6px;
}

.tile-count {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.02em;
}

.tile-unit {
    font-size: .72rem;
    color: var(--text-subtle);
}

.tile-urgent {
    position: absolute;
    top: 10px;
    inset-inline-start: 10px;
    max-width: calc(100% - 20px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: .62rem;
    font-weight: 700;
    line-height: 1.6;
    padding: 1px 7px;
    border-radius: 99px;
    background: var(--danger-50);
    color: var(--danger-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.tile-urgent .icon {
    width: 12px;
    height: 12px;
}

.tile-urgent-warn {
    background: var(--warning-50);
    color: var(--warning-500);
}

.tile--installation .tile-icon {
    background: #eaf3ff;
    color: #2563eb;
}

.tile--collection .tile-icon {
    background: #f3ecff;
    color: #7c3aed;
}

.tile--emergency .tile-icon {
    background: #ffeded;
    color: #dc2626;
}

.tile--periodic .tile-icon {
    background: #eafaf3;
    color: #0f9d6e;
}

:root[data-theme="dark"] .tile--installation .tile-icon {
    background: #12233f;
    color: #7fb0ff;
}

:root[data-theme="dark"] .tile--collection .tile-icon {
    background: #241a3f;
    color: #b79bff;
}

:root[data-theme="dark"] .tile--emergency .tile-icon {
    background: #38181a;
    color: #ff8c8c;
}

:root[data-theme="dark"] .tile--periodic .tile-icon {
    background: #10261e;
    color: #5ad3a3;
}

/* ============================================================== کارت مأموریت */
.mission-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mission-card {
    display: block;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: transform .14s var(--ease), box-shadow var(--dur) var(--ease);
    position: relative;
    overflow: hidden;
}

.mission-card:active {
    transform: scale(.985);
}

.mission-card.is-overdue {
    border-color: color-mix(in srgb, var(--danger-500) 35%, var(--border));
}

/* نوار رنگی سمت راست (RTL → سمت شروع) */
.mission-card::before {
    content: "";
    position: absolute;
    inset-block: 12px;
    inset-inline-start: 0;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--brand-400);
}

.mission-card.mt-emergency::before {
    background: #ef4444;
}

.mission-card.mt-installation::before {
    background: #3b82f6;
}

.mission-card.mt-collection::before {
    background: #8b5cf6;
}

.mission-card.mt-periodic::before {
    background: #10b981;
}

.mission-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mission-type {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .72rem;
    font-weight: 700;
    color: var(--text-muted);
}

.mission-type .icon {
    width: 15px;
    height: 15px;
}

.mission-code {
    font-size: .7rem;
    color: var(--text-subtle);
    font-family: var(--font-num);
    direction: ltr;
    /* کد لاتین نباید با متن فارسی مجاور قاطی شود (مثل «۴ روز پیشINS-24081»). */
    unicode-bidi: isolate;
    white-space: nowrap;
}

.mission-title {
    font-size: .96rem;
    font-weight: 700;
    margin-top: 6px;
    line-height: 1.5;
}

.mission-merchant {
    font-size: .82rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.mission-address {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.mission-address .icon {
    width: 15px;
    height: 15px;
    margin-top: 3px;
    flex: 0 0 auto;
}

.mission-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .76rem;
    color: var(--text-muted);
    font-weight: 500;
}

.meta-item .icon {
    width: 14px;
    height: 14px;
}

.meta-item.is-danger {
    color: var(--danger-500);
    font-weight: 700;
}

.meta-item.is-warning {
    color: var(--warning-500);
    font-weight: 700;
}

.meta-item.is-success {
    color: var(--success-500);
    font-weight: 700;
}

/* ============================================================== صفحه مأموریت‌ها */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 4px 12px;
}

.page-head h1 {
    font-size: 1.22rem;
}

.page-head p {
    font-size: .8rem;
    color: var(--text-muted);
}

.search-bar {
    position: relative;
    margin-bottom: 4px;
}

.search-bar .input {
    min-height: 46px;
    padding-right: 44px;
    border-radius: var(--radius);
}

.search-bar .icon {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    color: var(--text-subtle);
}

.filter-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 4px 10px;
    font-size: .8rem;
    color: var(--text-muted);
}

/* ============================================================== جزئیات مأموریت */
.hero {
    padding: 18px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.hero-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hero h1 {
    font-size: 1.15rem;
    margin-top: 10px;
}

.hero-sub {
    color: var(--text-muted);
    font-size: .86rem;
    margin-top: 2px;
}

.hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}

.hero-actions .btn {
    min-height: 48px;
    font-size: .9rem;
}

.hero-actions .btn-block {
    grid-column: 1 / -1;
}

.action-bar {
    position: sticky;
    bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom));
    z-index: 20;
    margin: 16px -4px 0;
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.action-bar .btn {
    min-height: 48px;
}

.action-bar .btn-block {
    grid-column: 1 / -1;
}

/* تاریخ‌چه */
.timeline {
    position: relative;
    padding-inline-start: 8px;
}

.timeline-item {
    position: relative;
    padding: 0 0 18px 0;
    padding-inline-start: 26px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    inset-inline-start: 4px;
    top: 8px;
    bottom: -8px;
    width: 2px;
    background: var(--border);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-dot {
    position: absolute;
    inset-inline-start: 0;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand-500);
    box-shadow: 0 0 0 4px var(--brand-50);
}

.timeline-dot.success {
    background: var(--success-500);
    box-shadow: 0 0 0 4px var(--brand-50);
}

.timeline-dot.primary {
    background: var(--info-500);
    box-shadow: 0 0 0 4px var(--info-50);
}

.timeline-dot.warning {
    background: var(--warning-500);
    box-shadow: 0 0 0 4px var(--warning-50);
}

.timeline-title {
    font-size: .88rem;
    font-weight: 600;
}

.timeline-time {
    font-size: .72rem;
    color: var(--text-subtle);
}

.timeline-note {
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================================== داشبورد */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.metric {
    padding: 14px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.metric-label {
    font-size: .76rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.metric-label .icon {
    width: 15px;
    height: 15px;
}

.metric-value {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -.02em;
    margin-top: 6px;
    line-height: 1;
}

.metric-value small {
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-subtle);
    margin-inline-start: 4px;
}

.metric-wide {
    grid-column: 1 / -1;
}

.chart {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    align-items: end;
    height: 150px;
    padding-top: 6px;
}

.chart-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar {
    width: 100%;
    max-width: 26px;
    border-radius: 7px 7px 4px 4px;
    background: linear-gradient(180deg, var(--brand-400), var(--brand-600));
    min-height: 4px;
    position: relative;
    transition: height .5s var(--ease);
}

.chart-bar.is-empty {
    background: var(--surface-3);
}

.chart-day {
    font-size: .68rem;
    color: var(--text-subtle);
    font-weight: 600;
}

.chart-value {
    font-size: .7rem;
    font-weight: 700;
    color: var(--text-muted);
}

.chart-col.is-today .chart-day {
    color: var(--brand-600);
}

.chart-col.is-today .chart-bar {
    box-shadow: 0 0 0 2px var(--brand-200);
}

.rating-stars {
    display: inline-flex;
    gap: 2px;
    color: #f59e0b;
}

.rating-stars .icon {
    width: 15px;
    height: 15px;
    fill: currentColor;
    stroke: none;
}

/* ============================================================== یادداشت‌ها */
.note {
    padding: 14px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    position: relative;
}

.note.is-pinned {
    border-color: var(--brand-200);
    background: linear-gradient(180deg, var(--brand-50), var(--surface) 60%);
}

.note-title {
    font-weight: 700;
    font-size: .92rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.note-title .icon {
    width: 16px;
    height: 16px;
    color: var(--brand-500);
}

.note-body {
    font-size: .86rem;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.85;
    /* newlineهای متن حفظ می‌شوند؛ همراه با .clamp-3 ارتفاع کارت‌ها یکنواخت می‌ماند */
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.note-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    min-width: 0;
}

/* کد مأموریت لاتین است؛ بدون bidi-isolate بودن، در RTL به «زمان» قبلی می‌چسبد. */
.note-meta {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.note-meta .badge {
    direction: ltr;
    unicode-bidi: isolate;
    font-family: var(--font-num);
}

/* زمینهٔ مأموریت در مودال یادداشت (فقط وقتی از صفحه مأموریت باز شود) */
.note-context {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: var(--brand-50);
    border: 1px solid var(--brand-100);
    color: var(--brand-600);
    font-size: .82rem;
    font-weight: 600;
    min-width: 0;
}

.note-actions {
    display: flex;
    gap: 4px;
}

.fab {
    position: fixed;
    inset-inline-end: max(16px, calc(50% - var(--maxw) / 2 + var(--page-pad)));
    bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
    z-index: 45;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: var(--brand-600);
    color: var(--on-brand);
    box-shadow: 0 16px 30px -12px var(--brand-700);
    transition: transform .14s var(--ease);
}

.fab:active {
    transform: scale(.92);
}

.fab .icon {
    width: 26px;
    height: 26px;
}

@media (min-width: 900px) {
    .fab {
        bottom: 30px;
        inset-inline-end: calc(50% - var(--maxw) / 2 + var(--page-pad));
    }
}

/* ============================================================== اعلان‌ها */
/* هر اعلان یک دکمهٔ submit داخل فرم است؛ ظاهر آن باید مثل کارت بماند. */
.notif-form {
    margin: 0;
    display: block;
    width: 100%;
}

.notif {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    position: relative;
    color: var(--text);
    font: inherit;
    align-items: flex-start;
    /* دکمه است، پس باید رفتار یک کارت تمام‌عرض و راست‌چین داشته باشد. */
    width: 100%;
    text-align: start;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform .12s var(--ease);
}

.notif:hover {
    background: var(--surface-2);
}

.notif:active {
    transform: scale(.985);
}

.notif:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

.notif-chevron {
    align-self: center;
    color: var(--text-subtle);
    flex: 0 0 auto;
}

.notif.is-unread {
    border-color: var(--brand-200);
    background: linear-gradient(180deg, var(--brand-50), var(--surface) 70%);
}

.notif-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: var(--surface-3);
    color: var(--text-muted);
}

.notif-icon .icon {
    width: 19px;
    height: 19px;
}

.notif-icon.success {
    background: var(--brand-50);
    color: var(--brand-600);
}

.notif-icon.warning {
    background: var(--warning-50);
    color: var(--warning-500);
}

.notif-icon.danger {
    background: var(--danger-50);
    color: var(--danger-500);
}

.notif-icon.info {
    background: var(--info-50);
    color: var(--info-500);
}

/*
   اعلان خوانده‌شده از نخوانده قابل تفکیک باشد.
   این قاعده عمداً *بعد از* رنگ‌های severity می‌آید تا آیکون اعلان خوانده‌شده
   خاکستری شود (در غیر این صورت رنگ معنایی برنده می‌شد).
*/
.notif:not(.is-unread) .notif-icon {
    background: var(--surface-3);
    color: var(--text-subtle);
}

.notif:not(.is-unread) .notif-title {
    font-weight: 600;
    color: var(--text-muted);
}

/* ستون متن اعلان: عنوان، بدنه و زمان زیر هم با فاصله‌های کنترل‌شده. */
.notif-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
}

.notif-title {
    display: block;
    font-weight: 700;
    font-size: .88rem;
    line-height: 1.55;
}

.notif-body {
    display: block;
    font-size: .82rem;
    color: var(--text-muted);
    line-height: 1.65;
}

.notif-time {
    display: block;
    font-size: .7rem;
    color: var(--text-subtle);
    margin-top: 2px;
}

.unread-dot {
    position: absolute;
    top: 14px;
    inset-inline-end: 14px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-500);
}

/* ============================================================== پروفایل */
.profile-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 2px 14px;
}

.profile-head h1 {
    font-size: 1.12rem;
}

.profile-head .meta {
    font-size: .8rem;
    color: var(--text-muted);
}

.profile-menu {
    display: flex;
    flex-direction: column;
}

.profile-menu a,
.profile-menu button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text);
    font-size: .92rem;
    font-weight: 500;
    width: 100%;
    text-align: start;
    border-bottom: 1px solid var(--border);
}

.profile-menu> :last-child {
    border-bottom: 0;
}

.profile-menu a:active,
.profile-menu button:active {
    background: var(--surface-2);
}

.profile-menu .icon {
    color: var(--text-subtle);
}

.profile-menu .chevron {
    margin-inline-start: auto;
    color: var(--text-subtle);
}

.profile-menu .menu-danger {
    color: var(--danger-500);
}

.profile-menu .menu-danger .icon {
    color: var(--danger-500);
}

.stat-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.stat-strip>div {
    background: var(--surface);
    padding: 12px 6px;
    text-align: center;
    min-width: 0;
}

.stat-strip .v {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.4;
    /* «—» (بدون داده) و «۱ ساعت و ۵ دقیقه» هر دو باید در ستون جا شوند. */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-strip .k {
    font-size: .7rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ============================================================== وضعیت کاری */
.status-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.status-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1.5px solid var(--border);
    text-align: start;
    transition: all var(--dur) var(--ease);
}

.status-option:active {
    transform: scale(.985);
}

.status-option .opt-icon {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.status-option .opt-icon .icon {
    width: 24px;
    height: 24px;
}

.status-option .opt-title {
    font-weight: 700;
    font-size: .98rem;
}

.status-option .opt-desc {
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.6;
}

.status-option[data-status="available"] .opt-icon {
    background: var(--brand-50);
    color: var(--brand-600);
}

.status-option[data-status="break"] .opt-icon {
    background: var(--warning-50);
    color: var(--warning-500);
}

.status-option[data-status="off"] .opt-icon {
    background: var(--surface-3);
    color: var(--text-muted);
}

.status-option.is-selected {
    border-color: var(--brand-500);
    box-shadow: var(--ring);
}

.status-option.is-selected::after {
    content: "✓";
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--brand-600);
    color: var(--on-brand);
    font-size: .72rem;
    display: grid;
    place-items: center;
}

.status-screen {
    min-height: 100dvh;
    padding: max(28px, env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
}

.status-screen .wrap-inner {
    max-width: 480px;
    margin: 0 auto;
}

/* ============================================================== صفحه آفلاین / خطا */
.state-screen {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 32px 24px;
    text-align: center;
}

.state-icon {
    width: 90px;
    height: 90px;
    border-radius: 28px;
    display: grid;
    place-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    color: var(--brand-500);
}

.state-icon .icon {
    width: 40px;
    height: 40px;
}

.state-screen h1 {
    font-size: 1.2rem;
}

.state-screen p {
    color: var(--text-muted);
    font-size: .88rem;
    max-width: 34ch;
}

.state-code {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-subtle);
    opacity: .35;
    line-height: 1;
}

/* ============================================================== نصب PWA */
.install-banner {
    position: fixed;
    inset-inline: 12px;
    /* بالای نوار پایین، بدون پوشاندن محتوا: نوار پایین ثابت است، پس بنر هم
       باید همان فاصله را رعایت کند و در صورت نمایش، محتوا فضای کافی دارد. */
    bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));
    pointer-events: none;
    visibility: hidden;
    z-index: 60;
    max-width: calc(var(--maxw) - 24px);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-lg);
    /* پس‌زمینهٔ کاملاً مات + حاشیهٔ برند تا از کارت‌های زیرش جدا شود. */
    background: var(--surface);
    border: 1px solid var(--brand-200);
    box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .55), var(--shadow-lg);
    transform: translateY(140%);
    transition: transform .3s var(--ease);
    /* محتوای زیر بنر نباید شلوغی ایجاد کند */
    isolation: isolate;
}

.install-banner.is-visible {
    transform: none;
    pointer-events: auto;
    visibility: visible;
}

.install-banner .icon {
    color: var(--brand-600);
}

.install-banner .txt {
    flex: 1;
    min-width: 0;
}

.install-banner strong {
    display: block;
    font-size: .86rem;
}

.install-banner span {
    font-size: .74rem;
    color: var(--text-muted);
}