:root {
  color-scheme: light;
  --navy-950: #09274e;
  --navy-900: #0e3568;
  --navy-800: #12457f;
  --blue-600: #2864e8;
  --blue-500: #3e78f1;
  --blue-100: #eaf1ff;
  --blue-50: #f5f8ff;
  --cyan-500: #1aa8b8;
  --green-600: #12835f;
  --green-100: #e2f6ef;
  --amber-600: #a9640a;
  --amber-100: #fff2d6;
  --red-600: #c33e4d;
  --red-100: #fde7ea;
  --ink-900: #17233d;
  --ink-700: #3b4964;
  --ink-500: #66728a;
  --line: #e3e8f2;
  --surface: #ffffff;
  --canvas: #f3f6fb;
  --shadow: 0 20px 50px rgba(20, 42, 78, .12);
  --shadow-soft: 0 8px 24px rgba(20, 42, 78, .08);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); color: var(--ink-900); }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-view { min-height: 100vh; display: grid; grid-template-columns: 1.08fr .92fr; background: var(--surface); }
.login-art { position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 72px; color: #fff; background: linear-gradient(145deg, #0a2c5c 0%, #114b8c 56%, #167aa0 100%); }
.login-art::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 20% 18%, rgba(83, 168, 255, .32), transparent 34%), linear-gradient(115deg, transparent 0 62%, rgba(255,255,255,.08) 62% 63%, transparent 63%); }
.login-art-copy { position: relative; max-width: 600px; z-index: 2; }
.login-art-copy h1 { margin: 12px 0 18px; font-size: clamp(38px, 5vw, 66px); line-height: 1.18; letter-spacing: -.04em; }
.login-art-copy p { margin: 0; font-size: 18px; color: rgba(255,255,255,.78); }
.brand-orbit { position: absolute; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; }
.orbit-one { width: 520px; height: 520px; top: -170px; left: -100px; }
.orbit-two { width: 360px; height: 360px; top: -90px; left: -20px; }
.brand-mark.large { position: absolute; top: 78px; left: 90px; width: 118px; height: 118px; font-size: 58px; opacity: .97; z-index: 2; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 48px; }
.login-card { width: min(430px, 100%); }
.brand-lockup, .sidebar-brand { display: flex; align-items: center; gap: 13px; }
.brand-lockup { margin-bottom: 66px; }
.brand-lockup strong, .sidebar-brand strong { display: block; font-size: 18px; }
.brand-lockup span, .sidebar-brand span { display: block; margin-top: 3px; color: var(--ink-500); font-size: 12px; }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; color: #fff; font-size: 24px; font-weight: 800; background: linear-gradient(145deg, var(--blue-500), var(--navy-900)); box-shadow: 0 10px 25px rgba(40,100,232,.25); }
.login-heading { margin-bottom: 30px; }
.login-heading h2 { margin: 7px 0 10px; font-size: 34px; letter-spacing: -.03em; }
.login-heading p { margin: 0; color: var(--ink-500); }
.eyebrow { color: var(--blue-600); font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.eyebrow.light { color: #8bd8ef; }
.field { display: grid; gap: 8px; margin-bottom: 18px; color: var(--ink-700); font-size: 13px; font-weight: 700; }
.field input, .field select, .field textarea, .search-input { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 14px; background: #fff; color: var(--ink-900); outline: none; transition: border .2s, box-shadow .2s; }
.field textarea { padding-top: 12px; min-height: 100px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .search-input:focus { border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(62,120,241,.12); }
.primary-button, .secondary-button, .ghost-button, .danger-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 43px; padding: 0 18px; border-radius: 10px; border: 0; font-weight: 800; text-decoration: none; transition: transform .15s, box-shadow .2s, background .2s; }
.primary-button { color: #fff; background: linear-gradient(135deg, var(--blue-600), var(--blue-500)); box-shadow: 0 9px 20px rgba(40,100,232,.22); }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 12px 24px rgba(40,100,232,.28); }
.secondary-button { color: var(--navy-900); background: var(--blue-100); }
.ghost-button { color: var(--ink-700); background: transparent; border: 1px solid var(--line); }
.danger-button { color: var(--red-600); background: var(--red-100); }
.full { width: 100%; }
.form-error { min-height: 20px; color: var(--red-600); font-size: 13px; }
.login-note { margin: 24px 0 0; text-align: center; color: var(--ink-500); font-size: 12px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--navy-950); color: #fff; box-shadow: 8px 0 30px rgba(9,39,78,.11); z-index: 20; }
.sidebar-brand { padding: 22px 24px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand .brand-mark { background: linear-gradient(145deg, #3c79ee, #19a2bb); box-shadow: none; }
.sidebar-brand span { color: rgba(255,255,255,.58); }
.navigation { flex: 1; overflow-y: auto; padding: 14px 12px; scrollbar-width: thin; }
.nav-item { width: 100%; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 11px; margin: 3px 0; padding: 10px 12px; border: 0; border-radius: 10px; color: rgba(255,255,255,.74); background: transparent; text-align: right; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.active { color: #fff; background: linear-gradient(100deg, rgba(61,120,241,.42), rgba(26,168,184,.16)); box-shadow: inset -3px 0 0 #5f91f6; }
.nav-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.08); font-size: 11px; font-weight: 800; }
.nav-item.active .nav-icon { background: rgba(255,255,255,.15); }
.nav-arrow { opacity: .38; }
.sidebar-footer { padding: 15px 16px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.version-pill { margin-bottom: 11px; color: rgba(255,255,255,.6); font-size: 11px; }
.version-pill span { display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: #46d1a5; box-shadow: 0 0 0 4px rgba(70,209,165,.12); }
.sidebar-logout { width: 100%; color: rgba(255,255,255,.78); border-color: rgba(255,255,255,.13); }
.app-main { min-width: 0; }
.topbar { height: 74px; position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; background: rgba(255,255,255,.92); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar-context span, .user-chip small { display: block; color: var(--ink-500); font-size: 11px; }
.topbar-context strong { display: block; margin-top: 3px; font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; color: var(--ink-700); background: #fff; }
.notification-button { position: relative; font-size: 18px; }
.notification-button .notification-count { position: absolute; top: -6px; right: -7px; min-width: 21px; height: 21px; display: grid; place-items: center; padding: 0 5px; border-radius: 999px; color: #fff; background: var(--red-600); border: 2px solid #fff; font-size: 9px; font-weight: 800; line-height: 1; }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 180px; border: 0; background: transparent; color: var(--ink-900); text-align: right; }
.user-avatar { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(145deg, var(--navy-900), var(--cyan-500)); font-weight: 800; }
.menu-button { display: none; }
.content { padding: 28px; outline: none; }

.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; }
.page-header h1 { margin: 6px 0 0; font-size: 28px; letter-spacing: -.03em; }
.page-header p { margin: 8px 0 0; color: var(--ink-500); }
.header-actions { display: flex; gap: 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { position: relative; overflow: hidden; min-height: 148px; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-soft); }
.stat-card::after { content: ""; position: absolute; width: 100px; height: 100px; left: -34px; bottom: -46px; border-radius: 50%; background: var(--blue-50); }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--blue-600); background: var(--blue-100); font-weight: 800; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; background: var(--green-100); color: var(--green-600); font-size: 10px; font-weight: 800; }
.stat-value { margin-top: 17px; font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.stat-label { color: var(--ink-500); font-size: 13px; }
.dashboard-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-soft); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-size: 17px; }
.panel-header p { margin: 4px 0 0; color: var(--ink-500); font-size: 12px; }
.panel-body { padding: 20px; }
.progress-list { display: grid; gap: 16px; }
.progress-row { display: grid; gap: 8px; }
.progress-meta { display: flex; justify-content: space-between; color: var(--ink-700); font-size: 12px; }
.progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: #edf1f7; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan-500), var(--blue-500)); }
.progress-100 { width: 100%; }
.progress-70 { width: 70%; }
.progress-90 { width: 90%; }
.progress-75 { width: 75%; }
.progress-80 { width: 80%; }
.progress-40 { width: 40%; }
.progress-15 { width: 15%; }
.progress-10 { width: 10%; }
.progress-5 { width: 5%; }
.milestone-list { display: grid; gap: 3px; }
.milestone { display: grid; grid-template-columns: 27px 1fr; gap: 11px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.milestone:last-child { border-bottom: 0; }
.milestone-number { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: var(--blue-600); background: var(--blue-100); font-size: 11px; font-weight: 800; }
.milestone strong { font-size: 13px; }
.milestone p { margin: 4px 0 0; color: var(--ink-500); font-size: 11px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.search-wrap { position: relative; width: min(420px, 100%); }
.search-wrap::before { content: "⌕"; position: absolute; top: 10px; right: 14px; color: var(--ink-500); font-size: 21px; }
.search-input { padding-right: 42px; }
.table-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow-soft); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 16px; background: var(--blue-50); color: var(--ink-700); font-size: 12px; text-align: right; white-space: nowrap; }
td { padding: 13px 16px; border-top: 1px solid var(--line); color: var(--ink-700); font-size: 13px; vertical-align: middle; }
tbody tr:hover td { background: #fbfcff; }
.code-cell { direction: ltr; text-align: right; color: var(--navy-900); font-weight: 800; font-variant-numeric: tabular-nums; }
.currency-pill { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: var(--blue-100); color: var(--blue-600); font-size: 10px; font-weight: 800; }
.muted { color: var(--ink-500); }
.empty-state { padding: 54px 24px; text-align: center; color: var(--ink-500); }
.empty-icon { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 20px; background: var(--blue-100); color: var(--blue-600); font-size: 25px; }
.empty-state h2 { margin: 0 0 8px; color: var(--ink-900); }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-top: 1px solid var(--line); color: var(--ink-500); font-size: 12px; }
.pagination-actions { display: flex; gap: 7px; }
.pagination button { min-width: 36px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink-700); }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

.tabs { display: flex; gap: 6px; margin-bottom: 18px; padding: 5px; border-radius: 12px; background: #eaf0f8; width: fit-content; }
.tab { min-height: 38px; padding: 0 16px; border: 0; border-radius: 9px; color: var(--ink-500); background: transparent; font-weight: 800; }
.tab.active { color: var(--navy-900); background: #fff; box-shadow: 0 4px 12px rgba(20,42,78,.09); }
.row-actions { display: flex; gap: 7px; }
.small-button { min-height: 32px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink-700); font-size: 11px; font-weight: 800; }
.operation-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.operation-summary > div { display: grid; gap: 4px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-soft); }
.operation-summary strong { color: var(--navy-900); font-size: 22px; }
.operation-summary span { color: var(--ink-500); font-size: 11px; }
.operation-toolbar { justify-content: flex-start; }
.operation-toolbar .search-wrap { margin-left: auto; }
.filter-select { min-height: 48px; min-width: 170px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-700); background: #fff; outline: none; }
.operations-table { min-width: 1280px; }
.operations-table th, .operations-table td { padding: 11px 12px; }
.cell-note { display: block; margin-top: 4px; color: var(--ink-500); font-size: 10px; font-weight: 400; }
.money-cell { direction: ltr; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.money-cell small { color: var(--ink-500); }
.profit-cell { color: var(--green-600); font-weight: 800; }
.remaining-cell { color: var(--navy-900); font-weight: 800; }
.success-text { color: var(--green-600) !important; }
.operation-status { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 8px; background: var(--blue-100); color: var(--blue-600); font-size: 10px; font-weight: 800; white-space: nowrap; }
.operation-status small { opacity: .65; font-size: 9px; }
.status-RF, .status-VO { color: var(--red-600); background: var(--red-100); }
.status-EX { color: var(--amber-600); background: var(--amber-100); }
.link-count { display: inline-flex; min-width: 42px; justify-content: center; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.link-count.complete, .balance-ok { color: var(--green-600); background: var(--green-100); }
.link-count.warning, .balance-error { color: var(--red-600); background: var(--red-100); }
.balance-ok, .balance-error { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.link-button { padding: 0; border: 0; color: var(--blue-600); background: transparent; font-size: 11px; font-weight: 800; text-decoration: underline; }
.invoice-type, .movement-pill { display: inline-flex; padding: 5px 8px; border-radius: 8px; background: var(--blue-100); color: var(--blue-600); font-size: 10px; font-weight: 800; white-space: nowrap; }
.invoice-type.type-0 { color: var(--amber-600); background: var(--amber-100); }
.movement-pill.movement--1 { color: var(--red-600); background: var(--red-100); }
.movement-pill.movement-1 { color: var(--green-600); background: var(--green-100); }
.movement-pill.movement-null, .movement-pill.movement-0 { color: var(--ink-500); background: #edf1f6; }
.receipt-kind { display: inline-flex; padding: 6px 9px; border-radius: 8px; color: var(--blue-600); background: var(--blue-100); font-size: 10px; font-weight: 800; white-space: nowrap; }
.receipt-kind.kind-receipt { color: var(--green-600); background: var(--green-100); }
.receipt-kind.kind-expense { color: var(--red-600); background: var(--red-100); }
.receipt-table { min-width: 1280px; }
.receipt-kind-selector { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-bottom: 20px; }
.receipt-kind-selector label { position: relative; cursor: pointer; }
.receipt-kind-selector input { position: absolute; opacity: 0; pointer-events: none; }
.receipt-kind-selector span { min-height: 72px; display: grid; align-content: center; gap: 5px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink-700); background: #fff; font-size: 13px; font-weight: 800; transition: .2s; }
.receipt-kind-selector small { color: var(--ink-500); font-size: 10px; font-weight: 500; }
.receipt-kind-selector input:checked + span { border-color: var(--blue-500); color: var(--blue-600); background: var(--blue-50); box-shadow: 0 0 0 3px rgba(62,120,241,.1); }
.transfer-kind-selector { grid-template-columns: 1fr; }
.transfer-kind-selector span { min-height: 58px; }
.invoice-type-selector, .settlement-party-selector { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.invoice-service-picker { margin: 20px 0 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.invoice-service-picker > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; background: var(--blue-50); }
.invoice-service-picker > header > div { display: grid; gap: 4px; }
.invoice-service-picker > header span { color: var(--ink-500); font-size: 10px; }
.invoice-service-picker > header input { width: min(320px, 45%); background: #fff; }
.invoice-service-picker .table-scroll { max-height: 410px; overflow: auto; }
.invoice-service-picker table { min-width: 940px; }
.settlement-entry-picker table { min-width: 1250px; }
.invoice-service-picker th, .invoice-service-picker td { padding: 9px 10px; }
.table-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 10px; }
.table-check input { width: 17px; height: 17px; accent-color: var(--blue-600); }
.confirm-check { display: flex; align-items: center; gap: 9px; margin-top: 6px; cursor: pointer; }
.confirm-check input { width: 18px; height: 18px; accent-color: var(--blue-600); }
.confirm-check b { font-size: 11px; }
.invoice-calculation-fields { margin-top: 18px; }
.invoice-create-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.invoice-create-totals > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 58px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--blue-50); }
.invoice-create-totals span { color: var(--ink-500); font-size: 10px; }
.invoice-create-totals strong { direction: ltr; font-size: 12px; }
.invoice-create-totals .grand { color: #fff; border-color: var(--navy-900); background: var(--navy-900); }
.invoice-create-totals .grand span { color: #d9e7fb; }
.invoice-create-totals .remaining { border-color: var(--blue-600); background: var(--blue-600); }
.settlement-create-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.settlement-create-totals > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 66px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--blue-50); }
.settlement-create-totals span { color: var(--ink-500); font-size: 10px; }
.settlement-create-totals strong { direction: ltr; font-size: 14px; }
.settlement-create-totals .grand { color: #fff; border-color: var(--navy-900); background: var(--navy-900); }
.settlement-create-totals .grand span { color: #d9e7fb; }
.settlement-create-totals .balanced { border-color: var(--green-600); background: var(--green-600); }
.invoice-print-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.invoice-print-checks label { display: flex; align-items: center; gap: 9px; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 11px; cursor: pointer; }
.invoice-print-checks input { width: 17px; height: 17px; accent-color: var(--blue-600); }
.accounting-policy { display: grid; gap: 5px; margin-top: 16px; padding: 13px 15px; border: 1px solid #bde8d7; border-radius: 10px; color: var(--green-600); background: var(--green-100); }
.accounting-policy strong { font-size: 12px; }
.accounting-policy span { font-size: 11px; line-height: 1.7; }
.reversion-note { display: grid; gap: 5px; margin-top: 14px; padding: 13px 15px; border: 1px solid #f0c5cb; border-radius: 10px; color: var(--red-600); background: var(--red-100); }
.reversion-note strong { font-size: 12px; }
.reversion-note span { color: var(--ink-700); font-size: 11px; }
.reversion-note small { color: var(--ink-500); font-size: 10px; }
.revert-panel { display: flex; align-items: end; gap: 12px; margin-top: 18px; padding: 15px; border: 1px solid #f0c5cb; border-radius: 11px; background: var(--red-100); }
.revert-panel .field { flex: 1; }
.revert-panel .danger-button { min-height: 46px; white-space: nowrap; }
.posting-preview { margin-top: 7px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--blue-50); }
.posting-preview header { display: flex; justify-content: space-between; gap: 10px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.posting-preview header span { color: var(--ink-500); font-size: 10px; }
.posting-preview > div { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 10px; padding: 11px 15px; border-bottom: 1px solid var(--line); }
.posting-preview > div span { color: var(--ink-500); font-size: 10px; }
.posting-preview > div strong { font-size: 12px; }
.posting-preview > div b { color: var(--navy-900); direction: ltr; font-size: 12px; }
.posting-preview footer { display: grid; gap: 7px; padding: 12px 15px; color: var(--ink-700); font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.detail-item { min-height: 72px; display: grid; align-content: center; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--blue-50); }
.detail-item span { color: var(--ink-500); font-size: 10px; }
.detail-item strong { font-size: 12px; line-height: 1.5; }
.section-title { margin: 24px 0 12px; font-size: 15px; }
.embedded-entry { margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.embedded-entry header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; background: var(--blue-50); }
.embedded-entry header div { display: grid; gap: 3px; }
.embedded-entry header span:not(.balance-ok):not(.balance-error) { color: var(--ink-500); font-size: 10px; }
.embedded-entry th, .embedded-entry td { padding: 10px 12px; }
.embedded-entry tfoot th { border-top: 2px solid var(--line); }
.detail-actions { display: flex; justify-content: flex-end; gap: 9px; margin-bottom: 14px; }
.data-warning { display: grid; gap: 5px; margin-top: 14px; padding: 13px 15px; border: 1px solid #f2d7a5; border-radius: 10px; color: #7a5105; background: var(--amber-100); }
.data-warning.verified { border-color: #bde8d7; color: var(--green-600); background: var(--green-100); }
.data-warning strong { font-size: 12px; }
.data-warning span { font-size: 11px; line-height: 1.7; }
.data-warning[hidden] { display: none !important; }
.empty-state.compact { padding: 24px; }
.invoice-totals { display: grid; gap: 10px; margin-top: 16px; }
.invoice-totals > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.print-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.print-options > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-700); font-size: 11px; }
.option-on { color: var(--green-600); }
.option-off { color: var(--ink-500); }
.invoice-workflow { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.workflow-preliminary { color: #7a5311; background: #fff2c7; }
.workflow-pending_approval { color: #174f88; background: #dceeff; }
.workflow-final { color: #176a4b; background: #dff6eb; }
.workflow-imported { color: #536174; background: #e9eef4; }
.workflow-panel { display: grid; gap: 12px; margin-top: 18px; padding: 17px; border: 1px solid #cfe0f5; border-radius: 13px; background: linear-gradient(135deg, #f4f9ff, #fff); }
.workflow-panel header { display: grid; gap: 4px; }
.workflow-panel header strong { color: var(--navy-900); font-size: 14px; }
.workflow-panel header span { color: var(--ink-500); font-size: 11px; line-height: 1.7; }
.workflow-panel > button { justify-self: end; }
.workflow-panel.approved { border-color: #bfe8d4; background: linear-gradient(135deg, #effbf6, #fff); }
.workflow-panel.returned { border-color: #f1c7cd; background: linear-gradient(135deg, #fff5f6, #fff); }
.workflow-decision { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.danger-button:disabled { opacity: .58; cursor: not-allowed; }

.statement-note-card { margin-bottom: 18px; }
.statement-note-card textarea { width: 100%; min-height: 82px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; resize: vertical; color: var(--ink-900); background: #fff; font-family: inherit; line-height: 1.7; }
.statement-note-card .form-actions { justify-content: space-between; }
.statement-note-readonly { margin: 0; padding: 14px; border-radius: 10px; color: var(--ink-700); background: var(--blue-50); white-space: pre-wrap; line-height: 1.8; }
.note-history { margin-top: 12px; color: var(--ink-700); }
.note-history summary { cursor: pointer; font-weight: 800; }
.note-history ul { display: grid; gap: 7px; margin: 10px 0 0; padding: 0; list-style: none; }
.note-history li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 8px; background: var(--blue-50); font-size: 11px; }
.year-close-readiness { margin-bottom: 18px; }
.financial-years-table .selected-row td { background: var(--blue-50); }
.backup-check.warning { border-color: #f1d49b; background: #fff9ed; }
.backup-check.warning > span { color: #9b6500; background: #fff0ca; }
.launch-checks { margin-bottom: 18px; }
.launch-checklist { margin: 18px 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow-soft); }
.launch-checklist-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 18px; }
.launch-checklist-item { display: grid; gap: 11px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.launch-checklist-item.approved { border-color: #bde5d7; background: #f6fffb; }
.launch-checklist-item > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.launch-checklist-item h3 { margin: 5px 0 0; color: var(--ink-900); font-size: 14px; }
.launch-checklist-item p { margin: 0; color: var(--ink-500); font-size: 12px; line-height: 1.7; }
.launch-checklist-item .small-button { justify-self: start; }
.ltr-value { direction: ltr; unicode-bidi: isolate; }
.checklist-evidence { display: grid; gap: 4px; padding: 10px 12px; border-radius: 9px; background: var(--blue-50); font-size: 11px; }
.checklist-evidence small { color: var(--ink-500); }
@media (max-width: 900px) { .launch-checklist-grid { grid-template-columns: 1fr; } }
.danger-text, .negative-cell { color: var(--red-600) !important; }
.cash-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.cash-cards article { display: grid; gap: 5px; min-height: 115px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(145deg, #fff, var(--blue-50)); box-shadow: var(--shadow-soft); }
.cash-cards article > span { width: fit-content; padding: 4px 8px; border-radius: 999px; color: var(--blue-600); background: var(--blue-100); font-size: 10px; font-weight: 800; }
.cash-cards article strong { font-size: 21px; direction: ltr; text-align: right; }
.cash-cards article small { color: var(--ink-500); }
.statement-toolbar { justify-content: flex-start; flex-wrap: wrap; }
.statement-toolbar .search-wrap { margin-left: auto; }
.date-filter { display: flex; align-items: center; gap: 7px; color: var(--ink-500); font-size: 11px; font-weight: 700; }
.date-filter input { min-height: 48px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-700); background: #fff; }
.cash-table { min-width: 1450px; }
.party-table { min-width: 1050px; }
.party-statement-table { min-width: 1420px; }
.transfer-table { min-width: 1400px; }
.receipt-cell { color: var(--green-600); font-weight: 800; }
.payment-cell { color: var(--red-600); font-weight: 800; }
.report-tabs { margin-bottom: 16px; }
.currency-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-bottom: 16px; }
.currency-summary article { display: grid; gap: 5px; min-height: 92px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(145deg, #fff, var(--blue-50)); box-shadow: var(--shadow-soft); }
.currency-summary article > span { width: fit-content; padding: 3px 8px; border-radius: 999px; color: var(--blue-600); background: var(--blue-100); font-size: 10px; font-weight: 800; }
.currency-summary article strong { direction: ltr; text-align: right; font-size: 19px; }
.currency-summary article small { color: var(--ink-500); font-size: 10px; line-height: 1.65; }
.operational-filters { row-gap: 9px; }
.operational-report-table { min-width: 1780px; }
.operational-report-table.tjd-table { min-width: 1450px; }
.source-pill { display: inline-flex; align-items: center; min-height: 38px; padding: 0 12px; border-radius: 9px; color: var(--ink-500); background: #eef2f7; font-size: 11px; }
.financial-table { min-width: 950px; }
.financial-table .account-name { min-width: 320px; }
.financial-table .final-balance { color: var(--navy-900); font-weight: 800; }
.account-name.depth-2 { padding-right: 25px; }
.account-name.depth-3 { padding-right: 38px; }
.account-name.depth-4 { padding-right: 52px; }
.account-name.depth-5 { padding-right: 66px; }
.report-table-card { margin-top: 14px; }
.permission-card { margin-bottom: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; }
.permission-policy { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px; background: linear-gradient(90deg, var(--blue-50), #fff); }
.permission-policy h3 { margin: 0 0 4px; font-size: 15px; }
.permission-policy p { margin: 0; color: var(--ink-500); font-size: 12px; }
.permission-module { display: grid; grid-template-columns: 1.2fr repeat(4, 1fr); align-items: center; gap: 8px; padding: 12px 15px; border-top: 1px solid var(--line); }
.permission-module.header { background: var(--blue-50); color: var(--ink-700); font-size: 11px; font-weight: 800; }
.permission-module strong { font-size: 13px; }
.permission-check { display: flex; justify-content: center; }
.permission-check input { width: 18px; height: 18px; accent-color: var(--blue-600); }
.special-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 16px; }
.special-item { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; }
.special-item input { width: 17px; height: 17px; accent-color: var(--blue-600); }
.role-selector { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 15px 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow-soft); }
.role-selector label { color: var(--ink-700); font-size: 12px; font-weight: 800; }
.role-selector select { min-width: 230px; min-height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink-900); }
.role-selector small { margin-right: auto; color: var(--ink-500); }
.role-catalog { margin-bottom: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 4px; background: #fff; box-shadow: var(--shadow-soft); }
.role-catalog > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.role-catalog h2 { margin: 0 0 3px; color: var(--ink-900); font-size: 14px; }
.role-catalog p { margin: 0; color: var(--ink-500); font-size: 10px; }
.role-catalog > header > span { padding: 5px 9px; border-radius: 999px; color: var(--blue-600); background: var(--blue-100); font-size: 10px; font-weight: 800; }
.role-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 9px; }
.role-card { display: grid; gap: 5px; min-height: 88px; padding: 11px 13px; border: 1px solid #e5e6f2; border-radius: 6px; color: var(--ink-700); background: #fff; text-align: right; }
.role-card:hover { border-color: #aeb1ff; background: #f8f8ff; }
.role-card.active { border-color: var(--blue-600); background: #f1f1ff; box-shadow: inset 0 -2px 0 var(--blue-600); }
.role-card span { color: var(--blue-600); font-size: 9px; font-weight: 800; }
.role-card strong { color: var(--ink-900); font-size: 12px; }
.role-card small { color: var(--ink-500); font-size: 9px; }
.role-kind { padding: 5px 9px; border-radius: 999px; font-size: 9px; font-weight: 800; }
.role-kind.system { color: var(--blue-600); background: var(--blue-100); }
.role-kind.custom { color: var(--green-600); background: var(--green-100); }
.role-selector-actions { display: flex; align-items: center; gap: 7px; }
.role-selector-actions .danger-button { min-height: 32px; padding: 0 11px; border-radius: 4px; font-size: 9px; }
.modal:has(#role-create-form) { width: min(1220px, calc(100vw - 24px)); }
.role-editor-form .role-name-field { margin-bottom: 4px; }
.role-editor-form .security-note { margin: 12px 0; }
.role-editor-form .permission-card { margin-bottom: 12px; }
.role-editor-form .permission-module:not(.header) { padding-top: 34px; }
.switch { position: relative; display: inline-flex; width: 44px; height: 24px; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #cdd5e2; transition: .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + span { background: var(--blue-600); }
.switch input:checked + span::after { transform: translateX(-20px); }

.user-table { min-width: 1180px; }
.reference-table { min-width: 1050px; }
.service-type-table { min-width: 1550px; }
.user-identity { display: grid; gap: 3px; }
.user-identity strong { color: var(--navy-900); }
.user-identity small { color: var(--ink-500); direction: ltr; text-align: right; }
.state-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 27px; padding: 4px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.state-pill.active, .state-pill.read { color: var(--green-600); background: var(--green-100); }
.state-pill.inactive { color: var(--red-600); background: var(--red-100); }
.state-pill.pending, .state-pill.unread { color: var(--amber-600); background: var(--amber-100); }
.role-pill { display: inline-flex; padding: 5px 9px; border-radius: 8px; color: var(--blue-600); background: var(--blue-100); font-size: 10px; font-weight: 800; }
.security-note { display: grid; gap: 5px; margin-top: 18px; padding: 14px 16px; border: 1px solid #cfe0f5; border-radius: 11px; background: var(--blue-50); }
.security-note strong { color: var(--navy-900); font-size: 12px; }
.security-note span { color: var(--ink-500); font-size: 11px; line-height: 1.7; }
.notification-list { display: grid; gap: 10px; }
.notification-card { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: start; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow-soft); }
.notification-card.unread { border-color: #bcd0fb; background: linear-gradient(105deg, var(--blue-50), #fff); }
.notification-card.unread::after { content: ""; position: absolute; top: 17px; right: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--blue-600); }
.notification-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--blue-600); background: var(--blue-100); font-size: 12px; font-weight: 800; }
.notification-icon.success { color: var(--green-600); background: var(--green-100); }
.notification-icon.warning { color: var(--amber-600); background: var(--amber-100); }
.notification-icon.action { color: #7b4db7; background: #f0e7fc; }
.notification-copy { display: grid; gap: 6px; }
.notification-copy strong { color: var(--navy-900); font-size: 13px; }
.notification-copy p { margin: 0; color: var(--ink-700); font-size: 12px; line-height: 1.7; }
.notification-copy small { color: var(--ink-500); font-size: 10px; }
.notification-actions { display: flex; gap: 7px; align-items: center; }
.activity-table { min-width: 1180px; }
.audit-json-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 18px; }
.audit-json { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #f8fafc; }
.audit-json header { padding: 11px 13px; border-bottom: 1px solid var(--line); color: var(--navy-900); font-size: 12px; font-weight: 800; background: var(--blue-50); }
.audit-json pre { max-height: 390px; overflow: auto; margin: 0; padding: 14px; direction: ltr; text-align: left; color: #24324a; font: 11px/1.7 Consolas, monospace; white-space: pre-wrap; word-break: break-word; }

.backup-summary .backup-summary-text { font-size: 12px; line-height: 1.55; word-break: break-word; }
.backup-summary .backup-summary-text small { display: block; color: var(--ink-500); font-size: 9px; font-weight: 600; }
.backup-readiness { margin-bottom: 14px; }
.backup-check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 16px; }
.backup-check { display: flex; align-items: center; gap: 11px; min-height: 66px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.backup-check > span { flex: 0 0 31px; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; font-weight: 900; }
.backup-check > div { display: grid; gap: 4px; }
.backup-check strong { color: var(--navy-900); font-size: 12px; }
.backup-check small { color: var(--ink-500); font-size: 10px; }
.backup-check.passed > span { color: var(--green-600); background: var(--green-100); }
.backup-check.pending > span { color: var(--amber-600); background: var(--amber-100); }
.backup-readiness + .data-warning { margin-bottom: 14px; }

.construction { min-height: 520px; display: grid; place-items: center; padding: 40px; border: 1px dashed #cfd7e6; border-radius: var(--radius-lg); background: radial-gradient(circle at 50% 30%, #fff, var(--blue-50)); text-align: center; }
.construction-icon { width: 84px; height: 84px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 25px; color: #fff; background: linear-gradient(145deg, var(--navy-900), var(--blue-500)); font-size: 25px; font-weight: 800; box-shadow: var(--shadow); }
.construction h2 { margin: 0 0 10px; font-size: 25px; }
.construction p { max-width: 560px; margin: 0 auto; color: var(--ink-500); line-height: 1.8; }
.construction .status-badge { margin-top: 20px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(9,28,56,.58); backdrop-filter: blur(5px); }
.modal { width: min(980px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: var(--radius-lg); background: #fff; box-shadow: 0 30px 80px rgba(5,25,55,.3); }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 19px 22px; border-bottom: 1px solid var(--line); background: #fff; }
.modal-header h2 { margin: 4px 0 0; font-size: 20px; }
.modal-body { padding: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 23px; }
.helper { margin: 7px 0 0; color: var(--ink-500); font-size: 11px; }
.toast-region { position: fixed; z-index: 80; left: 22px; bottom: 22px; display: grid; gap: 10px; }
.toast { min-width: 280px; max-width: 420px; padding: 14px 16px; border-radius: 11px; color: #fff; background: var(--navy-950); box-shadow: var(--shadow); animation: toast-in .2s ease-out; }
.toast.error { background: #9f2637; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .operation-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cash-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .currency-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 850px) {
  .login-view { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-panel { min-height: 100vh; padding: 28px; }
  .brand-lockup { margin-bottom: 50px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; right: 0; transform: translateX(105%); width: 270px; transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .menu-button { display: grid; }
  .topbar { padding: 0 16px; }
  .topbar-context { display: none; }
  .content { padding: 19px 14px; }
  .page-header { align-items: stretch; flex-direction: column; }
  .special-grid { grid-template-columns: 1fr; }
  .notification-card { grid-template-columns: 42px minmax(0, 1fr); }
  .notification-actions { grid-column: 2; }
  .audit-json-grid { grid-template-columns: 1fr; }
  .backup-check-grid { grid-template-columns: 1fr; }
  .permission-module { grid-template-columns: 1.1fr repeat(4, .8fr); font-size: 10px; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .invoice-totals > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 580px) {
  .stats-grid { grid-template-columns: 1fr; }
  .user-chip { min-width: 0; }
  .user-chip > span:last-child { display: none; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .header-actions { width: 100%; }
  .header-actions > * { flex: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .permission-module { min-width: 650px; }
  .permission-card.module-matrix { overflow-x: auto; }
  .operation-summary, .detail-grid { grid-template-columns: 1fr; }
  .cash-cards { grid-template-columns: 1fr; }
  .currency-summary { grid-template-columns: 1fr; }
  .invoice-totals > div, .print-options { grid-template-columns: 1fr; }
  .invoice-type-selector, .settlement-party-selector, .invoice-create-totals, .settlement-create-totals, .invoice-print-checks { grid-template-columns: 1fr; }
  .invoice-service-picker > header { align-items: stretch; flex-direction: column; }
  .invoice-service-picker > header input { width: 100%; }
  .revert-panel { align-items: stretch; flex-direction: column; }
  .workflow-decision { grid-template-columns: 1fr; }
  .receipt-kind-selector { grid-template-columns: 1fr; }
  .posting-preview > div { grid-template-columns: 55px 1fr; }
  .posting-preview > div b { grid-column: 2; }
  .operation-toolbar .search-wrap { margin-left: 0; }
  .statement-toolbar .search-wrap { margin-left: 0; }
  .role-selector { align-items: stretch; flex-direction: column; }
  .role-selector select { width: 100%; min-width: 0; }
  .role-selector small { margin-right: 0; }
  .notification-card { grid-template-columns: 1fr; }
  .notification-icon { display: none; }
  .notification-actions { grid-column: 1; }
}

/* واجهة الإصدار المطابق: القالب البصري الأفقي المستلهم من سير عمل شاهين */
:root {
  --navy-950: #0b3264;
  --navy-900: #103d74;
  --blue-600: #2f34f5;
  --blue-500: #4c7eff;
  --blue-100: #ececff;
  --blue-50: #f6f6ff;
  --canvas: #f4f4fc;
  --line: #e9e9f4;
  --shadow: 0 18px 45px rgba(31, 39, 101, .16);
  --shadow-soft: 0 2px 12px rgba(31, 39, 101, .045);
  --radius-lg: 6px;
  --radius-md: 4px;
  --radius-sm: 3px;
}

.app-shell { min-height: 100vh; display: block; background: var(--canvas); }
.system-topbar {
  position: sticky; top: 0; z-index: 45; height: 66px; padding: 0 26px;
  color: #fff; background: var(--navy-950); border: 0; backdrop-filter: none;
}
.topbar-brand { display: flex; align-items: center; gap: 11px; }
.topbar-brand .brand-mark.compact { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(145deg, #2e54ff, #28a7a2); box-shadow: none; }
.topbar-brand strong { display: block; font-size: 17px; }
.topbar-brand span { display: block; margin-top: 2px; color: rgba(255,255,255,.64); font-size: 10px; }
.system-topbar .topbar-actions { gap: 8px; }
.system-topbar .user-chip { min-width: 0; padding: 0 8px; color: #fff; }
.system-topbar .user-chip strong { font-size: 12px; }
.system-topbar .user-chip small { color: rgba(255,255,255,.58); font-size: 9px; }
.system-topbar .user-avatar { width: 35px; height: 35px; border-radius: 50%; color: #fff; background: rgba(255,255,255,.14); }
.header-icon, .header-logout {
  min-height: 34px; border: 0; color: rgba(255,255,255,.86); background: transparent;
}
.header-icon { position: relative; width: 36px; font-size: 20px; }
.header-logout { padding: 0 11px; border: 1px solid rgba(255,255,255,.18); border-radius: 4px; font-size: 11px; font-weight: 800; }
.header-logout:hover, .header-icon:hover { color: #fff; background: rgba(255,255,255,.08); }

.top-navigation-shell {
  position: sticky; top: 66px; z-index: 40; height: 42px; padding: 0 25px;
  color: #25274c; background: rgba(255,255,255,.98); border-bottom: 1px solid var(--line);
}
.navigation { height: 42px; display: flex; align-items: stretch; gap: 3px; padding: 0; overflow: visible; }
.top-nav-link, .nav-group > summary {
  min-width: 116px; height: 42px; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0 14px; border: 0; border-radius: 0; color: #292d51; background: transparent;
  font-size: 12px; font-weight: 800; white-space: nowrap; list-style: none;
}
.top-nav-link span, .nav-group > summary span { color: var(--blue-600); font-size: 14px; }
.top-nav-link:hover, .nav-group > summary:hover, .top-nav-link.active, .nav-group.active > summary, .nav-group[open] > summary {
  color: var(--navy-900); background: #f0efff; box-shadow: inset 0 -2px 0 var(--blue-600);
}
.nav-group { position: relative; }
.nav-group > summary { cursor: pointer; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-dropdown {
  position: absolute; top: 42px; right: 0; z-index: 60; width: 248px; display: grid;
  padding: 7px; border: 1px solid var(--line); border-top: 2px solid var(--blue-600);
  background: #fff; box-shadow: 0 16px 34px rgba(28, 34, 84, .14);
}
.nav-dropdown-item {
  min-height: 38px; padding: 0 12px; border: 0; border-radius: 2px; color: #303456; background: #fff;
  text-align: right; font-size: 11px; font-weight: 700;
}
.nav-dropdown-item:hover, .nav-dropdown-item.active { color: var(--blue-600); background: #f4f3ff; }

.shortcut-strip {
  height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 0 25px;
  background: #f8f8ff; border-bottom: 1px solid var(--line);
}
.shortcut-icons { direction: ltr; display: flex; align-self: stretch; }
.shortcut-icons > span { width: 74px; display: grid; place-items: center; color: #323652; border-left: 1px solid #eeeeF6; font-weight: 800; }
.shortcut-icons > span:first-child { color: #fff; background: linear-gradient(135deg, #f15b16, #ff7d31); }
.shortcut-strip .topbar-context { display: flex; align-items: center; gap: 7px; }
.shortcut-strip .topbar-context span { color: #777a94; font-size: 10px; }
.shortcut-strip .topbar-context strong { margin: 0; color: #292d51; font-size: 11px; }

.content { min-height: calc(100vh - 150px); padding: 20px 24px 38px; background: var(--canvas); }
.page-header { align-items: center; margin: 0 0 15px; }
.page-header .eyebrow { display: none; }
.page-header h1 { margin: 0; color: #25294b; font-size: 21px; letter-spacing: 0; }
.page-header p { margin: 5px 0 0; color: #7a7d98; font-size: 11px; }
.header-actions { gap: 7px; }
.primary-button, .secondary-button, .ghost-button, .danger-button {
  min-height: 39px; padding: 0 15px; border-radius: 3px; box-shadow: none; font-size: 11px;
}
.primary-button { background: linear-gradient(105deg, #2b2bf4, #4e83ff); }
.secondary-button { color: #fff; background: var(--navy-900); }
.ghost-button { background: #fff; }

.panel, .table-card, .operation-summary > div, .cash-cards article, .currency-summary article {
  border-radius: 3px; box-shadow: var(--shadow-soft);
}
.panel-header { padding: 14px 16px; }
.panel-header h2 { color: #272b4e; font-size: 14px; }
.panel-header p { font-size: 10px; }
.panel-body { padding: 16px; }
.toolbar { margin-bottom: 10px; }
.search-input, .filter-select, .date-filter input, .field input, .field select, .field textarea {
  min-height: 42px; border-radius: 3px; background: #fff;
}
.search-wrap::before { top: 8px; }
.table-card { border-color: #ededf6; }
th { padding: 11px 12px; color: #2428d7; background: #fafaff; border-left: 1px solid #eeeeF6; font-size: 10px; }
td { padding: 10px 12px; border-top-color: #efeff6; border-left: 1px solid #f2f2f8; color: #343856; font-size: 11px; }
tbody tr:hover td { background: #f8f8ff; }
.small-button { min-height: 30px; border-radius: 3px; font-size: 10px; }
.pagination { background: #fff; }
.pagination button { border-radius: 2px; }
.tabs { margin-bottom: 12px; padding: 0; border-radius: 0; background: transparent; }
.tab { min-height: 36px; border-radius: 0; }
.tab.active { color: var(--blue-600); box-shadow: inset 0 -2px 0 var(--blue-600); background: #f0efff; }

.modal-backdrop { padding: 24px; background: rgba(15, 24, 63, .36); backdrop-filter: none; }
.modal { width: min(1040px, calc(100vw - 48px)); max-height: calc(100vh - 48px); border-radius: 2px; }
.modal-header { padding: 15px 18px; text-align: center; }
.modal-header > div { flex: 1; }
.modal-header .eyebrow { display: none; }
.modal-header h2 { margin: 0; color: var(--blue-600); font-size: 17px; }
.modal-header .icon-button { position: absolute; right: 16px; left: auto; width: 30px; height: 30px; color: #ef555a; border-color: #ef555a; border-radius: 50%; }
.modal-body { padding: 22px; background: #f6f6ff; }
.form-actions { position: sticky; bottom: -22px; margin: 24px -22px -22px; padding: 10px 12px; background: #fff; border-top: 1px solid var(--line); }
.modal .form-actions { justify-content: stretch; }
.modal .form-actions > button { flex: 1; }
.form-actions .primary-button { min-width: 260px; }

.dashboard-period-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: -20px -24px 24px; padding: 9px 24px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.date-range, .period-buttons { display: flex; align-items: center; gap: 8px; }
.date-range label { display: flex; align-items: center; gap: 6px; color: #767992; font-size: 10px; }
.date-range input { height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 2px; color: #303452; background: #fafaff; }
.period-buttons button { min-width: 78px; height: 34px; border: 0; color: #333750; background: #efeff8; font-size: 11px; font-weight: 800; }
.period-buttons button.active { color: #fff; background: linear-gradient(100deg, #2e2cf4, #5486ff); }
.shahin-stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-bottom: 1px; background: #ececf5; }
.shahin-stat { position: relative; min-height: 210px; display: grid; place-items: center; align-content: center; gap: 10px; background: #fff; }
.shahin-stat-icon { position: absolute; top: 18px; left: 18px; color: #d9d9eb; font-size: 18px; }
.shahin-stat strong { color: var(--blue-600); font-size: 22px; }
.shahin-stat p { margin: 0; color: #292d50; font-size: 15px; font-weight: 800; }
.dashboard-analysis-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: #ececf5; }
.dashboard-breakdown { min-height: 400px; display: flex; flex-direction: column; padding: 20px 26px; background: #fff; }
.dashboard-breakdown h2 { margin: 0; color: #2b2f50; font-size: 14px; text-align: center; }
.breakdown-space { flex: 1; }
.dashboard-breakdown ul { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.dashboard-breakdown li { display: grid; grid-template-columns: 10px 1fr auto auto; align-items: center; gap: 7px; color: #555873; font-size: 10px; }
.dashboard-breakdown li b { color: #303451; }
.dashboard-breakdown li small { min-width: 32px; color: #23a86c; text-align: left; }
.breakdown-dot { width: 8px; height: 8px; border: 1px solid #48bd7f; border-radius: 50%; }
.dot-1 { border-color: #ecaf40; }.dot-2 { border-color: #5964eb; }.dot-3 { border-color: #ec6f84; }
.report-index-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.report-index-card {
  min-height: 170px; display: grid; align-content: center; justify-items: center; gap: 10px; padding: 18px;
  border: 1px solid var(--line); border-radius: 3px; color: #2e3253; background: #fff; text-align: center;
  box-shadow: var(--shadow-soft);
}
.report-index-card:hover { border-color: #bfc1ff; background: #f9f9ff; transform: translateY(-1px); }
.report-index-card > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 3px; color: #fff; background: linear-gradient(135deg, var(--navy-900), var(--blue-600)); font-size: 11px; font-weight: 900; }
.report-index-card strong { font-size: 14px; }
.report-index-card small { color: #7b7e98; font-size: 10px; line-height: 1.8; }

.login-view { grid-template-columns: 1fr 1fr; background: #fff; }
.login-art { color: #202442; background: linear-gradient(145deg, #f4f5ff, #eceeff); }
.login-art::before { background: radial-gradient(circle at 25% 20%, rgba(80,130,255,.22), transparent 35%), radial-gradient(circle at 75% 60%, rgba(42,167,162,.16), transparent 32%); }
.login-art-copy p { color: #747891; }
.login-art-copy .eyebrow { color: var(--blue-600); }
.login-card .brand-lockup { margin-bottom: 52px; }
.login-heading h2 { color: #25294a; font-size: 28px; }
.login-card .primary-button { min-height: 46px; }

@media (max-width: 1050px) {
  .navigation { overflow-x: auto; overflow-y: visible; }
  .top-nav-link, .nav-group > summary { min-width: 105px; }
  .shahin-stats-grid, .dashboard-analysis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .system-topbar { padding: 0 12px; }
  .system-topbar .user-chip > span:last-child, .header-logout { display: none; }
  .top-navigation-shell { top: 66px; padding: 0 8px; }
  .navigation { overflow-x: auto; }
  .nav-dropdown { position: fixed; top: 108px; right: 10px; left: 10px; width: auto; }
  .shortcut-strip { padding: 0 12px; }
  .shortcut-icons > span { width: 48px; }
  .content { padding: 14px 10px 28px; }
  .dashboard-period-bar { align-items: stretch; flex-direction: column; margin: -14px -10px 14px; padding: 10px; }
  .date-range, .period-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .period-buttons { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .period-buttons button { min-width: 0; }
  .shahin-stats-grid, .dashboard-analysis-grid { grid-template-columns: 1fr; }
  .report-index-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 8px; }
  .modal { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .form-actions .primary-button { min-width: 0; }
}

/* نموذج إضافة وتعديل الخدمة المطابق لدورة عمل الشاهين */
.shahin-service-form { min-width: min(1120px, 82vw); }
.service-type-selector { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 8px; margin-bottom: 18px; }
.service-choice { position: relative; cursor: pointer; }
.service-choice input { position: absolute; opacity: 0; pointer-events: none; }
.service-choice span { display: flex; min-height: 44px; align-items: center; justify-content: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink-700); font-weight: 700; transition: .15s ease; }
.service-choice input:checked + span { border-color: var(--blue-600); background: var(--blue-50); color: var(--blue-700); box-shadow: inset 0 0 0 1px var(--blue-600); }
.service-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.service-form-grid .span-2, .service-calculation-grid .span-2 { grid-column: span 2; }
.service-values-card { margin: 17px 0; padding: 16px; border: 1px solid #e5e8f6; border-radius: 7px; background: #f6f6ff; }
.service-calculation-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.service-calculation-grid .computed input, .service-calculation-grid .total-field input { background: #fff; color: var(--blue-700); font-weight: 800; }
.service-calculation-grid .total-field input { border-color: #b8c7ff; }
.simple-calculation-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; }
.quantity-field > span:last-child { display: grid; grid-template-columns: 40px 1fr 40px; }
.quantity-field button { border: 1px solid var(--line); background: var(--blue-600); color: #fff; font-size: 20px; cursor: pointer; }
.quantity-field button:first-child { border-radius: 0 5px 5px 0; }
.quantity-field button:last-child { border-radius: 5px 0 0 5px; }
.quantity-field input { border-radius: 0; text-align: center; }
.tax-toggle { min-width: 170px; margin-top: 14px; }
.service-tax-grid { display: grid; grid-template-columns: repeat(5, minmax(90px, 1fr)); gap: 8px; margin-top: 12px; }
.service-tax-grid label { display: grid; grid-template-columns: 42px 1fr; align-items: center; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; background: #fff; }
.service-tax-grid span { padding: 9px; color: var(--blue-700); font-weight: 800; text-align: center; background: var(--blue-50); }
.service-tax-grid input { min-width: 0; border: 0; border-radius: 0; }
.service-secondary-grid { padding-top: 4px; }
.service-option-row { display: flex; align-items: center; gap: 8px; margin-top: 13px; padding: 9px; border: 1px solid #e5e8f6; border-radius: 6px; background: #f8f8ff; }
.service-option-row > strong { min-width: 120px; color: var(--ink-600); }
.service-option-row .service-choice { flex: 1; }
.service-option-row .service-choice span { min-height: 38px; }
.service-form-actions .dark-button { flex: 1; }
.detail-actions { display: flex; justify-content: flex-end; margin-bottom: 12px; }

@media (max-width: 760px) {
  .shahin-service-form { min-width: 0; }
  .service-type-selector { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-form-grid, .service-calculation-grid, .simple-calculation-grid { grid-template-columns: 1fr; }
  .service-form-grid .span-2, .service-calculation-grid .span-2 { grid-column: auto; }
  .service-tax-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-option-row { align-items: stretch; flex-direction: column; }
}

/* هوية Maab Go وتقريب شاشة الخدمات من القالب التشغيلي في شاهين */
:root {
  --maab-teal: #1198a7;
  --maab-orange: #ff6518;
  --shahin-indigo: #2e2cf4;
  --shahin-page: #f5f5ff;
}

.maab-go-logo {
  position: relative;
  flex: 0 0 auto;
  display: block;
  overflow: hidden;
  background-image: url("/assets/maab-go-logo.png");
  background-repeat: no-repeat;
  background-position: center;
}
.compact-logo { width: 50px; height: 54px; background-size: auto 54px; }
.card-logo { width: 68px; height: 72px; margin: 0 !important; background-size: auto 78px; }
.login-logo {
  position: absolute;
  top: 64px;
  left: 76px;
  z-index: 2;
  width: 108px;
  height: 116px;
  background-size: auto 122px;
}

.system-topbar {
  height: 62px;
  padding: 0 22px;
  background: #082f5f;
  border-bottom: 2px solid rgba(17, 152, 167, .62);
}
.topbar-brand { gap: 7px; }
.topbar-brand strong { font-size: 16px; letter-spacing: .01em; }
.topbar-brand span { font-size: 9px; }
.top-navigation-shell { top: 62px; }
.shortcut-strip { height: 38px; }
.content { min-height: calc(100vh - 142px); background: var(--shahin-page); }

.login-art::before {
  background: radial-gradient(circle at 22% 20%, rgba(46,44,244,.14), transparent 36%),
    radial-gradient(circle at 72% 62%, rgba(17,152,167,.14), transparent 34%);
}
.login-art .brand-orbit { border-color: rgba(46,44,244,.12); }
.login-art-copy h1 { color: #212548; }
.login-art-copy p { color: #777b97; }
.brand-lockup > div strong { color: #173453; font-size: 21px; }
.brand-lockup > div span { color: #6f758e; }

.shahin-services-shell {
  overflow: visible;
  border: 1px solid #e8e8f4;
  background: #fff;
  box-shadow: 0 3px 14px rgba(29, 35, 88, .05);
}
.service-list-toolbar {
  min-height: 59px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #ececf5;
  background: #fff;
}
.service-list-actions { display: flex; align-items: center; gap: 8px; }
.service-list-actions .primary-button,
.service-list-actions .ghost-button {
  min-height: 37px;
  padding: 0 14px;
  border-radius: 3px;
  font-size: 11px;
}
.service-create-button { min-width: 128px; }
.service-create-button > span { font-size: 17px; line-height: 1; }
.service-export-button { color: #263052; background: #fff; }
.service-list-caption { color: #303452; font-size: 12px; font-weight: 800; }
.service-list-caption::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--maab-teal);
}
.service-filter-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 320px) auto;
  gap: 9px;
  padding: 11px 14px;
  border-bottom: 1px solid #e7e7f2;
  background: #f8f8ff;
}
.service-filter-panel .search-input,
.service-filter-panel .filter-select,
.service-filter-panel .ghost-button { min-height: 38px; }

.service-status-tabs {
  height: 48px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 7px 14px 0;
  border-bottom: 1px solid #e5e5f1;
  background: #f6f6ff;
}
.service-status-tab {
  min-width: 112px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  color: #4e526d;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}
.service-status-tab small {
  min-width: 22px;
  padding: 2px 5px;
  border-radius: 9px;
  color: #6d718a;
  background: #e9e9f4;
  font-size: 9px;
}
.service-status-tab:hover { color: var(--shahin-indigo); background: #efeffd; }
.service-status-tab.active {
  color: #fff;
  border-color: var(--shahin-indigo);
  background: linear-gradient(105deg, #2929ef, #4d66ff);
}
.service-status-tab.active small { color: var(--shahin-indigo); background: #fff; }

.service-table-card { overflow: visible; margin: 0; border: 0; box-shadow: none; }
.service-table-card .table-scroll { overflow: visible; }
.service-list-table { width: 100%; min-width: 0; table-layout: fixed; }
.service-list-table th:nth-child(1) { width: 46px; }
.service-list-table th:nth-child(2) { width: 82px; }
.service-list-table th:nth-child(3) { width: 50px; }
.service-list-table th:nth-child(4) { width: 165px; }
.service-list-table th:nth-child(5) { width: 83px; }
.service-list-table th:nth-child(6) { width: 104px; }
.service-list-table th:nth-child(7),
.service-list-table th:nth-child(9) { width: 152px; }
.service-list-table th:nth-child(8),
.service-list-table th:nth-child(10) { width: 110px; }
.service-list-table th:nth-child(11) { width: 48px; }
.service-list-table th {
  height: 42px;
  padding: 8px 9px;
  color: #2627dc;
  background: #fbfbff;
  border-left: 1px solid #ededf5;
  white-space: nowrap;
  text-align: center;
}
.service-list-table td {
  height: 48px;
  padding: 7px 9px;
  color: #303451;
  background: #fff;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.service-list-table td strong { display: block; overflow: hidden; color: #363a58; font-size: 11px; text-overflow: ellipsis; }
.service-list-table .cell-note { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.service-list-table .money-cell { direction: ltr; min-width: 0; }
.service-list-table .money-cell b { color: #252947; font-size: 11px; }
.service-list-table .money-cell small {
  display: inline-block;
  margin: 0 5px 0 0;
  color: #7c8098;
  font-size: 9px;
}
.service-status-code { color: #282bf0; font-size: 11px; font-weight: 900; }
.status-code-VO { color: #e34d57; }
.status-code-RF { color: #df8a1e; }
.status-code-EX { color: #138a9a; }

.service-row-menu-cell { position: relative; width: 50px; overflow: visible !important; }
.service-row-menu { position: relative; }
.service-row-menu summary {
  width: 31px;
  height: 29px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border: 1px solid #dedfeb;
  border-radius: 3px;
  color: #343953;
  background: #fff;
  font-weight: 900;
  list-style: none;
  cursor: pointer;
}
.service-row-menu summary::-webkit-details-marker { display: none; }
.service-row-menu[open] summary { color: var(--shahin-indigo); border-color: #aaaef9; background: #f3f3ff; }
.service-row-menu-popover {
  position: absolute;
  top: 34px;
  left: 0;
  z-index: 80;
  width: 190px;
  display: grid;
  padding: 5px;
  border: 1px solid #e0e1ec;
  border-top: 2px solid var(--shahin-indigo);
  background: #fff;
  box-shadow: 0 14px 35px rgba(28, 33, 77, .18);
}
.service-row-menu-popover button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  color: #333752;
  background: #fff;
  text-align: right;
  font-size: 10px;
  font-weight: 700;
}
.service-row-menu-popover button:hover { color: var(--shahin-indigo); background: #f5f5ff; }

.modal:has(.shahin-service-form) { width: min(1240px, calc(100vw - 28px)); }
.modal:has(.shahin-service-form) .modal-body { padding: 18px; }
.shahin-service-form { min-width: 0; }
.shahin-service-form .field { gap: 5px; margin-bottom: 0; font-size: 11px; }
.shahin-service-form .field input,
.shahin-service-form .field select { min-height: 40px; padding: 0 10px; font-size: 11px; }
.shahin-service-form .service-type-selector { gap: 7px; margin-bottom: 14px; }
.shahin-service-form .service-choice span { min-height: 40px; padding: 6px 8px; font-size: 10px; }
.shahin-service-form .service-form-grid,
.shahin-service-form .service-calculation-grid { gap: 9px; }
.shahin-service-form .service-values-card { margin: 13px 0; padding: 13px; border-radius: 3px; background: #f1f1fb; }
.shahin-service-form .form-actions { bottom: -18px; margin: 18px -18px -18px; }

@media (max-width: 1200px) {
  .service-table-card .table-scroll { overflow-x: auto; overflow-y: visible; }
  .service-list-table { min-width: 1180px; }
}

@media (max-width: 760px) {
  .login-logo { top: 24px; left: 24px; }
  .compact-logo { width: 42px; height: 48px; background-size: auto 49px; }
  .topbar-brand > div { display: none; }
  .top-navigation-shell { top: 62px; }
  .service-list-toolbar { align-items: stretch; flex-direction: column-reverse; }
  .service-list-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .service-filter-panel { grid-template-columns: 1fr; }
  .service-status-tabs { overflow-x: auto; }
  .service-status-tab { min-width: 94px; }
  .modal:has(.shahin-service-form) { width: calc(100vw - 16px); }
}

/* قوائم الفواتير والتسويات والإيصالات بنمط شاهين */
.shahin-list-shell {
  overflow: visible;
  border: 1px solid #e8e8f4;
  background: #fff;
  box-shadow: 0 3px 14px rgba(29, 35, 88, .05);
}
.module-list-toolbar {
  min-height: 59px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #ececf5;
  background: #fff;
}
.module-list-actions { display: flex; align-items: center; gap: 8px; }
.module-list-actions .primary-button,
.module-list-actions .ghost-button {
  min-height: 37px;
  padding: 0 14px;
  border-radius: 3px;
  font-size: 11px;
}
.module-list-caption { color: #303452; font-size: 12px; font-weight: 800; }
.module-list-caption::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--maab-teal);
}
.module-filter-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 230px) minmax(180px, 250px) auto;
  gap: 9px;
  padding: 11px 14px;
  border-bottom: 1px solid #e7e7f2;
  background: #f8f8ff;
}
.module-filter-panel.receipt-filter-panel { grid-template-columns: minmax(260px, 1fr) auto; }
.module-filter-panel.master-filter-panel,
.module-filter-panel.journal-filter-panel,
.module-filter-panel.cash-filter-panel { grid-template-columns: minmax(260px, 1fr) auto; }
.module-filter-panel .search-input,
.module-filter-panel .filter-select,
.module-filter-panel .ghost-button { min-height: 38px; }
.module-status-tabs {
  height: 48px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 7px 14px 0;
  border-bottom: 1px solid #e5e5f1;
  background: #f6f6ff;
}
.module-status-tab {
  min-width: 124px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  color: #4e526d;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}
.module-status-tab small {
  min-width: 22px;
  padding: 2px 5px;
  border-radius: 9px;
  color: #6d718a;
  background: #e9e9f4;
  font-size: 9px;
}
.module-status-tab:hover { color: var(--shahin-indigo); background: #efeffd; }
.module-status-tab.active {
  color: #fff;
  border-color: var(--shahin-indigo);
  background: linear-gradient(105deg, #2929ef, #4d66ff);
}
.module-status-tab.active small { color: var(--shahin-indigo); background: #fff; }

.compact-table-card { overflow: visible; margin: 0; border: 0; box-shadow: none; }
.compact-table-card .table-scroll { overflow: visible; }
.compact-list-table { width: 100%; min-width: 0; table-layout: fixed; }
.compact-list-table th {
  height: 42px;
  padding: 8px 8px;
  color: #2627dc;
  background: #fbfbff;
  border-left: 1px solid #ededf5;
  text-align: center;
  white-space: nowrap;
}
.compact-list-table td {
  height: 48px;
  overflow: hidden;
  padding: 7px 8px;
  color: #303451;
  background: #fff;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.compact-list-table td strong { display: block; overflow: hidden; text-overflow: ellipsis; }
.compact-list-table .money-cell { min-width: 0; }
.compact-list-table .invoice-workflow { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

.invoice-list-table th:nth-child(1) { width: 58px; }
.invoice-list-table th:nth-child(2) { width: 82px; }
.invoice-list-table th:nth-child(3) { width: 75px; }
.invoice-list-table th:nth-child(4) { width: 170px; }
.invoice-list-table th:nth-child(5) { width: 235px; }
.invoice-list-table th:nth-child(6) { width: 62px; }
.invoice-list-table th:nth-child(7),
.invoice-list-table th:nth-child(8),
.invoice-list-table th:nth-child(9) { width: 94px; }
.invoice-list-table th:nth-child(10) { width: 78px; }
.invoice-list-table th:nth-child(11) { width: 48px; }

.settlement-list-table th:nth-child(1) { width: 62px; }
.settlement-list-table th:nth-child(2) { width: 82px; }
.settlement-list-table th:nth-child(3) { width: 260px; }
.settlement-list-table th:nth-child(4) { width: 62px; }
.settlement-list-table th:nth-child(5),
.settlement-list-table th:nth-child(6),
.settlement-list-table th:nth-child(7) { width: 92px; }
.settlement-list-table th:nth-child(8) { width: 105px; }
.settlement-list-table th:nth-child(9) { width: 100px; }
.settlement-list-table th:nth-child(10) { width: 95px; }
.settlement-list-table th:nth-child(11) { width: 48px; }

.receipt-list-table th:nth-child(1) { width: 68px; }
.receipt-list-table th:nth-child(2) { width: 82px; }
.receipt-list-table th:nth-child(3) { width: 90px; }
.receipt-list-table th:nth-child(4) { width: 235px; }
.receipt-list-table th:nth-child(5) { width: 190px; }
.receipt-list-table th:nth-child(6) { width: 105px; }
.receipt-list-table th:nth-child(7) { width: 62px; }
.receipt-list-table th:nth-child(8) { width: 105px; }
.receipt-list-table th:nth-child(9) { width: 78px; }
.receipt-list-table th:nth-child(10) { width: 48px; }

.party-list-table th:nth-child(1) { width: 105px; }
.party-list-table th:nth-child(2) { width: 300px; }
.party-list-table th:nth-child(3) { width: 300px; }
.party-list-table th:nth-child(4) { width: 75px; }
.party-list-table th:nth-child(5) { width: 130px; }
.party-list-table th:nth-child(6) { width: 90px; }
.party-list-table th:last-child { width: 48px; }

.journal-list-table th:nth-child(1) { width: 76px; }
.journal-list-table th:nth-child(2) { width: 88px; }
.journal-list-table th:nth-child(3) { width: 82px; }
.journal-list-table th:nth-child(4) { width: 115px; }
.journal-list-table th:nth-child(5) { width: 285px; }
.journal-list-table th:nth-child(6) { width: 64px; }
.journal-list-table th:nth-child(7),
.journal-list-table th:nth-child(8) { width: 105px; }
.journal-list-table th:nth-child(9) { width: 98px; }
.journal-list-table th:nth-child(10) { width: 48px; }

.master-list-table th:nth-child(1) { width: 105px; }
.master-list-table th:nth-child(2) { width: 330px; }
.master-list-table th:nth-child(3) { width: 120px; }
.master-list-table th:nth-child(4) { width: 135px; }
.master-list-table th:nth-child(5) { width: 78px; }
.master-list-table th:nth-child(6) { width: 130px; }
.master-list-table th:nth-child(7) { width: 48px; }

.cash-list-table th:nth-child(1) { width: 105px; }
.cash-list-table th:nth-child(2) { width: 390px; }
.cash-list-table th:nth-child(3) { width: 78px; }
.cash-list-table th:nth-child(4) { width: 150px; }
.cash-list-table th:nth-child(5) { width: 145px; }
.cash-list-table th:nth-child(6) { width: 110px; }
.cash-list-table th:nth-child(7) { width: 48px; }
.cash-list-table .negative-cell { color: #c54d57; font-weight: 800; }

/* كثافة نماذج الدورة المالية مثل نوافذ شاهين */
.modal:has(#invoice-form) { width: min(1210px, calc(100vw - 28px)); }
.modal:has(#settlement-form) { width: min(1180px, calc(100vw - 28px)); }
.modal:has(#receipt-form) { width: min(1080px, calc(100vw - 28px)); }
.modal:has(#invoice-form) .modal-body,
.modal:has(#settlement-form) .modal-body,
.modal:has(#receipt-form) .modal-body { padding: 18px; }
#invoice-form .field,
#settlement-form .field,
#receipt-form .field { gap: 5px; margin-bottom: 0; font-size: 11px; }
#invoice-form .field input,
#invoice-form .field select,
#settlement-form .field input,
#settlement-form .field select,
#receipt-form .field input,
#receipt-form .field select { min-height: 40px; padding: 0 10px; font-size: 11px; }
#invoice-form .form-grid,
#settlement-form .form-grid,
#receipt-form .form-grid { gap: 10px; }
#invoice-form .receipt-kind-selector span,
#settlement-form .receipt-kind-selector span,
#receipt-form .receipt-kind-selector span { min-height: 54px; border-radius: 3px; }
#invoice-form .invoice-service-picker,
#settlement-form .invoice-service-picker { border-radius: 3px; }
#settlement-form .settlement-entry-picker table { min-width: 980px; }
#invoice-form .form-actions,
#settlement-form .form-actions,
#receipt-form .form-actions { margin-right: 0; margin-left: 0; }

@media (max-width: 1100px) {
  .compact-table-card .table-scroll { overflow-x: auto; overflow-y: visible; }
  .invoice-list-table { min-width: 1090px; }
  .settlement-list-table { min-width: 1100px; }
  .receipt-list-table { min-width: 1050px; }
  .party-list-table { min-width: 980px; }
  .journal-list-table { min-width: 1060px; }
  .master-list-table { min-width: 970px; }
  .cash-list-table { min-width: 1020px; }
}

@media (max-width: 760px) {
  .module-list-toolbar { align-items: stretch; flex-direction: column-reverse; }
  .module-list-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .module-filter-panel,
  .module-filter-panel.receipt-filter-panel,
  .module-filter-panel.master-filter-panel,
  .module-filter-panel.journal-filter-panel,
  .module-filter-panel.cash-filter-panel { grid-template-columns: 1fr; }
  .module-status-tabs { overflow-x: auto; }
  .module-status-tab { min-width: 104px; }
  .modal:has(#invoice-form),
  .modal:has(#settlement-form),
  .modal:has(#receipt-form) { width: calc(100vw - 16px); }
}

/* مصفوفة الصلاحيات كبطاقات مستقلة مثل شاشة شاهين المرجعية */
.permission-card.module-matrix {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.permission-card.module-matrix > .permission-module.header { display: none; }
.permission-card.module-matrix > .permission-module:not(.header) {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 4px;
  padding: 36px 0 14px;
  border: 0;
}
.permission-card.module-matrix > .permission-module:not(.header) > strong {
  position: absolute;
  top: 9px;
  right: 4px;
  color: #292d55;
  font-size: 12px;
}
.permission-card.module-matrix .permission-check {
  min-height: 46px;
  align-items: center;
  justify-content: flex-end;
  padding: 0 14px;
  border: 1px solid #e8e8f4;
  border-radius: 3px;
  background: #fff;
}
.permission-card.module-matrix .permission-check > span {
  order: 2;
  flex: 1;
  overflow: hidden;
  color: #303453;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.permission-card.module-matrix .permission-check input {
  order: 1;
  width: 16px;
  height: 16px;
  margin: 0 0 0 8px;
  appearance: none;
  border: 1px solid #7f8395;
  border-radius: 50%;
  background: #fff;
}
.permission-card.module-matrix .permission-check input:checked {
  border: 4px solid var(--shahin-indigo);
}
.permission-card.module-matrix .permission-check input:disabled:checked {
  border-color: #b6b8c6;
}
.permission-card.module-matrix .permission-check:has(input:checked) {
  border-color: #c5c6fa;
  background: #f9f9ff;
}
.permission-policy { border-radius: 3px; background: #f6f6ff; }
.permission-policy h3 { color: #252a51; font-size: 13px; }
.permission-policy p { font-size: 10px; }

@media (max-width: 760px) {
  .permission-card.module-matrix > .permission-module:not(.header) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .role-card-grid { grid-template-columns: 1fr; }
  .role-selector-actions { width: 100%; }
  .role-selector-actions > button { flex: 1; }
}

/* مطابقة كثافة خط شاهين ونظام الأيقونات الموحد */
:root { font-family: Tahoma, Arial, sans-serif; }
body { font-size: 12px; }
button, input, select, textarea { font-family: Tahoma, Arial, sans-serif; }
.ui-icon, .top-nav-icon, .nav-menu-icon, .nav-add-icon, .shortcut-action-icon,
.dashboard-stat-icon, .service-choice-icon, .button-icon {
  display: block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}
.page-header h1 { font-size: 18px; }
.page-header p { font-size: 9px; }
.primary-button, .secondary-button, .ghost-button, .danger-button { font-size: 10px; }
th { font-size: 9px; }
td { font-size: 10px; }
.small-button { font-size: 9px; }
.shahin-stat strong { font-size: 20px; }
.shahin-stat p { font-size: 13px; }
.dashboard-breakdown h2 { font-size: 12px; }

/* التنقل العلوي والقوائم المنسدلة مثل شاهين */
.top-nav-link, .nav-group > summary {
  min-width: 108px;
  gap: 6px;
  padding: 0 12px;
  font-size: 11px;
}
.top-nav-link > span, .nav-group > summary > span {
  color: #292d51;
  font-size: 11px;
}
.top-nav-link .top-nav-icon, .nav-group > summary .top-nav-icon {
  width: 16px;
  height: 16px;
  color: #2e35ff;
}
.nav-dropdown {
  width: 220px;
  gap: 1px;
  padding: 6px;
  border-top: 0;
  border-radius: 4px;
  box-shadow: 0 9px 24px rgba(28, 34, 84, .13);
}
.nav-dropdown-row {
  min-height: 39px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 29px;
  align-items: center;
  border-radius: 3px;
  background: #fff;
}
.nav-dropdown-row:hover, .nav-dropdown-row.active { background: #f6f5ff; }
.nav-dropdown-item {
  min-width: 0;
  min-height: 39px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 9px;
  color: #2f3356;
  background: transparent;
  font-size: 10px;
}
.nav-dropdown-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-menu-icon { width: 16px; height: 16px; color: #2f36ff; }
.nav-create-button {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #dedff1;
  border-radius: 3px;
  color: #3038ff;
  background: #fff;
}
.nav-create-button:hover { border-color: #9094ff; background: #f0f0ff; }
.nav-add-icon { width: 16px; height: 16px; }
.nav-create-placeholder { width: 27px; }

/* الاختصارات الأربعة للإجراءات المباشرة */
.shortcut-icons {
  direction: rtl;
  order: 2;
  position: relative;
  display: flex;
  align-self: center;
  align-items: center;
  gap: 7px;
  overflow: visible;
}
.shortcut-strip .topbar-context { order: 1; }
.shortcut-action {
  position: relative;
  width: 44px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #e2e4f2;
  border-radius: 11px;
  color: #262b50;
  background: #fff;
  box-shadow: 0 2px 7px rgba(28, 34, 84, .06);
  transition: transform .16s ease, color .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.shortcut-action-icon { width: 18px; height: 18px; }
.shortcut-service { color: #f25718; }
.shortcut-receipt { color: #078f82; }
.shortcut-invoice { color: #3342ed; }
.shortcut-expense { color: #c73c57; }
.shortcut-action:hover, .shortcut-action:focus-visible {
  color: #fff;
  background: #313bf0;
  border-color: #313bf0;
  box-shadow: 0 6px 16px rgba(49, 59, 240, .2);
  transform: translateY(-1px);
}
.shortcut-action:focus-visible { outline: 2px solid rgba(49, 59, 240, .3); outline-offset: 2px; }
.shortcut-action:disabled { cursor: not-allowed; opacity: .42; transform: none; box-shadow: none; }
.shortcut-icons .shortcut-tooltip {
  pointer-events: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 50%;
  z-index: 100;
  width: max-content !important;
  max-width: 170px;
  display: none !important;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: #24304f;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 5px 15px rgba(20, 25, 60, .18);
  transform: translateX(50%);
}
.shortcut-icons .shortcut-action:hover .shortcut-tooltip,
.shortcut-icons .shortcut-action:focus-visible .shortcut-tooltip { display: block !important; }
body:has(.modal-backdrop:not(.hidden)) .shortcut-tooltip { display: none !important; }
.dashboard-stat-icon { width: 19px; height: 19px; }

/* نموذج الخدمة: شريط جانبي وأيقونات وخانات كثيفة مثل المرجع */
.modal:has(.shahin-service-form) {
  width: min(1380px, calc(100vw - 12px));
  max-height: calc(100vh - 12px);
}
.modal:has(.shahin-service-form) .modal-header {
  min-height: 48px;
  padding: 9px 18px;
  background: #fff;
}
.modal:has(.shahin-service-form) .modal-header h2 { font-size: 15px; }
.modal:has(.shahin-service-form) .modal-body { padding: 0; overflow: auto; }
.service-modal .modal-header { position: sticky; justify-content: center; }
.service-modal .modal-header > div:first-child { flex: 0 1 auto; }
.service-modal .modal-header .icon-button { right: 16px; }
.service-modal-tools {
  position: absolute;
  left: 16px;
  display: flex !important;
  flex: 0 0 auto !important;
  align-items: center;
  gap: 8px;
}
.service-modal-tools button {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  color: #283cff;
  background: transparent;
  cursor: pointer;
}
.service-modal-tools button:hover { color: #1025d7; background: #f1f2ff; }
.service-modal-tools .ui-icon { width: 19px; height: 19px; }
.service-modal.service-modal-maximized {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  border-radius: 0;
}
.service-modal.service-modal-maximized .service-form-workspace { min-height: calc(100vh - 106px); }
.shahin-service-form { min-width: 0; }
.service-form-workspace {
  min-height: calc(100vh - 123px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 285px;
  direction: rtl;
  background: #f5f5ff;
}
.service-form-main {
  min-width: 0;
  padding: 20px 14px 24px;
  background: #f5f5ff;
}
.service-form-aside {
  min-width: 0;
  padding: 20px 14px 24px;
  border-left: 6px solid #0a3b78;
  background: #efefff;
}
.service-extract-button {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
  border: 0;
  border-radius: 18px;
  color: #2b31ef;
  background: #fff;
  font-size: 9px;
  font-weight: 800;
  box-shadow: 0 3px 12px rgba(44, 48, 120, .05);
}
.service-extract-button .button-icon { width: 15px; height: 15px; }
.shahin-service-form .service-type-selector {
  grid-template-columns: repeat(7, minmax(86px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.shahin-service-form .service-type-selector .service-choice span {
  min-height: 68px;
  flex-direction: column;
  gap: 6px;
  padding: 7px 5px;
  border-radius: 3px;
  font-size: 9px;
}
.service-type-selector .service-choice-icon { width: 25px; height: 25px; color: #141826; }
.service-type-selector .service-choice input:checked + span .service-choice-icon { color: #2029ff; }
.service-choice span b { font: inherit; font-weight: 700; }
.shahin-service-form .field { gap: 5px; margin-bottom: 0; font-size: 9px; }
.shahin-service-form .field > span:first-child { color: #272b50; }
.shahin-service-form .field input,
.shahin-service-form .field select,
.shahin-service-form .field textarea {
  min-height: 39px;
  padding: 0 9px;
  border-color: #e2e3f2;
  border-radius: 3px;
  font-size: 10px;
}
.shahin-service-form .field textarea { min-height: 40px; padding-top: 9px; }
.service-primary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.shahin-service-form .service-values-card {
  margin: 16px 0 12px;
  padding: 14px 12px;
  border: 0;
  border-top: 2px solid #3945ff;
  border-radius: 0;
  background: #fff;
}
.ticket-values-card .service-calculation-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.ticket-values-card .itinerary-field { grid-column: span 5; }
.simple-calculation-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 14px;
}
.simple-calculation-grid .total-field { grid-column: span 1; }
.quantity-field > span:last-child { grid-template-columns: 34px 1fr 34px; }
.quantity-field button { color: #2930ed; background: #f5f5ff; font-size: 14px; }
.service-tax-button {
  min-width: 145px;
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  padding: 0 18px;
  border: 0;
  border-radius: 3px;
  color: #fff;
  background: #ef5314;
  font-size: 10px;
  font-weight: 800;
}
.service-tax-button .button-icon { width: 16px; height: 16px; }
.service-main-note { margin-top: 10px !important; }
.service-main-note textarea { min-height: 42px !important; }
#service-posting-preview { display: none; }
.service-secondary-grid { grid-template-columns: 1fr; gap: 10px; }
.service-form-aside .service-option-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.service-form-aside .service-option-row > strong {
  grid-column: 1 / -1;
  min-width: 0;
  color: #292d51;
  font-size: 9px;
}
.service-form-aside .service-choice span {
  min-height: 30px;
  padding: 5px 6px;
  border-radius: 3px;
  background: #fff;
  font-size: 9px;
}
.service-form-aside .age-option-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.service-form-aside .age-option-row .service-choice span { min-height: 66px; flex-direction: column; gap: 4px; }
.service-form-aside .age-option-row .service-choice-icon { width: 24px; height: 24px; color: #565b6c; }
.service-form-aside .travel-class-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.service-form-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin: 0 !important;
  padding: 9px 10px;
  gap: 6px;
  background: #fff;
}
.service-form-actions > button { min-height: 44px; border-radius: 3px; font-size: 10px; }
.service-form-actions .dark-button { color: #fff; background: #123f78; }
.service-form-actions #save-service { flex: 2.4; }

@media (max-width: 1100px) {
  .service-form-workspace { grid-template-columns: minmax(0, 1fr) 250px; }
  .shahin-service-form .service-type-selector { overflow-x: auto; grid-template-columns: repeat(7, minmax(100px, 1fr)); }
  .ticket-values-card .service-calculation-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ticket-values-card .itinerary-field { grid-column: span 2; }
}

@media (max-width: 760px) {
  .service-form-workspace { grid-template-columns: 1fr; }
  .service-form-main { order: 1; }
  .service-form-aside { order: 2; border-left: 0; border-top: 5px solid #0a3b78; }
  .service-primary-grid, .ticket-values-card .service-calculation-grid, .simple-calculation-grid { grid-template-columns: 1fr; }
  .ticket-values-card .itinerary-field, .simple-calculation-grid .total-field { grid-column: auto; }
  .shortcut-action { width: 40px; height: 32px; }
}

/* نماذج الإضافة المباشرة للعملاء والمزوّدين والفنادق والسيولة */
.modal:has(.master-create-form) { width: min(820px, calc(100vw - 24px)); }
.master-create-form { display: grid; gap: 16px; }
.master-create-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e4e5fb;
  border-radius: 5px;
  color: #2432d7;
  background: linear-gradient(90deg, #f0f4ff, #fbf3ff);
}
.master-create-heading > .ui-icon { width: 27px; height: 27px; }
.master-create-heading div { display: grid; gap: 3px; }
.master-create-heading strong { font-size: 13px; }
.master-create-heading span { color: #6a6f8c; font-size: 9px; }
.master-create-form .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.master-create-form .wide { grid-column: 1 / -1; }
.master-form-section {
  padding: 12px;
  border: 1px solid #e6e7fa;
  border-radius: 5px;
  background: #f8f8ff;
}
.master-form-section > strong { display: block; margin-bottom: 10px; color: #292d51; font-size: 10px; }
.master-checkbox {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border: 1px solid #e4e5f6;
  border-radius: 4px;
  background: #fff;
  color: #343854;
  font-size: 10px;
}
.master-checkbox input { width: 16px; height: 16px; accent-color: #2d35ff; }
@media (max-width: 640px) {
  .master-create-form .form-grid { grid-template-columns: 1fr; }
  .master-create-form .wide { grid-column: auto; }
}

/* نماذج البيانات المرجعية المطابقة لتقسيم شاهين */
.modal:has(.shahin-reference-form) { width: min(880px, calc(100vw - 22px)); max-height: calc(100vh - 26px); }
.shahin-reference-form { display: grid; gap: 14px; direction: rtl; }
.shahin-reference-form > .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.shahin-reference-form .wide { grid-column: 1 / -1; }
.shahin-reference-form .field textarea { min-height: 72px; resize: vertical; }
.master-status-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.master-status-choices label { position: relative; }
.master-status-choices input { position: absolute; opacity: 0; pointer-events: none; }
.master-status-choices span {
  min-height: 46px; display: flex; align-items: center; justify-content: center; padding: 8px 12px;
  border: 1px solid #e2e4f5; border-radius: 5px; color: #292e54; background: #fff; font-size: 10px; font-weight: 800; cursor: pointer;
}
.master-status-choices input:checked + span { border-color: #3538ff; color: #252aff; background: #f8f8ff; box-shadow: inset 0 0 0 1px rgba(53,56,255,.08); }
.code-refresh-field > span:last-child { display: grid; grid-template-columns: minmax(0, 1fr) 42px; }
.code-refresh-field > span:last-child input { border-radius: 0 4px 4px 0; }
.regenerate-code { border: 1px solid #e1e3f3; border-right: 0; border-radius: 4px 0 0 4px; color: #22315d; background: #f7f8ff; font-size: 16px; }
.master-create-form .three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.master-color-field { display: grid; gap: 7px; color: #343854; font-size: 10px; font-weight: 700; }
.master-color-row { min-height: 54px; display: flex; align-items: center; gap: 10px; padding: 9px 14px; border: 1px solid #e5e6f5; border-radius: 5px; background: #fff; }
.master-color-native { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.master-color-native::-webkit-color-swatch { border: 0; border-radius: 50%; }
.master-color-preset { width: 28px; height: 28px; padding: 0; border: 3px solid #fff; border-radius: 50%; background: var(--preset); box-shadow: 0 0 0 1px #e0e2ed; }
.reference-image-field { display: grid; grid-template-columns: minmax(0, 1fr) 82px; align-items: end; gap: 10px; }
.reference-image-field > span { grid-column: 1 / -1; color: #343854; font-size: 10px; font-weight: 700; }
.reference-file-picker { min-height: 42px; display: flex; align-items: center; padding: 0 12px; border: 1px solid #3438ff; border-radius: 4px; color: #32376a; background: #fff; cursor: pointer; }
.reference-file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.reference-image-preview { width: 72px; height: 72px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; color: #0b315f; background: #dde1ed; font-size: 26px; font-weight: 900; }
.reference-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.service-type-reference-form .reference-image-preview { border-radius: 10px; }
.service-template-section { padding-top: 4px; border-top: 3px solid; border-image: linear-gradient(90deg, #3a7afe, #e08a6a, #f4d53e, #7469e9) 1; }
.reference-gradient-heading { margin: 16px 8px; padding: 11px 18px; border-radius: 4px; color: #302c58; background: linear-gradient(90deg, #dceaff, #fbedf7); font-size: 14px; font-weight: 900; text-align: center; }
.service-template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.service-template-grid label { position: relative; }
.service-template-grid input { position: absolute; opacity: 0; }
.service-template-grid span { min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 8px 10px; border: 1px solid #e3e5f4; border-radius: 5px; color: #313657; background: #fff; font-size: 10px; font-weight: 800; cursor: pointer; }
.service-template-grid b { font-size: 19px; font-weight: 500; }
.service-template-grid input:checked + span { border-color: #3337ff; color: #282dce; background: #f8f8ff; }
.sticky-form-actions { position: sticky; bottom: -16px; z-index: 5; margin: 2px -2px -2px; padding: 11px 2px 2px; background: #fff; }
@media (max-width: 640px) {
  .shahin-reference-form > .form-grid, .master-create-form .three-columns, .service-template-grid { grid-template-columns: 1fr; }
  .shahin-reference-form .wide { grid-column: auto; }
  .master-status-choices { grid-template-columns: 1fr 1fr; }
  .master-color-row { flex-wrap: wrap; }
}

/* خط Cairo ولوحة تحكم احترافية مرتبطة بالفترة */
:root { font-family: "Cairo", Tahoma, Arial, sans-serif; }
body, button, input, select, textarea { font-family: "Cairo", Tahoma, Arial, sans-serif; }
body { line-height: 1.55; }

.dashboard-period-bar {
  direction: rtl;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: -20px -24px 18px;
  padding: 11px 24px;
  border: 0;
  border-bottom: 1px solid #e8ebf5;
  background: rgba(255,255,255,.96);
  box-shadow: 0 6px 22px rgba(31, 43, 85, .045);
}
.date-range { direction: rtl; display: flex; align-items: center; gap: 10px; }
.date-range label { display: grid; gap: 4px; color: #737994; font-size: 9px; font-weight: 600; }
.dashboard-date-input {
  min-width: 154px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid #e1e5f1;
  border-radius: 11px;
  background: #f8f9ff;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.dashboard-date-input:focus-within { border-color: #7881ff; background: #fff; box-shadow: 0 0 0 3px rgba(63, 70, 255, .09); }
.dashboard-date-icon { width: 16px; height: 16px; color: #5964f4; }
.date-range input {
  width: 116px;
  height: 36px;
  padding: 0;
  border: 0;
  outline: 0;
  color: #252a50;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}
.period-buttons {
  direction: ltr;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px;
  border: 1px solid #e7e9f3;
  border-radius: 15px;
  background: #f7f8fd;
}
.period-buttons button {
  min-width: 82px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #454b69;
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  box-shadow: none;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.period-buttons button:hover { color: #2e36db; background: #fff; box-shadow: 0 5px 14px rgba(47, 54, 128, .08); }
.period-buttons button.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(115deg, #2e2cf4, #5486ff);
  box-shadow: 0 7px 16px rgba(54, 64, 244, .22);
  transform: translateY(-1px);
}
.dashboard-period-bar::before, .dashboard-period-bar::after, .period-buttons::before, .period-buttons::after { display: none !important; content: none !important; }

.dashboard-result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 4px 3px;
}
.dashboard-result-heading .eyebrow { color: #69708c; font-size: 8px; }
.dashboard-result-heading h1 { margin: 2px 0 0; color: #252a50; font-size: 15px; }
.dashboard-value-summary {
  min-width: 230px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 13px;
  border: 1px solid #dcebe8;
  border-radius: 12px;
  color: #637071;
  background: linear-gradient(115deg, #f5fffc, #f4f7ff);
  font-size: 9px;
}
.dashboard-value-summary strong { color: #0d7f6c; font-size: 13px; }
.dashboard-value-summary small { color: #72817f; font-size: 8px; }

.shahin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
  background: transparent;
}
.shahin-stat {
  position: relative;
  min-height: 144px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid #e6e8f3;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(38, 45, 91, .055);
}
.shahin-stat::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  left: -42px;
  bottom: -58px;
  border-radius: 50%;
  background: rgba(71, 91, 255, .035);
}
.shahin-stat-icon {
  position: static;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  color: #414cf1;
  background: #f0f2ff;
}
.shahin-stat:nth-child(2) .shahin-stat-icon { color: #0f8f80; background: #eafaf7; }
.shahin-stat:nth-child(3) .shahin-stat-icon { color: #d07b17; background: #fff5e7; }
.shahin-stat:nth-child(4) .shahin-stat-icon { color: #9b55cc; background: #f8efff; }
.shahin-stat-icon .dashboard-stat-icon { width: 22px; height: 22px; }
.shahin-stat > div { display: grid; gap: 1px; }
.shahin-stat strong { color: #292ff0; font-size: 23px; line-height: 1.2; }
.shahin-stat p { margin: 0; color: #292d50; font-size: 12px; font-weight: 800; }
.shahin-stat small { color: #9a9db2; font-size: 8px; }

.dashboard-analysis-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
  background: transparent;
}
.dashboard-breakdown {
  min-height: 380px;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid #e6e8f3;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(38, 45, 91, .05);
}
.dashboard-breakdown > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dashboard-breakdown h2 { margin: 0; color: #292d50; font-size: 11px; text-align: right; }
.dashboard-breakdown > header > span { color: #a0a3b6; font-size: 8px; }
.dashboard-donut-wrap { position: relative; width: 172px; height: 172px; margin: 20px auto 18px; }
.dashboard-donut { width: 100%; height: 100%; overflow: visible; }
.dashboard-donut-track, .dashboard-donut-segment { fill: none; stroke-width: 5.5; transform: rotate(-90deg); transform-origin: center; }
.dashboard-donut-track { stroke: #f0f1f7; }
.dashboard-donut-segment { stroke-linecap: round; }
.dashboard-donut-card .segment-0 { stroke: #0b315f; }
.dashboard-donut-card .segment-1 { stroke: #4fc7ca; }
.dashboard-donut-card .segment-2 { stroke: #ffbe28; }
.dashboard-donut-card .segment-3 { stroke: #ff7a55; }
.dashboard-donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.dashboard-donut-center strong { color: #20294b; font-size: 18px; line-height: 1.1; }
.dashboard-donut-center span { color: #a2a6b8; font-size: 8px; }
.dashboard-breakdown ul { display: grid; gap: 10px; margin: auto 0 0; padding: 0; list-style: none; }
.dashboard-breakdown li { display: grid; grid-template-columns: 9px 1fr auto 42px; align-items: center; gap: 6px; color: #5d627e; font-size: 9px; }
.dashboard-breakdown li b { color: #252a50; }
.dashboard-breakdown li small { color: #33967c; text-align: left; }
.dashboard-breakdown .breakdown-dot { width: 8px; height: 8px; border: 0; border-radius: 50%; background: #0b315f; }
.dashboard-breakdown .dot-1 { background: #4fc7ca; }
.dashboard-breakdown .dot-2 { background: #ffbe28; }
.dashboard-breakdown .dot-3 { background: #ff7a55; }

.dashboard-trend-card {
  padding: 18px 20px 14px;
  border: 1px solid #e6e8f3;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(38, 45, 91, .05);
}
.dashboard-trend-card > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.dashboard-trend-card h2 { margin: 2px 0 0; color: #292d50; font-size: 12px; }
.dashboard-trend-card .eyebrow { color: #767c96; font-size: 8px; }
.trend-legend { display: flex; align-items: center; gap: 16px; color: #686e89; font-size: 8px; }
.trend-legend span { display: flex; align-items: center; gap: 6px; }
.trend-legend span::before { content: ""; width: 18px; height: 3px; border-radius: 999px; background: #4fc7ca; }
.trend-legend .supplier-line::before { background: #0b315f; }
.dashboard-trend { width: 100%; min-height: 260px; margin-top: 10px; overflow: visible; direction: ltr; }
.trend-grid line { stroke: #eceef5; stroke-width: 1; }
.trend-grid text { fill: #9da2b5; font-family: "Cairo", sans-serif; font-size: 7px; text-anchor: end; }
.trend-customer-area { fill: rgba(79, 199, 202, .28); }
.trend-supplier-area { fill: rgba(11, 49, 95, .86); }
.trend-customer-line { fill: none; stroke: #3cbec2; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.trend-supplier-line { fill: none; stroke: #0b315f; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.trend-date-label { fill: #7f849a; font-family: "Cairo", sans-serif; font-size: 7px; text-anchor: middle; }
.dashboard-chart-empty { min-height: 220px; display: grid; place-items: center; color: #9196aa; font-size: 10px; }
.dashboard-loading { min-height: 430px; display: grid; place-content: center; justify-items: center; gap: 12px; color: #6c728e; }
.dashboard-loading span { width: 34px; height: 34px; border: 3px solid #e5e7f4; border-top-color: #3d47ef; border-radius: 50%; animation: dashboard-spin .8s linear infinite; }
.dashboard-loading strong { font-size: 10px; }
@keyframes dashboard-spin { to { transform: rotate(360deg); } }

@media (max-width: 1050px) {
  .dashboard-period-bar { align-items: stretch; flex-direction: column; }
  .date-range, .period-buttons { width: 100%; }
  .date-range { justify-content: space-between; }
  .dashboard-date-input { min-width: 0; }
  .period-buttons { justify-content: stretch; }
  .period-buttons button { flex: 1; }
  .shahin-stats-grid, .dashboard-analysis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .dashboard-period-bar { margin: -14px -10px 14px; padding: 10px; }
  .date-range { display: grid; grid-template-columns: 1fr; }
  .dashboard-date-input, .date-range input { width: 100%; }
  .period-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); direction: rtl; }
  .period-buttons button { min-width: 0; }
  .dashboard-result-heading { align-items: stretch; flex-direction: column; }
  .dashboard-value-summary { min-width: 0; }
  .shahin-stats-grid, .dashboard-analysis-grid { grid-template-columns: 1fr; }
  .dashboard-breakdown { min-height: 350px; }
  .dashboard-trend-card > header { align-items: flex-start; flex-direction: column; }
}
