:root {
    --ui-bg: #f6f1e9;
    --ui-surface: rgba(255, 255, 255, 0.94);
    --ui-surface-strong: #ffffff;
    --ui-surface-soft: #f8f3ec;
    --ui-text: #171411;
    --ui-text-soft: #5f5448;
    --ui-text-muted: #7b6d5e;
    --ui-line: rgba(111, 93, 72, 0.14);
    --ui-line-strong: rgba(111, 93, 72, 0.22);
    --ui-gold: #b88449;
    --ui-gold-deep: #8f6330;
    --ui-gold-soft: rgba(184, 132, 73, 0.12);
    --ui-shadow-card: 0 20px 54px rgba(30, 22, 16, 0.08);
    --ui-shadow-soft: 0 12px 30px rgba(30, 22, 16, 0.05);
    --ui-radius-lg: 32px;
    --ui-radius-md: 24px;
    --ui-radius-sm: 18px;
    --ui-space-1: 8px;
    --ui-space-2: 12px;
    --ui-space-3: 16px;
    --ui-space-4: 20px;
    --ui-space-5: 24px;
    --ui-space-6: 28px;
    --ui-space-7: 36px;
}

/* 2026-04-25 Design System refresh */
:root {
    --ds-bg: #f7f4ee;
    --ds-bg-soft: #fbf9f5;
    --ds-surface: #ffffff;
    --ds-surface-soft: #fcfaf6;
    --ds-surface-muted: #f2ece3;
    --ds-text: #231f1a;
    --ds-text-soft: #5f584f;
    --ds-text-muted: #8a8175;
    --ds-brand: #b68a55;
    --ds-brand-deep: #8d6839;
    --ds-brand-soft: rgba(182, 138, 85, 0.12);
    --ds-success: #5f8f67;
    --ds-success-soft: rgba(95, 143, 103, 0.14);
    --ds-warning: #d18c48;
    --ds-warning-soft: rgba(209, 140, 72, 0.14);
    --ds-danger: #c76b62;
    --ds-danger-soft: rgba(199, 107, 98, 0.12);
    --ds-line: rgba(111, 93, 72, 0.12);
    --ds-line-strong: rgba(111, 93, 72, 0.18);
    --ds-shadow-sm: 0 10px 26px rgba(30, 22, 16, 0.05);
    --ds-shadow-md: 0 18px 44px rgba(30, 22, 16, 0.07);
    --ds-shadow-lg: 0 26px 60px rgba(30, 22, 16, 0.09);
    --ds-radius-xs: 12px;
    --ds-radius-sm: 16px;
    --ds-radius-md: 22px;
    --ds-radius-lg: 28px;
    --ds-radius-xl: 34px;
    --ds-space-1: 6px;
    --ds-space-2: 10px;
    --ds-space-3: 14px;
    --ds-space-4: 18px;
    --ds-space-5: 22px;
    --ds-space-6: 28px;
    --ds-space-7: 36px;
    --ds-space-8: 48px;
    --ds-font-family: "Segoe UI", "Arial", "Noto Sans Hebrew", sans-serif;
    --ds-font-size-xs: 11px;
    --ds-font-size-sm: 12px;
    --ds-font-size-md: 14px;
    --ds-font-size-lg: 16px;
    --ds-font-size-xl: 20px;
    --ds-font-size-2xl: 30px;
    --ds-line-height-tight: 1.25;
    --ds-line-height-base: 1.55;
}

html[dir="rtl"] body {
    font-family: var(--ds-font-family);
    color: var(--ds-text);
    background:
        radial-gradient(circle at 8% 10%, rgba(182, 138, 85, 0.08), transparent 18%),
        radial-gradient(circle at 100% 0%, rgba(34, 30, 26, 0.05), transparent 22%),
        linear-gradient(180deg, var(--ds-bg-soft) 0%, var(--ds-bg) 100%);
}

html[dir="rtl"] .page,
html[dir="rtl"] .auth-page {
    font-size: var(--ds-font-size-md);
    line-height: var(--ds-line-height-base);
}

html[dir="rtl"] .muted,
html[dir="rtl"] .subtitle,
html[dir="rtl"] .table-secondary-text,
html[dir="rtl"] .sidebar-link-copy small,
html[dir="rtl"] .header-system-copy,
html[dir="rtl"] .header-user-role,
html[dir="rtl"] .section-card p,
html[dir="rtl"] .summary-card p,
html[dir="rtl"] .notification-card p {
    color: var(--ds-text-soft) !important;
}

html[dir="rtl"] .eyebrow,
html[dir="rtl"] .sidebar-section-label,
html[dir="rtl"] .sidebar-system-label {
    color: var(--ds-brand-deep);
    font-size: var(--ds-font-size-xs);
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] .brand-mark,
html[dir="rtl"] .header-system-title {
    color: var(--ds-text);
    line-height: var(--ds-line-height-tight);
}

html[dir="rtl"] h1 { font-size: clamp(2rem, 2.8vw, 3.1rem); }
html[dir="rtl"] h2 { font-size: clamp(1.25rem, 1.8vw, 2rem); }
html[dir="rtl"] h3 { font-size: 1.05rem; }

html[dir="rtl"] .app-shell {
    gap: var(--ds-space-5);
    padding: var(--ds-space-4);
}

html[dir="rtl"] .app-sidebar {
    flex-basis: 284px;
    padding: 26px 20px;
    border-radius: var(--ds-radius-xl);
    background:
        radial-gradient(circle at 84% 0%, rgba(182, 138, 85, 0.16), transparent 20%),
        linear-gradient(180deg, #161310 0%, #1c1815 48%, #231e19 100%);
    box-shadow: 0 24px 50px rgba(17, 12, 8, 0.14);
}

html[dir="rtl"] .sidebar-brand { padding-block-end: var(--ds-space-5); }

html[dir="rtl"] .brand-logo {
    align-items: center;
    text-align: center;
}

html[dir="rtl"] .brand-emblem {
    align-self: center;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    font-size: 30px;
}

html[dir="rtl"] .brand-mark {
    font-size: 31px;
    color: #fffaf4;
}

html[dir="rtl"] .brand-tagline {
    color: rgba(255, 245, 232, 0.78);
    font-size: var(--ds-font-size-sm);
}

html[dir="rtl"] .sidebar-nav { gap: 10px; }

html[dir="rtl"] .sidebar-link-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(182, 138, 85, 0.1);
    border: 1px solid rgba(182, 138, 85, 0.14);
    color: var(--ds-brand-deep);
    font-size: 15px;
    font-weight: 800;
}

html[dir="rtl"] .sidebar-link-icon::before {
    display: block;
    line-height: 1;
}

html[dir="rtl"] .icon-cases::before { content: "▣"; }
html[dir="rtl"] .icon-plus::before { content: "+"; }
html[dir="rtl"] .icon-bell::before { content: "◔"; }
html[dir="rtl"] .icon-request::before { content: "◎"; }
html[dir="rtl"] .icon-report::before { content: "▤"; }
html[dir="rtl"] .icon-factory::before { content: "⌂"; }
html[dir="rtl"] .icon-settings::before { content: "◌"; }
html[dir="rtl"] .icon-workspace::before { content: "◫"; }
html[dir="rtl"] .icon-help::before { content: "?"; }
html[dir="rtl"] .icon-calendar::before { content: "◷"; }

html[dir="rtl"] .app-flash-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(32, 24, 17, 0.18);
    backdrop-filter: blur(4px);
}

html[dir="rtl"] .app-flash-dialog {
    width: min(430px, 100%);
    display: grid;
    justify-items: center;
    gap: 14px;
    position: relative;
    padding: 30px 28px 24px;
    border-radius: 28px;
    background:
        radial-gradient(circle at 50% 0%, rgba(182, 138, 85, 0.12), transparent 32%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(252, 249, 244, 0.98) 100%);
    border: 1px solid var(--ds-line-strong);
    box-shadow: 0 32px 80px rgba(32, 24, 17, 0.2);
    text-align: center;
    animation: app-flash-in 180ms ease-out;
}

html[dir="rtl"] .app-flash-dialog-error {
    border-color: rgba(199, 107, 98, 0.35);
}

html[dir="rtl"] .app-flash-dialog-success {
    border-color: rgba(95, 143, 103, 0.28);
}

html[dir="rtl"] .app-flash-close {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--ds-line);
    background: #fffaf4;
    color: var(--ds-text-soft);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

html[dir="rtl"] .app-flash-close:hover {
    background: var(--ds-surface-muted);
    color: var(--ds-text);
}

html[dir="rtl"] .app-flash-icon {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    font-size: 24px;
    font-weight: 900;
}

html[dir="rtl"] .app-flash-dialog-error .app-flash-icon {
    color: #a9443b;
    background: rgba(199, 107, 98, 0.13);
    border: 1px solid rgba(199, 107, 98, 0.2);
}

html[dir="rtl"] .app-flash-dialog-success .app-flash-icon {
    color: #4f7f59;
    background: rgba(95, 143, 103, 0.14);
    border: 1px solid rgba(95, 143, 103, 0.2);
}

html[dir="rtl"] .app-flash-copy {
    display: grid;
    gap: 8px;
}

html[dir="rtl"] .app-flash-copy h2 {
    margin: 0;
    font-size: 19px;
    line-height: 1.55;
    color: var(--ds-text);
}

html[dir="rtl"] .app-flash-action {
    min-width: 132px;
    margin-top: 4px;
}

@keyframes app-flash-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

html[dir="rtl"] .sidebar-link {
    padding-block: 14px;
    padding-inline: 16px 12px;
    border-radius: 22px;
}

html[dir="rtl"] .sidebar-link.is-disabled {
    opacity: 0.6;
    cursor: default;
    pointer-events: none;
}

html[dir="rtl"] .sidebar-link-copy strong { font-size: 15px; }

html[dir="rtl"] .sidebar-link-badge {
    min-width: 22px;
    height: 22px;
    font-size: 11px;
}

html[dir="rtl"] .sidebar-footer {
    gap: var(--ds-space-3);
}

html[dir="rtl"] .sidebar-user-card {
    border-radius: 20px;
    padding: 12px;
}

html[dir="rtl"] .app-main {
    gap: var(--ds-space-4);
    padding-block: 8px 24px;
}

html[dir="rtl"] .app-header {
    grid-template-columns: minmax(180px, 0.72fr) minmax(320px, 1.25fr) minmax(180px, 0.75fr);
    gap: 16px;
    padding: 14px 18px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--ds-shadow-sm);
}

html[dir="rtl"] .header-system-chip,
html[dir="rtl"] .header-notification-chip,
html[dir="rtl"] .header-user-chip {
    min-height: 52px;
    border-radius: 18px;
    background: var(--ds-surface);
    border-color: var(--ds-line);
}

html[dir="rtl"] .header-search {
    min-height: 54px;
    border-radius: 20px;
    background: linear-gradient(180deg, #fffdfa 0%, #f7f0e8 100%);
}

html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea {
    min-height: 46px;
    padding: 11px 14px;
    border-radius: var(--ds-radius-sm);
    border: 1px solid var(--ds-line);
    background: var(--ds-surface);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
    font-family: var(--ds-font-family);
    color: var(--ds-text);
}

html[dir="rtl"] textarea { min-height: 112px; }

html[dir="rtl"] label span {
    font-size: var(--ds-font-size-sm);
    color: var(--ds-text-soft);
    margin-bottom: 8px;
}

html[dir="rtl"] .workspace-layout,
html[dir="rtl"] .detail-layout {
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: var(--ds-space-5);
}

html[dir="rtl"] .workspace-side { gap: var(--ds-space-4); }

html[dir="rtl"] .section-card,
html[dir="rtl"] .summary-card,
html[dir="rtl"] .notification-card,
html[dir="rtl"] .premium-kpi-card,
html[dir="rtl"] .metric-tile,
html[dir="rtl"] .action-metric,
html[dir="rtl"] .hero-stat-chip {
    background: var(--ds-surface);
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-sm);
}

html[dir="rtl"] .section-card { padding: 22px; }

html[dir="rtl"] .screen-head,
html[dir="rtl"] .section-head { margin-bottom: var(--ds-space-4); }

html[dir="rtl"] .page-hero,
html[dir="rtl"] .action-strip-card,
html[dir="rtl"] .premium-filter-card,
html[dir="rtl"] .premium-table-card {
    border-radius: var(--ds-radius-xl);
    background: rgba(255,255,255,0.88);
    border: 1px solid var(--ds-line);
    box-shadow: var(--ds-shadow-md);
}

html[dir="rtl"] .page-hero,
html[dir="rtl"] .action-strip-card,
html[dir="rtl"] .premium-filter-card {
    padding: 24px 28px;
}

html[dir="rtl"] .hero-stat-chip,
html[dir="rtl"] .action-metric,
html[dir="rtl"] .summary-card,
html[dir="rtl"] .premium-kpi-card,
html[dir="rtl"] .metric-tile {
    padding: 16px 18px;
}

html[dir="rtl"] .summary-card strong,
html[dir="rtl"] .kpi-value,
html[dir="rtl"] .action-metric strong,
html[dir="rtl"] .hero-stat-chip strong {
    font-size: clamp(1.35rem, 1.8vw, 2rem);
    color: var(--ds-text);
}

html[dir="rtl"] .summary-label,
html[dir="rtl"] .kpi-label,
html[dir="rtl"] .action-metric span,
html[dir="rtl"] .hero-stat-chip span {
    color: var(--ds-text-soft);
    font-size: var(--ds-font-size-sm);
}

html[dir="rtl"] .executive-alert-bar,
html[dir="rtl"] .action-strip {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) auto;
    gap: var(--ds-space-4);
    align-items: center;
}

html[dir="rtl"] .executive-alert-item,
html[dir="rtl"] .action-metric {
    min-height: 88px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

html[dir="rtl"] .premium-filter-toolbar,
html[dir="rtl"] .filter-grid { gap: 14px; }

html[dir="rtl"] .filter-actions {
    display: flex;
    align-items: end;
    gap: 10px;
}

html[dir="rtl"] .button {
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 15px;
    font-size: var(--ds-font-size-md);
    font-weight: 700;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

html[dir="rtl"] .button.primary {
    background: linear-gradient(180deg, #c49863 0%, var(--ds-brand) 100%);
    color: #fffdfa;
    box-shadow: 0 12px 24px rgba(182, 138, 85, 0.22);
}

html[dir="rtl"] .button.secondary {
    background: #fffaf2;
    color: var(--ds-brand-deep);
    border: 1px solid rgba(182, 138, 85, 0.24);
}

html[dir="rtl"] .button.ghost {
    background: var(--ds-surface);
    color: var(--ds-text-soft);
    border: 1px solid var(--ds-line);
}

html[dir="rtl"] .button.warning {
    background: #fff5f3;
    color: var(--ds-danger);
    border: 1px solid rgba(199, 107, 98, 0.22);
}

html[dir="rtl"] .button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--ds-shadow-sm);
}

html[dir="rtl"] .status {
    padding: 7px 12px;
    border-radius: 999px;
    font-size: var(--ds-font-size-sm);
    border: 1px solid transparent;
}

html[dir="rtl"] .status-closed,
html[dir="rtl"] .status-sent-to-factory {
    background: var(--ds-success-soft);
    color: var(--ds-success);
    border-color: rgba(95,143,103,0.22);
}

html[dir="rtl"] .status-blocked-waiting-designer,
html[dir="rtl"] .status-returned-for-completion,
html[dir="rtl"] .status-returned-for-decomposition-fix {
    background: var(--ds-warning-soft);
    color: var(--ds-warning);
    border-color: rgba(209,140,72,0.22);
}

html[dir="rtl"] .status-in-decomposition,
html[dir="rtl"] .status-received-by-decomposer,
html[dir="rtl"] .status-ready-for-assignment,
html[dir="rtl"] .status-download-preparation {
    background: rgba(182, 138, 85, 0.12);
    color: var(--ds-brand-deep);
    border-color: rgba(182,138,85,0.2);
}

html[dir="rtl"] .status-submitted-for-review,
html[dir="rtl"] .status-managerial-review,
html[dir="rtl"] .status-approved-for-factory-transfer {
    background: rgba(85, 118, 186, 0.10);
    color: #5e6f9f;
    border-color: rgba(94,111,159,0.18);
}

html[dir="rtl"] .premium-table-wrap {
    border-radius: var(--ds-radius-lg);
    border: 1px solid var(--ds-line);
    overflow: hidden;
    background: var(--ds-surface);
}

html[dir="rtl"] .premium-data-table {
    border-collapse: separate;
    border-spacing: 0;
}

html[dir="rtl"] .premium-data-table thead th {
    background: #231f1a;
    color: rgba(255, 248, 238, 0.92);
    font-size: var(--ds-font-size-xs);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 14px 16px;
    border-bottom: none;
}

html[dir="rtl"] .premium-data-table tbody tr.data-row {
    background: var(--ds-surface);
    transition: background-color 0.16s ease;
}

html[dir="rtl"] .premium-data-table tbody tr.data-row:hover {
    background: var(--ds-surface-soft);
}

html[dir="rtl"] .premium-data-table tbody td {
    padding: 16px;
    border-bottom: 1px solid rgba(111, 93, 72, 0.08);
    vertical-align: middle;
}

html[dir="rtl"] .table-primary-link,
html[dir="rtl"] .case-name-trigger,
html[dir="rtl"] .person-link {
    color: var(--ds-text);
    font-weight: 700;
}

html[dir="rtl"] button.table-primary-link {
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    font: inherit;
    text-align: inherit;
}

html[dir="rtl"] .notification-card {
    padding: 18px;
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface);
}

html[dir="rtl"] .notification-card.is-unread {
    border-color: rgba(182, 138, 85, 0.28);
    background: linear-gradient(180deg, #fffdf8 0%, #fffaf2 100%);
}

html[dir="rtl"] .timeline-item {
    padding: 16px 18px;
    border-radius: var(--ds-radius-md);
    border: 1px solid var(--ds-line);
    background: var(--ds-surface);
}

html[dir="rtl"] .quick-card-panel,
html[dir="rtl"] .nested-section-card {
    background: var(--ds-surface-soft);
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius-md);
    box-shadow: none;
}

html[dir="rtl"] .auth-page {
    min-height: 100vh;
    padding: var(--ds-space-5);
    background:
        radial-gradient(circle at 25% 10%, rgba(182, 138, 85, 0.09), transparent 18%),
        linear-gradient(180deg, var(--ds-bg-soft) 0%, var(--ds-bg) 100%);
}

html[dir="rtl"] .auth-shell {
    gap: var(--ds-space-5);
    align-items: stretch;
}

html[dir="rtl"] .auth-brand-panel,
html[dir="rtl"] .premium-auth-card {
    border-radius: var(--ds-radius-xl);
    border: 1px solid var(--ds-line);
    box-shadow: var(--ds-shadow-lg);
}

html[dir="rtl"] .premium-auth-card {
    background: rgba(255,255,255,0.94);
    padding: 28px;
}

html[dir="rtl"] .auth-brand-panel {
    background:
        radial-gradient(circle at 80% 10%, rgba(182, 138, 85, 0.18), transparent 18%),
        linear-gradient(180deg, #1b1612 0%, #221d18 100%);
}

html[dir="rtl"] .auth-brand-panel .eyebrow,
html[dir="rtl"] .auth-brand-panel h1,
html[dir="rtl"] .auth-brand-panel .muted,
html[dir="rtl"] .auth-feature strong,
html[dir="rtl"] .auth-feature span {
    color: #fff7ef !important;
}

@media (max-width: 1320px) {
    html[dir="rtl"] .app-sidebar {
        flex-basis: 256px;
    }

    html[dir="rtl"] .workspace-layout,
    html[dir="rtl"] .detail-layout {
        grid-template-columns: minmax(0, 1fr) 240px;
    }
}

@media (max-width: 1100px) {
    html[dir="rtl"] .app-header {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .workspace-layout,
    html[dir="rtl"] .detail-layout,
    html[dir="rtl"] .auth-shell {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .workspace-side { order: 2; }

    html[dir="rtl"] .executive-alert-bar,
    html[dir="rtl"] .action-strip {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    :root {
        --ds-space-4: 16px;
        --ds-space-5: 18px;
        --ds-space-6: 22px;
    }

    html[dir="rtl"] .app-shell {
        padding: 0 0 84px;
        gap: 0;
    }

    html[dir="rtl"] .app-main {
        padding: 10px 12px 22px;
    }

    html[dir="rtl"] .app-header {
        border-radius: 22px;
        padding: 12px 14px;
        position: sticky;
        inset-block-start: 10px;
    }

    html[dir="rtl"] .page-hero,
    html[dir="rtl"] .action-strip-card,
    html[dir="rtl"] .premium-filter-card,
    html[dir="rtl"] .section-card,
    html[dir="rtl"] .summary-card,
    html[dir="rtl"] .premium-auth-card {
        padding: 18px;
        border-radius: 22px;
    }
}

/* Leads module */
html[dir="rtl"] .icon-leads::before {
    content: "◎";
}

html[dir="rtl"] .leads-page-shell,
html[dir="rtl"] .lead-detail-shell {
    display: grid;
    gap: 18px;
}

html[dir="rtl"] .leads-hero,
html[dir="rtl"] .lead-detail-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px minmax(260px, 360px);
    gap: 22px;
    align-items: center;
    min-height: 154px;
    padding: 24px 30px;
    border-radius: 28px;
    background:
        radial-gradient(circle at 18% 18%, rgba(190, 145, 76, 0.13), transparent 34%),
        linear-gradient(135deg, rgba(255, 253, 249, 0.98) 0%, rgba(250, 245, 237, 0.94) 100%);
    border: 1px solid rgba(177, 135, 72, 0.16);
    box-shadow: 0 18px 45px rgba(44, 32, 20, 0.07);
}

html[dir="rtl"] .lead-detail-hero {
    grid-template-columns: minmax(0, 1fr) auto;
}

html[dir="rtl"] .leads-hero h1,
html[dir="rtl"] .lead-detail-hero h1 {
    margin: 5px 0 8px;
    color: var(--ds-text, #24211d);
    font-size: clamp(34px, 4vw, 54px);
    font-weight: 950;
    line-height: 1.08;
}

html[dir="rtl"] .leads-hero p,
html[dir="rtl"] .lead-detail-hero p {
    max-width: 700px;
    margin: 0;
    color: var(--ds-text-muted, #756b5f);
    font-size: 15px;
    font-weight: 650;
    line-height: 1.65;
}

html[dir="rtl"] .leads-hero-art {
    align-self: stretch;
    min-height: 122px;
    border-radius: 22px;
    background:
        url("/static/images/leads-hero-illustration.svg") center / cover no-repeat,
        linear-gradient(135deg, #f6ead9, #fffaf2);
    opacity: 0.92;
    border: 1px solid rgba(177, 135, 72, 0.1);
}

html[dir="rtl"] .leads-hero-insight {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 7px 12px;
    align-items: center;
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(177, 135, 72, 0.16);
    box-shadow: 0 16px 34px rgba(46, 34, 22, 0.055);
}

html[dir="rtl"] .leads-check {
    grid-row: 1 / span 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #188756;
    background: #eefaf3;
    border: 1px solid rgba(24, 135, 86, 0.2);
    font-weight: 900;
}

html[dir="rtl"] .leads-hero-insight strong {
    font-size: 15px;
    font-weight: 900;
}

html[dir="rtl"] .leads-hero-insight small {
    color: #7a7064;
    line-height: 1.55;
    font-weight: 650;
}

html[dir="rtl"] .leads-tabs,
html[dir="rtl"] .lead-detail-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 7px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(177, 135, 72, 0.15);
    box-shadow: 0 12px 28px rgba(46, 34, 22, 0.045);
}

html[dir="rtl"] .lead-detail-tabs {
    grid-template-columns: repeat(9, minmax(0, 1fr));
}

html[dir="rtl"] .leads-tab,
html[dir="rtl"] .lead-detail-tabs a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 45px;
    padding: 0 14px;
    border-radius: 15px;
    text-decoration: none;
    color: #5f5448;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 850;
    white-space: nowrap;
    transition: 0.18s ease;
}

html[dir="rtl"] .leads-tab strong {
    min-width: 28px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(177, 135, 72, 0.1);
    color: #9b6325;
    font-size: 12px;
}

html[dir="rtl"] .leads-tab:hover,
html[dir="rtl"] .lead-detail-tabs a:hover {
    border-color: rgba(177, 135, 72, 0.22);
    background: #fffaf3;
}

html[dir="rtl"] .leads-tab.is-active,
html[dir="rtl"] .lead-detail-tabs a.is-active {
    color: #fff;
    background: linear-gradient(180deg, #bd8b45 0%, #9d6c33 100%);
    border-color: rgba(128, 82, 31, 0.3);
    box-shadow: 0 12px 22px rgba(157, 108, 51, 0.22);
}

html[dir="rtl"] .leads-tab.is-active strong {
    color: #7b4c1b;
    background: rgba(255, 255, 255, 0.9);
}

html[dir="rtl"] .leads-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

html[dir="rtl"] .leads-kpi-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 12px;
    align-items: center;
    min-height: 105px;
    padding: 17px 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(177, 135, 72, 0.14);
    box-shadow: 0 14px 30px rgba(46, 34, 22, 0.055);
}

html[dir="rtl"] .leads-kpi-icon {
    grid-row: 1 / span 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 16px;
    color: #a26d31;
    background: #fbf2e5;
    border: 1px solid rgba(177, 135, 72, 0.14);
    font-weight: 950;
}

html[dir="rtl"] .leads-kpi-card strong {
    font-size: 30px;
    line-height: 1;
    color: #28231d;
}

html[dir="rtl"] .leads-kpi-card span:not(.leads-kpi-icon) {
    font-size: 13px;
    font-weight: 900;
    color: #4c4238;
}

html[dir="rtl"] .leads-kpi-card small {
    color: #85796e;
    font-size: 12px;
    font-weight: 650;
}

html[dir="rtl"] .leads-filter-card,
html[dir="rtl"] .leads-table-card,
html[dir="rtl"] .leads-form-card,
html[dir="rtl"] .leads-selected-panel,
html[dir="rtl"] .lead-detail-card {
    padding: 22px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(177, 135, 72, 0.13);
    box-shadow: 0 16px 36px rgba(46, 34, 22, 0.055);
}

html[dir="rtl"] .leads-section-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

html[dir="rtl"] .leads-section-head h2,
html[dir="rtl"] .lead-detail-card h2 {
    margin: 0 0 5px;
    font-size: 23px;
    font-weight: 950;
}

html[dir="rtl"] .leads-section-head p {
    margin: 0;
    color: #7d7166;
    font-size: 13px;
    font-weight: 650;
}

html[dir="rtl"] .leads-filter-grid,
html[dir="rtl"] .lead-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
    align-items: end;
}

html[dir="rtl"] .lead-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

html[dir="rtl"] .leads-filter-grid label,
html[dir="rtl"] .lead-form-grid label {
    display: grid;
    gap: 7px;
    color: #6d6257;
    font-size: 12px;
    font-weight: 850;
}

html[dir="rtl"] .leads-filter-grid input,
html[dir="rtl"] .leads-filter-grid select,
html[dir="rtl"] .lead-form-grid input,
html[dir="rtl"] .lead-form-grid select,
html[dir="rtl"] .lead-form-grid textarea {
    width: 100%;
    min-height: 44px;
    padding: 0 13px;
    border-radius: 14px;
    border: 1px solid rgba(177, 135, 72, 0.16);
    background: rgba(255, 253, 250, 0.98);
    color: #2c2824;
    font: inherit;
    outline: none;
}

html[dir="rtl"] .lead-form-grid textarea {
    min-height: 94px;
    padding-top: 12px;
    resize: vertical;
}

html[dir="rtl"] .lead-form-wide {
    grid-column: 1 / -1;
}

html[dir="rtl"] .leads-filter-actions,
html[dir="rtl"] .lead-form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
}

html[dir="rtl"] .leads-table-wrap {
    overflow-x: auto;
    border-radius: 20px;
    border: 1px solid rgba(177, 135, 72, 0.12);
}

html[dir="rtl"] .leads-table {
    width: 100%;
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
}

html[dir="rtl"] .leads-table th {
    padding: 14px 13px;
    color: #fff;
    background: #1f1b17;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

html[dir="rtl"] .leads-table td {
    padding: 13px;
    border-bottom: 1px solid rgba(177, 135, 72, 0.1);
    color: #302a24;
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
}

html[dir="rtl"] .leads-table tbody tr:hover,
html[dir="rtl"] .leads-table tbody tr.is-selected {
    background: #fff8ec;
}

html[dir="rtl"] .lead-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    color: #8c5c25;
    background: #fbf0df;
    border: 1px solid rgba(177, 135, 72, 0.16);
    font-size: 12px;
    font-weight: 900;
}

html[dir="rtl"] .leads-row-actions {
    display: flex;
    gap: 6px;
}

html[dir="rtl"] .button.small {
    min-height: 32px;
    padding: 0 11px;
    font-size: 12px;
}

html[dir="rtl"] .leads-selected-panel,
html[dir="rtl"] .lead-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 16px;
}

html[dir="rtl"] .lead-detail-grid {
    grid-template-columns: minmax(330px, 0.9fr) minmax(0, 1.1fr);
}

html[dir="rtl"] .leads-selected-panel h3 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 950;
}

html[dir="rtl"] .leads-selected-panel dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 7px 14px;
    margin: 0;
}

html[dir="rtl"] .leads-selected-panel dt {
    color: #8b7e72;
    font-size: 12px;
    font-weight: 850;
}

html[dir="rtl"] .leads-selected-panel dd {
    margin: 0;
    color: #2d2823;
    font-weight: 800;
}

html[dir="rtl"] .lead-stage-line {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

html[dir="rtl"] .lead-stage-line span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 7px;
    border-radius: 999px;
    color: #7c7166;
    background: #f5f1ea;
    border: 1px solid rgba(177, 135, 72, 0.12);
    font-size: 11px;
    font-weight: 850;
    text-align: center;
}

html[dir="rtl"] .lead-stage-line span.is-current {
    color: #fff;
    background: linear-gradient(180deg, #bd8b45 0%, #9d6c33 100%);
}

html[dir="rtl"] .lead-note-preview,
html[dir="rtl"] .lead-record-item {
    margin: 0 0 9px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #fbf8f3;
    border: 1px solid rgba(177, 135, 72, 0.1);
}

html[dir="rtl"] .lead-record-list {
    display: grid;
    gap: 10px;
}

html[dir="rtl"] .lead-record-item {
    display: grid;
    gap: 6px;
}

html[dir="rtl"] .lead-record-item strong {
    font-size: 14px;
    font-weight: 950;
}

html[dir="rtl"] .lead-record-item span,
html[dir="rtl"] .lead-record-item small {
    color: #81766b;
    font-size: 12px;
    font-weight: 700;
}

html[dir="rtl"] .lead-record-item p {
    margin: 0;
    color: #3f3831;
    line-height: 1.55;
}

html[dir="rtl"] .leads-empty-state {
    display: grid;
    place-items: center;
    gap: 9px;
    min-height: 150px;
    padding: 24px;
    border-radius: 20px;
    background: #fbf8f3;
    border: 1px dashed rgba(177, 135, 72, 0.22);
    text-align: center;
}

html[dir="rtl"] .leads-empty-state strong {
    font-size: 18px;
    font-weight: 950;
}

html[dir="rtl"] .leads-empty-state p {
    margin: 0;
    color: #7b7065;
}

html[dir="rtl"] .lead-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
}

@media (max-width: 1400px) {
    html[dir="rtl"] .leads-hero {
        grid-template-columns: minmax(0, 1fr) 260px;
    }

    html[dir="rtl"] .leads-hero-insight {
        grid-column: 1 / -1;
    }

    html[dir="rtl"] .leads-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    html[dir="rtl"] .lead-detail-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    html[dir="rtl"] .leads-hero,
    html[dir="rtl"] .lead-detail-hero,
    html[dir="rtl"] .leads-selected-panel,
    html[dir="rtl"] .lead-detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    html[dir="rtl"] .leads-tabs,
    html[dir="rtl"] .leads-kpi-grid,
    html[dir="rtl"] .leads-filter-grid,
    html[dir="rtl"] .lead-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

html {
    scroll-behavior: smooth;
}

html[dir="rtl"] body {
    direction: rtl;
    text-align: start;
    color: var(--ui-text);
    background:
        radial-gradient(circle at 12% 0%, rgba(184, 132, 73, 0.12), transparent 20%),
        radial-gradient(circle at 100% 12%, rgba(23, 20, 17, 0.07), transparent 24%),
        linear-gradient(180deg, #fcfaf7 0%, var(--ui-bg) 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

html[dir="rtl"] .page,
html[dir="rtl"] .card,
html[dir="rtl"] .section-card,
html[dir="rtl"] .summary-card,
html[dir="rtl"] .screen-head,
html[dir="rtl"] .section-head,
html[dir="rtl"] .hero-copy,
html[dir="rtl"] .timeline-item,
html[dir="rtl"] .notification-card,
html[dir="rtl"] .queue-item {
    text-align: start;
}

html[dir="rtl"] .app-shell {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: var(--ui-space-6);
    padding: 20px;
    min-height: 100vh;
    direction: rtl;
}

html[dir="rtl"] .app-sidebar {
    flex: 0 0 332px;
    min-height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
    position: sticky;
    inset-block-start: 20px;
    display: flex;
    flex-direction: column;
    gap: var(--ui-space-5);
    padding: 30px 24px;
    border-radius: 34px;
    background:
        radial-gradient(circle at 84% 0%, rgba(184, 132, 73, 0.18), transparent 20%),
        linear-gradient(180deg, #0f0d0c 0%, #171412 45%, #201c18 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 28px 54px rgba(17, 12, 8, 0.18);
    overflow: hidden;
}

html[dir="rtl"] .app-sidebar::before {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 1px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(184, 132, 73, 0.18), rgba(255, 255, 255, 0.03));
}

html[dir="rtl"] .sidebar-brand {
    padding: 6px 4px 20px;
    border-block-end: 1px solid rgba(255, 255, 255, 0.08);
}

html[dir="rtl"] .brand-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

html[dir="rtl"] .brand-emblem {
    align-self: flex-start;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 249, 241, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff9f2;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 34px;
    font-weight: 700;
}

html[dir="rtl"] .brand-mark {
    font-size: 36px;
    line-height: 1;
}

html[dir="rtl"] .brand-tagline,
html[dir="rtl"] .sidebar-section-label,
html[dir="rtl"] .sidebar-system-label,
html[dir="rtl"] .eyebrow {
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

html[dir="rtl"] .sidebar-section-label,
html[dir="rtl"] .sidebar-system-label {
    color: rgba(255, 242, 228, 0.48);
    font-size: 11px;
    font-weight: 700;
}

html[dir="rtl"] .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

html[dir="rtl"] .sidebar-link {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding-block: 16px;
    padding-inline: 18px 14px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 246, 237, 0.82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

html[dir="rtl"] .sidebar-link::after {
    content: "";
    position: absolute;
    inset-block: 12px;
    inset-inline-end: 10px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(184, 132, 73, 0), rgba(184, 132, 73, 0.92), rgba(184, 132, 73, 0));
    opacity: 0;
    transform: scaleY(0.5);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

html[dir="rtl"] .sidebar-link:hover,
html[dir="rtl"] .sidebar-link.is-active {
    border-color: rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
    color: #fffaf4;
    transform: translateY(-1px);
}

html[dir="rtl"] .sidebar-link.is-active::after,
html[dir="rtl"] .sidebar-link:hover::after {
    opacity: 1;
    transform: scaleY(1);
}

html[dir="rtl"] .sidebar-link-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

html[dir="rtl"] .sidebar-link-copy strong {
    font-size: 16px;
}

html[dir="rtl"] .sidebar-link-copy small {
    color: rgba(255, 244, 232, 0.62);
    line-height: 1.45;
}

html[dir="rtl"] .sidebar-link-badge {
    min-width: 24px;
    height: 24px;
    padding-inline: 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(180deg, #d49b5d 0%, #b88449 100%);
    box-shadow: 0 10px 22px rgba(184, 132, 73, 0.35);
}

html[dir="rtl"] .sidebar-footer {
    margin-block-start: auto;
    display: flex;
    flex-direction: column;
    gap: var(--ui-space-4);
    padding-block-start: var(--ui-space-5);
    border-block-start: 1px solid rgba(255, 255, 255, 0.07);
}

html[dir="rtl"] .sidebar-user-card {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

html[dir="rtl"] .sidebar-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: #fff7ee;
    font-weight: 800;
}

html[dir="rtl"] .sidebar-logout {
    width: 100%;
}

html[dir="rtl"] .app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--ui-space-5);
    padding-block: 10px 28px;
}

html[dir="rtl"] .app-header {
    display: grid;
    grid-template-columns: minmax(180px, 0.7fr) minmax(320px, 1.2fr) auto;
    align-items: center;
    gap: 18px;
    padding: 18px 24px;
    border-radius: 30px;
    border: 1px solid rgba(111, 93, 72, 0.12);
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(16px);
    box-shadow: var(--ui-shadow-soft);
    position: sticky;
    inset-block-start: 16px;
    z-index: 16;
}

html[dir="rtl"] .header-system-chip,
html[dir="rtl"] .header-notification-chip,
html[dir="rtl"] .header-user-chip {
    min-height: 58px;
    border-radius: 22px;
    border: 1px solid rgba(111, 93, 72, 0.12);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

html[dir="rtl"] .header-system-chip {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding-inline: 18px;
}

html[dir="rtl"] .header-system-title {
    font-weight: 800;
    color: var(--ui-text);
}

html[dir="rtl"] .header-system-copy,
html[dir="rtl"] .header-user-role {
    font-size: 12px;
    color: var(--ui-text-soft);
}

html[dir="rtl"] .header-search-wrap {
    width: 100%;
    position: relative;
    z-index: 30;
}

html[dir="rtl"] .header-search {
    min-height: 60px;
    padding-inline: 18px;
    border-radius: 24px;
    border: 1px solid rgba(111, 93, 72, 0.12);
    background: linear-gradient(180deg, rgba(251, 248, 243, 0.98) 0%, rgba(246, 239, 230, 0.92) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
    position: relative;
    z-index: 31;
}

html[dir="rtl"] .global-search-form {
    display: flex;
    align-items: center;
    gap: 12px;
    direction: rtl;
    position: relative;
    z-index: 32;
    pointer-events: auto;
}

html[dir="rtl"] .header-search-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(143, 99, 48, 0.5);
    position: relative;
    flex: 0 0 auto;
    pointer-events: none;
}

html[dir="rtl"] .header-search-icon::after {
    content: "";
    position: absolute;
    inline-size: 8px;
    block-size: 2px;
    background: rgba(143, 99, 48, 0.5);
    inset-block-end: -3px;
    inset-inline-start: -4px;
    transform: rotate(38deg);
    border-radius: 999px;
}

html[dir="rtl"] .global-search-form input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 0;
    box-shadow: none;
    text-align: start;
    direction: rtl;
    color: var(--ui-text);
    position: relative;
    z-index: 33;
    pointer-events: auto;
    cursor: text;
}

html[dir="rtl"] .global-search-form input::placeholder {
    color: rgba(114, 104, 93, 0.8);
}

html[dir="rtl"] .header-meta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}

html[dir="rtl"] .header-search-submit {
    position: relative;
    z-index: 33;
    pointer-events: auto;
    cursor: pointer;
}

html[dir="rtl"] .header-notification-dropdown {
    position: relative;
}

html[dir="rtl"] .header-notification-dropdown > summary {
    list-style: none;
    cursor: pointer;
}

html[dir="rtl"] .header-notification-dropdown > summary::-webkit-details-marker {
    display: none;
}

html[dir="rtl"] .header-notification-chip,
html[dir="rtl"] .header-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding-inline: 16px;
}

html[dir="rtl"] .header-notification-count {
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #d49b5d 0%, #b88449 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

html[dir="rtl"] .header-notification-chip {
    min-width: 126px;
    justify-content: flex-start;
}

html[dir="rtl"] .header-notification-panel {
    position: absolute;
    inset-inline-start: 0;
    inset-block-start: calc(100% + 14px);
    inline-size: min(420px, 82vw);
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(111, 93, 72, 0.14);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 28px 56px rgba(28, 21, 15, 0.16);
    backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 40;
}

html[dir="rtl"] .header-notification-panel-head,
html[dir="rtl"] .header-notification-panel-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

html[dir="rtl"] .header-notification-panel-head strong {
    font-size: 14px;
    font-weight: 800;
    color: var(--ui-text);
}

html[dir="rtl"] .header-notification-preview-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

html[dir="rtl"] .header-notification-preview-item,
html[dir="rtl"] .header-notification-preview-empty {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(111, 93, 72, 0.12);
    background: linear-gradient(180deg, rgba(253, 250, 245, 0.98) 0%, rgba(248, 242, 234, 0.9) 100%);
    color: var(--ui-text);
    text-decoration: none;
}

html[dir="rtl"] .header-notification-preview-item:hover {
    border-color: rgba(184, 132, 73, 0.22);
    transform: translateY(-1px);
}

html[dir="rtl"] .header-notification-preview-item.is-unread {
    box-shadow: inset 3px 0 0 rgba(184, 132, 73, 0.85);
}

html[dir="rtl"] .header-notification-preview-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

html[dir="rtl"] .header-notification-preview-top strong {
    font-size: 13px;
    font-weight: 800;
    color: var(--ui-text);
}

html[dir="rtl"] .header-notification-preview-top span,
html[dir="rtl"] .header-notification-preview-item p,
html[dir="rtl"] .header-notification-preview-empty span {
    margin: 0;
    color: var(--ui-text-soft);
    font-size: 12px;
    line-height: 1.6;
}

html[dir="rtl"] .header-user-chip {
    flex-direction: column;
    align-items: flex-start;
    min-width: 170px;
}

html[dir="rtl"] .header-user-name {
    font-weight: 800;
}

html[dir="rtl"] .page {
    max-width: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

html[dir="rtl"] .screen-head,
html[dir="rtl"] .section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

html[dir="rtl"] .screen-head {
    padding: 34px;
    border-radius: var(--ui-radius-lg);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 242, 234, 0.94) 100%);
    border: 1px solid var(--ui-line);
    box-shadow: var(--ui-shadow-card);
}

html[dir="rtl"] .hero-copy,
html[dir="rtl"] .section-head > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

html[dir="rtl"] .screen-head h1,
html[dir="rtl"] .screen-head h2,
html[dir="rtl"] .section-head h2,
html[dir="rtl"] .section-head h3 {
    margin: 0;
    color: var(--ui-text);
    letter-spacing: -0.03em;
}

html[dir="rtl"] .screen-head h1 {
    font-size: clamp(32px, 2.8vw, 52px);
    line-height: 1.05;
}

html[dir="rtl"] .section-head h2 {
    font-size: 26px;
}

html[dir="rtl"] .muted {
    color: var(--ui-text-soft);
    line-height: 1.65;
}

html[dir="rtl"] .screen-head p,
html[dir="rtl"] .section-head p,
html[dir="rtl"] .card p,
html[dir="rtl"] .section-card p,
html[dir="rtl"] .summary-card p,
html[dir="rtl"] .metric-tile p,
html[dir="rtl"] .ranking-group p,
html[dir="rtl"] .queue-item p,
html[dir="rtl"] .notification-card p,
html[dir="rtl"] .table-secondary-text {
    color: var(--ui-text-soft);
}

html[dir="rtl"] .eyebrow {
    color: var(--ui-gold-deep);
    font-size: 11px;
    font-weight: 800;
}

html[dir="rtl"] .screen-head-actions,
html[dir="rtl"] .form-actions,
html[dir="rtl"] .row-actions,
html[dir="rtl"] .action-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

html[dir="rtl"] .hero-stat-chip,
html[dir="rtl"] .soft-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    min-width: 160px;
    padding: 16px 18px;
    border-radius: 24px;
    border: 1px solid rgba(184, 132, 73, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 239, 229, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

html[dir="rtl"] .hero-stat-chip > span,
html[dir="rtl"] .soft-chip > span {
    color: var(--ui-text-soft);
    font-weight: 700;
}

html[dir="rtl"] .hero-stat-chip-link,
html[dir="rtl"] .action-metric-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

html[dir="rtl"] .hero-stat-chip-link:hover,
html[dir="rtl"] .action-metric-link:hover {
    transform: translateY(-2px);
}

html[dir="rtl"] .hero-stat-chip strong,
html[dir="rtl"] .summary-card strong {
    font-size: 34px;
    line-height: 1;
}

html[dir="rtl"] .hero-status-cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

html[dir="rtl"] .workspace-layout,
html[dir="rtl"] .detail-layout {
    display: flex;
    align-items: flex-start;
    gap: 28px;
}

html[dir="rtl"] .workspace-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 26px;
}

html[dir="rtl"] .workspace-side {
    flex: 0 0 320px;
    min-width: 300px;
    position: sticky;
    inset-block-start: 116px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

html[dir="rtl"] .detail-layout > .stack-gap:first-child {
    flex: 1.15;
    min-width: 0;
}

html[dir="rtl"] .detail-layout > .stack-gap:last-child {
    flex: 0 0 360px;
    min-width: 320px;
    position: sticky;
    inset-block-start: 116px;
}

html[dir="rtl"] .stack,
html[dir="rtl"] .stack-gap,
html[dir="rtl"] .notification-stack,
html[dir="rtl"] .ranking-stack,
html[dir="rtl"] .case-queue,
html[dir="rtl"] .timeline,
html[dir="rtl"] .list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

html[dir="rtl"] .quick-note-list,
html[dir="rtl"] .active-note-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

html[dir="rtl"] .quick-note-panel {
    background: linear-gradient(180deg, rgba(255, 250, 244, 0.98) 0%, rgba(249, 241, 232, 0.88) 100%);
}

html[dir="rtl"] .quick-note-item,
html[dir="rtl"] .active-note-item {
    padding: 15px 17px;
    border-radius: 20px;
    border: 1px solid rgba(184, 132, 73, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(252, 247, 240, 0.88) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

html[dir="rtl"] .quick-note-item strong,
html[dir="rtl"] .active-note-item strong {
    display: block;
    margin-block-end: 6px;
    color: var(--ui-gold-deep);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

html[dir="rtl"] .quick-note-item p,
html[dir="rtl"] .active-note-item p {
    margin: 0;
    color: var(--ui-text);
    line-height: 1.65;
}

html[dir="rtl"] .grid-two,
html[dir="rtl"] .hero-summary-grid,
html[dir="rtl"] .metric-grid,
html[dir="rtl"] .kpi-grid,
html[dir="rtl"] .action-panels,
html[dir="rtl"] .ranking-columns,
html[dir="rtl"] .content-subgrid {
    display: grid;
    gap: 18px;
}

html[dir="rtl"] .grid-two,
html[dir="rtl"] .content-subgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

html[dir="rtl"] .hero-summary-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

html[dir="rtl"] .kpi-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

html[dir="rtl"] .metric-grid,
html[dir="rtl"] .action-panels,
html[dir="rtl"] .ranking-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

html[dir="rtl"] .card,
html[dir="rtl"] .section-card,
html[dir="rtl"] .summary-card,
html[dir="rtl"] .metric-tile,
html[dir="rtl"] .ranking-group,
html[dir="rtl"] .queue-item,
html[dir="rtl"] .notification-card,
html[dir="rtl"] .auth-card,
html[dir="rtl"] .auth-brand-panel,
html[dir="rtl"] .action-card {
    border-radius: 28px;
    border: 1px solid var(--ui-line);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-card);
    backdrop-filter: blur(8px);
}

html[dir="rtl"] .card,
html[dir="rtl"] .section-card,
html[dir="rtl"] .auth-card,
html[dir="rtl"] .auth-brand-panel {
    padding: 28px;
}

html[dir="rtl"] .summary-card,
html[dir="rtl"] .metric-tile {
    padding: 22px;
}

html[dir="rtl"] .summary-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-height: 148px;
}

html[dir="rtl"] .summary-label,
html[dir="rtl"] .kpi-label {
    color: var(--ui-text-soft);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

html[dir="rtl"] .premium-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

html[dir="rtl"] .premium-kpi-card {
    position: relative;
    overflow: hidden;
    min-height: 178px;
    padding: 24px 22px;
}

html[dir="rtl"] .premium-kpi-card::before {
    content: "";
    position: absolute;
    inset-block-start: 18px;
    inset-inline-start: 18px;
    inline-size: 44px;
    block-size: 44px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(184, 132, 73, 0.16) 0%, rgba(184, 132, 73, 0.05) 100%);
    border: 1px solid rgba(184, 132, 73, 0.12);
}

html[dir="rtl"] .premium-kpi-card .kpi-label {
    margin-block-start: 54px;
}

html[dir="rtl"] .kpi-value,
html[dir="rtl"] .metric-value {
    font-size: clamp(30px, 2.2vw, 44px);
    font-weight: 800;
    color: var(--ui-text);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

html[dir="rtl"] .premium-metric-tile,
html[dir="rtl"] .metric-tile {
    min-height: 170px;
}

html[dir="rtl"] .action-strip-card,
html[dir="rtl"] .executive-alert-bar {
    border-radius: 32px;
    background:
        linear-gradient(125deg, rgba(255, 255, 255, 0.96) 0%, rgba(245, 237, 227, 0.94) 100%);
    border: 1px solid rgba(184, 132, 73, 0.12);
    box-shadow: 0 24px 48px rgba(32, 24, 17, 0.08);
}

html[dir="rtl"] .action-strip,
html[dir="rtl"] .executive-alert-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 18px;
    padding: 24px 28px;
}

html[dir="rtl"] .action-strip-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 12px;
}

html[dir="rtl"] .action-metric,
html[dir="rtl"] .executive-alert-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    min-height: 92px;
    padding: 16px 18px;
    border-radius: 22px;
    border: 1px solid rgba(111, 93, 72, 0.1);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

html[dir="rtl"] .action-metric span,
html[dir="rtl"] .executive-alert-item span {
    color: var(--ui-text-soft);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45;
}

html[dir="rtl"] .action-metric-link:hover {
    border-color: rgba(184, 132, 73, 0.28);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.74),
        0 14px 28px rgba(46, 33, 22, 0.08);
}

html[dir="rtl"] .action-metric-link.is-active {
    border-color: rgba(184, 132, 73, 0.35);
    background: linear-gradient(180deg, rgba(255, 251, 244, 0.96) 0%, rgba(245, 236, 223, 0.98) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.82),
        0 16px 30px rgba(184, 132, 73, 0.14);
}

html[dir="rtl"] .action-metric strong,
html[dir="rtl"] .executive-alert-item strong {
    font-size: 28px;
    line-height: 1;
}

html[dir="rtl"] .premium-filter-card,
html[dir="rtl"] .filter-card {
    border-radius: 30px;
}

html[dir="rtl"] .premium-filter-toolbar,
html[dir="rtl"] .filter-toolbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

html[dir="rtl"] .filter-toolbar label {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 22px;
    border: 1px solid rgba(111, 93, 72, 0.1);
    background: linear-gradient(180deg, rgba(252, 249, 244, 0.98) 0%, rgba(245, 239, 232, 0.9) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

html[dir="rtl"] label > span {
    display: block;
    margin: 0;
    color: var(--ui-text-soft);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

html[dir="rtl"] [data-lead-extra][hidden],
html[dir="rtl"] .appointment-lead-extra.is-hidden {
    display: none !important;
}

/* Lead CRM polish */
html[dir="rtl"] .lead-crm-shell {
    gap: 18px;
    max-width: 1680px;
    margin-inline: auto;
    font-size: 15px;
}

html[dir="rtl"] .leads-hero-compact,
html[dir="rtl"] .lead-profile-hero {
    min-height: 0;
    padding: 24px 28px;
    align-items: center;
}

html[dir="rtl"] .leads-hero-compact h1,
html[dir="rtl"] .lead-profile-hero h1 {
    font-size: clamp(32px, 3vw, 38px);
    line-height: 1.08;
}

html[dir="rtl"] .leads-hero-compact p,
html[dir="rtl"] .lead-profile-hero p,
html[dir="rtl"] .lead-card-subtitle {
    font-size: 15px;
    color: #71685f;
}

html[dir="rtl"] .leads-tabs-premium,
html[dir="rtl"] .lead-tabs-premium {
    padding: 7px;
    background: rgba(255, 252, 247, 0.92);
    border: 1px solid rgba(177, 135, 72, 0.18);
    border-radius: 20px;
    box-shadow: 0 14px 36px rgba(63, 45, 24, 0.06);
}

html[dir="rtl"] .leads-tabs-premium .leads-tab,
html[dir="rtl"] .lead-tabs-premium a {
    min-height: 48px;
    border-radius: 16px;
    font-size: 14px;
}

html[dir="rtl"] .leads-tabs-premium .leads-tab.is-active,
html[dir="rtl"] .lead-tabs-premium a.is-active {
    background: linear-gradient(180deg, #bd8840, #9b6c34);
    color: #fff;
    box-shadow: 0 12px 22px rgba(155, 108, 52, 0.18);
}

html[dir="rtl"] .leads-kpi-premium {
    grid-template-columns: repeat(6, minmax(150px, 1fr));
}

html[dir="rtl"] .leads-kpi-card {
    min-height: 118px;
    border-radius: 20px;
    background: linear-gradient(180deg, #fffefb, #fffaf4);
}

html[dir="rtl"] .leads-kpi-card strong {
    font-size: 34px;
    letter-spacing: 0;
}

html[dir="rtl"] .leads-kpi-card span:not(.leads-kpi-icon) {
    font-size: 14px;
    font-weight: 800;
}

html[dir="rtl"] .leads-kpi-card small,
html[dir="rtl"] .lead-record-item small,
html[dir="rtl"] .lead-activity-item span {
    font-size: 13px;
}

html[dir="rtl"] .leads-filter-card,
html[dir="rtl"] .leads-table-card,
html[dir="rtl"] .leads-form-card,
html[dir="rtl"] .leads-selected-panel,
html[dir="rtl"] .lead-detail-card {
    border-radius: 22px;
    box-shadow: 0 16px 42px rgba(63, 45, 24, 0.055);
}

html[dir="rtl"] .leads-section-head h2,
html[dir="rtl"] .lead-detail-card h2 {
    font-size: 23px;
}

html[dir="rtl"] .leads-section-head p {
    font-size: 15px;
}

html[dir="rtl"] .lead-form-premium {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

html[dir="rtl"] .lead-form-section {
    display: grid;
    gap: 13px;
    padding: 18px;
    border: 1px solid rgba(177, 135, 72, 0.14);
    border-radius: 20px;
    background: rgba(255, 252, 247, 0.72);
}

html[dir="rtl"] .lead-form-section-notes,
html[dir="rtl"] .lead-form-premium .lead-form-actions {
    grid-column: 1 / -1;
}

html[dir="rtl"] .lead-form-section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(177, 135, 72, 0.12);
}

html[dir="rtl"] .lead-form-section-title span {
    font-size: 17px;
    font-weight: 900;
    color: #3f3328;
}

html[dir="rtl"] .lead-form-section-title small {
    color: #86786a;
    font-size: 13px;
}

html[dir="rtl"] .lead-form-section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

html[dir="rtl"] .lead-form-premium label,
html[dir="rtl"] .lead-form-grid label {
    font-size: 14px;
}

html[dir="rtl"] .lead-form-premium input,
html[dir="rtl"] .lead-form-premium select,
html[dir="rtl"] .lead-form-premium textarea,
html[dir="rtl"] .lead-form-grid input,
html[dir="rtl"] .lead-form-grid select,
html[dir="rtl"] .lead-form-grid textarea,
html[dir="rtl"] .leads-filter-grid input,
html[dir="rtl"] .leads-filter-grid select {
    min-height: 46px;
    font-size: 14px;
}

html[dir="rtl"] .lead-profile-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    border: 1px solid rgba(177, 135, 72, 0.18);
    border-radius: 24px;
    background:
        radial-gradient(circle at 12% 18%, rgba(196, 152, 79, 0.11), transparent 32%),
        linear-gradient(135deg, #fffaf2, #ffffff 62%, #f8efe3);
}

html[dir="rtl"] .lead-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

html[dir="rtl"] .lead-profile-meta span {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    padding: 6px 12px;
    border: 1px solid rgba(177, 135, 72, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    color: #4d4035;
    font-weight: 800;
}

html[dir="rtl"] .lead-profile-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    max-width: 520px;
}

html[dir="rtl"] .lead-profile-actions form,
html[dir="rtl"] .leads-row-actions form {
    margin: 0;
}

html[dir="rtl"] .lead-detail-card-compact {
    padding: 18px;
}

html[dir="rtl"] .lead-two-column {
    grid-template-columns: minmax(360px, 0.95fr) minmax(0, 1.05fr);
}

html[dir="rtl"] .lead-mini-table th,
html[dir="rtl"] .lead-mini-table td {
    font-size: 13.5px;
    vertical-align: middle;
}

html[dir="rtl"] .lead-mini-table td {
    line-height: 1.45;
}

html[dir="rtl"] .lead-status-badge {
    font-size: 13px;
    min-height: 28px;
}

html[dir="rtl"] .leads-row-actions {
    align-items: center;
    gap: 6px;
    min-width: 250px;
}

html[dir="rtl"] .leads-row-actions .button.small {
    min-height: 30px;
    padding: 6px 10px;
    white-space: nowrap;
}

html[dir="rtl"] .leads-table td {
    font-size: 14px;
}

html[dir="rtl"] .leads-selected-panel {
    grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr) minmax(280px, 0.85fr);
    align-items: stretch;
}

html[dir="rtl"] .lead-selected-empty {
    grid-column: 1 / -1;
}

html[dir="rtl"] .lead-activity-timeline {
    display: grid;
    gap: 10px;
    position: relative;
}

html[dir="rtl"] .lead-activity-item {
    position: relative;
    padding: 13px 16px;
    border: 1px solid rgba(177, 135, 72, 0.13);
    border-radius: 16px;
    background: #fffaf4;
}

html[dir="rtl"] .lead-activity-item strong {
    display: block;
    margin-bottom: 4px;
    color: #2d251f;
    font-size: 15px;
}

html[dir="rtl"] .lead-activity-item p {
    margin: 6px 0 0;
    color: #6f6359;
}

html[dir="rtl"] .leads-empty-state {
    min-height: 150px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 250, 243, 0.94), rgba(255, 255, 255, 0.88));
}

@media (max-width: 1500px) {
    html[dir="rtl"] .leads-kpi-premium {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    html[dir="rtl"] .lead-form-premium,
    html[dir="rtl"] .lead-form-section-grid,
    html[dir="rtl"] .lead-profile-hero,
    html[dir="rtl"] .lead-two-column,
    html[dir="rtl"] .leads-selected-panel {
        grid-template-columns: minmax(0, 1fr);
    }

    html[dir="rtl"] .lead-profile-actions {
        justify-content: flex-start;
        max-width: none;
    }
}

html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea {
    width: 100%;
    min-height: 54px;
    padding-inline: 16px;
    padding-block: 13px;
    border-radius: 18px;
    border: 1px solid rgba(111, 93, 72, 0.14);
    background: #fcfaf7;
    color: var(--ui-text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
    text-align: start;
    direction: rtl;
}

html[dir="rtl"] input[type="file"] {
    padding-block: 12px;
}

html[dir="rtl"] textarea {
    min-height: 118px;
    resize: vertical;
}

html[dir="rtl"] .filter-toolbar label input,
html[dir="rtl"] .filter-toolbar label select {
    min-height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

html[dir="rtl"] .filter-actions {
    align-self: end;
}

html[dir="rtl"] .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding-inline: 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 800;
    letter-spacing: 0.01em;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

html[dir="rtl"] .button:hover:not(:disabled) {
    transform: translateY(-1px);
}

html[dir="rtl"] .button.primary {
    background: linear-gradient(180deg, #c58c52 0%, #a86f36 100%);
    color: #fff;
    box-shadow: 0 14px 28px rgba(168, 111, 54, 0.26);
}

html[dir="rtl"] .button.secondary {
    background: rgba(255, 250, 243, 0.96);
    color: var(--ui-gold-deep);
    border-color: rgba(184, 132, 73, 0.22);
}

html[dir="rtl"] .button.ghost {
    background: rgba(255, 255, 255, 0.5);
    color: var(--ui-text);
    border-color: rgba(111, 93, 72, 0.16);
}

html[dir="rtl"] .button.warning {
    background: #fff1ef;
    color: #aa4540;
    border-color: rgba(170, 69, 64, 0.18);
}

html[dir="rtl"] .button.small {
    min-height: 36px;
    padding-inline: 12px;
    font-size: 13px;
}

html[dir="rtl"] .table-wrap {
    overflow: auto;
    padding: 14px;
    border-radius: 28px;
    border: 1px solid rgba(111, 93, 72, 0.1);
    background: linear-gradient(180deg, rgba(250, 247, 242, 0.96) 0%, rgba(245, 239, 232, 0.92) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

html[dir="rtl"] table,
html[dir="rtl"] .data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

html[dir="rtl"] .data-table thead th {
    padding: 15px 18px;
    background: #1c1916;
    color: rgba(255, 246, 235, 0.96);
    text-align: start;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: none;
}

html[dir="rtl"] .data-table thead th:first-child {
    border-start-start-radius: 20px;
    border-end-start-radius: 20px;
}

html[dir="rtl"] .data-table thead th:last-child {
    border-start-end-radius: 20px;
    border-end-end-radius: 20px;
}

html[dir="rtl"] .data-table tbody tr.data-row td,
html[dir="rtl"] .data-table tbody tr td {
    padding: 18px;
    text-align: start;
    vertical-align: top;
    border-block: 1px solid rgba(111, 93, 72, 0.1);
    background: rgba(255, 255, 255, 0.96);
}

html[dir="rtl"] .data-table tbody tr.data-row td:first-child {
    border-start-start-radius: 22px;
    border-end-start-radius: 22px;
    border-inline-start: 1px solid rgba(111, 93, 72, 0.1);
}

html[dir="rtl"] .data-table tbody tr.data-row td:last-child {
    border-start-end-radius: 22px;
    border-end-end-radius: 22px;
    border-inline-end: 1px solid rgba(111, 93, 72, 0.1);
}

html[dir="rtl"] .data-table tbody tr.data-row:hover td {
    background: #fffdfa;
    box-shadow: 0 14px 26px rgba(44, 31, 21, 0.06);
}

html[dir="rtl"] .table-identity,
html[dir="rtl"] .table-meta-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

html[dir="rtl"] .table-secondary-text {
    color: var(--ui-text-muted);
    font-size: 12px;
}

html[dir="rtl"] .row-actions {
    justify-content: flex-start;
}

html[dir="rtl"] .inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

html[dir="rtl"] .status,
html[dir="rtl"] .state-pill,
html[dir="rtl"] .sla-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding-block: 8px;
    padding-inline: 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

html[dir="rtl"] .status,
html[dir="rtl"] .state-pill.neutral,
html[dir="rtl"] .sla-indicator.neutral {
    background: rgba(111, 93, 72, 0.08);
    color: var(--ui-text);
    border-color: rgba(111, 93, 72, 0.12);
}

html[dir="rtl"] .status[class*="submitted"],
html[dir="rtl"] .status[class*="managerial-review"],
html[dir="rtl"] .status[class*="ready"],
html[dir="rtl"] .status[class*="review"],
html[dir="rtl"] .sla-indicator.orange {
    background: rgba(191, 128, 62, 0.12);
    color: #9d6327;
    border-color: rgba(191, 128, 62, 0.18);
}

html[dir="rtl"] .status[class*="blocked"],
html[dir="rtl"] .status[class*="returned-for-completion"],
html[dir="rtl"] .status[class*="returned-for-decomposition-fix"],
html[dir="rtl"] .state-pill.error,
html[dir="rtl"] .sla-indicator.red {
    background: rgba(183, 75, 69, 0.1);
    color: #a54740;
    border-color: rgba(183, 75, 69, 0.16);
}

html[dir="rtl"] .status[class*="decomposition-completed"],
html[dir="rtl"] .status[class*="approved"],
html[dir="rtl"] .status[class*="sent"],
html[dir="rtl"] .status[class*="closed"],
html[dir="rtl"] .state-pill.success {
    background: rgba(66, 128, 95, 0.12);
    color: #2f6a4b;
    border-color: rgba(66, 128, 95, 0.18);
}

html[dir="rtl"] .status[class*="assigned"],
html[dir="rtl"] .status[class*="received"],
html[dir="rtl"] .status[class*="in-decomposition"],
html[dir="rtl"] .status[class*="returned-from-designer"] {
    background: rgba(64, 92, 145, 0.1);
    color: #355382;
    border-color: rgba(64, 92, 145, 0.14);
}

html[dir="rtl"] .quick-card-row td {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

html[dir="rtl"] .quick-card-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-12px);
    transition: max-height 0.35s ease, opacity 0.26s ease, transform 0.26s ease, margin 0.26s ease, padding 0.26s ease;
    margin: 0;
    padding: 0;
    border-radius: 32px;
    border: none;
    background: transparent;
    box-shadow: none;
}

html[dir="rtl"] .quick-card-row.is-open .quick-card-panel {
    max-height: 3200px;
    opacity: 1;
    transform: translateY(0);
    margin-block: 12px 18px;
    padding: 26px;
    border: 1px solid rgba(111, 93, 72, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 242, 234, 0.98) 100%);
    box-shadow: var(--ui-shadow-card);
}

html[dir="rtl"] .quick-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-block-end: 20px;
}

html[dir="rtl"] .quick-card-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 24px;
}

html[dir="rtl"] .quick-card-section,
html[dir="rtl"] .quick-subsection,
html[dir="rtl"] .quick-chat-block {
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(111, 93, 72, 0.09);
    border-radius: 24px;
    padding: 20px;
}

html[dir="rtl"] .quick-card-section {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

html[dir="rtl"] .quick-subsection h4,
html[dir="rtl"] .quick-chat-block h4,
html[dir="rtl"] .quick-card-section > h4,
html[dir="rtl"] .quick-visual-head h4 {
    margin: 0 0 12px;
    font-size: 20px;
}

html[dir="rtl"] .quick-visual-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-block-end: 12px;
}

html[dir="rtl"] .quick-visual-frame {
    display: block;
    border-radius: 24px;
    overflow: hidden;
    aspect-ratio: 16 / 11;
    background: #ece4d9;
}

html[dir="rtl"] .quick-visual-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

html[dir="rtl"] .quick-chat-feed,
html[dir="rtl"] .quick-files-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

html[dir="rtl"] .quick-chat-feed {
    max-block-size: 320px;
    overflow: auto;
}

html[dir="rtl"] .quick-chat-item,
html[dir="rtl"] .quick-file-link,
html[dir="rtl"] .list-item,
html[dir="rtl"] .queue-item,
html[dir="rtl"] .notification-card,
html[dir="rtl"] .timeline-item {
    border-radius: 20px;
    border: 1px solid rgba(111, 93, 72, 0.1);
    background: rgba(255, 255, 255, 0.84);
}

html[dir="rtl"] .quick-chat-item,
html[dir="rtl"] .timeline-item {
    padding: 16px 18px;
}

html[dir="rtl"] .quick-file-link,
html[dir="rtl"] .list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
}

html[dir="rtl"] .quick-chat-head,
html[dir="rtl"] .timeline-head,
html[dir="rtl"] .notification-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-block-end: 10px;
}

html[dir="rtl"] .fact-grid,
html[dir="rtl"] .info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

html[dir="rtl"] .fact-grid > div,
html[dir="rtl"] .info-grid > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-height: 98px;
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(111, 93, 72, 0.1);
}

html[dir="rtl"] .history-details {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

html[dir="rtl"] .history-summary {
    align-self: flex-start;
}

html[dir="rtl"] .notification-stack {
    gap: 16px;
}

html[dir="rtl"] .notification-card {
    padding: 22px 24px;
    position: relative;
}

html[dir="rtl"] .notification-card::before {
    content: "";
    position: absolute;
    inset-block: 20px;
    inset-inline-end: 14px;
    width: 4px;
    border-radius: 999px;
    background: transparent;
}

html[dir="rtl"] .notification-card.is-unread {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 240, 228, 0.96) 100%);
    border-color: rgba(184, 132, 73, 0.18);
    box-shadow: 0 18px 34px rgba(184, 132, 73, 0.12);
}

html[dir="rtl"] .notification-card.is-unread::before {
    background: linear-gradient(180deg, #d49b5d 0%, #b88449 100%);
}

html[dir="rtl"] .notification-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(184, 132, 73, 0.12);
    color: var(--ui-gold-deep);
    font-size: 12px;
    font-weight: 800;
}

html[dir="rtl"] .notification-type,
html[dir="rtl"] .notification-time {
    color: var(--ui-text-soft);
}

html[dir="rtl"] .ranking-group,
html[dir="rtl"] .queue-item {
    padding: 22px;
}

html[dir="rtl"] .ranking-list,
html[dir="rtl"] .plain-list {
    margin: 0;
    padding: 0;
}

html[dir="rtl"] .ranking-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

html[dir="rtl"] .ranking-list li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(111, 93, 72, 0.09);
}

html[dir="rtl"] .ranking-rank {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(184, 132, 73, 0.12);
    color: var(--ui-gold-deep);
    font-weight: 800;
}

html[dir="rtl"] .person-link {
    color: var(--ui-text);
    font-weight: 700;
}

html[dir="rtl"] .person-link:hover,
html[dir="rtl"] .person-link:focus-visible {
    color: var(--ui-gold-deep);
}

html[dir="rtl"] .ranking-list li strong,
html[dir="rtl"] .metric-value,
html[dir="rtl"] .kpi-value,
html[dir="rtl"] .summary-card strong,
html[dir="rtl"] .hero-stat-chip strong,
html[dir="rtl"] .executive-alert-item strong,
html[dir="rtl"] .action-metric strong {
    color: var(--ui-text);
}

html[dir="rtl"] .ranking-group .muted,
html[dir="rtl"] .section-card .muted,
html[dir="rtl"] .filter-card .muted,
html[dir="rtl"] .premium-filter-card .muted,
html[dir="rtl"] .action-strip-copy .muted,
html[dir="rtl"] .hero-copy .muted {
    color: var(--ui-text-soft);
}

html[dir="rtl"] .case-queue {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

html[dir="rtl"] .queue-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

html[dir="rtl"] .auth-page {
    min-height: 100vh;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

html[dir="rtl"] .auth-shell {
    display: flex;
    align-items: stretch;
    gap: 34px;
    width: min(1200px, 100%);
}

html[dir="rtl"] .auth-brand-panel {
    flex: 1.08;
    min-height: 680px;
    padding: 42px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 14% 16%, rgba(184, 132, 73, 0.22), transparent 20%),
        linear-gradient(160deg, #16120f 0%, #1a1613 38%, #241d18 100%);
    color: #fff9f2;
}

html[dir="rtl"] .auth-brand-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 520px;
}

html[dir="rtl"] .auth-brand-panel .muted,
html[dir="rtl"] .auth-feature span {
    color: rgba(255, 241, 224, 0.74);
}

html[dir="rtl"] .auth-feature-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-block-start: auto;
}

html[dir="rtl"] .auth-feature {
    padding: 18px 20px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
}

html[dir="rtl"] .premium-auth-card {
    flex: 0 0 500px;
    padding: 40px;
}

html[dir="rtl"] .auth-card-head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-block-end: 20px;
}

html[dir="rtl"] .auth-support-panel,
html[dir="rtl"] .auth-demo-panel {
    padding: 20px 22px;
    border-radius: 22px;
    border: 1px solid rgba(111, 93, 72, 0.12);
    background: rgba(249, 244, 236, 0.9);
}

html[dir="rtl"] .demo-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

html[dir="rtl"] .plain-list {
    list-style-position: inside;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

html[dir="rtl"] .checkbox-row {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
}

html[dir="rtl"] .checkbox-row input {
    width: auto;
    min-height: auto;
    margin: 4px 0 0;
}

html[dir="rtl"] .manager-workspace .workspace-main {
    flex: 1.2;
}

html[dir="rtl"] .manager-workspace .workspace-side {
    flex: 0 0 300px;
}

/* Compact Scale Calibration */

html[dir="rtl"] body {
    font-size: 14px;
    line-height: 1.5;
}

html[dir="rtl"] .app-shell {
    gap: 20px;
    padding: 14px;
}

html[dir="rtl"] .app-sidebar {
    flex: 0 0 292px;
    min-height: calc(100vh - 28px);
    max-height: calc(100vh - 28px);
    inset-block-start: 14px;
    gap: 18px;
    padding: 22px 18px;
    border-radius: 28px;
}

html[dir="rtl"] .sidebar-brand {
    padding: 2px 2px 14px;
}

html[dir="rtl"] .brand-logo {
    gap: 8px;
}

html[dir="rtl"] .brand-emblem {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 28px;
}

html[dir="rtl"] .brand-mark {
    font-size: 30px;
}

html[dir="rtl"] .brand-tagline,
html[dir="rtl"] .sidebar-section-label,
html[dir="rtl"] .sidebar-system-label,
html[dir="rtl"] .eyebrow {
    letter-spacing: 0.1em;
}

html[dir="rtl"] .sidebar-nav {
    gap: 8px;
}

html[dir="rtl"] .sidebar-link {
    gap: 10px;
    padding-block: 11px;
    padding-inline: 14px 11px;
    border-radius: 18px;
}

html[dir="rtl"] .sidebar-link-copy strong {
    font-size: 14px;
}

html[dir="rtl"] .sidebar-link-copy small {
    font-size: 11px;
    line-height: 1.3;
}

html[dir="rtl"] .sidebar-link-badge,
html[dir="rtl"] .header-notification-count,
html[dir="rtl"] .notification-state {
    min-width: 22px;
    height: 22px;
    font-size: 11px;
}

html[dir="rtl"] .sidebar-user-card {
    gap: 8px;
    padding: 10px;
    border-radius: 18px;
}

html[dir="rtl"] .sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
}

html[dir="rtl"] .page {
    gap: 18px;
}

html[dir="rtl"] .app-header {
    grid-template-columns: minmax(156px, 0.62fr) minmax(280px, 1.04fr) auto;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 24px;
}

html[dir="rtl"] .header-system-chip,
html[dir="rtl"] .header-notification-chip,
html[dir="rtl"] .header-user-chip {
    min-height: 48px;
    border-radius: 16px;
}

html[dir="rtl"] .header-system-chip,
html[dir="rtl"] .header-notification-chip,
html[dir="rtl"] .header-user-chip {
    padding-inline: 12px;
}

html[dir="rtl"] .header-system-title,
html[dir="rtl"] .header-user-name {
    font-size: 13px;
}

html[dir="rtl"] .header-system-copy,
html[dir="rtl"] .header-user-role {
    font-size: 10px;
}

html[dir="rtl"] .header-search {
    min-height: 48px;
    padding-inline: 14px;
    border-radius: 18px;
}

html[dir="rtl"] .global-search-form {
    gap: 8px;
}

html[dir="rtl"] .global-search-form input {
    font-size: 13px;
}

html[dir="rtl"] .header-search-submit {
    min-height: 30px;
    min-width: 58px;
}

html[dir="rtl"] .header-notification-panel {
    inset-block-start: calc(100% + 10px);
    inline-size: min(370px, 82vw);
    padding: 14px;
    border-radius: 18px;
    gap: 10px;
}

html[dir="rtl"] .header-notification-preview-list {
    gap: 8px;
}

html[dir="rtl"] .header-notification-preview-item,
html[dir="rtl"] .header-notification-preview-empty {
    gap: 4px;
    padding: 10px 12px;
    border-radius: 14px;
}

html[dir="rtl"] .screen-head,
html[dir="rtl"] .card,
html[dir="rtl"] .section-card,
html[dir="rtl"] .auth-card,
html[dir="rtl"] .auth-brand-panel {
    padding: 20px;
}

html[dir="rtl"] .screen-head {
    padding: 24px;
}

html[dir="rtl"] .screen-head,
html[dir="rtl"] .section-head {
    gap: 14px;
}

html[dir="rtl"] .screen-head h1 {
    font-size: clamp(25px, 2.15vw, 40px);
}

html[dir="rtl"] .section-head h2 {
    font-size: 20px;
}

html[dir="rtl"] .section-head h3 {
    font-size: 18px;
}

html[dir="rtl"] .muted {
    font-size: 12px;
    line-height: 1.45;
}

html[dir="rtl"] .hero-copy,
html[dir="rtl"] .section-head > div {
    gap: 6px;
}

html[dir="rtl"] .grid-two,
html[dir="rtl"] .hero-summary-grid,
html[dir="rtl"] .metric-grid,
html[dir="rtl"] .kpi-grid,
html[dir="rtl"] .action-panels,
html[dir="rtl"] .ranking-columns,
html[dir="rtl"] .content-subgrid {
    gap: 12px;
}

html[dir="rtl"] .card,
html[dir="rtl"] .section-card,
html[dir="rtl"] .summary-card,
html[dir="rtl"] .metric-tile,
html[dir="rtl"] .ranking-group,
html[dir="rtl"] .queue-item,
html[dir="rtl"] .notification-card,
html[dir="rtl"] .auth-card,
html[dir="rtl"] .auth-brand-panel,
html[dir="rtl"] .action-card {
    border-radius: 22px;
}

html[dir="rtl"] .summary-card,
html[dir="rtl"] .metric-tile {
    padding: 16px;
}

html[dir="rtl"] .summary-card {
    min-height: 112px;
    gap: 6px;
}

html[dir="rtl"] .hero-stat-chip,
html[dir="rtl"] .soft-chip {
    min-width: 132px;
    padding: 12px 14px;
    border-radius: 18px;
}

html[dir="rtl"] .hero-stat-chip strong,
html[dir="rtl"] .summary-card strong {
    font-size: 27px;
}

html[dir="rtl"] .summary-label,
html[dir="rtl"] .kpi-label,
html[dir="rtl"] label > span {
    font-size: 10px;
}

html[dir="rtl"] .premium-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
}

html[dir="rtl"] .premium-kpi-card {
    min-height: 138px;
    padding: 18px 16px;
}

html[dir="rtl"] .premium-kpi-card::before {
    inset-block-start: 14px;
    inset-inline-start: 14px;
    inline-size: 34px;
    block-size: 34px;
    border-radius: 12px;
}

html[dir="rtl"] .premium-kpi-card .kpi-label {
    margin-block-start: 40px;
}

html[dir="rtl"] .kpi-value,
html[dir="rtl"] .metric-value {
    font-size: clamp(24px, 1.85vw, 34px);
}

html[dir="rtl"] .premium-metric-tile,
html[dir="rtl"] .metric-tile {
    min-height: 128px;
}

html[dir="rtl"] .action-strip-card,
html[dir="rtl"] .executive-alert-bar {
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(32, 24, 17, 0.07);
}

html[dir="rtl"] .action-strip,
html[dir="rtl"] .executive-alert-bar {
    gap: 12px;
    padding: 18px 20px;
}

html[dir="rtl"] .action-strip-copy h2 {
    font-size: 24px;
}

html[dir="rtl"] .action-strip-metrics {
    gap: 8px;
}

html[dir="rtl"] .action-metric,
html[dir="rtl"] .executive-alert-item {
    min-height: 72px;
    padding: 12px 14px;
    border-radius: 16px;
}

html[dir="rtl"] .action-metric strong,
html[dir="rtl"] .executive-alert-item strong {
    font-size: 22px;
}

html[dir="rtl"] .premium-filter-card,
html[dir="rtl"] .filter-card {
    border-radius: 22px;
}

html[dir="rtl"] .premium-filter-toolbar,
html[dir="rtl"] .filter-toolbar {
    gap: 10px;
}

html[dir="rtl"] .filter-toolbar label {
    gap: 6px;
    padding: 10px 12px;
    border-radius: 16px;
}

html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea {
    min-height: 44px;
    padding-inline: 12px;
    padding-block: 10px;
    border-radius: 14px;
    font-size: 13px;
}

html[dir="rtl"] textarea {
    min-height: 96px;
}

html[dir="rtl"] .button {
    min-height: 39px;
    padding-inline: 14px;
    font-size: 13px;
}

html[dir="rtl"] .button.small {
    min-height: 30px;
    padding-inline: 10px;
    font-size: 11px;
}

html[dir="rtl"] .table-wrap {
    padding: 8px;
    border-radius: 20px;
}

html[dir="rtl"] .data-table thead th {
    padding: 10px 13px;
    font-size: 10px;
}

html[dir="rtl"] .data-table thead th:first-child {
    border-start-start-radius: 14px;
    border-end-start-radius: 14px;
}

html[dir="rtl"] .data-table thead th:last-child {
    border-start-end-radius: 14px;
    border-end-end-radius: 14px;
}

html[dir="rtl"] .data-table tbody tr.data-row td,
html[dir="rtl"] .data-table tbody tr td {
    padding: 12px 13px;
}

html[dir="rtl"] .data-table tbody tr.data-row td:first-child {
    border-start-start-radius: 16px;
    border-end-start-radius: 16px;
}

html[dir="rtl"] .data-table tbody tr.data-row td:last-child {
    border-start-end-radius: 16px;
    border-end-end-radius: 16px;
}

html[dir="rtl"] .table-primary-link,
html[dir="rtl"] .case-name-trigger {
    font-size: 14px;
}

html[dir="rtl"] .table-secondary-text {
    font-size: 11px;
}

html[dir="rtl"] .status {
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 999px;
}

html[dir="rtl"] .workspace-side {
    flex: 0 0 292px;
    min-width: 276px;
    gap: 18px;
}

html[dir="rtl"] .side-panel {
    padding: 20px;
    border-radius: 24px;
}

html[dir="rtl"] .side-panel-head h3 {
    font-size: 18px;
}

html[dir="rtl"] .queue-item,
html[dir="rtl"] .notification-card {
    padding: 16px;
}

html[dir="rtl"] .ranking-group {
    padding: 16px;
}

html[dir="rtl"] .ranking-list {
    gap: 8px;
}

html[dir="rtl"] .ranking-list li {
    gap: 8px;
    padding: 10px 12px;
    border-radius: 14px;
}

html[dir="rtl"] .ranking-rank {
    width: 26px;
    height: 26px;
    border-radius: 9px;
    font-size: 11px;
}

html[dir="rtl"] .quick-card-row.is-open .quick-card-panel {
    padding: 18px;
    border-radius: 24px;
}

html[dir="rtl"] .quick-card-head {
    gap: 10px;
}

html[dir="rtl"] .quick-subsection,
html[dir="rtl"] .quick-chat-block,
html[dir="rtl"] .quick-files-block {
    padding-top: 10px;
}

html[dir="rtl"] .quick-subsection h4,
html[dir="rtl"] .quick-chat-block h4,
html[dir="rtl"] .quick-card-section > h4,
html[dir="rtl"] .quick-visual-head h4 {
    font-size: 18px;
}

html[dir="rtl"] .quick-chat-feed {
    max-block-size: 248px;
}

html[dir="rtl"] .quick-chat-item,
html[dir="rtl"] .quick-file-link,
html[dir="rtl"] .list-item,
html[dir="rtl"] .timeline-item {
    padding: 11px 13px;
    border-radius: 14px;
}

html[dir="rtl"] .notification-card {
    padding: 16px 18px;
}

html[dir="rtl"] .notification-card-head {
    gap: 10px;
    margin-block-end: 8px;
}

html[dir="rtl"] .auth-page {
    padding: 16px;
}

html[dir="rtl"] .auth-shell {
    gap: 20px;
    width: min(1120px, 100%);
}

html[dir="rtl"] .auth-brand-panel {
    min-height: 580px;
    padding: 28px;
}

html[dir="rtl"] .auth-brand-inner {
    gap: 14px;
    max-width: 480px;
}

html[dir="rtl"] .auth-feature-list {
    gap: 10px;
}

html[dir="rtl"] .auth-feature {
    padding: 12px 14px;
    border-radius: 18px;
}

html[dir="rtl"] .premium-auth-card {
    flex: 0 0 430px;
    padding: 26px;
}

html[dir="rtl"] .auth-card-head {
    gap: 6px;
    margin-block-end: 16px;
}

html[dir="rtl"] .auth-support-panel,
html[dir="rtl"] .auth-demo-panel {
    padding: 14px 16px;
    border-radius: 16px;
}

@media (max-width: 1400px) {
    html[dir="rtl"] .hero-summary-grid,
    html[dir="rtl"] .kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    html[dir="rtl"] .action-strip,
    html[dir="rtl"] .executive-alert-bar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1180px) {
    html[dir="rtl"] .app-shell,
    html[dir="rtl"] .workspace-layout,
    html[dir="rtl"] .detail-layout,
    html[dir="rtl"] .auth-shell {
        flex-direction: column;
    }

    html[dir="rtl"] .app-sidebar,
    html[dir="rtl"] .workspace-side,
    html[dir="rtl"] .detail-layout > .stack-gap:last-child,
    html[dir="rtl"] .premium-auth-card {
        flex: 1 1 auto;
        min-width: 0;
        max-height: none;
        position: relative;
        inset-block-start: auto;
    }

    html[dir="rtl"] .app-sidebar {
        min-height: auto;
    }

    html[dir="rtl"] .app-header {
        grid-template-columns: 1fr;
        position: relative;
        inset-block-start: auto;
    }

    html[dir="rtl"] .header-meta {
        justify-content: flex-start;
    }
}

@media (max-width: 900px) {
    html[dir="rtl"] .grid-two,
    html[dir="rtl"] .content-subgrid,
    html[dir="rtl"] .metric-grid,
    html[dir="rtl"] .action-panels,
    html[dir="rtl"] .ranking-columns,
    html[dir="rtl"] .premium-filter-toolbar,
    html[dir="rtl"] .filter-toolbar,
    html[dir="rtl"] .fact-grid,
    html[dir="rtl"] .info-grid,
    html[dir="rtl"] .quick-card-grid {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .hero-summary-grid,
    html[dir="rtl"] .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html[dir="rtl"] .quick-card-head,
    html[dir="rtl"] .screen-head,
    html[dir="rtl"] .section-head {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 640px) {
    html[dir="rtl"] .app-shell,
    html[dir="rtl"] .auth-page {
        padding: 14px;
    }

    html[dir="rtl"] .app-sidebar,
    html[dir="rtl"] .screen-head,
    html[dir="rtl"] .card,
    html[dir="rtl"] .section-card,
    html[dir="rtl"] .auth-brand-panel,
    html[dir="rtl"] .premium-auth-card {
        padding: 20px;
        border-radius: 24px;
    }

    html[dir="rtl"] .quick-card-row.is-open .quick-card-panel {
        padding: 20px;
        border-radius: 24px;
    }

    html[dir="rtl"] .hero-summary-grid,
    html[dir="rtl"] .kpi-grid {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .data-table {
        min-width: 760px;
    }
}

@media (max-width: 820px) {
    html[dir="rtl"],
    html[dir="rtl"] body {
        overflow-x: hidden;
    }

    html[dir="rtl"] body {
        background:
            radial-gradient(circle at 50% 0%, rgba(184, 132, 73, 0.08), transparent 34%),
            linear-gradient(180deg, #fbf8f3 0%, #f4ede4 100%);
        overscroll-behavior-y: contain;
    }

    html[dir="rtl"] .app-shell {
        display: block;
        padding: 10px 10px calc(94px + env(safe-area-inset-bottom, 0px));
    }

    html[dir="rtl"] .app-main {
        width: 100%;
        min-width: 0;
        padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
        gap: 14px;
    }

    html[dir="rtl"] .app-header {
        position: sticky;
        inset-block-start: calc(8px + env(safe-area-inset-top, 0px));
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
        border-radius: 22px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        z-index: 35;
    }

    html[dir="rtl"] .header-system-chip {
        display: none;
    }

    html[dir="rtl"] .header-meta {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        align-items: center;
        order: 1;
        width: 100%;
        min-width: 0;
    }

    html[dir="rtl"] .header-search-wrap {
        order: 2;
        width: 100%;
        min-width: 0;
    }

    html[dir="rtl"] .header-user-chip,
    html[dir="rtl"] .header-notification-chip {
        display: grid;
        align-items: center;
        min-height: 44px;
        border-radius: 16px;
        padding-inline: 12px;
        min-width: 0;
        max-width: 100%;
    }

    html[dir="rtl"] .header-user-name {
        font-size: 12px;
    }

    html[dir="rtl"] .header-user-role,
html[dir="rtl"] .header-notification-chip span {
    font-size: 10px;
}

html[dir="rtl"] .app-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    position: sticky;
    top: var(--ds-space-4);
    min-height: var(--shell-header-height);
}

html[dir="rtl"] .header-search-wrap {
    order: 1;
    flex: 0 1 760px;
    width: min(760px, 100%);
    margin-inline: auto;
}

html[dir="rtl"] .sidebar-brand-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

html[dir="rtl"] .sidebar-profile-dropdown,
html[dir="rtl"] .sidebar-notification-dropdown {
    position: relative;
}

html[dir="rtl"] .sidebar-user-chip {
    min-width: 138px;
    justify-content: flex-start;
}

html[dir="rtl"] .sidebar-notification-chip {
    min-width: 54px;
    min-height: 54px;
    justify-content: center;
    padding-inline: 12px;
    position: relative;
}

html[dir="rtl"] .sidebar-notification-chip > span:not(.header-notification-icon):not(.header-notification-count) {
    display: none;
}

html[dir="rtl"] .sidebar-notification-chip .header-notification-count {
    position: absolute;
    inset-block-start: 6px;
    inset-inline-start: 6px;
}

html[dir="rtl"] .sidebar-brand .header-notification-panel,
html[dir="rtl"] .sidebar-brand .header-profile-panel {
    inset-inline-end: 0;
    inset-inline-start: auto;
}

html[dir="rtl"] .sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 0 0 auto;
}

html[dir="rtl"] .sidebar-footer-profile,
html[dir="rtl"] .sidebar-footer-notifications {
    position: relative;
    width: 100%;
}

html[dir="rtl"] .sidebar-user-card {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    cursor: pointer;
    min-height: 78px;
    padding: 12px 14px;
}

html[dir="rtl"] .sidebar-footer-notifications .sidebar-notification-chip {
    width: 68px;
    min-height: 46px;
    justify-content: center;
    padding-inline: 0;
    margin-inline: auto;
}

html[dir="rtl"] .sidebar-footer-notifications .sidebar-notification-chip .header-notification-count {
    position: static;
}

html[dir="rtl"] .sidebar-footer .header-notification-panel,
html[dir="rtl"] .sidebar-footer .header-profile-panel {
    inset-inline-end: 0;
    inset-inline-start: auto;
    inset-block-start: auto;
    inset-block-end: calc(100% + 12px);
}

html[dir="rtl"] .sidebar-footer form {
    width: 100%;
}

@media (max-width: 1100px) {
    html[dir="rtl"] .app-header {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    html[dir="rtl"] .header-meta {
        order: 1;
        margin-inline: 0;
        width: 100%;
    }

    html[dir="rtl"] .header-search-wrap {
        order: 2;
        width: 100%;
        margin-inline: 0;
    }

    html[dir="rtl"] .sidebar-brand-meta {
        gap: 10px;
    }
}

    html[dir="rtl"] .header-user-chip {
        justify-items: start;
        gap: 2px;
    }

    html[dir="rtl"] .header-notification-chip {
        grid-template-columns: auto 1fr auto;
        gap: 8px;
    }

    html[dir="rtl"] .header-search {
        min-height: 46px;
        padding-inline: 12px;
        border-radius: 18px;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    }

    html[dir="rtl"] .global-search-form input {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 13px;
    }

    html[dir="rtl"] .global-search-form,
    html[dir="rtl"] .header-meta > *,
    html[dir="rtl"] .page,
    html[dir="rtl"] .workspace-layout,
    html[dir="rtl"] .workspace-main,
    html[dir="rtl"] .workspace-side,
    html[dir="rtl"] .detail-layout,
    html[dir="rtl"] .screen-head,
    html[dir="rtl"] .card,
    html[dir="rtl"] .section-card,
    html[dir="rtl"] .table-wrap,
    html[dir="rtl"] .premium-table-wrap {
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    html[dir="rtl"] .header-search-submit {
        min-width: 54px;
        min-height: 30px;
        border-radius: 999px;
    }

    html[dir="rtl"] .header-notification-panel {
        position: fixed;
        inset-inline: 10px;
        inset-block-start: calc(76px + env(safe-area-inset-top, 0px));
        inline-size: auto;
        max-block-size: min(62vh, 520px);
        overflow: auto;
        border-radius: 20px;
    }

    html[dir="rtl"] .page,
    html[dir="rtl"] .workspace-main,
    html[dir="rtl"] .workspace-side,
    html[dir="rtl"] .detail-layout > .stack-gap,
    html[dir="rtl"] .content-subgrid,
    html[dir="rtl"] .action-panels,
    html[dir="rtl"] .ranking-columns,
    html[dir="rtl"] .metric-grid,
    html[dir="rtl"] .grid-two {
        gap: 12px;
    }

    html[dir="rtl"] .screen-head,
    html[dir="rtl"] .card,
    html[dir="rtl"] .section-card,
    html[dir="rtl"] .summary-card,
    html[dir="rtl"] .metric-tile,
    html[dir="rtl"] .premium-kpi-card {
        border-radius: 20px;
    }

    html[dir="rtl"] .screen-head {
        padding: 16px;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(249, 243, 235, 0.92) 100%);
        box-shadow: 0 16px 34px rgba(29, 22, 16, 0.06);
    }

    html[dir="rtl"] .screen-head h1 {
        font-size: 30px;
        line-height: 1.12;
    }

    html[dir="rtl"] .screen-head p.muted {
        font-size: 12px;
        line-height: 1.4;
    }

    html[dir="rtl"] .screen-head-actions,
    html[dir="rtl"] .hero-status-cluster,
    html[dir="rtl"] .action-strip-metrics {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    html[dir="rtl"] .hero-stat-chip,
    html[dir="rtl"] .soft-chip,
    html[dir="rtl"] .summary-card,
    html[dir="rtl"] .action-metric,
    html[dir="rtl"] .executive-alert-item {
        min-width: 0;
    }

    html[dir="rtl"] .hero-stat-chip,
    html[dir="rtl"] .soft-chip {
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.94);
    }

    html[dir="rtl"] .summary-card strong,
    html[dir="rtl"] .hero-stat-chip strong {
        font-size: 24px;
    }

    html[dir="rtl"] .cases-hero,
    html[dir="rtl"] .detail-hero,
    html[dir="rtl"] .dashboard-hero {
        overflow: hidden;
    }

    html[dir="rtl"] .detail-hero .screen-head-actions,
    html[dir="rtl"] .cases-hero .screen-head-actions {
        inline-size: 100%;
        justify-content: stretch;
    }

    html[dir="rtl"] .detail-hero .screen-head-actions > *,
    html[dir="rtl"] .cases-hero .screen-head-actions > * {
        flex: 1 1 auto;
    }

    html[dir="rtl"] .action-strip,
    html[dir="rtl"] .executive-alert-bar {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    html[dir="rtl"] .action-strip-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    html[dir="rtl"] .action-strip-actions .button {
        width: 100%;
    }

    html[dir="rtl"] .kpi-value,
    html[dir="rtl"] .metric-value {
        font-size: 24px;
    }

    html[dir="rtl"] .premium-kpi-grid,
    html[dir="rtl"] .hero-summary-grid,
    html[dir="rtl"] .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html[dir="rtl"] .filter-toolbar,
    html[dir="rtl"] .premium-filter-toolbar,
    html[dir="rtl"] .quick-card-grid,
    html[dir="rtl"] .fact-grid,
    html[dir="rtl"] .info-grid {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .filter-toolbar label {
        padding: 10px;
    }

    html[dir="rtl"] .premium-create-card,
    html[dir="rtl"] .filter-card,
    html[dir="rtl"] .action-strip-card {
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 242, 235, 0.92) 100%);
    }

    html[dir="rtl"] .table-wrap.premium-table-wrap {
        padding: 0;
        border: none;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    html[dir="rtl"] .premium-data-table {
        display: block;
        min-width: 0;
    }

    html[dir="rtl"] .premium-data-table thead {
        display: none;
    }

    html[dir="rtl"] .premium-data-table tbody {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    html[dir="rtl"] .premium-data-table tr.data-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 12px;
        padding: 14px;
        border-radius: 20px;
        border: 1px solid rgba(111, 93, 72, 0.1);
        background: rgba(255, 255, 255, 0.88);
        box-shadow: 0 10px 24px rgba(31, 23, 17, 0.07);
        transition: transform 160ms ease, box-shadow 160ms ease;
    }

    html[dir="rtl"] .premium-data-table tr.data-row:active {
        transform: scale(0.992);
        box-shadow: 0 8px 18px rgba(31, 23, 17, 0.06);
    }

    html[dir="rtl"] .premium-data-table tr.data-row > td {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        min-width: 0;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    html[dir="rtl"] .premium-data-table tr.data-row > td::before {
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--ui-text-soft);
    }

    html[dir="rtl"] .premium-data-table tr.data-row > td:nth-child(1)::before { content: "תיק"; }
    html[dir="rtl"] .premium-data-table tr.data-row > td:nth-child(2)::before { content: "לקוח"; }
    html[dir="rtl"] .premium-data-table tr.data-row > td:nth-child(3)::before { content: "סטטוס"; }
    html[dir="rtl"] .premium-data-table tr.data-row > td:nth-child(4)::before { content: "Owner"; }
    html[dir="rtl"] .premium-data-table tr.data-row > td:nth-child(5)::before { content: "מעצב"; }
    html[dir="rtl"] .premium-data-table tr.data-row > td:nth-child(6)::before { content: "מפרק"; }
    html[dir="rtl"] .premium-data-table tr.data-row > td:nth-child(7)::before { content: "אספקה"; }
    html[dir="rtl"] .premium-data-table tr.data-row > td:nth-child(8)::before { content: "פעולות"; }

    html[dir="rtl"] .premium-data-table tr.data-row > td:nth-child(8) {
        grid-column: 1 / -1;
    }

    html[dir="rtl"] .premium-data-table .row-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    html[dir="rtl"] .premium-data-table .row-actions form,
    html[dir="rtl"] .premium-data-table .row-actions .inline-form {
        width: 100%;
    }

    html[dir="rtl"] .premium-data-table .row-actions select {
        width: 100%;
    }

    html[dir="rtl"] .case-name-trigger,
    html[dir="rtl"] .table-primary-link {
        font-size: 16px;
    }

    html[dir="rtl"] .quick-card-row td {
        padding: 0 !important;
    }

    html[dir="rtl"] .quick-card-row.is-open td {
        padding-block-start: 4px !important;
    }

    html[dir="rtl"] .quick-card-row.is-open .quick-card-panel {
        padding: 16px;
        border-radius: 20px;
        box-shadow: 0 12px 28px rgba(31, 23, 17, 0.07);
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 241, 233, 0.94) 100%);
    }

    html[dir="rtl"] .quick-chat-feed {
        max-block-size: 220px;
    }

    html[dir="rtl"] .quick-card-head .button,
    html[dir="rtl"] .quick-subsection .button,
    html[dir="rtl"] .quick-chat-block .button,
    html[dir="rtl"] .quick-files-block .button {
        width: 100%;
        justify-content: center;
    }

    html[dir="rtl"] .workspace-side {
        display: none;
    }

    html[dir="rtl"] .side-panel {
        border-radius: 20px;
    }

    html[dir="rtl"] .app-sidebar {
        position: fixed;
        inset-inline: 10px;
        inset-block-end: calc(8px + env(safe-area-inset-bottom, 0px));
        inset-block-start: auto;
        z-index: 45;
        min-height: auto;
        max-height: none;
        flex: none;
        padding: 10px;
        border-radius: 24px;
        background: rgba(23, 20, 17, 0.96);
        box-shadow: 0 18px 40px rgba(16, 12, 9, 0.32);
        backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.06);
    }

    html[dir="rtl"] .sidebar-brand,
    html[dir="rtl"] .sidebar-section-label,
    html[dir="rtl"] .sidebar-footer {
        display: none;
    }

    html[dir="rtl"] .sidebar-nav {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    html[dir="rtl"] .sidebar-link {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 6px;
        min-height: 62px;
        padding: 9px 6px;
        text-align: center;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.02);
        transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
    }

    html[dir="rtl"] .sidebar-link.is-active {
        transform: translateY(-2px);
        background: linear-gradient(180deg, rgba(184, 132, 73, 0.24) 0%, rgba(184, 132, 73, 0.12) 100%);
        box-shadow: 0 10px 18px rgba(184, 132, 73, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    }

    html[dir="rtl"] .sidebar-link:active {
        transform: scale(0.98);
    }

    html[dir="rtl"] .sidebar-link-copy {
        align-items: center;
        text-align: center;
    }

    html[dir="rtl"] .sidebar-link-copy strong {
        font-size: 11px;
        line-height: 1.15;
    }

    html[dir="rtl"] .sidebar-link-copy small {
        display: none;
    }

    html[dir="rtl"] .sidebar-link-icon {
        width: 18px;
        height: 18px;
        min-width: 18px;
    }

    html[dir="rtl"] .sidebar-link-badge {
        position: absolute;
        inset-inline-start: 6px;
        inset-block-start: 6px;
        min-width: 18px;
        height: 18px;
        font-size: 10px;
    }

    html[dir="rtl"] .auth-page {
        padding: 12px;
        min-height: 100dvh;
        background:
            radial-gradient(circle at 50% 0%, rgba(184, 132, 73, 0.12), transparent 28%),
            linear-gradient(180deg, #fbf8f3 0%, #f0e8de 100%);
    }

    html[dir="rtl"] .auth-shell {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    html[dir="rtl"] .auth-brand-panel {
        min-height: auto;
        padding: 20px;
        border-radius: 24px;
        box-shadow: 0 18px 40px rgba(24, 18, 13, 0.16);
        padding-block-end: 26px;
    }

    html[dir="rtl"] .premium-auth-card {
        flex: 1 1 auto;
        padding: 20px;
        border-radius: 24px;
        box-shadow: 0 18px 36px rgba(24, 18, 13, 0.08);
        margin-block-start: -10px;
        position: relative;
        z-index: 2;
    }

    html[dir="rtl"] .auth-brand-inner {
        gap: 10px;
    }

    html[dir="rtl"] .auth-brand-panel h1 {
        font-size: 26px;
        line-height: 1.12;
    }

    html[dir="rtl"] .auth-feature-list {
        margin-block-start: 6px;
        gap: 8px;
    }

    html[dir="rtl"] .auth-feature {
        padding: 12px 14px;
        border-radius: 18px;
    }

    html[dir="rtl"] .auth-card-head {
        margin-block-end: 14px;
    }

    html[dir="rtl"] .auth-demo-panel,
    html[dir="rtl"] .auth-support-panel {
        border-radius: 18px;
    }
}

@media (max-width: 520px) {
    html[dir="rtl"] .premium-kpi-grid,
    html[dir="rtl"] .hero-summary-grid,
    html[dir="rtl"] .kpi-grid {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .header-meta {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    html[dir="rtl"] .header-user-chip,
    html[dir="rtl"] .header-notification-chip {
        justify-content: center;
    }

    html[dir="rtl"] .header-user-role {
        display: none;
    }

    html[dir="rtl"] .header-user-chip {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    html[dir="rtl"] .screen-head {
        padding: 14px;
    }

    html[dir="rtl"] .screen-head h1 {
        font-size: 26px;
    }

    html[dir="rtl"] .screen-head .eyebrow {
        font-size: 10px;
    }

    html[dir="rtl"] .hero-stat-chip,
    html[dir="rtl"] .soft-chip,
    html[dir="rtl"] .summary-card,
    html[dir="rtl"] .action-metric,
    html[dir="rtl"] .executive-alert-item {
        width: 100%;
    }

    html[dir="rtl"] .summary-card {
        min-height: 0;
        padding: 14px;
    }

    html[dir="rtl"] .summary-card strong {
        font-size: 22px;
    }

    html[dir="rtl"] .action-strip-actions {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .app-sidebar {
        inset-inline: 8px;
        padding: 8px;
        border-radius: 22px;
    }

    html[dir="rtl"] .sidebar-nav {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }

    html[dir="rtl"] .sidebar-link {
        min-height: 52px;
        padding: 7px 4px;
        border-radius: 16px;
    }

    html[dir="rtl"] .sidebar-link-copy strong {
        font-size: 10px;
    }

    html[dir="rtl"] .auth-page {
        padding: 10px;
    }

    html[dir="rtl"] .auth-brand-panel {
        padding: 18px;
        padding-block-end: 22px;
    }

    html[dir="rtl"] .auth-brand-panel h1 {
        font-size: 24px;
    }

    html[dir="rtl"] .auth-feature-list {
        gap: 6px;
    }

    html[dir="rtl"] .auth-feature:last-child {
        display: none;
    }

    html[dir="rtl"] .premium-auth-card {
        padding: 18px;
        margin-block-start: -14px;
    }

    html[dir="rtl"] .premium-data-table tr.data-row {
        grid-template-columns: 1fr;
        padding: 12px;
        gap: 8px;
    }

    html[dir="rtl"] .premium-data-table tr.data-row > td:nth-child(8) {
        grid-column: auto;
    }
}

/* Stage 2 shell refinement: light sidebar, clean header, unified premium shell */
html[dir="rtl"] {
    --shell-sidebar-width: 284px;
    --shell-header-height: 78px;
}

html[dir="rtl"] body.app-shell-active {
    background:
        radial-gradient(circle at 50% 0%, rgba(184, 132, 73, 0.08), transparent 22%),
        linear-gradient(180deg, #f8f4ee 0%, #f4efe7 100%);
}

html[dir="rtl"] .app-shell {
    direction: rtl;
    grid-template-columns: var(--shell-sidebar-width) minmax(0, 1fr);
    gap: var(--ds-space-5);
    align-items: start;
    padding: var(--ds-space-4);
}

html[dir="rtl"] .app-sidebar {
    position: sticky;
    top: var(--ds-space-4);
    min-height: calc(100dvh - (var(--ds-space-4) * 2));
    padding: 22px 18px 18px;
    border-radius: 30px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 245, 239, 0.98) 100%);
    border: 1px solid rgba(161, 137, 106, 0.16);
    box-shadow: 0 18px 42px rgba(93, 76, 56, 0.08);
    color: var(--ds-text);
}

html[dir="rtl"] .sidebar-brand {
    padding-bottom: var(--ds-space-5);
    margin-bottom: var(--ds-space-4);
    border-bottom: 1px solid var(--ds-line);
}

html[dir="rtl"] .brand-logo {
    gap: 10px;
    color: var(--ds-text);
}

html[dir="rtl"] .brand-emblem {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(180deg, #1f1a16 0%, #2a231d 100%);
    color: #fff;
    box-shadow: 0 10px 18px rgba(31, 26, 22, 0.16);
}

html[dir="rtl"] .brand-mark {
    color: #1f1a16;
    font-size: 32px;
    letter-spacing: -0.04em;
}

html[dir="rtl"] .brand-tagline,
html[dir="rtl"] .sidebar-section-label,
html[dir="rtl"] .sidebar-system-label,
html[dir="rtl"] .sidebar-link-copy small,
html[dir="rtl"] .header-system-copy,
html[dir="rtl"] .header-user-role {
    color: var(--ds-text-muted);
}

html[dir="rtl"] .sidebar-section-label {
    margin-bottom: var(--ds-space-3);
    font-size: 11px;
    letter-spacing: 0.14em;
}

html[dir="rtl"] .sidebar-nav {
    gap: 10px;
}

html[dir="rtl"] .sidebar-link,
html[dir="rtl"] .sidebar-link.is-disabled {
    position: relative;
    min-height: 72px;
    padding: 14px 16px;
    border-radius: 22px;
    background: transparent;
    border: 1px solid rgba(161, 137, 106, 0.14);
    box-shadow: none;
}

html[dir="rtl"] .sidebar-link:hover {
    border-color: rgba(184, 132, 73, 0.24);
    background: rgba(184, 132, 73, 0.06);
    transform: translateY(-1px);
}

html[dir="rtl"] .sidebar-link.is-active {
    background:
        linear-gradient(180deg, rgba(184, 132, 73, 0.16) 0%, rgba(184, 132, 73, 0.08) 100%);
    border-color: rgba(184, 132, 73, 0.34);
    box-shadow: inset 0 0 0 1px rgba(184, 132, 73, 0.08);
}

html[dir="rtl"] .sidebar-link.is-active::before {
    content: "";
    position: absolute;
    inset-inline-start: 12px;
    inset-block: 14px;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--ds-brand) 0%, var(--ds-brand-deep) 100%);
}

html[dir="rtl"] .sidebar-link-copy strong,
html[dir="rtl"] .header-system-title,
html[dir="rtl"] .header-user-name {
    color: var(--ds-text);
}

html[dir="rtl"] .sidebar-link-icon {
    border-radius: 14px;
    background: rgba(184, 132, 73, 0.08);
    color: var(--ds-brand-deep);
}

html[dir="rtl"] .sidebar-link-badge {
    background: linear-gradient(180deg, var(--ds-brand) 0%, var(--ds-brand-deep) 100%);
    color: #fff;
    box-shadow: 0 8px 18px rgba(184, 132, 73, 0.22);
}

html[dir="rtl"] .sidebar-user-card {
    background: rgba(184, 132, 73, 0.06);
    border: 1px solid rgba(184, 132, 73, 0.16);
}

html[dir="rtl"] .sidebar-user-avatar {
    background: linear-gradient(180deg, var(--ds-brand) 0%, var(--ds-brand-deep) 100%);
    color: #fff;
    box-shadow: 0 10px 18px rgba(184, 132, 73, 0.2);
}

html[dir="rtl"] .sidebar-logout {
    width: 100%;
    justify-content: center;
    background: #1f1a16;
    color: #fff;
    border-color: #1f1a16;
}

html[dir="rtl"] .sidebar-logout:hover {
    background: #2a231d;
    border-color: #2a231d;
}

html[dir="rtl"] .app-main {
    min-width: 0;
}

html[dir="rtl"] .app-header {
    position: sticky;
    top: var(--ds-space-4);
    z-index: 15;
    min-height: var(--shell-header-height);
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr) minmax(0, 340px);
    gap: var(--ds-space-4);
    padding: 16px 22px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(161, 137, 106, 0.14);
    box-shadow: 0 16px 34px rgba(93, 76, 56, 0.08);
    backdrop-filter: blur(18px);
}

html[dir="rtl"] .header-system-chip,
html[dir="rtl"] .header-user-chip,
html[dir="rtl"] .header-notification-chip,
html[dir="rtl"] .header-search {
    background: rgba(248, 244, 238, 0.92);
    border: 1px solid rgba(161, 137, 106, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

html[dir="rtl"] .header-search {
    min-height: 52px;
}

html[dir="rtl"] .header-search input {
    color: var(--ds-text);
}

html[dir="rtl"] .header-search input::placeholder {
    color: var(--ds-text-muted);
}

html[dir="rtl"] .header-search-icon,
html[dir="rtl"] .header-notification-icon {
    color: var(--ds-brand-deep);
}

html[dir="rtl"] .header-notification-panel {
    border-radius: 24px;
    border: 1px solid rgba(161, 137, 106, 0.14);
    box-shadow: 0 20px 36px rgba(93, 76, 56, 0.1);
}

html[dir="rtl"] .page {
    padding-top: var(--ds-space-4);
}

html[dir="rtl"] .section-card,
html[dir="rtl"] .summary-card,
html[dir="rtl"] .notification-card,
html[dir="rtl"] .premium-kpi-card,
html[dir="rtl"] .premium-filter-card,
html[dir="rtl"] .premium-table-card,
html[dir="rtl"] .action-strip-card,
html[dir="rtl"] .side-panel,
html[dir="rtl"] .quick-card-panel,
html[dir="rtl"] .nested-section-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(251, 248, 243, 0.98) 100%);
    border: 1px solid rgba(161, 137, 106, 0.14);
    box-shadow: 0 18px 32px rgba(93, 76, 56, 0.06);
}

html[dir="rtl"] .page-hero {
    padding: 28px 30px;
}

html[dir="rtl"] .page-hero h1,
html[dir="rtl"] .screen-head h1 {
    color: var(--ds-text);
}

html[dir="rtl"] .page-hero-copy,
html[dir="rtl"] .screen-head p,
html[dir="rtl"] .section-card > p,
html[dir="rtl"] .notification-card p,
html[dir="rtl"] .workspace-side p {
    color: var(--ds-text-soft);
}

html[dir="rtl"] .button.primary {
    background: linear-gradient(180deg, var(--ds-brand) 0%, var(--ds-brand-deep) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 12px 20px rgba(184, 132, 73, 0.18);
}

html[dir="rtl"] .button.secondary {
    background: rgba(184, 132, 73, 0.08);
    border-color: rgba(184, 132, 73, 0.18);
    color: var(--ds-brand-deep);
}

html[dir="rtl"] .button.ghost {
    color: var(--ds-text-soft);
}

@media (max-width: 1100px) {
    html[dir="rtl"] .app-shell {
        grid-template-columns: 1fr;
        padding-inline: var(--ds-space-3);
    }

    html[dir="rtl"] .app-sidebar {
        position: static;
        min-height: auto;
        order: 2;
    }

    html[dir="rtl"] .app-header {
        grid-template-columns: 1fr;
    }
}

/* Cases workspace redesign */
html[dir="rtl"] .cases-workspace-layout {
    grid-template-columns: minmax(0, 1fr) 302px;
    align-items: start;
    direction: ltr;
}

html[dir="rtl"] .cases-side-rail {
    position: sticky;
    top: calc(var(--shell-header-height) + var(--ds-space-6));
    display: grid;
    gap: var(--ds-space-4);
    direction: rtl;
}

html[dir="rtl"] .cases-side-rail .cases-alert-panel {
    order: 1;
}

html[dir="rtl"] .cases-side-rail .cases-insight-panel {
    order: 2;
}

html[dir="rtl"] .cases-side-rail .ai-alerts-panel {
    order: 3;
}

html[dir="rtl"] .cases-workspace-layout > .workspace-main {
    direction: rtl;
}

html[dir="rtl"] .new-case-layout {
    display: flex;
    align-items: flex-start;
    gap: var(--ds-space-5);
}

html[dir="rtl"] .new-case-form-card {
    flex: 1 1 auto;
}

html[dir="rtl"] .new-case-side-rail {
    flex: 0 0 300px;
    min-width: 280px;
    position: sticky;
    top: calc(var(--shell-header-height) + var(--ds-space-6));
    display: flex;
    flex-direction: column;
    gap: var(--ds-space-4);
}

html[dir="rtl"] .empty-state-card {
    padding: 22px;
    border: 1px dashed rgba(161, 137, 106, 0.26);
    border-radius: 22px;
    background: rgba(248, 244, 238, 0.62);
}

html[dir="rtl"] .empty-state-card strong {
    display: block;
    margin-bottom: 8px;
    color: var(--ds-text);
}

@media (max-width: 1180px) {
    html[dir="rtl"] .new-case-layout {
        flex-direction: column;
    }

    html[dir="rtl"] .new-case-side-rail {
        position: static;
        min-width: 0;
        width: 100%;
    }
}

html[dir="rtl"] .cases-side-metrics {
    display: grid;
    gap: 12px;
}

html[dir="rtl"] .cases-side-metrics-grid {
    display: grid;
    gap: 12px;
}

html[dir="rtl"] .cases-side-metric-tile {
    width: 100%;
    min-width: 0;
    align-items: flex-start;
    justify-items: start;
    text-align: right;
    padding: 16px 18px;
    border-radius: 22px;
}

html[dir="rtl"] .cases-side-metric-tile > span {
    font-size: 13px;
    line-height: 1.5;
}

html[dir="rtl"] .cases-side-metric-tile strong {
    font-size: 2rem;
    line-height: 1;
}

html[dir="rtl"] .ai-alerts-panel {
    display: grid;
    gap: 14px;
}

html[dir="rtl"] .ai-alerts-head {
    align-items: start;
}

html[dir="rtl"] .ai-alerts-head .muted {
    margin-top: 4px;
}

html[dir="rtl"] .ai-alerts-head-badge-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

html[dir="rtl"] .ai-alert-bell {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(184, 132, 73, 0.10);
    border: 1px solid rgba(184, 132, 73, 0.14);
    font-size: 16px;
}

html[dir="rtl"] .ai-alert-critical-badge {
    min-width: 44px;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px 10px;
}

html[dir="rtl"] .ai-alerts-summary {
    margin: 0;
    color: var(--ui-text-soft);
    font-size: 13px;
}

html[dir="rtl"] .ai-alerts-list {
    display: grid;
    gap: 10px;
}

html[dir="rtl"] .ai-alert-item {
    display: grid;
    gap: 8px;
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 244, 236, 0.88) 100%);
    border: 1px solid rgba(184, 132, 73, 0.12);
    box-shadow: 0 10px 24px rgba(60, 44, 27, 0.05);
}

html[dir="rtl"] .ai-alert-item-critical {
    border-inline-start: 4px solid rgba(203, 87, 62, 0.95);
}

html[dir="rtl"] .ai-alert-item-warning {
    border-inline-start: 4px solid rgba(215, 143, 54, 0.95);
}

html[dir="rtl"] .ai-alert-item-info {
    border-inline-start: 4px solid rgba(94, 128, 196, 0.9);
}

html[dir="rtl"] .ai-alert-item-head,
html[dir="rtl"] .ai-alert-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

html[dir="rtl"] .ai-alert-level {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

html[dir="rtl"] .ai-alert-level-critical {
    color: #9a3a2a;
    background: rgba(203, 87, 62, 0.12);
}

html[dir="rtl"] .ai-alert-level-warning {
    color: #9b6521;
    background: rgba(215, 143, 54, 0.14);
}

html[dir="rtl"] .ai-alert-level-info {
    color: #375a9c;
    background: rgba(94, 128, 196, 0.12);
}

html[dir="rtl"] .ai-alert-copy strong {
    display: block;
    font-size: 14px;
    color: var(--ui-text);
}

html[dir="rtl"] .ai-alert-copy p {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--ui-text-soft);
}

html[dir="rtl"] .metric-card-inline {
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(249, 244, 236, 0.82) 100%);
}

html[dir="rtl"] .metric-card-inline strong {
    display: block;
    margin-bottom: 6px;
    color: var(--ds-text);
}

html[dir="rtl"] .metric-card-inline p {
    margin: 0;
    color: var(--ds-text-soft);
}

html[dir="rtl"] .cases-hero-refined {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--ds-space-4);
    align-items: start;
}

html[dir="rtl"] .cases-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    align-content: flex-start;
    max-width: 920px;
}

html[dir="rtl"] .cases-hero-refined {
    align-items: start;
    gap: 18px;
}

html[dir="rtl"] .cases-hero-copy-card {
    margin-bottom: 0;
}

html[dir="rtl"] .cases-action-center {
    margin: 18px 0 26px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

html[dir="rtl"] .cases-action-center-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin: 0 auto;
}

html[dir="rtl"] .cases-action-center .hero-stat-chip {
    min-width: 150px;
    padding: 12px 18px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(252, 248, 241, 0.98) 0%, rgba(247, 239, 229, 0.9) 100%);
    border: 1px solid rgba(184, 132, 73, 0.16);
    box-shadow: 0 10px 24px rgba(44, 31, 20, 0.04);
}

html[dir="rtl"] .cases-action-center .hero-stat-chip > span {
    font-size: 12px;
    font-weight: 700;
}

html[dir="rtl"] .cases-action-center .hero-stat-chip strong {
    font-size: 1.7rem;
    line-height: 1;
}

html[dir="rtl"] .cases-action-center .hero-stat-chip-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(44, 31, 20, 0.08);
    border-color: rgba(184, 132, 73, 0.24);
}

html[dir="rtl"] .cases-action-center .hero-stat-chip-link.is-active {
    background: linear-gradient(180deg, rgba(255, 250, 243, 0.99) 0%, rgba(247, 236, 219, 0.96) 100%);
    border-color: rgba(184, 132, 73, 0.28);
}

html[dir="rtl"] .cases-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--ds-space-4);
    margin-bottom: var(--ds-space-4);
}

html[dir="rtl"] .cases-kpi-card {
    padding: 18px 20px;
    border-radius: 24px;
    display: grid;
    gap: 10px;
}

html[dir="rtl"] .cases-kpi-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--ds-text-soft);
    font-size: var(--ds-font-size-sm);
}

html[dir="rtl"] .cases-kpi-card strong {
    font-size: 32px;
    line-height: 1;
    color: var(--ds-text);
}

html[dir="rtl"] .cases-kpi-card small {
    color: var(--ds-text-muted);
}

html[dir="rtl"] .cases-kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(184, 132, 73, 0.08);
    box-shadow: inset 0 0 0 1px rgba(184, 132, 73, 0.14);
}

html[dir="rtl"] .cases-kpi-icon.is-brand::before { content: "⬇"; }
html[dir="rtl"] .cases-kpi-icon.is-warning::before { content: "✓"; }
html[dir="rtl"] .cases-kpi-icon.is-info::before { content: "◔"; }
html[dir="rtl"] .cases-kpi-icon.is-success::before { content: "★"; }

html[dir="rtl"] .cases-action-strip .action-strip {
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
    align-items: center;
}

html[dir="rtl"] .cases-filter-card .section-head,
html[dir="rtl"] .cases-table-head,
html[dir="rtl"] .cases-preview-hub .section-head {
    margin-bottom: var(--ds-space-4);
}

html[dir="rtl"] .cases-filter-toolbar {
    grid-template-columns: minmax(0, 1.2fr) repeat(5, minmax(0, 1fr));
    align-items: end;
}

html[dir="rtl"] .filter-search-control {
    grid-column: span 2;
}

html[dir="rtl"] .cases-table-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

html[dir="rtl"] .cases-table .data-row {
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

html[dir="rtl"] .cases-table .data-row:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(93, 76, 56, 0.08);
}

html[dir="rtl"] .cases-table .data-row.is-selected {
    background: linear-gradient(180deg, rgba(184, 132, 73, 0.1) 0%, rgba(184, 132, 73, 0.05) 100%);
    box-shadow: 0 18px 28px rgba(184, 132, 73, 0.08);
}

html[dir="rtl"] .case-select-trigger {
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--ds-text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

html[dir="rtl"] .case-select-trigger.is-active,
html[dir="rtl"] .case-select-trigger:hover {
    color: var(--ds-brand-deep);
}

html[dir="rtl"] .case-inline-preview-row {
    display: none;
}

html[dir="rtl"] .case-inline-preview-row.is-open {
    display: table-row;
}

html[dir="rtl"] .case-inline-preview-row > td {
    padding: 0 14px;
    border: 0;
    background: linear-gradient(180deg, rgba(250, 246, 238, 0.72), rgba(255, 252, 247, 0.28));
}

html[dir="rtl"] .case-inline-preview-panel {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-6px);
    transition: max-height 220ms ease, opacity 180ms ease, transform 180ms ease, padding 180ms ease;
    padding: 0;
    pointer-events: none;
}

html[dir="rtl"] .case-inline-preview-row.is-open .case-inline-preview-panel {
    max-height: none;
    opacity: 1;
    overflow: visible;
    transform: translateY(0);
    padding: 10px 0 22px;
    pointer-events: auto;
}

html[dir="rtl"] .case-inline-preview-card {
    display: grid;
    grid-template-columns: minmax(190px, 242px) minmax(0, 1fr) minmax(154px, 178px);
    grid-template-areas: "visual summary actions";
    direction: ltr;
    gap: 14px;
    align-items: stretch;
    min-height: 172px;
    padding: 12px 12px 16px;
    border: 1px solid rgba(155, 116, 64, 0.18);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(251, 247, 239, 0.94)),
        var(--ds-surface);
    box-shadow: 0 16px 34px rgba(81, 65, 44, 0.08);
}

html[dir="rtl"] .case-inline-preview-visual {
    grid-area: visual;
    direction: rtl;
    min-width: 0;
}

html[dir="rtl"] .case-inline-preview-visual img,
html[dir="rtl"] .case-inline-preview-placeholder {
    width: 100%;
    height: 148px;
    border-radius: 14px;
    border: 1px solid rgba(155, 116, 64, 0.16);
    background: #fbf7ef;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.62);
}

html[dir="rtl"] .case-inline-preview-visual img {
    display: block;
    object-fit: cover;
}

html[dir="rtl"] .case-inline-preview-placeholder {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    color: var(--ds-text-muted);
    text-align: center;
    font-size: var(--ds-font-size-sm);
}

html[dir="rtl"] .case-inline-preview-placeholder-icon {
    position: relative;
    width: 38px;
    height: 32px;
    border-radius: 9px;
    border: 1px solid rgba(155, 116, 64, 0.32);
    background: rgba(184, 132, 73, 0.08);
}

html[dir="rtl"] .case-inline-preview-placeholder-icon::before {
    content: "";
    position: absolute;
    inset-inline-start: 8px;
    bottom: 7px;
    width: 20px;
    height: 10px;
    border-radius: 8px 8px 3px 3px;
    background: rgba(155, 116, 64, 0.28);
}

html[dir="rtl"] .case-inline-preview-placeholder-icon::after {
    content: "";
    position: absolute;
    inset-inline-end: 8px;
    top: 7px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: rgba(155, 116, 64, 0.36);
}

html[dir="rtl"] .case-inline-preview-summary {
    grid-area: summary;
    direction: rtl;
    min-width: 0;
    display: grid;
    gap: 10px;
    align-content: start;
}

html[dir="rtl"] .case-inline-preview-titlebar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

html[dir="rtl"] .case-inline-preview-title h3 {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 2px 0 0;
    color: var(--ds-text);
    font-size: 18px;
    line-height: 1.25;
    letter-spacing: 0;
}

html[dir="rtl"] .case-inline-preview-title h3 span {
    font-size: 13px;
    color: var(--ds-brand-deep);
}

html[dir="rtl"] .case-inline-preview-title h3 strong {
    overflow-wrap: anywhere;
}

html[dir="rtl"] .case-inline-preview-badges {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

html[dir="rtl"] .case-progress-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    color: var(--ds-brand-deep);
    background: rgba(184, 132, 73, 0.11);
    border: 1px solid rgba(184, 132, 73, 0.18);
    font-weight: 800;
    font-size: var(--ds-font-size-sm);
}

html[dir="rtl"] .case-inline-preview-stage {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(31, 26, 22, 0.06);
}

html[dir="rtl"] .case-inline-preview-stage span,
html[dir="rtl"] .case-inline-preview-facts dt {
    color: var(--ds-text-muted);
    font-size: var(--ds-font-size-xs);
    font-weight: 700;
}

html[dir="rtl"] .case-inline-preview-stage strong {
    color: var(--ds-text);
    font-size: var(--ds-font-size-sm);
}

html[dir="rtl"] .case-inline-preview-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

html[dir="rtl"] .case-inline-preview-facts div {
    min-width: 0;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(31, 26, 22, 0.055);
}

html[dir="rtl"] .case-inline-preview-facts dd {
    margin: 3px 0 0;
    color: var(--ds-text);
    font-weight: 800;
    font-size: var(--ds-font-size-sm);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[dir="rtl"] .case-inline-preview-alert {
    width: fit-content;
    max-width: 100%;
    margin-bottom: 2px;
    padding: 6px 10px;
    border-radius: 999px;
    color: #8b4b27;
    background: rgba(203, 117, 61, 0.1);
    border: 1px solid rgba(203, 117, 61, 0.18);
    font-size: var(--ds-font-size-xs);
    font-weight: 800;
    line-height: 1.45;
}

html[dir="rtl"] .case-inline-preview-actions {
    grid-area: actions;
    direction: rtl;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    min-width: 0;
}

html[dir="rtl"] .case-inline-preview-actions .button {
    width: 100%;
}

html[dir="rtl"] .case-inline-preview-file-count {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    color: var(--ds-text-muted);
    background: rgba(31, 26, 22, 0.045);
    font-size: var(--ds-font-size-xs);
    font-weight: 700;
}

@media (max-width: 980px) {
    html[dir="rtl"] .case-inline-preview-row.is-open .case-inline-preview-panel {
        max-height: none;
    }

    html[dir="rtl"] .case-inline-preview-card {
        grid-template-columns: 1fr;
        grid-template-areas:
            "visual"
            "summary"
            "actions";
        min-height: 0;
    }

    html[dir="rtl"] .case-inline-preview-visual img,
    html[dir="rtl"] .case-inline-preview-placeholder {
        height: 176px;
    }

    html[dir="rtl"] .case-inline-preview-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    html[dir="rtl"] .case-inline-preview-actions .button,
    html[dir="rtl"] .case-inline-preview-file-count {
        width: auto;
        flex: 1 1 150px;
    }
}

@media (max-width: 1180px) {
    html[dir="rtl"] .case-inline-preview-facts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    html[dir="rtl"] .case-inline-preview-row > td {
        padding: 0 8px;
    }

    html[dir="rtl"] .case-inline-preview-card {
        padding: 10px;
        border-radius: 14px;
    }

    html[dir="rtl"] .case-inline-preview-titlebar {
        display: grid;
        gap: 8px;
    }

    html[dir="rtl"] .case-inline-preview-title h3 {
        display: grid;
        gap: 3px;
        font-size: 16px;
    }

    html[dir="rtl"] .case-inline-preview-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

html[dir="rtl"] .status-cell-stack {
    display: grid;
    gap: 6px;
}

html[dir="rtl"] .table-inline-note {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: var(--ds-font-size-xs);
    color: var(--ds-text-soft);
    background: rgba(31, 26, 22, 0.05);
}

html[dir="rtl"] .table-inline-note.is-warning {
    background: var(--ds-warning-soft);
    color: #9b640d;
}

html[dir="rtl"] .cases-preview-hub {
    margin-top: var(--ds-space-4);
    padding: 26px 28px;
}

html[dir="rtl"] .cases-preview-empty {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 48px 20px;
    text-align: center;
}

html[dir="rtl"] .cases-preview-empty.is-hidden {
    display: none;
}

html[dir="rtl"] .cases-preview-empty-illustration {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    background:
        radial-gradient(circle at 30% 30%, rgba(184, 132, 73, 0.22), transparent 52%),
        linear-gradient(180deg, rgba(184, 132, 73, 0.12) 0%, rgba(184, 132, 73, 0.06) 100%);
    border: 1px solid rgba(184, 132, 73, 0.14);
}

html[dir="rtl"] .case-preview-card {
    display: none;
    gap: var(--ds-space-4);
}

html[dir="rtl"] .case-preview-card.is-open {
    display: grid;
}

html[dir="rtl"] body.preview-modal-open {
    overflow: hidden;
}

html[dir="rtl"] .case-preview-modal-layer[hidden] {
    display: none !important;
}

html[dir="rtl"] .case-preview-modal-layer {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: grid;
    place-items: center;
    padding: 24px;
}

html[dir="rtl"] .case-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(246, 241, 233, 0.72);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
}

html[dir="rtl"] .case-preview-modal {
    position: relative;
    z-index: 1;
    width: min(94vw, 1520px);
    max-height: 90vh;
    overflow: hidden;
    display: none;
}

html[dir="rtl"] .case-preview-modal.is-open {
    display: block;
}

html[dir="rtl"] .case-preview-shell {
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    border-radius: 32px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(248, 242, 233, 0.98) 100%);
    border: 1px solid rgba(161, 137, 106, 0.16);
    box-shadow: 0 28px 60px rgba(55, 39, 24, 0.16);
}

html[dir="rtl"] .case-preview-close {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(161, 137, 106, 0.22);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--ds-text);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

html[dir="rtl"] .case-preview-close:hover {
    transform: translateY(-1px);
    border-color: rgba(182, 138, 85, 0.34);
    box-shadow: 0 12px 22px rgba(55, 39, 24, 0.08);
}

html[dir="rtl"] .case-preview-footer {
    display: flex;
    justify-content: flex-start;
    padding-top: var(--ds-space-4);
    border-top: 1px solid var(--ds-line);
    margin-top: var(--ds-space-4);
}

html[dir="rtl"] .case-preview-header {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 2fr) minmax(0, 1fr);
    gap: 18px 24px;
    align-items: start;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--ds-line);
}

html[dir="rtl"] .case-preview-header-main {
    display: grid;
    gap: 10px;
}

html[dir="rtl"] .case-preview-title-row,
html[dir="rtl"] .case-preview-primary {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

html[dir="rtl"] .case-preview-id-block,
html[dir="rtl"] .case-preview-client-block,
html[dir="rtl"] .case-preview-meta-item {
    display: grid;
    gap: 6px;
}

html[dir="rtl"] .case-preview-meta-label,
html[dir="rtl"] .case-preview-meta-item span {
    font-size: 12px;
    color: var(--ds-text-muted);
}

html[dir="rtl"] .case-preview-case-number {
    font-size: clamp(2rem, 3vw, 2.6rem);
    line-height: 1;
    color: var(--ds-text);
}

html[dir="rtl"] .case-preview-client-block h3 {
    margin: 0;
    font-size: 1.65rem;
}

html[dir="rtl"] .case-preview-meta-bar {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid rgba(161, 137, 106, 0.12);
    border-radius: 20px;
    background: rgba(255, 253, 249, 0.72);
}

html[dir="rtl"] .case-preview-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

html[dir="rtl"] .case-preview-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

html[dir="rtl"] .preview-ui-only-button {
    min-width: 92px;
}

html[dir="rtl"] .case-preview-meta-item strong.is-warning {
    color: var(--ds-warning);
}

html[dir="rtl"] .case-preview-progress {
    padding-block: 22px 8px;
}

html[dir="rtl"] .case-preview-progress-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

html[dir="rtl"] .case-preview-progress-line {
    position: absolute;
    inset-inline: 48px;
    top: 18px;
    height: 2px;
    background: linear-gradient(90deg, rgba(111, 93, 72, 0.1) 0%, rgba(111, 93, 72, 0.24) 100%);
    z-index: 0;
}

html[dir="rtl"] .case-preview-progress-step {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 10px;
    text-align: center;
}

html[dir="rtl"] .case-preview-progress-step .step-dot {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1ebe2;
    border: 1px solid rgba(161, 137, 106, 0.18);
    color: var(--ds-text-muted);
    font-size: 13px;
    font-weight: 800;
}

html[dir="rtl"] .case-preview-progress-step .step-label {
    font-size: 12px;
    color: var(--ds-text-soft);
}

html[dir="rtl"] .case-preview-progress-step.is-complete .step-dot {
    background: #221d18;
    color: #fffaf4;
    border-color: #221d18;
}

html[dir="rtl"] .case-preview-progress-step.is-current .step-dot {
    background: linear-gradient(180deg, rgba(184, 132, 73, 0.94) 0%, rgba(155, 108, 52, 0.96) 100%);
    color: #fffaf2;
    border-color: rgba(184, 132, 73, 0.4);
    box-shadow: 0 10px 18px rgba(184, 132, 73, 0.18);
}

html[dir="rtl"] .case-preview-progress-step.is-current .step-label {
    color: var(--ds-brand-deep);
    font-weight: 700;
}

html[dir="rtl"] .case-preview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--ds-space-4);
}

html[dir="rtl"] .case-preview-grid-primary {
    grid-template-columns: 1.3fr 1.08fr;
    align-items: stretch;
}

html[dir="rtl"] .case-preview-grid-support {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
}

html[dir="rtl"] .case-preview-grid-secondary {
    grid-template-columns: 1.05fr 1fr 0.92fr 0.82fr;
    align-items: stretch;
}

html[dir="rtl"] .case-preview-block {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(161, 137, 106, 0.12);
    box-shadow: 0 16px 32px rgba(55, 39, 24, 0.05);
}

html[dir="rtl"] .case-preview-block-span-2 {
    grid-column: span 2;
}

html[dir="rtl"] .case-preview-block-critical {
    background: linear-gradient(180deg, rgba(255, 248, 242, 0.99) 0%, rgba(255, 244, 236, 0.97) 100%);
    border-color: rgba(209, 121, 82, 0.42);
    box-shadow: 0 24px 44px rgba(209, 140, 72, 0.14);
    min-height: 100%;
    position: relative;
    overflow: hidden;
}

html[dir="rtl"] .case-preview-block-critical::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 18px;
    bottom: 18px;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, #de8748 0%, #c76b62 100%);
}

html[dir="rtl"] .case-preview-block-critical .case-preview-card-icon {
    width: 46px;
    height: 46px;
    font-size: 22px;
    background: rgba(209, 140, 72, 0.2);
    border-color: rgba(209, 121, 82, 0.28);
}

html[dir="rtl"] .case-preview-attention-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(199, 107, 98, 0.12);
    color: #9f4f49;
    border: 1px solid rgba(199, 107, 98, 0.22);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

html[dir="rtl"] .case-preview-urgent-copy {
    color: #9b4d3a !important;
    font-weight: 700;
}

html[dir="rtl"] .section-head.compact {
    margin-bottom: 14px;
}

html[dir="rtl"] .case-preview-card-head {
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

html[dir="rtl"] .case-preview-card-head h4 {
    margin: 0;
    font-size: 1.08rem;
    letter-spacing: -0.01em;
}

html[dir="rtl"] .case-preview-card-head .muted {
    margin-top: 4px;
    line-height: 1.55;
    font-size: 12px;
    color: var(--ds-text-muted) !important;
}

html[dir="rtl"] .case-preview-card-title {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

html[dir="rtl"] .case-preview-card-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(184, 132, 73, 0.12);
    border: 1px solid rgba(161, 137, 106, 0.16);
    font-size: 16px;
    line-height: 1;
    flex: 0 0 auto;
}

html[dir="rtl"] .preview-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

html[dir="rtl"] .preview-mini-grid div {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(248, 244, 238, 0.88);
    border: 1px solid rgba(161, 137, 106, 0.1);
}

html[dir="rtl"] .preview-mini-grid strong,
html[dir="rtl"] .preview-list-item strong,
html[dir="rtl"] .insight-item strong,
html[dir="rtl"] .quick-action-tile strong {
    color: var(--ds-text);
}

html[dir="rtl"] .preview-mini-grid span,
html[dir="rtl"] .preview-list-item span,
html[dir="rtl"] .alert-item-card span,
html[dir="rtl"] .quick-action-tile span {
    color: var(--ds-text-muted);
}

html[dir="rtl"] .preview-history-list,
html[dir="rtl"] .preview-list,
html[dir="rtl"] .insight-list,
html[dir="rtl"] .alert-stack {
    display: grid;
    gap: 10px;
}

html[dir="rtl"] .preview-list-item,
html[dir="rtl"] .alert-item-card,
html[dir="rtl"] .quick-action-tile {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(248, 244, 238, 0.84);
    border: 1px solid rgba(161, 137, 106, 0.1);
}

html[dir="rtl"] .quick-action-tile {
    min-height: 108px;
    align-content: start;
    gap: 10px;
    padding: 14px 16px;
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(251, 247, 240, 0.96) 100%);
    border-color: rgba(176, 144, 104, 0.16);
    box-shadow: 0 10px 20px rgba(53, 38, 24, 0.04);
    cursor: pointer;
}

html[dir="rtl"] .quick-action-tile:hover {
    transform: translateY(-3px);
    background: rgba(255, 250, 243, 0.98);
    border-color: rgba(184, 132, 73, 0.28);
    box-shadow: 0 18px 28px rgba(55, 39, 24, 0.11);
}

html[dir="rtl"] .case-preview-card-actions-wrap {
    box-shadow: 0 20px 40px rgba(184, 132, 73, 0.1);
    border-color: rgba(184, 132, 73, 0.18);
}

html[dir="rtl"] .case-preview-card-actions-wrap .quick-action-tile {
    min-height: 116px;
}

html[dir="rtl"] .quick-action-tile-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(184, 132, 73, 0.12);
    border: 1px solid rgba(184, 132, 73, 0.18);
    color: var(--ds-brand-deep);
    font-size: 16px;
    font-weight: 900;
}

html[dir="rtl"] .quick-action-tile.is-primary {
    background: linear-gradient(180deg, rgba(255, 251, 245, 1) 0%, rgba(248, 240, 229, 0.98) 100%);
    border-color: rgba(184, 132, 73, 0.24);
    box-shadow: 0 16px 30px rgba(184, 132, 73, 0.12);
}

html[dir="rtl"] .quick-action-tile.is-primary strong {
    color: var(--ds-brand-deep);
}

html[dir="rtl"] .case-preview-next-action {
    display: grid;
    gap: 4px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(246, 236, 221, 0.72);
    border: 1px solid rgba(184, 132, 73, 0.16);
}

html[dir="rtl"] .case-preview-next-action strong {
    color: var(--ds-brand-deep);
    font-size: 15px;
    font-weight: 800;
}

html[dir="rtl"] .preview-list-item.static {
    cursor: default;
}

html[dir="rtl"] .preview-list-item.missing {
    background: rgba(255, 245, 235, 0.92);
    border-color: rgba(230, 155, 74, 0.18);
}

html[dir="rtl"] .preview-list-item.success {
    background: rgba(237, 247, 239, 0.92);
    border-color: rgba(98, 168, 111, 0.18);
}

html[dir="rtl"] .preview-empty-note {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(250, 248, 244, 0.92);
    border: 1px dashed rgba(161, 137, 106, 0.18);
}

html[dir="rtl"] .preview-empty-note strong {
    color: var(--ds-text);
}

html[dir="rtl"] .preview-empty-note span {
    color: var(--ds-text-muted);
}

html[dir="rtl"] .preview-stat-stack {
    display: grid;
    gap: 10px;
}

html[dir="rtl"] .preview-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(248, 244, 238, 0.72);
    border: 1px solid rgba(161, 137, 106, 0.1);
}

html[dir="rtl"] .preview-stat-row strong {
    color: var(--ds-text);
}

html[dir="rtl"] .preview-stat-row span {
    color: var(--ds-text-soft);
}

html[dir="rtl"] .spec-summary-card {
    display: grid;
    gap: 14px;
}

html[dir="rtl"] .spec-summary-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

html[dir="rtl"] .spec-summary-top strong {
    font-size: 30px;
    line-height: 1;
}

html[dir="rtl"] .spec-summary-progress,
html[dir="rtl"] .kpi-progress {
    height: 6px;
    border-radius: 999px;
    background: rgba(31, 26, 22, 0.08);
    overflow: hidden;
}

html[dir="rtl"] .spec-summary-progress span,
html[dir="rtl"] .kpi-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--ds-brand-deep) 0%, var(--ds-brand) 100%);
}

html[dir="rtl"] .compact-list .preview-list-item {
    padding-block: 10px;
}

html[dir="rtl"] .preview-card-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

html[dir="rtl"] .preview-emphasis-button {
    background: linear-gradient(180deg, #fff5ea 0%, #f9ead7 100%);
    color: #9b5d2b;
    border-color: rgba(209, 121, 82, 0.22);
    box-shadow: 0 10px 18px rgba(209, 140, 72, 0.1);
}

html[dir="rtl"] .preview-inline-action {
    margin: 0;
}

html[dir="rtl"] .preview-inline-action .quick-action-tile {
    width: 100%;
    text-align: start;
    border: 0;
    cursor: pointer;
}

html[dir="rtl"] .preview-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

html[dir="rtl"] .preview-actions-matrix {
    gap: 10px;
}

html[dir="rtl"] .preview-history-card {
    gap: 8px;
}

html[dir="rtl"] .case-preview-history-list {
    display: grid;
    gap: 10px;
    max-height: 290px;
    overflow: auto;
    padding-inline-end: 4px;
}

html[dir="rtl"] .case-preview-card-files .preview-list,
html[dir="rtl"] .case-preview-card-notes .preview-list {
    max-height: 290px;
    overflow: auto;
    padding-inline-end: 4px;
}

html[dir="rtl"] .preview-file-meta {
    font-size: 11px;
    color: var(--ds-text-muted);
}

html[dir="rtl"] .preview-contact-list,
html[dir="rtl"] .preview-summary-list {
    display: grid;
    gap: 10px;
}

html[dir="rtl"] .preview-contact-row,
html[dir="rtl"] .preview-summary-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 16px;
    background: rgba(248, 244, 238, 0.72);
    border: 1px solid rgba(161, 137, 106, 0.08);
}

html[dir="rtl"] .preview-contact-row strong,
html[dir="rtl"] .preview-summary-row strong {
    color: var(--ds-text);
}

html[dir="rtl"] .preview-contact-row span,
html[dir="rtl"] .preview-summary-row span {
    color: var(--ds-text-soft);
    text-align: left;
}

html[dir="rtl"] .case-preview-card-summary {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(250, 246, 239, 0.96) 100%);
    border-color: rgba(184, 132, 73, 0.18);
    box-shadow: 0 18px 36px rgba(63, 47, 28, 0.08);
}

html[dir="rtl"] .case-preview-card-summary .spec-summary-top strong {
    font-size: 42px;
    color: var(--ds-success);
    text-shadow: 0 6px 18px rgba(95, 143, 103, 0.12);
}

html[dir="rtl"] .preview-summary-row.is-emphasis {
    background: rgba(230, 241, 232, 0.72);
    border-color: rgba(95, 143, 103, 0.18);
}

html[dir="rtl"] .preview-summary-row.is-emphasis span {
    color: var(--ds-success);
    font-weight: 800;
}

html[dir="rtl"] .case-preview-card-files,
html[dir="rtl"] .case-preview-card-spec,
html[dir="rtl"] .case-preview-card-pdf {
    padding: 16px;
    box-shadow: 0 12px 24px rgba(55, 39, 24, 0.04);
}

html[dir="rtl"] .case-preview-card-customer {
    padding: 15px;
    background: rgba(252, 250, 246, 0.92);
}

html[dir="rtl"] .case-preview-block-secondary {
    background: rgba(252, 250, 246, 0.88);
    box-shadow: 0 10px 22px rgba(55, 39, 24, 0.035);
}

html[dir="rtl"] .case-preview-card-history,
html[dir="rtl"] .case-preview-card-notes {
    padding: 16px;
    min-height: 260px;
}

html[dir="rtl"] .case-preview-card-customer .preview-mini-grid div,
html[dir="rtl"] .case-preview-card-customer .preview-contact-row {
    padding: 10px 12px;
}

html[dir="rtl"] .preview-history-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

html[dir="rtl"] .preview-history-title {
    margin: 0;
    color: var(--ds-text);
    font-weight: 700;
}

html[dir="rtl"] .case-preview-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(191, 168, 128, 0.22);
}

html[dir="rtl"] .case-preview-footer-nav {
    display: flex;
}

html[dir="rtl"] .case-preview-footer-nav:first-child {
    justify-content: flex-start;
}

html[dir="rtl"] .case-preview-footer-nav:last-child {
    justify-content: flex-end;
}

html[dir="rtl"] .case-preview-footer-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

html[dir="rtl"] .case-preview-primary-action {
    min-width: 190px;
    box-shadow: 0 14px 26px rgba(184, 132, 73, 0.18);
}

html[dir="rtl"] .case-preview-secondary-action {
    min-width: 110px;
}

html[dir="rtl"] .case-preview-nav-button {
    min-width: 180px;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 16px;
    border-radius: 18px;
    border: 1px solid rgba(191, 168, 128, 0.22);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(249, 244, 236, 0.96));
    color: var(--ds-text);
    box-shadow: 0 12px 24px rgba(32, 24, 17, 0.05);
    text-align: right;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

html[dir="rtl"] .case-preview-nav-button:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(191, 168, 128, 0.42);
    box-shadow: 0 16px 28px rgba(32, 24, 17, 0.08);
}

html[dir="rtl"] .case-preview-nav-button:disabled,
html[dir="rtl"] .case-preview-nav-button.is-disabled {
    opacity: 0.42;
    cursor: not-allowed;
    box-shadow: none;
}

html[dir="rtl"] .case-preview-nav-label {
    font-size: 11px;
    color: var(--ds-text-soft);
}

html[dir="rtl"] .case-preview-nav-button strong {
    font-size: 15px;
    font-weight: 800;
    color: var(--ds-text);
}

html[dir="rtl"] .insight-item {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(248, 244, 238, 0.86);
    border: 1px solid rgba(161, 137, 106, 0.1);
}

html[dir="rtl"] .insight-icon {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    margin-top: 3px;
    background: var(--ds-brand-soft);
}

html[dir="rtl"] .insight-icon.is-warning { background: rgba(230, 155, 74, 0.75); }
html[dir="rtl"] .insight-icon.is-danger { background: rgba(204, 105, 105, 0.72); }
html[dir="rtl"] .insight-icon.is-success { background: rgba(98, 168, 111, 0.72); }
html[dir="rtl"] .insight-icon.is-brand { background: rgba(184, 132, 73, 0.72); }

html[dir="rtl"] .alert-item-card.is-empty {
    text-align: center;
}

html[dir="rtl"] .quick-action-grid {
    display: grid;
    gap: 10px;
}

html[dir="rtl"] .detail-layout {
    align-items: start;
}

html[dir="rtl"] .detail-main-card,
html[dir="rtl"] .detail-support-card {
    position: relative;
    overflow: hidden;
}

html[dir="rtl"] .detail-main-card::before,
html[dir="rtl"] .detail-support-card::before {
    content: "";
    position: absolute;
    inset-inline: 18px auto;
    top: 0;
    inline-size: 64px;
    block-size: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--ds-brand) 0%, rgba(184, 132, 73, 0.12) 100%);
}

html[dir="rtl"] .detail-support-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(249,245,239,0.94) 100%);
}

html[dir="rtl"] .detail-visual-card {
    display: grid;
    gap: 14px;
}

html[dir="rtl"] .detail-visual-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: calc(var(--ds-radius-lg) - 4px);
    border: 1px solid rgba(161, 137, 106, 0.12);
    background: rgba(247, 242, 235, 0.92);
}

html[dir="rtl"] .detail-visual-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

html[dir="rtl"] .checklist-card {
    display: grid;
    gap: 12px;
}

html[dir="rtl"] .checklist-row {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(161, 137, 106, 0.12);
    background: rgba(255, 255, 255, 0.72);
}

html[dir="rtl"] .checklist-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    margin-top: 4px;
    background: rgba(184, 132, 73, 0.22);
    box-shadow: inset 0 0 0 3px rgba(255,255,255,0.85);
}

html[dir="rtl"] .checklist-row.is-complete {
    border-color: rgba(98, 168, 111, 0.18);
    background: rgba(241, 248, 242, 0.9);
}

html[dir="rtl"] .checklist-row.is-complete .checklist-dot {
    background: rgba(98, 168, 111, 0.85);
}

html[dir="rtl"] .checklist-row.is-missing {
    border-color: rgba(230, 155, 74, 0.2);
    background: rgba(255, 250, 244, 0.92);
}

html[dir="rtl"] .checklist-row.is-missing .checklist-dot {
    background: rgba(230, 155, 74, 0.85);
}

html[dir="rtl"] .checklist-row strong {
    display: block;
    margin-bottom: 4px;
}

html[dir="rtl"] .checklist-row small {
    display: block;
    color: var(--ds-text-soft);
    line-height: 1.55;
}

html[dir="rtl"] .cases-create-card {
    margin-top: var(--ds-space-4);
}

@media (max-width: 1320px) {
    html[dir="rtl"] .cases-workspace-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    html[dir="rtl"] .cases-side-rail {
        position: static;
        order: 2;
    }
}

@media (max-width: 980px) {
    html[dir="rtl"] .case-preview-meta-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html[dir="rtl"] .case-preview-progress-track {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        row-gap: 18px;
    }

    html[dir="rtl"] .case-preview-progress-line {
        display: none;
    }

    html[dir="rtl"] .cases-kpi-grid,
    html[dir="rtl"] .preview-mini-grid {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .case-preview-grid,
    html[dir="rtl"] .case-preview-grid-primary,
    html[dir="rtl"] .case-preview-grid-support,
    html[dir="rtl"] .case-preview-grid-secondary,
    html[dir="rtl"] .preview-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html[dir="rtl"] .case-preview-block-span-2 {
        grid-column: span 2;
    }

    html[dir="rtl"] .case-preview-footer {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .case-preview-footer-nav,
    html[dir="rtl"] .case-preview-footer-nav:first-child,
    html[dir="rtl"] .case-preview-footer-nav:last-child,
    html[dir="rtl"] .case-preview-footer-actions {
        justify-content: center;
    }

    html[dir="rtl"] .cases-filter-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    html[dir="rtl"] .filter-search-control {
        grid-column: 1 / -1;
    }

    html[dir="rtl"] .cases-action-strip .action-strip,
    html[dir="rtl"] .cases-hero-refined,
    html[dir="rtl"] .case-preview-header {
        grid-template-columns: 1fr;
        display: grid;
    }

    html[dir="rtl"] .cases-action-center {
        margin: 14px 0 22px;
    }
}

@media (max-width: 640px) {
    html[dir="rtl"] .case-preview-title-row,
    html[dir="rtl"] .case-preview-primary {
        flex-direction: column;
        gap: 10px;
    }

    html[dir="rtl"] .case-preview-meta-bar {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .case-preview-progress-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html[dir="rtl"] .case-preview-grid,
    html[dir="rtl"] .case-preview-grid-primary,
    html[dir="rtl"] .case-preview-grid-support,
    html[dir="rtl"] .case-preview-grid-secondary,
    html[dir="rtl"] .preview-action-grid {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .case-preview-block-span-2 {
        grid-column: auto;
    }

    html[dir="rtl"] .case-preview-nav-button {
        min-width: min(100%, 260px);
        width: 100%;
    }

    html[dir="rtl"] .case-preview-footer-actions {
        flex-direction: column;
        width: 100%;
    }

    html[dir="rtl"] .case-preview-footer-actions .button {
        width: 100%;
        justify-content: center;
    }

    html[dir="rtl"] .cases-filter-toolbar {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .cases-kpi-card strong,
    html[dir="rtl"] .spec-summary-top strong {
        font-size: 26px;
    }

    html[dir="rtl"] .cases-action-center-inner {
        gap: 10px;
    }

    html[dir="rtl"] .cases-action-center .hero-stat-chip {
        min-width: 136px;
    }
}

/* === Stage 4: internal screens refinement === */

html[dir="rtl"] .detail-hero,
html[dir="rtl"] .dashboard-hero,
html[dir="rtl"] .page-hero {
    padding: 26px 30px;
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(184, 132, 73, 0.08), transparent 32%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 246, 239, 0.9) 100%);
    border: 1px solid rgba(161, 137, 106, 0.14);
    box-shadow: var(--ds-shadow-md);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--ds-space-5);
    align-items: start;
}

html[dir="rtl"] .hero-copy {
    display: grid;
    gap: 10px;
}

html[dir="rtl"] .hero-copy h1 {
    margin: 0;
    font-size: clamp(2rem, 2vw + 1rem, 2.85rem);
    line-height: 1.08;
    color: var(--ds-text);
}

html[dir="rtl"] .hero-copy .muted {
    max-width: 76ch;
}

html[dir="rtl"] .screen-head-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 10px;
}

html[dir="rtl"] .hero-status-cluster {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

html[dir="rtl"] .soft-chip,
html[dir="rtl"] .hero-stat-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(184, 132, 73, 0.08);
    color: var(--ds-text-soft);
    border: 1px solid rgba(184, 132, 73, 0.14);
}

html[dir="rtl"] .hero-stat-chip {
    display: grid;
    gap: 2px;
    min-width: 132px;
    justify-items: center;
}

html[dir="rtl"] .hero-stat-chip strong {
    font-size: 1.5rem;
    color: var(--ds-brand-deep);
}

html[dir="rtl"] .detail-layout,
html[dir="rtl"] .manager-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, .92fr);
    gap: var(--ds-space-5);
    align-items: start;
}

html[dir="rtl"] .manager-workspace {
    grid-template-columns: minmax(0, 1.18fr) minmax(300px, .82fr);
}

html[dir="rtl"] .stack-gap {
    display: grid;
    gap: var(--ds-space-5);
}

html[dir="rtl"] .section-card,
html[dir="rtl"] .notification-card,
html[dir="rtl"] .auth-card,
html[dir="rtl"] .side-panel {
    border-radius: 26px;
    border: 1px solid rgba(161, 137, 106, 0.14);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 244, 238, 0.95) 100%);
    box-shadow: var(--ds-shadow-sm);
}

html[dir="rtl"] .section-card {
    padding: 24px 26px;
}

html[dir="rtl"] .nested-section-card {
    padding: 20px 22px;
    border-radius: 22px;
    border: 1px solid rgba(161, 137, 106, 0.12);
    background: rgba(252, 249, 244, 0.92);
    box-shadow: none;
}

html[dir="rtl"] .section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

html[dir="rtl"] .section-head h2,
html[dir="rtl"] .section-head h3 {
    margin: 0;
    color: var(--ds-text);
    line-height: 1.15;
}

html[dir="rtl"] .section-head h2 {
    font-size: 1.45rem;
}

html[dir="rtl"] .section-head h3 {
    font-size: 1.08rem;
}

html[dir="rtl"] .fact-grid,
html[dir="rtl"] .info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

html[dir="rtl"] .fact-grid > div,
html[dir="rtl"] .info-grid > div {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(161, 137, 106, 0.12);
}

html[dir="rtl"] .fact-grid strong,
html[dir="rtl"] .info-grid strong {
    font-size: var(--ds-font-size-xs);
    letter-spacing: 0;
    color: var(--ds-text-muted);
}

html[dir="rtl"] .fact-grid span,
html[dir="rtl"] .info-grid span {
    color: var(--ds-text);
    font-weight: 600;
}

html[dir="rtl"] .hero-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

html[dir="rtl"] .summary-card {
    display: grid;
    gap: 6px;
    min-height: 118px;
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(161, 137, 106, 0.14);
    box-shadow: var(--ds-shadow-sm);
}

html[dir="rtl"] .summary-label {
    color: var(--ds-text-muted);
    font-size: var(--ds-font-size-xs);
}

html[dir="rtl"] .summary-card strong {
    font-size: 1.35rem;
    color: var(--ds-text);
}

html[dir="rtl"] .summary-card small {
    color: var(--ds-text-muted);
}

html[dir="rtl"] .timeline {
    display: grid;
    gap: 12px;
}

html[dir="rtl"] .timeline-item {
    position: relative;
    display: grid;
    gap: 8px;
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(161, 137, 106, 0.12);
}

html[dir="rtl"] .timeline-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: var(--ds-text-soft);
}

html[dir="rtl"] .history-details {
    display: grid;
    gap: 14px;
}

html[dir="rtl"] .history-summary {
    width: fit-content;
}

html[dir="rtl"] .active-note-list,
html[dir="rtl"] .ranking-stack,
html[dir="rtl"] .notification-stack,
html[dir="rtl"] .case-queue,
html[dir="rtl"] .side-link-list,
html[dir="rtl"] .side-stat-list,
html[dir="rtl"] .side-notes-list {
    display: grid;
    gap: 12px;
}

html[dir="rtl"] .active-note-item,
html[dir="rtl"] .queue-item,
html[dir="rtl"] .side-link,
html[dir="rtl"] .side-stat-item,
html[dir="rtl"] .side-notes-list li,
html[dir="rtl"] .ranking-group,
html[dir="rtl"] .notification-card,
html[dir="rtl"] .auth-feature,
html[dir="rtl"] .auth-support-panel,
html[dir="rtl"] .auth-demo-panel {
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(161, 137, 106, 0.12);
}

html[dir="rtl"] .queue-item,
html[dir="rtl"] .side-link {
    color: inherit;
    text-decoration: none;
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

html[dir="rtl"] .queue-item:hover,
html[dir="rtl"] .side-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(93, 76, 56, 0.08);
    border-color: rgba(184, 132, 73, 0.2);
}

html[dir="rtl"] .premium-action-panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ds-space-5);
}

html[dir="rtl"] .executive-alert-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    padding: 20px 22px;
}

html[dir="rtl"] .executive-alert-item {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(161, 137, 106, 0.12);
}

html[dir="rtl"] .executive-alert-item strong {
    font-size: 1.45rem;
    color: var(--ds-brand-deep);
}

html[dir="rtl"] .premium-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

html[dir="rtl"] .premium-kpi-card {
    min-height: 126px;
}

html[dir="rtl"] .executive-metric-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

html[dir="rtl"] .premium-metric-tile {
    min-height: 122px;
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(161, 137, 106, 0.12);
}

html[dir="rtl"] .premium-group h3,
html[dir="rtl"] .side-panel h3,
html[dir="rtl"] .auth-demo-panel h3 {
    margin: 0 0 8px;
}

html[dir="rtl"] .ranking-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

html[dir="rtl"] .ranking-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(250, 246, 239, 0.92);
    border: 1px solid rgba(161, 137, 106, 0.1);
}

html[dir="rtl"] .ranking-rank {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(184, 132, 73, 0.12);
    color: var(--ds-brand-deep);
    font-weight: 800;
}

html[dir="rtl"] .person-link {
    color: var(--ds-text);
    text-decoration: none;
}

html[dir="rtl"] .person-link:hover {
    color: var(--ds-brand-deep);
}

html[dir="rtl"] .notification-card {
    gap: 14px;
}

html[dir="rtl"] .notification-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

html[dir="rtl"] .notification-state,
html[dir="rtl"] .state-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(184, 132, 73, 0.08);
    color: var(--ds-brand-deep);
    border: 1px solid rgba(184, 132, 73, 0.14);
}

html[dir="rtl"] .notification-time,
html[dir="rtl"] .notification-type {
    color: var(--ds-text-muted);
}

html[dir="rtl"] .row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

html[dir="rtl"] .premium-auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, 480px);
    gap: 26px;
    align-items: stretch;
}

html[dir="rtl"] .auth-brand-panel {
    min-height: 720px;
    padding: 36px;
    border-radius: 34px;
    background:
        radial-gradient(circle at top right, rgba(184, 132, 73, 0.18), transparent 28%),
        linear-gradient(180deg, #fffdfa 0%, #f5f0e7 100%);
    border: 1px solid rgba(161, 137, 106, 0.14);
    box-shadow: var(--ds-shadow-md);
}

html[dir="rtl"] .auth-brand-inner {
    display: grid;
    gap: 20px;
    align-content: start;
}

html[dir="rtl"] .auth-card-head {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

html[dir="rtl"] .auth-card-head h2 {
    margin: 0;
    font-size: 2rem;
}

html[dir="rtl"] .auth-feature-list,
html[dir="rtl"] .demo-list {
    display: grid;
    gap: 12px;
}

html[dir="rtl"] .demo-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

html[dir="rtl"] .premium-auth-card {
    padding: 28px 30px;
}

html[dir="rtl"] .factory-preview-layout .section-card,
html[dir="rtl"] .detail-layout .section-card {
    min-width: 0;
}

html[dir="rtl"] .checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

html[dir="rtl"] .attachment-check {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(250, 246, 239, 0.92);
    border: 1px solid rgba(161, 137, 106, 0.1);
}

@media (max-width: 1320px) {
    html[dir="rtl"] .detail-layout,
    html[dir="rtl"] .manager-workspace,
    html[dir="rtl"] .premium-auth-shell,
    html[dir="rtl"] .premium-action-panels {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .hero-summary-grid,
    html[dir="rtl"] .executive-metric-grid,
    html[dir="rtl"] .premium-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html[dir="rtl"] .executive-alert-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Stage 2 shell refinement */
:root {
    --shell-sidebar-width: 312px;
    --shell-sidebar-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 244, 236, 0.96) 100%);
    --shell-sidebar-border: rgba(161, 137, 106, 0.16);
    --shell-sidebar-shadow: 0 18px 40px rgba(36, 25, 15, 0.08);
    --shell-sidebar-divider: rgba(161, 137, 106, 0.12);
    --shell-header-bg: rgba(255, 255, 255, 0.88);
    --shell-header-border: rgba(161, 137, 106, 0.12);
    --shell-header-shadow: 0 14px 34px rgba(36, 25, 15, 0.06);
}

@media (min-width: 901px) {
    html[dir="rtl"] .app-shell {
        grid-template-columns: var(--shell-sidebar-width) minmax(0, 1fr);
        gap: 22px;
        align-items: start;
        padding: 16px;
    }

    html[dir="rtl"] .app-sidebar {
        background: var(--shell-sidebar-bg);
        border: 1px solid var(--shell-sidebar-border);
        box-shadow: var(--shell-sidebar-shadow);
        min-height: calc(100dvh - 32px);
        padding: 24px 18px 18px;
    }

    html[dir="rtl"] .app-sidebar::before {
        display: none;
    }

    html[dir="rtl"] .sidebar-brand {
        padding-block-end: 18px;
        border-bottom: 1px solid var(--shell-sidebar-divider);
        margin-bottom: 16px;
    }

    html[dir="rtl"] .brand-logo {
        align-items: flex-start;
        text-align: right;
        gap: 8px;
    }

    html[dir="rtl"] .brand-emblem {
        align-self: flex-end;
        background: linear-gradient(180deg, rgba(184, 132, 73, 0.18) 0%, rgba(184, 132, 73, 0.08) 100%);
        color: var(--ds-brand-deep);
        border: 1px solid rgba(184, 132, 73, 0.18);
        box-shadow: none;
    }

    html[dir="rtl"] .brand-mark {
        color: var(--ds-text);
        font-size: 30px;
    }

    html[dir="rtl"] .brand-tagline {
        color: var(--ds-text-soft);
        font-size: 11px;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    html[dir="rtl"] .sidebar-nav-wrap {
        display: flex;
        flex-direction: column;
        gap: 18px;
        flex: 1;
    }

    html[dir="rtl"] .sidebar-nav-group {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    html[dir="rtl"] .sidebar-section-label {
        padding-inline: 6px;
        color: var(--ds-text-muted);
        letter-spacing: 0.1em;
    }

    html[dir="rtl"] .sidebar-link,
    html[dir="rtl"] .sidebar-link.is-disabled {
        min-height: 66px;
        padding: 12px 14px;
        border-radius: 20px;
        background: transparent;
        border: 1px solid transparent;
        box-shadow: none;
        gap: 12px;
    }

    html[dir="rtl"] .sidebar-link:hover {
        background: rgba(184, 132, 73, 0.06);
        border-color: rgba(184, 132, 73, 0.18);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    }

    html[dir="rtl"] .sidebar-link.is-active {
        background: linear-gradient(180deg, rgba(184, 132, 73, 0.16) 0%, rgba(184, 132, 73, 0.08) 100%);
        border-color: rgba(184, 132, 73, 0.28);
        box-shadow: inset 0 0 0 1px rgba(184, 132, 73, 0.08);
    }

    html[dir="rtl"] .sidebar-link.is-active::before {
        inset-inline-start: auto;
        inset-inline-end: 10px;
        inset-block: 12px;
        width: 4px;
        background: linear-gradient(180deg, var(--ds-brand) 0%, var(--ds-brand-deep) 100%);
        opacity: 1;
    }

    html[dir="rtl"] .sidebar-link::after {
        display: none;
    }

    html[dir="rtl"] .sidebar-link-copy {
        align-items: flex-start;
        text-align: right;
        gap: 3px;
    }

    html[dir="rtl"] .sidebar-link-copy strong {
        color: var(--ds-text);
        font-size: 14px;
    }

    html[dir="rtl"] .sidebar-link-copy small {
        color: var(--ds-text-muted);
        font-size: 11px;
    }

    html[dir="rtl"] .sidebar-link-icon {
        background: rgba(184, 132, 73, 0.08);
        border: 1px solid rgba(184, 132, 73, 0.14);
        color: var(--ds-brand-deep);
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    html[dir="rtl"] .sidebar-link-badge {
        margin-inline-start: auto;
        background: linear-gradient(180deg, var(--ds-brand) 0%, var(--ds-brand-deep) 100%);
        color: #fff;
        box-shadow: 0 8px 16px rgba(182, 138, 85, 0.2);
    }

    html[dir="rtl"] .sidebar-footer {
        padding-top: 16px;
        border-top: 1px solid var(--shell-sidebar-divider);
        gap: 12px;
    }

    html[dir="rtl"] .sidebar-system-label {
        color: var(--ds-text-muted);
    }

    html[dir="rtl"] .sidebar-user-card {
        background: rgba(255, 255, 255, 0.76);
        border: 1px solid rgba(161, 137, 106, 0.14);
        color: var(--ds-text);
    }

    html[dir="rtl"] .sidebar-user-avatar {
        background: linear-gradient(180deg, rgba(184, 132, 73, 0.22) 0%, rgba(184, 132, 73, 0.12) 100%);
        color: var(--ds-brand-deep);
    }

    html[dir="rtl"] .sidebar-logout {
        width: 100%;
        justify-content: center;
        background: #fffaf4;
        color: var(--ds-brand-deep);
        border-color: rgba(184, 132, 73, 0.2);
    }

    html[dir="rtl"] .app-main {
        gap: 18px;
        padding-block: 4px 22px;
    }

    html[dir="rtl"] .app-header {
        position: sticky;
        top: 16px;
        z-index: 15;
        grid-template-columns: minmax(0, 250px) minmax(0, 1fr) minmax(0, 280px);
        gap: 14px;
        align-items: center;
        padding: 12px 18px;
        min-height: 78px;
        border-radius: 26px;
        background: var(--shell-header-bg);
        border: 1px solid var(--shell-header-border);
        box-shadow: var(--shell-header-shadow);
        backdrop-filter: blur(12px);
    }

    html[dir="rtl"] .header-system-chip,
    html[dir="rtl"] .header-user-chip,
    html[dir="rtl"] .header-notification-chip {
        min-height: 50px;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.72);
        border: 1px solid rgba(161, 137, 106, 0.12);
        box-shadow: none;
    }

    html[dir="rtl"] .header-system-chip {
        justify-self: end;
        padding-inline: 18px;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(248, 244, 238, 0.84) 100%);
    }

    html[dir="rtl"] .header-system-title {
        font-size: 14px;
    }

    html[dir="rtl"] .header-system-copy {
        font-size: 10px;
        letter-spacing: 0.12em;
        text-transform: uppercase;
    }

    html[dir="rtl"] .header-search-wrap {
        max-width: 760px;
        justify-self: stretch;
    }

    html[dir="rtl"] .header-search {
        min-height: 50px;
        padding-inline: 14px;
        border-radius: 18px;
        background: linear-gradient(180deg, rgba(252, 249, 244, 0.98) 0%, rgba(246, 239, 230, 0.9) 100%);
        border: 1px solid rgba(161, 137, 106, 0.14);
    }

    html[dir="rtl"] .header-search input {
        font-size: 13px;
    }

    html[dir="rtl"] .header-search-submit {
        min-height: 30px;
        min-width: 56px;
        border-radius: 999px;
    }

    html[dir="rtl"] .header-meta {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
    }

    html[dir="rtl"] .header-user-chip {
        min-width: 132px;
        padding-inline: 14px;
    }

    html[dir="rtl"] .header-user-name {
        font-size: 13px;
    }

    html[dir="rtl"] .header-user-role {
        font-size: 11px;
    }

    html[dir="rtl"] .header-notification-panel {
        border-radius: 20px;
        box-shadow: var(--ds-shadow-md);
    }
}

@media (max-width: 980px) {
    html[dir="rtl"] .page-hero,
    html[dir="rtl"] .detail-hero,
    html[dir="rtl"] .dashboard-hero {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .hero-summary-grid,
    html[dir="rtl"] .fact-grid,
    html[dir="rtl"] .info-grid,
    html[dir="rtl"] .executive-metric-grid,
    html[dir="rtl"] .premium-kpi-grid,
    html[dir="rtl"] .premium-action-panels {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .executive-alert-bar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    html[dir="rtl"] .section-card,
    html[dir="rtl"] .premium-auth-card,
    html[dir="rtl"] .auth-brand-panel {
        padding: 18px;
    }

    html[dir="rtl"] .hero-copy h1 {
        font-size: 1.8rem;
    }
}

html[dir="rtl"] .dashboard-hero {
    position: relative;
    overflow: hidden;
    grid-template-columns: minmax(0, 1.12fr) auto;
}

html[dir="rtl"] .dashboard-hero::before {
    content: "";
    position: absolute;
    inset-block: 18px 18px;
    inset-inline-start: 18px;
    width: 6px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(184, 132, 73, 0.95) 0%, rgba(214, 187, 151, 0.24) 100%);
    opacity: 0.78;
}

html[dir="rtl"] .dashboard-hero .hero-copy {
    position: relative;
    z-index: 1;
    padding-inline-start: 12px;
}

html[dir="rtl"] .dashboard-hero-actions {
    align-items: stretch;
    gap: 14px;
}

html[dir="rtl"] .dashboard-hero-actions .button {
    min-width: 168px;
    justify-content: center;
}

html[dir="rtl"] .dashboard-filter-card {
    position: relative;
}

html[dir="rtl"] .dashboard-filter-card .section-head {
    align-items: end;
}

html[dir="rtl"] .dashboard-kpi-grid {
    margin-block: 4px 2px;
}

html[dir="rtl"] .dashboard-kpi-card {
    min-height: 144px;
    padding: 20px 18px;
}

html[dir="rtl"] .dashboard-kpi-card .kpi-label {
    color: var(--ds-text-soft);
    font-size: var(--ds-font-size-sm);
}

html[dir="rtl"] .dashboard-kpi-card .kpi-value {
    font-size: clamp(1.9rem, 2vw, 2.35rem);
}

html[dir="rtl"] .dashboard-compare-grid,
html[dir="rtl"] .dashboard-rankings-grid,
html[dir="rtl"] .dashboard-load-grid {
    align-items: start;
}

html[dir="rtl"] .dashboard-analytics-card,
html[dir="rtl"] .dashboard-metrics-card,
html[dir="rtl"] .dashboard-ranking-card,
html[dir="rtl"] .dashboard-load-card,
html[dir="rtl"] .dashboard-queue-card,
html[dir="rtl"] .dashboard-anomaly-card,
html[dir="rtl"] .dashboard-side-panel {
    position: relative;
    overflow: hidden;
}

html[dir="rtl"] .dashboard-analytics-card::before,
html[dir="rtl"] .dashboard-metrics-card::before,
html[dir="rtl"] .dashboard-ranking-card::before,
html[dir="rtl"] .dashboard-load-card::before,
html[dir="rtl"] .dashboard-queue-card::before,
html[dir="rtl"] .dashboard-anomaly-card::before,
html[dir="rtl"] .dashboard-side-panel::before {
    content: "";
    position: absolute;
    inset-block-start: 0;
    inset-inline-end: 24px;
    width: 74px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(184, 132, 73, 0.96) 0%, rgba(214, 187, 151, 0.16) 100%);
}

html[dir="rtl"] .dashboard-metrics-card .section-head,
html[dir="rtl"] .dashboard-ranking-card .section-head,
html[dir="rtl"] .dashboard-load-card .section-head,
html[dir="rtl"] .dashboard-queue-card .section-head,
html[dir="rtl"] .dashboard-anomaly-card .section-head {
    margin-block-end: 14px;
}

html[dir="rtl"] .executive-ranking-group {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(249, 244, 236, 0.9) 100%);
    border: 1px solid rgba(184, 132, 73, 0.12);
    box-shadow: 0 14px 26px rgba(44, 31, 20, 0.05);
}

html[dir="rtl"] .executive-ranking-group .ranking-list li {
    background: rgba(255, 255, 255, 0.88);
}

html[dir="rtl"] .dashboard-queue-grid,
html[dir="rtl"] .dashboard-anomalies-grid {
    gap: 18px;
}

html[dir="rtl"] .dashboard-queue-card .case-queue,
html[dir="rtl"] .dashboard-anomaly-card .case-queue {
    display: grid;
    gap: 12px;
}

html[dir="rtl"] .executive-queue-item {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(250, 246, 239, 0.9) 100%);
    border: 1px solid rgba(184, 132, 73, 0.12);
    box-shadow: 0 12px 22px rgba(44, 31, 20, 0.05);
}

html[dir="rtl"] .executive-queue-item strong {
    font-size: 1rem;
    color: var(--ds-text);
}

html[dir="rtl"] .dashboard-side-panel {
    gap: 16px;
}

html[dir="rtl"] .dashboard-focus-panel {
    background:
        radial-gradient(circle at top left, rgba(184, 132, 73, 0.1), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 241, 232, 0.96) 100%);
}

html[dir="rtl"] .dashboard-shortcut-panel .side-link-list,
html[dir="rtl"] .dashboard-notes-panel .side-notes-list {
    display: grid;
    gap: 12px;
}

html[dir="rtl"] .dashboard-notes-panel .side-notes-list li {
    background: rgba(255, 255, 255, 0.84);
}

@media (max-width: 1320px) {
    html[dir="rtl"] .dashboard-hero {
        grid-template-columns: 1fr;
    }
}

html[dir="rtl"] .header-notification-dropdown,
html[dir="rtl"] .header-profile-dropdown {
    position: relative;
}

html[dir="rtl"] .header-notification-dropdown > summary,
html[dir="rtl"] .header-profile-dropdown > summary {
    list-style: none;
    cursor: pointer;
}

html[dir="rtl"] .header-notification-dropdown > summary::-webkit-details-marker,
html[dir="rtl"] .header-profile-dropdown > summary::-webkit-details-marker {
    display: none;
}

html[dir="rtl"] .header-notification-chip,
html[dir="rtl"] .header-user-chip-button {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

html[dir="rtl"] .header-notification-chip:hover,
html[dir="rtl"] .header-user-chip-button:hover,
html[dir="rtl"] .header-notification-dropdown[open] .header-notification-chip,
html[dir="rtl"] .header-profile-dropdown[open] .header-user-chip-button {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(44, 31, 20, 0.08);
    border-color: rgba(184, 132, 73, 0.24);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 243, 235, 0.96) 100%);
}

html[dir="rtl"] .header-user-chip-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-align: right;
}

html[dir="rtl"] .header-user-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

html[dir="rtl"] .header-user-avatar,
html[dir="rtl"] .sidebar-user-avatar,
html[dir="rtl"] .header-user-avatar-image,
html[dir="rtl"] .sidebar-user-avatar-image {
    inline-size: 34px;
    block-size: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 34px;
}

html[dir="rtl"] .header-user-avatar,
html[dir="rtl"] .sidebar-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(184, 132, 73, 0.18) 0%, rgba(184, 132, 73, 0.08) 100%);
    border: 1px solid rgba(184, 132, 73, 0.18);
    color: var(--ds-brand-deep);
    font-weight: 800;
}

html[dir="rtl"] .header-profile-panel {
    position: absolute;
    inset-inline-start: 0;
    inset-block-start: calc(100% + 10px);
    inline-size: min(420px, 92vw);
    padding: 18px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 243, 235, 0.98) 100%);
    border: 1px solid rgba(184, 132, 73, 0.14);
    box-shadow: 0 20px 44px rgba(44, 31, 20, 0.12);
    z-index: 50;
}

html[dir="rtl"] .header-profile-panel-head {
    display: grid;
    gap: 4px;
    margin-block-end: 14px;
}

html[dir="rtl"] .header-profile-panel-head strong {
    font-size: 1rem;
    color: var(--ds-text);
}

html[dir="rtl"] .header-profile-panel-head span {
    color: var(--ds-text-soft);
    font-size: var(--ds-font-size-sm);
}

html[dir="rtl"] .profile-panel-form + .profile-panel-form {
    margin-block-start: 14px;
    padding-block-start: 14px;
    border-top: 1px solid rgba(184, 132, 73, 0.1);
}

html[dir="rtl"] .profile-panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

html[dir="rtl"] .profile-panel-grid-single {
    grid-template-columns: 1fr;
}

html[dir="rtl"] .profile-panel-grid label {
    display: grid;
    gap: 6px;
}

html[dir="rtl"] .profile-panel-grid label > span {
    font-size: 11px;
    font-weight: 700;
    color: var(--ds-text-soft);
}

html[dir="rtl"] .profile-panel-grid input[type="text"],
html[dir="rtl"] .profile-panel-grid input[type="email"],
html[dir="rtl"] .profile-panel-grid input[type="file"] {
    min-height: 42px;
    border-radius: 16px;
    border: 1px solid rgba(184, 132, 73, 0.14);
    background: rgba(255, 255, 255, 0.92);
    padding: 10px 14px;
}

html[dir="rtl"] .profile-panel-actions {
    display: flex;
    justify-content: flex-start;
    margin-block-start: 12px;
}

@media (max-width: 720px) {
    html[dir="rtl"] .header-profile-panel {
        inset-inline: 0;
        inline-size: auto;
    }

    html[dir="rtl"] .profile-panel-grid {
        grid-template-columns: 1fr;
    }
}

html[dir="rtl"] .preview-more-list {
    margin-block-start: 10px;
    display: grid;
    gap: 10px;
}

html[dir="rtl"] .preview-more-list summary {
    list-style: none;
    inline-size: fit-content;
    cursor: pointer;
}

html[dir="rtl"] .preview-more-list summary::-webkit-details-marker {
    display: none;
}

html[dir="rtl"] .preview-more-list-body {
    display: grid;
    gap: 10px;
    margin-block-start: 4px;
}

/* Login redesign */
html[dir="rtl"] body.auth-shell-active {
    background:
        radial-gradient(circle at 8% 8%, rgba(182, 138, 85, 0.08), transparent 16%),
        linear-gradient(180deg, #fcfaf6 0%, #f5efe6 100%);
}

html[dir="rtl"] .auth-page {
    min-height: 100vh;
    padding: 24px;
}

html[dir="rtl"] .login-screen {
    min-height: calc(100vh - 48px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

html[dir="rtl"] .login-screen::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(252, 248, 241, 0.5) 0%, rgba(244, 235, 220, 0.38) 100%),
        url('/static/images/login-kitchen-bg.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    z-index: 0;
}

html[dir="rtl"] .login-screen::after {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 16% 14%, rgba(255, 255, 255, 0.48), transparent 18%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 250, 243, 0.22) 100%);
    backdrop-filter: blur(3px);
    z-index: 0;
}

html[dir="rtl"] .login-shell {
    width: min(520px, calc(100vw - 48px));
    display: block;
    position: relative;
    z-index: 1;
}

html[dir="rtl"] .login-brand-panel {
    display: none;
}

html[dir="rtl"] .login-brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(252, 247, 239, 0.68) 0%, rgba(255, 252, 247, 0.34) 26%, rgba(255, 255, 255, 0.08) 100%),
        linear-gradient(180deg, rgba(255, 251, 245, 0.08) 0%, rgba(245, 234, 216, 0.18) 100%);
}

html[dir="rtl"] .login-brand-panel::after {
    display: none;
}

html[dir="rtl"] .login-brand-backdrop {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, transparent 0%, rgba(244, 232, 213, 0.18) 100%),
        linear-gradient(90deg, transparent 0 18%, rgba(155, 125, 84, 0.18) 18.4%, transparent 18.7%, transparent 49%, rgba(155, 125, 84, 0.14) 49.35%, transparent 49.6%, transparent 74%, rgba(155, 125, 84, 0.12) 74.3%, transparent 74.6%);
    opacity: 0.58;
}

html[dir="rtl"] .login-brand-copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 14px;
    max-width: 360px;
    margin-inline-end: auto;
    margin-inline-start: 54px;
    padding: 56px;
    text-align: right;
    background: none;
    backdrop-filter: none;
    border: 0;
    border-radius: 0;
}

html[dir="rtl"] .login-logo-mark {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3rem, 4vw, 4.25rem);
    line-height: 1;
    color: #1f1a16;
}

html[dir="rtl"] .login-logo-subtitle {
    color: var(--ds-brand);
    font-size: 0.92rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

html[dir="rtl"] .login-logo-divider {
    width: 66px;
    height: 2px;
    border-radius: 999px;
    background: rgba(182, 138, 85, 0.44);
}

html[dir="rtl"] .login-brand-copy .eyebrow {
    color: rgba(35, 31, 26, 0.82);
    font-size: 0.86rem;
    letter-spacing: 0.14em;
}

html[dir="rtl"] .login-brand-copy h1 {
    margin: 0;
    font-size: clamp(2.15rem, 2.8vw, 3rem);
    color: #7d653d;
}

html[dir="rtl"] .login-brand-copy p {
    margin: 0;
    max-width: 24ch;
    color: rgba(47, 40, 33, 0.78);
    font-size: 1.02rem;
    line-height: 1.85;
}

html[dir="rtl"] .login-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: auto;
    background: rgba(255, 255, 255, 0.92);
    padding: 64px 56px;
    position: relative;
    z-index: 1;
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow:
        0 28px 68px rgba(36, 25, 15, 0.12),
        0 12px 28px rgba(36, 25, 15, 0.06);
    backdrop-filter: blur(16px);
}

html[dir="rtl"] .login-card-head {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 8px;
    margin-block-end: 34px;
}

html[dir="rtl"] .login-card-head h2 {
    margin: 0;
    font-size: clamp(2rem, 2.4vw, 3rem);
    color: var(--ds-text);
}

html[dir="rtl"] .login-card-head p {
    margin: 0;
    color: var(--ds-text-soft);
    font-size: 1.05rem;
}

html[dir="rtl"] .login-form {
    display: grid;
    gap: 20px;
}

html[dir="rtl"] .login-field {
    display: grid;
    gap: 7px;
}

html[dir="rtl"] .login-field > span {
    color: var(--ds-text-soft);
    font-size: 1rem;
    font-weight: 700;
}

html[dir="rtl"] .login-input-shell {
    position: relative;
    display: flex;
    align-items: center;
}

html[dir="rtl"] .login-input-shell input {
    width: 100%;
    min-height: 68px;
    padding-inline: 64px 20px;
    border-radius: 20px;
    border: 1px solid rgba(182, 138, 85, 0.2);
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    font-size: 1rem;
}

html[dir="rtl"] .login-input-shell input::placeholder {
    color: #a09486;
}

html[dir="rtl"] .login-input-shell input:focus {
    border-color: rgba(182, 138, 85, 0.48);
    box-shadow:
        0 0 0 4px rgba(182, 138, 85, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html[dir="rtl"] .login-input-icon {
    position: absolute;
    inset-inline-start: 20px;
    inline-size: 23px;
    block-size: 23px;
    opacity: 0.86;
}

html[dir="rtl"] .login-input-icon::before,
html[dir="rtl"] .login-input-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
}

html[dir="rtl"] .login-input-icon-user::before {
    inline-size: 17px;
    block-size: 13px;
    border: 2px solid rgba(167, 119, 58, 0.84);
    border-radius: 4px;
    inset-block-start: 9px;
}

html[dir="rtl"] .login-input-icon-user::after {
    inline-size: 13px;
    block-size: 13px;
    border: 2px solid rgba(167, 119, 58, 0.84);
    border-radius: 50%;
    inset-block-start: -6px;
}

html[dir="rtl"] .login-input-icon-lock::before {
    inline-size: 17px;
    block-size: 13px;
    border: 2px solid rgba(167, 119, 58, 0.84);
    border-radius: 4px;
    inset-block-start: 8px;
}

html[dir="rtl"] .login-input-icon-lock::after {
    inline-size: 11px;
    block-size: 11px;
    border: 2px solid rgba(167, 119, 58, 0.84);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    inset-block-start: -8px;
}

html[dir="rtl"] .login-submit {
    min-height: 62px;
    border-radius: 20px;
    font-size: 1.15rem;
    margin-block-start: 12px;
    background: linear-gradient(180deg, #d2a768 0%, #b98543 54%, #915f2b 100%);
    box-shadow:
        0 16px 30px rgba(182, 138, 85, 0.3),
        0 6px 14px rgba(145, 95, 43, 0.12),
        inset 0 1px 0 rgba(255, 248, 238, 0.24);
    border: 1px solid rgba(150, 104, 49, 0.22);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease, background 0.16s ease;
}

html[dir="rtl"] .login-submit:hover {
    transform: translateY(-1px);
    background: linear-gradient(180deg, #c39658 0%, #aa7637 58%, #845625 100%);
    box-shadow:
        0 20px 36px rgba(170, 122, 62, 0.34),
        inset 0 1px 0 rgba(255, 248, 238, 0.18);
}

html[dir="rtl"] .login-submit:focus-visible {
    box-shadow:
        0 0 0 4px rgba(182, 138, 85, 0.16),
        0 16px 30px rgba(170, 122, 62, 0.28);
}

html[dir="rtl"] .login-support {
    margin-block-start: 34px;
    padding-block-start: 24px;
    border-top: 1px solid rgba(182, 138, 85, 0.14);
    display: grid;
    justify-items: center;
    gap: 12px;
    color: var(--ds-brand);
    text-align: center;
}

html[dir="rtl"] .login-support p {
    margin: 0;
    color: var(--ds-brand);
    font-size: 1rem;
}

html[dir="rtl"] .login-support-icon {
    inline-size: 22px;
    block-size: 22px;
    border-radius: 50%;
    position: relative;
    display: inline-block;
}

html[dir="rtl"] .login-support-icon::before {
    content: "";
    position: absolute;
    inset: 4px 5px auto auto;
    inline-size: 12px;
    block-size: 10px;
    border: 2px solid rgba(182, 138, 85, 0.72);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    transform: translateX(-2px);
}

html[dir="rtl"] .login-support-icon::after {
    content: "";
    position: absolute;
    inset: auto 4px 4px auto;
    inline-size: 14px;
    block-size: 10px;
    border: 2px solid rgba(182, 138, 85, 0.72);
    border-top: 0;
    border-radius: 0 0 10px 10px;
    transform: translateX(-1px);
}

@media (max-width: 1100px) {
    html[dir="rtl"] .auth-page {
        padding: 18px;
    }

    html[dir="rtl"] .login-shell {
        max-width: 720px;
    }

    html[dir="rtl"] .login-card {
        min-height: auto;
        padding: 42px 28px;
    }
}

@media (max-width: 640px) {
    html[dir="rtl"] .auth-page {
        padding: 12px;
    }

    html[dir="rtl"] .login-screen {
        min-height: calc(100vh - 24px);
    }

    html[dir="rtl"] .login-shell {
        border-radius: 28px;
        width: min(100%, calc(100vw - 24px));
    }

    html[dir="rtl"] .login-card {
        padding: 34px 20px 24px;
    }

    html[dir="rtl"] .login-logo-mark {
        font-size: 2.8rem;
    }

    html[dir="rtl"] .login-card-head h2 {
        font-size: 2rem;
    }

    html[dir="rtl"] .login-card-head p,
    html[dir="rtl"] .login-support p {
        font-size: 0.95rem;
    }

    html[dir="rtl"] .login-input-shell input {
        min-height: 60px;
    }

    html[dir="rtl"] .login-submit {
        min-height: 58px;
    }
}
.notifications-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.notifications-shell {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.notifications-grid-shell {
    width: min(100%, 1200px);
    margin-inline: auto;
}

.notifications-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(41, 30, 16, 0.07);
}

.notifications-heading {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notifications-heading h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.15;
    color: var(--ds-text);
}

.notifications-heading .muted {
    max-width: 560px;
    font-size: 13px;
    line-height: 1.7;
}

.notifications-top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.notifications-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid rgba(189, 161, 107, 0.18);
    background: rgba(255, 255, 255, 0.84);
}

.notifications-tab {
    border: 0;
    background: transparent;
    color: var(--ds-text-soft);
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.notifications-tab:hover {
    background: rgba(189, 161, 107, 0.1);
    color: var(--ds-text);
}

.notifications-tab.is-active {
    background: linear-gradient(135deg, rgba(201, 165, 98, 0.16), rgba(160, 120, 58, 0.08));
    color: var(--ds-brand-deep);
    box-shadow: inset 0 0 0 1px rgba(189, 161, 107, 0.24);
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    min-height: 92px;
    padding: 16px 18px 16px 20px;
    border-radius: 20px;
    border: 1px solid rgba(41, 30, 16, 0.08);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 28px rgba(74, 57, 33, 0.07);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    overflow: hidden;
}

.notification-row:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 36px rgba(74, 57, 33, 0.1);
    border-color: rgba(189, 161, 107, 0.22);
}

.notification-row:focus-visible {
    outline: 2px solid rgba(189, 161, 107, 0.5);
    outline-offset: 2px;
}

.notification-row-strip {
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    border-radius: 999px;
    background: rgba(189, 161, 107, 0.5);
}

.notification-level-danger .notification-row-strip {
    background: linear-gradient(180deg, rgba(212, 92, 92, 0.95), rgba(184, 65, 65, 0.92));
}

.notification-level-warning .notification-row-strip {
    background: linear-gradient(180deg, rgba(214, 156, 72, 0.95), rgba(191, 128, 48, 0.92));
}

.notification-level-success .notification-row-strip {
    background: linear-gradient(180deg, rgba(101, 170, 105, 0.95), rgba(66, 140, 90, 0.92));
}

.notification-level-info .notification-row-strip {
    background: linear-gradient(180deg, rgba(89, 142, 211, 0.92), rgba(67, 118, 184, 0.9));
}

.notification-row-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.notification-row-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.notification-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    color: var(--ds-text-soft);
    border: 1px solid rgba(41, 30, 16, 0.08);
    background: rgba(245, 241, 234, 0.9);
}

.notification-type-badge.level-danger {
    color: #9d4343;
    background: rgba(253, 239, 239, 0.94);
    border-color: rgba(212, 92, 92, 0.22);
}

.notification-type-badge.level-warning {
    color: #a36a18;
    background: rgba(255, 246, 231, 0.96);
    border-color: rgba(214, 156, 72, 0.22);
}

.notification-type-badge.level-success {
    color: #427c55;
    background: rgba(239, 248, 241, 0.96);
    border-color: rgba(101, 170, 105, 0.2);
}

.notification-type-badge.level-info {
    color: #446e9d;
    background: rgba(239, 245, 252, 0.96);
    border-color: rgba(89, 142, 211, 0.18);
}

.notification-case-ref,
.notification-unread-dot {
    font-size: 12px;
    font-weight: 700;
    color: var(--ds-text-muted);
}

.notification-unread-dot {
    color: var(--ds-brand-deep);
}

.notification-row-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.notification-row-copy h3 {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ds-text);
}

.notification-row-copy p {
    margin: 0;
    color: var(--ds-text-soft);
    font-size: 12px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-row-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.notification-row-time {
    font-size: 12px;
    color: var(--ds-text-muted);
    white-space: nowrap;
}

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

.notification-row-actions form {
    margin: 0;
}

.notification-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 240px;
    border-radius: 24px;
    border: 1px dashed rgba(189, 161, 107, 0.28);
    background: rgba(255, 255, 255, 0.78);
    text-align: center;
    padding: 32px 24px;
}

.notification-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(245, 241, 234, 0.9);
    color: var(--ds-brand-deep);
    font-size: 20px;
}

.notification-empty-state h3 {
    margin: 0;
    font-size: 20px;
    color: var(--ds-text);
}

.notification-empty-state p {
    margin: 0;
    max-width: 360px;
    color: var(--ds-text-soft);
    font-size: 13px;
    line-height: 1.7;
}

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

.notification-card-grid {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 208px;
    padding: 18px 18px 16px;
    border-radius: 24px;
    border: 1px solid rgba(41, 30, 16, 0.08);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 30px rgba(74, 57, 33, 0.07);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    overflow: hidden;
}

.notification-card-grid:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(74, 57, 33, 0.12);
    border-color: rgba(189, 161, 107, 0.22);
}

/* Sidebar footer visibility hardening */
html[dir="rtl"] .app-sidebar {
    overflow-y: auto;
    overflow-x: hidden;
}

html[dir="rtl"] .sidebar-footer {
    position: sticky;
    bottom: 0;
    margin-top: auto;
    padding-top: 12px;
    padding-bottom: 6px;
    gap: 10px;
    background: linear-gradient(180deg, rgba(249, 245, 239, 0) 0%, rgba(249, 245, 239, 0.94) 18%, rgba(249, 245, 239, 0.98) 100%);
    backdrop-filter: blur(6px);
}

html[dir="rtl"] .sidebar-logout {
    min-height: 40px;
    width: 100%;
}

.notification-card-grid.notification-level-danger {
    box-shadow: 0 14px 34px rgba(168, 84, 84, 0.1);
}

.notification-card-grid.notification-level-warning {
    box-shadow: 0 14px 34px rgba(186, 132, 58, 0.09);
}

.notification-card-grid:focus-visible {
    outline: 2px solid rgba(189, 161, 107, 0.48);
    outline-offset: 2px;
}

.notification-card-strip {
    position: absolute;
    inset-inline-end: 0;
    top: 18px;
    bottom: 18px;
    width: 4px;
    border-radius: 999px;
    background: rgba(189, 161, 107, 0.46);
}

.notification-card-grid.notification-level-danger .notification-card-strip {
    background: linear-gradient(180deg, rgba(212, 92, 92, 0.95), rgba(184, 65, 65, 0.92));
}

.notification-card-grid.notification-level-warning .notification-card-strip {
    background: linear-gradient(180deg, rgba(214, 156, 72, 0.95), rgba(191, 128, 48, 0.92));
}

.notification-card-grid.notification-level-success .notification-card-strip {
    background: linear-gradient(180deg, rgba(101, 170, 105, 0.95), rgba(66, 140, 90, 0.92));
}

.notification-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.notification-card-case {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ds-text-muted);
    font-size: 12px;
    font-weight: 800;
}

.notification-card-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 800;
    background: rgba(245, 241, 234, 0.92);
    border: 1px solid rgba(41, 30, 16, 0.08);
}

.notification-card-icon.level-danger {
    color: #a04444;
    background: rgba(253, 239, 239, 0.94);
    border-color: rgba(212, 92, 92, 0.18);
}

.notification-card-icon.level-warning {
    color: #a36a18;
    background: rgba(255, 246, 231, 0.96);
    border-color: rgba(214, 156, 72, 0.18);
}

.notification-card-icon.level-success {
    color: #427c55;
    background: rgba(239, 248, 241, 0.96);
    border-color: rgba(101, 170, 105, 0.16);
}

.notification-card-icon.level-info {
    color: #446e9d;
    background: rgba(239, 245, 252, 0.96);
    border-color: rgba(89, 142, 211, 0.16);
}

.notification-card-time {
    font-size: 12px;
    color: var(--ds-text-muted);
    white-space: nowrap;
}

.notification-card-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.notification-card-copy h3 {
    margin: 0;
    font-size: 21px;
    line-height: 1.35;
    color: var(--ds-text);
}

.notification-card-copy p {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--ds-text-soft);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid rgba(41, 30, 16, 0.06);
    margin-top: auto;
}

.notification-card-actions form {
    margin: 0;
}

.notification-card-actions .notification-type-badge {
    margin-inline-end: auto;
}

.notification-empty-state-grid {
    grid-column: 1 / -1;
}

@media (max-width: 1100px) {
    .notifications-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .notifications-top-actions {
        justify-content: space-between;
    }

    .notification-row {
        grid-template-columns: 1fr;
    }

    .notification-row-side {
        align-items: flex-start;
    }

    .notification-row-actions {
        justify-content: flex-start;
    }

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

@media (max-width: 720px) {
    .notifications-tabs {
        width: 100%;
        justify-content: space-between;
    }

    .notifications-tab {
        flex: 1;
        text-align: center;
        padding-inline: 10px;
    }

    .notification-row {
        padding: 14px 14px 14px 16px;
        border-radius: 18px;
    }

    .notification-row-copy h3 {
        font-size: 14px;
    }

    .notification-row-copy p {
        -webkit-line-clamp: 2;
    }

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

    .notification-card-grid {
        min-height: 196px;
        padding: 16px 16px 14px;
        border-radius: 20px;
    }

    .notification-card-copy h3 {
        font-size: 18px;
    }
}

/* Cases workspace user panel */
html[dir="rtl"] .cases-workspace-panel {
    display: grid;
    gap: 12px;
}

html[dir="rtl"] .cases-profile-dropdown,
html[dir="rtl"] .cases-notification-dropdown {
    position: relative;
}

html[dir="rtl"] .cases-user-card {
    width: 100%;
    min-height: 88px;
    padding: 14px 16px;
    border-radius: 24px;
    border: 1px solid rgba(161, 137, 106, 0.16);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(250, 246, 240, 0.96) 100%);
    box-shadow: 0 14px 32px rgba(74, 57, 33, 0.08);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

html[dir="rtl"] .cases-user-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(74, 57, 33, 0.11);
    border-color: rgba(189, 161, 107, 0.24);
}

html[dir="rtl"] .cases-user-card::-webkit-details-marker,
html[dir="rtl"] .cases-notification-chip::-webkit-details-marker {
    display: none;
}

html[dir="rtl"] .cases-notification-chip {
    width: 100%;
    min-height: 52px;
    padding: 10px 14px;
    justify-content: space-between;
    border-radius: 20px;
    border: 1px solid rgba(161, 137, 106, 0.14);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 24px rgba(74, 57, 33, 0.06);
}

html[dir="rtl"] .cases-notification-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(74, 57, 33, 0.1);
}

html[dir="rtl"] .cases-side-rail .header-profile-panel,
html[dir="rtl"] .cases-side-rail .header-notification-panel {
    inset-inline-start: 0;
    inset-inline-end: auto;
    width: min(360px, calc(100vw - 64px));
    margin-top: 10px;
}

html[dir="rtl"] .cases-side-rail .header-notification-panel {
    max-height: 420px;
    overflow: auto;
}

html[dir="rtl"] .sidebar-user-card-link {
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease;
}

html[dir="rtl"] .sidebar-user-card-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(74, 57, 33, 0.12);
    border-color: rgba(189, 161, 107, 0.26);
    background: rgba(255, 255, 255, 0.92);
}

html[dir="rtl"] .sidebar-user-card-link:focus-visible {
    outline: 2px solid rgba(189, 161, 107, 0.42);
    outline-offset: 3px;
}

html[dir="rtl"] .profile-page-layout {
    display: grid;
    gap: 22px;
}

html[dir="rtl"] .profile-summary-card,
html[dir="rtl"] .profile-form-card,
html[dir="rtl"] .profile-password-card {
    background: rgba(255, 255, 255, 0.94);
}

html[dir="rtl"] .profile-summary-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

html[dir="rtl"] .profile-summary-avatar,
html[dir="rtl"] .profile-summary-avatar-image {
    inline-size: 72px;
    block-size: 72px;
    border-radius: 24px;
    object-fit: cover;
    flex: 0 0 72px;
}

html[dir="rtl"] .profile-summary-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(184, 132, 73, 0.18) 0%, rgba(184, 132, 73, 0.08) 100%);
    border: 1px solid rgba(184, 132, 73, 0.18);
    color: var(--ds-brand-deep);
    font-size: 24px;
    font-weight: 800;
}

html[dir="rtl"] .profile-summary-copy h2 {
    margin: 0 0 6px;
    font-size: 28px;
}

html[dir="rtl"] .profile-summary-copy p {
    margin: 0;
    color: var(--ds-text-soft);
}

html[dir="rtl"] .profile-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

html[dir="rtl"] .profile-summary-item {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(250, 246, 240, 0.88);
    border: 1px solid rgba(161, 137, 106, 0.12);
}

html[dir="rtl"] .profile-summary-item span {
    display: block;
    color: var(--ds-text-muted);
    font-size: 12px;
    margin-bottom: 6px;
}

html[dir="rtl"] .profile-summary-item strong {
    font-size: 16px;
    color: var(--ds-text);
}

html[dir="rtl"] .profile-form-grid .field-label {
    display: block;
    margin-bottom: 10px;
    color: var(--ds-text);
    font-weight: 700;
}

html[dir="rtl"] .profile-avatar-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

html[dir="rtl"] .profile-avatar-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

html[dir="rtl"] .profile-avatar-option-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 20px;
    border: 1px solid rgba(161, 137, 106, 0.14);
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

html[dir="rtl"] .profile-avatar-option-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(74, 57, 33, 0.08);
}

html[dir="rtl"] .profile-avatar-option-card img {
    inline-size: 48px;
    block-size: 48px;
    border-radius: 16px;
}

html[dir="rtl"] .profile-avatar-option input:checked + .profile-avatar-option-card {
    border-color: rgba(184, 132, 73, 0.3);
    background: rgba(255, 248, 238, 0.96);
    box-shadow: 0 16px 32px rgba(184, 132, 73, 0.12);
}

html[dir="rtl"] .cases-filter-toolbar {
    display: grid;
    grid-template-columns: minmax(250px, 1.7fr) repeat(5, minmax(120px, 0.95fr)) auto;
    align-items: end;
    gap: 12px;
}

html[dir="rtl"] .cases-filter-toolbar > label {
    min-width: 0;
}

html[dir="rtl"] .cases-filter-toolbar .filter-search-control {
    min-width: 0;
}

html[dir="rtl"] .cases-filter-toolbar label span {
    margin-bottom: 6px;
    font-size: 11px;
}

html[dir="rtl"] .cases-filter-toolbar input,
html[dir="rtl"] .cases-filter-toolbar select {
    min-height: 54px;
    padding-block: 10px;
}

html[dir="rtl"] .cases-filter-toolbar .filter-actions {
    display: flex;
    align-items: end;
    gap: 10px;
    margin: 0;
    padding: 0;
    min-width: fit-content;
}

html[dir="rtl"] .cases-filter-toolbar .filter-actions .button {
    min-height: 48px;
    padding-inline: 18px;
}

@media (max-width: 900px) {
    html[dir="rtl"] .profile-summary-grid {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .profile-avatar-options {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .cases-filter-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html[dir="rtl"] .cases-filter-toolbar .filter-search-control,
    html[dir="rtl"] .cases-filter-toolbar .filter-actions {
        grid-column: 1 / -1;
    }
}

html[dir="rtl"] .case-workbench {
    display: grid;
    gap: 14px;
}

html[dir="rtl"] .case-workbench-header,
html[dir="rtl"] .case-workbench-timeline-card,
html[dir="rtl"] .case-workbench-tabs-shell {
    padding: 14px 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(250, 246, 240, 0.96) 100%);
    border: 1px solid rgba(161, 137, 106, 0.1);
    box-shadow: 0 14px 30px rgba(74, 57, 33, 0.06);
}

html[dir="rtl"] .case-workbench-headline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

html[dir="rtl"] .case-workbench-title h1 {
    margin: 0 0 4px;
    font-size: clamp(28px, 3.8vw, 38px);
    line-height: 1;
}

html[dir="rtl"] .case-workbench-title-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

html[dir="rtl"] .case-workbench-title-meta strong {
    font-size: 18px;
    color: var(--ds-text);
}

html[dir="rtl"] .case-workbench-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

html[dir="rtl"] .case-workbench-meta-grid {
    display: grid;
    grid-template-columns: 160px repeat(7, minmax(0, 1fr));
    gap: 8px;
}

html[dir="rtl"] .case-meta-card {
    min-height: 82px;
    padding: 12px 12px 10px;
    border-radius: 18px;
    border: 1px solid rgba(161, 137, 106, 0.12);
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
}

html[dir="rtl"] .case-meta-card span,
html[dir="rtl"] .case-meta-card small {
    color: var(--ds-text-muted);
    font-size: 12px;
}

html[dir="rtl"] .case-meta-card strong {
    color: var(--ds-text);
    font-size: 16px;
    line-height: 1.35;
}

html[dir="rtl"] .case-meta-progress {
    background: linear-gradient(180deg, rgba(255, 251, 245, 0.96) 0%, rgba(246, 238, 228, 0.92) 100%);
}

html[dir="rtl"] .case-progress-ring {
    --ring-color: var(--ds-brand);
    inline-size: 102px;
    block-size: 102px;
    margin-inline: auto;
    border-radius: 50%;
    background:
        radial-gradient(circle closest-side, rgba(255,255,255,0.98) 72%, transparent 73%),
        conic-gradient(var(--ring-color) 0 var(--progress), rgba(222, 216, 208, 0.88) var(--progress) 100%);
    display: grid;
    place-items: center;
    text-align: center;
    box-shadow: inset 0 0 0 1px rgba(161, 137, 106, 0.14);
}

html[dir="rtl"] .case-progress-ring strong {
    display: block;
    font-size: 20px;
    margin-bottom: 2px;
}

html[dir="rtl"] .case-progress-ring span {
    display: block;
    font-size: 11px;
    color: var(--ds-text-muted);
    max-inline-size: 74px;
    line-height: 1.4;
}

html[dir="rtl"] .case-workbench-timeline-card {
    overflow: hidden;
}

html[dir="rtl"] .case-workbench-timeline {
    position: relative;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
}

html[dir="rtl"] .case-workbench-timeline-line {
    position: absolute;
    inset-block-start: 18px;
    inset-inline: 6%;
    block-size: 2px;
    background: linear-gradient(90deg, rgba(214, 204, 189, 0.9) 0%, rgba(214, 204, 189, 0.35) 100%);
    z-index: 0;
}

html[dir="rtl"] .case-workbench-timeline-step {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 8px;
    text-align: center;
}

html[dir="rtl"] .case-workbench-timeline-step .step-dot {
    inline-size: 34px;
    block-size: 34px;
    border-radius: 999px;
    background: rgba(244, 239, 232, 0.94);
    border: 1px solid rgba(161, 137, 106, 0.14);
    color: var(--ds-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

html[dir="rtl"] .case-workbench-timeline-step .step-label {
    color: var(--ds-text-soft);
    font-size: 12px;
    line-height: 1.45;
}

html[dir="rtl"] .case-workbench-timeline-step.is-current .step-dot {
    background: linear-gradient(180deg, rgba(185, 145, 77, 0.98) 0%, rgba(160, 117, 54, 0.98) 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(185, 145, 77, 0.24);
    border-color: rgba(185, 145, 77, 0.32);
}

html[dir="rtl"] .case-workbench-timeline-step.is-current .step-label {
    color: var(--ds-brand-deep);
    font-weight: 700;
}

html[dir="rtl"] .case-workbench-timeline-step.is-complete .step-dot {
    background: rgba(33, 28, 25, 0.96);
    color: #fff;
    border-color: rgba(33, 28, 25, 0.96);
}

html[dir="rtl"] .case-workbench-tabs-shell {
    padding-top: 10px;
}

html[dir="rtl"] .case-workbench-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 12px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(161, 137, 106, 0.12);
}

html[dir="rtl"] .case-tab-button {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 9px 14px;
    border-radius: 14px;
    color: var(--ds-text-soft);
    font-weight: 700;
    cursor: pointer;
    transition: color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

html[dir="rtl"] .case-tab-button:hover {
    background: rgba(248, 244, 238, 0.86);
    color: var(--ds-text);
    transform: translateY(-1px);
}

html[dir="rtl"] .case-tab-button.is-active {
    color: var(--ds-brand-deep);
    background: rgba(249, 243, 232, 0.94);
    box-shadow: inset 0 -2px 0 rgba(185, 145, 77, 0.9);
}

html[dir="rtl"] .case-tab-panel {
    display: grid;
    gap: 18px;
}

html[dir="rtl"] .case-tab-intro {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
}

html[dir="rtl"] .case-tab-intro h2 {
    margin: 0 0 6px;
    font-size: 30px;
}

html[dir="rtl"] .case-tab-intro p {
    margin: 0;
}

html[dir="rtl"] .case-overview-grid-primary {
    display: grid;
    grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr);
    gap: 10px;
}

html[dir="rtl"] .case-overview-grid-secondary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

html[dir="rtl"] .case-overview-grid-finance {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
}

html[dir="rtl"] .case-overview-grid-finance .case-overview-card {
    min-height: 0;
}

html[dir="rtl"] .case-overview-grid-finance .case-payment-overview-card,
html[dir="rtl"] .case-overview-grid-finance .case-overview-card-summary {
    display: grid;
    align-content: start;
}

html[dir="rtl"] .case-overview-grid-tertiary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

html[dir="rtl"] .case-overview-grid-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

html[dir="rtl"] .case-overview-card {
    min-height: 100%;
    border: 1px solid rgba(161, 137, 106, 0.12);
    background: rgba(255, 255, 255, 0.93);
    box-shadow: 0 10px 24px rgba(74, 57, 33, 0.05);
    padding: 10px;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

html[dir="rtl"] .case-overview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(74, 57, 33, 0.09);
    border-color: rgba(185, 145, 77, 0.18);
}

html[dir="rtl"] .case-overview-card-critical,
html[dir="rtl"] .case-overview-card-actions {
    min-height: 182px;
}

html[dir="rtl"] .case-overview-card-critical {
    background: linear-gradient(180deg, rgba(255, 250, 246, 0.98) 0%, rgba(255, 247, 240, 0.98) 100%);
    border-color: rgba(214, 114, 86, 0.34);
    box-shadow: 0 16px 30px rgba(214, 114, 86, 0.08);
    position: relative;
}

html[dir="rtl"] .case-overview-card-critical::before {
    content: "";
    position: absolute;
    inset-block: 12px;
    inset-inline-end: 0;
    inline-size: 4px;
    border-radius: 999px 0 0 999px;
    background: linear-gradient(180deg, rgba(235, 99, 68, 0.9) 0%, rgba(224, 154, 64, 0.9) 100%);
}

html[dir="rtl"] .case-overview-card-actions {
    background: linear-gradient(180deg, rgba(255, 252, 247, 0.98) 0%, rgba(250, 246, 240, 0.98) 100%);
    box-shadow: 0 16px 30px rgba(185, 145, 77, 0.09);
}

html[dir="rtl"] .case-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

html[dir="rtl"] .case-panel-title {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

html[dir="rtl"] .case-panel-title h3 {
    margin: 0 0 2px;
    font-size: 16px;
}

html[dir="rtl"] .case-panel-title p {
    margin: 0;
    font-size: 11px;
    line-height: 1.3;
}

html[dir="rtl"] .case-panel-icon {
    inline-size: 34px;
    block-size: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    background: rgba(255, 245, 232, 0.96);
    color: var(--ds-brand-deep);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

html[dir="rtl"] .case-overview-card-critical .case-panel-icon {
    background: rgba(255, 236, 229, 0.96);
    color: #cf5e40;
    font-size: 20px;
}

html[dir="rtl"] .case-urgent-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(255, 226, 219, 0.98);
    color: #bd4f34;
    border: 1px solid rgba(214, 114, 86, 0.3);
    font-weight: 700;
    font-size: 10px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

html[dir="rtl"] .case-quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

html[dir="rtl"] .quick-action-tile {
    min-height: 60px;
    padding: 8px 9px;
    border-radius: 14px;
    border: 1px solid rgba(161, 137, 106, 0.14);
    background: rgba(255, 255, 255, 0.96);
    text-decoration: none;
    color: inherit;
    display: grid;
    gap: 1px;
    align-content: start;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease, filter .18s ease;
}

html[dir="rtl"] .quick-action-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 28px rgba(74, 57, 33, 0.12);
    border-color: rgba(185, 145, 77, 0.32);
    background: rgba(255, 252, 247, 1);
    filter: saturate(1.04);
}

html[dir="rtl"] .quick-action-tile:active {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(74, 57, 33, 0.1);
}

html[dir="rtl"] .quick-action-tile.is-primary {
    background: linear-gradient(180deg, rgba(185, 145, 77, 0.98) 0%, rgba(157, 117, 57, 0.98) 100%);
    color: #fff;
    box-shadow: 0 14px 28px rgba(185, 145, 77, 0.18);
    border-color: rgba(157, 117, 57, 0.3);
}

html[dir="rtl"] .quick-action-tile.is-primary:hover {
    box-shadow: 0 20px 34px rgba(185, 145, 77, 0.24);
    filter: brightness(0.98);
}

html[dir="rtl"] .quick-action-tile-icon {
    font-size: 14px;
    line-height: 1;
}

html[dir="rtl"] .quick-action-tile strong {
    font-size: 11px;
}

html[dir="rtl"] .preview-inline-action {
    display: contents;
}

html[dir="rtl"] .case-status-summary {
    display: grid;
    gap: 8px;
}

html[dir="rtl"] .case-status-summary.is-compact {
    gap: 6px;
}

html[dir="rtl"] .case-status-summary-top {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

html[dir="rtl"] .case-status-summary-top strong {
    font-size: 26px;
    color: #2f8b61;
    line-height: 1;
}

html[dir="rtl"] .case-overview-card-summary .case-status-summary-top strong {
    font-size: 40px;
    color: #2d9760;
}

html[dir="rtl"] .case-overview-grid-finance .case-overview-card-summary .case-status-summary-top strong {
    font-size: 26px;
}

html[dir="rtl"] .case-overview-grid-finance .case-overview-card-summary .case-status-summary {
    margin-block: 2px 8px;
}

html[dir="rtl"] .case-status-summary-list {
    display: grid;
    gap: 6px;
}

html[dir="rtl"] .preview-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 8px;
    border-radius: 12px;
    background: rgba(248, 244, 238, 0.86);
}

html[dir="rtl"] .preview-summary-row.is-emphasis {
    background: rgba(232, 246, 236, 0.9);
}

html[dir="rtl"] .documents-status-grid {
    display: grid;
    gap: 10px;
}

html[dir="rtl"] .documents-status-grid > div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(248, 244, 238, 0.84);
}

html[dir="rtl"] .compact-list {
    display: grid;
    gap: 5px;
}

html[dir="rtl"] .preview-list-item.missing {
    background: rgba(255, 249, 245, 0.96);
}

html[dir="rtl"] .preview-contact-card {
    min-height: 100%;
}

html[dir="rtl"] .preview-contact-grid {
    display: grid;
    gap: 6px;
}

html[dir="rtl"] .preview-contact-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 8px;
    border-radius: 12px;
    background: rgba(248, 244, 238, 0.84);
}

html[dir="rtl"] .case-overview-card .preview-card-actions {
    margin-top: 8px;
}

html[dir="rtl"] .case-document-divider {
    height: 1px;
    margin: 12px 0 10px;
    background: linear-gradient(90deg, transparent, rgba(176, 144, 104, 0.28), transparent);
}

html[dir="rtl"] .case-overview-card form[action*="/key-handover/pdf"] {
    flex: 1 1 100%;
}

html[dir="rtl"] .case-overview-card form[action*="/key-handover/pdf"] .button {
    width: 100%;
    min-height: 34px;
    white-space: normal;
    line-height: 1.25;
}

html[dir="rtl"] .case-overview-card .button {
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
}

html[dir="rtl"] .case-overview-card .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(74, 57, 33, 0.1);
}

html[dir="rtl"] .case-overview-card .preview-list-item strong,
html[dir="rtl"] .case-overview-card .preview-contact-row strong,
html[dir="rtl"] .case-overview-card .preview-summary-row strong {
    font-size: 11px;
}

html[dir="rtl"] .case-overview-card .preview-list-item,
html[dir="rtl"] .case-overview-card .preview-contact-row,
html[dir="rtl"] .case-overview-card .preview-summary-row,
html[dir="rtl"] .case-overview-card .muted,
html[dir="rtl"] .case-overview-card .preview-file-meta {
    font-size: 10px;
}

html[dir="rtl"] .case-overview-card .preview-list-item span,
html[dir="rtl"] .case-overview-card .preview-contact-row span,
html[dir="rtl"] .case-overview-card .preview-summary-row span,
html[dir="rtl"] .case-overview-card .muted {
    font-size: 10px;
}

html[dir="rtl"] .case-overview-card .preview-list-item {
    min-block-size: 0;
    padding: 6px 8px;
}

html[dir="rtl"] .case-overview-card .preview-list-item span,
html[dir="rtl"] .case-overview-card .preview-file-meta {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html[dir="rtl"] .case-overview-card-summary {
    min-height: 124px;
}

html[dir="rtl"] .case-tab-panel[hidden] {
    display: none !important;
}

html[dir="rtl"] .case-tab-panel.is-active {
    display: grid;
    gap: 14px;
}

html[dir="rtl"] .case-spec-workspace {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 240px;
    gap: 12px;
    align-items: start;
}

html[dir="rtl"] .case-spec-sidebar,
html[dir="rtl"] .case-spec-actions,
html[dir="rtl"] .case-spec-form-shell {
    border: 1px solid rgba(161, 137, 106, 0.12);
    background: rgba(255, 255, 255, 0.95);
}

html[dir="rtl"] .case-spec-sidebar,
html[dir="rtl"] .case-spec-actions {
    position: sticky;
    top: 16px;
}

html[dir="rtl"] .case-spec-readonly-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

html[dir="rtl"] .case-spec-readonly-item {
    padding: 8px 10px;
    border-radius: 14px;
    background: rgba(248, 244, 238, 0.82);
    display: grid;
    gap: 4px;
}

html[dir="rtl"] .case-spec-readonly-item span {
    font-size: 11px;
    color: var(--ds-text-muted);
}

html[dir="rtl"] .case-spec-readonly-item strong {
    font-size: 13px;
    color: var(--ds-text);
}

html[dir="rtl"] .case-spec-delivery-card {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    gap: 10px;
    align-items: end;
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255, 249, 241, 0.86);
    border: 1px solid rgba(184, 132, 73, 0.16);
}

html[dir="rtl"] .case-spec-delivery-card p {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
}

html[dir="rtl"] .case-spec-lock-card {
    display: grid;
    gap: 4px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(42, 113, 69, 0.14);
    background: rgba(232, 247, 237, 0.74);
    color: #245d3d;
}

html[dir="rtl"] .case-spec-lock-card strong {
    font-size: 14px;
}

html[dir="rtl"] .case-spec-lock-card span {
    font-size: 12px;
    color: rgba(36, 93, 61, 0.76);
}

html[dir="rtl"] .case-spec-lock-card.is-locked {
    border-color: rgba(185, 120, 45, 0.22);
    background: rgba(255, 247, 235, 0.9);
    color: #8a5c24;
}

html[dir="rtl"] .case-spec-lock-card.is-locked span {
    color: rgba(113, 78, 36, 0.8);
}

html[dir="rtl"] .case-spec-form-scroll {
    max-height: 68vh;
    overflow: auto;
    padding-inline-end: 4px;
}

html[dir="rtl"] .case-spec-step-panel[hidden] {
    display: none !important;
}

html[dir="rtl"] .case-spec-step-panel.is-active {
    display: grid;
}

html[dir="rtl"] .case-spec-section-block {
    display: grid;
    gap: 14px;
}

html[dir="rtl"] .case-spec-section-head h3 {
    margin: 0 0 4px;
    font-size: 22px;
}

html[dir="rtl"] .case-spec-section-head p {
    margin: 0;
    font-size: 12px;
}

html[dir="rtl"] .case-spec-subsection {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(250, 247, 242, 0.78);
    border: 1px solid rgba(161, 137, 106, 0.1);
}

html[dir="rtl"] .case-spec-subsection h4 {
    margin: 0;
    font-size: 15px;
    color: var(--ds-brand-deep);
}

html[dir="rtl"] .case-spec-upload-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(250, 247, 242, 0.84);
    border: 1px solid rgba(161, 137, 106, 0.1);
}

html[dir="rtl"] .case-spec-upload-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

html[dir="rtl"] .case-spec-upload-head strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
    color: var(--ds-brand-deep);
}

html[dir="rtl"] .case-spec-upload-head small,
html[dir="rtl"] .case-spec-upload-selected {
    font-size: 12px;
    color: var(--ds-text-muted);
}

html[dir="rtl"] .case-spec-upload-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

html[dir="rtl"] .case-spec-upload-list {
    display: grid;
    gap: 8px;
}

html[dir="rtl"] .case-spec-upload-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(161, 137, 106, 0.1);
    color: inherit;
    text-decoration: none;
}

html[dir="rtl"] .case-spec-upload-item strong {
    font-size: 13px;
    color: var(--ds-text);
}

html[dir="rtl"] .case-spec-upload-item small {
    font-size: 11px;
    color: var(--ds-text-muted);
}

html[dir="rtl"] .case-spec-upload-item.is-local {
    border-style: dashed;
}

html[dir="rtl"] .case-spec-upload-empty {
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    font-size: 12px;
    color: var(--ds-text-muted);
}

html[dir="rtl"] .case-spec-upload-empty.is-hidden {
    display: none;
}

html[dir="rtl"] .case-spec-upload-status {
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 12px;
}

html[dir="rtl"] .case-spec-upload-status[data-kind="success"] {
    background: rgba(230, 244, 235, 0.95);
    color: #2d7e54;
}

html[dir="rtl"] .case-spec-upload-status[data-kind="error"] {
    background: rgba(255, 237, 233, 0.95);
    color: #b95339;
}

html[dir="rtl"] .case-spec-upload-status[data-kind="info"] {
    background: rgba(247, 242, 233, 0.95);
    color: var(--ds-brand-deep);
}

html[dir="rtl"] .case-spec-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

html[dir="rtl"] .case-spec-field {
    display: grid;
    gap: 6px;
}

html[dir="rtl"] .case-spec-field > span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: var(--ds-text-soft);
    font-weight: 700;
}

html[dir="rtl"] .case-spec-field > span em {
    font-style: normal;
    font-size: 10px;
    color: #bf684d;
}

html[dir="rtl"] .case-spec-help {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

html[dir="rtl"] .case-spec-field input,
html[dir="rtl"] .case-spec-field select,
html[dir="rtl"] .case-spec-field textarea {
    inline-size: 100%;
    border-radius: 14px;
    border: 1px solid rgba(161, 137, 106, 0.14);
    background: rgba(255, 255, 255, 0.96);
    padding: 10px 12px;
    font: inherit;
    color: var(--ds-text);
}

html[dir="rtl"] .case-spec-field input.is-muted {
    background: rgba(244, 240, 233, 0.74);
    color: var(--muted);
}

html[dir="rtl"] .case-spec-field textarea {
    min-height: 110px;
    resize: vertical;
}

html[dir="rtl"] .case-spec-form-shell.is-locked input:not([type="hidden"]),
html[dir="rtl"] .case-spec-form-shell.is-locked select,
html[dir="rtl"] .case-spec-form-shell.is-locked textarea {
    background: rgba(248, 244, 238, 0.72);
    color: rgba(30, 28, 25, 0.72);
    cursor: not-allowed;
}

html[dir="rtl"] .case-spec-form-shell.is-locked .case-spec-repeat-add,
html[dir="rtl"] .case-spec-form-shell.is-locked .case-spec-repeat-remove {
    opacity: 0.55;
    cursor: not-allowed;
}

html[dir="rtl"] .case-spec-repeat-field {
    grid-column: 1 / -1;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 253, 249, 0.82);
    border: 1px solid rgba(161, 137, 106, 0.12);
}

html[dir="rtl"] .case-spec-repeat-list {
    display: grid;
    gap: 10px;
}

html[dir="rtl"] .case-spec-repeat-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    gap: 10px;
    align-items: end;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(161, 137, 106, 0.11);
}

html[dir="rtl"] .case-spec-repeat-row.has-extra .case-spec-repeat-control:nth-of-type(1),
html[dir="rtl"] .case-spec-repeat-row.has-extra .case-spec-repeat-control:nth-of-type(3) {
    grid-column: 1;
}

html[dir="rtl"] .case-spec-repeat-row.has-extra .case-spec-repeat-control:nth-of-type(2),
html[dir="rtl"] .case-spec-repeat-row.has-extra .case-spec-repeat-control:nth-of-type(4) {
    grid-column: 2;
}

html[dir="rtl"] .case-spec-repeat-row.has-extra .case-spec-repeat-remove {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
}

html[dir="rtl"] .case-spec-repeat-row.has-details .case-spec-repeat-control:nth-of-type(5) {
    grid-column: 1;
}

html[dir="rtl"] .case-spec-repeat-row.has-details .case-spec-repeat-control:nth-of-type(6) {
    grid-column: 2;
}

html[dir="rtl"] .case-spec-repeat-row.has-details .case-spec-repeat-remove {
    grid-row: 1 / span 3;
}

html[dir="rtl"] .case-spec-repeat-row.is-plinth {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}

html[dir="rtl"] .case-spec-repeat-row.is-drawer {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}

html[dir="rtl"] .case-spec-repeat-row.is-facade,
html[dir="rtl"] .case-spec-repeat-row.is-vitrine {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}

html[dir="rtl"] .case-spec-repeat-row.is-led {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}

html[dir="rtl"] .case-spec-repeat-control {
    display: grid;
    gap: 5px;
}

html[dir="rtl"] .case-spec-repeat-control small {
    color: var(--ds-text-muted);
    font-size: 11px;
    font-weight: 700;
}

html[dir="rtl"] .case-spec-repeat-control input,
html[dir="rtl"] .case-spec-repeat-control select {
    min-height: 42px;
    border-radius: 12px;
}

html[dir="rtl"] .case-spec-repeat-remove {
    inline-size: 36px;
    block-size: 36px;
    border-radius: 999px;
    border: 1px solid rgba(199, 107, 98, 0.18);
    background: rgba(255, 244, 241, 0.92);
    color: #a9443b;
    cursor: pointer;
    font-weight: 900;
}

html[dir="rtl"] .case-spec-repeat-remove:hover {
    background: rgba(255, 234, 229, 0.98);
}

html[dir="rtl"] .case-spec-repeat-help {
    grid-column: 1 / -1;
    color: #a45f2a;
    font-size: 11px;
    line-height: 1.45;
}

html[dir="rtl"] .case-spec-repeat-add {
    justify-self: start;
}

html[dir="rtl"] .case-spec-actions-stack {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

html[dir="rtl"] .case-spec-progress-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(248, 244, 238, 0.84);
    margin-bottom: 12px;
}

html[dir="rtl"] .case-spec-submit-form {
    display: grid;
}

html[dir="rtl"] .case-spec-submit-form .button[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

html[dir="rtl"] .case-spec-missing-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255, 248, 243, 0.95);
    border: 1px solid rgba(214, 114, 86, 0.18);
    margin-bottom: 12px;
}

html[dir="rtl"] .case-spec-missing-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

html[dir="rtl"] .case-spec-missing-head strong {
    font-size: 13px;
    color: #b6573e;
}

html[dir="rtl"] .case-spec-missing-head span {
    inline-size: 24px;
    block-size: 24px;
    border-radius: 999px;
    background: rgba(255, 228, 222, 0.98);
    color: #b6573e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
}

html[dir="rtl"] .case-spec-missing-list {
    display: grid;
    gap: 6px;
}

html[dir="rtl"] .case-spec-missing-item {
    padding: 7px 9px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    color: var(--ds-text-soft);
}

html[dir="rtl"] .case-spec-missing-item.is-success {
    background: rgba(234, 246, 238, 0.96);
    color: #2d7e54;
}

html[dir="rtl"] .case-spec-progress-card > span,
html[dir="rtl"] .case-spec-progress-card small {
    color: var(--ds-text-muted);
    font-size: 11px;
}

html[dir="rtl"] .case-spec-progress-card strong {
    font-size: 20px;
    color: var(--ds-brand-deep);
}

html[dir="rtl"] .case-spec-progress-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

html[dir="rtl"] .case-spec-progress-row b {
    font-size: 18px;
    color: #2d9760;
}

html[dir="rtl"] .case-spec-progress-bar {
    flex: 1;
    block-size: 8px;
    border-radius: 999px;
    background: rgba(219, 213, 205, 0.92);
    overflow: hidden;
}

html[dir="rtl"] .case-spec-progress-bar span {
    display: block;
    block-size: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(66, 152, 99, 0.94) 0%, rgba(185, 145, 77, 0.94) 100%);
}

html[dir="rtl"] .case-spec-actions-footer {
    display: grid;
}

html[dir="rtl"] .case-spec-save-feedback {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 12px;
}

html[dir="rtl"] .case-spec-save-feedback[data-kind="success"] {
    background: rgba(230, 244, 235, 0.95);
    color: #2d7e54;
}

html[dir="rtl"] .case-spec-save-feedback[data-kind="error"] {
    background: rgba(255, 237, 233, 0.95);
    color: #b95339;
}

html[dir="rtl"] .case-spec-save-feedback[data-kind="info"] {
    background: rgba(247, 242, 233, 0.95);
    color: var(--ds-brand-deep);
}

html[dir="rtl"] .case-spec-layout,
html[dir="rtl"] .case-chat-layout,
html[dir="rtl"] .case-notes-layout,
html[dir="rtl"] .case-files-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
}

html[dir="rtl"] .case-spec-nav,
html[dir="rtl"] .case-chat-sidebar,
html[dir="rtl"] .case-notes-sidebar,
html[dir="rtl"] .case-files-sidebar {
    position: sticky;
    top: 18px;
    align-self: start;
}

html[dir="rtl"] .case-spec-step-list {
    display: grid;
    gap: 10px;
}

html[dir="rtl"] .case-spec-step-button {
    appearance: none;
    border: 1px solid rgba(161, 137, 106, 0.14);
    background: rgba(255, 255, 255, 0.92);
    border-radius: 18px;
    padding: 14px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ds-text-soft);
    transition: all .18s ease;
}

html[dir="rtl"] .case-spec-step-button span {
    inline-size: 28px;
    block-size: 28px;
    border-radius: 999px;
    background: rgba(248, 244, 238, 0.88);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex: 0 0 28px;
}

html[dir="rtl"] .case-spec-step-button.is-active {
    background: rgba(255, 249, 241, 0.98);
    color: var(--ds-brand-deep);
    border-color: rgba(185, 145, 77, 0.22);
    box-shadow: 0 14px 24px rgba(185, 145, 77, 0.08);
}

html[dir="rtl"] .case-spec-step-button.is-active span {
    background: rgba(185, 145, 77, 0.14);
}

html[dir="rtl"] .case-spec-content,
html[dir="rtl"] .case-chat-content,
html[dir="rtl"] .case-notes-content,
html[dir="rtl"] .case-files-content {
    display: grid;
    gap: 16px;
}

html[dir="rtl"] .case-spec-section,
html[dir="rtl"] .case-spec-section-readonly {
    gap: 18px;
}

html[dir="rtl"] .case-spec-step-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

html[dir="rtl"] .case-spec-submit-row {
    justify-content: flex-start;
}

html[dir="rtl"] .case-files-groups,
html[dir="rtl"] .case-chat-thread,
html[dir="rtl"] .case-notes-groups,
html[dir="rtl"] .case-actions-grid {
    display: grid;
    gap: 16px;
}

html[dir="rtl"] .case-files-groups {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

html[dir="rtl"] .case-files-shell {
    display: grid;
    grid-template-columns: 236px minmax(520px, 1fr) 260px;
    grid-template-areas: "categories center detail";
    gap: 14px;
    align-items: start;
    direction: ltr;
}

html[dir="rtl"] .case-files-shell > *,
html[dir="rtl"] .case-history-audit-shell > *,
html[dir="rtl"] .case-notes-shell > * {
    min-width: 0;
}

html[dir="rtl"] .case-files-center-card {
    grid-area: center;
}

html[dir="rtl"] .case-file-detail-card {
    grid-area: detail;
}

html[dir="rtl"] .case-files-categories-card {
    grid-area: categories;
}

html[dir="rtl"] .case-files-center-card,
html[dir="rtl"] .case-file-detail-card,
html[dir="rtl"] .case-files-categories-card {
    direction: rtl;
}

html[dir="rtl"] .case-files-center-card,
html[dir="rtl"] .case-file-detail-card,
html[dir="rtl"] .case-files-categories-card {
    border: 1px solid rgba(161, 137, 106, 0.12);
    background: rgba(255, 255, 255, 0.95);
}

html[dir="rtl"] .case-files-categories-card {
    padding: 18px;
    background: linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(248, 244, 238, 0.9));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 18px 32px rgba(81, 65, 44, 0.06);
}

html[dir="rtl"] .case-files-center-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

html[dir="rtl"] .case-files-center-head h3 {
    margin: 2px 0 0;
    font-size: 20px;
    color: var(--ds-text);
    letter-spacing: 0;
}

html[dir="rtl"] .case-files-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(260px, auto) auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

html[dir="rtl"] .case-files-toolbar-search input,
html[dir="rtl"] .case-files-toolbar-filters select,
html[dir="rtl"] .case-files-toolbar-filters input,
html[dir="rtl"] .case-files-upload-fields select {
    inline-size: 100%;
    border-radius: 14px;
    border: 1px solid rgba(161, 137, 106, 0.14);
    background: rgba(255, 255, 255, 0.96);
    padding: 10px 12px;
    font: inherit;
    color: var(--ds-text);
}

html[dir="rtl"] .case-files-toolbar-search {
    position: relative;
}

html[dir="rtl"] .case-files-toolbar-search::before {
    content: "";
    position: absolute;
    inset-inline-start: 14px;
    top: 50%;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(90, 76, 56, 0.38);
    border-radius: 999px;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
}

html[dir="rtl"] .case-files-toolbar-search::after {
    content: "";
    position: absolute;
    inset-inline-start: 27px;
    top: calc(50% + 8px);
    width: 8px;
    height: 2px;
    border-radius: 999px;
    background: rgba(90, 76, 56, 0.38);
    transform: rotate(45deg);
    transform-origin: center;
    pointer-events: none;
}

html[dir="rtl"] .case-files-toolbar-search input {
    padding-inline-start: 44px;
}

html[dir="rtl"] .case-files-toolbar-filters {
    display: flex;
    gap: 8px;
}

html[dir="rtl"] .case-files-upload-bar {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(250, 247, 242, 0.84);
    border: 1px solid rgba(161, 137, 106, 0.1);
    margin-bottom: 12px;
}

html[dir="rtl"] .case-files-upload-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

html[dir="rtl"] .case-files-upload-head strong {
    color: var(--ds-text);
    font-size: 14px;
}

html[dir="rtl"] .case-files-upload-fields {
    display: grid;
    grid-template-columns: minmax(170px, 220px) minmax(280px, 1fr) auto;
    align-items: stretch;
    gap: 10px;
}

html[dir="rtl"] .case-files-dropzone {
    min-height: 118px;
    border: 1.5px dashed rgba(165, 122, 55, 0.38);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(250, 246, 238, 0.9));
    display: grid;
    place-items: center;
    align-content: center;
    gap: 7px;
    padding: 16px;
    cursor: pointer;
    text-align: center;
    color: var(--ds-text-soft);
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}

html[dir="rtl"] .case-files-dropzone:hover,
html[dir="rtl"] .case-files-dropzone.is-dragover {
    border-color: rgba(150, 103, 39, 0.72);
    background: rgba(255, 249, 241, 0.98);
    box-shadow: 0 16px 30px rgba(150, 103, 39, 0.1);
    transform: translateY(-1px);
}

html[dir="rtl"] .case-files-dropzone-icon {
    width: 42px;
    height: 34px;
    border-radius: 9px;
    background: rgba(184, 132, 73, 0.14);
    border: 1px solid rgba(184, 132, 73, 0.25);
    position: relative;
}

html[dir="rtl"] .case-files-dropzone-icon::before {
    content: "";
    position: absolute;
    inset-inline-start: 6px;
    top: -6px;
    width: 18px;
    height: 10px;
    border-radius: 7px 7px 0 0;
    background: rgba(184, 132, 73, 0.2);
    border: 1px solid rgba(184, 132, 73, 0.2);
    border-bottom: 0;
}

html[dir="rtl"] .case-files-dropzone strong {
    color: var(--ds-text);
    font-size: 15px;
}

html[dir="rtl"] .case-files-dropzone > span:not(.case-files-dropzone-icon):not(.button) {
    font-size: 12px;
    color: var(--ds-text-muted);
}

html[dir="rtl"] .case-files-upload-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

html[dir="rtl"] .case-files-upload-status {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 12px;
}

html[dir="rtl"] .case-files-upload-status[data-kind="success"] {
    background: rgba(230, 244, 235, 0.95);
    color: #2d7e54;
}

html[dir="rtl"] .case-files-upload-status[data-kind="error"] {
    background: rgba(255, 237, 233, 0.95);
    color: #b95339;
}

html[dir="rtl"] .case-files-upload-status[data-kind="info"] {
    background: rgba(247, 242, 233, 0.95);
    color: var(--ds-brand-deep);
}

html[dir="rtl"] .case-files-table-wrap {
    overflow: auto;
    border-radius: 18px;
    border: 1px solid rgba(161, 137, 106, 0.08);
    background: rgba(255, 255, 255, 0.62);
}

html[dir="rtl"] .case-files-table {
    inline-size: 100%;
    min-width: 720px;
    table-layout: fixed;
    border-collapse: collapse;
}

html[dir="rtl"] .case-files-table th,
html[dir="rtl"] .case-files-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(161, 137, 106, 0.1);
    text-align: right;
    font-size: 13px;
}

html[dir="rtl"] .case-files-table th {
    font-size: 12px;
    color: var(--ds-text-muted);
    background: rgba(250, 247, 242, 0.86);
    white-space: nowrap;
}

html[dir="rtl"] .case-file-row {
    cursor: pointer;
    transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}

html[dir="rtl"] .case-file-row:hover {
    background: rgba(248, 244, 238, 0.55);
    transform: translateY(-1px);
}

html[dir="rtl"] .case-file-row.is-selected {
    background: rgba(255, 249, 241, 0.92);
    box-shadow: inset 3px 0 0 rgba(165, 122, 55, 0.52);
}

html[dir="rtl"] .case-file-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

html[dir="rtl"] .case-file-name-cell > div {
    min-width: 0;
}

html[dir="rtl"] .case-file-type-icon {
    flex: 0 0 36px;
    inline-size: 36px;
    block-size: 30px;
    border-radius: 10px;
    background: rgba(184, 132, 73, 0.1);
    border: 1px solid rgba(184, 132, 73, 0.16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ds-brand-deep);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0;
}

html[dir="rtl"] .case-file-type-icon.is-pdf {
    background: rgba(185, 63, 47, 0.1);
    border-color: rgba(185, 63, 47, 0.18);
    color: #a64234;
}

html[dir="rtl"] .case-file-type-icon.is-dwg {
    background: rgba(51, 103, 145, 0.1);
    border-color: rgba(51, 103, 145, 0.18);
    color: #315f83;
}

html[dir="rtl"] .case-file-type-icon.is-pdp {
    background: rgba(37, 93, 146, 0.11);
    border-color: rgba(37, 93, 146, 0.2);
    color: #255d92;
}

html[dir="rtl"] .case-file-type-icon.is-image {
    background: rgba(62, 132, 92, 0.1);
    border-color: rgba(62, 132, 92, 0.18);
    color: #387a58;
}

html[dir="rtl"] .case-file-type-icon.is-sheet {
    background: rgba(55, 127, 84, 0.1);
    border-color: rgba(55, 127, 84, 0.18);
    color: #32734d;
}

html[dir="rtl"] .case-file-name-cell strong {
    display: block;
    color: var(--ds-text);
    font-size: 13px;
    line-height: 1.3;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html[dir="rtl"] .case-file-name-cell small {
    display: block;
    margin-top: 2px;
    color: var(--ds-text-muted);
    font-size: 11px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html[dir="rtl"] .case-file-type-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(248, 244, 238, 0.9);
    border: 1px solid rgba(161, 137, 106, 0.12);
    color: var(--ds-text-soft);
    font-weight: 800;
    font-size: 11px;
}

html[dir="rtl"] .case-file-row-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

html[dir="rtl"] .icon-action {
    border: 1px solid rgba(161, 137, 106, 0.14);
    background: rgba(255, 255, 255, 0.96);
    color: var(--ds-text-soft);
    border-radius: 12px;
    padding: 6px 10px;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
}

html[dir="rtl"] .icon-action:hover {
    color: var(--ds-brand-deep);
    border-color: rgba(185, 145, 77, 0.28);
    background: rgba(255, 249, 241, 0.98);
}

html[dir="rtl"] .icon-action.is-danger {
    color: #b95339;
    border-color: rgba(185, 83, 57, 0.18);
    background: rgba(255, 246, 243, 0.96);
}

html[dir="rtl"] .icon-action.is-danger:hover {
    color: #963d2a;
    border-color: rgba(185, 83, 57, 0.34);
    background: rgba(255, 237, 233, 0.98);
}

html[dir="rtl"] .icon-action[disabled] {
    opacity: 0.5;
    cursor: default;
}

html[dir="rtl"] .case-files-empty {
    padding: 42px 18px;
    text-align: center;
    color: var(--ds-text-muted);
    display: grid;
    justify-items: center;
    gap: 10px;
}

html[dir="rtl"] .case-files-empty-icon,
html[dir="rtl"] .case-file-detail-empty-icon {
    width: 72px;
    height: 54px;
    border-radius: 16px;
    background: rgba(184, 132, 73, 0.12);
    border: 1px solid rgba(184, 132, 73, 0.2);
    position: relative;
}

html[dir="rtl"] .case-files-empty-icon::before,
html[dir="rtl"] .case-file-detail-empty-icon::before {
    content: "";
    position: absolute;
    inset-inline-start: 10px;
    top: -10px;
    width: 30px;
    height: 14px;
    border-radius: 10px 10px 0 0;
    background: rgba(184, 132, 73, 0.16);
    border: 1px solid rgba(184, 132, 73, 0.18);
    border-bottom: 0;
}

html[dir="rtl"] .case-files-empty strong {
    color: var(--ds-text);
    font-size: 20px;
}

html[dir="rtl"] .case-files-empty span:not(.case-files-empty-icon) {
    font-size: 13px;
}

html[dir="rtl"] .case-files-category-list {
    display: grid;
    gap: 10px;
    margin: 16px 0;
}

html[dir="rtl"] .case-files-category-button {
    appearance: none;
    border: 1px solid rgba(161, 137, 106, 0.14);
    background: rgba(255, 255, 255, 0.92);
    color: var(--ds-text-soft);
    border-radius: 16px;
    padding: 13px 14px;
    text-align: right;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: all .18s ease;
}

html[dir="rtl"] .case-files-category-button:hover {
    transform: translateX(-2px);
    border-color: rgba(185, 145, 77, 0.24);
    background: rgba(255, 250, 244, 0.98);
    color: var(--ds-brand-deep);
}

html[dir="rtl"] .case-files-category-button.is-active {
    transform: translateX(-3px);
    box-shadow: inset 4px 0 0 rgba(165, 122, 55, 0.62), 0 12px 22px rgba(185, 145, 77, 0.08);
}

html[dir="rtl"] .case-files-category-main {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

html[dir="rtl"] .case-files-category-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    position: relative;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid transparent;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

html[dir="rtl"] .case-files-category-icon svg {
    width: 21px;
    height: 21px;
    display: block;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

html[dir="rtl"] .case-files-category-icon .icon-fill {
    fill: currentColor;
    opacity: .16;
    stroke: none;
}

html[dir="rtl"] .case-files-category-button:hover .case-files-category-icon,
html[dir="rtl"] .case-files-category-button.is-active .case-files-category-icon {
    transform: scale(1.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 10px 18px rgba(31, 26, 22, 0.08);
}

html[dir="rtl"] .case-files-category-button[data-files-category="all"] .case-files-category-icon {
    color: #a66b12;
    background: linear-gradient(145deg, #fff7df, #f6e0a6);
    border-color: rgba(166, 107, 18, 0.2);
}

html[dir="rtl"] .case-files-category-button[data-files-category="technical"] .case-files-category-icon {
    color: #256f9f;
    background: linear-gradient(145deg, #eef8ff, #cfe9fb);
    border-color: rgba(37, 111, 159, 0.18);
}

html[dir="rtl"] .case-files-category-button[data-files-category="plans"] .case-files-category-icon {
    color: #197a78;
    background: linear-gradient(145deg, #e9fbf7, #c7eee7);
    border-color: rgba(25, 122, 120, 0.18);
}

html[dir="rtl"] .case-files-category-button[data-files-category="images"] .case-files-category-icon {
    color: #3d874d;
    background: linear-gradient(145deg, #effbea, #d5efc9);
    border-color: rgba(61, 135, 77, 0.18);
}

html[dir="rtl"] .case-files-category-button[data-files-category="electrical"] .case-files-category-icon {
    color: #c97708;
    background: linear-gradient(145deg, #fff5d7, #ffd98a);
    border-color: rgba(201, 119, 8, 0.2);
}

html[dir="rtl"] .case-files-category-button[data-files-category="raumplan"] .case-files-category-icon {
    color: #255d92;
    background: linear-gradient(145deg, #edf6ff, #cfe2ff);
    border-color: rgba(37, 93, 146, 0.18);
}

html[dir="rtl"] .case-files-category-button[data-files-category="materials"] .case-files-category-icon {
    color: #8b5caa;
    background: linear-gradient(145deg, #fbf1ff, #ead8fb);
    border-color: rgba(139, 92, 170, 0.18);
}

html[dir="rtl"] .case-files-category-button[data-files-category="other"] .case-files-category-icon {
    color: #637083;
    background: linear-gradient(145deg, #f5f7fa, #e2e7ee);
    border-color: rgba(99, 112, 131, 0.18);
}

html[dir="rtl"] .case-files-category-button.is-active {
    background: rgba(255, 249, 241, 0.98);
    color: var(--ds-brand-deep);
    border-color: rgba(185, 145, 77, 0.22);
    transform: translateX(-3px);
    box-shadow: inset 4px 0 0 rgba(165, 122, 55, 0.62), 0 12px 22px rgba(185, 145, 77, 0.08);
}

html[dir="rtl"] .case-files-category-button small {
    min-width: 26px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(31, 26, 22, 0.05);
    color: var(--ds-text-muted);
    font-size: 11px;
    font-weight: 800;
}

html[dir="rtl"] .case-files-category-button.is-active small {
    background: rgba(185, 145, 77, 0.15);
    color: var(--ds-brand-deep);
}

html[dir="rtl"] .case-file-detail-body {
    display: grid;
    gap: 12px;
    min-width: 0;
}

html[dir="rtl"] .case-file-detail-card,
html[dir="rtl"] .case-files-categories-card {
    position: sticky;
    top: 14px;
}

html[dir="rtl"] .case-file-detail-empty {
    padding: 18px 14px;
    border-radius: 16px;
    background: rgba(250, 247, 242, 0.84);
    color: var(--ds-text-muted);
    font-size: 12px;
    display: grid;
    justify-items: center;
    gap: 8px;
    text-align: center;
}

html[dir="rtl"] .case-file-detail-empty strong {
    color: var(--ds-text);
    font-size: 16px;
}

html[dir="rtl"] .case-file-detail-preview {
    min-height: 146px;
    border-radius: 18px;
    border: 1px solid rgba(161, 137, 106, 0.14);
    background:
        linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(248, 244, 238, 0.92));
    display: grid;
    place-items: center;
    overflow: hidden;
    text-decoration: none;
    color: var(--ds-brand-deep);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.64);
}

html[dir="rtl"] .case-file-detail-preview img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    display: block;
}

html[dir="rtl"] .case-file-detail-preview span {
    min-width: 74px;
    min-height: 54px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(184, 132, 73, 0.12);
    border: 1px solid rgba(184, 132, 73, 0.18);
    font-weight: 900;
}

html[dir="rtl"] .case-file-detail-preview.is-pdf span {
    background: rgba(185, 63, 47, 0.1);
    border-color: rgba(185, 63, 47, 0.18);
    color: #a64234;
}

html[dir="rtl"] .case-file-detail-preview.is-dwg span {
    background: rgba(51, 103, 145, 0.1);
    border-color: rgba(51, 103, 145, 0.18);
    color: #315f83;
}

html[dir="rtl"] .case-file-detail-preview.is-pdp span {
    background: rgba(37, 93, 146, 0.11);
    border-color: rgba(37, 93, 146, 0.2);
    color: #255d92;
}

html[dir="rtl"] .case-file-detail-preview.is-sheet span {
    background: rgba(55, 127, 84, 0.1);
    border-color: rgba(55, 127, 84, 0.18);
    color: #32734d;
}

html[dir="rtl"] .case-file-detail-icon {
    inline-size: 56px;
    block-size: 56px;
    border-radius: 18px;
    background: rgba(248, 244, 238, 0.88);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

html[dir="rtl"] .case-file-detail-name {
    font-size: 20px;
    font-weight: 800;
    color: var(--ds-text);
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
}

html[dir="rtl"] .case-file-detail-meta {
    display: grid;
    gap: 10px;
}

html[dir="rtl"] .case-file-detail-meta > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(250, 247, 242, 0.82);
}

html[dir="rtl"] .case-file-detail-meta strong {
    font-size: 12px;
    color: var(--ds-text-muted);
}

html[dir="rtl"] .case-file-detail-meta span {
    font-size: 13px;
    color: var(--ds-text);
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: left;
}

html[dir="rtl"] .case-file-detail-actions {
    display: grid;
    gap: 8px;
}

html[dir="rtl"] .case-status-actions-shell {
    display: grid;
    grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

html[dir="rtl"] .case-status-current-card {
    position: sticky;
    top: 14px;
}

html[dir="rtl"] .case-status-current-body,
html[dir="rtl"] .case-status-main-card,
html[dir="rtl"] .case-status-selection-area,
html[dir="rtl"] .case-status-note-card,
html[dir="rtl"] .case-status-summary-card,
html[dir="rtl"] .case-status-allowed-card {
    display: grid;
    gap: 14px;
}

html[dir="rtl"] .case-status-current-primary {
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 250, 243, 0.98), rgba(248, 244, 238, 0.92));
    border: 1px solid rgba(161, 137, 106, 0.14);
    display: grid;
    gap: 8px;
}

html[dir="rtl"] .case-status-current-primary strong {
    color: var(--ds-text);
    font-size: 18px;
}

html[dir="rtl"] .case-status-current-primary small {
    color: var(--ds-text-muted);
    font-size: 12px;
    font-weight: 800;
}

html[dir="rtl"] .case-status-current-list,
html[dir="rtl"] .case-status-summary-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

html[dir="rtl"] .case-status-current-list > div,
html[dir="rtl"] .case-status-summary-list > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(161, 137, 106, 0.08);
}

html[dir="rtl"] .case-status-current-list dt,
html[dir="rtl"] .case-status-summary-list dt {
    color: var(--ds-text-muted);
    font-size: 12px;
    font-weight: 800;
}

html[dir="rtl"] .case-status-current-list dd,
html[dir="rtl"] .case-status-summary-list dd {
    margin: 0;
    color: var(--ds-text);
    font-size: 13px;
    font-weight: 800;
    text-align: left;
}

html[dir="rtl"] .case-status-actions-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}

html[dir="rtl"] .case-status-actions-head h2 {
    margin: 4px 0 6px;
    color: var(--ds-text);
    font-size: 24px;
}

html[dir="rtl"] .case-status-success {
    min-width: 220px;
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(230, 244, 235, 0.95);
    border: 1px solid rgba(72, 154, 102, 0.16);
    color: #2d7e54;
    font-weight: 900;
    font-size: 13px;
}

html[dir="rtl"] .case-status-actions-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(210px, 240px);
    gap: 14px;
    align-items: start;
}

html[dir="rtl"] .case-status-subhead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

html[dir="rtl"] .case-status-subhead h3 {
    margin: 0;
    color: var(--ds-text);
    font-size: 17px;
}

html[dir="rtl"] .case-status-subhead span {
    color: var(--ds-text-muted);
    font-size: 12px;
    font-weight: 800;
}

html[dir="rtl"] .case-status-option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

html[dir="rtl"] .case-status-option-card {
    position: relative;
    min-height: 118px;
    padding: 14px 14px 12px;
    border-radius: 18px;
    border: 1px solid rgba(161, 137, 106, 0.14);
    background: rgba(255, 255, 255, 0.88);
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    cursor: pointer;
    transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

html[dir="rtl"] .case-status-option-card:hover {
    transform: translateY(-2px);
    border-color: rgba(184, 132, 73, 0.28);
    background: rgba(255, 250, 244, 0.98);
    box-shadow: 0 14px 26px rgba(53, 38, 24, 0.07);
}

html[dir="rtl"] .case-status-option-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

html[dir="rtl"] .case-status-option-card.is-selected {
    border-color: rgba(165, 122, 55, 0.52);
    background: linear-gradient(180deg, rgba(255, 250, 243, 0.98), rgba(250, 244, 235, 0.96));
    box-shadow: inset 4px 0 0 rgba(165, 122, 55, 0.64), 0 16px 28px rgba(184, 132, 73, 0.12);
}

html[dir="rtl"] .case-status-option-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 900;
    background: rgba(184, 132, 73, 0.1);
    border: 1px solid rgba(184, 132, 73, 0.18);
    color: var(--ds-brand-deep);
}

html[dir="rtl"] .case-status-option-content {
    display: grid;
    gap: 6px;
    min-width: 0;
}

html[dir="rtl"] .case-status-option-content strong {
    color: var(--ds-text);
    font-size: 16px;
}

html[dir="rtl"] .case-status-option-content small {
    color: var(--ds-text-muted);
    font-size: 12px;
    line-height: 1.55;
}

html[dir="rtl"] .case-status-option-action {
    grid-column: 2;
    width: fit-content;
    max-width: 100%;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(31, 26, 22, 0.05);
    color: var(--ds-text-soft);
    font-size: 11px;
    font-weight: 900;
}

html[dir="rtl"] .case-status-option-card.is-active .case-status-option-icon,
html[dir="rtl"] .case-status-option-card.is-selected .case-status-option-icon {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

html[dir="rtl"] .case-status-option-card.is-active .case-status-option-icon,
html[dir="rtl"] .case-status-option-card.is-active .case-status-option-action,
html[dir="rtl"] .case-status-option-card.is-selected.is-active .case-status-option-icon {
    color: #2d7e54;
    background: rgba(230, 244, 235, 0.9);
    border-color: rgba(72, 154, 102, 0.2);
}

html[dir="rtl"] .case-status-option-card.is-waiting .case-status-option-icon,
html[dir="rtl"] .case-status-option-card.is-waiting .case-status-option-action {
    color: #a56f20;
    background: rgba(255, 244, 222, 0.92);
    border-color: rgba(196, 140, 55, 0.2);
}

html[dir="rtl"] .case-status-option-card.is-danger .case-status-option-icon,
html[dir="rtl"] .case-status-option-card.is-danger .case-status-option-action {
    color: #b95339;
    background: rgba(255, 237, 233, 0.92);
    border-color: rgba(185, 83, 57, 0.2);
}

html[dir="rtl"] .case-status-option-card.is-closed .case-status-option-icon,
html[dir="rtl"] .case-status-option-card.is-closed .case-status-option-action {
    color: #637083;
    background: rgba(245, 247, 250, 0.94);
    border-color: rgba(99, 112, 131, 0.16);
}

html[dir="rtl"] .case-status-allowed-card,
html[dir="rtl"] .case-status-note-card,
html[dir="rtl"] .case-status-summary-card {
    padding: 14px;
    border-radius: 18px;
    background: rgba(250, 247, 242, 0.78);
    border: 1px solid rgba(161, 137, 106, 0.1);
}

html[dir="rtl"] .case-status-allowed-list {
    display: grid;
    gap: 8px;
}

html[dir="rtl"] .case-status-allowed-item {
    appearance: none;
    border: 1px solid rgba(161, 137, 106, 0.12);
    background: rgba(255, 255, 255, 0.82);
    color: var(--ds-text);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: right;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

html[dir="rtl"] .case-status-allowed-item:hover,
html[dir="rtl"] .case-status-allowed-item.is-active {
    transform: translateX(-2px);
    border-color: rgba(184, 132, 73, 0.28);
    background: rgba(255, 250, 244, 0.98);
}

html[dir="rtl"] .case-status-allowed-item span {
    width: 30px;
    height: 30px;
    border-radius: 11px;
    background: rgba(184, 132, 73, 0.1);
    color: var(--ds-brand-deep);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

html[dir="rtl"] .case-status-allowed-item strong,
html[dir="rtl"] .case-status-allowed-empty {
    font-size: 13px;
}

html[dir="rtl"] .case-status-allowed-empty {
    color: var(--ds-text-muted);
}

html[dir="rtl"] .case-status-action-form {
    display: grid;
    gap: 14px;
}

html[dir="rtl"] .case-status-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: 14px;
    align-items: stretch;
}

html[dir="rtl"] .case-status-note-card label,
html[dir="rtl"] .case-status-assignee-field label {
    color: var(--ds-text);
    font-size: 13px;
    font-weight: 900;
}

html[dir="rtl"] .case-status-note-card textarea {
    min-height: 112px;
    border-radius: 16px;
    border-color: rgba(161, 137, 106, 0.16);
    background: rgba(255, 255, 255, 0.94);
}

html[dir="rtl"] .case-status-note-card small {
    color: var(--ds-text-muted);
    font-size: 12px;
}

html[dir="rtl"] .case-status-field-error {
    padding: 9px 12px;
    border-radius: 12px;
    background: rgba(255, 237, 233, 0.95);
    color: #b95339;
    font-size: 12px;
    font-weight: 800;
}

html[dir="rtl"] .case-status-assignee-field {
    display: grid;
    gap: 8px;
}

html[dir="rtl"] .case-status-action-footer {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

html[dir="rtl"] .case-status-action-footer .button[disabled] {
    opacity: .52;
    cursor: not-allowed;
    box-shadow: none;
}

html[dir="rtl"] .case-status-empty-state {
    min-height: 220px;
    border-radius: 20px;
    border: 1px dashed rgba(161, 137, 106, 0.2);
    background: rgba(255, 252, 247, 0.78);
    display: grid;
    place-items: center;
    justify-items: center;
    gap: 8px;
    text-align: center;
    color: var(--ds-text-muted);
    padding: 28px;
}

html[dir="rtl"] .case-status-empty-state strong {
    color: var(--ds-text);
    font-size: 18px;
}

html[dir="rtl"] .case-status-empty-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: rgba(184, 132, 73, 0.1);
    color: var(--ds-brand-deep);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
}

html[dir="rtl"] .case-notes-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    grid-template-areas: "main summary";
    gap: 14px;
    align-items: start;
    direction: ltr;
}

html[dir="rtl"] .case-notes-main-card,
html[dir="rtl"] .case-notes-summary-card {
    direction: rtl;
    border: 1px solid rgba(161, 137, 106, 0.12);
    background: rgba(255, 253, 249, 0.96);
}

html[dir="rtl"] .case-notes-main-card {
    grid-area: main;
    display: grid;
    gap: 16px;
}

html[dir="rtl"] .case-notes-summary-card {
    grid-area: summary;
    position: sticky;
    top: 14px;
    display: grid;
    gap: 14px;
}

html[dir="rtl"] .case-notes-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(161, 137, 106, 0.1);
}

html[dir="rtl"] .case-notes-head h2 {
    margin: 4px 0 5px;
    color: var(--ds-text);
    font-size: 24px;
}

html[dir="rtl"] .case-notes-list {
    display: grid;
    gap: 10px;
}

html[dir="rtl"] .case-note-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(161, 137, 106, 0.12);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 22px rgba(53, 38, 24, 0.035);
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

html[dir="rtl"] .case-note-item:hover {
    transform: translateY(-1px);
    border-color: rgba(184, 132, 73, 0.24);
    background: rgba(255, 250, 244, 0.96);
}

html[dir="rtl"] .case-note-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(184, 132, 73, 0.12);
    color: var(--ds-brand-deep);
    border: 1px solid rgba(184, 132, 73, 0.18);
    font-weight: 900;
}

html[dir="rtl"] .case-note-body {
    min-width: 0;
    display: grid;
    gap: 8px;
}

html[dir="rtl"] .case-note-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

html[dir="rtl"] .case-note-meta div {
    display: flex;
    gap: 7px;
    align-items: baseline;
    flex-wrap: wrap;
}

html[dir="rtl"] .case-note-meta strong {
    color: var(--ds-text);
    font-size: 14px;
}

html[dir="rtl"] .case-note-meta span,
html[dir="rtl"] .case-note-meta time {
    color: var(--ds-text-muted);
    font-size: 12px;
    font-weight: 800;
}

html[dir="rtl"] .case-note-content {
    margin: 0;
    color: var(--ds-text);
    font-size: 14px;
    line-height: 1.75;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

html[dir="rtl"] .case-note-item:not(.is-expanded) .case-note-content {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

html[dir="rtl"] .case-note-expand {
    width: fit-content;
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--ds-brand-deep);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    padding: 0;
}

html[dir="rtl"] .case-notes-empty {
    min-height: 300px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 10px;
    text-align: center;
    color: var(--ds-text-muted);
    border-radius: 20px;
    border: 1px dashed rgba(161, 137, 106, 0.2);
    background: rgba(250, 247, 242, 0.72);
}

html[dir="rtl"] .case-notes-empty strong {
    color: var(--ds-text);
    font-size: 21px;
}

html[dir="rtl"] .case-notes-empty p {
    margin: 0;
}

html[dir="rtl"] .case-notes-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(184, 132, 73, 0.1);
    border: 1px solid rgba(184, 132, 73, 0.18);
    font-size: 26px;
}

html[dir="rtl"] .case-notes-composer {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: 20px;
    border: 1px solid rgba(161, 137, 106, 0.14);
    background: linear-gradient(180deg, rgba(255, 252, 247, 0.95), rgba(248, 244, 238, 0.82));
}

html[dir="rtl"] .case-notes-composer label {
    color: var(--ds-text);
    font-weight: 900;
    font-size: 14px;
}

html[dir="rtl"] .case-notes-composer textarea {
    min-height: 96px;
    resize: vertical;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(161, 137, 106, 0.14);
    padding: 12px 14px;
    line-height: 1.7;
}

html[dir="rtl"] .case-notes-composer textarea:focus {
    outline: none;
    border-color: rgba(184, 132, 73, 0.36);
    box-shadow: 0 0 0 3px rgba(184, 132, 73, 0.08);
}

html[dir="rtl"] .case-notes-composer-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

html[dir="rtl"] .case-notes-composer-footer span {
    color: #b95339;
    font-size: 12px;
    font-weight: 800;
}

html[dir="rtl"] .case-notes-summary-metric {
    padding: 16px;
    border-radius: 18px;
    background: rgba(250, 247, 242, 0.86);
    border: 1px solid rgba(161, 137, 106, 0.1);
    display: grid;
    gap: 3px;
}

html[dir="rtl"] .case-notes-summary-metric strong {
    color: var(--ds-brand-deep);
    font-size: 36px;
    line-height: 1;
}

html[dir="rtl"] .case-notes-summary-metric span {
    color: var(--ds-text-muted);
    font-size: 12px;
    font-weight: 900;
}

html[dir="rtl"] .case-notes-summary-list {
    display: grid;
    gap: 8px;
    margin: 0;
}

html[dir="rtl"] .case-notes-summary-list div {
    padding: 11px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(161, 137, 106, 0.08);
}

html[dir="rtl"] .case-notes-summary-list dt {
    color: var(--ds-text-muted);
    font-size: 11px;
    font-weight: 900;
}

html[dir="rtl"] .case-notes-summary-list dd {
    margin: 3px 0 0;
    color: var(--ds-text);
    font-size: 13px;
    font-weight: 900;
}

html[dir="rtl"] .case-notes-shell {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 286px);
    grid-template-areas:
        "composer summary"
        "feed tools";
}

html[dir="rtl"] .case-notes-composer-card {
    grid-area: composer;
    direction: rtl;
}

html[dir="rtl"] .case-notes-feed-card {
    grid-area: feed;
    direction: rtl;
}

html[dir="rtl"] .case-notes-side-tools {
    grid-area: tools;
    direction: rtl;
    display: grid;
    gap: 14px;
}

html[dir="rtl"] .case-notes-composer-card,
html[dir="rtl"] .case-notes-feed-card,
html[dir="rtl"] .case-notes-filter-card,
html[dir="rtl"] .case-notes-pinned-card {
    border: 1px solid rgba(161, 137, 106, 0.12);
    background: rgba(255, 253, 249, 0.96);
}

html[dir="rtl"] .case-notes-composer {
    box-shadow: none;
}

html[dir="rtl"] .case-notes-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

html[dir="rtl"] .case-notes-form-block {
    display: grid;
    gap: 8px;
}

html[dir="rtl"] .case-notes-form-block > strong,
html[dir="rtl"] .case-notes-inline-fields label > span,
html[dir="rtl"] .case-notes-search span,
html[dir="rtl"] .case-notes-sort span {
    color: var(--ds-text);
    font-size: 12px;
    font-weight: 900;
}

html[dir="rtl"] .case-notes-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

html[dir="rtl"] .case-notes-chip input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    margin: 0;
    inset-inline-start: 0;
    inset-block-start: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    opacity: 0;
    pointer-events: none;
}

html[dir="rtl"] .case-notes-chip span {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 13px;
    border-radius: 999px;
    border: 1px solid rgba(161, 137, 106, 0.16);
    background: rgba(255, 255, 255, 0.86);
    color: var(--ds-text-muted);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

html[dir="rtl"] .case-notes-chip span:hover,
html[dir="rtl"] .case-notes-chip input:checked + span {
    transform: translateY(-1px);
    border-color: rgba(184, 132, 73, 0.34);
    background: rgba(255, 246, 232, 0.98);
    color: var(--ds-brand-deep);
}

html[dir="rtl"] .case-notes-inline-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, .65fr) auto;
    gap: 10px;
    align-items: end;
}

html[dir="rtl"] .case-notes-inline-fields label {
    display: grid;
    gap: 7px;
}

html[dir="rtl"] .case-notes-inline-fields input[type="text"],
html[dir="rtl"] .case-note-edit-row input,
html[dir="rtl"] .case-note-edit-row select,
html[dir="rtl"] .case-notes-search input,
html[dir="rtl"] .case-notes-sort select {
    min-height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(161, 137, 106, 0.14);
    background: rgba(255, 255, 255, 0.92);
    padding: 9px 12px;
}

html[dir="rtl"] .case-notes-attachment-button,
html[dir="rtl"] .case-notes-pin-toggle {
    min-height: 58px;
    border-radius: 16px;
    border: 1px solid rgba(161, 137, 106, 0.14);
    background: rgba(255, 255, 255, 0.84);
    padding: 10px 12px;
    cursor: pointer;
}

html[dir="rtl"] .case-notes-attachment-button small {
    color: var(--ds-text-muted);
    font-size: 11px;
    font-weight: 800;
}

html[dir="rtl"] .case-notes-pin-toggle {
    display: flex !important;
    align-items: center;
    gap: 8px;
    color: var(--ds-text-muted);
    font-weight: 900;
    font-size: 12px;
}

html[dir="rtl"] .case-notes-pin-toggle input {
    inline-size: 16px;
    block-size: 16px;
    flex: 0 0 16px;
    margin: 0;
}

html[dir="rtl"] .case-notes-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

html[dir="rtl"] .case-notes-summary-grid div {
    min-height: 86px;
    padding: 13px;
    border-radius: 16px;
    background: rgba(250, 247, 242, 0.86);
    border: 1px solid rgba(161, 137, 106, 0.1);
    display: grid;
    align-content: center;
    gap: 3px;
}

html[dir="rtl"] .case-notes-summary-grid strong {
    color: var(--ds-brand-deep);
    font-size: 28px;
    line-height: 1;
}

html[dir="rtl"] .case-notes-summary-grid span {
    color: var(--ds-text-muted);
    font-size: 11px;
    font-weight: 900;
}

html[dir="rtl"] .case-notes-feed-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(161, 137, 106, 0.1);
}

html[dir="rtl"] .case-notes-feed-head h2 {
    margin: 4px 0 5px;
    color: var(--ds-text);
    font-size: 24px;
}

html[dir="rtl"] .case-notes-feed-count {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(184, 132, 73, 0.1);
    color: var(--ds-brand-deep);
    font-size: 12px;
    font-weight: 900;
}

html[dir="rtl"] .case-note-item.is-pinned {
    border-color: rgba(184, 132, 73, 0.34);
    background: linear-gradient(180deg, rgba(255, 250, 242, 0.98), rgba(255, 255, 255, 0.92));
    box-shadow: inset 4px 0 0 rgba(184, 132, 73, 0.52), 0 12px 24px rgba(53, 38, 24, 0.045);
}

html[dir="rtl"] .case-note-item.is-highlighted {
    border-color: rgba(184, 132, 73, 0.55);
    box-shadow: 0 0 0 4px rgba(184, 132, 73, 0.12), 0 16px 32px rgba(53, 38, 24, 0.08);
}

html[dir="rtl"] .case-note-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

html[dir="rtl"] .case-note-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(184, 132, 73, 0.11);
    color: var(--ds-brand-deep);
    font-size: 11px;
    font-weight: 900;
}

html[dir="rtl"] .case-note-badge.is-soft {
    background: rgba(31, 26, 22, 0.05);
    color: var(--ds-text-muted);
}

html[dir="rtl"] .case-note-badge.is-topic {
    background: rgba(231, 241, 255, 0.82);
    color: #486b94;
}

html[dir="rtl"] .case-note-badge.is-pinned {
    background: rgba(255, 242, 214, 0.95);
    color: #9a681c;
}

html[dir="rtl"] .case-note-attachment {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 9px 11px;
    border-radius: 14px;
    background: rgba(250, 247, 242, 0.8);
    border: 1px solid rgba(161, 137, 106, 0.12);
    color: inherit;
    text-decoration: none;
}

html[dir="rtl"] .case-note-attachment > span {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(184, 132, 73, 0.12);
    color: var(--ds-brand-deep);
    font-size: 11px;
    font-weight: 900;
}

html[dir="rtl"] .case-note-attachment div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

html[dir="rtl"] .case-note-attachment strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}

html[dir="rtl"] .case-note-attachment small {
    color: var(--ds-text-muted);
    font-size: 11px;
    font-weight: 800;
}

html[dir="rtl"] .case-note-actions,
html[dir="rtl"] .case-note-edit-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

html[dir="rtl"] .case-note-actions form {
    margin: 0;
}

html[dir="rtl"] .case-note-action {
    appearance: none;
    border: 1px solid rgba(161, 137, 106, 0.12);
    background: rgba(255, 255, 255, 0.86);
    color: var(--ds-text-muted);
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
}

html[dir="rtl"] .case-note-action:hover {
    color: var(--ds-brand-deep);
    border-color: rgba(184, 132, 73, 0.26);
}

html[dir="rtl"] .case-note-action.is-danger:hover {
    color: #b95339;
    border-color: rgba(185, 83, 57, 0.24);
}

html[dir="rtl"] .case-note-edit-form {
    display: grid;
    gap: 9px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(250, 247, 242, 0.78);
    border: 1px solid rgba(161, 137, 106, 0.1);
}

html[dir="rtl"] .case-note-edit-form[hidden] {
    display: none;
}

html[dir="rtl"] .case-note-edit-form textarea {
    min-height: 92px;
    resize: vertical;
    border-radius: 14px;
    border: 1px solid rgba(161, 137, 106, 0.14);
    padding: 10px 12px;
}

html[dir="rtl"] .case-note-edit-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

html[dir="rtl"] .case-notes-search,
html[dir="rtl"] .case-notes-sort {
    display: grid;
    gap: 7px;
}

html[dir="rtl"] .case-notes-filter-buttons {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin: 12px 0;
}

html[dir="rtl"] .case-notes-filter-buttons button {
    appearance: none;
    border: 1px solid rgba(161, 137, 106, 0.14);
    background: rgba(255, 255, 255, 0.86);
    color: var(--ds-text-muted);
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
}

html[dir="rtl"] .case-notes-filter-buttons button.is-active,
html[dir="rtl"] .case-notes-filter-buttons button:hover {
    color: var(--ds-brand-deep);
    border-color: rgba(184, 132, 73, 0.28);
    background: rgba(255, 246, 232, 0.94);
}

html[dir="rtl"] .case-notes-pinned-list {
    display: grid;
    gap: 8px;
}

html[dir="rtl"] .case-notes-pinned-item {
    appearance: none;
    border: 1px solid rgba(184, 132, 73, 0.16);
    background: rgba(255, 250, 242, 0.94);
    border-radius: 14px;
    padding: 11px;
    text-align: right;
    display: grid;
    gap: 4px;
    cursor: pointer;
}

html[dir="rtl"] .case-notes-pinned-item strong {
    color: var(--ds-text);
    font-size: 12px;
}

html[dir="rtl"] .case-notes-pinned-item span {
    color: var(--ds-text-muted);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.5;
}

html[dir="rtl"] .case-notes-empty.is-filtered {
    min-height: 190px;
}

html[dir="rtl"] .case-notes-empty[hidden] {
    display: none !important;
}

html[dir="rtl"] .case-chat-shell {
    display: grid;
    grid-template-columns: 254px minmax(0, 1fr) 280px;
    grid-template-areas: "topics conversation details";
    gap: 14px;
    align-items: start;
    direction: ltr;
}

html[dir="rtl"] .case-chat-topics-card,
html[dir="rtl"] .case-chat-center-card,
html[dir="rtl"] .case-chat-details-card {
    direction: rtl;
}

html[dir="rtl"] .case-chat-topics-card {
    grid-area: topics;
    position: sticky;
    top: 14px;
}

html[dir="rtl"] .case-chat-center-card {
    grid-area: conversation;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 12px;
    min-width: 0;
    min-height: 280px;
    height: clamp(280px, calc(100vh - 500px), 700px);
}

html[dir="rtl"] .case-chat-details-card {
    grid-area: details;
    position: sticky;
    top: 14px;
    display: grid;
    gap: 14px;
}

html[dir="rtl"] .case-chat-topic-list {
    display: grid;
    gap: 10px;
    margin: 12px 0;
}

html[dir="rtl"] .case-chat-topic {
    appearance: none;
    border: 1px solid rgba(161, 137, 106, 0.14);
    background: rgba(255, 255, 255, 0.92);
    border-radius: 18px;
    padding: 12px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    text-align: right;
    cursor: pointer;
    transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

html[dir="rtl"] .case-chat-topic:hover,
html[dir="rtl"] .case-chat-topic.is-active {
    transform: translateX(-2px);
    border-color: rgba(184, 132, 73, 0.28);
    background: rgba(255, 250, 244, 0.98);
    box-shadow: inset 4px 0 0 rgba(165, 122, 55, 0.58), 0 12px 22px rgba(184, 132, 73, 0.08);
}

html[dir="rtl"] .case-chat-topic-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(184, 132, 73, 0.12);
    border: 1px solid rgba(184, 132, 73, 0.18);
    color: var(--ds-brand-deep);
    font-weight: 900;
}

html[dir="rtl"] .case-chat-topic-content {
    display: grid;
    gap: 4px;
    min-width: 0;
}

html[dir="rtl"] .case-chat-topic-content strong {
    color: var(--ds-text);
    font-size: 14px;
}

html[dir="rtl"] .case-chat-topic-content small,
html[dir="rtl"] .case-chat-topic-meta {
    color: var(--ds-text-muted);
    font-size: 11px;
    font-weight: 800;
}

html[dir="rtl"] .case-chat-topic-content small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[dir="rtl"] .case-chat-conversation-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(161, 137, 106, 0.1);
}

html[dir="rtl"] .case-chat-conversation-head h2 {
    margin: 4px 0 5px;
    color: var(--ds-text);
    font-size: 24px;
}

html[dir="rtl"] .case-chat-head-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

html[dir="rtl"] .case-chat-thread {
    overflow-y: auto;
    overscroll-behavior: contain;
    min-height: 0;
    padding: 16px 10px 18px;
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(255, 252, 247, 0.82), rgba(250, 247, 242, 0.72));
    border: 1px solid rgba(161, 137, 106, 0.08);
    display: grid;
    align-content: start;
    gap: 12px;
}

html[dir="rtl"] .case-chat-date-pill {
    justify-self: center;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(31, 26, 22, 0.05);
    color: var(--ds-text-muted);
    font-size: 11px;
    font-weight: 900;
}

html[dir="rtl"] .case-chat-message {
    display: grid;
    grid-template-columns: 36px minmax(0, 74%);
    gap: 10px;
    align-items: end;
}

html[dir="rtl"] .case-chat-message.is-mine {
    grid-template-columns: minmax(0, 74%) 36px;
    justify-content: end;
}

html[dir="rtl"] .case-chat-message.is-mine .case-chat-avatar {
    grid-column: 2;
}

html[dir="rtl"] .case-chat-message.is-mine .case-chat-bubble {
    grid-column: 1;
    grid-row: 1;
}

html[dir="rtl"] .case-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #fff7df, #f0d7a3);
    color: var(--ds-brand-deep);
    border: 1px solid rgba(184, 132, 73, 0.22);
    font-weight: 900;
    box-shadow: 0 6px 14px rgba(53, 38, 24, 0.08);
}

html[dir="rtl"] .case-chat-avatar.small {
    width: 30px;
    height: 30px;
    font-size: 12px;
    flex: 0 0 30px;
}

html[dir="rtl"] .case-chat-bubble {
    min-width: 0;
    padding: 12px 14px;
    border-radius: 18px 18px 18px 6px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(161, 137, 106, 0.12);
    box-shadow: 0 12px 24px rgba(53, 38, 24, 0.045);
}

html[dir="rtl"] .case-chat-message.is-mine .case-chat-bubble {
    border-radius: 18px 18px 6px 18px;
    background: linear-gradient(180deg, rgba(255, 248, 236, 0.98), rgba(246, 236, 219, 0.94));
    border-color: rgba(184, 132, 73, 0.18);
}

html[dir="rtl"] .case-chat-bubble header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 7px;
}

html[dir="rtl"] .case-chat-bubble header div {
    display: grid;
    gap: 2px;
}

html[dir="rtl"] .case-chat-bubble strong {
    color: var(--ds-text);
    font-size: 13px;
}

html[dir="rtl"] .case-chat-bubble span,
html[dir="rtl"] .case-chat-bubble time,
html[dir="rtl"] .case-chat-read-state {
    color: var(--ds-text-muted);
    font-size: 11px;
    font-weight: 800;
}

html[dir="rtl"] .case-chat-bubble p {
    margin: 0;
    color: var(--ds-text);
    line-height: 1.7;
    font-size: 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

html[dir="rtl"] .case-chat-read-state {
    display: block;
    margin-top: 8px;
    text-align: left;
}

html[dir="rtl"] .case-chat-empty {
    min-height: 100%;
    display: grid;
    place-items: center;
    justify-items: center;
    align-content: center;
    gap: 10px;
    text-align: center;
    color: var(--ds-text-muted);
    padding: 32px;
}

html[dir="rtl"] .case-chat-empty strong {
    color: var(--ds-text);
    font-size: 22px;
}

html[dir="rtl"] .case-chat-empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(184, 132, 73, 0.1);
    border: 1px solid rgba(184, 132, 73, 0.18);
    font-size: 28px;
}

html[dir="rtl"] .case-chat-composer {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 46px;
    gap: 10px;
    align-items: end;
    padding: 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(161, 137, 106, 0.14);
    box-shadow: 0 12px 24px rgba(53, 38, 24, 0.045);
}

html[dir="rtl"] .case-chat-composer textarea {
    min-height: 44px;
    max-height: 126px;
    resize: none;
    border: 0;
    background: transparent;
    padding: 11px 6px;
    box-shadow: none;
}

html[dir="rtl"] .case-chat-composer textarea:focus {
    outline: none;
}

html[dir="rtl"] .case-chat-composer-icon,
html[dir="rtl"] .case-chat-send-button {
    appearance: none;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(161, 137, 106, 0.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

html[dir="rtl"] .case-chat-composer-icon {
    background: rgba(248, 244, 238, 0.92);
    color: var(--ds-text-muted);
}

html[dir="rtl"] .case-chat-send-button {
    background: linear-gradient(180deg, var(--ds-brand) 0%, var(--ds-brand-deep) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 20px rgba(184, 132, 73, 0.22);
}

html[dir="rtl"] .case-chat-composer-icon:hover,
html[dir="rtl"] .case-chat-send-button:hover {
    transform: translateY(-2px);
}

html[dir="rtl"] .case-chat-details-section {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(250, 247, 242, 0.78);
    border: 1px solid rgba(161, 137, 106, 0.1);
}

html[dir="rtl"] .case-chat-details-section > strong,
html[dir="rtl"] .case-chat-details-head strong {
    color: var(--ds-text);
    font-size: 14px;
}

html[dir="rtl"] .case-chat-details-section > span,
html[dir="rtl"] .case-chat-details-head span {
    color: var(--ds-text-muted);
    font-size: 12px;
    font-weight: 800;
}

html[dir="rtl"] .case-chat-details-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

html[dir="rtl"] .case-chat-participant-list,
html[dir="rtl"] .case-chat-file-list {
    display: grid;
    gap: 8px;
}

html[dir="rtl"] .case-chat-participant,
html[dir="rtl"] .case-chat-file-card,
html[dir="rtl"] .case-chat-muted-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(161, 137, 106, 0.08);
}

html[dir="rtl"] .case-chat-participant div,
html[dir="rtl"] .case-chat-file-card div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

html[dir="rtl"] .case-chat-participant strong,
html[dir="rtl"] .case-chat-file-card strong {
    color: var(--ds-text);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[dir="rtl"] .case-chat-participant small,
html[dir="rtl"] .case-chat-file-card small,
html[dir="rtl"] .case-chat-muted-row {
    color: var(--ds-text-muted);
    font-size: 11px;
    font-weight: 800;
}

html[dir="rtl"] .case-chat-file-card {
    color: inherit;
    text-decoration: none;
    transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

html[dir="rtl"] .case-chat-file-card:hover {
    transform: translateY(-1px);
    border-color: rgba(184, 132, 73, 0.22);
    background: rgba(255, 250, 244, 0.98);
}

html[dir="rtl"] .case-chat-file-card > span {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex: 0 0 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(184, 132, 73, 0.1);
    border: 1px solid rgba(184, 132, 73, 0.16);
    color: var(--ds-brand-deep);
    font-size: 11px;
    font-weight: 900;
}

html[dir="rtl"] .case-chat-center-card {
    background: rgba(255, 253, 249, 0.98);
    box-shadow: 0 18px 40px rgba(53, 38, 24, 0.055);
}

html[dir="rtl"] .case-chat-thread {
    padding: 22px 18px;
    gap: 16px;
    direction: ltr;
    background:
        radial-gradient(circle at 18% 8%, rgba(184, 132, 73, 0.05), transparent 30%),
        linear-gradient(180deg, rgba(255, 253, 249, 0.92), rgba(248, 245, 240, 0.82));
}

html[dir="rtl"] .case-chat-date-pill {
    position: relative;
    direction: rtl;
    margin: 4px 0;
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(161, 137, 106, 0.12);
    box-shadow: 0 8px 18px rgba(53, 38, 24, 0.04);
}

html[dir="rtl"] .case-chat-message,
html[dir="rtl"] .case-chat-message.is-mine {
    width: fit-content;
    max-width: min(74%, 680px);
    display: flex;
    align-items: flex-end;
    gap: 10px;
    direction: ltr;
    transition: transform 150ms ease, filter 150ms ease;
}

html[dir="rtl"] .case-chat-message.is-other {
    justify-self: left;
    flex-direction: row;
}

html[dir="rtl"] .case-chat-message.is-mine {
    justify-self: right;
    flex-direction: row-reverse;
}

html[dir="rtl"] .case-chat-message:hover {
    transform: translateY(-1px);
    filter: drop-shadow(0 10px 18px rgba(53, 38, 24, 0.045));
}

html[dir="rtl"] .case-chat-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    font-size: 13px;
}

html[dir="rtl"] .case-chat-bubble {
    direction: rtl;
    min-width: 176px;
    padding: 12px 14px 10px;
    border-radius: 18px 18px 18px 7px;
    background: #f6f5f2;
    border-color: rgba(31, 26, 22, 0.07);
    box-shadow: 0 12px 24px rgba(53, 38, 24, 0.04);
}

html[dir="rtl"] .case-chat-message.is-mine .case-chat-bubble {
    border-radius: 18px 18px 7px 18px;
    background: linear-gradient(180deg, #fff7e8, #f4e7d0);
    border-color: rgba(184, 132, 73, 0.22);
}

html[dir="rtl"] .case-chat-bubble header {
    margin-bottom: 8px;
    align-items: center;
}

html[dir="rtl"] .case-chat-bubble header div {
    display: flex;
    align-items: baseline;
    gap: 7px;
    flex-wrap: wrap;
}

html[dir="rtl"] .case-chat-bubble strong {
    font-size: 13px;
    line-height: 1.2;
}

html[dir="rtl"] .case-chat-bubble time {
    padding-inline-start: 10px;
    white-space: nowrap;
}

html[dir="rtl"] .case-chat-bubble p {
    font-size: 14px;
    line-height: 1.65;
}

html[dir="rtl"] .case-chat-read-state {
    margin-top: 7px;
    color: rgba(88, 78, 65, 0.72);
}

html[dir="rtl"] .case-chat-attachment-card {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(161, 137, 106, 0.12);
    color: inherit;
    text-decoration: none;
}

html[dir="rtl"] .case-chat-attachment-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(184, 132, 73, 0.12);
    color: var(--ds-brand-deep);
    border: 1px solid rgba(184, 132, 73, 0.18);
    font-size: 11px;
    font-weight: 900;
}

html[dir="rtl"] .case-chat-attachment-icon.is-image {
    overflow: hidden;
    padding: 0;
    background: #fff;
}

html[dir="rtl"] .case-chat-attachment-icon.is-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

html[dir="rtl"] .case-chat-attachment-meta {
    display: grid;
    gap: 3px;
    min-width: 0;
}

html[dir="rtl"] .case-chat-attachment-meta strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[dir="rtl"] .case-chat-attachment-meta small,
html[dir="rtl"] .case-chat-attachment-download {
    color: var(--ds-text-muted);
    font-size: 11px;
    font-weight: 800;
}

html[dir="rtl"] .case-chat-attachment-download {
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(248, 244, 238, 0.9);
}

html[dir="rtl"] .case-chat-empty {
    min-height: 340px;
    direction: rtl;
}

html[dir="rtl"] .case-chat-empty p {
    margin: 0;
    font-size: 14px;
}

html[dir="rtl"] .case-chat-composer {
    grid-template-columns: 46px minmax(0, 1fr) 52px;
    padding: 12px;
    border-radius: 22px;
    background: #fff;
    border-color: rgba(184, 132, 73, 0.18);
    box-shadow: 0 18px 34px rgba(53, 38, 24, 0.08);
    position: relative;
    z-index: 5;
}

html[dir="rtl"] .case-chat-composer-body {
    display: grid;
    gap: 8px;
    min-width: 0;
}

html[dir="rtl"] .case-chat-composer textarea {
    min-height: 46px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(248, 246, 242, 0.92);
}

html[dir="rtl"] .case-chat-composer-icon,
html[dir="rtl"] .case-chat-send-button {
    width: 46px;
    height: 46px;
    border-radius: 16px;
}

html[dir="rtl"] .case-chat-composer-icon {
    font-size: 19px;
    background: rgba(248, 244, 238, 0.96);
}

html[dir="rtl"] .case-chat-composer-icon:disabled,
html[dir="rtl"] .case-chat-send-button:disabled {
    opacity: .58;
    cursor: wait;
    transform: none;
}

html[dir="rtl"] .case-chat-send-button {
    font-size: 18px;
}

html[dir="rtl"] .case-chat-attachment-preview {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

html[dir="rtl"] .case-chat-selected-file {
    min-width: min(100%, 210px);
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 14px;
    background: rgba(255, 250, 244, 0.96);
    border: 1px solid rgba(184, 132, 73, 0.18);
}

html[dir="rtl"] .case-chat-selected-file span {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(184, 132, 73, 0.12);
    color: var(--ds-brand-deep);
    font-size: 10px;
    font-weight: 900;
}

html[dir="rtl"] .case-chat-selected-file strong {
    color: var(--ds-text);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[dir="rtl"] .case-chat-selected-file small {
    color: var(--ds-text-muted);
    font-size: 11px;
    font-weight: 800;
}

html[dir="rtl"] .case-chat-selected-file button {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 0;
    background: rgba(31, 26, 22, 0.06);
    color: var(--ds-text-muted);
    cursor: pointer;
    font-weight: 900;
}

html[dir="rtl"] .case-chat-upload-status {
    width: fit-content;
    max-width: 100%;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

html[dir="rtl"] .case-chat-upload-status[data-kind="info"] {
    background: rgba(247, 242, 233, 0.95);
    color: var(--ds-brand-deep);
}

html[dir="rtl"] .case-chat-upload-status[data-kind="success"] {
    background: rgba(230, 244, 235, 0.95);
    color: #2d7e54;
}

html[dir="rtl"] .case-chat-upload-status[data-kind="error"] {
    background: rgba(255, 237, 233, 0.95);
    color: #b95339;
}

html[dir="rtl"] .case-chat-participant {
    padding: 11px;
    background: rgba(255, 255, 255, 0.9);
}

html[dir="rtl"] .case-chat-participant:hover {
    background: rgba(255, 250, 244, 0.98);
    border-color: rgba(184, 132, 73, 0.18);
}

@media (max-width: 1180px) {
    html[dir="rtl"] .case-files-shell {
        grid-template-columns: 1fr;
        grid-template-areas:
            "categories"
            "center"
            "detail";
        direction: rtl;
    }

    html[dir="rtl"] .case-files-toolbar {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .case-status-actions-shell,
    html[dir="rtl"] .case-status-actions-layout,
    html[dir="rtl"] .case-status-form-grid,
    html[dir="rtl"] .case-chat-shell {
        grid-template-columns: 1fr;
        grid-template-areas:
            "topics"
            "conversation"
            "details";
        direction: rtl;
    }

    html[dir="rtl"] .case-notes-shell {
        grid-template-columns: 1fr;
        grid-template-areas:
            "composer"
            "summary"
            "feed"
            "tools";
        direction: rtl;
    }

    html[dir="rtl"] .case-notes-form-grid,
    html[dir="rtl"] .case-notes-inline-fields,
    html[dir="rtl"] .case-note-edit-row {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .case-status-current-card,
    html[dir="rtl"] .case-chat-topics-card,
    html[dir="rtl"] .case-chat-details-card,
    html[dir="rtl"] .case-notes-summary-card {
        position: static;
    }

    html[dir="rtl"] .case-file-detail-card,
    html[dir="rtl"] .case-files-categories-card {
        position: static;
    }

    html[dir="rtl"] .case-files-toolbar-filters,
    html[dir="rtl"] .case-files-upload-meta {
        flex-direction: column;
        align-items: stretch;
    }

    html[dir="rtl"] .case-chat-center-card {
        grid-template-rows: auto minmax(260px, 1fr) auto;
        height: auto;
        min-height: 560px;
    }

    html[dir="rtl"] .case-files-upload-fields {
        grid-template-columns: 1fr;
    }
}

html[dir="rtl"] .file-group-card,
html[dir="rtl"] .chat-card,
html[dir="rtl"] .notes-card,
html[dir="rtl"] .action-card {
    background: rgba(255, 255, 255, 0.95);
}

html[dir="rtl"] .file-list-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

html[dir="rtl"] .case-actions-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

html[dir="rtl"] .action-card {
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(161, 137, 106, 0.14);
    min-height: 100%;
}

html[dir="rtl"] .case-chat-thread .chat-message,
html[dir="rtl"] .case-notes-groups .preview-list-item {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(248, 244, 238, 0.84);
}

html[dir="rtl"] .case-history-full {
    display: grid;
    gap: 14px;
}

html[dir="rtl"] .case-history-full .timeline-item {
    border: 1px solid rgba(161, 137, 106, 0.12);
    border-radius: 20px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.94);
}

html[dir="rtl"] .case-history-full .timeline-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

html[dir="rtl"] .case-history-audit-shell {
    direction: ltr;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}

html[dir="rtl"] .case-history-audit-shell > * {
    direction: rtl;
}

html[dir="rtl"] .case-history-actions-card,
html[dir="rtl"] .case-history-details-card,
html[dir="rtl"] .case-history-filter-card,
html[dir="rtl"] .case-history-timeline-card {
    border-color: rgba(176, 144, 104, 0.14);
    box-shadow: 0 18px 34px rgba(53, 38, 24, 0.05);
}

html[dir="rtl"] .case-history-main-card {
    display: grid;
    gap: 16px;
}

html[dir="rtl"] .case-history-action-stack {
    display: grid;
    gap: 10px;
}

html[dir="rtl"] .case-history-documentation-card,
html[dir="rtl"] .case-history-info-card {
    margin-top: 16px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(176, 144, 104, 0.14);
    background: rgba(255, 252, 247, 0.92);
}

html[dir="rtl"] .case-history-documentation-card {
    display: grid;
    gap: 7px;
}

html[dir="rtl"] .case-history-documentation-card span,
html[dir="rtl"] .case-history-info-card p,
html[dir="rtl"] .case-history-documentation-card small,
html[dir="rtl"] .case-history-documentation-card p {
    color: var(--ds-text-muted);
    font-size: 12px;
    margin: 0;
}

html[dir="rtl"] .case-history-documentation-card strong {
    font-size: 34px;
    color: #27935d;
    line-height: 1;
}

html[dir="rtl"] .case-history-doc-bar {
    height: 7px;
    border-radius: 999px;
    background: rgba(41, 147, 93, 0.13);
    overflow: hidden;
}

html[dir="rtl"] .case-history-doc-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #27935d;
}

html[dir="rtl"] .case-history-info-card strong {
    color: var(--ds-text);
    display: block;
    margin-bottom: 6px;
}

html[dir="rtl"] .case-history-filter-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

html[dir="rtl"] .case-history-filter-head h2 {
    margin: 4px 0 0;
}

html[dir="rtl"] .case-history-filter-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
}

html[dir="rtl"] .case-history-control {
    display: grid;
    gap: 6px;
}

html[dir="rtl"] .case-history-control span {
    color: var(--ds-text-muted);
    font-size: 12px;
    font-weight: 700;
}

html[dir="rtl"] .case-history-control input,
html[dir="rtl"] .case-history-control select {
    min-height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(176, 144, 104, 0.16);
    background: rgba(255, 255, 255, 0.95);
    padding: 0 14px;
}

html[dir="rtl"] .case-history-filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

html[dir="rtl"] .case-history-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

html[dir="rtl"] .case-history-summary-tile {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(176, 144, 104, 0.14);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 24px rgba(53, 38, 24, 0.04);
    display: grid;
    gap: 5px;
}

html[dir="rtl"] .case-history-summary-tile span,
html[dir="rtl"] .case-history-summary-tile small {
    color: var(--ds-text-muted);
    font-size: 12px;
}

html[dir="rtl"] .case-history-summary-tile strong {
    color: var(--ds-text);
    font-size: 18px;
}

html[dir="rtl"] .case-history-timeline-card {
    padding: 18px;
}

html[dir="rtl"] .case-history-timeline {
    position: relative;
    display: grid;
    gap: 10px;
    padding-inline-start: 18px;
}

html[dir="rtl"] .case-history-timeline::before {
    content: "";
    position: absolute;
    inset-block: 8px;
    inset-inline-start: 32px;
    width: 2px;
    border-radius: 999px;
    background: rgba(176, 144, 104, 0.18);
}

html[dir="rtl"] .case-history-event {
    position: relative;
    width: 100%;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 190px;
    gap: 12px;
    align-items: center;
    text-align: right;
    border: 1px solid rgba(176, 144, 104, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    padding: 12px;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

html[dir="rtl"] .case-history-event:hover,
html[dir="rtl"] .case-history-event.is-selected {
    border-color: rgba(184, 132, 73, 0.28);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(253, 247, 238, 0.96));
    box-shadow: 0 14px 28px rgba(53, 38, 24, 0.07);
    transform: translateY(-1px);
}

html[dir="rtl"] .case-history-event-dot {
    z-index: 1;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #f7f0e7;
    border: 1px solid rgba(176, 144, 104, 0.18);
}

html[dir="rtl"] .case-history-event-dot span {
    font-size: 12px;
    font-weight: 900;
    color: #a87534;
}

html[dir="rtl"] .case-history-event-body,
html[dir="rtl"] .case-history-event-actor {
    min-width: 0;
}

html[dir="rtl"] .case-history-event-body {
    display: grid;
    gap: 5px;
}

html[dir="rtl"] .case-history-event-body strong {
    color: var(--ds-text);
}

html[dir="rtl"] .case-history-event-body small,
html[dir="rtl"] .case-history-event-meta time,
html[dir="rtl"] .case-history-event-actor small {
    color: var(--ds-text-muted);
    font-size: 12px;
}

html[dir="rtl"] .case-history-event-actor-line {
    color: var(--ds-brand-deep);
    font-size: 12px;
    font-weight: 800;
}

html[dir="rtl"] .case-history-event-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

html[dir="rtl"] .case-history-event-actor {
    display: flex;
    align-items: center;
    gap: 9px;
}

html[dir="rtl"] .case-history-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #f5eadb;
    color: #9f6b2d;
    border: 1px solid rgba(176, 144, 104, 0.18);
    font-weight: 800;
}

html[dir="rtl"] .case-history-status-flow {
    display: inline-flex;
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(72, 124, 184, 0.08);
    color: #355f90;
    font-size: 12px;
    font-weight: 700;
}

html[dir="rtl"] .case-history-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: #f5efe6;
    color: #9f6b2d;
}

html[dir="rtl"] .case-history-badge.is-status { background: #eef4ff; color: #315f9c; }
html[dir="rtl"] .case-history-badge.is-file { background: #f0ecff; color: #6650a8; }
html[dir="rtl"] .case-history-badge.is-spec { background: #fff4dd; color: #9c6b19; }
html[dir="rtl"] .case-history-badge.is-pdf { background: #fff0ef; color: #b33c34; }
html[dir="rtl"] .case-history-badge.is-chat { background: #eef6ff; color: #426d9c; }
html[dir="rtl"] .case-history-badge.is-note { background: #fff7dc; color: #9c751c; }
html[dir="rtl"] .case-history-badge.is-payment { background: #eaf8ef; color: #287849; }
html[dir="rtl"] .case-history-badge.is-sla { background: #fff0ef; color: #ba473c; }
html[dir="rtl"] .case-history-badge.is-assignment { background: #f1f7ec; color: #4f7d32; }
html[dir="rtl"] .case-history-badge.is-user,
html[dir="rtl"] .case-history-badge.is-system { background: #f3f1ed; color: #6d6257; }

html[dir="rtl"] .case-history-details-card {
    position: sticky;
    top: 18px;
}

html[dir="rtl"] .case-history-details-empty,
html[dir="rtl"] .case-history-empty {
    min-height: 220px;
    display: grid;
    place-items: center;
    text-align: center;
    gap: 8px;
    color: var(--ds-text-muted);
}

html[dir="rtl"] .case-history-details-empty span,
html[dir="rtl"] .case-history-empty span {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: #f7efe5;
    color: #b88449;
    font-size: 24px;
}

html[dir="rtl"] .case-history-details-content {
    display: grid;
    gap: 14px;
}

html[dir="rtl"] .case-history-details-content h3 {
    margin: 0;
}

html[dir="rtl"] .case-history-details-list {
    display: grid;
    gap: 8px;
    margin: 0;
}

html[dir="rtl"] .case-history-details-list div,
html[dir="rtl"] .case-history-detail-section,
html[dir="rtl"] .case-history-file-panel {
    padding: 11px 12px;
    border-radius: 14px;
    background: rgba(248, 244, 238, 0.76);
    border: 1px solid rgba(176, 144, 104, 0.1);
}

html[dir="rtl"] .case-history-details-list dt {
    color: var(--ds-text-muted);
    font-size: 12px;
    margin-bottom: 4px;
}

html[dir="rtl"] .case-history-details-list dd {
    margin: 0;
    color: var(--ds-text);
    font-weight: 700;
}

html[dir="rtl"] .case-history-detail-section {
    display: grid;
    gap: 6px;
}

html[dir="rtl"] .case-history-detail-section p {
    margin: 0;
    color: var(--ds-text-muted);
    line-height: 1.6;
}

html[dir="rtl"] .case-history-file-panel {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

html[dir="rtl"] .case-history-file-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #fff0ef;
    color: #b33c34;
    font-weight: 900;
}

html[dir="rtl"] .case-history-empty.is-filtered {
    min-height: 180px;
}

@media print {
    html[dir="rtl"] .app-sidebar,
    html[dir="rtl"] .case-history-actions-card,
    html[dir="rtl"] .case-history-filter-card,
    html[dir="rtl"] .case-history-details-card,
    html[dir="rtl"] .case-workbench-tabs-shell {
        display: none !important;
    }

    html[dir="rtl"] .case-history-audit-shell {
        display: block;
    }
}

@media (max-width: 1400px) {
    html[dir="rtl"] .case-workbench-meta-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    html[dir="rtl"] .case-overview-grid-secondary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html[dir="rtl"] .case-overview-grid-tertiary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html[dir="rtl"] .case-overview-grid-summary {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .case-files-groups,
    html[dir="rtl"] .case-actions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    html[dir="rtl"] .case-workbench-headline,
    html[dir="rtl"] .case-tab-intro,
    html[dir="rtl"] .case-spec-layout,
    html[dir="rtl"] .case-chat-layout,
    html[dir="rtl"] .case-notes-layout,
    html[dir="rtl"] .case-files-layout,
    html[dir="rtl"] .case-overview-grid-primary,
    html[dir="rtl"] .case-overview-grid-finance,
    html[dir="rtl"] .case-overview-grid-secondary,
    html[dir="rtl"] .case-overview-grid-tertiary,
    html[dir="rtl"] .case-overview-grid-summary {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .case-workbench-headline,
    html[dir="rtl"] .case-tab-intro {
        align-items: stretch;
    }

    html[dir="rtl"] .case-workbench-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html[dir="rtl"] .case-spec-workspace {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .case-spec-readonly-grid,
    html[dir="rtl"] .case-spec-delivery-card,
    html[dir="rtl"] .case-spec-fields-grid {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .case-history-audit-shell {
        direction: rtl;
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .case-history-filter-grid,
    html[dir="rtl"] .case-history-summary-grid,
    html[dir="rtl"] .case-history-event {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .case-history-details-card {
        position: static;
    }

    html[dir="rtl"] .case-history-timeline::before {
        display: none;
    }

    html[dir="rtl"] .case-spec-repeat-row,
    html[dir="rtl"] .case-spec-repeat-row.is-plinth,
    html[dir="rtl"] .case-spec-repeat-row.is-drawer,
    html[dir="rtl"] .case-spec-repeat-row.is-facade,
    html[dir="rtl"] .case-spec-repeat-row.is-vitrine,
    html[dir="rtl"] .case-spec-repeat-row.is-led {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .case-spec-repeat-row.has-extra .case-spec-repeat-control:nth-of-type(1),
    html[dir="rtl"] .case-spec-repeat-row.has-extra .case-spec-repeat-control:nth-of-type(2),
    html[dir="rtl"] .case-spec-repeat-row.has-extra .case-spec-repeat-control:nth-of-type(3),
    html[dir="rtl"] .case-spec-repeat-row.has-extra .case-spec-repeat-control:nth-of-type(4),
    html[dir="rtl"] .case-spec-repeat-row.has-details .case-spec-repeat-control:nth-of-type(5),
    html[dir="rtl"] .case-spec-repeat-row.has-details .case-spec-repeat-control:nth-of-type(6),
    html[dir="rtl"] .case-spec-repeat-row.has-extra .case-spec-repeat-remove {
        grid-column: auto;
        grid-row: auto;
    }

    html[dir="rtl"] .case-spec-repeat-remove {
        justify-self: start;
    }

    html[dir="rtl"] .case-spec-nav,
    html[dir="rtl"] .case-chat-sidebar,
    html[dir="rtl"] .case-notes-sidebar,
    html[dir="rtl"] .case-files-sidebar,
    html[dir="rtl"] .case-spec-sidebar,
    html[dir="rtl"] .case-spec-actions {
        position: static;
    }
}

@media (max-width: 760px) {
    html[dir="rtl"] .case-workbench-header,
    html[dir="rtl"] .case-workbench-timeline-card,
    html[dir="rtl"] .case-workbench-tabs-shell {
        padding: 20px 18px;
    }

    html[dir="rtl"] .case-workbench-meta-grid,
    html[dir="rtl"] .case-files-groups,
    html[dir="rtl"] .case-actions-grid,
    html[dir="rtl"] .case-status-option-grid,
    html[dir="rtl"] .case-quick-actions-grid {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .case-history-filter-head,
    html[dir="rtl"] .case-history-filter-actions {
        display: grid;
        align-items: stretch;
    }

    html[dir="rtl"] .case-history-file-panel {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .case-chat-conversation-head {
        display: grid;
    }

    html[dir="rtl"] .case-chat-message,
    html[dir="rtl"] .case-chat-message.is-mine {
        grid-template-columns: 32px minmax(0, 1fr);
        justify-content: stretch;
    }

    html[dir="rtl"] .case-chat-message.is-mine .case-chat-avatar,
    html[dir="rtl"] .case-chat-message.is-mine .case-chat-bubble {
        grid-column: auto;
        grid-row: auto;
    }

    html[dir="rtl"] .case-chat-composer {
        grid-template-columns: 38px minmax(0, 1fr) 40px;
    }

    html[dir="rtl"] .case-workbench-title h1 {
        font-size: 32px;
    }

    html[dir="rtl"] .case-workbench-timeline {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        row-gap: 20px;
    }

    html[dir="rtl"] .case-workbench-timeline-line {
        display: none;
    }
}

.payment-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(146, 113, 68, 0.18);
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.payment-badge-paid {
    color: #167246;
    background: #e8f7ee;
    border-color: rgba(22, 114, 70, 0.22);
}

.payment-badge-unpaid {
    color: #a34327;
    background: #fff0e8;
    border-color: rgba(190, 77, 45, 0.25);
}

.payment-badge-unknown {
    color: #766d63;
    background: #f3f0eb;
    border-color: rgba(118, 109, 99, 0.18);
}

.collection-kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 16px;
}

.collection-kpi-tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 72px;
    padding: 16px 18px;
    border: 1px solid rgba(177, 135, 72, 0.18);
    border-radius: 18px;
    background: rgba(255, 252, 247, 0.92);
    color: #2d2925;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(49, 38, 26, 0.06);
}

.collection-kpi-tile strong {
    font-size: 1.8rem;
    color: #9b6c31;
}

.collection-kpi-tile span {
    color: #6f665c;
    font-weight: 700;
}

.collection-kpi-tile.is-paid strong { color: #1f8a55; }
.collection-kpi-tile.is-unpaid strong { color: #b25434; }
.collection-kpi-tile.is-unknown strong { color: #7b746b; }

.collection-kpi-tile.is-active {
    border-color: rgba(166, 115, 44, 0.52);
    box-shadow: 0 16px 34px rgba(166, 115, 44, 0.16);
}

.case-payment-overview-card {
    position: relative;
    overflow: hidden;
}

.case-payment-overview-card.is-highlighted {
    animation: payment-card-pulse 1.4s ease;
}

@keyframes payment-card-pulse {
    0%, 100% { box-shadow: 0 12px 30px rgba(49, 38, 26, 0.06); }
    35% { box-shadow: 0 0 0 4px rgba(180, 126, 52, 0.16), 0 18px 40px rgba(180, 126, 52, 0.18); }
}

.case-payment-form {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.case-payment-overview-card .case-payment-form {
    gap: 8px;
    margin-top: 8px;
}

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

.case-payment-note {
    display: grid;
    gap: 6px;
}

.case-payment-note span,
.case-payment-modal-note span {
    color: #7a6f65;
    font-weight: 800;
    font-size: 0.86rem;
}

.case-payment-note textarea,
.case-payment-modal-note textarea {
    width: 100%;
    border: 1px solid rgba(177, 135, 72, 0.18);
    border-radius: 14px;
    background: #fffdf9;
    padding: 12px 14px;
    resize: vertical;
    font: inherit;
}

.case-payment-overview-card .case-payment-note textarea {
    min-height: 42px;
    max-height: 64px;
    padding: 8px 10px;
}

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

.case-payment-note-submit {
    min-width: 128px;
    box-shadow: 0 10px 22px rgba(142, 96, 42, 0.14);
}

.admin-warranty-card textarea {
    min-height: 180px;
    line-height: 1.65;
}

.admin-settings-hero h1 {
    margin-bottom: 8px;
}

.admin-settings-shell {
    display: grid;
    gap: 18px;
}

.admin-settings-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid rgba(177, 135, 72, 0.16);
    border-radius: 22px;
    background: rgba(255, 252, 247, 0.88);
    box-shadow: 0 18px 50px rgba(46, 34, 22, 0.06);
}

.admin-settings-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 16px;
    color: #5f5448;
    font-weight: 850;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.admin-settings-tab:hover {
    border-color: rgba(177, 135, 72, 0.22);
    background: #fff7eb;
    color: #8a612b;
}

.admin-settings-tab.is-active {
    border-color: rgba(177, 135, 72, 0.42);
    background: linear-gradient(180deg, #fff5e6 0%, #f7ead8 100%);
    color: #8a612b;
    box-shadow: inset 0 -2px 0 rgba(177, 135, 72, 0.52), 0 12px 24px rgba(142, 96, 42, 0.1);
}

.manager-report-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: -8px 0 18px;
    padding: 8px;
    border: 1px solid rgba(177, 135, 72, 0.16);
    border-radius: 22px;
    background: rgba(255, 252, 247, 0.9);
    box-shadow: 0 18px 50px rgba(46, 34, 22, 0.06);
}

.manager-report-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 16px;
    color: #5f5448;
    font-weight: 850;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.manager-report-tab:hover {
    border-color: rgba(177, 135, 72, 0.22);
    background: #fff7eb;
    color: #8a612b;
}

.manager-report-tab.is-active {
    border-color: rgba(177, 135, 72, 0.42);
    background: linear-gradient(180deg, #fff5e6 0%, #f7ead8 100%);
    color: #8a612b;
    box-shadow: inset 0 -2px 0 rgba(177, 135, 72, 0.52), 0 12px 24px rgba(142, 96, 42, 0.1);
}

html[dir="rtl"] .cases-module-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin: 0 0 14px;
    padding: 28px 30px;
    border: 1px solid rgba(177, 135, 72, 0.16);
    border-radius: 30px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(250, 246, 239, 0.96) 100%);
    box-shadow: 0 24px 55px rgba(46, 34, 22, 0.07);
}

html[dir="rtl"] .cases-module-hero-copy {
    display: grid;
    gap: 7px;
}

html[dir="rtl"] .cases-module-hero h1 {
    margin: 0;
    color: var(--ds-text);
    font-size: 36px;
    line-height: 1.05;
    letter-spacing: 0;
}

html[dir="rtl"] .cases-module-hero p {
    margin: 0;
    color: var(--ds-text-soft);
    font-size: 14px;
    line-height: 1.7;
}

html[dir="rtl"] .cases-module-hero-meta {
    min-inline-size: 156px;
    min-block-size: 92px;
    display: grid;
    place-items: center;
    gap: 4px;
    padding: 14px 20px;
    border: 1px solid rgba(177, 135, 72, 0.2);
    border-radius: 24px;
    background: rgba(255, 252, 247, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 14px 30px rgba(46, 34, 22, 0.05);
}

html[dir="rtl"] .cases-module-hero-meta span {
    color: var(--ds-text-soft);
    font-size: 12px;
    font-weight: 800;
}

html[dir="rtl"] .cases-module-hero-meta strong {
    color: var(--ds-brand-deep);
    font-size: 28px;
    line-height: 1;
}

html[dir="rtl"] .cases-module-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 8px;
    margin: 0 0 18px;
    padding: 8px;
    border: 1px solid rgba(177, 135, 72, 0.16);
    border-radius: 26px;
    background: rgba(255, 252, 247, 0.92);
    box-shadow: 0 18px 44px rgba(46, 34, 22, 0.06);
}

html[dir="rtl"] .cases-module-tabs .manager-report-tab {
    min-height: 54px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.68);
    color: #66594c;
}

html[dir="rtl"] .cases-module-tabs .manager-report-tab:hover {
    background: #fff7eb;
    border-color: rgba(177, 135, 72, 0.26);
    box-shadow: 0 12px 22px rgba(142, 96, 42, 0.08);
}

html[dir="rtl"] .cases-module-tabs .manager-report-tab.is-active {
    background: linear-gradient(180deg, #fff6e8 0%, #f6e7d3 100%);
    border-color: rgba(177, 135, 72, 0.48);
    color: #8a612b;
    box-shadow: inset 0 -3px 0 rgba(177, 135, 72, 0.56), 0 16px 30px rgba(142, 96, 42, 0.12);
}

html[dir="rtl"] .cases-action-center {
    margin: 0 0 18px;
    padding: 16px;
    border: 1px solid rgba(177, 135, 72, 0.13);
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(250, 246, 240, 0.92) 100%);
    box-shadow: 0 18px 42px rgba(46, 34, 22, 0.055);
}

html[dir="rtl"] .cases-action-center-inner {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

html[dir="rtl"] .cases-action-center .hero-stat-chip {
    min-width: 0;
    width: 100%;
    min-height: 104px;
    align-items: flex-start;
    justify-items: start;
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(177, 135, 72, 0.16);
    box-shadow: 0 14px 30px rgba(46, 34, 22, 0.055);
}

html[dir="rtl"] .cases-action-center .hero-stat-chip > span {
    color: var(--ds-text-soft);
    font-size: 12px;
    font-weight: 850;
}

html[dir="rtl"] .cases-action-center .hero-stat-chip strong {
    color: var(--ds-text);
    font-size: 32px;
    line-height: 1;
}

html[dir="rtl"] .cases-action-center .hero-stat-chip-link.is-active {
    background: linear-gradient(180deg, rgba(255, 249, 238, 0.98) 0%, rgba(247, 235, 216, 0.95) 100%);
    border-color: rgba(177, 135, 72, 0.34);
}

html[dir="rtl"] .cases-filter-card {
    padding: 22px;
}

html[dir="rtl"] .cases-filter-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(161, 137, 106, 0.11);
}

html[dir="rtl"] .cases-filter-head h2 {
    margin: 4px 0 2px;
    font-size: 20px;
}

html[dir="rtl"] .cases-filter-toolbar {
    padding-top: 4px;
}

html[dir="rtl"] .cases-filter-toolbar .filter-actions {
    align-self: stretch;
}

html[dir="rtl"] .cases-filter-toolbar .filter-actions .button {
    justify-content: center;
}

html[dir="rtl"] .cases-filter-toolbar label {
    background: rgba(255, 255, 255, 0.78);
    border-color: rgba(161, 137, 106, 0.13);
}

html[dir="rtl"] .cases-table-head {
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(161, 137, 106, 0.12);
}

html[dir="rtl"] .cases-table-head h2 {
    margin: 0 0 6px;
    font-size: 22px;
}

html[dir="rtl"] .cases-table-toolbar .soft-chip {
    min-width: 0;
    border-radius: 18px;
}

html[dir="rtl"] .cases-table thead th {
    padding-block: 17px;
    background: linear-gradient(180deg, #231f1a 0%, #181511 100%);
}

html[dir="rtl"] .cases-table tbody tr.data-row td {
    transition: background 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

html[dir="rtl"] .cases-table tbody td[colspan] {
    padding: 42px 24px;
    color: var(--ds-text-soft);
    text-align: center;
    font-weight: 800;
    background: linear-gradient(180deg, rgba(255, 252, 247, 0.82) 0%, rgba(250, 247, 242, 0.82) 100%);
}

html[dir="rtl"] .cases-workspace-layout {
    display: block;
    direction: rtl;
}

html[dir="rtl"] .cases-workspace-layout > .workspace-main {
    gap: 14px;
    width: 100%;
}

html[dir="rtl"] .cases-side-rail {
    display: none;
}

html[dir="rtl"] .cases-module-hero {
    margin: 0;
    padding: 24px 28px;
    min-height: 128px;
    overflow: hidden;
}

html[dir="rtl"] .cases-module-hero h1 {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

html[dir="rtl"] .cases-module-hero h1::before {
    content: "▣";
    inline-size: 42px;
    block-size: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(177, 135, 72, 0.22);
    border-radius: 15px;
    background: #fff7ea;
    color: #a97736;
    font-size: 18px;
    box-shadow: 0 10px 22px rgba(142, 96, 42, 0.08);
}

html[dir="rtl"] .cases-module-hero-meta {
    min-block-size: 76px;
    min-inline-size: 136px;
}

html[dir="rtl"] .cases-module-tabs {
    margin: -8px 0 12px;
    padding: 10px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.9);
}

html[dir="rtl"] .cases-module-tabs .cases-tab {
    gap: 10px;
    min-height: 62px;
    padding: 0 18px;
    border: 1px solid rgba(177, 135, 72, 0.13);
    font-size: 14px;
    white-space: nowrap;
}

html[dir="rtl"] .cases-tab-icon {
    inline-size: 34px;
    block-size: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: #fff8ee;
    color: #a97736;
    border: 1px solid rgba(177, 135, 72, 0.16);
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
}

html[dir="rtl"] .cases-tab-all .cases-tab-icon::before { content: "▣"; }
html[dir="rtl"] .cases-tab-new .cases-tab-icon::before { content: "+"; }
html[dir="rtl"] .cases-tab-download .cases-tab-icon::before { content: "↓"; }
html[dir="rtl"] .cases-tab-factory .cases-tab-icon::before { content: "⌂"; }

html[dir="rtl"] .cases-module-tabs .cases-tab.is-active .cases-tab-icon {
    background: #f2dfbf;
    border-color: rgba(154, 102, 43, 0.32);
    color: #76511f;
}

html[dir="rtl"] .cases-action-center {
    margin: 0 0 12px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

html[dir="rtl"] .cases-action-center-inner {
    gap: 14px;
}

html[dir="rtl"] .cases-action-center .cases-kpi-card {
    position: relative;
    min-height: 116px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-content: center;
    gap: 6px 14px;
    padding: 20px 22px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(177, 135, 72, 0.14);
    box-shadow: 0 18px 36px rgba(46, 34, 22, 0.06);
}

html[dir="rtl"] .cases-action-center .cases-kpi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(177, 135, 72, 0.26);
    box-shadow: 0 22px 42px rgba(46, 34, 22, 0.08);
}

html[dir="rtl"] .cases-action-center .cases-kpi-card.is-active {
    background: linear-gradient(180deg, #fff8ee 0%, #f8ead6 100%);
    border-color: rgba(177, 135, 72, 0.36);
}

html[dir="rtl"] .cases-action-center .cases-kpi-icon {
    grid-row: 1 / span 3;
    grid-column: 2;
    inline-size: 48px;
    block-size: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: #fbf2e4;
    color: #a97736;
    border: 1px solid rgba(177, 135, 72, 0.18);
    font-size: 21px;
    font-weight: 900;
}

html[dir="rtl"] .cases-kpi-active .cases-kpi-icon::before { content: "▣"; }
html[dir="rtl"] .cases-kpi-new .cases-kpi-icon::before { content: "+"; }
html[dir="rtl"] .cases-kpi-download .cases-kpi-icon::before { content: "↓"; }
html[dir="rtl"] .cases-kpi-factory .cases-kpi-icon::before { content: "⌂"; }

html[dir="rtl"] .cases-action-center .cases-kpi-title {
    color: var(--ds-text);
    font-size: 14px;
    font-weight: 900;
}

html[dir="rtl"] .cases-action-center .cases-kpi-card strong {
    color: #1f1b17;
    font-size: 34px;
    line-height: 1;
}

html[dir="rtl"] .cases-action-center .cases-kpi-card small {
    color: var(--ds-text-muted);
    font-size: 12px;
    font-weight: 700;
}

html[dir="rtl"] .cases-filter-card {
    margin: 0 0 12px;
    padding: 20px 22px 22px;
    border-radius: 26px;
}

html[dir="rtl"] .cases-filter-head {
    align-items: center;
    padding-bottom: 14px;
    margin-bottom: 14px;
}

html[dir="rtl"] .cases-filter-clear-top {
    min-height: 42px;
}

html[dir="rtl"] .cases-filter-toolbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
    padding-top: 0;
}

html[dir="rtl"] .cases-filter-toolbar .filter-search-control {
    grid-column: span 2;
}

html[dir="rtl"] .cases-filter-toolbar label {
    min-width: 0;
    padding: 10px 12px 12px;
    border-radius: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

html[dir="rtl"] .cases-filter-toolbar label span {
    margin-bottom: 7px;
    color: #4f463d;
    font-size: 11px;
    font-weight: 900;
}

html[dir="rtl"] .cases-filter-toolbar input,
html[dir="rtl"] .cases-filter-toolbar select {
    min-height: 46px;
}

html[dir="rtl"] .cases-filter-toolbar .filter-actions {
    grid-column: span 2;
    display: flex;
    gap: 12px;
    align-items: end;
    justify-content: flex-start;
}

html[dir="rtl"] .cases-filter-toolbar .filter-actions .button {
    min-height: 48px;
    min-inline-size: 132px;
}

html[dir="rtl"] .premium-table-card {
    padding: 22px;
    border-radius: 28px;
}

html[dir="rtl"] .cases-table-head {
    align-items: center;
    margin-bottom: 16px;
}

html[dir="rtl"] .cases-table-head h2 {
    font-size: 25px;
}

html[dir="rtl"] .cases-table-toolbar {
    justify-content: flex-start;
}

html[dir="rtl"] .premium-table-wrap {
    padding: 0;
    border-radius: 22px;
    background: #fffdf9;
}

html[dir="rtl"] .cases-table {
    min-width: 980px;
}

html[dir="rtl"] .cases-table thead th {
    padding: 16px 18px;
    font-size: 12px;
    letter-spacing: 0;
}

html[dir="rtl"] .cases-table tbody tr.data-row td {
    padding: 17px 18px;
    border-bottom: 1px solid rgba(111, 93, 72, 0.08);
}

html[dir="rtl"] .cases-empty-state {
    min-height: 190px;
    display: grid;
    place-items: center;
    justify-items: center;
    gap: 10px;
    padding: 26px;
}

html[dir="rtl"] .cases-empty-state::before {
    content: "▣";
    inline-size: 54px;
    block-size: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: #fff7ea;
    color: #a97736;
    border: 1px solid rgba(177, 135, 72, 0.18);
    font-size: 22px;
}

html[dir="rtl"] .cases-empty-state strong {
    color: var(--ds-text);
    font-size: 20px;
}

html[dir="rtl"] .cases-empty-state span {
    color: var(--ds-text-soft);
    font-weight: 700;
}

@media (max-width: 1180px) {
    html[dir="rtl"] .cases-action-center-inner,
    html[dir="rtl"] .cases-module-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html[dir="rtl"] .cases-filter-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html[dir="rtl"] .cases-filter-toolbar .filter-search-control,
    html[dir="rtl"] .cases-filter-toolbar .filter-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    html[dir="rtl"] .cases-module-hero {
        flex-direction: column;
        align-items: stretch;
        padding: 22px;
    }

    html[dir="rtl"] .cases-module-hero h1 {
        font-size: 28px;
    }

    html[dir="rtl"] .cases-module-hero-meta {
        inline-size: 100%;
    }

    html[dir="rtl"] .cases-action-center-inner,
    html[dir="rtl"] .cases-module-tabs {
        grid-template-columns: minmax(0, 1fr);
    }

    html[dir="rtl"] .cases-filter-head {
        flex-direction: column;
    }

    html[dir="rtl"] .cases-filter-toolbar {
        grid-template-columns: minmax(0, 1fr);
    }

    html[dir="rtl"] .cases-filter-toolbar .filter-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .cases-filter-toolbar .filter-actions .button {
        inline-size: 100%;
    }
}

.admin-settings-content {
    min-height: 420px;
}

.admin-settings-panel {
    display: none;
}

.admin-settings-panel.is-active {
    display: block;
}

.appointment-hero {
    align-items: center;
}

.appointment-shell {
    display: grid;
    gap: 18px;
}

.appointment-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.appointment-form-card {
    scroll-margin-top: 24px;
}

.appointment-form [data-lead-extra][hidden] {
    display: none;
}

.appointment-duplicate-warning {
    display: block;
    margin-top: 6px;
    padding: 7px 10px;
    border: 1px solid rgba(198, 76, 53, 0.16);
    border-radius: 12px;
    background: #fff0ea;
    color: #9d3d2c;
    font-weight: 760;
}

.appointment-duplicate-warning[hidden] {
    display: none;
}

.appointment-duplicate-panel {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(177, 135, 72, 0.22);
    border-radius: 18px;
    background: #fff8ed;
}

.appointment-duplicate-panel[hidden] {
    display: none;
}

.appointment-duplicate-panel strong {
    color: #3d342c;
    font-weight: 900;
}

.appointment-duplicate-panel p {
    margin: 4px 0 0;
    color: #7b7167;
    font-size: 0.86rem;
    font-weight: 700;
}

.appointment-duplicate-item {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid rgba(177, 135, 72, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}

.appointment-duplicate-item span,
.appointment-duplicate-item small {
    color: #766a5f;
    font-size: 0.82rem;
    font-weight: 720;
}

.appointment-table-wrap {
    border: 1px solid rgba(177, 135, 72, 0.12);
    border-radius: 18px;
    overflow: auto;
    background: #fffdf9;
}

.appointment-table {
    min-width: 980px;
}

.appointment-table th,
.appointment-table td {
    white-space: nowrap;
}

.appointment-table td:last-child {
    white-space: normal;
    min-width: 180px;
}

.appointment-admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 18px;
    padding: 8px;
    border: 1px solid rgba(177, 135, 72, 0.14);
    border-radius: 18px;
    background: rgba(255, 250, 242, 0.58);
}

.appointment-admin-tab {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(177, 135, 72, 0.12);
    border-radius: 13px;
    background: #fffdf9;
    color: #5f5448;
    font: inherit;
    font-weight: 850;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.appointment-admin-tab:hover,
.appointment-admin-tab.is-active {
    border-color: rgba(177, 135, 72, 0.42);
    background: #fff4e3;
    color: #8a612b;
    box-shadow: 0 10px 22px rgba(142, 96, 42, 0.08);
}

.appointment-admin-panel {
    display: none;
}

.appointment-admin-panel.is-active {
    display: grid;
    gap: 16px;
}

.appointment-filter-form {
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid rgba(177, 135, 72, 0.12);
    border-radius: 18px;
    background: rgba(255, 253, 249, 0.72);
}

.appointment-target-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(140px, 220px) minmax(180px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.appointment-target-row label {
    display: grid;
    gap: 6px;
}

.appointment-target-row input {
    width: 100%;
}

.role-appointment_coordinator html[dir="rtl"] .app-sidebar,
html[dir="rtl"] body.role-appointment_coordinator .app-sidebar {
    background: linear-gradient(180deg, #fffdf8 0%, #fbf6ed 100%);
    border: 1px solid rgba(177, 135, 72, 0.16);
    box-shadow: 0 24px 54px rgba(65, 48, 28, 0.1);
}

html[dir="rtl"] body.role-appointment_coordinator .brand-mark {
    color: #1f1b17;
}

html[dir="rtl"] body.role-appointment_coordinator .brand-tagline,
html[dir="rtl"] body.role-appointment_coordinator .sidebar-section-label,
html[dir="rtl"] body.role-appointment_coordinator .sidebar-system-label {
    color: #8a8177;
}

html[dir="rtl"] body.role-appointment_coordinator .sidebar-link {
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid transparent;
    color: #2a251f;
}

html[dir="rtl"] body.role-appointment_coordinator .sidebar-link:hover,
html[dir="rtl"] body.role-appointment_coordinator .sidebar-link.is-active {
    background: #fff4e4;
    border-color: rgba(177, 135, 72, 0.35);
    box-shadow: 0 12px 30px rgba(142, 96, 42, 0.1);
}

html[dir="rtl"] body.role-appointment_coordinator .sidebar-link.is-active {
    box-shadow: inset 4px 0 0 #b18748, 0 14px 32px rgba(142, 96, 42, 0.12);
}

html[dir="rtl"] body.role-appointment_coordinator .sidebar-link small,
html[dir="rtl"] body.role-appointment_coordinator .sidebar-user-card small {
    color: #83786c;
}

html[dir="rtl"] body.role-appointment_coordinator .sidebar-user-card {
    background: #fffdf8;
    border: 1px solid rgba(177, 135, 72, 0.14);
    box-shadow: 0 12px 28px rgba(65, 48, 28, 0.08);
}

.appointment-coordinator-page {
    display: grid;
    gap: 18px;
}

.appointment-coordinator-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 154px;
    padding: 28px 32px;
    border: 1px solid rgba(177, 135, 72, 0.14);
    border-radius: 24px;
    background: linear-gradient(180deg, #fffdf9 0%, #fbf6ec 100%);
    box-shadow: 0 18px 44px rgba(75, 55, 32, 0.08);
}

.appointment-coordinator-title {
    display: flex;
    align-items: center;
    gap: 18px;
}

.appointment-hero-icon {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    border-radius: 18px;
    border: 1px solid rgba(177, 135, 72, 0.2);
    background: #fff3e2;
    color: #9f7134;
    font-size: 1.35rem;
    font-weight: 900;
}

.appointment-coordinator-title h1 {
    margin: 4px 0 6px;
    color: #241f1a;
    font-size: clamp(2.1rem, 4vw, 3.8rem);
    line-height: 1;
}

.appointment-coordinator-title p {
    margin: 0;
    color: #6f665c;
    font-size: 1rem;
}

.appointment-new-button {
    min-width: 166px;
    min-height: 48px;
    justify-content: center;
    box-shadow: 0 14px 34px rgba(142, 96, 42, 0.18);
}

.appointment-new-button span {
    font-size: 1.25rem;
    line-height: 1;
}

.appointment-coordinator-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.appointment-coordinator-kpi {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    min-height: 136px;
    padding: 18px;
    border: 1px solid rgba(177, 135, 72, 0.14);
    border-radius: 18px;
    background: #fffdf9;
    box-shadow: 0 15px 36px rgba(75, 55, 32, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.appointment-coordinator-kpi:hover {
    transform: translateY(-2px);
    border-color: rgba(177, 135, 72, 0.28);
    box-shadow: 0 20px 42px rgba(75, 55, 32, 0.12);
}

.appointment-kpi-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border: 1px solid rgba(177, 135, 72, 0.2);
    border-radius: 18px;
    background: #fff3e2;
    color: #9f7134;
    font-weight: 900;
    font-size: 1.15rem;
}

.appointment-kpi-icon.icon-clock::before { content: "◷"; }
.appointment-kpi-icon.icon-flag::before { content: "⚑"; }
.appointment-kpi-icon.icon-target::before { content: "◎"; }

.appointment-coordinator-kpi small {
    color: #3d342c;
    font-size: 0.92rem;
    font-weight: 900;
}

.appointment-coordinator-kpi strong {
    display: block;
    margin: 4px 0;
    color: #201b16;
    font-size: clamp(1.7rem, 3vw, 2.7rem);
    line-height: 1;
}

.appointment-coordinator-kpi span:not(.appointment-kpi-icon) {
    color: #7b7167;
    font-size: 0.86rem;
    font-weight: 720;
}

.appointment-kpi-progress {
    position: relative;
    height: 8px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(177, 135, 72, 0.14);
}

.appointment-kpi-progress i {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #d3a257 0%, #95682d 100%);
}

.appointment-card {
    border: 1px solid rgba(177, 135, 72, 0.14);
    border-radius: 22px;
    background: #fffdf9;
    box-shadow: 0 16px 42px rgba(75, 55, 32, 0.08);
}

.appointment-card-head,
.appointment-table-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 24px 26px 14px;
}

.appointment-card-head h2,
.appointment-table-head h2 {
    margin: 0 0 4px;
    color: #262019;
    font-size: clamp(1.45rem, 2.4vw, 2.2rem);
}

.appointment-card-head p,
.appointment-table-head p {
    margin: 0;
    color: #756b61;
}

.appointment-coordinator-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
    padding: 8px 26px 26px;
}

.appointment-coordinator-form label,
.appointment-table-filters label {
    display: grid;
    gap: 7px;
}

.appointment-coordinator-form label span,
.appointment-table-filters label span {
    color: #4d4238;
    font-size: 0.86rem;
    font-weight: 900;
}

.appointment-coordinator-form input,
.appointment-coordinator-form select,
.appointment-coordinator-form textarea,
.appointment-table-filters input,
.appointment-table-filters select {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(177, 135, 72, 0.16);
    border-radius: 12px;
    background: #fff;
    color: #2d2822;
    font: inherit;
}

.appointment-coordinator-form textarea {
    min-height: 104px;
    resize: vertical;
}

.appointment-coordinator-form input[readonly] {
    background: #f7f1e8;
    color: #6f6256;
}

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

.appointment-form-actions .button {
    min-width: 160px;
    min-height: 46px;
    justify-content: center;
}

html[dir="rtl"] .cases-module-tabs .cases-tab.is-active {
    background: linear-gradient(180deg, #b6843e 0%, #9f6f32 100%);
    color: #fff;
    border-color: rgba(126, 82, 30, 0.45);
    box-shadow: 0 12px 24px rgba(126, 82, 30, 0.18);
}

html[dir="rtl"] .cases-module-tabs .cases-tab.is-active .cases-tab-icon {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.26);
    color: #fff;
}

html[dir="rtl"] .cases-tab-icon {
    inline-size: 28px;
    block-size: 28px;
    border-radius: 10px;
    font-size: 14px;
}

html[dir="rtl"] .cases-tab-all .cases-tab-icon::before { content: "□"; }
html[dir="rtl"] .cases-tab-new .cases-tab-icon::before { content: "+"; }
html[dir="rtl"] .cases-tab-download .cases-tab-icon::before { content: "↓"; }
html[dir="rtl"] .cases-tab-factory .cases-tab-icon::before { content: "⌂"; }

.appointment-month-card {
    overflow: hidden;
}

.appointment-table-filters {
    display: grid;
    grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(150px, 1fr)) auto;
    gap: 12px;
    align-items: end;
    padding: 0 26px 18px;
}

.appointment-table-filters .button {
    min-height: 44px;
}

.appointment-table-shell {
    margin: 0 18px;
    border: 1px solid rgba(177, 135, 72, 0.14);
    border-radius: 18px;
    overflow: auto;
    background: #fff;
}

.appointment-premium-table {
    width: 100%;
    min-width: 1140px;
    border-collapse: separate;
    border-spacing: 0;
    direction: rtl;
}

.appointment-premium-table thead th {
    padding: 14px 16px;
    background: #191512;
    color: #fffaf2;
    font-size: 0.82rem;
    font-weight: 900;
    text-align: right;
    white-space: nowrap;
}

.appointment-premium-table thead th:first-child {
    border-start-start-radius: 14px;
}

.appointment-premium-table thead th:last-child {
    border-start-end-radius: 14px;
}

.appointment-premium-table td {
    padding: 13px 16px;
    border-bottom: 1px solid rgba(177, 135, 72, 0.1);
    color: #2d2822;
    font-size: 0.9rem;
    vertical-align: middle;
    white-space: nowrap;
}

.appointment-premium-table tr:hover td {
    background: #fff8ed;
}

.appointment-premium-table td small {
    display: block;
    margin-top: 4px;
    color: #8a8176;
    font-size: 0.76rem;
}

.appointment-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 12px;
    border: 1px solid rgba(68, 153, 93, 0.18);
    border-radius: 999px;
    background: #e8f7ec;
    color: #2f8351;
    font-weight: 900;
    font-size: 0.78rem;
}

.appointment-status-cancelled {
    border-color: rgba(206, 83, 66, 0.28);
    background: #fff0ec;
    color: #b64f42;
}

.appointment-status-recurrent {
    border-color: rgba(95, 127, 185, 0.24);
    background: #edf4ff;
    color: #416aa8;
}

.appointment-status-rescheduled {
    border-color: rgba(139, 120, 164, 0.24);
    background: #f3eef9;
    color: #75609a;
}

.appointment-status-completed {
    border-color: rgba(68, 153, 93, 0.18);
    background: #e8f7ec;
    color: #2f8351;
}

.appointment-status-no_show {
    border-color: rgba(206, 83, 66, 0.24);
    background: #fff5f0;
    color: #a84a43;
}

.appointment-cancel-reason {
    color: #a84a43 !important;
}

.appointment-table-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.appointment-export-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.appointment-export-form input,
.appointment-export-form select {
    min-height: 34px;
    border: 1px solid #eadfce;
    border-radius: 11px;
    background: #fffdf8;
    color: #3d342c;
    font-weight: 760;
    padding: 0 10px;
}

.appointment-export-form input {
    width: 84px;
}

.appointment-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 26px 22px;
    color: #665b50;
    font-weight: 760;
}

.appointment-table-footer label,
.appointment-page-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.appointment-table-footer select {
    width: 78px;
    min-height: 36px;
}

.appointment-page-controls span {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #ad7b39;
    color: #fff;
    font-weight: 900;
}

.appointment-page-controls button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

html[dir="rtl"] .button.danger {
    background: #fff1ef;
    color: #a84a43;
    border: 1px solid rgba(199, 107, 98, 0.24);
}

.appointment-action-button {
    min-height: 32px;
    padding-inline: 12px;
}

.appointment-modal[hidden] {
    display: none;
}

.appointment-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 26px;
}

.appointment-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(35, 28, 20, 0.32);
    backdrop-filter: blur(4px);
}

.appointment-modal-panel {
    position: relative;
    width: min(960px, 100%);
    max-height: min(86vh, 920px);
    overflow: auto;
    border: 1px solid rgba(177, 135, 72, 0.18);
    border-radius: 26px;
    background: #fffdf9;
    box-shadow: 0 34px 90px rgba(38, 28, 18, 0.22);
}

.appointment-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 24px 26px 10px;
    border-bottom: 1px solid rgba(177, 135, 72, 0.12);
}

.appointment-modal-head h3 {
    margin: 4px 0;
    color: #211a14;
    font-size: 1.45rem;
}

.appointment-modal-head p {
    margin: 0;
    color: #756b61;
}

.appointment-modal-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
    padding: 20px 26px 24px;
}

.appointment-modal-form label,
.appointment-delete-form label {
    display: grid;
    gap: 7px;
}

.appointment-modal-form label span,
.appointment-delete-form label span {
    color: #4d4238;
    font-size: 0.84rem;
    font-weight: 900;
}

.appointment-modal-form input,
.appointment-modal-form select,
.appointment-modal-form textarea,
.appointment-delete-form input {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(177, 135, 72, 0.17);
    border-radius: 12px;
    background: #fff;
    color: #2d2822;
    font: inherit;
}

.appointment-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    border: 1px dashed rgba(177, 135, 72, 0.18);
    border-radius: 14px;
    background: #fff8ed;
    color: #73675b;
    font-size: 0.82rem;
    font-weight: 760;
}

.appointment-modal-actions {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
}

.appointment-delete-form {
    display: grid;
    gap: 10px;
    margin: 0 26px 24px;
    padding: 16px;
    border: 1px solid rgba(199, 107, 98, 0.2);
    border-radius: 18px;
    background: rgba(255, 241, 239, 0.72);
}

.appointment-delete-form h4,
.appointment-delete-form p {
    margin: 0;
}

.appointment-delete-form p {
    color: #806a64;
    font-size: 0.86rem;
}

.appointment-manager-dashboard {
    display: grid;
    gap: 18px;
}

.appointment-manager-hero {
    align-items: center;
    min-height: 150px;
}

.appointment-manager-period {
    display: grid;
    min-width: 180px;
    gap: 6px;
    padding: 14px 18px;
    border: 1px solid rgba(177, 135, 72, 0.18);
    border-radius: 18px;
    background: rgba(255, 253, 249, 0.82);
    box-shadow: 0 14px 34px rgba(94, 72, 42, 0.08);
    text-align: center;
}

.appointment-manager-period span,
.appointment-manager-kpi small {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 780;
}

.appointment-manager-period strong {
    color: var(--ink);
    font-size: 1.25rem;
}

.appointment-manager-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.appointment-manager-kpi {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 128px;
    padding: 16px;
    border: 1px solid rgba(177, 135, 72, 0.14);
    border-radius: 18px;
    background: linear-gradient(180deg, #fffdf9 0%, #fff9ef 100%);
    box-shadow: 0 16px 38px rgba(94, 72, 42, 0.08);
}

.appointment-manager-kpi strong {
    display: block;
    margin: 4px 0;
    color: var(--ink);
    font-size: clamp(1.35rem, 1.9vw, 2rem);
    line-height: 1.05;
}

.appointment-manager-kpi span:not(.kpi-icon) {
    color: #70665a;
    font-size: 0.82rem;
}

.appointment-manager-kpi .kpi-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(177, 135, 72, 0.18);
    border-radius: 16px;
    background: #fff4e5;
    color: #a97835;
    font-weight: 900;
}

.appointment-manager-kpi .icon-clock::before { content: "◷"; }
.appointment-manager-kpi .icon-target::before { content: "◎"; }
.appointment-manager-kpi .icon-trending::before { content: "↗"; }
.appointment-manager-kpi .icon-user::before { content: "♙"; }
.appointment-manager-kpi .icon-designer::before { content: "◇"; }

.appointment-mini-progress,
.appointment-progress-track {
    position: relative;
    display: block;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(177, 135, 72, 0.14);
}

.appointment-mini-progress {
    margin-top: 8px;
}

.appointment-mini-progress i,
.appointment-progress-track i {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #c99a52 0%, #9b6f32 100%);
}

.appointment-manager-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: end;
}

.appointment-dashboard-filter {
    display: grid;
    grid-template-columns: repeat(7, minmax(135px, 1fr)) auto;
    gap: 10px;
    align-items: end;
}

.appointment-dashboard-filter label {
    display: grid;
    gap: 6px;
}

.appointment-dashboard-filter label span {
    color: #6b5d50;
    font-size: 0.78rem;
    font-weight: 850;
}

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

.appointment-export-inline {
    display: flex;
    justify-content: flex-end;
}

.appointment-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.appointment-chart-card {
    min-height: 280px;
}

.section-head.compact {
    margin-bottom: 12px;
}

.section-head.compact h2 {
    margin: 0;
    font-size: 1rem;
}

.appointment-progress-row {
    display: grid;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(177, 135, 72, 0.1);
}

.appointment-progress-row:last-child {
    border-bottom: 0;
}

.appointment-progress-row > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.appointment-progress-row strong {
    color: var(--ink);
    font-size: 0.92rem;
}

.appointment-progress-row span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 760;
}

.appointment-management-row {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
    gap: 16px;
}

.appointment-targets-table {
    min-width: 760px;
}

.appointment-insight-list {
    display: grid;
    gap: 10px;
}

.appointment-insight-item {
    display: grid;
    gap: 5px;
    padding: 12px 14px;
    border: 1px solid rgba(177, 135, 72, 0.12);
    border-radius: 14px;
    background: #fffaf1;
}

.appointment-insight-item span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 780;
}

.appointment-insight-item strong {
    color: var(--ink);
    font-size: 0.98rem;
}

.appointment-manager-table {
    min-width: 1280px;
}

.appointment-manager-table td:nth-child(11) {
    white-space: normal;
    min-width: 220px;
}

@media (max-width: 1500px) {
    .appointment-coordinator-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

    .appointment-dashboard-filter {
        grid-template-columns: repeat(4, minmax(135px, 1fr));
    }

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

@media (max-width: 1100px) {
    .appointment-coordinator-hero,
    .appointment-card-head,
    .appointment-table-head,
    .appointment-table-footer {
        display: grid;
    }

    .appointment-coordinator-form,
    .appointment-coordinator-kpis,
    .appointment-table-filters,
    .appointment-modal-form {
        grid-template-columns: 1fr;
    }

    .appointment-new-button,
    .appointment-form-actions .button,
    .appointment-modal-actions .button {
        width: 100%;
    }

    .appointment-modal {
        padding: 12px;
    }

    .appointment-modal-head,
    .appointment-modal-actions {
        display: grid;
    }

    .appointment-manager-kpis,
    .appointment-dashboard-grid,
    .appointment-management-row,
    .appointment-manager-toolbar,
    .appointment-dashboard-filter {
        grid-template-columns: 1fr;
    }
}

.admin-users-management {
    display: grid;
    gap: 18px;
}

.admin-users-group {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(177, 135, 72, 0.12);
    border-radius: 20px;
    background: rgba(255, 253, 249, 0.72);
}

.admin-users-group-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid rgba(177, 135, 72, 0.12);
    padding-bottom: 12px;
}

.admin-users-group-head h3 {
    margin: 0 0 4px;
    font-size: 1.08rem;
}

.admin-users-list {
    display: grid;
    gap: 10px;
}

.admin-user-row {
    border: 1px solid rgba(177, 135, 72, 0.14);
    border-radius: 18px;
    background: #fffdf9;
    overflow: hidden;
    box-shadow: 0 12px 26px rgba(46, 34, 22, 0.04);
}

.admin-user-row summary {
    cursor: pointer;
}

.admin-user-row:hover {
    border-color: rgba(177, 135, 72, 0.28);
    box-shadow: 0 16px 34px rgba(46, 34, 22, 0.07);
}

.admin-user-row-body {
    padding: 16px;
    border-top: 1px solid rgba(177, 135, 72, 0.12);
    background: rgba(255, 250, 242, 0.46);
}

.technical-schema-editor {
    margin: 0;
}

.technical-schema-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 18px;
    align-items: start;
}

.technical-schema-workspace,
.technical-schema-side-card,
.technical-schema-side-note {
    border: 1px solid rgba(177, 135, 72, 0.14);
    border-radius: 20px;
    background: rgba(255, 253, 249, 0.78);
}

.technical-schema-workspace {
    padding: 18px;
}

.technical-schema-head {
    margin-bottom: 16px;
}

.technical-schema-tabs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.technical-schema-tabs-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.technical-add-tab-button {
    flex: 0 0 auto;
    min-width: 138px;
    justify-content: center;
    white-space: nowrap;
}

.technical-spec-admin-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(177, 135, 72, 0.16);
    border-radius: 14px;
    background: #fffdf9;
    color: #594f45;
    font-weight: 850;
    cursor: pointer;
}

.technical-spec-admin-tab:hover,
.technical-spec-admin-tab.is-active {
    border-color: rgba(177, 135, 72, 0.46);
    background: #fff5e7;
    color: #9a6c31;
    box-shadow: 0 10px 22px rgba(142, 96, 42, 0.1);
}

.technical-spec-admin-tab.is-disabled {
    opacity: 0.58;
}

.drag-grip {
    color: #b18748;
    font-weight: 900;
    letter-spacing: 0;
}

.technical-tab-editor {
    display: grid;
    gap: 14px;
}

.technical-tab-editor-head,
.technical-tab-meta,
.technical-options-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.technical-tab-editor-head h3 {
    margin: 0 0 4px;
    font-size: 1.15rem;
}

.technical-tab-meta {
    padding: 14px;
    border: 1px solid rgba(177, 135, 72, 0.12);
    border-radius: 18px;
    background: #fffaf2;
}

.technical-tab-meta label,
.technical-tab-active {
    display: grid;
    gap: 6px;
}

.technical-tab-meta input,
.technical-tab-meta select,
.technical-question-grid input,
.technical-question-grid select,
.technical-option-set textarea {
    width: 100%;
    border: 1px solid rgba(177, 135, 72, 0.16);
    border-radius: 12px;
    background: #fffdf9;
    padding: 10px 12px;
    font: inherit;
}

.technical-tab-order-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.technical-questions-list {
    display: grid;
    gap: 12px;
}

.technical-question-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(177, 135, 72, 0.14);
    border-radius: 18px;
    background: #fffdf9;
    box-shadow: 0 12px 28px rgba(46, 34, 22, 0.04);
}

.technical-question-card:hover {
    border-color: rgba(177, 135, 72, 0.3);
}

.technical-question-card.is-disabled {
    opacity: 0.62;
}

.technical-question-actions {
    display: flex;
    flex-wrap: wrap;
    align-content: start;
    gap: 8px;
}

.technical-question-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 10px;
}

.technical-question-grid label,
.technical-option-set {
    display: grid;
    gap: 6px;
}

.technical-question-grid label span,
.technical-option-set span,
.technical-tab-meta span,
.technical-tab-active span {
    color: #756a60;
    font-size: 0.78rem;
    font-weight: 850;
}

.technical-options-editor {
    grid-column: 2;
    display: grid;
    gap: 10px;
    margin-top: 2px;
    padding-top: 10px;
    border-top: 1px solid rgba(177, 135, 72, 0.12);
}

.technical-empty-options {
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f7f2eb;
}

.technical-schema-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.technical-schema-side {
    display: grid;
    gap: 14px;
}

.technical-schema-side-card,
.technical-schema-side-note {
    padding: 18px;
}

.technical-schema-side-card h3 {
    margin: 0 0 12px;
}

.technical-schema-side-card ul {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.technical-schema-side-card li {
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(177, 135, 72, 0.22);
    color: #5f5448;
    font-weight: 760;
}

.technical-schema-side-note {
    background: #fff7eb;
}

.technical-schema-side-note p {
    margin-bottom: 0;
}

.technical-schema-preview {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid rgba(177, 135, 72, 0.16);
    border-radius: 18px;
    background: #fffaf2;
}

.technical-preview-tab h4 {
    margin: 0 0 12px;
}

.technical-preview-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 160px 90px;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(177, 135, 72, 0.12);
}

.technical-preview-row small {
    display: inline-flex;
    justify-content: center;
    padding: 5px 8px;
    border-radius: 999px;
    background: #f5ead8;
    color: #9a6c31;
    font-weight: 850;
}

@media (max-width: 760px) {
    .admin-settings-tabs {
        display: grid;
    }

    .admin-settings-tab {
        width: 100%;
    }

    .admin-users-group-head {
        display: grid;
    }

    .appointment-admin-tabs,
    .appointment-target-row,
    .appointment-manager-toolbar,
    .appointment-dashboard-filter,
    .appointment-dashboard-grid,
    .appointment-management-row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .appointment-admin-tab {
        width: 100%;
    }

    .appointment-manager-kpis {
        grid-template-columns: 1fr;
    }

    .appointment-manager-kpi {
        min-height: 112px;
    }

    .appointment-export-inline,
    .appointment-dashboard-actions {
        justify-content: stretch;
        display: grid;
    }

    .technical-schema-main,
    .technical-question-card,
    .technical-question-grid,
    .technical-preview-row {
        grid-template-columns: 1fr;
    }

    .technical-options-editor {
        grid-column: auto;
    }

    .technical-schema-tabs-row,
    .technical-tab-editor-head,
    .technical-tab-meta {
        display: grid;
    }
}

.case-payment-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(41, 34, 27, 0.34);
    backdrop-filter: blur(5px);
}

.case-payment-modal-backdrop[hidden] {
    display: none;
}

.case-payment-modal {
    position: relative;
    width: min(520px, 100%);
    padding: 28px;
    border-radius: 24px;
    border: 1px solid rgba(177, 135, 72, 0.24);
    background: #fffaf2;
    box-shadow: 0 26px 80px rgba(31, 24, 18, 0.24);
    direction: rtl;
}

.case-payment-modal h2 {
    margin: 4px 0 8px;
    font-size: 1.45rem;
}

.case-payment-modal p {
    margin: 0 0 18px;
    color: #6f665c;
}

.case-payment-modal-close {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(177, 135, 72, 0.18);
    background: #fff;
    cursor: pointer;
}

.case-payment-modal-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.case-payment-modal-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(177, 135, 72, 0.18);
    border-radius: 16px;
    background: #fffdf9;
    cursor: pointer;
    font-weight: 800;
}

.case-payment-modal-options label:has(input:checked) {
    border-color: rgba(166, 115, 44, 0.55);
    background: #f7eddc;
}

.case-payment-modal-error {
    margin-top: 12px;
    color: #a34327;
    font-weight: 800;
}

.case-payment-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    margin-top: 18px;
}

@media (max-width: 760px) {
    .collection-kpi-strip,
    .case-payment-modal-options {
        grid-template-columns: 1fr;
    }
}

/* Inline case preview: keep bottom warnings/notices inside the expanded row. */
html[dir="rtl"] .cases-table .case-inline-preview-row > td {
    overflow: visible;
}

html[dir="rtl"] .cases-table .case-inline-preview-row.is-open .case-inline-preview-panel {
    max-height: none;
    overflow: visible;
    padding-bottom: 30px;
}

html[dir="rtl"] .cases-table .case-inline-preview-card {
    margin-block-end: 6px;
}

html[dir="rtl"] .cases-table .case-inline-preview-summary {
    padding-block-end: 4px;
}

@media (min-width: 1181px) {
    html[dir="rtl"] .cases-table .case-inline-preview-facts {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Cases dashboard polish - central content only */
html[dir="rtl"] .cases-module-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(330px, 1fr) minmax(260px, 330px) minmax(250px, 360px);
    align-items: center;
    gap: 18px;
    min-height: 174px;
    margin: 0 0 10px;
    padding: 26px 32px 26px 24px;
    overflow: hidden;
    border-radius: 30px;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 253, 249, 0.94) 36%, rgba(255, 253, 249, 0.98) 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(250, 246, 239, 0.97) 100%);
    border: 1px solid rgba(177, 135, 72, 0.16);
    box-shadow: 0 18px 42px rgba(46, 34, 22, 0.065);
}

html[dir="rtl"] .cases-module-hero-copy {
    position: relative;
    z-index: 1;
    justify-self: start;
    text-align: right;
}

html[dir="rtl"] .cases-module-hero h1 {
    font-size: 42px;
    line-height: 1;
}

html[dir="rtl"] .cases-module-hero h1::before {
    display: none;
}

html[dir="rtl"] .cases-module-hero h1::after {
    display: none;
}

html[dir="rtl"] .cases-hero-art {
    position: relative;
    z-index: 0;
    justify-self: stretch;
    align-self: stretch;
    min-height: 144px;
    margin: -20px -18px -20px 0;
    border-radius: 26px 0 0 26px;
    background:
        linear-gradient(90deg, rgba(255, 253, 249, 0.02) 0%, rgba(255, 253, 249, 0.7) 88%, rgba(255, 253, 249, 0.98) 100%),
        url("/static/images/cases-hero-illustration.svg") left center / cover no-repeat;
}

html[dir="rtl"] .cases-hero-alert {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 12px;
    align-items: center;
    min-height: 100px;
    padding: 17px 20px;
    border-radius: 22px;
    text-decoration: none;
    color: var(--ds-text);
    background: rgba(255, 252, 248, 0.93);
    border: 1px solid rgba(177, 135, 72, 0.18);
    box-shadow: 0 16px 34px rgba(46, 34, 22, 0.06);
}

html[dir="rtl"] .cases-hero-alert-icon {
    grid-row: 1 / span 3;
    inline-size: 36px;
    block-size: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 900;
}

html[dir="rtl"] .cases-hero-alert strong {
    font-size: 17px;
    font-weight: 950;
}

html[dir="rtl"] .cases-hero-alert small {
    color: var(--ds-text-soft);
    font-weight: 720;
    line-height: 1.5;
}

html[dir="rtl"] .cases-hero-alert-action {
    color: #9b6325;
    font-size: 12px;
    font-weight: 900;
}

html[dir="rtl"] .cases-hero-alert-stuck {
    border-color: rgba(219, 80, 60, 0.25);
    background: linear-gradient(180deg, rgba(255, 251, 247, 0.98) 0%, rgba(255, 240, 235, 0.9) 100%);
}

html[dir="rtl"] .cases-hero-alert-stuck .cases-hero-alert-icon {
    background: #fff0ec;
    color: #cf3f32;
    border: 1px solid rgba(207, 63, 50, 0.2);
}

html[dir="rtl"] .cases-hero-alert-stuck strong {
    color: #cf3f32;
}

html[dir="rtl"] .cases-hero-alert-clear .cases-hero-alert-icon {
    background: #eaf7ee;
    color: #238456;
    border: 1px solid rgba(35, 132, 86, 0.18);
}

html[dir="rtl"] .cases-module-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 0 0 10px;
    padding: 5px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(177, 135, 72, 0.16);
    box-shadow: 0 12px 26px rgba(46, 34, 22, 0.045);
}

html[dir="rtl"] .cases-module-tabs .cases-tab {
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-inline-start-color: rgba(177, 135, 72, 0.12);
    border-radius: 14px;
    font-size: 14px;
    white-space: nowrap;
    justify-content: center;
}

html[dir="rtl"] .cases-action-center {
    margin: 0 0 10px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

html[dir="rtl"] .cases-action-center-inner {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

html[dir="rtl"] .cases-action-center .cases-kpi-card {
    min-height: 110px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-content: center;
    gap: 6px 14px;
    padding: 17px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(177, 135, 72, 0.14);
    box-shadow: 0 14px 28px rgba(46, 34, 22, 0.055);
}

html[dir="rtl"] .cases-action-center .cases-kpi-icon {
    inline-size: 36px;
    block-size: 36px;
    border-radius: 14px;
    font-size: 17px;
}

html[dir="rtl"] .cases-action-center .cases-kpi-card strong {
    font-size: 34px;
}

html[dir="rtl"] .cases-action-center .cases-kpi-title {
    font-size: 13px;
}

html[dir="rtl"] .cases-action-center .cases-kpi-card small {
    font-size: 12px;
}

html[dir="rtl"] .cases-action-center .cases-kpi-card.has-alert {
    border-color: rgba(219, 80, 60, 0.28);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 243, 238, 0.96) 100%);
}

html[dir="rtl"] .cases-action-center .cases-kpi-card.has-alert .cases-kpi-icon {
    background: #fff0ec;
    color: #cf3f32;
    border-color: rgba(207, 63, 50, 0.18);
}

html[dir="rtl"] .cases-action-center .cases-kpi-card.has-alert strong,
html[dir="rtl"] .cases-action-center .cases-kpi-card.has-alert .cases-kpi-title {
    color: #cf3f32;
}

html[dir="rtl"] .cases-kpi-stuck .cases-kpi-icon::before {
    content: "!";
}

html[dir="rtl"] .cases-kpi-personal .cases-kpi-icon::before {
    content: "*";
}

html[dir="rtl"] .cases-kpi-active .cases-kpi-icon::before { content: "□"; }
html[dir="rtl"] .cases-kpi-new .cases-kpi-icon::before { content: "+"; }
html[dir="rtl"] .cases-kpi-download .cases-kpi-icon::before { content: "↓"; }
html[dir="rtl"] .cases-kpi-factory .cases-kpi-icon::before { content: "⌂"; }

html[dir="rtl"] .cases-filter-card {
    margin: 0 0 12px;
    padding: 20px 22px 22px;
    border-radius: 26px;
}

html[dir="rtl"] .cases-filter-head {
    align-items: center;
    padding-bottom: 14px;
    margin-bottom: 14px;
}

html[dir="rtl"] .cases-filter-toolbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
    padding-top: 0;
}

html[dir="rtl"] .cases-filter-toolbar .filter-search-control {
    grid-column: span 2;
}

html[dir="rtl"] .cases-filter-toolbar label {
    min-width: 0;
    padding: 10px 12px 12px;
    border-radius: 18px;
}

html[dir="rtl"] .cases-filter-toolbar .filter-actions {
    grid-column: span 2;
    display: flex;
    gap: 12px;
    align-items: end;
    justify-content: flex-start;
}

html[dir="rtl"] .premium-table-card {
    padding: 22px;
    border-radius: 28px;
}

html[dir="rtl"] .cases-table-head h2 {
    font-size: 25px;
}

html[dir="rtl"] .cases-empty-state {
    min-height: 190px;
    display: grid;
    place-items: center;
    justify-items: center;
    gap: 10px;
    padding: 26px;
}

@media (max-width: 1420px) {
    html[dir="rtl"] .cases-action-center-inner {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    html[dir="rtl"] .cases-module-hero {
        grid-template-columns: minmax(0, 1fr);
    }

    html[dir="rtl"] .cases-hero-art {
        display: none;
    }

    html[dir="rtl"] .cases-action-center-inner,
    html[dir="rtl"] .cases-module-tabs,
    html[dir="rtl"] .cases-filter-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    html[dir="rtl"] .cases-module-hero {
        padding: 22px;
    }

    html[dir="rtl"] .cases-module-hero h1 {
        font-size: 28px;
    }

    html[dir="rtl"] .cases-action-center-inner,
    html[dir="rtl"] .cases-module-tabs,
    html[dir="rtl"] .cases-filter-toolbar {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Case list inner tabs must stay in one professional single-row control. */
html[dir="rtl"] .workspace-layout.cases-workspace-layout .workspace-main > nav.cases-module-tabs {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    grid-template-columns: none !important;
    grid-auto-flow: unset !important;
    padding: 6px !important;
    margin: 0 0 10px !important;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

html[dir="rtl"] .workspace-layout.cases-workspace-layout .workspace-main > nav.cases-module-tabs > a.manager-report-tab.cases-tab {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    min-inline-size: 0 !important;
    width: auto !important;
    max-width: max-content !important;
    max-inline-size: max-content !important;
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 18px !important;
    gap: 8px !important;
    font-size: 14px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

html[dir="rtl"] .workspace-layout.cases-workspace-layout .workspace-main > nav.cases-module-tabs > a.manager-report-tab.cases-tab.is-active,
html[dir="rtl"] .workspace-layout.cases-workspace-layout .workspace-main > nav.cases-module-tabs > a.manager-report-tab.cases-tab[aria-selected="true"],
html[dir="rtl"] .workspace-layout.cases-workspace-layout .workspace-main > nav.cases-module-tabs > a.manager-report-tab.cases-tab.current {
    flex: 0 1 auto !important;
    width: auto !important;
    max-width: max-content !important;
    max-inline-size: max-content !important;
}

html[dir="rtl"] .workspace-layout.cases-workspace-layout .workspace-main > nav.cases-module-tabs > a.manager-report-tab.cases-tab > span:not(.cases-tab-icon) {
    min-width: 0 !important;
    min-inline-size: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

html[dir="rtl"] .workspace-layout.cases-workspace-layout .workspace-main > nav.cases-module-tabs > a.manager-report-tab.cases-tab .cases-tab-icon {
    width: 16px !important;
    height: 16px !important;
    inline-size: 16px !important;
    block-size: 16px !important;
    flex: 0 0 16px !important;
    flex-shrink: 0 !important;
    border-radius: 7px !important;
    font-size: 10px !important;
}

/* Case list KPI cards: seven live counters must stay in one compact row. */
html[dir="rtl"] .workspace-layout.cases-workspace-layout .workspace-main .cases-action-center > .cases-action-center-inner {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 8px !important;
    align-items: stretch !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding-bottom: 2px !important;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

html[dir="rtl"] .workspace-layout.cases-workspace-layout .workspace-main .cases-action-center > .cases-action-center-inner > a.cases-kpi-card {
    width: auto !important;
    min-width: 0 !important;
    min-inline-size: 0 !important;
    min-height: 96px !important;
    padding: 12px 14px !important;
    grid-template-columns: minmax(0, 1fr) 30px !important;
    gap: 4px 8px !important;
}

html[dir="rtl"] .workspace-layout.cases-workspace-layout .workspace-main .cases-action-center > .cases-action-center-inner > a.cases-kpi-card .cases-kpi-icon {
    inline-size: 30px !important;
    block-size: 30px !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
}

html[dir="rtl"] .workspace-layout.cases-workspace-layout .workspace-main .cases-action-center > .cases-action-center-inner > a.cases-kpi-card .cases-kpi-title,
html[dir="rtl"] .workspace-layout.cases-workspace-layout .workspace-main .cases-action-center > .cases-action-center-inner > a.cases-kpi-card small {
    min-width: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

html[dir="rtl"] .workspace-layout.cases-workspace-layout .workspace-main .cases-action-center > .cases-action-center-inner > a.cases-kpi-card .cases-kpi-title {
    font-size: 12px !important;
}

html[dir="rtl"] .workspace-layout.cases-workspace-layout .workspace-main .cases-action-center > .cases-action-center-inner > a.cases-kpi-card strong {
    font-size: 30px !important;
    line-height: 1 !important;
}

html[dir="rtl"] .workspace-layout.cases-workspace-layout .workspace-main .cases-action-center > .cases-action-center-inner > a.cases-kpi-card small {
    font-size: 11px !important;
}
/* Compensation module */
html[dir="rtl"] .icon-compensation::before {
    content: "₪";
    font-weight: 900;
}

html[dir="rtl"] .comp-page-shell {
    display: grid;
    gap: 18px;
    direction: rtl;
}

html[dir="rtl"] .comp-page-head,
html[dir="rtl"] .comp-salary-hero,
html[dir="rtl"] .comp-card,
html[dir="rtl"] .comp-alert-card {
    background: rgba(255, 253, 249, 0.94);
    border: 1px solid rgba(184, 132, 73, 0.16);
    border-radius: 24px;
    box-shadow: 0 18px 45px rgba(45, 35, 24, 0.08);
}

html[dir="rtl"] .comp-page-head {
    display: grid;
    gap: 18px;
    padding: 24px;
}

html[dir="rtl"] .comp-user-strip {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

html[dir="rtl"] .comp-user-strip h1 {
    margin: 4px 0 8px;
    font-size: clamp(34px, 4vw, 58px);
    letter-spacing: 0;
    color: #221d18;
}

html[dir="rtl"] .comp-user-strip p,
html[dir="rtl"] .comp-card-head p {
    margin: 0;
    color: #7f7468;
    font-size: 15px;
}

html[dir="rtl"] .comp-head-actions,
html[dir="rtl"] .comp-form-actions,
html[dir="rtl"] .comp-actions-cell,
html[dir="rtl"] .comp-period-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

html[dir="rtl"] .comp-period-picker {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
    align-items: end;
}

html[dir="rtl"] .comp-period-picker label,
html[dir="rtl"] .comp-form-grid label,
html[dir="rtl"] .comp-inline-form label {
    display: grid;
    gap: 7px;
    color: #5f5145;
    font-weight: 800;
    font-size: 13px;
}

html[dir="rtl"] .comp-period-picker input,
html[dir="rtl"] .comp-period-picker select,
html[dir="rtl"] .comp-form-grid input,
html[dir="rtl"] .comp-form-grid select,
html[dir="rtl"] .comp-form-grid textarea,
html[dir="rtl"] .comp-inline-form select,
html[dir="rtl"] .comp-workday input,
html[dir="rtl"] .comp-workday select,
html[dir="rtl"] .comp-period-actions select {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(133, 105, 75, 0.18);
    border-radius: 14px;
    background: #fffdfa;
    color: #2b241d;
    padding: 9px 12px;
    font: inherit;
}

html[dir="rtl"] .comp-salary-hero {
    min-height: 220px;
    display: grid;
    grid-template-columns: minmax(260px, 0.65fr) 1fr;
    overflow: hidden;
    position: relative;
}

html[dir="rtl"] .comp-hero-art {
    min-height: 220px;
    background:
        linear-gradient(90deg, rgba(255, 253, 249, 0.2), rgba(255, 253, 249, 0.98)),
        url("/static/images/kitchen-visual.jpg");
    background-size: cover;
    background-position: center;
}

html[dir="rtl"] .comp-salary-copy {
    display: grid;
    place-content: center;
    text-align: center;
    padding: 28px 32px;
}

html[dir="rtl"] .comp-salary-copy strong {
    display: block;
    font-size: clamp(48px, 7vw, 86px);
    line-height: 1;
    color: #2b241d;
    font-weight: 900;
}

html[dir="rtl"] .comp-salary-copy small {
    color: #7a6e61;
    font-size: 15px;
}

html[dir="rtl"] .comp-salary-breakdown {
    position: absolute;
    inset-inline: 50%;
    transform: translateX(50%);
    bottom: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(130px, 1fr));
    min-width: min(640px, calc(100% - 48px));
    background: rgba(255, 253, 249, 0.92);
    border: 1px solid rgba(184, 132, 73, 0.16);
    border-radius: 22px;
    box-shadow: 0 14px 35px rgba(45, 35, 24, 0.1);
    overflow: hidden;
}

html[dir="rtl"] .comp-salary-breakdown article {
    padding: 14px 18px;
    text-align: center;
    border-inline-start: 1px solid rgba(184, 132, 73, 0.12);
}

html[dir="rtl"] .comp-salary-breakdown article:first-child {
    border-inline-start: 0;
}

html[dir="rtl"] .comp-salary-breakdown span {
    display: block;
    color: #6e6358;
    font-size: 13px;
    font-weight: 800;
}

html[dir="rtl"] .comp-salary-breakdown strong {
    color: #3d3127;
    font-size: 20px;
}

html[dir="rtl"] .comp-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

html[dir="rtl"] .comp-kpi-card {
    min-height: 112px;
    background: rgba(255, 253, 249, 0.95);
    border: 1px solid rgba(184, 132, 73, 0.16);
    border-radius: 20px;
    box-shadow: 0 14px 35px rgba(45, 35, 24, 0.06);
    padding: 18px;
    display: grid;
    gap: 7px;
    position: relative;
}

html[dir="rtl"] .comp-kpi-card.is-warning {
    border-color: rgba(218, 97, 72, 0.28);
    background: rgba(255, 246, 242, 0.95);
}

html[dir="rtl"] .comp-kpi-card small {
    color: #5f5145;
    font-weight: 900;
    font-size: 14px;
}

html[dir="rtl"] .comp-kpi-card strong {
    font-size: 26px;
    color: #2a221b;
}

html[dir="rtl"] .comp-icon {
    position: absolute;
    inset-inline-start: 18px;
    top: 18px;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 14px;
    display: inline-grid;
    place-items: center;
    background: rgba(184, 132, 73, 0.11);
    color: #ad7434;
    font-weight: 900;
}

html[dir="rtl"] .comp-tabs {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 8px;
    background: rgba(255, 253, 249, 0.92);
    border: 1px solid rgba(184, 132, 73, 0.14);
    border-radius: 22px;
    padding: 8px;
    box-shadow: 0 12px 30px rgba(45, 35, 24, 0.05);
}

html[dir="rtl"] .comp-tabs a {
    text-decoration: none;
    color: #4b4036;
    font-weight: 900;
    text-align: center;
    padding: 13px 10px;
    border-radius: 16px;
    border: 1px solid transparent;
    transition: 0.18s ease;
}

html[dir="rtl"] .comp-tabs a:hover {
    border-color: rgba(184, 132, 73, 0.22);
    background: rgba(184, 132, 73, 0.07);
}

html[dir="rtl"] .comp-tabs a.is-active {
    color: #fff;
    background: linear-gradient(180deg, #c99a57, #a97634);
    box-shadow: 0 12px 24px rgba(169, 118, 52, 0.24);
}

html[dir="rtl"] .comp-card {
    padding: 22px;
}

html[dir="rtl"] .comp-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
}

html[dir="rtl"] .comp-card-head h2 {
    margin: 0;
    color: #241e18;
    font-size: 22px;
}

html[dir="rtl"] .comp-card-head span,
html[dir="rtl"] .comp-card-head a {
    color: #ad7434;
    font-weight: 900;
    text-decoration: none;
}

html[dir="rtl"] .comp-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
}

html[dir="rtl"] .comp-grid-summary {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 0.8fr);
}

html[dir="rtl"] .comp-wide-card {
    grid-column: 1 / -1;
}

html[dir="rtl"] .comp-definition-list {
    display: grid;
    gap: 8px;
    margin: 0;
}

html[dir="rtl"] .comp-definition-list div,
html[dir="rtl"] .comp-alert-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    background: rgba(247, 241, 232, 0.78);
    border: 1px solid rgba(184, 132, 73, 0.08);
    border-radius: 14px;
}

html[dir="rtl"] .comp-definition-list dt,
html[dir="rtl"] .comp-alert-list span {
    color: #6d6258;
    font-weight: 800;
}

html[dir="rtl"] .comp-definition-list dd,
html[dir="rtl"] .comp-alert-list strong {
    margin: 0;
    font-weight: 900;
    color: #2a221b;
}

html[dir="rtl"] .comp-definition-list .is-total {
    background: rgba(184, 132, 73, 0.13);
}

html[dir="rtl"] .comp-alert-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

html[dir="rtl"] .comp-table-wrap {
    overflow-x: auto;
}

html[dir="rtl"] .comp-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

html[dir="rtl"] .comp-table th {
    background: #1f1a16;
    color: #fff;
    font-weight: 900;
    padding: 13px 12px;
    white-space: nowrap;
}

html[dir="rtl"] .comp-table th:first-child {
    border-start-start-radius: 14px;
}

html[dir="rtl"] .comp-table th:last-child {
    border-start-end-radius: 14px;
}

html[dir="rtl"] .comp-table td {
    padding: 13px 12px;
    border-bottom: 1px solid rgba(133, 105, 75, 0.1);
    color: #2d251d;
    vertical-align: middle;
    background: rgba(255, 253, 249, 0.78);
}

html[dir="rtl"] .comp-table tr:hover td {
    background: rgba(247, 241, 232, 0.95);
}

html[dir="rtl"] .comp-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    margin-inline-start: 4px;
    background: #f0ebe4;
    color: #62564b;
}

html[dir="rtl"] .comp-badge-paid,
html[dir="rtl"] .comp-badge-approved,
html[dir="rtl"] .comp-badge-synced {
    color: #24714b;
    background: #e6f5eb;
}

html[dir="rtl"] .comp-badge-unpaid,
html[dir="rtl"] .comp-badge-pending_admin_approval {
    color: #b46822;
    background: #fff1dc;
}

html[dir="rtl"] .comp-badge-rejected,
html[dir="rtl"] .comp-badge-cancelled {
    color: #ba4337;
    background: #ffe7e3;
}

html[dir="rtl"] .comp-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

html[dir="rtl"] .comp-form-compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

html[dir="rtl"] .comp-span-2 {
    grid-column: 1 / -1;
}

html[dir="rtl"] .comp-form-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
}

html[dir="rtl"] .comp-inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

html[dir="rtl"] .button.mini {
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
}

html[dir="rtl"] .button.danger {
    color: #b13d2f;
    background: #fff0ec;
    border: 1px solid rgba(177, 61, 47, 0.24);
}

html[dir="rtl"] .comp-workday-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

html[dir="rtl"] .comp-workday {
    display: grid;
    gap: 7px;
    padding: 12px;
    border: 1px solid rgba(184, 132, 73, 0.12);
    border-radius: 16px;
    background: rgba(247, 241, 232, 0.58);
}

html[dir="rtl"] .comp-empty-state,
html[dir="rtl"] .comp-alert-card {
    padding: 18px;
    border-radius: 18px;
    color: #65594e;
    background: rgba(247, 241, 232, 0.68);
    text-align: center;
    font-weight: 800;
}

html[dir="rtl"] .comp-history-list {
    display: grid;
    gap: 9px;
}

html[dir="rtl"] .comp-history-list > div {
    padding: 13px 14px;
    border-radius: 14px;
    background: rgba(247, 241, 232, 0.64);
    border: 1px solid rgba(184, 132, 73, 0.1);
}

html[dir="rtl"] .comp-history-list strong,
html[dir="rtl"] .comp-history-list small {
    display: block;
}

html[dir="rtl"] .comp-history-list small {
    color: #807368;
    margin-top: 4px;
}

@media (max-width: 1180px) {
    html[dir="rtl"] .comp-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html[dir="rtl"] .comp-tabs {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    html[dir="rtl"] .comp-user-strip,
    html[dir="rtl"] .comp-card-head {
        display: grid;
    }

    html[dir="rtl"] .comp-period-picker,
    html[dir="rtl"] .comp-salary-hero,
    html[dir="rtl"] .comp-grid,
    html[dir="rtl"] .comp-form-grid,
    html[dir="rtl"] .comp-form-compact {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .comp-tabs {
        grid-template-columns: 1fr 1fr;
    }

    html[dir="rtl"] .comp-salary-breakdown {
        position: static;
        transform: none;
        min-width: 0;
        margin: 0 16px 16px;
        grid-template-columns: 1fr;
    }
}
