@font-face {
    font-family: "Vazirmatn";
    src: url("fonts/Vazirmatn-Variable.f6d31671339d.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --skos-space-1: 4px;
    --skos-space-2: 8px;
    --skos-space-3: 12px;
    --skos-space-4: 16px;
    --skos-space-6: 24px;
    --skos-space-8: 32px;
    --skos-radius-sm: 6px;
    --skos-radius-md: 10px;
    --skos-radius-lg: 16px;
    --skos-navy: #17324d;
    --skos-navy-strong: #102a43;
    --skos-orange: #f28c28;
    --skos-text: #1f2937;
    --skos-surface: #ffffff;
    --skos-surface-soft: #f6f8fb;
    --skos-border: #e2e8f0;
    --skos-muted: #64748b;
    --skos-success: #176b47;
    --skos-warning: #8a5a0b;
    --skos-danger: #c24141;
    --skos-focus: 0 0 0 3px rgba(242, 140, 40, .28);
    --skos-sidebar-width: 232px;
    --skos-content-readable: 900px;
    --skos-content-wide: 1440px;
    --skos-content-dense: 1440px;
    --skos-mobile-gutter: 16px;
    --skos-control-min-height: 44px;
    --skos-font-size-body: 15px;
    --skos-font-size-table: 14px;

    /* Keep legacy component variables aligned with the single SKOS system. */
    --navy: var(--skos-navy);
    --navy2: var(--skos-navy);
    --orange: var(--skos-orange);
    --bg: var(--skos-surface-soft);
    --text: var(--skos-text);
    --muted: var(--skos-muted);
    --border: var(--skos-border);
    --green: var(--skos-success);
    --red: var(--skos-danger);
    --amber: var(--skos-warning);
    --crm-primary: var(--skos-navy);
    --crm-primary-dark: var(--skos-navy-strong);
    --crm-accent: var(--skos-orange);
    --crm-paper: var(--skos-surface-soft);
    --crm-card: var(--skos-surface);
    --crm-border: var(--skos-border);
    --crm-muted: var(--skos-muted);
    --crm-sidebar-width: var(--skos-sidebar-width);
    --ui-navy: var(--skos-navy);
    --ui-orange: var(--skos-orange);
    --ui-bg: var(--skos-surface-soft);
    --ui-surface: var(--skos-surface);
    --ui-text: var(--skos-text);
    --ui-muted: var(--skos-muted);
    --ui-border: var(--skos-border);
}

/* Global presentation contract; the bundled font never needs an external host. */
html {
    direction: rtl;
    background: var(--skos-surface-soft);
}

body,
button,
input,
select,
textarea,
table,
summary {
    font-family: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
}

body {
    color: var(--skos-text);
    font-size: var(--skos-font-size-body);
    font-weight: 400;
    text-align: right;
}

/* Author display rules must never defeat the HTML hidden state. */
[hidden] {
    display: none !important;
}

.ltr-value,
.technical-value,
.phone-value,
.financial-amount,
.quantity,
.identifier {
    direction: ltr;
    unicode-bidi: isolate;
}

.ltr-value,
.technical-value,
.phone-value {
    display: inline-block;
    max-width: 100%;
}

.technical-value,
.identifier {
    overflow-wrap: anywhere;
}

.content-readable,
.content-wide,
.content-dense {
    width: calc(100% - 48px);
    min-width: 0;
    margin-inline: auto;
}

.content-readable { max-width: var(--skos-content-readable); }
.content-wide { max-width: var(--skos-content-wide); }
.content-dense { max-width: var(--skos-content-dense); }

.crm-app-body {
    background: var(--skos-surface-soft);
}

.crm-app-body .crm-shell {
    width: 100%;
    max-width: 1920px;
    grid-template-columns: var(--skos-sidebar-width) minmax(0, 1fr);
}

.crm-app-body .crm-main {
    width: calc(100% - 48px);
    max-width: var(--skos-content-wide);
    min-width: 0;
    padding-block: 24px 48px;
}

.crm-app-body h1,
.crm-app-body h2,
.crm-app-body h3,
.crm-app-body h4,
.crm-app-body h5,
.crm-app-body h6 {
    color: var(--skos-navy);
}

.crm-app-body .page-header h1,
.crm-app-body .mission-hero h1,
.crm-app-body .customer-hero h1,
.crm-app-body .ds-page-header h1 {
    font-size: clamp(28px, 2.1vw, 32px);
    font-weight: 700;
    letter-spacing: normal;
    line-height: 1.4;
}

.crm-app-body .panel-heading h2,
.crm-app-body .ds-section-header h2,
.crm-app-body .section-inline-heading h2 {
    font-weight: 600;
}

.crm-app-body label,
.crm-app-body .btn,
.crm-app-body button,
.crm-app-body .nav-section a {
    font-weight: 500;
}

.crm-app-body table,
.crm-app-body .workspace-table,
.crm-app-body .ds-data-table {
    font-size: var(--skos-font-size-table);
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

/* Operational links are calm at rest and explicit for pointer/keyboard use. */
.crm-app-body a {
    color: var(--skos-navy);
    text-decoration: none;
    text-decoration-thickness: from-font;
    text-underline-offset: .18em;
}

.crm-app-body a:hover { color: var(--skos-navy-strong); }
.crm-app-body a:active { color: #0b2135; }

.crm-auth-body :is(a, button, summary, input, select, textarea):focus-visible,
.crm-app-body a:focus-visible,
.crm-app-body button:focus-visible,
.crm-app-body summary:focus-visible,
.crm-app-body input:focus-visible,
.crm-app-body select:focus-visible,
.crm-app-body textarea:focus-visible {
    border-radius: var(--skos-radius-sm);
    outline: 2px solid var(--skos-orange);
    outline-offset: 2px;
    box-shadow: var(--skos-focus);
}

.crm-app-body .prose a,
.crm-app-body .rich-text a,
.crm-app-body .help-copy a {
    text-decoration: underline;
}

/* Authenticated header: explicit contrast over the navy surface. */
.crm-app-body .crm-brand,
.crm-app-body .crm-brand:hover,
.crm-app-body .crm-brand:active,
.crm-app-body .crm-brand .brand-copy strong { color: var(--skos-surface); }
.crm-app-body .crm-brand .brand-copy small { color: #e2e8f0; }
.crm-app-body .crm-brand { flex-shrink: 0; white-space: nowrap; }
.crm-app-body .crm-topbar-inner { padding-block: 4px; gap: var(--skos-space-2); }
.crm-app-body .crm-topbar :is(summary, .nav-toggle) {
    min-height: var(--skos-control-min-height);
    min-width: var(--skos-control-min-height);
    box-sizing: border-box;
}

/* Amount and currency form one reading unit; identifiers remain exact text. */
.money-rial {
    display: inline-flex;
    align-items: baseline;
    gap: .3em;
    direction: rtl;
    unicode-bidi: isolate;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* App navigation */
.crm-app-body .crm-sidebar {
    border-inline-end: 0;
    background: var(--skos-navy);
    box-shadow: -6px 0 18px rgba(15, 23, 42, .08);
}

.crm-app-body .sidebar-brand-panel {
    margin: 12px 12px 6px;
    padding: 10px;
    border: 0;
    border-radius: var(--skos-radius-md);
    background: rgba(255, 255, 255, .07);
}

.crm-app-body .sidebar-brand-panel img {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 10px;
}

.crm-app-body .sidebar-brand-panel strong { color: #fff; font-size: 12px; }
.crm-app-body .sidebar-brand-panel span { color: rgba(255, 255, 255, .66); font-size: 10px; }
.crm-app-body .sidebar-nav { padding-inline: 10px; scrollbar-color: rgba(255, 255, 255, .28) transparent; }
.crm-app-body .crm-core-nav .nav-section { gap: 3px; padding-block: 8px; }

.crm-app-body .crm-core-nav .nav-section h2,
.crm-app-body .crm-secondary-nav > summary {
    color: rgba(255, 255, 255, .62);
    font-weight: 500;
}

.crm-app-body .crm-core-nav .nav-section a {
    min-height: var(--skos-control-min-height);
    gap: 10px;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    color: rgba(255, 255, 255, .82);
    font-size: 12.5px;
}

.crm-app-body .crm-core-nav .nav-section a:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.crm-app-body .crm-core-nav .nav-section a.is-active {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    box-shadow: inset -3px 0 0 var(--skos-orange);
}

.crm-app-body .crm-core-nav .nav-section a.is-active::before { display: none; }

.crm-app-body .nav-glyph {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    border-radius: 7px;
    background: rgba(255, 255, 255, .08);
    color: currentColor;
    padding: 3px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.crm-app-body .nav-section a.is-active .nav-glyph {
    background: rgba(242, 140, 40, .2);
    color: #fff;
}

.crm-app-body .sidebar-footer {
    padding: 10px 12px;
    background: var(--skos-navy-strong) !important;
}

.crm-app-body .sidebar-user { padding-bottom: 8px; }
.crm-app-body .sidebar-logout {
    min-height: var(--skos-control-min-height);
    border-color: rgba(255, 255, 255, .14);
    background: transparent;
    color: rgba(255, 255, 255, .72);
    font-weight: 500;
}
.crm-app-body .sidebar-logout:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* Shared components */
.crm-app-body .panel,
.crm-app-body .ui-panel,
.crm-app-body .stat-card,
.crm-app-body .ds-summary-card,
.crm-app-body .ds-quick-action-card {
    border-color: var(--skos-border);
    background: var(--skos-surface);
    box-shadow: 0 2px 10px rgba(15, 23, 42, .035);
}

.crm-app-body .panel-heading,
.crm-app-body .ui-panel-heading {
    border-bottom-color: #edf1f5;
}

.crm-app-body .btn {
    min-height: var(--skos-control-min-height);
    border-radius: var(--skos-radius-md);
}

.crm-app-body summary,
.crm-app-body .account-logout-button,
.crm-app-body .command-search-panel a {
    min-height: var(--skos-control-min-height);
    min-width: var(--skos-control-min-height);
}

.crm-app-body .btn-primary {
    border-color: var(--skos-orange);
    background: var(--skos-orange);
    color: #1f2937;
    box-shadow: none;
}

.crm-app-body .btn-primary:hover { border-color: #db7414; background: #e9801d; }

.crm-app-body .form-control,
.crm-app-body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.crm-app-body select,
.crm-app-body textarea {
    border-color: #cbd5e1;
    border-radius: var(--skos-radius-md);
    background: #fff;
    color: var(--skos-text);
    min-height: var(--skos-control-min-height);
}

.crm-app-body .form-control:focus,
.crm-app-body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus,
.crm-app-body select:focus,
.crm-app-body textarea:focus {
    border-color: var(--skos-navy);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(23, 50, 77, .12);
}

.crm-app-body .form-control:focus-visible,
.crm-app-body input:not([type="hidden"]):focus-visible,
.crm-app-body select:focus-visible,
.crm-app-body textarea:focus-visible {
    outline: 2px solid var(--skos-orange);
    outline-offset: 2px;
    box-shadow: var(--skos-focus);
}

.crm-app-body .panel:has(.searchable-customer-picker) {
    overflow: visible;
}

.crm-app-body .status-badge,
.crm-app-body .result-badge,
.crm-app-body .priority,
.crm-app-body .type-badge,
.crm-app-body .ds-status-badge {
    font-weight: 500;
}

.crm-app-body .message.success { color: var(--skos-success); }
.crm-app-body .message.warning { color: var(--skos-warning); }
.crm-app-body .message.error { color: var(--skos-danger); }

.crm-app-body .breadcrumb,
.crm-app-body .ds-breadcrumb {
    color: var(--skos-muted);
    font-size: 13px;
}

.crm-app-body .timeline-dot {
    background: var(--skos-navy);
    box-shadow: 0 0 0 2px #cbd5e1;
}

.crm-app-body .empty-state,
.crm-app-body .ds-empty-state {
    border-color: var(--skos-border);
    background: var(--skos-surface-soft);
    color: var(--skos-muted);
}

.crm-app-body .table-wrap,
.crm-app-body .ds-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

.crm-app-body .workspace-table,
.crm-app-body .ds-data-table {
    color: var(--skos-text);
}

.crm-app-body .workspace-table th,
.crm-app-body .workspace-table td,
.crm-app-body .ds-data-table th,
.crm-app-body .ds-data-table td {
    border: 0;
    border-bottom: 1px solid #edf1f5;
    padding: 10px 12px;
    text-align: right;
}

.crm-app-body .workspace-table th,
.crm-app-body .ds-data-table th {
    background: #f8fafc;
    color: var(--skos-muted);
    font-weight: 500;
}

.crm-app-body .workspace-table tbody tr:hover,
.crm-app-body .ds-data-table tbody tr:hover { background: #f8fafc; }

.crm-app-body .table-sticky thead th,
.crm-app-body .ds-table-wrap.is-sticky thead th {
    position: sticky;
    z-index: 2;
    top: 0;
}

.ds-page-header,
.ds-section-header,
.ds-primary-actions,
.ds-breadcrumb,
.ds-tabs,
.ds-pagination {
    display: flex;
    align-items: center;
    gap: var(--skos-space-3);
}

.ds-page-header,
.ds-section-header {
    justify-content: space-between;
}

.ds-page-header { margin-block-end: var(--skos-space-6); }
.ds-page-header h1,
.ds-section-header h2 { margin: 0; color: var(--skos-navy); }
.ds-page-header p,
.ds-section-header p { margin: var(--skos-space-1) 0 0; color: var(--skos-muted); }
.ds-breadcrumb { margin-block-end: var(--skos-space-2); font-size: 13px; }
.ds-breadcrumb a { color: var(--skos-navy); }
.ds-primary-actions { min-width: 0; flex-wrap: wrap; justify-content: flex-end; }

.ds-quick-action-grid,
.ds-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
    gap: var(--skos-space-3);
}

.ds-quick-action-card,
.ds-summary-card {
    min-width: 0;
    border: 1px solid var(--skos-border);
    border-radius: var(--skos-radius-md);
    background: var(--skos-surface);
}

.ds-quick-action-card {
    display: grid;
    min-height: 96px;
    padding: var(--skos-space-4);
    color: inherit;
    text-decoration: none;
}

.ds-quick-action-card:hover,
.ds-quick-action-card:focus-visible {
    border-color: var(--skos-orange);
    outline: 3px solid rgba(230, 126, 34, .18);
    outline-offset: 2px;
}

.ds-quick-action-card strong { color: var(--skos-navy); }
.ds-quick-action-card span { color: var(--skos-muted); font-size: 12px; }
.ds-summary-card { padding: var(--skos-space-4); }
.ds-summary-card > span { display: block; color: var(--skos-muted); font-size: 12px; }
.ds-summary-card > strong { display: block; margin-top: var(--skos-space-2); color: var(--skos-navy); font-size: 22px; }

.ds-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding-inline: var(--skos-space-3);
    border-radius: 999px;
    background: #eaf1f6;
    color: var(--skos-navy);
    font-size: 12px;
    font-weight: 800;
}

.ds-status-badge.is-degraded { background: #fff0ee; color: var(--skos-danger); }
.ds-tabs { flex-wrap: wrap; margin-block: var(--skos-space-4); }
.ds-tabs a { min-height: 44px; padding: 9px 14px; border-radius: var(--skos-radius-md); color: var(--skos-navy); text-decoration: none; }
.ds-tabs a:hover,
.ds-tabs a:focus-visible { background: #eaf1f6; outline: 2px solid var(--skos-orange); }
.ds-tabs a[aria-current="page"] { background: var(--skos-navy); color: white; }

.ds-table-wrap { max-width: 100%; overflow-x: auto; }
.ds-data-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ds-data-table th,
.ds-data-table td { padding: var(--skos-space-3); border-bottom: 1px solid var(--skos-border); text-align: start; vertical-align: top; }
.ds-data-table th { color: var(--skos-muted); font-size: 12px; }
.ds-responsive-record-list { display: none; gap: var(--skos-space-3); }
.ds-responsive-record { padding: var(--skos-space-4); border: 1px solid var(--skos-border); border-radius: var(--skos-radius-md); background: white; }
.ds-responsive-record dl { display: grid; grid-template-columns: minmax(85px, auto) 1fr; gap: var(--skos-space-2); margin: 0; }
.ds-responsive-record dt { color: var(--skos-muted); }
.ds-responsive-record dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.ds-empty-state { padding: var(--skos-space-6); border: 1px dashed var(--skos-border); border-radius: var(--skos-radius-md); background: var(--skos-surface-soft); color: var(--skos-muted); text-align: center; }
.ds-pagination { flex-wrap: wrap; justify-content: center; margin-block-start: var(--skos-space-4); }
.ds-pagination a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: var(--skos-space-4); border: 1px solid var(--skos-border); border-radius: var(--skos-radius-md); color: var(--skos-navy); text-decoration: none; }

.financial-amount,
.quantity,
.identifier,
.source-freshness {
    font-variant-numeric: tabular-nums;
}

.financial-amount,
.quantity,
.identifier { direction: ltr; unicode-bidi: isolate; }
.financial-amount { max-width: 100%; overflow-wrap: anywhere; }
.identifier { white-space: normal; overflow-wrap: anywhere; }
.source-freshness { color: var(--skos-muted); font-size: 12px; }

.customer-workspace-nav { margin-block: var(--skos-space-4) var(--skos-space-6); }
.statement-panel { margin-block-end: var(--skos-space-4); }
.statement-meta { display: flex; flex-wrap: wrap; gap: var(--skos-space-2) var(--skos-space-4); color: var(--skos-muted); }
.statement-alert { margin-block: var(--skos-space-4); }

@media (max-width: 720px) {
    .content-readable,
    .content-wide,
    .content-dense {
        width: calc(100% - 2 * var(--skos-mobile-gutter));
    }

    .crm-app-body .crm-main {
        width: 100%;
        padding-inline: var(--skos-mobile-gutter);
    }

    .crm-app-body .crm-core-nav .nav-section a,
    .crm-app-body .crm-secondary-nav > summary,
    .crm-app-body .sidebar-logout {
        min-height: 44px;
    }

    .crm-app-body .page-header h1,
    .crm-app-body .mission-hero h1,
    .crm-app-body .customer-hero h1,
    .crm-app-body .ds-page-header h1 {
        font-size: clamp(25px, 7vw, 29px);
    }

    .crm-app-body img,
    .crm-app-body svg,
    .crm-app-body canvas { max-width: 100%; }

    .ds-page-header,
    .ds-section-header { align-items: stretch; flex-direction: column; }
    .ds-primary-actions { justify-content: stretch; }
    .ds-primary-actions .btn { min-height: 44px; flex: 1 1 auto; }
    .ds-quick-action-grid,
    .ds-summary-grid { grid-template-columns: 1fr; }
    .statement-financial-table { display: none; }
    .ds-responsive-record-list { display: grid; }
    .ds-responsive-record .identifier { white-space: normal; overflow-wrap: anywhere; }
}

/* Reviewed operational records keep readable values on narrow screens. */
.crm-app-body .integration-run-facts strong {
    max-width: 100%; white-space: normal; overflow-wrap: anywhere; font-size: 16px;
}
.crm-app-body .crm-report-grid .quick-action-card {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 16px; min-height: 76px;
}
.crm-app-body .crm-report-grid .quick-action-card strong { font-size: 16px; }
.crm-app-body .crm-report-grid .quick-action-card > span { font-size: 20px; }
@media (max-width: 767px) {
    .crm-app-body .customer-review-summary .grouped-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
    }
    .crm-app-body .customer-review-summary .stat-card { min-height: 0; padding: 10px 12px; }
    .crm-app-body .customer-review-summary .stat-card strong { font-size: 23px; }
    .crm-app-body .mobile-record-table,
    .crm-app-body .mobile-record-table tbody { display: block; width: 100%; min-width: 0; }
    .crm-app-body .mobile-record-table thead { display: none; }
    .crm-app-body .mobile-record-table tbody tr {
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
        margin: 12px; border: 1px solid var(--skos-border); border-radius: 10px;
    }
    .crm-app-body .mobile-record-table td {
        display: grid; align-content: start; min-width: 0; gap: 4px;
        padding: 10px; border: 0; white-space: normal; overflow-wrap: anywhere;
    }
    .crm-app-body .mobile-record-table td::before {
        content: attr(data-label); color: var(--skos-muted); font-size: 11px;
    }
    .crm-app-body .mobile-record-table td:first-child,
    .crm-app-body .mobile-record-table td[colspan] { grid-column: 1 / -1; }
    .crm-app-body .mobile-record-table td[colspan]::before { display: none; }
    .crm-app-body .mobile-record-table :is(.financial-amount, .quantity) {
        max-width: 100%; overflow-x: auto; white-space: nowrap; font-size: 13px;
    }
}

@media print {
    @page { margin: 14mm; }
    .statement-print-mode .crm-topbar,
    .statement-print-mode .crm-sidebar,
    .statement-print-mode .nav-backdrop,
    .statement-print-mode .messages,
    .statement-print-mode .no-print { display: none !important; }
    .statement-print-mode .crm-shell { display: block !important; }
    .statement-print-mode .crm-main { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
    .statement-print-mode { background: white; color: #111; }
    .statement-print-mode .panel { box-shadow: none !important; }
    .statement-print-mode .statement-panel { break-inside: auto; overflow: visible; }
    .statement-print-mode .ds-summary-card,
    .statement-print-mode .ds-section-header,
    .statement-print-mode .statement-financial-table tr { break-inside: avoid; }
    .statement-print-mode .ds-responsive-record-list { display: none !important; }
    .statement-print-mode .ds-table-wrap { overflow: visible; }
    .statement-print-mode .statement-financial-table { display: table !important; table-layout: fixed; font-size: 10px; }
    .statement-print-mode .statement-financial-table thead { display: table-header-group; }
    .statement-print-mode .statement-financial-table .financial-amount { white-space: nowrap; }
    .statement-print-mode a { color: inherit; text-decoration: none; }
}
