:root {
  color-scheme: light;
  /* Rasheed brand palette sampled from the supplied logo */
  --ink: #18243b;
  --muted: #64748b;
  --canvas: #f4f8fc;
  --surface: #ffffff;
  --surface-soft: #edf4fa;
  --line: #d9e5f0;
  --brand: #0071bc;
  --primary: var(--brand);
  --brand-hover: #1b1464;
  --brand-deep: #1b1464;
  --brand-soft: #e4f2fb;
  --brand-cyan: #29abe2;
  --brand-teal: #00a99d;
  --focus-ring: #29abe2;
  --accent: #0071bc;
  --green: #148579;
  --green-soft: #e5f8f4;
  --orange: #a85f14;
  --orange-soft: #fbf1e4;
  --red: #b42336;
  --red-soft: #faecec;
  /* Legacy semantic aliases used by older module styles. Keep them theme-aware. */
  --text: var(--ink);
  --text-muted: var(--muted);
  --border: var(--line);
  --border-color: var(--line);
  --border-strong: #c6d2e0;
  --line-strong: #aab9c9;
  --surface-muted: var(--surface-soft);
  --surface-subtle: var(--surface-soft);
  --panel-muted: var(--surface);
  --card: var(--surface);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Segoe UI Variable", "SF Pro Text", "SF Arabic", "Noto Sans Arabic", "Noto Sans", Tahoma, Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}
a { color: inherit; text-decoration: none; }

.app-shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.app-shell[hidden], .auth-screen[hidden] { display: none !important; }
.auth-form[hidden] { display: none !important; }
.auth-screen { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(circle at 18% 14%, #e4f2fb 0, transparent 34%), var(--canvas); }
.auth-card { width: min(430px, 100%); padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 22px 70px rgba(25, 18, 34, .1); }
.auth-brand { display: flex; align-items: center; gap: 11px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.auth-brand > div { display: grid; gap: 3px; }
.auth-brand strong { font-size: 16px; }
.auth-brand small, .auth-footnote { color: var(--muted); font-size: 11px; }
.auth-form { display: grid; gap: 13px; padding-top: 19px; }
.auth-form > div h1 { margin: 0; font-size: 19px; }
.auth-form > div p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.auth-form > .button { width: 100%; min-height: 42px; margin-top: 3px; }
.auth-message { min-height: 0; margin-top: 12px; color: var(--brand-deep); font-size: 12px; line-height: 1.6; }
.auth-message:empty { display: none; }
.auth-footnote { margin: 18px 0 0; line-height: 1.7; }
.app-notice { position: fixed; z-index: 70; top: 12px; left: 50%; max-width: min(520px, calc(100vw - 24px)); padding: 10px 15px; transform: translateX(-50%); border: 1px solid #b6ddec; border-radius: 9px; background: #fff; color: var(--brand-deep); box-shadow: 0 8px 30px rgba(30, 20, 40, .14); font-size: 12px; }
.sidebar {
  display: flex; flex-direction: column; gap: 16px; min-width: 0;
  padding: 20px 14px 14px; background: var(--surface); border-left: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 9px 8px; }
.brand-mark {
  display: block; flex: none; width: 39px; height: 39px;
  border-radius: 10px; object-fit: contain; background: transparent;
}
.brand-copy { display: grid; gap: 1px; min-width: 0; }
.auth-brand .brand-mark { width: 48px; height: 48px; border-radius: 11px; }
.brand-copy strong { font-size: 17px; font-weight: 650; letter-spacing: -.3px; }
.brand-copy small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.company-switch {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 55px; padding: 8px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface); text-align: right; cursor: pointer;
}
.company-switch:hover { background: var(--surface-soft); }
.company-avatar { display: grid; place-items: center; flex: 0 0 33px; width: 33px; height: 33px; overflow: hidden; border-radius: 8px; color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.company-avatar.has-company-logo { padding: 0; background: var(--surface-soft); border: 1px solid var(--line); }
.company-avatar-logo { display: block; width: 100%; height: 100%; object-fit: contain; padding: 2px; border-radius: inherit; }
.company-avatar-initial { display: grid; place-items: center; width: 100%; height: 100%; line-height: 1; }
.company-copy { display: grid; flex: 1; gap: 2px; min-width: 0; }
.company-copy small { color: var(--muted); font-size: 11px; }
.company-copy strong { overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.chevron { color: var(--muted); font-size: 16px; }
.module-nav { display: grid; gap: 2px; }
.nav-section-label { padding: 10px 10px 3px; color: var(--muted); font-size: 11px; }
.nav-item {
  display: flex; flex-direction: row; direction: rtl; align-items: center; gap: 10px; width: 100%;
  min-height: 37px; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); text-align: right; cursor: pointer; transition: background .15s ease, color .15s ease;
}
.nav-item:hover { color: var(--ink); background: var(--surface-soft); }
.nav-item.active { color: var(--brand-deep); background: var(--brand-soft); font-weight: 600; }
.nav-icon { display: grid; place-items: center; flex: none; width: 19px; height: 19px; }
.nav-icon svg { display: block; width: 17px; height: 17px; stroke: currentColor; }
.nav-text { min-width: 0; flex: 1; text-align: right; white-space: nowrap; }
.nav-count { min-width: 20px; color: var(--muted); font-size: 11px; text-align: left; }
.sidebar-bottom { display: grid; gap: 12px; margin-top: auto; }
.assistant-shortcut {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 11px;
  border: 1px solid #c4e5f2; border-radius: 9px; background: #f1f8fc; text-align: right; cursor: pointer;
}
.assistant-shortcut:hover { background: var(--brand-soft); }
.assistant-glyph { display: grid; place-items: center; flex: none; width: 31px; height: 31px; border-radius: 9px; color: var(--brand); background: var(--brand-soft); font-size: 18px; }
.assistant-shortcut span:last-child { display: grid; gap: 2px; }
.assistant-shortcut strong { font-size: 12px; font-weight: 600; }
.assistant-shortcut small { color: var(--muted); font-size: 11px; }
.account-user { display: flex; align-items: center; gap: 9px; padding: 10px 4px 0; border-top: 1px solid var(--line); }
.user-avatar { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; color: var(--brand-deep); background: #e4f2fb; font-weight: 700; }
.account-user > span:nth-child(2) { display: grid; flex: 1; gap: 2px; }
.account-user strong { font-size: 11px; font-weight: 600; }
.account-user small { color: var(--muted); font-size: 11px; }
.user-menu { width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.user-menu:hover { background: var(--surface-soft); }

.main-area { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 65px;
  padding: 10px 25px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.breadcrumb { display: flex; align-items: center; gap: 9px; min-width: 140px; color: var(--muted); font-size: 12px; }
.breadcrumb strong { color: var(--ink); font-weight: 600; }
.breadcrumb-separator { color: #9aaabd; }
.topbar-tools { display: flex; align-items: center; gap: 10px; }
.global-search {
  display: flex; align-items: center; gap: 8px; width: min(280px, 27vw); min-width: 180px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); color: var(--muted);
}
.global-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.global-search input::placeholder { color: var(--muted); }
.global-search kbd { flex: none; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; font-size: 11px; font-family: inherit; }
.search-glyph { font-size: 20px; line-height: 1; }
.sync-status { flex: none; padding: 6px 9px; border: 1px solid #c4ebe4; border-radius: 16px; background: var(--green-soft); color: var(--green); font-size: 10px; white-space: nowrap; }
.sync-status[data-state="saving"] { border-color: #eadfcf; background: var(--orange-soft); color: var(--orange); }
.sync-status[data-state="error"] { border-color: #efd8d8; background: var(--red-soft); color: var(--red); }
.top-icon {
  position: relative; display: grid; place-items: center; flex: none; width: 36px; height: 36px;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer;
}
.top-icon:hover { background: var(--surface-soft); color: var(--ink); }
.notification-mark { position: absolute; top: 6px; left: 6px; width: 7px; height: 7px; border-radius: 50%; background: #bd5c70; }
.notification-count { position: absolute; top: -3px; left: -4px; display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border: 2px solid var(--surface); border-radius: 10px; background: #a34158; color: #fff; font-size: 9px; line-height: 1; }
.notification-count[hidden] { display: none; }
.mobile-menu { display: none; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; font-size: 19px; cursor: pointer; }
.page-host { flex: 1; width: 100%; max-width: 1600px; margin: 0 auto; padding: 24px; }
.app-footer { display: flex; justify-content: space-between; gap: 10px; padding: 10px 25px; color: var(--muted); font-size: 11px; }
.sidebar-scrim { display: none; }

.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 19px; }
.page-heading h1 { margin: 0; font-size: 22px; line-height: 1.4; font-weight: 650; letter-spacing: -.3px; }
.page-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.heading-actions, .toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 37px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink);
  font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.button:hover { background: var(--surface-soft); }
.button-primary { border-color: var(--brand); background: var(--brand); color: #fff; }
.button-primary:hover { border-color: var(--brand-hover); background: var(--brand-hover); }
.button-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.button-quiet:hover { border-color: var(--line); color: var(--ink); }
.button-symbol { font-size: 17px; line-height: 1; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.metric-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.metric-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--brand); background: var(--brand-soft); }
.metric-icon svg { width: 16px; height: 16px; stroke: currentColor; }
.metric-value { margin: 10px 0 6px; font-size: 22px; line-height: 1.2; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.metric-value small { color: var(--muted); font-size: 11px; font-weight: 400; letter-spacing: 0; }
.metric-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.metric-trend { color: var(--green); font-weight: 600; }
.metric-alert { color: var(--orange); font-weight: 600; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(240px, .8fr); gap: 13px; margin-bottom: 13px; }
.dashboard-alerts { margin-bottom: 13px; scroll-margin-top: 16px; }
.alert-count { padding: 4px 9px; border-radius: 18px; background: var(--orange-soft); color: var(--orange); font-size: 10px; white-space: nowrap; }
.alert-row:hover { background: var(--surface-soft); }
.lower-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(260px, .9fr); gap: 13px; }
.panel { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.panel-header h2 { margin: 0; font-size: 14px; font-weight: 600; }
.panel-caption { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.panel-link { padding: 0; border: 0; background: transparent; color: var(--brand); font-size: 11px; font-weight: 600; cursor: pointer; }
.panel-link:hover { color: var(--brand-deep); }
.range-select { min-height: 32px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--muted); font-size: 11px; }
.chart-area { display: flex; align-items: end; gap: clamp(8px, 2vw, 18px); height: 180px; padding: 10px 5px 0; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent 43px, var(--line) 44px, transparent 45px); }
.chart-month { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: end; gap: 7px; min-width: 0; height: 100%; }
.chart-bars { display: flex; align-items: end; justify-content: center; gap: 4px; width: min(42px, 75%); height: 142px; }
.chart-bar { width: 42%; min-height: 5px; border-radius: 4px 4px 1px 1px; background: var(--brand); }
.chart-bar.forecast { background: #b7e7f4; }
.chart-month-label { color: var(--muted); font-size: 11px; white-space: nowrap; }
.chart-legend { display: flex; gap: 14px; margin-top: 11px; color: var(--muted); font-size: 11px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 9px; height: 9px; border-radius: 2px; background: var(--brand); }
.legend-swatch.pale { background: #b7e7f4; }
.cash-value { margin: 14px 0 2px; font-size: 25px; font-weight: 650; font-variant-numeric: tabular-nums; }
.cash-caption, .muted-text { color: var(--muted); font-size: 11px; }
.goal-row { display: flex; justify-content: space-between; gap: 8px; margin: 20px 0 8px; font-size: 11px; }
.progress-track { height: 8px; overflow: hidden; border-radius: 8px; background: var(--brand-soft); }
.progress-fill { display: block; width: 72%; height: 100%; border-radius: inherit; background: var(--brand); }
.forecast-note { margin-top: 9px; color: var(--muted); font-size: 11px; }
.stock-list { display: grid; gap: 12px; }
.stock-row { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(60px, 1.4fr) 40px; align-items: center; gap: 10px; font-size: 11px; }
.stock-name { color: var(--muted); }
.stock-track { height: 8px; overflow: hidden; border-radius: 8px; background: var(--canvas); }
.stock-track span { display: block; height: 100%; border-radius: inherit; background: var(--brand-teal); }
.stock-quantity { text-align: left; font-weight: 600; }
.task-list { display: grid; }
.task-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.task-row:last-child { padding-bottom: 0; border-bottom: 0; }
.task-icon { display: grid; place-items: center; flex: none; width: 29px; height: 29px; border-radius: 8px; color: var(--brand); background: var(--brand-soft); font-size: 14px; }
.task-copy { min-width: 0; }
.task-title { font-size: 11px; font-weight: 600; }
.task-meta { margin-top: 3px; color: var(--muted); font-size: 11px; }
.status-pill { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 20px; background: var(--brand-soft); color: var(--brand); font-size: 11px; white-space: nowrap; }
.status-pill.green { background: var(--green-soft); color: var(--green); }
.status-pill.orange { background: var(--orange-soft); color: var(--orange); }
.status-pill.red { background: var(--red-soft); color: var(--red); }
.ai-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 13px; padding: 13px 15px; border: 1px solid #c4e5f2; border-radius: 10px; background: #f1f8fc; }
.ai-banner-copy { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ai-banner-mark { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; color: var(--brand); background: var(--brand-soft); font-size: 18px; }
.ai-banner-title { font-size: 11px; font-weight: 600; }
.ai-banner-text { margin-top: 3px; color: var(--muted); font-size: 11px; }

.workflow-shortcuts { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: -5px 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.workflow-shortcuts-label { color: var(--muted); font-size: 11px; font-weight: 650; white-space: nowrap; }
.workflow-shortcuts-links { display: flex; align-items: center; flex: 1; flex-wrap: wrap; gap: 6px; }
.workflow-shortcut { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 5px 9px; border: 1px solid transparent; border-radius: 7px; background: var(--surface-soft); color: var(--ink); font-size: 11px; cursor: pointer; }
.workflow-shortcut span { color: var(--muted); }
.workflow-shortcut:hover { border-color: var(--line); background: var(--brand-soft); color: var(--brand-deep); }
.workflow-shortcut.is-current { border-color: #b6ddec; background: var(--brand-soft); color: var(--brand-deep); font-weight: 650; }
.workflow-shortcut:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.module-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 11px; }
.toolbar-start { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.view-switch { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--canvas); }
.view-switch .button { min-height: 29px; padding: 5px 9px; border-color: transparent; background: transparent; }
.view-switch .button.active { border-color: var(--line); background: var(--surface); color: var(--brand-deep); box-shadow: 0 1px 2px rgba(20, 15, 30, .05); }
.table-search { width: min(270px, 38vw); min-height: 36px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 12px; }
.table-search::placeholder { color: var(--muted); }
.table-container { overflow: hidden; padding: 0; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; min-width: 720px; border-collapse: collapse; text-align: right; }
.data-table th { padding: 12px 14px; background: var(--surface-soft); color: var(--muted); font-size: 11px; font-weight: 500; white-space: nowrap; }
.data-table td { padding: 13px 14px; border-top: 1px solid var(--line); font-size: 11px; white-space: nowrap; }
.data-table tbody tr:hover { background: #f1f8fc; }
.record-title { font-weight: 600; }
.record-id { margin-top: 3px; color: var(--muted); font-size: 11px; }
.row-open { padding: 5px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--brand); font-size: 11px; cursor: pointer; }
.row-open:hover { background: var(--brand-soft); }
.empty-state { padding: 38px 12px; color: var(--muted); font-size: 12px; text-align: center; }
.table-summary { display: flex; justify-content: space-between; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.kanban-board { display: grid; grid-auto-columns: minmax(220px, 1fr); grid-auto-flow: column; gap: 10px; overflow-x: auto; padding: 14px; }
.kanban-column { display: grid; align-content: start; gap: 8px; min-height: 200px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--canvas); }
.kanban-column > header { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 2px 1px 7px; border-bottom: 1px solid var(--line); font-size: 11px; }
.kanban-column > header span { color: var(--muted); }
.kanban-card { display: grid; gap: 5px; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-align: right; cursor: grab; box-shadow: 0 1px 2px rgba(20, 15, 30, .04); }
.kanban-card:hover { border-color: #9bd3eb; box-shadow: 0 3px 8px rgba(53, 35, 70, .08); }
.kanban-card strong { font-size: 11px; font-weight: 600; }
.kanban-card span, .kanban-card small { color: var(--muted); font-size: 10px; }
.module-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 12px; padding: 11px 13px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-deep); font-size: 11px; }
.module-note span { color: var(--brand-deep); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.settings-card { min-height: 200px; }
.settings-form { display: flex; align-items: end; gap: 9px; max-width: 500px; }
.settings-form .form-field { flex: 1; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.settings-actions label.button { cursor: pointer; }
.settings-note, .setup-hint { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.user-management { margin-top: 14px; padding: 18px; }
.user-create-form { display: grid; grid-template-columns: 1fr 1fr 1fr 1.2fr auto; align-items: end; gap: 10px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.user-create-form > .button { min-height: 39px; }
.user-create-form { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
.user-create-form > .button { grid-column: 4; }
.user-create-form select[multiple], .user-table select[multiple] { min-height: 78px; padding: 5px; }
.branch-create-form { display: flex; align-items: end; gap: 10px; max-width: 650px; margin-bottom: 14px; }
.branch-management { margin-top: 14px; padding: 18px; }
.branch-create-form .form-field { flex: 1; }
.branch-list { display: flex; flex-wrap: wrap; gap: 7px; }
.branch-chip { padding: 6px 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-soft); color: var(--ink); font-size: 11px; }
.user-table-wrap { overflow-x: auto; }
.user-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.user-table th, .user-table td { padding: 10px 9px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.user-table th { color: var(--muted); font-weight: 500; }
.user-table select { max-width: 150px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; }
.audit-log { margin-top: 14px; padding: 18px; }
.audit-count { color: var(--muted); font-size: 11px; white-space: nowrap; }
.audit-filters { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)) auto; align-items: end; gap: 9px; padding-bottom: 13px; }
.audit-filters .form-field input, .audit-filters .form-field select { min-height: 36px; padding: 7px 9px; font-size: 11px; }
.audit-search { grid-column: span 2; }
.audit-table-wrap { overflow: auto; max-height: 560px; border-top: 1px solid var(--line); }
.audit-table-wrap .user-table { min-width: 780px; }
.audit-table-wrap .user-table td { white-space: normal; vertical-align: top; }
.audit-record-id { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.audit-action { display: inline-block; padding: 3px 7px; border-radius: 12px; background: var(--surface-soft); color: var(--muted); font-size: 10px; white-space: nowrap; }
.audit-action-create { background: var(--green-soft); color: var(--green); }
.audit-action-update { background: var(--brand-soft); color: var(--brand); }
.audit-action-delete { background: #fff0ef; color: var(--red); }
.audit-change-details { min-width: 160px; margin-top: 6px; color: var(--muted); font-size: 10px; }
.audit-change-details summary { cursor: pointer; }
.audit-change-details ul { display: grid; gap: 3px; margin: 5px 0 0; padding-inline-start: 17px; }
.audit-change-details li { line-height: 1.6; overflow-wrap: anywhere; }
.audit-empty { padding: 18px !important; color: var(--muted); text-align: center !important; }
.audit-footer { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding-top: 11px; color: var(--muted); font-size: 10px; }
.user-active { display: inline-flex; align-items: center; gap: 5px; }
.user-active input { accent-color: var(--brand); }
.backup-summary { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.backup-summary strong { font-size: 25px; font-weight: 650; }
.backup-summary span { color: var(--muted); font-size: 11px; }
.settings-feedback { margin: 13px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--green-soft); color: var(--green); font-size: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.recent-list { display: grid; }
.recent-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: right; cursor: pointer; }
.recent-row:last-child { border-bottom: 0; }
.recent-row:hover strong { color: var(--brand); }
.recent-row > span:first-child { display: grid; gap: 3px; min-width: 0; }
.recent-row strong { overflow: hidden; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.recent-row small { color: var(--muted); font-size: 10px; }
.empty-panel { display: grid; justify-items: start; gap: 10px; padding: 14px 0 2px; }
.empty-panel p { margin: 0; color: var(--muted); font-size: 12px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pos-shift-panel { display: grid; gap: 10px; margin-bottom: 13px; padding: 14px; }
.pos-shift-panel .panel-header { margin-bottom: 0; }
.pos-shift-panel .detail-grid { margin-block: 3px; }
.pos-shift-panel > .button { justify-self: start; }
.pos-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr); gap: 13px; align-items: start; }
.pos-catalog, .pos-cart-panel { min-width: 0; }
.pos-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 9px; }
.pos-product { display: grid; justify-items: start; gap: 5px; min-height: 145px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); text-align: right; cursor: pointer; }
.pos-product:hover:not(:disabled) { border-color: #8ccae6; box-shadow: 0 4px 12px rgba(56, 39, 72, .08); }
.pos-product:disabled, .pos-product.unavailable { opacity: .55; cursor: not-allowed; }
.pos-product-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; color: var(--brand); background: var(--brand-soft); }
.pos-product-icon svg { width: 17px; height: 17px; stroke: currentColor; }
.pos-product strong { font-size: 11px; }
.pos-product small { color: var(--muted); font-size: 10px; }
.pos-product b { font-size: 12px; font-weight: 650; }
.pos-cart-list { display: grid; }
.pos-cart-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pos-cart-row > div:first-child { display: grid; gap: 3px; min-width: 0; }
.pos-cart-row strong { font-size: 11px; }
.pos-cart-row small { color: var(--muted); font-size: 10px; }
.quantity-control { display: inline-flex; align-items: center; gap: 5px; }
.quantity-control button { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); cursor: pointer; }
.quantity-control span { min-width: 18px; text-align: center; font-size: 11px; }
.pos-cart-empty { padding: 20px 0; color: var(--muted); font-size: 11px; text-align: center; }
.pos-customer { display: grid; gap: 9px; margin-top: 12px; }
.pos-bank-fields:not([hidden]) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; grid-column: 1 / -1; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.pos-bank-fields[hidden] { display: none; }
.pos-total { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.pos-total span { color: var(--muted); font-size: 12px; }
.pos-total strong { font-size: 20px; }
.pos-checkout { width: 100%; margin-top: 12px; }
.pos-history { margin-top: 13px; }

.dialog {
  width: min(520px, calc(100vw - 28px)); max-height: min(86vh, 760px); overflow-y: auto;
  padding: 0; border: 1px solid var(--line); border-radius: 12px; color: var(--ink);
  background: var(--surface); box-shadow: 0 25px 80px rgba(20, 15, 30, .24);
}
.dialog::backdrop { background: rgba(22, 18, 27, .44); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 13px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; font-size: 16px; font-weight: 650; }
.eyebrow { margin: 0 0 4px; color: var(--brand); font-size: 11px; font-weight: 600; }
.dialog-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.dialog-close { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; }
.dialog-close:hover { background: var(--surface-soft); color: var(--ink); }
.dialog-content { display: grid; gap: 13px; padding: 18px 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.dynamic-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.dynamic-fields .wide { grid-column: 1 / -1; }
.order-lines-field { grid-column: 1 / -1; }
.order-line-entry { display: grid; grid-template-columns: minmax(150px, 1.5fr) minmax(75px, .6fr) minmax(100px, .8fr) auto; gap: 7px; }
.order-line-entry:has([data-order-discount]) { grid-template-columns: minmax(150px, 1.4fr) minmax(70px, .55fr) minmax(96px, .75fr) minmax(70px, .45fr) auto; }
.order-line-entry input, .order-line-entry select { min-width: 0; min-height: 39px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font-size: 12px; }
.order-line-list { display: grid; gap: 6px; margin-top: 8px; }
.order-line-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.order-line-row > span { display: grid; gap: 3px; min-width: 0; }
.order-line-edit { display: grid; grid-template-columns: repeat(3, minmax(70px, 1fr)); gap: 6px; margin: 7px 0 3px; max-width: 480px; }
.order-line-edit label { display: grid; gap: 3px; min-width: 0; }
.order-line-edit label span { color: var(--muted); font-size: 10px; }
.order-line-edit input { width: 100%; min-width: 0; min-height: 31px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface); font-size: 11px; }
.order-line-row strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.order-line-row small { color: var(--muted); font-size: 10px; }
.form-field { display: grid; gap: 6px; min-width: 0; }
.form-field > span { color: var(--muted); font-size: 11px; }
.form-field input, .form-field select, .form-field textarea, .assistant-prompt input {
  width: 100%; min-height: 39px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--surface); color: var(--ink); font-size: 12px;
}
.form-field textarea { resize: vertical; }
.form-field input::placeholder, .form-field textarea::placeholder { color: #8b9bb0; }
.dialog-footer { display: flex; gap: 8px; padding: 12px 20px 18px; }
#detailActions { flex-wrap: wrap; }
.dialog-footer .dialog-spacer { flex: 1; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-statusline { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 20px; color: var(--muted); font-size: 11px; }
.detail-related { display: grid; gap: 7px; }
.detail-related h3 { margin: 3px 0 0; font-size: 12px; }
.related-link { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-align: right; cursor: pointer; }
.related-link:hover { border-color: #9bd3eb; background: var(--surface-soft); }
.related-link span { color: var(--brand); font-size: 10px; }
.related-link strong { grid-row: span 2; align-self: center; font-size: 11px; }
.related-link small { color: var(--muted); font-size: 10px; }
.journal-lines { overflow-x: auto; }
.journal-lines h3 { margin: 0 0 7px; font-size: 12px; }
.journal-lines table { width: 100%; border-collapse: collapse; font-size: 11px; }
.journal-lines th, .journal-lines td { padding: 8px 9px; border-bottom: 1px solid var(--line); text-align: right; }
.journal-lines th { color: var(--muted); font-weight: 500; }
.detail-item { padding: 11px; border-radius: 8px; background: var(--surface-soft); }
.detail-item span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; }
.detail-item strong { font-size: 12px; font-weight: 600; }
.activity-panel { display: grid; gap: 10px; padding-top: 5px; border-top: 1px solid var(--line); }
.attachments-panel { display: grid; gap: 9px; padding-top: 13px; border-top: 1px solid var(--line); }
.attachments-panel h3 { margin: 0; font-size: 12px; }
.attachment-row { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.attachment-file-icon { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 7px; background: var(--brand-soft); color: var(--brand); }
.attachment-meta { display: grid; flex: 1; min-width: 0; gap: 2px; }
.attachment-meta strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.attachment-meta small { color: var(--muted); font-size: 10px; }
.attachment-upload { display: flex; align-items: end; gap: 9px; padding-top: 4px; }
.attachment-upload .form-field { flex: 1; }
.attachment-upload input[type="file"] { padding: 6px; font-size: 10px; }
.activity-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.activity-heading h3 { margin: 0; font-size: 12px; }
.activity-heading > span { color: var(--muted); font-size: 10px; }
.activity-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 9px; }
.activity-form .form-field textarea { min-height: 58px; }
.activity-form > .button { min-height: 38px; }
.activity-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.activity-item { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 9px; padding: 9px 2px; }
.activity-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.activity-dot.is-status { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.activity-item p { margin: 0; font-size: 11px; line-height: 1.6; }
.activity-item time { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.activity-empty { margin: 0; padding: 9px; border-radius: 7px; background: var(--surface-soft); color: var(--muted); font-size: 11px; }
.assistant-dialog { width: min(500px, calc(100vw - 28px)); }
.payment-dialog { width: min(460px, calc(100vw - 28px)); }
.import-dialog { width: min(860px, calc(100vw - 28px)); }
.import-dialog #importForm { display: contents; }
.import-guide { padding: 11px 12px; border-radius: 8px; background: var(--surface-soft); }
.import-guide p { margin: 0; font-size: 12px; line-height: 1.7; }
.import-guide small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.import-preview { overflow: auto; max-height: 280px; border: 1px solid var(--line); border-radius: 8px; }
.import-preview table { width: 100%; border-collapse: collapse; font-size: 11px; }
.import-preview th, .import-preview td { padding: 8px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; }
.import-preview th { position: sticky; top: 0; background: var(--surface-soft); color: var(--muted); }
.import-preview td { max-width: 230px; overflow-wrap: anywhere; }
.import-row-valid { color: var(--green); white-space: nowrap; }
.import-row-duplicate { color: var(--orange); white-space: nowrap; }
.import-row-invalid { color: var(--red); white-space: nowrap; }
.import-summary { padding: 9px 11px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-deep); font-size: 11px; line-height: 1.7; }
.import-feedback { margin: 0; padding: 9px 11px; border-radius: 8px; background: var(--green-soft); color: var(--green); font-size: 11px; line-height: 1.6; }
.import-feedback.is-error { background: #fff0ef; color: var(--red); }
.payment-summary { margin: 0; padding: 11px 12px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-deep); font-size: 12px; line-height: 1.7; }
.payment-error { margin: 0; color: var(--red); font-size: 11px; }
.assistant-insights { display: grid; gap: 9px; padding: 16px 20px 4px; }
.assistant-insights article { display: grid; gap: 4px; padding: 11px 12px; border-radius: 8px; background: var(--surface-soft); }
.assistant-insights article > span { color: var(--brand); font-size: 11px; font-weight: 600; }
.assistant-insights article strong { font-size: 12px; font-weight: 600; }
.assistant-insights article small { color: var(--muted); font-size: 11px; line-height: 1.6; }
.assistant-prompt { display: flex; align-items: center; gap: 8px; padding: 14px 20px; }
.assistant-prompt input { flex: 1; min-width: 0; }
.assistant-response { margin: 0 20px 18px; padding: 11px 12px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-deep); font-size: 12px; }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 230px minmax(0, 1fr); }
  .sidebar { padding-inline: 11px; }
  .page-host { padding: 20px; }
  .metric-card { padding: 12px; }
  .metric-value { font-size: 19px; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .dashboard-grid { grid-template-columns: minmax(0, 1.2fr) minmax(210px, .8fr); }
  .lower-grid { grid-template-columns: 1fr; }
  .topbar { padding-inline: 16px; }
  .page-host { padding: 17px; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed; z-index: 30; inset: 0 0 0 auto; width: min(290px, 86vw); height: 100dvh;
    overflow-y: auto; border-left: 1px solid var(--line); box-shadow: 0 12px 40px rgba(31, 24, 42, .12);
    transform: translateX(110%); transition: transform .2s ease;
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; z-index: 29; inset: 0; display: block; background: rgba(22, 18, 27, .35); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .sidebar-scrim.is-open { opacity: 1; pointer-events: auto; }
  .mobile-menu { display: grid; place-items: center; }
  .topbar { justify-content: flex-start; min-height: 58px; padding: 8px 12px; }
  .breadcrumb { flex: 1; min-width: 0; }
  .topbar-tools { gap: 5px; }
  .global-search { width: min(270px, 43vw); min-width: 130px; padding: 7px 8px; }
  .global-search kbd { display: none; }
  .help-top { display: none; }
  .page-host { padding: 16px 13px; }
  .app-footer { padding: 10px 13px; }
  .sync-status { padding: 5px 7px; font-size: 9px; }
}
@media (max-width: 620px) {
  .workflow-shortcuts { align-items: flex-start; flex-direction: column; gap: 7px; padding: 10px; }
  .workflow-shortcuts-links { width: 100%; }
  .workflow-shortcut { flex: 1 1 auto; justify-content: space-between; }
  .page-heading { flex-direction: column; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric-card { padding: 11px; }
  .metric-value { font-size: 18px; }
  .dashboard-grid, .lower-grid { grid-template-columns: 1fr; }
  .chart-area { height: 155px; }
  .chart-bars { height: 118px; }
  .ai-banner { align-items: flex-start; flex-direction: column; }
  .module-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-start { display: grid; grid-template-columns: 1fr auto; }
  .table-search { width: 100%; }
  .form-row, .detail-grid { grid-template-columns: 1fr; }
  .activity-form { grid-template-columns: 1fr; }
  .attachment-upload { align-items: stretch; flex-direction: column; }
  .attachment-row { flex-wrap: wrap; }
  .attachment-meta { flex-basis: calc(100% - 42px); }
  .dynamic-fields { grid-template-columns: 1fr; }
  .order-line-entry { grid-template-columns: 1fr 1fr; }
  .order-line-entry select { grid-column: 1 / -1; }
  .order-line-entry button { grid-column: 1 / -1; }
  .order-line-edit { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; }
  .settings-grid { grid-template-columns: 1fr; }
  .user-create-form { grid-template-columns: 1fr 1fr; }
  .user-create-form > .button { grid-column: 1 / -1; }
  .branch-create-form { align-items: stretch; flex-direction: column; }
  .audit-filters { grid-template-columns: 1fr 1fr; }
  .audit-search { grid-column: 1 / -1; }
  .audit-filters > .button { min-height: 38px; }
  .settings-form { align-items: stretch; flex-direction: column; }
  .pos-layout { grid-template-columns: 1fr; }
  .app-footer { flex-direction: column; gap: 3px; }
}
@media (max-width: 380px) {
  .sync-status { display: none; }
  .global-search { min-width: 105px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Mihwar ERP 0.3: analytical dashboard and advanced list tools */
.financial-metrics { margin-top: -2px; }
.dashboard-data-note { margin: -4px 2px 13px; color: var(--muted); font-size: 10px; line-height: 1.75; }
.sales-trend-panel { margin-bottom: 13px; }
.sales-trend-chart { min-height: 188px; }
.sales-trend-chart .chart-bars { height: 145px; }
.sales-trend-chart .chart-bar { display: block; background: linear-gradient(180deg, var(--brand-cyan), var(--brand)); transition: height .25s ease; }
.module-toolbar-advanced { align-items: flex-end; }
.module-toolbar-advanced .toolbar-start { min-width: 240px; }
.table-date-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 7px; }
.table-date-filters label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.table-date-filters input, .page-size-label select, .saved-view-select { min-height: 32px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font: inherit; font-size: 11px; }
.toolbar-actions { align-items: center; }
.table-sort { display: inline-flex; align-items: center; gap: 4px; padding: 4px 2px; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 650; cursor: pointer; white-space: nowrap; }
.table-sort:hover { color: var(--brand); }
.table-sort span { color: var(--brand); }
.table-pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 12px 2px 0; color: var(--muted); font-size: 11px; }
.table-pagination .button { min-height: 30px; padding: 5px 10px; }
.table-pagination .button:disabled { opacity: .45; cursor: not-allowed; }
.page-size-label { display: inline-flex; align-items: center; gap: 6px; }
.table-summary [data-range-summary] { color: var(--muted); }
@media (max-width: 900px) {
  .module-toolbar-advanced { align-items: stretch; }
  .table-date-filters { order: 3; }
  .toolbar-actions { flex-wrap: wrap; }
}
@media (max-width: 620px) {
  .table-date-filters { display: grid; grid-template-columns: 1fr 1fr; }
  .table-date-filters label { min-width: 0; }
  .table-date-filters input { width: 100%; min-width: 0; }
  .table-pagination { justify-content: space-between; }
  .saved-view-select { flex: 1; }
  .sales-trend-chart { gap: 7px; }
}
.system-health-card #systemHealthResult[data-health="ok"] { color: var(--green); }
.system-health-card #systemHealthResult[data-health="warning"] { color: var(--red); }
.system-health-card [data-system-health]:disabled { opacity: .6; cursor: wait; }

/* Mihwar ERP 0.6 — Phase 2: professional workspace UX */
.global-search-wrap { position: relative; flex: none; width: min(280px, 27vw); min-width: 180px; }
.global-search-wrap .global-search { width: 100%; min-width: 0; }
.search-suggestions { position: absolute; z-index: 90; top: calc(100% + 7px); inset-inline: 0; max-height: min(460px, 65vh); overflow: auto; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 16px 44px rgba(25, 18, 34, .18); }
.search-suggestions[hidden] { display: none !important; }
.search-suggestion { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 8px 9px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: right; cursor: pointer; }
.search-suggestion:hover, .search-suggestion.is-active { background: var(--brand-soft); }
.search-suggestion-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--surface-soft); color: var(--brand); }
.search-suggestion-icon svg { width: 17px; height: 17px; stroke: currentColor; }
.search-suggestion-copy { display: grid; flex: 1; min-width: 0; gap: 4px; }
.search-suggestion-copy strong { overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.search-suggestion-copy small, .search-suggestion-status { color: var(--muted); font-size: 10px; }
.search-suggestion-status { flex: none; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-suggestion-empty { padding: 16px 12px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.sidebar-toggle { display: grid; }
.favorite-toggle { color: var(--brand-deep); }
.favorite-toggle[aria-pressed="true"] { background: var(--brand-soft); border-color: #9fdaf0; }
.nav-shortcut-label { margin-top: 2px; border-top: 1px solid var(--line); }
.calendar-view { padding: 16px; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.calendar-toolbar h2 { margin: 0; font-size: 17px; }
.calendar-toolbar p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.calendar-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.calendar-nav .button { min-height: 32px; padding: 6px 10px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.calendar-weekday { padding: 10px 5px; background: var(--surface-soft); color: var(--muted); font-size: 10px; font-weight: 650; text-align: center; }
.calendar-day { display: flex; flex-direction: column; gap: 7px; min-height: 110px; min-width: 0; padding: 7px; background: var(--surface); }
.calendar-day.is-empty { background: var(--surface-soft); }
.calendar-day-number { align-self: flex-start; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: var(--muted); font-size: 11px; }
.calendar-events { display: grid; align-content: start; gap: 4px; min-width: 0; }
.calendar-event { display: grid; gap: 2px; width: 100%; min-width: 0; padding: 5px 6px; border: 0; border-radius: 5px; background: var(--brand-soft); color: var(--brand-deep); text-align: right; cursor: pointer; }
.calendar-event:hover { filter: brightness(.97); outline: 1px solid var(--brand); }
.calendar-event span { overflow: hidden; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event small { color: var(--muted); font-size: 9px; }
.calendar-more { color: var(--muted); font-size: 9px; }
.calendar-empty { display: grid; gap: 6px; margin-bottom: 13px; color: var(--muted); font-size: 11px; }
.calendar-empty strong { color: var(--ink); font-size: 12px; }
.calendar-grid-empty { margin-top: 6px; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf5ff;
  --muted: #a8bdd4;
  --canvas: #0d152b;
  --surface: #121d38;
  --surface-soft: #1a2a48;
  --line: #2c4366;
  --brand: #29abe2;
  --brand-hover: #0071bc;
  --brand-deep: #82dcf5;
  --brand-soft: #1d3b58;
  --brand-cyan: #29abe2;
  --brand-teal: #00c3b3;
  --focus-ring: #29abe2;
  --accent: #29abe2;
  --green: #58d5c5;
  --green-soft: #193d43;
  --orange: #f2bf7c;
  --orange-soft: #423325;
  --red: #ff979a;
  --red-soft: #422932;
  --border-strong: #526b8d;
  --line-strong: #526b8d;
}
:root[data-theme="dark"] .auth-screen { background: radial-gradient(circle at 18% 14%, #1a3150 0, transparent 34%), var(--canvas); }
:root[data-theme="dark"] .app-notice { border-color: var(--line); background: var(--surface); color: var(--brand-deep); }
:root[data-theme="dark"] .assistant-shortcut, :root[data-theme="dark"] .ai-banner { border-color: var(--line); background: var(--surface-soft); }
:root[data-theme="dark"] .user-avatar { color: var(--brand-deep); background: var(--brand-soft); }
:root[data-theme="dark"] .data-table tbody tr:hover { background: #203453; }
:root[data-theme="dark"] .kanban-card:hover { border-color: var(--brand); }
:root[data-theme="dark"] .import-feedback.is-error, :root[data-theme="dark"] .audit-action-delete { background: var(--red-soft); color: var(--red); }
:root[data-theme="dark"] .payment-error { color: var(--red); }
:root[data-theme="dark"] .sync-status { border-color: #285a55; }
:root[data-theme="dark"] .sync-status[data-state="saving"] { border-color: #665236; }
:root[data-theme="dark"] .sync-status[data-state="error"] { border-color: #6b3742; }
:root[data-theme="dark"] .calendar-event:hover { filter: brightness(1.1); }

/* 1.9.53 — systematic dark-theme contrast fixes for legacy components. */
:root[data-theme="dark"] .app-notice { border-color: var(--line); background: var(--surface); color: var(--ink); }
:root[data-theme="dark"] .assistant-shortcut,
:root[data-theme="dark"] .ai-banner { border-color: var(--line); background: var(--surface-soft); color: var(--ink); }
:root[data-theme="dark"] .assistant-shortcut small,
:root[data-theme="dark"] .ai-banner small { color: var(--muted); }
:root[data-theme="dark"] .user-avatar { color: var(--brand-deep); background: var(--brand-soft); }
:root[data-theme="dark"] .breadcrumb-separator { color: var(--muted); }
:root[data-theme="dark"] .form-field input::placeholder,
:root[data-theme="dark"] .form-field textarea::placeholder { color: #9bb0c9; opacity: 1; }
:root[data-theme="dark"] .audit-action-delete,
:root[data-theme="dark"] .import-feedback.is-error { border-color: #70414b; background: var(--red-soft); color: var(--red); }
:root[data-theme="dark"] .workflow-progress-step.is-complete .workflow-progress-marker { background: #17483d; color: #a4f0ce; }
:root[data-theme="dark"] .operational-pulse-card.has-items .operational-pulse-count { color: var(--orange); }
:root[data-theme="dark"] .operational-pulse-card.is-clear .operational-pulse-count { color: var(--green); }
:root[data-theme="dark"] .operational-pulse-status.is-urgent { border: 1px solid #74414a; color: #ffb3b5; background: #482a34; }
:root[data-theme="dark"] .operational-pulse-status.is-clear { border: 1px solid #286457; color: #9aeadb; background: #173e3b; }
:root[data-theme="dark"] .invoice-stock-badge.is-available { color: #a4f0ce; background: #17483d; border-color: #286b59; }
:root[data-theme="dark"] .invoice-stock-badge.is-unavailable { color: #ffb3b5; background: #482a34; border-color: #74414a; }
:root[data-theme="dark"] .invoice-stock-badge.is-service { color: #b8d4ff; background: #203d68; border-color: #315c91; }
:root[data-theme="dark"] .danger-text { color: #ff9da3 !important; }
:root[data-theme="dark"] .app-mode-toggle,
:root[data-theme="dark"] .app-mode-toggle[data-current-mode="simple"] { color: #071a2b !important; border-color: var(--brand-cyan) !important; background: var(--brand-cyan) !important; }
:root[data-theme="dark"] .app-mode-toggle:hover,
:root[data-theme="dark"] .app-mode-toggle:focus-visible { color: #071a2b !important; border-color: #59c8f0 !important; background: #59c8f0 !important; }
:root[data-theme="dark"] .app-mode-toggle-icon,
:root[data-theme="dark"] .app-mode-toggle-label { color: inherit !important; }
:root[data-theme="dark"] .search-suggestion-icon { color: var(--brand-cyan); background: var(--surface-soft); }
:root[data-theme="dark"] .workflow-progress-step.is-current .workflow-progress-marker { color: #071a2b; }
:root[data-theme="dark"] .simple-home-action.is-sale { color: #fff; background: #075a91; border-color: #1689c6; }
:root[data-theme="dark"] .simple-home-action.is-invoices { color: #fff; background: #30277f; border-color: #635ac0; }

/* English mode uses a true LTR application shell while keeping customer data untouched. */
html[data-language="en"] body { direction: ltr; }
html[data-language="en"] .sidebar { border-left: 0; border-right: 1px solid var(--line); }
html[data-language="en"] .brand,
html[data-language="en"] .company-switch,
html[data-language="en"] .assistant-shortcut,
html[data-language="en"] .nav-item { direction: ltr; text-align: left; }
html[data-language="en"] .nav-item .nav-text,
html[data-language="en"] .company-copy,
html[data-language="en"] .assistant-shortcut span:last-child { text-align: left; }
html[data-language="en"] .breadcrumb { direction: ltr; }
html[data-language="en"] .page-heading,
html[data-language="en"] .module-context-line,
html[data-language="en"] .module-title-lockup { direction: ltr; }
html[data-language="en"] .settings-center-nav button,
html[data-language="en"] .settings-center-search,
html[data-language="en"] .settings-form-section,
html[data-language="en"] .form-field { text-align: left; }
html[data-language="en"] .settings-center-nav button { direction: ltr; }
html[data-language="en"] .data-table { direction: ltr; }
html[data-language="en"] .data-table th,
html[data-language="en"] .data-table td { text-align: left; }
html[data-language="en"] .module-page-heading,
html[data-language="en"] .module-toolbar,
html[data-language="en"] .module-records-heading { direction: ltr; }
html[data-language="en"] .module-search-field,
html[data-language="en"] .global-search { direction: ltr; }
html[data-language="en"] input:not([type="number"]):not([type="date"]),
html[data-language="en"] textarea,
html[data-language="en"] select { text-align: start; }
:root[data-theme="dark"][data-language="en"] .settings-center-nav button.is-active { color: var(--brand-cyan); }

@media (min-width: 761px) {
  .app-shell { transition: grid-template-columns .2s ease; }
  .app-shell.sidebar-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar-collapsed .sidebar { padding-inline: 9px; }
  .sidebar-collapsed .brand { justify-content: center; padding-inline: 0; }
  .sidebar-collapsed .brand-copy, .sidebar-collapsed .company-copy, .sidebar-collapsed .chevron,
  .sidebar-collapsed .nav-text, .sidebar-collapsed .nav-section-label,
  .sidebar-collapsed .assistant-shortcut span:last-child, .sidebar-collapsed .account-user > span:nth-child(2),
  .sidebar-collapsed .user-menu { display: none !important; }
  .sidebar-collapsed .company-switch { justify-content: center; padding-inline: 0; }
  .sidebar-collapsed .nav-item { justify-content: center; padding-inline: 0; }
  .sidebar-collapsed .nav-icon { width: 25px; height: 25px; }
  .sidebar-collapsed .assistant-shortcut { justify-content: center; padding: 8px; }
  .sidebar-collapsed .account-user { justify-content: center; padding-inline: 0; }
}
@media (max-width: 760px) {
  .sidebar-toggle { display: none; }
  .global-search-wrap { width: min(270px, 43vw); min-width: 130px; }
  .global-search-wrap .global-search { width: 100%; min-width: 0; }
  .search-suggestions { position: fixed; top: 62px; inset-inline: 12px; max-height: 60vh; }
}
@media (max-width: 620px) {
  .calendar-view { padding: 9px; }
  .calendar-day { min-height: 76px; padding: 4px; }
  .calendar-day-number { width: 21px; height: 21px; font-size: 10px; }
  .calendar-event { padding: 4px; }
  .calendar-event span { font-size: 9px; }
  .calendar-event small, .calendar-more { display: none; }
  .calendar-weekday { font-size: 9px; padding: 8px 2px; }
  .calendar-grid { grid-template-columns: repeat(7, minmax(30px, 1fr)); overflow-x: auto; }
  .calendar-nav { width: 100%; }
  .calendar-nav .button { flex: 1; }
  .global-search-wrap { flex: 1; min-width: 0; width: auto; }
  .theme-toggle { flex: none; }
}
@media print {
  body, :root { color-scheme: light; --ink: #111; --muted: #555; --canvas: #fff; --surface: #fff; --surface-soft: #f6f6f6; --line: #ddd; }
  .sidebar, .sidebar-scrim, .topbar, .app-footer, .app-notice, .heading-actions, .toolbar-actions, .toolbar-start, .table-date-filters, .table-pagination, [data-pagination], [data-print-view] { display: none !important; }
  .app-shell { display: block !important; min-height: 0; }
  .main-area { display: block; }
  .page-host { max-width: none; padding: 0; margin: 0; }
  .page-heading { margin-bottom: 10px; }
  .page-heading h1 { font-size: 18pt; }
  .page-subtitle { font-size: 9pt; }
  .panel, .table-container { border: 0 !important; box-shadow: none !important; background: #fff !important; }
  .table-scroll { display: block !important; overflow: visible !important; }
  .data-table { min-width: 0 !important; width: 100% !important; }
  .data-table th, .data-table td { padding: 5px 6px; font-size: 8pt; white-space: normal; }
  .calendar-view { break-inside: avoid; }
  .calendar-grid { gap: 1px; }
  .calendar-day { min-height: 72px; }
  .calendar-event { border: 1px solid #ddd; background: #f7f7f7 !important; color: #111 !important; }
  button { print-color-adjust: exact; }
}

:root[data-theme="dark"] .button-primary { color: #10162d; border-color: var(--brand-cyan); background: var(--brand-cyan); }
:root[data-theme="dark"] .button-primary:hover { color: #fff; border-color: var(--brand-hover); background: var(--brand-hover); }
:root[data-theme="dark"] .workflow-progress-step.is-current .workflow-progress-marker { color: #10162d; }
:root[data-theme="dark"] .brand-mark { background: transparent; }
:root[data-theme="dark"] .search-suggestion-icon { background: #1a3150; }

/* Phase 2 refinement: configurable table columns and print-friendly lists */
.column-picker { position: relative; display: inline-flex; flex: none; }
.column-picker > summary { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 7px 10px; list-style: none; cursor: pointer; }
.column-picker > summary::-webkit-details-marker { display: none; }
.column-picker > summary::marker { content: ""; }
.column-picker[open] > summary { border-color: var(--brand); background: var(--brand-soft); }
.column-picker-popover { position: absolute; z-index: 80; inset-inline-end: 0; top: calc(100% + 6px); display: grid; gap: 9px; min-width: 180px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); box-shadow: 0 14px 34px rgba(18, 12, 24, .16); }
.column-picker-popover label { display: flex; align-items: center; gap: 8px; min-height: 24px; color: var(--ink); font-size: 11px; cursor: pointer; }
.column-picker-popover input[type="checkbox"] { accent-color: var(--brand); }
.data-table [hidden] { display: none !important; }
@media (max-width: 620px) {
  .column-picker-popover { position: fixed; top: auto; inset-inline: 12px; bottom: 12px; min-width: 0; padding: 16px; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(10, 8, 13, .22), 0 14px 34px rgba(18, 12, 24, .20); }
  .column-picker-popover label { min-height: 32px; }
}
@media print {
  .column-picker { display: none !important; }
  .data-table [hidden] { display: none !important; }
  .data-table thead { display: table-header-group; }
  .data-table tr { break-inside: avoid; }
}


/* Stage 3: transactional progress for sales, purchasing and invoice settlement */
.workflow-progress {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-muted, var(--surface));
}
.workflow-progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.workflow-progress-heading h3 { margin: 0; font-size: 13px; }
.workflow-progress-heading span { color: var(--muted); font-size: 11px; }
.workflow-progress-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.workflow-progress-step {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  padding: 8px 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card, var(--surface));
}
.workflow-progress-marker {
  display: inline-flex;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.workflow-progress-label { min-width: 0; font-size: 11px; line-height: 1.45; }
.workflow-progress-step.is-complete .workflow-progress-marker { background: #d9f4e6; color: #11633e; }
.workflow-progress-step.is-current { border-color: var(--accent, var(--brand)); background: color-mix(in srgb, var(--accent, var(--brand)) 7%, var(--surface)); }
.workflow-progress-step.is-current .workflow-progress-marker { background: var(--accent, var(--brand)); color: #fff; }
@media (max-width: 760px) {
  .workflow-progress-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-progress-step:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media print {
  .workflow-progress { break-inside: avoid; }
}

/* Import bank statement workflows */
.bank-import-row{display:grid;grid-template-columns:minmax(180px,2fr) minmax(160px,1fr) auto auto;gap:12px;align-items:end;margin:16px 0;padding:14px;border:1px solid var(--border-color,var(--line));border-radius:12px;background:var(--surface-subtle,var(--surface-soft))}
.bank-import-row .form-field{margin:0;min-width:0}
@media(max-width:850px){.bank-import-row{grid-template-columns:1fr 1fr}.bank-import-row button{width:100%}}
@media(max-width:520px){.bank-import-row{grid-template-columns:1fr}}

/* Phase 7 — live sales and collection analytics */
.sales-analytics-panel { margin-bottom: 13px; }
.sales-analytics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sales-analytics-card { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.sales-analytics-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.sales-analytics-value { display: block; margin: 12px 0 6px; font-size: 22px; line-height: 1.25; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sales-analytics-card p { min-height: 34px; margin: 0 0 10px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.sales-analytics-card .panel-link { margin-top: 8px; }
.sales-analytics-value.is-positive { color: var(--green); }
.sales-analytics-value.is-negative, .sales-analytics-value.is-attention { color: var(--orange); }
.sales-analytics-progress { height: 6px; margin: 8px 0 4px; overflow: hidden; border-radius: 999px; background: var(--line); }
.sales-analytics-progress span { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width .25s ease; }
.sales-analytics-summary { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.sales-analytics-summary span { display: inline-flex; align-items: baseline; gap: 5px; }
.sales-analytics-summary strong { color: var(--ink); font-weight: 700; }
.analytics-period { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
@media (max-width: 900px) {
  .sales-analytics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .sales-analytics-grid { grid-template-columns: 1fr; }
  .sales-analytics-value { font-size: 20px; }
  .sales-analytics-card p { min-height: 0; }
  .analytics-period { display: none; }
}


/* 1.9.13 — focused usability, responsive polish, and keyboard accessibility */
.skip-link { position: fixed; z-index: 200; top: 10px; right: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); box-shadow: 0 8px 24px rgba(25, 18, 34, .14); transform: translateY(-160%); transition: transform .16s ease; }
.skip-link:focus { transform: translateY(0); outline: 3px solid var(--focus-ring); outline-offset: 2px; }
:where(button, input, select, textarea, a) { scroll-margin-block: 18px; }
:where(input, select, textarea):focus-visible { border-color: var(--brand); }
:where(button, .button, .top-icon, .nav-item) { -webkit-tap-highlight-color: transparent; }
.button, .top-icon, .nav-item, .row-open { transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease; }
.button:active:not(:disabled) { transform: translateY(1px); }
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); }
.data-table th { position: sticky; top: 0; z-index: 2; }
.data-table tbody tr:focus-within { background: var(--brand-soft); }
.panel, .metric-card, .settings-card { box-shadow: 0 1px 2px rgba(24, 18, 32, .025); }
.form-field input:disabled, .form-field select:disabled, .form-field textarea:disabled { cursor: not-allowed; opacity: .7; }
::selection { background: var(--brand-soft); color: var(--brand-deep); }
@media (hover: hover) {
  .panel:hover, .metric-card:hover { border-color: color-mix(in srgb, var(--brand) 18%, var(--line)); }
  .button:hover:not(:disabled) { box-shadow: 0 3px 10px rgba(45, 30, 62, .07); }
}
@media (max-width: 760px) {
  .topbar { position: sticky; top: 0; }
  .data-table th { position: static; }
  .panel { padding: 13px; }
  .dialog { width: min(100% - 16px, 680px); max-height: calc(100dvh - 16px); }
  .dialog-content { padding: 14px; }
  .dialog-footer { padding: 10px 14px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .skip-link, .button, .top-icon, .nav-item, .row-open { transition: none !important; }
}


/* 1.9.15 — readable, permission-aware document journey */
.document-journey {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--surface), var(--surface-soft));
}
.document-journey-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.document-journey-heading h3 { margin: 0; font-size: 15px; }
.document-journey-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.document-journey-count {
  display: inline-grid;
  min-width: 30px;
  height: 30px;
  place-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--brand-deep);
  background: var(--brand-soft);
  font-weight: 700;
}
.document-journey-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.document-journey-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  align-items: start;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-align: right;
  cursor: pointer;
  transition: border-color .16s ease, transform .16s ease;
}
.document-journey-item:hover { border-color: var(--brand); transform: translateY(-1px); }
.document-journey-kind { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.document-journey-item strong { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.document-journey-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; grid-column: 1 / -1; }
.document-journey-meta small { color: var(--muted); font-size: 11px; }
.document-journey-arrow { position: absolute; left: 12px; top: 12px; color: var(--brand); font-size: 16px; }
.document-journey-item:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
@media (max-width: 760px) {
  .document-journey { padding: 12px; }
  .document-journey-list { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .document-journey-item { transition: none !important; }
}


/* 1.9.16 — operational pulse */
.operational-pulse { margin: 18px 0; }
.operational-pulse-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.operational-pulse-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 13px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  text-align: right;
  cursor: pointer;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.operational-pulse-card:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(30, 20, 40, .07);
}
.operational-pulse-card:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.operational-pulse-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--brand-deep);
  background: var(--brand-soft);
}
.operational-pulse-copy { display: grid; gap: 4px; min-width: 0; }
.operational-pulse-copy strong { font-size: 12px; overflow-wrap: anywhere; }
.operational-pulse-copy small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.operational-pulse-count { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }
.operational-pulse-card.has-items .operational-pulse-count { color: #b45309; }
.operational-pulse-card.is-clear .operational-pulse-count { color: #15803d; }
.operational-pulse-status {
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.operational-pulse-status.is-urgent { color: #991b1b; background: #fee2e2; }
.operational-pulse-status.is-clear { color: #166534; background: #dcfce7; }
@media (max-width: 1120px) {
  .operational-pulse-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .operational-pulse-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operational-pulse-card { grid-template-columns: auto minmax(0, 1fr); }
  .operational-pulse-count { grid-column: 2; font-size: 17px; }
}
@media (max-width: 420px) {
  .operational-pulse-grid { grid-template-columns: minmax(0, 1fr); }
  .operational-pulse-card { grid-template-columns: auto minmax(0, 1fr) auto; }
  .operational-pulse-count { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .operational-pulse-card { transition: none !important; }
}


/* 1.9.17 — Odoo-inspired sales invoice editor */
.invoice-line-items-field > span { display: block; margin-bottom: 10px; font-weight: 700; }
.invoice-line-items-field .order-line-entry {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}
.invoice-line-items-field .order-line-list { margin-top: 10px; }
.invoice-line-items-field .order-line-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.invoice-totals {
  display: grid;
  gap: 8px;
  max-width: 360px;
  margin: 14px 0 0 auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.invoice-totals > div { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 13px; }
.invoice-totals strong { color: var(--text, inherit); font-variant-numeric: tabular-nums; }
.invoice-totals .invoice-grand-total { padding-top: 10px; border-top: 1px solid var(--line); color: var(--text, inherit); font-weight: 800; font-size: 15px; }
.invoice-totals .invoice-grand-total strong { color: var(--brand-deep); font-size: 19px; }
.invoice-line-items-field[hidden] { display: none !important; }
@media (max-width: 620px) {
  .invoice-totals { max-width: none; }
  .invoice-line-items-field .order-line-entry { padding: 9px; }
}


/* واجهة مستندات المبيعات مستوحاة من تخطيط Odoo: نموذج واسع، مراحل، وبنود واضحة */
#recordDialog.odoo-document-dialog {
  width: min(1480px, calc(100vw - 34px));
  max-width: calc(100vw - 34px);
  max-height: calc(100dvh - 28px);
  border-radius: 5px;
  border-color: var(--line);
  box-shadow: 0 22px 70px rgba(10, 12, 20, .32);
}
#recordDialog.odoo-document-dialog #recordForm { min-height: min(780px, calc(100dvh - 30px)); }
#recordDialog.odoo-document-dialog .dialog-header {
  align-items: center; padding: 16px 24px 13px; background: var(--surface);
}
#recordDialog.odoo-document-dialog .dialog-header h2 { font-size: 25px; font-weight: 720; letter-spacing: -.3px; }
#recordDialog.odoo-document-dialog .dialog-header .eyebrow { font-size: 11px; }
.odoo-document-ribbon {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 10px 24px; border-bottom: 1px solid var(--line); background: var(--surface-soft);
}
.odoo-document-ribbon-title { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.odoo-doc-kicker { color: var(--muted); font-size: 11px; }
.odoo-doc-stage { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.odoo-doc-stage span { padding: 8px 13px; color: var(--muted); font-size: 11px; }
.odoo-doc-stage span.is-current { color: var(--brand); background: var(--brand-soft); font-weight: 750; box-shadow: inset 0 -2px var(--brand); }
.odoo-doc-stage i { color: var(--muted); font-size: 16px; font-style: normal; }
.odoo-doc-reference { color: var(--muted); font-size: 10px; }
#recordDialog.odoo-document-dialog .dialog-content { padding: 23px 28px 25px; gap: 18px; }
#recordDialog.odoo-document-dialog .dialog-content > .form-field:first-child { max-width: 520px; }
#recordDialog.odoo-document-dialog .dialog-content > .form-row { grid-template-columns: minmax(260px, 1.35fr) minmax(200px, .65fr); gap: 24px; }
#recordDialog.odoo-document-dialog .dynamic-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px 22px; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
#recordDialog.odoo-document-dialog .dynamic-fields .wide,
#recordDialog.odoo-document-dialog .dynamic-fields .order-lines-field { grid-column: 1 / -1; }
#recordDialog.odoo-document-dialog .form-field > span { color: var(--ink); font-size: 11px; font-weight: 650; }
#recordDialog.odoo-document-dialog .form-field input,
#recordDialog.odoo-document-dialog .form-field select,
#recordDialog.odoo-document-dialog .form-field textarea { border-radius: 3px; border-color: transparent; border-bottom-color: var(--line); background: transparent; min-height: 37px; }
#recordDialog.odoo-document-dialog .form-field input:focus,
#recordDialog.odoo-document-dialog .form-field select:focus,
#recordDialog.odoo-document-dialog .form-field textarea:focus { border-color: var(--brand); background: var(--surface); outline: 1px solid color-mix(in srgb, var(--brand) 16%, transparent); }
#recordDialog.odoo-document-dialog .order-lines-field > span { display: block; margin-bottom: 10px; font-size: 15px; }
#recordDialog.odoo-document-dialog .order-line-entry { grid-template-columns: minmax(200px, 2fr) minmax(75px, .65fr) minmax(105px, .85fr) minmax(75px, .55fr) auto; gap: 8px; }
#recordDialog.odoo-document-dialog .order-line-entry input,
#recordDialog.odoo-document-dialog .order-line-entry select { border-radius: 3px; background: var(--surface); }
#recordDialog.odoo-document-dialog .order-line-list { margin-top: 12px; gap: 0; border-top: 1px solid var(--line); }
#recordDialog.odoo-document-dialog .order-line-row { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 13px 8px; }
#recordDialog.odoo-document-dialog .dialog-footer { position: sticky; bottom: 0; z-index: 2; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface); }
#recordDialog.odoo-document-dialog .dialog-footer .button-primary { min-width: 130px; }
@media (max-width: 900px) {
  #recordDialog.odoo-document-dialog { width: calc(100vw - 12px); max-width: calc(100vw - 12px); max-height: calc(100dvh - 12px); }
  #recordDialog.odoo-document-dialog .dialog-content { padding: 16px; }
  #recordDialog.odoo-document-dialog .dynamic-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #recordDialog.odoo-document-dialog .order-line-entry { grid-template-columns: minmax(0, 1fr) minmax(72px, .45fr); }
  #recordDialog.odoo-document-dialog .dialog-content > .form-row { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 560px) {
  #recordDialog.odoo-document-dialog .dynamic-fields { grid-template-columns: 1fr; }
  #recordDialog.odoo-document-dialog .dynamic-fields .wide,
  #recordDialog.odoo-document-dialog .dynamic-fields .order-lines-field { grid-column: auto; }
  .odoo-document-ribbon { padding: 10px 14px; }
  .odoo-document-ribbon-title { gap: 9px; }
  .odoo-doc-stage span { padding: 7px 8px; font-size: 10px; }
}

/* Navigation tree: compact grouped modules */
.nav-tree-heading { display:flex; align-items:center; gap:8px; width:100%; min-height:35px; margin:5px 0 2px; padding:7px 10px; border:0; border-radius:8px; background:transparent; color:var(--muted); text-align:start; font:inherit; font-size:11px; font-weight:700; cursor:pointer; }
.nav-tree-heading:hover, .nav-tree-heading.is-expanded { color:var(--ink); background:var(--surface-soft); }
.nav-tree-caret { display:inline-flex; width:12px; justify-content:center; color:var(--brand); font-size:13px; }
.nav-tree-count { margin-inline-start:auto; padding:1px 6px; border-radius:10px; background:var(--surface-soft); font-size:10px; font-weight:500; }
.nav-tree-children { margin-inline-start:8px; padding-inline-start:7px; border-inline-start:1px solid var(--line); }
.nav-tree-children .nav-item { min-height:34px; margin:1px 0; padding-block:6px; font-size:12px; }
.sidebar-collapsed .nav-tree-heading { justify-content:center; padding-inline:0; }
.sidebar-collapsed .nav-tree-heading span:not(.nav-tree-caret) { display:none; }
.sidebar-collapsed .nav-tree-children { margin-inline-start:0; padding-inline-start:0; border:0; }
.product-search-link { display:inline-flex; margin-top:7px; padding:5px 2px; border:0; background:transparent; color:var(--brand); font:inherit; font-size:12px; cursor:pointer; }
.product-search-link:hover { text-decoration:underline; }
.product-picker-dialog { width:min(1040px, calc(100vw - 28px)); max-width:1040px; max-height:min(86vh, 900px); padding:0; overflow:hidden; }
.product-picker-dialog::backdrop { background:rgba(10,12,18,.62); backdrop-filter:blur(2px); }
.product-picker-header { padding:20px 24px 15px; }
.product-picker-header .dialog-subtitle { margin:6px 0 0; color:var(--muted); font-size:12px; }
.product-picker-toolbar { display:flex; align-items:center; gap:14px; justify-content:space-between; padding:13px 22px; border-block:1px solid var(--line); background:var(--surface-soft); }
.product-picker-search { display:flex; align-items:center; gap:10px; flex:1; max-width:620px; min-height:40px; padding:0 12px; border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--muted); }
.product-picker-search input { width:100%; min-width:0; border:0; outline:0; background:transparent; color:var(--ink); font:inherit; font-size:13px; }
.product-picker-count { white-space:nowrap; color:var(--brand); font-size:12px; font-weight:700; }
.product-picker-table-wrap { max-height:55vh; overflow:auto; }
.product-picker-table { width:100%; border-collapse:collapse; font-size:12px; }
.product-picker-table th, .product-picker-table td { padding:10px 14px; border-bottom:1px solid var(--line); text-align:start; white-space:nowrap; }
.product-picker-table th { position:sticky; top:0; z-index:1; background:var(--surface); color:var(--muted); font-weight:700; }
.product-picker-table td:first-child, .product-picker-table th:first-child { width:70px; text-align:center; }
.product-picker-table td:nth-child(2) { white-space:normal; min-width:220px; }
.product-picker-table td:nth-child(2) strong, .product-picker-table td:nth-child(2) small { display:block; }
.product-picker-table td:nth-child(2) small { margin-top:3px; color:var(--muted); font-size:10px; }
.product-picker-table tbody tr:hover { background:var(--surface-soft); }
.product-picker-table input[type=checkbox] { width:16px; height:16px; accent-color:var(--brand); cursor:pointer; }
.product-picker-empty { padding:35px!important; text-align:center!important; color:var(--muted); }
.product-picker-dialog .dialog-footer { position:sticky; bottom:0; padding:13px 22px; border-top:1px solid var(--line); background:var(--surface); }
@media (max-width:700px) { .product-picker-toolbar { align-items:stretch; flex-direction:column; } .product-picker-table-wrap { overflow:auto; } .product-picker-table { min-width:700px; } }

/* Simple / professional workspace mode switch and simplified daily-work home */
.app-mode-toggle {
  flex: 0 0 auto;
  min-height: 34px;
  gap: 7px;
  padding: 7px 11px;
  border-color: color-mix(in srgb, var(--brand) 24%, var(--line));
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 11px;
}
.app-mode-toggle:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); }
.app-mode-toggle-icon { display: inline-grid; place-items: center; font-size: 15px; line-height: 1; }
.app-mode-toggle-label { white-space: nowrap; }
:root[data-theme="dark"] .app-mode-toggle { color: var(--brand-cyan); border-color: color-mix(in srgb, var(--brand-cyan) 38%, var(--line)); }
:root[data-theme="dark"] .app-mode-toggle:hover { color: #fff; background: var(--brand-soft); }
.app-shell.simple-mode { grid-template-columns: 226px minmax(0, 1fr); }
.app-shell.simple-mode .sidebar { padding-inline: 13px; }
.simple-mode .brand { margin-bottom: 13px; }
.simple-mode .company-switch { margin-bottom: 10px; }
.simple-mode .nav-tree-heading { min-height: 32px; margin-block: 3px 1px; padding-block: 5px; }
.simple-mode .nav-tree-children .nav-item { min-height: 33px; }
.simple-mode .assistant-shortcut { display: none; }
.simple-nav-heading { font-size: 12px; }
.simple-nav-children { padding-inline-start: 5px; }
.simple-mode.sidebar-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
.simple-mode .page-host { max-width: 1380px; }
.simple-welcome {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  margin-bottom: 18px; padding: 24px 26px; border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(115deg, var(--surface) 0%, var(--brand-soft) 100%);
}
.simple-welcome-copy { min-width: 0; }
.simple-mode-label { display: inline-flex; align-items: center; margin-bottom: 7px; padding: 4px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-deep); font-size: 10px; font-weight: 750; }
:root[data-theme="dark"] .simple-mode-label { color: var(--brand-cyan); }
.simple-welcome h1 { margin: 0; font-size: clamp(23px, 2.2vw, 31px); line-height: 1.35; font-weight: 760; }
.simple-welcome p { margin: 7px 0 8px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.simple-welcome small { color: var(--muted); font-size: 11px; }
.simple-primary-cta { min-height: 48px; padding-inline: 22px; border-radius: 10px; font-size: 14px; }
.simple-stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-bottom: 19px; }
.simple-stat { display: flex; align-items: flex-start; gap: 11px; min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.simple-stat-icon { display: grid; place-items: center; flex: 0 0 35px; width: 35px; height: 35px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); }
.simple-stat-icon svg { width: 19px; height: 19px; stroke: currentColor; }
.simple-stat-copy { display: grid; gap: 4px; min-width: 0; }
.simple-stat-copy small { color: var(--muted); font-size: 11px; }
.simple-stat-copy strong { overflow-wrap: anywhere; font-size: clamp(16px, 1.6vw, 22px); line-height: 1.25; font-weight: 750; font-variant-numeric: tabular-nums; }
.simple-stat-copy em { color: var(--muted); font-size: 10px; font-style: normal; line-height: 1.6; }
.simple-workspace { margin-bottom: 18px; }
.simple-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.simple-section-heading h2 { margin: 0; font-size: 17px; }
.simple-section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.simple-actions-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.simple-action-card { display: flex; align-items: center; gap: 11px; min-width: 0; min-height: 88px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); text-align: start; cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease; }
.simple-action-card:hover { border-color: color-mix(in srgb, var(--brand) 52%, var(--line)); background: var(--surface-soft); box-shadow: 0 7px 18px rgba(20, 62, 100, .06); transform: translateY(-1px); }
.simple-action-card.is-primary { border-color: color-mix(in srgb, var(--brand) 38%, var(--line)); background: var(--brand-soft); }
.simple-action-icon { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 10px; background: var(--surface-soft); color: var(--brand); }
.simple-action-card.is-primary .simple-action-icon { background: var(--brand); color: white; }
.simple-action-icon svg { width: 20px; height: 20px; stroke: currentColor; }
.simple-action-copy { display: grid; gap: 5px; min-width: 0; flex: 1; }
.simple-action-copy strong { font-size: 12px; line-height: 1.5; }
.simple-action-copy small { color: var(--muted); font-size: 10px; line-height: 1.6; }
.simple-action-arrow { flex: none; color: var(--muted); font-size: 16px; }
.simple-recent-panel { margin-bottom: 11px; }
.simple-recent-list { display: grid; }
.simple-recent-row { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 5px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: start; cursor: pointer; }
.simple-recent-row:last-child { border-bottom: 0; }
.simple-recent-row:hover { background: var(--surface-soft); }
.simple-recent-icon { display: grid; place-items: center; flex: 0 0 33px; width: 33px; height: 33px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); }
.simple-recent-icon svg { width: 17px; height: 17px; stroke: currentColor; }
.simple-recent-copy { display: grid; gap: 3px; min-width: 0; flex: 1; }
.simple-recent-copy strong { overflow: hidden; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.simple-recent-copy small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.simple-recent-amount { flex: none; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.simple-recent-row .status-pill { flex: none; }
.simple-data-note { margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.8; }
@media (max-width: 1150px) {
  .app-mode-toggle { padding-inline: 8px; }
  .app-mode-toggle-label { max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
  .simple-actions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .simple-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .app-shell.simple-mode { display: block; }
  .app-shell.simple-mode .sidebar { padding-inline: 18px; }
  .simple-welcome { align-items: flex-start; flex-direction: column; padding: 19px; }
  .simple-primary-cta { width: 100%; }
  .simple-actions-grid { grid-template-columns: 1fr; }
  .simple-stat { padding: 12px; }
  .simple-recent-row { flex-wrap: wrap; }
  .simple-recent-amount { margin-inline-start: auto; }
  .app-mode-toggle { min-height: 32px; }
  .app-mode-toggle-label { max-width: 76px; }
}
@media (max-width: 420px) {
  .app-mode-toggle { gap: 4px; padding-inline: 7px; }
  .app-mode-toggle-label { max-width: 62px; font-size: 10px; }
  .simple-stats-grid { grid-template-columns: 1fr 1fr; }
  .simple-stat { gap: 7px; }
  .simple-stat-icon { flex-basis: 30px; width: 30px; height: 30px; }
  .simple-stat-copy em { display: none; }
}


/* 1.9.24 — make simple mode a distinct, unmistakable workspace. */
.app-shell.simple-mode { grid-template-columns: 238px minmax(0, 1fr); }
.app-shell.simple-mode .sidebar { padding: 18px 13px 12px; gap: 12px; }
.app-shell.simple-mode .sidebar-toggle,
.app-shell.simple-mode .help-top,
.app-shell.simple-mode #notificationButton { display: none !important; }
.app-shell.simple-mode .nav-tree-count,
.app-shell.simple-mode .nav-count { display: none !important; }
.app-shell.simple-mode .module-nav { gap: 5px; }
.app-shell.simple-mode .nav-tree-heading { min-height: 39px; margin: 2px 0; padding: 9px 10px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; }
.app-shell.simple-mode .nav-tree-heading.is-expanded { border-color: var(--line); background: var(--surface-soft); }
.app-shell.simple-mode .nav-tree-children { margin-inline-start: 8px; padding-inline-start: 6px; }
.app-shell.simple-mode .nav-tree-children .nav-item { min-height: 38px; margin: 2px 0; padding: 8px 10px; font-size: 12px; }
.app-shell.simple-mode .company-switch { min-height: 47px; }
.app-shell.simple-mode .assistant-shortcut { display: none; }
.app-shell.simple-mode .global-search { width: min(280px, 26vw); }
.app-shell.simple-mode #pageHost[data-dashboard-mode="professional"] { display: none; }
.simple-welcome { background: linear-gradient(115deg, var(--surface) 0%, var(--brand-soft) 100%); }
.simple-stats-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 24px; }
.simple-stats-compact .simple-stat { align-items: center; min-height: 65px; padding: 12px 15px; }
.simple-stats-compact .simple-stat-copy { gap: 4px; }
.simple-stats-compact .simple-stat-copy strong { font-size: 18px; }
.simple-core-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.simple-core-actions .simple-action-card { min-height: 112px; padding: 18px; gap: 13px; }
.simple-core-actions .simple-action-icon { flex-basis: 44px; width: 44px; height: 44px; }
.simple-core-actions .simple-action-copy strong { font-size: 14px; }
.simple-core-actions .simple-action-copy small { font-size: 11px; }
.simple-secondary-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.simple-secondary-actions > span { margin-inline-end: 5px; color: var(--muted); font-size: 11px; }
.simple-secondary-link { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); color: var(--ink); font: inherit; font-size: 11px; cursor: pointer; }
.simple-secondary-link:hover { border-color: var(--brand); color: var(--brand); }
.simple-secondary-link svg { width: 15px; height: 15px; stroke: currentColor; }
.app-mode-toggle[data-current-mode="simple"] { border-color: var(--brand); background: var(--brand); color: #fff; }
.app-mode-toggle[data-current-mode="simple"]:hover { background: var(--brand-deep); color: #fff; }
@media (max-width: 1150px) {
  .simple-core-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .simple-stats-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .app-shell.simple-mode .sidebar { display: flex; }
  .simple-core-actions, .simple-stats-compact { grid-template-columns: 1fr; }
  .simple-core-actions .simple-action-card { min-height: 80px; }
  .simple-secondary-actions { align-items: stretch; }
  .simple-secondary-actions > span { width: 100%; }
}

/* 1.9.25 — six-icon Odoo-inspired simple workspace, clear navigation labels, bottom mode notice. */
.app-notice {
  top: auto;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(620px, calc(100vw - 28px));
  padding: 12px 17px;
  border-color: color-mix(in srgb, var(--brand-cyan) 45%, var(--line));
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 12px 38px rgba(0, 0, 0, .24);
  line-height: 1.65;
}

/* The section-count pills and leftover item counters are deliberately omitted from the navigation. */
.nav-tree-count,
.nav-count { display: none !important; }
.app-shell:not(.simple-mode):not(.sidebar-collapsed) .nav-item .nav-text {
  display: block;
  visibility: visible;
  opacity: 1;
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
}
.app-shell:not(.simple-mode) .nav-item { gap: 10px; }
.app-shell:not(.simple-mode) .nav-item .nav-text { text-indent: 0; }

/* Mode switch: a fixed-width, high-contrast button so its Arabic label never clips. */
.app-mode-toggle {
  min-width: max-content;
  max-width: none;
  flex: 0 0 auto;
  overflow: visible;
  border: 1px solid var(--brand) !important;
  background: var(--brand) !important;
  color: #fff !important;
  padding: 8px 14px;
  gap: 8px;
  line-height: 1.5;
  box-shadow: 0 2px 0 rgba(27, 20, 100, .13);
}
.app-mode-toggle:hover,
.app-mode-toggle:focus-visible {
  background: var(--brand-deep) !important;
  border-color: var(--brand-deep) !important;
  color: #fff !important;
}
.app-mode-toggle-icon,
.app-mode-toggle-label { color: inherit !important; }
.app-mode-toggle-label {
  display: inline-block;
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 750;
}
.simple-home-button { display: none; }

/* In simple mode, the navigation tree is replaced by personalized daily shortcuts.
   All neutral surfaces use the same semantic theme tokens as professional mode. */
.app-shell.simple-mode {
  --simple-bg: var(--canvas);
  --simple-panel: var(--surface);
  --simple-border: var(--line);
  --simple-ink: var(--ink);
  --simple-muted: var(--muted);
  --simple-hover: var(--surface-soft);
  display: grid;
  grid-template-columns: minmax(0, 1fr) !important;
  min-height: 100vh;
  background: var(--canvas);
}
.app-shell.simple-mode > .sidebar,
.app-shell.simple-mode > .sidebar-scrim { display: none !important; }
.app-shell.simple-mode .main-area {
  min-width: 0;
  min-height: 100vh;
  background: var(--simple-bg);
  color: var(--simple-ink);
}
.app-shell.simple-mode .topbar {
  min-height: 65px;
  border-bottom-color: var(--simple-border);
  background: var(--simple-panel);
  color: var(--simple-ink);
}
.app-shell.simple-mode .breadcrumb { color: var(--simple-muted); }
.app-shell.simple-mode .breadcrumb strong,
.app-shell.simple-mode .breadcrumb > span:first-child { color: var(--simple-ink); }
.app-shell.simple-mode .theme-toggle { color: var(--simple-ink); border: 1px solid var(--simple-border); background: var(--simple-panel); }
.app-shell.simple-mode .theme-toggle:hover { border-color: var(--brand-cyan); background: var(--simple-hover); }
:root[data-theme="light"] .app-shell.simple-mode .theme-toggle { color: var(--simple-ink); }
.app-shell.simple-mode .topbar-tools > :not(#appModeToggle):not(#simpleHomeButton):not(#themeToggle):not(.topbar-search-mode-group):not(.topbar-utility-actions) { display: none !important; }
.app-shell.simple-mode .mobile-menu { display: none !important; }
.app-shell.simple-mode #simpleHomeButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  border: 1px solid #343434;
  border-radius: 10px;
  background: var(--simple-panel);
  color: var(--simple-ink);
}
.app-shell.simple-mode #simpleHomeButton:hover { border-color: var(--brand-cyan); background: var(--simple-hover); }
.app-shell.simple-mode .page-host {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(12px, 1.6vw, 26px);
}
.app-shell.simple-mode #pageHost[data-dashboard-mode="simple"] {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.app-shell.simple-mode #pageHost[data-dashboard-mode="professional"] { display: none !important; }
.app-shell.simple-mode .app-footer {
  border-top: 1px solid var(--simple-border);
  background: var(--simple-bg);
  color: var(--simple-muted);
}
.app-shell.simple-mode .app-footer-version { color: var(--simple-muted); font-variant-numeric: tabular-nums; }

.simple-home-screen {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  min-height: calc(100dvh - 132px);
  padding: clamp(14px, 1.5vw, 29px);
  border: 1px solid var(--simple-border);
  border-radius: clamp(18px, 2vw, 38px);
  background: var(--simple-panel);
  color: var(--simple-ink);
}
.simple-home-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 46px;
}
.simple-home-toolbar > div { display: flex; flex-direction: column; gap: 2px; }
.simple-home-toolbar strong { color: var(--simple-ink); font-size: 15px; font-weight: 800; }
.simple-home-toolbar small { color: var(--simple-muted); font-size: 11px; }
.simple-home-customize { min-height: 38px; border-color: var(--simple-border); background: var(--simple-panel); color: var(--simple-ink); }
.simple-home-empty { display: grid; place-content: center; gap: 12px; min-height: 260px; text-align: center; color: var(--simple-muted); }
.simple-home-empty p { margin: 0; }
.simple-home-grid {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: none;
  grid-auto-rows: minmax(110px, 1fr);
  gap: clamp(10px, 1vw, 18px);
  min-height: 470px;
  direction: rtl;
}
.simple-home-action {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 1.7vh, 25px);
  padding: clamp(12px, 1.5vw, 26px);
  border: 1px solid transparent;
  border-radius: clamp(16px, 1.9vw, 31px);
  background: transparent;
  color: var(--simple-ink);
  text-align: center;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.simple-home-action:hover {
  border-color: var(--simple-border);
  background: var(--simple-hover);
  transform: translateY(-1px);
}
.simple-home-action:focus-visible { outline: 3px solid var(--brand-cyan); outline-offset: 2px; }
.simple-home-action.is-sale {
  border-color: #0071bc;
  background: #0071bc;
  color: #fff;
}
.simple-home-action.is-sale:hover { background: #0782d2; box-shadow: 0 8px 24px rgba(0, 113, 188, .2); }
.simple-home-action.is-invoices {
  border-color: #21186e;
  background: #1b1464;
  color: #fff;
}
.simple-home-action.is-invoices:hover { background: #282080; box-shadow: 0 8px 24px rgba(27, 20, 100, .2); }
.simple-home-action:disabled {
  opacity: .38;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.simple-home-icon { display: grid; place-items: center; width: clamp(35px, 3.4vw, 54px); height: clamp(35px, 3.4vw, 54px); color: currentColor; }
.simple-home-icon svg { display: block; width: 100%; height: 100%; stroke: currentColor; stroke-width: 1.8; }
.simple-home-label {
  color: inherit;
  font-size: clamp(18px, 1.65vw, 32px);
  font-weight: 730;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.simple-home-footer-note {
  margin: auto 0 0;
  padding: 4px 2px 0;
  color: var(--simple-muted);
  text-align: end;
  font-size: 12px;
  line-height: 1.75;
}

.simple-home-settings-dialog { width: min(680px, calc(100vw - 24px)); max-width: 680px; padding: 0; }
.simple-home-settings-dialog .dialog-content { padding: 16px 22px 20px; }
.simple-settings-intro { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.simple-home-settings-list { display: grid; gap: 7px; max-height: min(55vh, 520px); overflow: auto; }
.simple-settings-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.simple-settings-choice { display: flex; align-items: center; flex: 1; gap: 10px; min-width: 0; cursor: pointer; }
.simple-settings-choice input { width: 17px; height: 17px; accent-color: var(--brand); }
.simple-settings-item-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px; background: var(--surface-soft); color: var(--brand); }
.simple-settings-item-icon svg { width: 18px; height: 18px; }
.simple-settings-item-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.simple-settings-item-copy strong { color: var(--ink); font-size: 13px; }
.simple-settings-item-copy small { color: var(--muted); font-size: 10px; }
.simple-settings-reorder { display: flex; gap: 5px; }
.simple-settings-reorder button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--ink); cursor: pointer; }
.simple-vendor-invoice-list { display: grid; gap: 9px; }
.simple-vendor-invoice-option { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.simple-vendor-invoice-option > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.simple-vendor-invoice-option > div:first-child strong { overflow: hidden; text-overflow: ellipsis; }
.simple-vendor-invoice-option small { color: var(--muted); font-size: 11px; }
.simple-vendor-invoice-total { text-align: end; white-space: nowrap; }
.simple-vendor-invoice-option .button { min-height: 36px; padding: 7px 10px; font-size: 12px; }
.simple-quick-dialog { width: min(570px, calc(100vw - 24px)); max-width: 570px; padding: 0; }
.simple-quick-dialog .dialog-content { padding: 18px 22px 22px; }
.simple-quick-choices { display: grid; gap: 10px; }
.simple-quick-choice {
  display: flex;
  width: 100%;
  min-height: 76px;
  align-items: center;
  gap: 13px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  text-align: start;
  cursor: pointer;
}
.simple-quick-choice:hover { border-color: var(--brand); background: var(--surface-soft); }
.simple-quick-choice-icon { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.simple-quick-choice-icon svg { width: 23px; height: 23px; stroke: currentColor; }
.simple-quick-choice > span:nth-child(2) { display: grid; flex: 1; gap: 5px; }
.simple-quick-choice strong { font-size: 14px; }
.simple-quick-choice small { color: var(--muted); font-size: 11px; line-height: 1.65; }
.simple-activity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.simple-activity-stat { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.simple-activity-stat > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); }
.simple-activity-stat svg { width: 18px; height: 18px; stroke: currentColor; }
.simple-activity-stat small { color: var(--muted); font-size: 11px; }
.simple-activity-stat strong { font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.simple-activity-note { margin: 13px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }

@media (max-width: 900px) {
  .simple-home-grid { grid-auto-rows: minmax(100px, 1fr); grid-template-rows: none; min-height: 410px; }
  .simple-home-label { font-size: clamp(16px, 2vw, 24px); }
}
@media (max-width: 600px) {
  .app-shell.simple-mode .topbar { padding-inline: 12px; gap: 8px; }
  .app-shell.simple-mode .breadcrumb { gap: 4px; font-size: 11px; }
  .app-shell.simple-mode #appModeToggle { min-width: max-content; padding: 7px 9px; }
  .app-shell.simple-mode .app-mode-toggle-label { font-size: 11px; }
  .app-shell.simple-mode .page-host { padding: 9px; }
  .simple-home-screen { min-height: calc(100dvh - 120px); padding: 10px; border-radius: 18px; }
  .simple-home-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-rows: minmax(76px, auto); gap: 8px; min-height: 0; }
  .simple-home-action { flex-direction: row; justify-content: flex-start; gap: 16px; padding: 13px 18px; border-radius: 14px; }
  .simple-home-icon { flex: 0 0 34px; width: 34px; height: 34px; }
  .simple-home-label { flex: 1; text-align: start; font-size: 17px; }
  .simple-home-footer-note { font-size: 10px; text-align: center; }
  .app-shell.simple-mode .app-footer { padding: 8px 12px; font-size: 10px; }
  .simple-activity-grid { grid-template-columns: 1fr; }
  .app-notice { bottom: 12px; max-width: calc(100vw - 22px); font-size: 11px; }
}

/* 1.9.28 — customer picker with explicit options and invoice line composer inside the table */
[hidden] { display: none !important; }
.invoice-customer-picker { position: relative; display: grid; gap: 6px; }
.invoice-customer-select-row { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 6px; align-items: stretch; }
.invoice-customer-picker [data-invoice-customer-search] { width: 100%; min-width: 0; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.invoice-customer-picker [data-invoice-customer-search]:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.invoice-customer-toggle { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--ink); font-size: 18px; cursor: pointer; }
.invoice-customer-toggle:hover, .invoice-customer-toggle:focus-visible { border-color: var(--brand); color: var(--brand); outline: 2px solid color-mix(in srgb, var(--brand) 18%, transparent); }
.invoice-customer-picker .field-hint { margin: 0; color: var(--muted); font-size: 11px; }
.invoice-customer-picker [data-invoice-customer-results] { position: absolute; inset-inline: 0; top: 46px; z-index: 90; max-height: min(320px, 45vh); overflow: auto; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 14px 32px rgba(8, 16, 35, .22); }
.invoice-customer-picker [data-invoice-customer-results][hidden] { display: none !important; }
.relation-search-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); text-align: start; cursor: pointer; }
.relation-search-option:hover, .relation-search-option:focus-visible { background: var(--brand-soft); outline: none; }
.relation-search-option > span:first-child { display: grid; gap: 3px; }
.relation-search-option strong { font-size: 12px; }
.relation-search-option small { color: var(--muted); font-size: 10px; }
.relation-option-check { color: var(--brand); font-size: 16px; }
.relation-search-empty { padding: 13px; color: var(--muted); font-size: 12px; }
.invoice-lines-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.invoice-lines-table { width: 100%; min-width: 790px; border-collapse: separate; border-spacing: 0; background: var(--surface); color: var(--ink); font-size: 12px; }
.invoice-lines-table thead th { position: sticky; top: 0; padding: 10px 9px; background: var(--surface-soft); color: var(--ink); border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.invoice-lines-table tbody td { padding: 9px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.invoice-lines-table tbody tr:last-child td { border-bottom: 0; }
.invoice-lines-table tbody tr:hover { background: color-mix(in srgb, var(--brand-soft) 22%, transparent); }
.invoice-product-cell { min-width: 180px; }
.invoice-product-cell strong { display: block; font-size: 12px; }
.invoice-product-cell small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.invoice-line-number { width: 86px; min-height: 34px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); text-align: end; font-variant-numeric: tabular-nums; }
.invoice-line-number:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.invoice-line-tax, .invoice-line-total { white-space: nowrap; font-variant-numeric: tabular-nums; }
.invoice-line-total { font-weight: 800; }
.invoice-stock-badge { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.invoice-stock-badge small { font-size: 9px; font-weight: 600; }
.invoice-stock-badge.is-available { color: #166534; background: #dcfce7; border: 1px solid #bbf7d0; }
.invoice-stock-badge.is-unavailable { color: #991b1b; background: #fee2e2; border: 1px solid #fecaca; }
.invoice-stock-badge.is-service { color: #1d4ed8; background: #dbeafe; border: 1px solid #bfdbfe; }
.invoice-stock-badge.is-pending { color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); }
.invoice-empty-lines { padding: 22px !important; color: var(--muted); text-align: center; }
.invoice-add-line-table-row td { border-top: 1px dashed var(--line); background: var(--surface-soft); padding: 8px !important; vertical-align: middle; }
.invoice-inline-product-entry { display: grid; gap: 5px; min-width: 190px; }
.invoice-inline-product-entry select { width: 100%; min-height: 34px; min-width: 0; padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; }
.invoice-table-search-link { justify-self: start; padding: 2px 0; border: 0; background: transparent; color: var(--brand); font: inherit; font-size: 10px; cursor: pointer; }
.invoice-table-search-link:hover { text-decoration: underline; }
.invoice-row-add-button { white-space: nowrap; padding-inline: 10px; min-height: 34px; }
#recordDialog [name="owner"][readonly] { opacity: .92; background: var(--surface-soft); cursor: default; }
#recordDialog .odoo-doc-reference strong[data-invoice-number-preview] { direction: ltr; unicode-bidi: isolate; display: inline-block; color: var(--brand); font-variant-numeric: tabular-nums; }
@media (max-width: 540px) {
  .invoice-lines-table { min-width: 720px; }
  .invoice-customer-picker [data-invoice-customer-results] { max-height: 45vh; }
}

/* 1.9.30 — mobile-only responsive polish. Desktop layout remains unchanged. */
@media (max-width: 760px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .app-shell:not(.simple-mode) { display: block; min-height: 100dvh; }
  .main-area { width: 100%; min-width: 0; }

  /* Two clear header rows: page identity first, controls second. */
  .topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 9px;
    min-height: 0;
    padding: 8px 11px 9px;
  }
  .mobile-menu { order: 0; flex: 0 0 34px; width: 34px; height: 34px; }
  .breadcrumb {
    order: 1;
    flex: 1 1 0;
    min-width: 0;
    gap: 5px;
    font-size: 11px;
    overflow: hidden;
  }
  .breadcrumb > span:first-child,
  .breadcrumb-separator { flex: 0 0 auto; }
  .breadcrumb strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar-tools {
    order: 2;
    display: flex;
    flex: 1 0 100%;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
    min-width: 0;
  }
  .topbar-tools .sidebar-toggle,
  .topbar-tools .help-top,
  .topbar-tools .sync-status { display: none !important; }
  .app-mode-toggle {
    order: 0;
    flex: 0 0 auto;
    min-width: max-content;
    max-width: none;
    min-height: 38px;
    padding: 8px 11px;
    gap: 7px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.25;
    white-space: nowrap;
  }
  .app-mode-toggle-icon { flex: 0 0 auto; font-size: 14px; }
  .app-mode-toggle-label {
    display: inline-block;
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap;
    font-size: 12px;
    line-height: 1.25;
  }
  .global-search-wrap {
    order: 1;
    flex: 1 1 135px;
    min-width: 118px;
    width: auto;
  }
  .global-search {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 7px 8px;
    gap: 5px;
  }
  .global-search input { min-width: 0; font-size: 11px; }
  .global-search .search-glyph { font-size: 17px; }
  .global-search kbd { display: none; }
  .topbar-tools .theme-toggle,
  .topbar-tools #notificationButton,
  .topbar-tools #simpleHomeButton { flex: 0 0 34px; width: 34px; min-width: 34px; height: 34px; }
  .topbar-tools .theme-toggle { order: 2; }
  .topbar-tools #notificationButton { order: 3; }
  .topbar-tools #simpleHomeButton { order: 0; }

  .page-host { width: 100%; max-width: 100%; min-width: 0; padding: 13px 10px; }
  .page-heading { gap: 9px; margin-bottom: 13px; }
  .page-heading h1 { font-size: 20px; line-height: 1.4; }
  .page-subtitle { font-size: 11px; line-height: 1.65; }
  .heading-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    width: 100%;
  }
  .heading-actions .button { width: 100%; min-width: 0; min-height: 37px; padding: 7px 8px; font-size: 11px; white-space: normal; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
  .metric-card { min-width: 0; padding: 10px; border-radius: 10px; }
  .metric-top { gap: 5px; font-size: 10px; line-height: 1.5; }
  .metric-icon { flex: 0 0 28px; width: 28px; height: 28px; }
  .metric-value { margin: 7px 0 4px; font-size: clamp(16px, 4.4vw, 20px); line-height: 1.25; overflow-wrap: anywhere; }
  .metric-value small { font-size: 9px; }
  .metric-foot { gap: 4px; font-size: 10px; line-height: 1.55; }
  .dashboard-grid, .lower-grid { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .panel { min-width: 0; padding: 12px; border-radius: 10px; }
  .panel-header { gap: 7px; margin-bottom: 10px; }
  .panel-header h2 { font-size: 13px; line-height: 1.5; }
  .panel-caption { font-size: 10px; line-height: 1.6; }
  .workflow-shortcuts { margin: 0 0 10px; padding: 9px; }
  .workflow-shortcuts-label { font-size: 10px; }
  .workflow-shortcut { min-height: 32px; padding: 6px 8px; font-size: 10px; }
  .app-footer { padding: 9px 11px; font-size: 10px; }
  .app-notice {
    bottom: max(12px, env(safe-area-inset-bottom));
    top: auto;
    width: max-content;
    max-width: calc(100vw - 20px);
    padding: 10px 12px;
    font-size: 11px;
    line-height: 1.6;
  }

  /* In simple mode keep the home tiles icon-led and the mode label fully visible. */
  .app-shell.simple-mode .topbar { gap: 7px; padding: 8px 10px 9px; }
  .app-shell.simple-mode .breadcrumb { flex: 1 1 100%; min-height: 28px; }
  .app-shell.simple-mode .topbar-tools { flex: 1 0 100%; justify-content: flex-start; }
  .app-shell.simple-mode #simpleHomeButton { order: 0; }
  .app-shell.simple-mode #appModeToggle { order: 1; min-width: max-content; }
  .app-shell.simple-mode .app-mode-toggle-label { max-width: none !important; font-size: 12px; }
  .app-shell.simple-mode .page-host { padding: 10px; }
  .simple-home-screen { min-height: auto; padding: 12px; border-radius: 14px; }
  .simple-home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-rows: minmax(112px, auto);
    gap: 9px;
    min-height: 0;
  }
  .simple-home-action { min-width: 0; flex-direction: column; justify-content: center; gap: 8px; padding: 12px 7px; border-radius: 12px; text-align: center; }
  .simple-home-icon { flex: 0 0 32px; width: 32px; height: 32px; }
  .simple-home-label { min-width: 0; flex: 0 1 auto; text-align: center; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
  .simple-home-footer-note { font-size: 10px; line-height: 1.6; }
  .app-shell.simple-mode .app-footer { padding: 8px 10px; }
}

@media (max-width: 380px) {
  .topbar { padding-inline: 8px; }
  .breadcrumb { gap: 4px; font-size: 10px; }
  .app-mode-toggle { padding-inline: 8px; gap: 5px; }
  .app-mode-toggle-label { font-size: 11px; }
  .global-search-wrap { flex-basis: 120px; min-width: 110px; }
  .metric-card { padding: 8px; }
  .metric-top { font-size: 9px; }
  .metric-value { font-size: 16px; }
  .simple-home-grid { grid-template-rows: none; grid-auto-rows: minmax(100px, auto); gap: 7px; }
  .simple-home-label { font-size: 12px; }
}

/* Tablet header wrap: prevent the tool row overflowing beside the desktop sidebar. */
@media (min-width: 761px) and (max-width: 900px) {
  .topbar { flex-wrap: wrap; align-items: center; gap: 6px 10px; min-height: 0; padding-block: 9px; }
  .breadcrumb { order: 0; flex: 1 1 0; min-width: 0; }
  .topbar-tools { order: 1; flex: 1 0 100%; flex-wrap: wrap; justify-content: flex-start; gap: 7px; width: 100%; min-width: 0; }
  .global-search-wrap { flex: 1 1 200px; min-width: 180px; width: auto; }
  .global-search { width: 100%; min-width: 0; }
}


/* 1.9.34 — تصميم الفاتورة والطباعة والتوقيع والختم وحفظ بيانات المنشأة. */
.company-settings-form { display: grid; width: 100%; max-width: none; align-items: stretch; gap: 14px; }
.company-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.company-settings-grid .form-field { min-width: 0; }
.company-logo-row { display: flex; align-items: center; gap: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.company-logo-preview-wrap { display: grid; flex: 0 0 92px; justify-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.company-logo-preview-wrap img { width: 72px; height: 72px; object-fit: contain; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.company-logo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.company-logo-actions small { flex: 1 0 100%; color: var(--muted); font-size: 10px; line-height: 1.7; }
.company-form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.company-form-actions .button { min-height: 40px; }

@media (min-width: 761px) {
  html, body { height: 100%; }
  body.workspace-active { height: 100dvh; overflow: hidden; }
  body.workspace-active .app-shell:not([hidden]) { height: 100dvh; min-height: 0; overflow: hidden; }
  body.workspace-active .sidebar { height: 100dvh; min-height: 0; overflow: hidden; }
  body.workspace-active .module-nav { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; align-content: start; }
  body.workspace-active .main-area { height: 100dvh; min-height: 0; overflow: hidden; }
  body.workspace-active .page-host { min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; }
  body.workspace-active .app-footer { flex: 0 0 auto; }
  body.workspace-active .app-shell.simple-mode .main-area { overflow: hidden; }
}

@media (max-width: 760px) {
  .company-settings-grid { grid-template-columns: minmax(0, 1fr); }
  .company-logo-row { align-items: flex-start; }
  .company-logo-actions { align-items: flex-start; }
  .company-form-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .company-form-actions .button { width: 100%; white-space: normal; }
  body.workspace-active { overflow-x: hidden; }
}

/* رشيد ERP 1.9.34 — إعدادات المنشأة وتصميم الفاتورة */
.company-settings-form .company-settings-grid,
.invoice-design-grid,
.invoice-artwork-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.company-settings-form .company-settings-grid .form-field,
.invoice-design-grid .form-field { min-width: 0; }
.invoice-design-grid .form-field.wide { grid-column: 1 / -1; }
.company-logo-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  padding: 16px;
  margin-top: 16px;
  border: 1px solid var(--border, #d7e1ec);
  border-radius: 14px;
  background: var(--surface-muted, #f7f9fc);
}
.company-logo-preview-wrap {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 120px;
  color: var(--muted, #667085);
  font-size: 12px;
}
.company-logo-preview-wrap img { width: 100px; height: 82px; object-fit: contain; }
.company-logo-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.company-logo-actions small { flex-basis: 100%; color: var(--muted, #667085); }
.invoice-artwork-settings,
.invoice-design-settings,
.taxes-setting-card {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--border, #d7e1ec);
  border-radius: 14px;
  background: var(--surface, #fff);
}
.invoice-artwork-grid { margin-top: 12px; }
.invoice-artwork-picker {
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 8px;
  padding: 12px;
  min-width: 0;
  border: 1px solid var(--border, #d7e1ec);
  border-radius: 12px;
  background: var(--surface-muted, #f7f9fc);
}
.invoice-artwork-preview {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 92px;
  max-height: 126px;
  padding: 8px;
  overflow: hidden;
  border: 1px dashed var(--border-strong, #c6d2e0);
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--muted, #667085);
  font-size: 12px;
}
.invoice-artwork-preview img { max-width: 100%; max-height: 108px; object-fit: contain; }
.invoice-artwork-picker .inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.invoice-artwork-picker .inline-actions .button,
.invoice-artwork-picker .inline-actions label.button { margin: 0; }
.setting-check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 0 0;
  color: var(--text, #172033);
  line-height: 1.6;
}
.setting-check-row > input { flex: 0 0 auto; margin-top: 4px; accent-color: #0071bc; }
.setting-check-row > span { display: grid; gap: 4px; }
.setting-check-row small { color: var(--muted, #667085); font-size: 12px; }
.company-form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
@media (max-width: 760px) {
  .company-settings-form .company-settings-grid,
  .invoice-design-grid,
  .invoice-artwork-grid { grid-template-columns: minmax(0, 1fr); }
  .invoice-design-grid .form-field.wide { grid-column: auto; }
  .company-logo-row { align-items: flex-start; }
  .company-logo-actions { min-width: 0; }
  .invoice-artwork-picker { width: 100%; }
}


/* 1.9.35 — precise invoice timestamps, selected-row print control and product autocomplete. */
.selected-invoice-print-status { display:inline-flex; align-items:center; min-height:32px; color:var(--muted); font-size:11px; padding:0 5px; }
.invoice-select-cell, .invoice-select-cell-header { width:54px; min-width:54px; text-align:center!important; }
.invoice-select-cell input[type="radio"] { width:17px; height:17px; accent-color:var(--brand); cursor:pointer; }
.data-table tbody tr.is-selected-invoice { background:color-mix(in srgb, var(--brand) 10%, var(--surface)); }
.invoice-product-autocomplete { position:relative; min-width:0; }
.invoice-product-autocomplete > input[type="search"] { display:block; width:100%; min-width:0; min-height:36px; padding:7px 9px; border:1px solid var(--line); border-radius:7px; background:var(--surface); color:var(--ink); font:inherit; font-size:12px; }
.invoice-product-autocomplete > input[type="search"]:focus { border-color:var(--brand); outline:2px solid color-mix(in srgb,var(--brand) 16%,transparent); }
.invoice-product-suggestions { position:absolute; z-index:120; inset-inline:0; top:calc(100% + 4px); min-width:260px; max-height:260px; overflow:auto; padding:4px; border:1px solid var(--line); border-radius:9px; background:var(--surface); box-shadow:0 12px 32px #0f172a24; }
.invoice-product-suggestion { display:flex; align-items:center; width:100%; gap:9px; padding:8px; border:0; border-radius:6px; color:var(--ink); background:transparent; font:inherit; text-align:start; cursor:pointer; }
.invoice-product-suggestion:hover, .invoice-product-suggestion:focus-visible { background:var(--surface-soft); outline:0; }
.invoice-product-suggestion-icon { display:grid; place-items:center; width:30px; height:30px; flex:0 0 30px; border-radius:7px; background:color-mix(in srgb,var(--brand) 12%,var(--surface)); color:var(--brand); }
.invoice-product-suggestion-copy { display:flex; flex:1; min-width:0; flex-direction:column; gap:2px; }
.invoice-product-suggestion-copy strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.invoice-product-suggestion-copy small { color:var(--muted); font-size:10px; }
.invoice-product-suggestion-price { color:var(--brand); font-size:11px; font-weight:800; white-space:nowrap; }
.invoice-product-suggestion-empty { padding:14px 10px; color:var(--muted); font-size:11px; text-align:center; }
.invoice-history-panel { margin-top:18px; }
@media (max-width:760px) {
  .selected-invoice-print-status { flex-basis:100%; padding:5px 0; }
  .invoice-select-cell, .invoice-select-cell-header { width:42px; min-width:42px; }
  .invoice-product-suggestions { min-width:min(280px, calc(100vw - 48px)); max-width:calc(100vw - 48px); }
}

/* 1.9.38 — keep invoice product autocomplete above clipped table content. */
.invoice-product-suggestions-portal {
  position: fixed !important;
  z-index: 12000 !important;
  box-sizing: border-box;
  margin: 0;
  overscroll-behavior: contain;
}
.invoice-product-suggestions-portal .invoice-product-suggestion {
  width: 100%;
  box-sizing: border-box;
}
.invoice-product-suggestions-portal .invoice-product-suggestion-empty {
  min-height: 40px;
}

/* 1.9.38 — invoice metadata: dates share a row and branch follows below. */
#recordDialog.odoo-document-dialog .invoice-dynamic-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#recordDialog.odoo-document-dialog .invoice-dynamic-fields .invoice-customer-field,
#recordDialog.odoo-document-dialog .invoice-dynamic-fields .invoice-branch-field { grid-column: 1 / -1; }
#recordDialog.odoo-document-dialog .invoice-date-field { min-width: 0; }
/* The invoice and due dates stay side-by-side; branch is a full row beneath them. */
#recordDialog.odoo-document-dialog .invoice-branch-field { grid-column: 1 / -1; }
@media (max-width: 560px) {
  #recordDialog.odoo-document-dialog .invoice-dynamic-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #recordDialog.odoo-document-dialog .invoice-dynamic-fields .invoice-customer-field,
  #recordDialog.odoo-document-dialog .invoice-dynamic-fields .invoice-branch-field,
  #recordDialog.odoo-document-dialog .invoice-dynamic-fields .wide,
  #recordDialog.odoo-document-dialog .invoice-dynamic-fields .order-lines-field { grid-column: 1 / -1; }
}


/* 1.9.38 — invoice product popup is moved to the modal's top layer to avoid clipping. */
#recordDialog.odoo-document-dialog .invoice-product-suggestions-portal {
  position: fixed !important;
  z-index: 12000 !important;
  box-sizing: border-box;
  margin: 0;
  overscroll-behavior: contain;
  isolation: isolate;
}
#recordDialog.odoo-document-dialog .invoice-product-suggestions-portal .invoice-product-suggestion {
  width: 100%;
  box-sizing: border-box;
}

/* 1.9.39 — compact invoice/quotation metadata so document forms use less vertical space. */
#recordDialog.odoo-document-dialog #recordForm {
  min-height: 0 !important;
}
#recordDialog.odoo-document-dialog .dialog-content {
  padding: 12px 20px 16px;
  gap: 8px;
  align-content: start;
}
#recordDialog.odoo-document-dialog .dialog-content > .form-row {
  gap: 10px 14px;
}
#recordDialog.odoo-document-dialog .dynamic-fields,
#recordDialog.odoo-document-dialog .invoice-dynamic-fields {
  gap: 7px 16px;
  padding: 9px 0;
  align-content: start;
  grid-auto-rows: min-content;
}
#recordDialog.odoo-document-dialog .form-field {
  gap: 3px;
  align-content: start;
}
#recordDialog.odoo-document-dialog .form-field > span {
  line-height: 1.25;
}
#recordDialog.odoo-document-dialog .form-field input,
#recordDialog.odoo-document-dialog .form-field select,
#recordDialog.odoo-document-dialog .form-field textarea {
  min-height: 32px;
  padding: 5px 9px;
  line-height: 1.3;
}
#recordDialog.odoo-document-dialog .invoice-customer-picker {
  gap: 4px;
}
#recordDialog.odoo-document-dialog .invoice-customer-picker .field-hint {
  font-size: 10px;
  line-height: 1.25;
}
#recordDialog.odoo-document-dialog .invoice-branch-field {
  grid-column: 1 / -1;
}
#recordDialog.odoo-document-dialog .invoice-line-items-field > span {
  margin-bottom: 5px;
  font-size: 13px;
}
#recordDialog.odoo-document-dialog .invoice-line-items-field .order-line-list {
  margin-top: 7px;
}
#recordDialog.odoo-document-dialog .order-line-row {
  padding: 8px 7px;
}
#recordDialog.odoo-document-dialog .dialog-footer {
  padding: 10px 20px 12px;
}
@media (max-width: 900px) {
  #recordDialog.odoo-document-dialog .dialog-content {
    padding: 10px 13px 13px;
    gap: 7px;
  }
  #recordDialog.odoo-document-dialog .dynamic-fields,
  #recordDialog.odoo-document-dialog .invoice-dynamic-fields {
    gap: 7px 10px;
    padding: 8px 0;
  }
}
@media (max-width: 560px) {
  #recordDialog.odoo-document-dialog .dialog-content {
    padding: 9px 11px 12px;
    gap: 7px;
  }
  #recordDialog.odoo-document-dialog .invoice-dynamic-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 9px;
  }
  #recordDialog.odoo-document-dialog .invoice-dynamic-fields .invoice-customer-field,
  #recordDialog.odoo-document-dialog .invoice-dynamic-fields .invoice-branch-field,
  #recordDialog.odoo-document-dialog .invoice-dynamic-fields .wide,
  #recordDialog.odoo-document-dialog .invoice-dynamic-fields .order-lines-field {
    grid-column: 1 / -1;
  }
  #recordDialog.odoo-document-dialog .form-field input,
  #recordDialog.odoo-document-dialog .form-field select,
  #recordDialog.odoo-document-dialog .form-field textarea {
    min-height: 31px;
  }
}


/* 1.9.48 — unified interaction, readability, and responsive usability pass. */
:root {
  --ui-radius-sm: 9px;
  --ui-radius-md: 12px;
  --ui-radius-lg: 15px;
  --ui-shadow-card: 0 2px 8px rgba(24, 36, 59, .035);
  --ui-shadow-raised: 0 10px 26px rgba(24, 36, 59, .085);
}

body { line-height: 1.62; }
.page-host { max-width: 1680px; padding: clamp(18px, 2vw, 30px); }
.page-heading { gap: 18px; margin-bottom: 21px; }
.page-heading h1 { font-size: clamp(21px, 1.7vw, 25px); line-height: 1.42; letter-spacing: -.2px; }
.page-subtitle { max-width: 860px; font-size: 12.5px; line-height: 1.75; }

.sidebar { gap: 15px; }
.nav-section-label { padding-top: 13px; font-size: 11.5px; font-weight: 650; }
.nav-tree-heading { min-height: 37px; border-radius: var(--ui-radius-sm); transition: background-color .16s ease, color .16s ease; }
.nav-tree-heading:hover { background: var(--surface-soft); color: var(--ink); }
.nav-item { min-height: 40px; margin-block: 1px; border-inline-start: 3px solid transparent; padding-inline-start: 8px; border-radius: var(--ui-radius-sm); }
.nav-item.active { border-inline-start-color: var(--brand); }
.company-switch { min-height: 58px; border-radius: var(--ui-radius-md); }
.account-user { padding-top: 12px; }

.topbar { min-height: 68px; padding-inline: clamp(14px, 2vw, 30px); }
.topbar-tools { gap: 8px; }
.global-search { min-height: 40px; border-radius: 10px; transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease; }
.global-search:focus-within { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
.top-icon { width: 40px; height: 40px; border-radius: 10px; }
.mobile-menu { border-radius: 10px; }

.button { min-height: 39px; border-radius: 9px; transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease; }
.button:disabled, button:disabled { cursor: not-allowed; }
.button:disabled { opacity: .52; box-shadow: none; }
.button-primary { box-shadow: 0 2px 5px color-mix(in srgb, var(--brand) 16%, transparent); }
.button-primary:hover:not(:disabled) { box-shadow: 0 5px 13px color-mix(in srgb, var(--brand) 19%, transparent); }

.panel, .metric-card, .settings-card { border-radius: var(--ui-radius-md); box-shadow: var(--ui-shadow-card); }
.panel { padding: 18px; }
.panel-header { margin-bottom: 16px; }
.panel-header h2 { font-size: 14px; line-height: 1.55; }
.panel-caption { font-size: 11.5px; line-height: 1.65; }
.metric-card { padding: 16px; }
.metric-top { font-size: 11.5px; }
.metric-value { font-size: 23px; }
.metric-foot { line-height: 1.55; }
.status-pill { min-height: 25px; padding-inline: 9px; line-height: 1.35; }
.workflow-shortcuts { border-radius: var(--ui-radius-md); padding: 11px 13px; }
.workflow-shortcut { min-height: 34px; border-radius: 8px; }

.module-toolbar-advanced { gap: 9px; }
.table-search { min-height: 40px; border-radius: 9px; }
.range-select, .table-date-filters input, .page-size-label select, .saved-view-select { min-height: 38px; border-radius: 9px; font-size: 12px; }
.table-container { border-radius: var(--ui-radius-md); box-shadow: var(--ui-shadow-card); }
.table-scroll { scrollbar-color: var(--line) transparent; scrollbar-width: thin; overscroll-behavior-inline: contain; }
.table-scroll::-webkit-scrollbar { height: 9px; }
.table-scroll::-webkit-scrollbar-thumb { border: 2px solid var(--surface); border-radius: 10px; background: var(--line); }
.data-table th { padding: 13px 14px; font-size: 11.5px; font-weight: 650; }
.data-table td { padding: 14px; font-size: 12px; line-height: 1.55; }
.data-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-soft) 42%, var(--surface)); }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--brand-soft) 70%, var(--surface)); }
.data-table tbody tr.is-selected-invoice,
.data-table tbody tr.is-selected-invoice:hover { background: color-mix(in srgb, var(--brand) 12%, var(--surface)); }
.panel.table-container { padding: 0; }
.table-sort { min-height: 30px; font-size: inherit; }
.row-open { min-height: 34px; padding-inline: 10px; border-radius: 8px; font-weight: 650; }
.table-summary { font-size: 11.5px; }
.table-pagination { gap: 8px; }
.table-pagination .button { min-height: 36px; }
.empty-state { padding: 48px 16px; font-size: 13px; line-height: 1.8; }

.form-field { gap: 7px; }
.form-field > span { font-size: 12px; font-weight: 600; }
.form-field input, .form-field select, .form-field textarea, .assistant-prompt input { min-height: 42px; border-radius: 9px; font-size: 13px; transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; }
.form-field textarea { min-height: 86px; line-height: 1.65; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 11%, transparent); outline: 0; }
.dialog { border-radius: 16px; }
.dialog-header { position: sticky; top: 0; z-index: 3; background: var(--surface); }
.dialog-header h2 { font-size: 17px; }
.dialog-close { width: 38px; height: 38px; border-radius: 9px; }
.dialog-footer { position: sticky; bottom: 0; z-index: 2; border-top: 1px solid var(--line); background: var(--surface); }

:root[data-theme="dark"] .data-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-soft) 36%, var(--surface)); }
:root[data-theme="dark"] .data-table tbody tr:hover { background: color-mix(in srgb, var(--brand) 18%, var(--surface)); }
:root[data-theme="dark"] .dialog-header,
:root[data-theme="dark"] .dialog-footer { background: var(--surface); }
:root[data-theme="dark"] .button-primary { box-shadow: 0 2px 7px rgba(0, 0, 0, .18); }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .panel, .metric-card, .settings-card { transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
  .panel:hover, .metric-card:hover, .settings-card:hover { box-shadow: var(--ui-shadow-raised); }
  .metric-card:hover { transform: translateY(-1px); }
  .nav-item:hover { transform: translateX(-1px); }
}

@media (max-width: 900px) {
  .page-host { padding: 17px; }
  .panel { padding: 15px; }
  .metric-card { padding: 13px; }
  .data-table td { padding: 12px; }
}

@media (max-width: 760px) {
  .page-host { padding: 15px 12px; }
  .topbar { gap: 7px 9px; padding: 8px 12px 10px; }
  .topbar-tools { gap: 6px; }
  .topbar-tools .theme-toggle,
  .topbar-tools #notificationButton,
  .topbar-tools #simpleHomeButton { flex-basis: 38px; width: 38px; min-width: 38px; height: 38px; }
  .app-mode-toggle { min-height: 40px; border-radius: 10px; }
  .global-search { min-height: 40px; }
  .page-heading { margin-bottom: 16px; }
  .page-heading h1 { font-size: 21px; }
  .panel { padding: 14px; }
  .metric-card { min-height: 112px; padding: 12px; }
  .metric-value { font-size: 20px; }
  .module-toolbar-advanced { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  .module-toolbar-advanced .toolbar-start { display: grid; grid-template-columns: minmax(0, 1fr) minmax(112px, auto); min-width: 0; gap: 7px; }
  .module-toolbar-advanced .table-search { width: 100%; min-width: 0; }
  .table-date-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
  .table-date-filters label { justify-content: space-between; min-width: 0; font-size: 11px; }
  .table-date-filters input { min-width: 0; width: 100%; }
  .toolbar-actions { display: flex; align-items: stretch; gap: 6px; }
  .toolbar-actions > .button, .toolbar-actions > .column-picker { flex: 1 1 auto; }
  .toolbar-actions > .button { min-width: 0; min-height: 38px; white-space: normal; }
  .toolbar-actions .column-picker > summary { width: 100%; min-height: 38px; }
  .data-table th { padding: 11px 10px; }
  .data-table td { padding: 12px 10px; font-size: 11.5px; }
  .table-scroll::after { content: "مرّر الجدول أفقياً لعرض بقية الأعمدة"; display: block; padding: 7px 10px; border-top: 1px dashed var(--line); background: var(--surface-soft); color: var(--muted); font-size: 10px; text-align: center; }
  .table-summary { flex-wrap: wrap; padding: 10px 12px; }
  .dialog { width: min(100% - 16px, 720px); max-height: calc(100dvh - 16px - env(safe-area-inset-top)); margin: auto; border-radius: 14px; }
  .dialog-header { padding: 14px 15px 11px; }
  .dialog-content { padding: 14px 15px; }
  .dialog-footer { padding: 11px 15px calc(13px + env(safe-area-inset-bottom)); }
  .dialog-footer .button { min-height: 42px; }
  .nav-item { min-height: 44px; }
  .nav-tree-heading { min-height: 42px; }
  .mobile-menu { width: 40px; height: 40px; }
  .sidebar { padding-top: max(18px, env(safe-area-inset-top)); padding-bottom: max(14px, env(safe-area-inset-bottom)); }
}

@media (max-width: 420px) {
  .page-host { padding: 12px 10px; }
  .topbar { padding-inline: 9px; }
  .topbar-tools { gap: 5px; }
  .app-mode-toggle { flex: 0 0 40px; width: 40px; min-width: 40px; justify-content: center; padding-inline: 0; }
  .app-mode-toggle-label { display: none !important; }
  .app-mode-toggle-icon { font-size: 17px; }
  .global-search-wrap { flex: 1 1 90px; min-width: 0; }
  .global-search { min-width: 0; padding-inline: 7px; }
  .global-search input { font-size: 10.5px; }
  .topbar-tools .theme-toggle,
  .topbar-tools #notificationButton,
  .topbar-tools #simpleHomeButton { flex-basis: 36px; width: 36px; min-width: 36px; height: 36px; }
  .module-toolbar-advanced .toolbar-start { grid-template-columns: minmax(0, 1fr) minmax(98px, auto); }
  .page-heading h1 { font-size: 20px; }
  .heading-actions { gap: 6px; }
  .heading-actions .button { font-size: 10.5px; }
  .metric-grid { gap: 7px; }
  .metric-card { min-height: 106px; padding: 10px; }
  .metric-value { font-size: 18px; }
  .panel { padding: 12px; }
  .app-footer { padding-inline: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .panel, .metric-card, .settings-card, .nav-item { transition: none !important; transform: none !important; }
}

/* 1.9.49 — shared module workspaces and document editor system */
.module-page-heading {
  align-items: center;
  gap: 20px;
  padding: 19px 21px;
  margin-bottom: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(115deg, color-mix(in srgb, var(--brand-soft) 66%, var(--surface)), var(--surface) 62%);
  box-shadow: 0 3px 12px rgba(24, 36, 59, .035);
}
.module-hero-main { display: grid; gap: 9px; min-width: 0; }
.module-context-line { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 10.5px; }
.module-section-label { color: var(--brand-deep); font-weight: 750; }
.module-context-divider { color: var(--line-strong, #aab9c9); }
.module-workspace-label { color: var(--muted); }
.module-title-lockup { display: flex; align-items: center; gap: 13px; min-width: 0; }
.module-hero-icon { display: grid; place-items: center; flex: 0 0 49px; width: 49px; height: 49px; border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--line)); border-radius: 14px; background: var(--surface); color: var(--brand); box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 9%, transparent); }
.module-hero-icon svg { width: 23px; height: 23px; stroke: currentColor; }
.module-title-copy { min-width: 0; }
.module-title-copy h1 { margin: 0; font-size: clamp(21px, 1.7vw, 26px); line-height: 1.35; font-weight: 750; letter-spacing: -.35px; }
.module-title-copy .page-subtitle { max-width: 900px; margin-top: 5px; line-height: 1.75; }
.module-heading-actions { align-items: center; flex: 0 0 auto; }
.module-heading-actions .button { min-height: 41px; white-space: nowrap; }
.module-create-action { box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 19%, transparent); }
.module-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 13px; }
.module-summary-card { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 82px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: 0 2px 8px rgba(24, 36, 59, .025); }
.module-summary-icon { display: grid; place-items: center; flex: 0 0 39px; width: 39px; height: 39px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); }
.module-summary-icon svg { width: 19px; height: 19px; stroke: currentColor; }
.module-summary-card[data-tone="teal"] .module-summary-icon { color: var(--green); background: var(--green-soft); }
.module-summary-card[data-tone="violet"] .module-summary-icon { color: var(--brand-deep); background: color-mix(in srgb, var(--brand-deep) 9%, var(--surface)); }
.module-summary-copy { display: grid; gap: 1px; min-width: 0; }
.module-summary-copy > span { color: var(--muted); font-size: 10.5px; font-weight: 650; }
.module-summary-copy > strong { color: var(--ink); font-size: 21px; font-weight: 800; line-height: 1.25; font-variant-numeric: tabular-nums; }
.module-summary-copy > small { overflow: hidden; color: var(--muted); font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.module-toolbar-advanced { align-items: stretch; display: grid; grid-template-columns: minmax(250px, 1.05fr) minmax(320px, 1.35fr); gap: 12px; margin: 0 0 12px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.module-filter-group, .module-tools-group { display: grid; align-content: start; gap: 8px; min-width: 0; }
.module-tools-group { padding-inline-start: 12px; border-inline-start: 1px solid var(--line); }
.toolbar-group-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; }
.toolbar-group-heading strong { color: var(--ink); font-size: 11px; font-weight: 750; }
.toolbar-group-heading span { color: var(--muted); font-size: 9.5px; }
.module-toolbar-advanced .toolbar-start { display: grid; grid-template-columns: minmax(0, 1fr) minmax(118px, auto); gap: 7px; min-width: 0; }
.module-search-field { position: relative; display: flex; align-items: center; min-width: 0; }
.module-search-icon { position: absolute; inset-inline-start: 10px; display: grid; place-items: center; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.module-search-icon svg { width: 16px; height: 16px; stroke: currentColor; }
.module-search-field .table-search { width: 100%; min-width: 0; padding-inline-start: 33px; }
.module-toolbar-advanced .module-status-field { min-width: 0; }
.module-toolbar-advanced .module-status-field select { width: 100%; min-width: 0; }
.module-toolbar-advanced .table-date-filters { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 9px; margin-top: 1px; }
.module-toolbar-advanced .table-date-filters label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.module-toolbar-advanced .table-date-filters input { width: 135px; min-width: 0; }
.module-tools-group .toolbar-actions { align-items: center; justify-content: flex-start; gap: 6px; }
.module-tools-group .toolbar-actions > .button,
.module-tools-group .column-picker > summary { min-height: 36px; padding-inline: 10px; font-size: 10.5px; }
.module-tools-group .view-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.module-tools-group .view-switch .button { min-height: 30px; padding: 4px 10px; border-color: transparent; background: transparent; font-size: 10px; }
.module-tools-group .view-switch .button.active { border-color: var(--line); background: var(--surface); color: var(--brand-deep); box-shadow: 0 1px 4px rgba(24, 36, 59, .08); }
.module-records-panel { border-radius: 14px; }
.module-records-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 17px 12px; border-bottom: 1px solid var(--line); }
.module-records-heading h2 { margin: 0; color: var(--ink); font-size: 13px; font-weight: 750; }
.module-records-heading p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.module-current-view { flex: 0 0 auto; padding: 5px 9px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface-soft); color: var(--muted); font-size: 9.5px; }
.module-records-panel .table-scroll { border-radius: 0; }
.module-records-panel .table-summary { padding-inline: 16px; }
.module-records-panel .table-pagination { padding: 0 16px 15px; }
.module-records-panel .data-table th:first-child { padding-inline-start: 17px; }
.module-records-panel .data-table td:last-child { white-space: nowrap; }
.module-records-panel .empty-state { min-height: 178px; display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--muted); }

/* Progressive disclosure for optional and rarely used form fields. */
.record-advanced-details,
.settings-advanced-details {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 30%, var(--surface));
}
.record-advanced-details { grid-column: 1 / -1; padding: 11px 13px; }
.record-advanced-details > summary,
.settings-advanced-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}
.record-advanced-details > summary::-webkit-details-marker,
.settings-advanced-details > summary::-webkit-details-marker { display: none; }
.record-advanced-details > summary::after,
.settings-advanced-details > summary::after {
  content: "＋";
  display: grid;
  place-items: center;
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand);
  font-size: 14px;
}
.record-advanced-details[open] > summary::after,
.settings-advanced-details[open] > summary::after { content: "−"; }
.record-advanced-details > summary small {
  margin-inline-start: auto;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}
.record-advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  padding-top: 13px;
}
.settings-advanced-details { padding: 12px 14px; }
.settings-advanced-details[open] > summary { margin-bottom: 13px; }
.settings-advanced-details .company-settings-grid { margin-bottom: 12px; }
.settings-advanced-details .invoice-artwork-settings,
.settings-advanced-details .invoice-design-grid { margin-top: 12px; }
.record-advanced-details > summary:focus-visible,
.settings-advanced-details > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
:root[data-theme="dark"] .record-advanced-details,
:root[data-theme="dark"] .settings-advanced-details { background: color-mix(in srgb, var(--surface-soft) 45%, var(--surface)); }

/* Common, Odoo-inspired grouping for sales and procurement documents. */
#recordDialog.odoo-document-dialog { width: min(930px, calc(100vw - 28px)); }
#recordDialog.odoo-document-dialog .dialog-content { gap: 16px; }
#recordDialog.odoo-document-dialog .document-dynamic-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 0; border: 0; }
#recordDialog.odoo-document-dialog .document-field-section { min-width: 0; padding: 14px 15px 15px; border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb, var(--surface-soft) 30%, var(--surface)); }
#recordDialog.odoo-document-dialog .document-field-section-collapsible { padding: 11px 14px 13px; }
#recordDialog.odoo-document-dialog .document-field-section-collapsible > summary { margin: 0; cursor: pointer; list-style: none; }
#recordDialog.odoo-document-dialog .document-field-section-collapsible > summary::-webkit-details-marker { display: none; }
#recordDialog.odoo-document-dialog .document-field-section-collapsible > summary::after { content: "＋"; display: grid; place-items: center; flex: 0 0 25px; width: 25px; height: 25px; border: 1px solid var(--line); border-radius: 8px; color: var(--brand); }
#recordDialog.odoo-document-dialog .document-field-section-collapsible[open] > summary { margin-bottom: 13px; }
#recordDialog.odoo-document-dialog .document-field-section-collapsible[open] > summary::after { content: "−"; }
#recordDialog.odoo-document-dialog .document-field-heading-copy { display: grid; gap: 2px; min-width: 0; }
#recordDialog.odoo-document-dialog .document-field-heading-copy strong { color: var(--ink); font-size: 12px; font-weight: 750; }
#recordDialog.odoo-document-dialog .document-field-heading-copy small { color: var(--muted); font-size: 9.5px; line-height: 1.55; font-weight: 400; }
#recordDialog.odoo-document-dialog .document-field-toggle { margin-inline-start: auto; color: var(--muted); font-size: 9px; white-space: nowrap; }
#recordDialog.odoo-document-dialog .document-field-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
#recordDialog.odoo-document-dialog .document-field-heading-icon { display: grid; place-items: center; flex: 0 0 31px; width: 31px; height: 31px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); }
#recordDialog.odoo-document-dialog .document-field-heading-icon svg { width: 16px; height: 16px; stroke: currentColor; }
#recordDialog.odoo-document-dialog .document-field-heading h3 { margin: 0; color: var(--ink); font-size: 12px; font-weight: 750; }
#recordDialog.odoo-document-dialog .document-field-heading p { margin: 2px 0 0; color: var(--muted); font-size: 9.5px; line-height: 1.55; }
#recordDialog.odoo-document-dialog .document-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 17px; min-width: 0; }
#recordDialog.odoo-document-dialog .document-field-grid > .wide,
#recordDialog.odoo-document-dialog .document-field-grid > .order-lines-field { grid-column: 1 / -1; }
#recordDialog.odoo-document-dialog .document-field-grid .form-field { min-width: 0; }
#recordDialog.odoo-document-dialog .document-field-grid .invoice-customer-field,
#recordDialog.odoo-document-dialog .document-field-grid .invoice-branch-field { grid-column: 1 / -1; }
#recordDialog.odoo-document-dialog .odoo-document-ribbon { margin-inline: 22px; border-radius: 10px; }
#recordDialog.odoo-document-dialog .odoo-doc-kicker { font-weight: 750; }
#recordDialog.odoo-document-dialog .odoo-doc-reference { font-variant-numeric: tabular-nums; }
#recordDialog.odoo-document-dialog .dialog-footer { gap: 9px; }
#recordDialog.odoo-document-dialog .dialog-footer .button { min-width: 105px; min-height: 42px; }

:root[data-theme="dark"] .module-page-heading { background: linear-gradient(115deg, color-mix(in srgb, var(--brand) 18%, var(--surface)), var(--surface) 62%); box-shadow: none; }
:root[data-theme="dark"] .module-hero-icon,
:root[data-theme="dark"] .module-summary-card { box-shadow: none; }
:root[data-theme="dark"] .module-tools-group .view-switch .button.active { background: var(--surface); }
:root[data-theme="dark"] #recordDialog.odoo-document-dialog .document-field-section { background: color-mix(in srgb, var(--surface-soft) 45%, var(--surface)); }

@media (max-width: 900px) {
  .module-page-heading { align-items: flex-start; }
  .module-toolbar-advanced { grid-template-columns: minmax(0, 1fr); }
  .module-tools-group { padding-inline-start: 0; padding-top: 10px; border-inline-start: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .module-page-heading { padding: 14px; border-radius: 13px; }
  .module-title-lockup { align-items: flex-start; gap: 10px; }
  .module-hero-icon { flex-basis: 40px; width: 40px; height: 40px; border-radius: 11px; }
  .module-hero-icon svg { width: 19px; height: 19px; }
  .module-title-copy h1 { font-size: 20px; }
  .module-title-copy .page-subtitle { font-size: 11px; }
  .module-heading-actions { width: 100%; }
  .module-heading-actions .button { flex: 1 1 auto; min-width: 0; }
  .module-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .module-summary-card { min-height: 74px; padding: 10px; gap: 8px; }
  .module-summary-icon { flex-basis: 32px; width: 32px; height: 32px; border-radius: 9px; }
  .module-summary-copy > strong { font-size: 18px; }
  .module-summary-copy > small { font-size: 9px; }
  .module-toolbar-advanced { padding: 10px; gap: 10px; }
  .module-toolbar-advanced .toolbar-start { grid-template-columns: minmax(0, 1fr) minmax(100px, .45fr); }
  .module-toolbar-advanced .table-date-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-toolbar-advanced .table-date-filters label { align-items: stretch; flex-direction: column; gap: 4px; }
  .module-toolbar-advanced .table-date-filters input { width: 100%; }
  .module-tools-group .toolbar-actions > .button { flex: 1 1 auto; }
  .module-records-heading { padding: 12px; }
  .module-records-heading p { max-width: 260px; }
  #recordDialog.odoo-document-dialog { width: calc(100vw - 12px); max-width: calc(100vw - 12px); max-height: calc(100dvh - 12px); }
  #recordDialog.odoo-document-dialog .dialog-content { padding: 12px; }
  #recordDialog.odoo-document-dialog .document-field-section { padding: 11px; }
  #recordDialog.odoo-document-dialog .document-field-grid { gap: 11px; }
  .record-advanced-grid { grid-template-columns: minmax(0, 1fr); }
  .record-advanced-details > summary { align-items: flex-start; }
  .record-advanced-details > summary small { display: none; }
  .settings-advanced-details { padding: 10px; }
}
@media (max-width: 420px) {
  .module-page-heading { padding: 12px; }
  .module-context-line { font-size: 9.5px; }
  .module-title-copy h1 { font-size: 18px; }
  .module-heading-actions { gap: 6px; }
  .module-heading-actions .button { font-size: 10px; padding-inline: 8px; }
  .module-summary-grid { gap: 6px; }
  .module-summary-card { align-items: flex-start; min-height: 70px; padding: 9px 8px; }
  .module-summary-icon { flex-basis: 29px; width: 29px; height: 29px; }
  .module-summary-copy > span { font-size: 9.5px; }
  .module-summary-copy > strong { font-size: 16px; }
  .module-toolbar-advanced .toolbar-start { grid-template-columns: minmax(0, 1fr); }
  .module-toolbar-advanced .module-status-field select { min-height: 38px; }
  .module-tools-group .toolbar-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-tools-group .view-switch { grid-column: 1 / -1; justify-content: center; }
  .module-tools-group .view-switch .button { flex: 1; }
  .module-current-view { display: none; }
  #recordDialog.odoo-document-dialog .document-field-grid { grid-template-columns: minmax(0, 1fr); }
  #recordDialog.odoo-document-dialog .document-field-grid > .wide,
  #recordDialog.odoo-document-dialog .document-field-grid > .order-lines-field,
  #recordDialog.odoo-document-dialog .document-field-grid .invoice-customer-field,
  #recordDialog.odoo-document-dialog .document-field-grid .invoice-branch-field { grid-column: auto; }
}

/* 1.9.50 — centralized settings workspace */
.settings-center-version { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); background: var(--surface); font-size: 10px; white-space: nowrap; }
.settings-center-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.settings-center-search { display: flex; align-items: center; gap: 9px; flex: 1; max-width: 620px; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); }
.settings-center-search svg { width: 17px; height: 17px; flex: none; }
.settings-center-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 12px; }
.settings-center-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
.settings-center-count { color: var(--muted); font-size: 11px; white-space: nowrap; }
.settings-center-layout { display: grid; grid-template-columns: 218px minmax(0, 1fr); align-items: start; gap: 14px; }
.settings-center-nav { position: sticky; top: 12px; display: grid; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.settings-center-nav button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 39px; padding: 7px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 11px; text-align: right; cursor: pointer; }
.settings-center-nav button svg { width: 16px; height: 16px; flex: none; }
.settings-center-nav button:hover { color: var(--ink); background: var(--surface-soft); }
.settings-center-nav button.is-active { border-color: color-mix(in srgb, var(--brand) 20%, var(--line)); background: var(--brand-soft); color: var(--brand-deep); font-weight: 700; }
.settings-center-content { min-width: 0; }
.settings-center-content .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-center-content [data-settings-panel][hidden] { display: none !important; }
.settings-no-results { grid-column: 1 / -1; padding: 24px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); background: var(--surface); text-align: center; font-size: 12px; }
.operational-settings-card { grid-column: 1 / -1; }
.operational-settings-form { display: grid; gap: 17px; }
.settings-form-section { display: grid; gap: 10px; }
.settings-form-section + .settings-form-section { padding-top: 14px; border-top: 1px solid var(--line); }
.settings-form-section h3 { margin: 0; color: var(--ink); font-size: 12px; }
.settings-prefix-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.settings-prefix-grid input { text-transform: uppercase; }
.settings-prefix-grid .form-field small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.settings-shortcut-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.settings-shortcut { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; min-height: 39px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--ink); font: inherit; font-size: 11px; text-align: right; cursor: pointer; }
.settings-shortcut:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); }
.settings-shortcut span:first-child { min-width: 0; }
.settings-center-content .branch-management,
.settings-center-content .user-management,
.settings-center-content .audit-log { margin-top: 13px; }
.settings-center-content .settings-feedback { margin-top: 12px; }
:root[data-table-density="compact"] .data-table th,
:root[data-table-density="compact"] .data-table td { padding-top: 6px; padding-bottom: 6px; }
:root[data-table-density="comfortable"] .data-table th,
:root[data-table-density="comfortable"] .data-table td { padding-top: 11px; padding-bottom: 11px; }
:root[data-theme="dark"] .settings-center-nav button.is-active { color: var(--brand-cyan); }
@media (max-width: 980px) {
  .settings-center-layout { grid-template-columns: 1fr; }
  .settings-center-nav { position: static; display: flex; overflow-x: auto; gap: 5px; padding: 7px; }
  .settings-center-nav button { flex: 0 0 auto; width: auto; white-space: nowrap; }
  .settings-center-nav button span { white-space: nowrap; }
}
@media (max-width: 760px) {
  .settings-center-content .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .operational-settings-card { grid-column: auto; }
  .settings-prefix-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-center-toolbar { align-items: stretch; flex-direction: column; }
  .settings-center-search { max-width: none; }
  .settings-center-count { text-align: left; }
}
@media (max-width: 420px) {
  .settings-prefix-grid, .settings-shortcut-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-center-version { display: none; }
  .settings-center-nav button { min-height: 38px; padding-inline: 9px; }
}

/* Settings Center Phase II */
.settings-form-section { display: grid; gap: 14px; margin-top: 14px; }
.custom-role-list, .document-profile-list { display: grid; gap: 8px; }
.custom-role-item, .document-profile-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border: 1px solid var(--border, #dfe5ec); border-radius: 11px; background: var(--surface, #fff); }
.custom-role-item > div:first-child, .document-profile-item > div:first-child { display: grid; gap: 3px; min-width: 0; }
.custom-role-item small, .document-profile-item small { color: var(--text-muted, #667085); font-size: 12px; }
.custom-role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; max-height: 430px; overflow: auto; padding: 9px; border: 1px solid var(--border, #dfe5ec); border-radius: 11px; }
.custom-role-module { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; background: var(--surface-soft, #f7f9fc); font-size: 12px; }
.custom-role-module > span:not(:first-child) { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; color: var(--text-muted, #667085); }
.custom-role-module input { accent-color: var(--brand, #0071bc); }
.notification-preference-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.notification-preference-grid .setting-check-row { min-height: 46px; padding: 9px 11px; border: 1px solid var(--border, #dfe5ec); border-radius: 9px; }
.settings-form-section h3 { margin: 7px 0 0; color: var(--text, #18213a); font-size: 14px; }
.settings-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.danger-text { color: #b42318 !important; }
:root[data-theme="dark"] .custom-role-item,
:root[data-theme="dark"] .document-profile-item,
:root[data-theme="dark"] .custom-role-grid,
:root[data-theme="dark"] .custom-role-module,
:root[data-theme="dark"] .notification-preference-grid .setting-check-row { background: var(--surface, #161d2a); border-color: var(--border, #334155); }
@media (max-width: 760px) {
  .custom-role-grid, .notification-preference-grid { grid-template-columns: minmax(0, 1fr); }
  .custom-role-item, .document-profile-item { align-items: flex-start; flex-direction: column; }
  .custom-role-module { grid-template-columns: minmax(0, 1fr) auto auto; }
}

/* Explicit contrast for legacy settings headings in dark mode. */
:root[data-theme="dark"] .settings-form-section h3,
:root[data-theme="dark"] .settings-center-nav button,
:root[data-theme="dark"] .settings-center-nav button:hover,
:root[data-theme="dark"] .custom-role-item small,
:root[data-theme="dark"] .document-profile-item small {
  color: var(--ink);
}
:root[data-theme="dark"] .settings-center-nav button.is-active {
  color: var(--brand-cyan);
}

/* Final dark-mode contrast overrides for controls whose legacy rules use !important. */
:root[data-theme="dark"] .app-mode-toggle,
:root[data-theme="dark"] .app-mode-toggle[data-current-mode="simple"],
:root[data-theme="dark"] .app-mode-toggle:hover,
:root[data-theme="dark"] .app-mode-toggle:focus-visible {
  color: #071a2b !important;
  border-color: var(--brand-cyan) !important;
  background: var(--brand-cyan) !important;
}
:root[data-theme="dark"] .app-mode-toggle-icon,
:root[data-theme="dark"] .app-mode-toggle-label { color: inherit !important; }
:root[data-theme="dark"] .simple-action-card.is-primary .simple-action-icon {
  color: #0d152b;
}
:root[data-theme="dark"] .notification-count {
  color: #fff;
  background: #873b52;
}

@media (max-width: 600px) {
  .simple-vendor-invoice-option { grid-template-columns: minmax(0,1fr) auto; }
  .simple-vendor-invoice-option .button { grid-column: 1 / -1; width: 100%; }
  .simple-home-settings-dialog .dialog-footer { flex-wrap: wrap; }
  .simple-home-toolbar { align-items: flex-start; }
  .simple-home-toolbar small { max-width: 210px; }
}

/* Personal Simple Mode: direct one-user invoice workflow */
.simple-direct-invoice-form { display: grid; gap: 13px; }
.simple-direct-mode-note { margin: 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); color: var(--ink); font-size: 12px; line-height: 1.8; }
.simple-direct-product-entry { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, .7fr); gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.simple-direct-product-entry > .form-field:first-child { grid-column: 1 / -1; }
.simple-direct-entry-numbers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.simple-direct-add { min-height: 42px; align-self: end; }
.simple-direct-lines-section { display: grid; gap: 9px; }
.simple-direct-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.simple-direct-section-heading strong { font-size: 13px; }
.simple-direct-section-heading small { color: var(--muted); font-size: 11px; }
.simple-direct-lines { display: grid; gap: 7px; }
.simple-direct-line { display: grid; grid-template-columns: minmax(0, 1fr) auto 32px; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.simple-direct-line-copy { display: grid; gap: 3px; min-width: 0; }
.simple-direct-line-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.simple-direct-line-copy small { color: var(--muted); font-size: 10px; }
.simple-direct-line > strong { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.simple-direct-remove { width: 30px; min-width: 30px; padding: 0; font-size: 18px; }
.simple-direct-settings-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.simple-direct-payment-toggle { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.simple-direct-payment-toggle input { width: 18px; height: 18px; accent-color: var(--brand); }
.simple-direct-payment-toggle span { display: grid; gap: 2px; }
.simple-direct-payment-toggle strong { font-size: 12px; }
.simple-direct-payment-toggle small { color: var(--muted); font-size: 10px; }
.simple-direct-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border-radius: 12px; background: var(--surface-soft); }
.simple-direct-total span { color: var(--muted); font-size: 13px; }
.simple-direct-total strong { color: var(--ink); font-size: 20px; font-variant-numeric: tabular-nums; }
.simple-direct-hint { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.8; }
.simple-direct-submit { min-height: 48px; width: 100%; }
@media (max-width: 640px) {
  .simple-direct-product-entry { grid-template-columns: minmax(0, 1fr); }
  .simple-direct-entry-numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .simple-direct-settings-row { grid-template-columns: minmax(0, 1fr); }
  .simple-direct-section-heading { align-items: flex-start; flex-direction: column; }
  .simple-direct-total strong { font-size: 17px; }
}


/* Previous simple dashboard grid rules retained for backward-compatible cascade; superseded by 1.9.59 below. */
.app-shell.simple-mode .simple-home-screen {
  min-height: 0 !important;
  height: auto !important;
  overflow: visible !important;
  gap: 14px;
}
.app-shell.simple-mode .simple-home-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-auto-rows: minmax(158px, auto) !important;
  gap: clamp(12px, 1.15vw, 18px) !important;
  min-height: 0 !important;
  height: auto !important;
  flex: 0 0 auto !important;
  align-content: start !important;
  overflow: visible !important;
}
.app-shell.simple-mode .simple-home-action {
  min-height: 158px !important;
  height: auto !important;
  gap: 12px !important;
  padding: clamp(14px, 1.5vw, 22px) !important;
  border-radius: 20px !important;
}
.app-shell.simple-mode .simple-home-label {
  max-width: 100%;
  font-size: clamp(16px, 1.45vw, 25px) !important;
  line-height: 1.4 !important;
  overflow-wrap: anywhere;
}
/* The primary sales and invoice tiles intentionally exchange their former blue/purple colours. */
.app-shell.simple-mode .simple-home-action.is-sale {
  border-color: #0071bc !important;
  background: #1b1464 !important;
  color: #fff !important;
}
.app-shell.simple-mode .simple-home-action.is-sale:hover {
  background: #282080 !important;
  box-shadow: 0 8px 24px rgba(27, 20, 100, .22) !important;
}
.app-shell.simple-mode .simple-home-action.is-invoices {
  border-color: #21186e !important;
  background: #0071bc !important;
  color: #fff !important;
}
.app-shell.simple-mode .simple-home-action.is-invoices:hover {
  background: #0782d2 !important;
  box-shadow: 0 8px 24px rgba(0, 113, 188, .22) !important;
}
.simple-direct-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
@media (max-width: 1050px) {
  .app-shell.simple-mode .simple-home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 650px) {
  .app-shell.simple-mode .simple-home-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .app-shell.simple-mode .simple-home-action { min-height: 118px !important; }
  .app-shell.simple-mode .simple-home-label { font-size: 18px !important; }
}


/* 1.9.58 — Keep the shortcut grid and its footer inside one continuous board; alternate tile colours. */
.app-shell.simple-mode .simple-home-screen {
  display: flex !important;
  flex: 0 0 auto !important;
  flex-direction: column !important;
  align-items: stretch !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  gap: 14px !important;
  padding: clamp(12px, 1.4vw, 22px) !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}
.app-shell.simple-mode .simple-home-toolbar {
  flex: 0 0 auto !important;
  width: 100% !important;
  min-width: 0 !important;
}
.app-shell.simple-mode .simple-home-board {
  display: flow-root !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  box-sizing: border-box !important;
  padding: clamp(10px, 1.15vw, 18px) !important;
  border: 1px solid var(--simple-border) !important;
  border-radius: clamp(16px, 1.8vw, 28px) !important;
  background: var(--canvas) !important;
  overflow: visible !important;
}
:root[data-theme="light"] .app-shell.simple-mode .simple-home-board {
  background: var(--canvas) !important;
}
.app-shell.simple-mode .simple-home-grid {
  display: grid !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  flex: 0 0 auto !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-template-rows: none !important;
  grid-auto-flow: row !important;
  grid-auto-rows: minmax(145px, auto) !important;
  align-content: start !important;
  gap: clamp(10px, 1.1vw, 17px) !important;
  direction: rtl !important;
  overflow: visible !important;
}
.app-shell.simple-mode .simple-home-action {
  display: flex !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 145px !important;
  height: 100% !important;
  box-sizing: border-box !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  padding: clamp(12px, 1.25vw, 20px) !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  border-radius: 18px !important;
  color: #fff !important;
  text-align: center !important;
  overflow-wrap: anywhere !important;
  box-shadow: 0 5px 14px rgba(0,0,0,.12) !important;
  transition: transform .16s ease, filter .16s ease, box-shadow .16s ease !important;
}
/* Six hues repeat in order so neighbouring shortcuts remain visually distinct. */
.app-shell.simple-mode .simple-home-action:nth-child(6n + 1) { background: linear-gradient(145deg, #075985, #0b4565) !important; }
.app-shell.simple-mode .simple-home-action:nth-child(6n + 2) { background: linear-gradient(145deg, #5140a8, #34266f) !important; }
.app-shell.simple-mode .simple-home-action:nth-child(6n + 3) { background: linear-gradient(145deg, #0f766e, #10524d) !important; }
.app-shell.simple-mode .simple-home-action:nth-child(6n + 4) { background: linear-gradient(145deg, #a12b53, #70203f) !important; }
.app-shell.simple-mode .simple-home-action:nth-child(6n + 5) { background: linear-gradient(145deg, #946016, #68420f) !important; }
.app-shell.simple-mode .simple-home-action:nth-child(6n + 6) { background: linear-gradient(145deg, #3946a6, #252e70) !important; }
.app-shell.simple-mode .simple-home-action:hover {
  filter: brightness(1.12) saturate(1.08) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 22px rgba(0,0,0,.2) !important;
}
.app-shell.simple-mode .simple-home-action:focus-visible {
  outline: 3px solid var(--brand-cyan) !important;
  outline-offset: 3px !important;
}
.app-shell.simple-mode .simple-home-action.is-sale {
  border-color: #4d45aa !important;
  background: linear-gradient(145deg, #5140a8, #34266f) !important;
  color: #fff !important;
}
.app-shell.simple-mode .simple-home-action.is-invoices {
  border-color: #1689c6 !important;
  background: linear-gradient(145deg, #075985, #0b4565) !important;
  color: #fff !important;
}
.app-shell.simple-mode .simple-home-icon {
  flex: 0 0 clamp(36px, 3.5vw, 52px) !important;
  width: clamp(36px, 3.5vw, 52px) !important;
  height: clamp(36px, 3.5vw, 52px) !important;
  color: currentColor !important;
}
.app-shell.simple-mode .simple-home-icon svg {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  stroke: currentColor !important;
}
.app-shell.simple-mode .simple-home-label {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  color: inherit !important;
  font-size: clamp(16px, 1.4vw, 24px) !important;
  line-height: 1.45 !important;
  overflow-wrap: anywhere !important;
}
.app-shell.simple-mode .simple-home-footer-note {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  margin: 12px 0 0 !important;
  padding: 10px 3px 2px !important;
  border-top: 1px solid rgba(255,255,255,.12) !important;
  box-sizing: border-box !important;
  color: var(--simple-muted) !important;
  text-align: end !important;
  line-height: 1.75 !important;
}
:root[data-theme="light"] .app-shell.simple-mode .simple-home-action {
  border-color: rgba(18,39,70,.1) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(23,48,80,.09) !important;
}
:root[data-theme="light"] .app-shell.simple-mode .simple-home-action:nth-child(6n + 1) { background: linear-gradient(145deg, #d8edff, #c3e2fa) !important; color: #123a58 !important; }
:root[data-theme="light"] .app-shell.simple-mode .simple-home-action:nth-child(6n + 2) { background: linear-gradient(145deg, #e8e0ff, #d7cafa) !important; color: #37266d !important; }
:root[data-theme="light"] .app-shell.simple-mode .simple-home-action:nth-child(6n + 3) { background: linear-gradient(145deg, #d2f4ed, #bde8df) !important; color: #10534c !important; }
:root[data-theme="light"] .app-shell.simple-mode .simple-home-action:nth-child(6n + 4) { background: linear-gradient(145deg, #ffe1e9, #f8cbd8) !important; color: #76203e !important; }
:root[data-theme="light"] .app-shell.simple-mode .simple-home-action:nth-child(6n + 5) { background: linear-gradient(145deg, #ffefc7, #f6dfab) !important; color: #64400d !important; }
:root[data-theme="light"] .app-shell.simple-mode .simple-home-action:nth-child(6n + 6) { background: linear-gradient(145deg, #dfe5ff, #cbd5fb) !important; color: #273174 !important; }
:root[data-theme="light"] .app-shell.simple-mode .simple-home-action.is-sale { background: linear-gradient(145deg, #5140a8, #34266f) !important; color: #fff !important; }
:root[data-theme="light"] .app-shell.simple-mode .simple-home-action.is-invoices { background: linear-gradient(145deg, #075985, #0b4565) !important; color: #fff !important; }
@media (max-width: 1050px) {
  .app-shell.simple-mode .simple-home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 650px) {
  .app-shell.simple-mode .simple-home-screen { padding: 10px !important; gap: 10px !important; }
  .app-shell.simple-mode .simple-home-board { padding: 8px !important; border-radius: 14px !important; }
  .app-shell.simple-mode .simple-home-grid { grid-template-columns: minmax(0, 1fr) !important; grid-auto-rows: minmax(88px, auto) !important; gap: 8px !important; }
  .app-shell.simple-mode .simple-home-action { min-height: 88px !important; height: auto !important; flex-direction: row !important; justify-content: flex-start !important; gap: 14px !important; padding: 12px 15px !important; border-radius: 12px !important; text-align: start !important; }
  .app-shell.simple-mode .simple-home-icon { flex: 0 0 34px !important; width: 34px !important; height: 34px !important; }
  .app-shell.simple-mode .simple-home-label { width: auto !important; flex: 1 1 auto !important; text-align: start !important; font-size: 16px !important; }
  .app-shell.simple-mode .simple-home-footer-note { font-size: 10px !important; }
}


/* 1.9.59 — Simple and professional workspaces share identical neutral theme surfaces. */
.app-shell.simple-mode,
.app-shell.simple-mode .main-area,
.app-shell.simple-mode .page-host,
.app-shell.simple-mode .simple-home-screen,
.app-shell.simple-mode .simple-home-board,
.app-shell.simple-mode .app-footer {
  background-color: var(--canvas) !important;
}
.app-shell.simple-mode .topbar {
  background-color: var(--surface) !important;
  border-bottom-color: var(--line) !important;
}
.app-shell.simple-mode .simple-home-board {
  background: var(--canvas) !important;
  border-color: var(--line) !important;
}


/* 1.9.63 — personal activity dashboard and daily sales report */
.simple-quick-dialog.is-activity-dashboard { width: min(1120px, calc(100vw - 24px)); max-width: 1120px; max-height: min(92dvh, 920px); }
.simple-quick-dialog.is-activity-dashboard .dialog-content { display: block; max-height: calc(92dvh - 145px); overflow: auto; padding: 16px 20px 22px; }
.activity-dashboard { display: grid; gap: 14px; color: var(--ink); }
.activity-filter-bar { display: flex; align-items: end; flex-wrap: wrap; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.activity-filter-bar > .form-field { flex: 0 1 190px; }
.activity-custom-range { display: flex; flex: 1 1 320px; gap: 8px; }
.activity-custom-range .form-field { flex: 1; min-width: 130px; }
.activity-filter-bar > .button { min-height: 39px; }
.activity-range-caption { color: var(--muted); font-size: 11px; }
.activity-currency-panel, .activity-dashboard-panel, .activity-daily-report-panel { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.activity-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.activity-section-heading h3, .activity-daily-report-panel h3 { margin: 0; font-size: 13px; font-weight: 750; }
.activity-section-heading p, .activity-daily-report-panel .activity-section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.activity-currency-pill, .activity-count-pill, .activity-report-mark, .activity-personal-tag { flex: none; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); color: var(--brand); font-size: 10px; font-weight: 750; }
.activity-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.activity-summary-card { display: grid; min-width: 0; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.activity-summary-card small { color: var(--muted); font-size: 10px; }
.activity-summary-card strong { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.activity-summary-card span { color: var(--muted); font-size: 9px; line-height: 1.5; }
.activity-summary-card.is-positive strong { color: var(--green); }
.activity-dashboard-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.activity-record-list, .activity-recommendation-list { display: grid; gap: 6px; }
.activity-record-row { display: flex; width: 100%; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); color: var(--ink); text-align: start; cursor: pointer; }
.activity-record-row:hover { border-color: var(--brand); background: var(--brand-soft); }
.activity-record-row > span:first-child { display: grid; gap: 3px; min-width: 0; }
.activity-record-row strong { overflow-wrap: anywhere; font-size: 11px; }
.activity-record-row small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.activity-record-row .status-pill { flex: none; }
.activity-personal-tag { color: var(--green); }
.activity-recommendation { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.activity-recommendation-mark { flex: none; color: var(--brand); font-size: 17px; }
.activity-recommendation > div { flex: 1; min-width: 0; }
.activity-recommendation strong { font-size: 11px; }
.activity-recommendation p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.activity-recommendation .panel-link { flex: none; }
.activity-empty-panel { padding: 16px; border: 1px dashed var(--line); border-radius: 11px; background: var(--surface-soft); }
.activity-empty-panel p { margin: 0; color: var(--muted); font-size: 11px; }
.activity-daily-report-panel { background: linear-gradient(135deg, var(--surface) 0%, var(--surface-soft) 100%); }
.activity-report-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.activity-report-controls .form-field { flex: 0 1 190px; margin-inline-end: auto; }
.activity-report-controls .button { min-height: 39px; }
.activity-data-note { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
@media (max-width: 900px) {
  .simple-quick-dialog.is-activity-dashboard { width: min(760px, calc(100vw - 18px)); max-height: 94dvh; }
  .simple-quick-dialog.is-activity-dashboard .dialog-content { max-height: calc(94dvh - 140px); padding: 12px; }
  .activity-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-dashboard-columns { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .activity-custom-range { flex-basis: 100%; }
  .activity-filter-bar > .form-field { flex: 1 1 100%; }
  .activity-report-controls .form-field { flex: 1 1 100%; margin: 0; }
  .activity-report-controls .button { flex: 1 1 calc(50% - 8px); }
  .activity-summary-card strong { font-size: 14px; }
  .activity-recommendation { align-items: flex-start; }
}


/* Internal bank-name editor; never fall back to a browser prompt. */
.bank-name-dialog { width: min(480px, calc(100vw - 28px)); }
.bank-name-dialog .dialog-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.bank-name-dialog .dialog-content { display: grid; gap: 12px; }
.bank-name-dialog .form-error { margin: 0; color: var(--red); font-size: 12px; }


/* 1.9.102 — Account avatar and time-aware welcome message. */
.morning-message-dialog {
  width: min(510px, calc(100vw - 28px));
  max-width: 510px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line));
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(12, 24, 48, .28);
}
.morning-message-dialog::backdrop { background: rgba(13, 23, 43, .66); backdrop-filter: blur(5px); }
.morning-message-shell {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0;
  min-height: 360px;
  padding: 25px 34px 26px;
  overflow: hidden;
  text-align: center;
  background: radial-gradient(circle at 50% -12%, color-mix(in srgb, var(--brand-cyan) 15%, transparent) 0, transparent 48%), linear-gradient(180deg, var(--surface) 0%, var(--surface) 72%, color-mix(in srgb, var(--brand-soft) 48%, var(--surface)) 100%);
}
.morning-message-dismiss {
  position: absolute; z-index: 5; top: 12px; inset-inline-start: 12px;
  display: grid; place-items: center; width: 31px; height: 31px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: var(--surface);
  font-size: 22px; cursor: pointer;
}
.morning-message-dismiss:hover { color: var(--ink); border-color: var(--brand); background: var(--brand-soft); }
.morning-message-avatar {
  position: relative; display: grid; place-items: center; width: 92px; height: 92px; margin: 4px 0 12px;
  overflow: hidden; border: 3px solid color-mix(in srgb, var(--brand-cyan) 28%, var(--surface));
  border-radius: 50%; background: linear-gradient(145deg, var(--brand-soft), var(--surface));
  box-shadow: 0 9px 24px rgba(7, 26, 55, .13);
}
.morning-message-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.morning-message-avatar img[hidden] { display: none; }
.morning-message-avatar-fallback { display: grid; place-items: center; width: 100%; height: 100%; color: var(--brand); }
.morning-message-avatar-fallback svg { width: 48px; height: 48px; }
.morning-message-avatar-fallback[hidden] { display: none; }
.morning-message-brand { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--brand-deep); font-size: 11px; font-weight: 750; }
.morning-message-brand img { width: 25px; height: 25px; object-fit: contain; }
.morning-message-brand i { margin-inline-start: 3px; padding-inline-start: 10px; border-inline-start: 1px solid var(--line); color: var(--muted); font-size: 10px; font-style: normal; font-weight: 500; }
.morning-message-kicker { margin: 14px 0 7px; color: var(--brand); font-size: 10px; font-weight: 700; letter-spacing: .2px; }
.morning-message-shell h2 { margin: 0; color: var(--ink); font-size: clamp(22px, 4vw, 27px); font-weight: 750; line-height: 1.45; }
.morning-message-shell h2 span { color: var(--brand); }
.morning-message-date { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.morning-message-copy { max-width: 390px; margin: 20px auto 0; color: var(--ink); font-size: 15px; font-weight: 550; line-height: 2; }
.morning-message-rule { display: flex; align-items: center; gap: 5px; margin: 20px 0 18px; }
.morning-message-rule span { width: 5px; height: 5px; border-radius: 50%; background: var(--brand-cyan); }
.morning-message-rule span:nth-child(2) { width: 26px; border-radius: 5px; background: var(--brand); }
.morning-message-rule span:nth-child(3) { background: var(--brand-teal); }
.morning-message-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; width: 100%; }
.morning-message-actions .button-primary { min-width: 158px; min-height: 43px; box-shadow: 0 7px 18px color-mix(in srgb, var(--brand) 18%, transparent); }
.morning-message-actions .button-primary span { margin-inline-start: 8px; }
.account-details-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.account-details-actions .button { flex: 1 1 auto; min-width: 135px; }
.account-profile-popover { max-height: min(420px, calc(100vh - 100px)); overflow-y: auto; }
@media (max-width: 520px) {
  .morning-message-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); border-radius: 16px; }
  .morning-message-shell { min-height: 0; padding: 24px 20px 20px; }
  .morning-message-avatar { width: 82px; height: 82px; margin-bottom: 8px; }
  .morning-message-copy { margin-top: 16px; font-size: 14px; }
  .morning-message-rule { margin: 16px 0; }
  .morning-message-actions { display: grid; grid-template-columns: 1fr; }
  .morning-message-actions .button { width: 100%; }
  .account-details-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .account-details-actions .button { min-width: 0; }
}
:root[data-theme="dark"] .morning-message-shell {
  background: radial-gradient(circle at 50% -12%, rgba(41, 171, 226, .17) 0, transparent 48%), linear-gradient(180deg, var(--surface) 0%, var(--surface) 72%, rgba(41, 171, 226, .07) 100%);
}
@media (prefers-reduced-motion: no-preference) {
  .morning-message-dialog[open] .morning-message-shell { animation: morning-message-enter .28s ease-out both; }
  @keyframes morning-message-enter { from { opacity: .75; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
}

/* Rasheed AI — image-to-invoice workspace */
.rasheed-ai-workspace { display: grid; gap: 18px; padding-bottom: 28px; }
.rasheed-ai-workspace .module-page-heading { margin-bottom: 0; }
.rasheed-ai-upload-panel, .rasheed-ai-review-panel, .rasheed-ai-history-panel { padding: 22px; }
.rasheed-ai-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.rasheed-ai-section-heading h2 { margin: 0; font-size: 16px; }
.rasheed-ai-section-heading p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.rasheed-ai-step-icon { display: grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; border: 1px solid color-mix(in srgb, var(--brand-cyan) 45%, var(--line)); border-radius: 12px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 800; }
.rasheed-ai-alert { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 12px 15px; border: 1px solid var(--line); border-radius: 11px; font-size: 12px; line-height: 1.8; }
.rasheed-ai-alert strong { white-space: nowrap; }
.rasheed-ai-alert.is-warning { border-color: color-mix(in srgb, var(--orange) 32%, var(--line)); background: var(--orange-soft); color: var(--ink); }
.rasheed-ai-alert.is-success { border-color: color-mix(in srgb, var(--green) 28%, var(--line)); background: var(--green-soft); color: var(--ink); }
.rasheed-ai-dropzone { display: grid; justify-items: center; gap: 8px; padding: 30px 18px; border: 1.5px dashed color-mix(in srgb, var(--brand) 45%, var(--line)); border-radius: 15px; background: color-mix(in srgb, var(--brand-soft) 50%, var(--surface)); text-align: center; transition: border-color .16s ease, background .16s ease; }
.rasheed-ai-dropzone.is-dragging { border-color: var(--brand-cyan); background: var(--brand-soft); }
.rasheed-ai-dropzone strong { font-size: 14px; }
.rasheed-ai-dropzone small { color: var(--muted); font-size: 11px; }
.rasheed-ai-upload-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: var(--surface); color: var(--brand); font-size: 24px; box-shadow: 0 5px 18px rgba(20, 55, 90, .08); }
.rasheed-ai-upload-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 7px; }
.rasheed-ai-images-host { margin-top: 15px; }
.rasheed-ai-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 11px; }
.rasheed-ai-image-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.rasheed-ai-image-open { display: grid; width: 100%; height: 145px; place-items: center; overflow: hidden; padding: 7px; border: 0; background: var(--surface-soft); cursor: zoom-in; }
.rasheed-ai-image-open img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .15s ease; }
.rasheed-ai-pdf-open { align-content: center; gap: 8px; color: var(--muted); cursor: pointer; }
.rasheed-ai-pdf-icon { display: grid; width: 58px; height: 68px; place-items: center; border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line)); border-radius: 8px; background: var(--surface); color: var(--brand); font-size: 16px; font-weight: 800; box-shadow: 0 5px 14px rgba(20, 55, 90, .08); }
.rasheed-ai-pdf-open small { color: var(--muted); font-size: 10px; }
.rasheed-ai-image-meta { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 8px 9px; }
.rasheed-ai-image-meta > span { min-width: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.rasheed-ai-image-tools { display: flex; flex: none; gap: 3px; }
.rasheed-ai-image-tools button { width: 25px; height: 25px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); cursor: pointer; }
.rasheed-ai-image-tools button:hover { border-color: var(--brand-cyan); color: var(--brand); }
.rasheed-ai-empty-images { display: grid; justify-items: center; gap: 7px; padding: 26px 12px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; }
.rasheed-ai-empty-images strong { color: var(--ink); font-size: 13px; }
.rasheed-ai-empty-images small { font-size: 11px; }
.rasheed-ai-empty-icon { color: var(--brand); font-size: 24px; }
.rasheed-ai-upload-footer, .rasheed-ai-review-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; color: var(--muted); font-size: 11px; }
.rasheed-ai-upload-footer > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.rasheed-ai-customer-suggestion { display: grid; gap: 4px; margin-bottom: 13px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.rasheed-ai-customer-suggestion strong { font-size: 12px; }
.rasheed-ai-customer-suggestion span { color: var(--brand); font-weight: 700; }
.rasheed-ai-customer-suggestion small { color: var(--muted); font-size: 10px; }
.rasheed-ai-customer-field { display: grid; max-width: 520px; gap: 7px; margin-bottom: 18px; font-size: 12px; font-weight: 700; }
.rasheed-ai-customer-field select, .rasheed-ai-line-fields .form-input { width: 100%; min-width: 0; min-height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); padding: 7px 10px; }
.rasheed-ai-review-list { display: grid; gap: 12px; }
.rasheed-ai-line-card { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.rasheed-ai-line-card.is-excluded { opacity: .7; background: var(--surface-soft); }
.rasheed-ai-line-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.rasheed-ai-line-heading > div { display: flex; min-width: 0; align-items: flex-start; gap: 9px; }
.rasheed-ai-line-heading > div strong { padding-top: 3px; line-height: 1.7; }
.rasheed-ai-line-number { display: grid; flex: 0 0 25px; width: 25px; height: 25px; place-items: center; border-radius: 8px; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 800; }
.rasheed-ai-status-pill { display: inline-flex; flex: none; align-items: center; padding: 4px 9px; border: 1px solid var(--line); border-radius: 30px; background: var(--surface-soft); color: var(--muted); font-size: 10px; white-space: nowrap; }
.rasheed-ai-status-pill[data-tone="success"] { border-color: color-mix(in srgb, var(--green) 28%, var(--line)); background: var(--green-soft); color: var(--green); }
.rasheed-ai-status-pill[data-tone="warning"] { border-color: color-mix(in srgb, var(--orange) 28%, var(--line)); background: var(--orange-soft); color: var(--orange); }
.rasheed-ai-status-pill[data-tone="info"] { border-color: color-mix(in srgb, var(--brand) 25%, var(--line)); background: var(--brand-soft); color: var(--brand); }
.rasheed-ai-line-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 9px 0 13px; color: var(--muted); font-size: 10px; }
.rasheed-ai-line-meta button { margin-inline-start: auto; font-size: 10px; }
.rasheed-ai-line-fields { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(3, minmax(110px, 1fr)); gap: 10px; }
.rasheed-ai-line-fields > label { display: grid; align-content: start; gap: 6px; color: var(--muted); font-size: 11px; }
.rasheed-ai-line-fields > .rasheed-ai-unit-field { display: grid; align-content: start; gap: 6px; color: var(--muted); font-size: 11px; }
.rasheed-ai-unit-field > label { display: grid; align-content: start; gap: 6px; color: var(--muted); font-size: 11px; }
.rasheed-ai-selected-product { color: var(--green); font-size: 12px; }
.rasheed-ai-no-product { color: var(--orange); font-size: 12px; }
.rasheed-ai-product-results { display: grid; gap: 4px; max-height: 150px; overflow: auto; }
.rasheed-ai-candidate { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); color: var(--ink); text-align: right; cursor: pointer; }
.rasheed-ai-candidate:hover { border-color: var(--brand-cyan); background: var(--brand-soft); }
.rasheed-ai-candidate span { font-size: 11px; }
.rasheed-ai-candidate small { color: var(--brand); font-size: 10px; }
.rasheed-ai-confirm-product { justify-self: start; padding: 6px 10px; font-size: 10px; }
.rasheed-ai-confirmed-note { color: var(--green); font-size: 10px; }
.rasheed-ai-line-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.rasheed-ai-review-check { display: inline-flex; align-items: center; gap: 6px; margin-inline-end: auto; color: var(--ink); font-size: 11px; }
.rasheed-ai-excluded-note { margin: 9px 0 0; color: var(--muted); font-size: 11px; }
.rasheed-ai-notes-field { margin-top: 14px; padding: 11px 13px; border-radius: 10px; background: var(--surface-soft); }
.rasheed-ai-notes-field strong { font-size: 11px; }
.rasheed-ai-notes-field p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.8; white-space: pre-wrap; }
.rasheed-ai-total-panel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 16px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.rasheed-ai-total-panel > div { display: grid; gap: 5px; }
.rasheed-ai-total-panel span { color: var(--muted); font-size: 10px; }
.rasheed-ai-total-panel strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.rasheed-ai-total-panel .is-total strong { color: var(--brand); font-size: 17px; }
.rasheed-ai-review-footer { align-items: center; margin-top: 16px; }
.rasheed-ai-review-footer > span { max-width: 560px; line-height: 1.8; }
.rasheed-ai-history-list { display: grid; }
.rasheed-ai-history-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 4px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: right; cursor: pointer; }
.rasheed-ai-history-row:last-child { border-bottom: 0; }
.rasheed-ai-history-row > span:first-child { display: grid; gap: 4px; }
.rasheed-ai-history-row strong { font-size: 11px; }
.rasheed-ai-history-row small, .rasheed-ai-history-empty { color: var(--muted); font-size: 10px; }
.rasheed-ai-image-dialog { width: min(900px, calc(100vw - 30px)); max-width: 900px; max-height: calc(100dvh - 30px); padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); }
.rasheed-ai-image-dialog::backdrop { background: rgba(5, 16, 31, .72); backdrop-filter: blur(3px); }
.rasheed-ai-image-dialog form { display: flex; justify-content: flex-start; }
.rasheed-ai-dialog-close { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); cursor: pointer; }
.rasheed-ai-image-dialog canvas { display: block; max-width: 100%; max-height: calc(100dvh - 120px); width: auto; height: auto; margin: 6px auto; object-fit: contain; background: #fff; }
.rasheed-ai-image-dialog p { margin: 5px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
:root[data-theme="dark"] .rasheed-ai-dropzone { background: color-mix(in srgb, var(--brand-deep) 12%, var(--surface)); }
:root[data-theme="dark"] .rasheed-ai-alert.is-warning, :root[data-theme="dark"] .rasheed-ai-alert.is-success { color: var(--ink); }
@media (max-width: 760px) {
  .rasheed-ai-upload-panel, .rasheed-ai-review-panel, .rasheed-ai-history-panel { padding: 15px; }
  .rasheed-ai-line-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rasheed-ai-line-fields > label:first-child { grid-column: 1 / -1; }
  .rasheed-ai-upload-footer, .rasheed-ai-review-footer { align-items: stretch; flex-direction: column; }
  .rasheed-ai-upload-footer > div { justify-content: stretch; }
  .rasheed-ai-upload-footer .button, .rasheed-ai-review-footer .button { flex: 1; }
}
@media (max-width: 480px) {
  .rasheed-ai-line-heading { flex-direction: column; }
  .rasheed-ai-line-fields { grid-template-columns: 1fr; }
  .rasheed-ai-line-fields > label:first-child { grid-column: auto; }
  .rasheed-ai-total-panel { grid-template-columns: 1fr; }
  .rasheed-ai-upload-actions { display: grid; width: 100%; }
  .rasheed-ai-upload-actions .button { width: 100%; }
  .rasheed-ai-line-actions { align-items: flex-start; flex-direction: column; }
  .rasheed-ai-review-check { margin-inline-end: 0; }
}

.rasheed-ai-unit-warning { display: block; margin-top: 6px; color: #b45309; font-size: 11px; line-height: 1.65; }

/* Company-wide units of measure catalog */
.unit-catalog-settings .panel-header { align-items: flex-start; }
.unit-catalog-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.unit-catalog-actions small { color: var(--muted, #64748b); line-height: 1.7; }
.unit-catalog-list { display: grid; gap: 14px; }
.unit-catalog-group { display: grid; gap: 8px; }
.unit-catalog-group h4 { margin: 0; font-size: .9rem; color: var(--muted, #64748b); }
.unit-catalog-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.unit-catalog-chip { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 12px; border: 1px solid var(--border, #e2e8f0); border-radius: 999px; background: var(--surface-soft, #f8fafc); color: var(--text, #1e293b); font-size: .9rem; }
.unit-catalog-dialog { width: min(460px, calc(100vw - 28px)); }
.unit-dialog-error { margin: 0; padding: 10px 12px; border-radius: 10px; color: #b42318; background: #fef3f2; }
.rasheed-ai-unit-field select[data-ai-unit], select[data-unit-select] { min-width: 0; width: 100%; }


/* 1.9.78 — mobile input comfort, safe dialogs, and accessible horizontal data regions. */
body { min-height: 100vh; min-height: 100dvh; }
.table-scroll[tabindex="0"] {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
}
.table-scroll[tabindex="0"]:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: -3px;
  border-radius: 7px;
}
.dialog { overscroll-behavior: contain; }

@media (max-width: 760px) {
  .dialog {
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px);
    margin-block: auto;
    -webkit-overflow-scrolling: touch;
  }
  .dialog-content { overscroll-behavior: contain; }
  .dialog-footer .button { min-height: 44px; }
  .form-field input,
  .form-field select,
  .form-field textarea,
  .assistant-prompt input,
  .global-search input,
  .table-search,
  .module-search-field input,
  .settings-center-search input {
    font-size: 16px;
  }
  .form-field input,
  .form-field select,
  .form-field textarea { min-height: 44px; }
  button, select, summary, a.button { touch-action: manipulation; }
  .mobile-menu { min-width: 44px; min-height: 44px; }
  .topbar-tools .theme-toggle,
  .topbar-tools #notificationButton,
  .topbar-tools #simpleHomeButton { min-width: 40px; min-height: 40px; }
}

@media (max-width: 560px) {
  /* Keep the mode switch accessible without letting its label crowd mobile tools. */
  .app-mode-toggle {
    flex: 0 0 40px;
    width: 40px;
    min-width: 40px;
    justify-content: center;
    padding-inline: 0;
  }
  .app-mode-toggle-label { display: none !important; }
  .app-mode-toggle-icon { font-size: 17px; }
  .global-search-wrap { flex: 1 1 120px; min-width: 120px; }
  .global-search { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .table-scroll[tabindex="0"] { scroll-behavior: auto; }
}

/* 1.9.79 — App Launcher shell. This layer changes the primary chrome and home route only. */
.app-shell.app-shell-launcher { display: block; min-height: 100vh; }
.app-shell.app-shell-launcher[hidden] { display: none !important; }
.app-shell-launcher .legacy-navigation,
.app-shell-launcher .sidebar-scrim { display: none !important; }
.app-shell-launcher .main-area { min-height: 100vh; width: 100%; }
.app-shell-launcher .app-topbar {
  position: sticky; top: 0; z-index: 40; display: grid;
  grid-template-columns: minmax(220px, auto) minmax(360px, 1fr) auto;
  align-items: center; gap: 16px; min-height: 76px; padding: 10px 24px;
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 4px 18px rgba(27, 42, 70, .035); backdrop-filter: blur(16px);
}
.topbar-brand-zone, .topbar-center-zone, .topbar-tools { display: flex; align-items: center; min-width: 0; }
.topbar-brand-zone { gap: 14px; }
.topbar-brand { flex: none; gap: 9px; padding: 0; }
.topbar-brand .brand-mark { width: 42px; height: 42px; }
.topbar-brand .brand-copy strong { color: var(--brand-deep); font-size: 17px; font-weight: 800; }
.topbar-brand .brand-copy small { font-size: 10px; }
.topbar-company { width: auto; min-width: 120px; max-width: 190px; min-height: 42px; padding: 5px 7px; gap: 7px; border-radius: 10px; background: var(--canvas); }
.topbar-company .company-avatar { flex-basis: 29px; width: 29px; height: 29px; border-radius: 8px; }
.topbar-company .company-copy { gap: 0; }
.topbar-company .company-copy small { font-size: 9px; }
.topbar-company .company-copy strong { max-width: 115px; font-size: 10px; }
.topbar-company .chevron { font-size: 13px; }
.topbar-center-zone { gap: 10px; }
.app-launcher-home { display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 7px; min-height: 39px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--brand-deep); font-size: 11px; font-weight: 750; cursor: pointer; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.app-launcher-home:hover { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); }
.app-launcher-home-icon { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 6px; background: var(--brand-soft); font-size: 18px; line-height: 1; }
.topbar-context { flex: none; min-width: auto; gap: 6px; padding-inline: 2px; font-size: 10px; white-space: nowrap; }
.topbar-context > span:first-child { color: var(--muted); }
.topbar-context strong { color: var(--ink); font-weight: 750; }
.app-topbar .global-search-wrap { flex: 1; min-width: 150px; }
.app-topbar .global-search { width: 100%; min-width: 150px; min-height: 40px; padding: 8px 11px; border-radius: 10px; background: var(--canvas); }
.app-topbar .global-search input { font-size: 11px; }
.app-topbar .global-search kbd { padding: 2px 5px; font-size: 9px; }
.app-topbar .topbar-tools { justify-content: flex-end; gap: 7px; }
.app-topbar .app-mode-toggle { min-height: 36px; padding: 7px 9px; border-radius: 9px; font-size: 10px; }
.app-topbar .top-icon { width: 34px; height: 34px; border-radius: 9px; }
.app-topbar .sync-status { padding: 5px 8px; font-size: 9px; }
.topbar-account { flex: none; gap: 7px; max-width: 155px; padding: 0 0 0 0; border: 0; }
.topbar-account .user-avatar { width: 34px; height: 34px; border: 1px solid var(--line); }
.topbar-account > span:nth-child(2) { min-width: 0; gap: 1px; }
.topbar-account strong { overflow: hidden; max-width: 84px; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-account small { overflow: hidden; max-width: 84px; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-account .user-menu { width: 27px; height: 27px; font-size: 9px; }
.app-shell-launcher .page-host { width: 100%; max-width: 1640px; padding: 28px clamp(18px, 3vw, 44px) 34px; }
.app-shell-launcher .app-footer { padding-inline: clamp(18px, 3vw, 44px); }

.app-launcher { display: grid; gap: 23px; max-width: 1510px; margin: 0 auto; }
.app-launcher-welcome { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 105px; padding: 20px 24px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(105deg, var(--surface) 0%, var(--brand-soft) 100%); }
.app-launcher-welcome-copy { min-width: 0; }
.app-launcher-kicker { display: inline-flex; margin-bottom: 5px; color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .2px; }
.app-launcher-welcome h1 { margin: 0; color: var(--ink); font-size: clamp(21px, 2vw, 27px); font-weight: 800; letter-spacing: -.4px; }
.app-launcher-welcome p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.app-launcher-welcome-meta { display: grid; flex: none; justify-items: end; gap: 7px; color: var(--muted); font-size: 10px; }
.launcher-company-chip { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 10px; border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line)); border-radius: 999px; background: var(--surface); color: var(--brand-deep); font-weight: 700; }
.app-launcher-toolbar { display: flex; align-items: center; gap: 12px; }
.app-launcher-search { display: flex; align-items: center; gap: 10px; width: min(520px, 100%); min-height: 43px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--brand); }
.app-launcher-search > span { font-size: 21px; line-height: 1; }
.app-launcher-search input { flex: 1; width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
.app-launcher-search input::placeholder { color: var(--muted); }
.app-launcher-search kbd { padding: 3px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-family: inherit; font-size: 9px; }
.app-launcher-count { margin-inline-start: auto; color: var(--muted); font-size: 10px; white-space: nowrap; }
.launcher-group, .launcher-shortcut-section { display: grid; gap: 11px; }
.launcher-group-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.launcher-group-heading h2 { margin: 0; color: var(--ink); font-size: 14px; font-weight: 800; }
.launcher-group-heading p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.launcher-group-count { flex: none; color: var(--muted); font-size: 9px; }
.launcher-app-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.launcher-shortcut-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.launcher-app-card { position: relative; min-width: 0; min-height: 79px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 2px 8px rgba(22, 39, 67, .025); transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.launcher-app-card:hover { border-color: color-mix(in srgb, var(--brand) 42%, var(--line)); box-shadow: 0 8px 22px rgba(21, 47, 83, .075); transform: translateY(-2px); }
.launcher-app-main { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 77px; padding: 13px 39px 13px 13px; border: 0; border-radius: inherit; background: transparent; color: var(--ink); text-align: start; cursor: pointer; }
.launcher-app-icon { display: grid; place-items: center; flex: none; width: 43px; height: 43px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); }
.launcher-app-icon svg { width: 22px; height: 22px; stroke: currentColor; }
.launcher-app-copy { display: grid; gap: 4px; min-width: 0; }
.launcher-app-copy strong { overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.launcher-app-copy small { overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.55; text-overflow: ellipsis; white-space: nowrap; }
.launcher-app-open-mark { position: absolute; bottom: 10px; left: 11px; color: var(--muted); font-size: 13px; opacity: .7; }
.launcher-favorite-toggle { position: absolute; top: 7px; right: 8px; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 17px; line-height: 1; cursor: pointer; }
.launcher-favorite-toggle:hover { background: var(--surface-soft); color: var(--brand); }
.launcher-favorite-toggle.is-active { color: #d49b2c; }
.launcher-app-card.is-compact { min-height: 62px; }
.launcher-app-card.is-compact .launcher-app-main { min-height: 60px; padding-block: 8px; }
.launcher-app-card.is-compact .launcher-app-icon { width: 34px; height: 34px; border-radius: 9px; }
.launcher-app-card.is-compact .launcher-app-icon svg { width: 18px; height: 18px; }
.launcher-app-card.is-compact .launcher-app-copy small { display: none; }
.launcher-no-results { padding: 25px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); text-align: center; font-size: 11px; }
.app-launcher-footnote { margin: 0; padding-top: 4px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; line-height: 1.7; }

:root[data-theme="dark"] .app-launcher-welcome { background: linear-gradient(105deg, var(--surface) 0%, color-mix(in srgb, var(--brand-deep) 28%, var(--surface)) 100%); }
:root[data-theme="dark"] .app-launcher-search { background: var(--surface); }
:root[data-theme="dark"] .app-launcher-home:hover { background: color-mix(in srgb, var(--brand) 20%, var(--surface)); }
:root[data-theme="dark"] .launcher-app-card { box-shadow: none; }

@media (max-width: 1320px) {
  .app-shell-launcher .app-topbar { grid-template-columns: minmax(190px, auto) minmax(260px, 1fr) auto; gap: 10px; padding-inline: 16px; }
  .topbar-context { display: none; }
  .topbar-brand-zone { gap: 8px; }
  .topbar-company { max-width: 155px; }
  .app-topbar .topbar-tools { gap: 4px; }
  .app-topbar .app-mode-toggle-label { display: none; }
  .app-topbar .app-mode-toggle { width: 35px; padding: 7px; }
}
@media (max-width: 1050px) {
  .app-shell-launcher .app-topbar { grid-template-columns: minmax(0, 1fr) auto; row-gap: 9px; }
  .topbar-brand-zone { grid-column: 1; grid-row: 1; }
  .app-topbar .topbar-tools { grid-column: 2; grid-row: 1; }
  .topbar-center-zone { grid-column: 1 / -1; grid-row: 2; }
  .app-topbar .global-search-wrap { min-width: 0; }
  .launcher-app-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .app-shell-launcher .app-topbar { position: sticky; grid-template-columns: 1fr; gap: 8px; min-height: 0; padding: 8px 11px; }
  .topbar-brand-zone { grid-column: 1; grid-row: 1; justify-content: space-between; }
  .topbar-brand .brand-mark { width: 35px; height: 35px; }
  .topbar-brand .brand-copy strong { font-size: 14px; }
  .topbar-brand .brand-copy small { display: none; }
  .topbar-company { min-height: 34px; max-width: 150px; border: 0; background: transparent; }
  .topbar-company .company-avatar { flex-basis: 27px; width: 27px; height: 27px; }
  .topbar-company .company-copy small { display: none; }
  .topbar-center-zone { grid-column: 1; grid-row: 2; gap: 7px; }
  .app-launcher-home { min-height: 38px; padding-inline: 9px; font-size: 10px; }
  .app-launcher-home > span:last-child { display: none; }
  .app-topbar .global-search { min-height: 38px; min-width: 0; }
  .app-topbar .global-search kbd { display: none; }
  .app-topbar .topbar-tools { grid-column: 1; grid-row: 3; justify-content: space-between; width: 100%; }
  .app-topbar .top-icon { width: 31px; height: 31px; }
  .app-topbar .sync-status { font-size: 8px; }
  .topbar-account { max-width: 145px; }
  .topbar-account .user-avatar { width: 29px; height: 29px; }
  .topbar-account strong { font-size: 9px; }
  .topbar-account small { display: none; }
  .app-shell-launcher .page-host { padding: 17px 12px 24px; }
  .app-launcher { gap: 17px; }
  .app-launcher-welcome { min-height: 0; align-items: flex-start; flex-direction: column; gap: 10px; padding: 16px; border-radius: 13px; }
  .app-launcher-welcome h1 { font-size: 21px; }
  .app-launcher-welcome p { font-size: 10px; }
  .app-launcher-welcome-meta { display: flex; align-items: center; justify-items: start; flex-wrap: wrap; gap: 9px; font-size: 9px; }
  .app-launcher-toolbar { align-items: stretch; flex-direction: column; gap: 6px; }
  .app-launcher-search { width: 100%; min-height: 40px; }
  .app-launcher-count { margin-inline-start: 0; }
  .launcher-app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .launcher-shortcut-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .launcher-app-card { min-height: 72px; }
  .launcher-app-main { min-height: 70px; gap: 8px; padding: 10px 34px 10px 8px; }
  .launcher-app-icon { width: 36px; height: 36px; }
  .launcher-app-copy strong { font-size: 10px; }
  .launcher-app-copy small { font-size: 8px; }
  .launcher-group-heading h2 { font-size: 13px; }
  .app-footer { font-size: 9px; }
}
@media (max-width: 380px) {
  .topbar-account .user-menu { width: 22px; font-size: 8px; }
  .app-topbar .help-top { display: none; }
  .app-topbar .sync-status { display: none; }
  .launcher-app-main { gap: 6px; padding-inline-start: 6px; }
  .launcher-app-icon { width: 32px; height: 32px; }
}

/* Launcher notification area uses existing document alerts and routes. */
.launcher-notifications { display: grid; gap: 10px; margin-top: 2px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.launcher-notification-list { display: grid; gap: 6px; }
.launcher-notification-row { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid transparent; border-radius: 9px; background: var(--canvas); color: var(--ink); text-align: start; cursor: pointer; }
.launcher-notification-row:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.launcher-notification-mark { display: grid; place-items: center; flex: none; width: 25px; height: 25px; border-radius: 8px; font-size: 12px; font-weight: 800; }
.launcher-notification-mark.is-urgent { background: var(--red-soft); color: var(--red); }
.launcher-notification-mark.is-warning { background: var(--orange-soft); color: var(--orange); }
.launcher-notification-copy { display: grid; gap: 3px; flex: 1; min-width: 0; }
.launcher-notification-copy strong { font-size: 10px; font-weight: 750; }
.launcher-notification-copy small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.launcher-notification-open { flex: none; color: var(--brand); font-size: 9px; font-weight: 700; }
.launcher-notifications-empty { margin: 0; padding: 10px 0; color: var(--muted); font-size: 10px; }
:root[data-theme="dark"] .launcher-notification-row { background: var(--surface-soft); }

/* 1.9.80 — Odoo-inspired application identity and compact account/action bar. */
.app-shell.app-shell-launcher .app-topbar {
  grid-template-columns: minmax(300px, auto) minmax(190px, 1fr) auto;
  gap: 14px;
  min-height: 70px;
  padding: 9px 20px;
}
.app-shell-launcher .topbar-brand-zone { gap: 12px; }
.app-shell-launcher .topbar-brand { gap: 7px; }
.app-shell-launcher .topbar-brand .brand-mark { width: 38px; height: 38px; }
.app-shell-launcher .topbar-brand .brand-copy strong { font-size: 16px; }
.app-shell-launcher .topbar-brand .brand-copy small { font-size: 9px; }
.app-shell-launcher .topbar-active-app {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 9px;
  width: auto;
  min-width: 145px;
  max-width: 205px;
  min-height: 45px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  text-align: start;
  cursor: pointer;
}
.app-shell-launcher .topbar-active-app:hover { border-color: var(--brand); background: var(--brand-soft); }
.topbar-active-app-icon { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 8px; background: var(--surface); color: var(--brand); }
.topbar-active-app-icon svg { width: 21px; height: 21px; stroke: currentColor; }
.topbar-active-app-copy { display: grid; gap: 2px; min-width: 0; flex: 1; }
.topbar-active-app-copy strong { overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.topbar-active-app-copy small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-active-app-chevron { flex: none; color: var(--muted); font-size: 14px; }
.app-shell-launcher .topbar-context { display: none; }
.app-shell-launcher .topbar-center-zone { min-width: 0; }
.app-shell-launcher .global-search-wrap { width: 100%; max-width: 540px; }
.app-shell-launcher .topbar-tools { gap: 9px; }
.app-shell-launcher .topbar-search-mode-group { display: flex; flex: 0 1 auto; align-items: center; gap: 10px; min-width: 0; }
.app-shell-launcher .topbar-search-mode-group .global-search-wrap { flex: 0 1 auto; width: clamp(270px, 25vw, 390px); min-width: 230px; max-width: none; }
.app-shell-launcher .topbar-search-mode-group .global-search { width: 100%; min-width: 0; }
.app-shell-launcher .topbar-tools-divider { display: block; flex: 0 0 1px; width: 1px; height: 30px; border-radius: 1px; background: var(--line-strong); opacity: .9; }
.app-shell-launcher .topbar-utility-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; min-width: 0; }
.app-mode-switch {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 2px;
  min-height: 38px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}
.app-mode-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.app-mode-choice:hover { color: var(--ink); background: var(--surface); }
.app-mode-choice.is-active { border-color: color-mix(in srgb, var(--brand) 18%, var(--line)); background: var(--surface); color: var(--brand-deep); box-shadow: 0 1px 4px rgba(18, 38, 68, .08); }
.app-mode-choice-icon { display: inline-grid; place-items: center; font-size: 13px; line-height: 1; }
.app-shell-launcher .theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: auto;
  min-width: 64px;
  height: 36px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
}
.app-shell-launcher .theme-toggle:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); }
.theme-toggle-icon { font-size: 16px; line-height: 1; }
.theme-toggle-label { font-size: 9px; font-weight: 750; white-space: nowrap; }
.topbar-ai-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, #8554db 28%, var(--line));
  border-radius: 9px;
  background: color-mix(in srgb, #8554db 9%, var(--surface));
  color: #7040c5;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.topbar-ai-button:hover { border-color: #8554db; background: color-mix(in srgb, #8554db 16%, var(--surface)); }
.topbar-ai-button[hidden] { display: none !important; }
.topbar-ai-icon { font-size: 17px; line-height: 1; }
:root[data-theme="dark"] .topbar-ai-button { border-color: #604895; background: #30264a; color: #d5baff; }
.app-shell-launcher .topbar-account { max-width: 175px; padding-inline-start: 8px; border-inline-start: 1px solid var(--line); }
.app-shell-launcher .topbar-account .user-avatar { flex: 0 0 35px; width: 35px; height: 35px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-deep); font-size: 13px; font-weight: 800; }
.topbar-account-copy { display: grid; gap: 1px; min-width: 0; }
.app-shell-launcher .topbar-account .topbar-account-kicker { color: var(--muted); font-size: 8px; line-height: 1.2; }
.app-shell-launcher .topbar-account strong { max-width: 95px; color: var(--ink); font-size: 10px; }
.app-shell-launcher .topbar-account #accountRole { max-width: 115px; color: var(--muted); font-size: 9px; }
.app-shell-launcher .topbar-account .user-menu { min-width: 28px; width: auto; padding-inline: 6px; border-radius: 7px; }
/* The mode control is an explicit two-choice selector. All top-bar actions remain available in simple mode. */
.app-shell.simple-mode .topbar-tools .topbar-ai-button,
.app-shell.simple-mode .topbar-tools .topbar-account,
.app-shell.simple-mode .topbar-tools #notificationButton,
.app-shell.simple-mode .topbar-tools .help-top,
.app-shell.simple-mode .topbar-tools .sync-status { display: inline-flex !important; }
.app-shell.simple-mode .topbar-tools .sync-status { display: none !important; }
.app-shell.simple-mode .topbar-tools .topbar-search-mode-group,
.app-shell.simple-mode .topbar-tools .topbar-utility-actions { display: flex !important; }
/* The launcher follows the Odoo-like square app-icon layout rather than description cards. */
.app-launcher { gap: 22px; }
.app-launcher-welcome { min-height: 76px; padding-block: 13px; }
.app-launcher-welcome h1 { font-size: clamp(19px, 1.8vw, 24px); }
.launcher-group { gap: 10px; }
.launcher-group-heading { padding-inline: 2px; }
.launcher-group-heading p { display: none; }
.launcher-app-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 11px; }
.launcher-app-card {
  min-height: 113px;
  border-color: transparent;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
}
.launcher-app-card:hover { border-color: var(--line); background: var(--surface); box-shadow: 0 5px 18px rgba(22, 39, 67, .06); transform: translateY(-2px); }
.launcher-app-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 108px;
  padding: 9px 5px 7px;
  text-align: center;
}
.launcher-app-icon {
  width: 62px;
  height: 62px;
  border: 1px solid color-mix(in srgb, var(--brand) 13%, var(--line));
  border-radius: 11px;
  background: linear-gradient(145deg, var(--surface-soft), var(--brand-soft));
  box-shadow: 0 2px 6px rgba(18, 38, 68, .06);
}
.launcher-app-icon svg { width: 30px; height: 30px; stroke-width: 1.8; }
.launcher-app-copy { display: block; width: 100%; }
.launcher-app-copy strong { display: block; color: var(--ink); font-size: 11px; font-weight: 750; white-space: normal; line-height: 1.45; }
.launcher-app-copy small { display: none; }
.launcher-app-open-mark { display: none; }
.launcher-favorite-toggle { top: 3px; right: 3px; z-index: 2; background: var(--surface); opacity: .9; }
.launcher-app-card:nth-child(6n + 1) .launcher-app-icon { color: #1685c8; background: #e7f3fc; }
.launcher-app-card:nth-child(6n + 2) .launcher-app-icon { color: #16a085; background: #e5f7f1; }
.launcher-app-card:nth-child(6n + 3) .launcher-app-icon { color: #8854d6; background: #f0eafd; }
.launcher-app-card:nth-child(6n + 4) .launcher-app-icon { color: #d8891a; background: #fff4df; }
.launcher-app-card:nth-child(6n + 5) .launcher-app-icon { color: #d4537b; background: #fdebf1; }
.launcher-app-card:nth-child(6n + 6) .launcher-app-icon { color: #0e9eaa; background: #e2f6f7; }
.launcher-app-card.is-compact { min-height: 80px; }
.launcher-app-card.is-compact .launcher-app-main { min-height: 78px; gap: 5px; padding-block: 6px; }
.launcher-app-card.is-compact .launcher-app-icon { width: 43px; height: 43px; }
.launcher-app-card.is-compact .launcher-app-icon svg { width: 22px; height: 22px; }
.launcher-app-card.is-compact .launcher-app-copy strong { font-size: 10px; }
:root[data-theme="dark"] .app-mode-switch { border-color: #344761; background: #152338; }
:root[data-theme="dark"] .app-mode-choice { color: #b7c6d8; }
:root[data-theme="dark"] .app-mode-choice.is-active { border-color: #3b5f86; background: #203b5b; color: #f3f8ff; }
:root[data-theme="dark"] .topbar-active-app { border-color: #344761; background: #17263b; }
:root[data-theme="dark"] .topbar-active-app-icon { background: #203b5b; color: #75c5f0; }
:root[data-theme="dark"] .launcher-app-card:hover { background: var(--surface); }

@media (max-width: 1420px) {
  .app-shell.app-shell-launcher .app-topbar { grid-template-columns: minmax(245px, auto) minmax(160px, 1fr) auto; gap: 9px; padding-inline: 13px; }
  .app-shell-launcher .topbar-brand-zone { gap: 7px; }
  .app-shell-launcher .topbar-active-app { min-width: 126px; max-width: 165px; }
  .app-shell-launcher .topbar-active-app-copy small { display: none; }
  .app-shell-launcher .topbar-tools { gap: 5px; }
  .app-shell-launcher .topbar-search-mode-group { gap: 8px; }
  .app-shell-launcher .topbar-search-mode-group .global-search-wrap { width: clamp(230px, 22vw, 330px); min-width: 210px; }
  .app-shell-launcher .topbar-account { max-width: 145px; }
}
@media (max-width: 1160px) {
  .app-shell.app-shell-launcher .app-topbar { grid-template-columns: minmax(220px, auto) minmax(130px, 1fr) auto; }
  .app-shell-launcher .topbar-brand .brand-copy small,
  .app-shell-launcher .topbar-account-kicker,
  .app-shell-launcher .sync-status { display: none !important; }
  .app-shell-launcher .topbar-ai-button > span:last-child { display: none; }
  .app-shell-launcher .topbar-ai-button { width: 36px; padding-inline: 0; }
  .app-mode-choice { padding-inline: 7px; }
  .app-shell-launcher .topbar-search-mode-group .global-search-wrap { width: 220px; min-width: 190px; }
  .app-shell-launcher .topbar-account { max-width: 118px; }
}
@media (max-width: 940px) {
  .app-shell.app-shell-launcher .app-topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .app-shell-launcher .topbar-brand-zone { grid-column: 1 / -1; grid-row: 1; }
  .app-shell-launcher .topbar-center-zone { display: none !important; }
  .app-shell-launcher .topbar-tools { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; width: 100%; }
  .app-shell-launcher .topbar-search-mode-group { flex: 1 1 auto; min-width: 0; }
  .app-shell-launcher .topbar-search-mode-group .global-search-wrap { flex: 1 1 220px; width: auto; max-width: none; min-width: 180px; }
  .app-shell-launcher .topbar-utility-actions { flex: 0 0 auto; }
  .app-shell-launcher .topbar-active-app-copy small { display: inline; }
  .launcher-app-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}
@media (max-width: 680px) {
  .app-shell.app-shell-launcher .app-topbar { grid-template-columns: 1fr; gap: 8px; padding: 8px 10px; }
  .app-shell-launcher .topbar-brand-zone { grid-column: 1; grid-row: 1; justify-content: space-between; }
  .app-shell-launcher .topbar-brand .brand-mark { width: 32px; height: 32px; }
  .app-shell-launcher .topbar-brand .brand-copy strong { font-size: 13px; }
  .app-shell-launcher .topbar-active-app { min-height: 38px; min-width: 120px; max-width: 165px; padding: 4px 7px; }
  .topbar-active-app-icon { flex-basis: 28px; width: 28px; height: 28px; }
  .topbar-active-app-icon svg { width: 18px; height: 18px; }
  .app-shell-launcher .topbar-active-app-copy strong { font-size: 9px; }
  .app-shell-launcher .topbar-active-app-copy small { display: none; }
  .app-shell-launcher .topbar-center-zone { display: none !important; }
  .app-shell-launcher .topbar-tools { grid-column: 1; grid-row: 2; display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; width: 100%; gap: 8px; }
  .app-shell-launcher .topbar-search-mode-group { width: 100%; min-width: 0; gap: 8px; }
  .app-shell-launcher .topbar-search-mode-group .global-search-wrap { flex: 1 1 auto; width: auto; min-width: 0; }
  .app-shell-launcher .topbar-tools-divider { height: 26px; }
  .app-shell-launcher .topbar-utility-actions { justify-content: flex-start; gap: 8px; }
  .app-mode-switch { min-height: 34px; }
  .app-mode-choice { min-height: 26px; padding-inline: 7px; font-size: 9px; }
  .app-shell-launcher .theme-toggle { min-width: 55px; height: 34px; }
  .theme-toggle-label { font-size: 8px; }
  .app-shell-launcher .topbar-ai-button { width: 34px; min-height: 34px; }
  .app-shell-launcher .top-icon { width: 34px; height: 34px; }
  .app-shell-launcher .topbar-account { max-width: 132px; }
  .app-shell-launcher .topbar-account .user-avatar { width: 30px; flex-basis: 30px; height: 30px; }
  .app-shell-launcher .topbar-account strong { max-width: 66px; font-size: 9px; }
  .app-shell-launcher .topbar-account #accountRole { max-width: 80px; font-size: 8px; }
  .app-shell-launcher .topbar-account .user-menu { height: 25px; min-width: 25px; font-size: 8px; }
  .app-launcher-welcome { min-height: 0; }
  .launcher-app-grid { grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 5px; }
  .launcher-app-card { min-height: 95px; }
  .launcher-app-main { min-height: 91px; gap: 6px; }
  .launcher-app-icon { width: 52px; height: 52px; }
  .launcher-app-icon svg { width: 25px; height: 25px; }
  .launcher-app-copy strong { font-size: 9px; }
}


/* 1.9.82 — Main applications with horizontal in-app section navigation.
   Section tabs remain in normal document flow and scroll away with page content. */
.application-navigation {
  position: relative;
  top: auto;
  z-index: auto;
  display: flex;
  align-items: center;
  min-width: 0;
  margin: -3px 0 18px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 5px 18px rgba(18, 39, 68, .045);
  backdrop-filter: blur(12px);
}
.application-navigation-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.application-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 39px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
.application-tab:hover { background: var(--surface-soft); color: var(--ink); }
.application-tab.is-active {
  border-color: color-mix(in srgb, var(--brand) 24%, var(--line));
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-weight: 800;
}
.application-tab:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.launcher-app-section-count { color: var(--brand) !important; font-weight: 750; }
:root[data-theme="dark"] .application-navigation {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
}
:root[data-theme="dark"] .application-tab.is-active {
  border-color: color-mix(in srgb, var(--brand) 34%, var(--line));
  color: #a9dafa;
}
@media (max-width: 760px) {
  .application-navigation { margin: 0 0 12px; padding: 5px; border-radius: 11px; }
  .application-navigation-tabs { gap: 3px; scrollbar-width: none; }
  .application-navigation-tabs::-webkit-scrollbar { display: none; }
  .application-tab { min-height: 37px; padding: 7px 11px; font-size: 10px; }
}
@media (max-width: 420px) {
  .application-navigation { margin-inline: -2px; }
  .application-tab { min-height: 36px; padding-inline: 10px; }
}


/* 1.9.82 — cleaner app launcher, restored simple home, compact topbar controls. */
.app-launcher-clean { display: grid; gap: 22px; }
.app-launcher-clean .launcher-app-grid-flat { margin: 0; padding: 4px 0; }
.app-launcher-clean .launcher-app-card { min-height: 112px; }
.app-launcher-clean .launcher-app-main { min-height: 108px; }
.app-launcher-clean .launcher-app-copy { display: block; }
.app-launcher-clean .launcher-app-copy strong { font-size: 12px; }
.app-launcher-clean .launcher-app-card:hover { background: transparent; border-color: transparent; box-shadow: none; transform: none; }
.app-launcher-clean .launcher-app-card:hover .launcher-app-icon { transform: translateY(-2px); box-shadow: 0 7px 18px rgba(22, 39, 67, .12); }
.app-launcher-clean .launcher-app-icon { transition: transform .16s ease, box-shadow .16s ease; }
.app-launcher-clean .launcher-notifications { margin-top: 4px; }
.app-launcher-clean .launcher-group-heading { min-height: 24px; }
.app-launcher-clean .launcher-group-heading p { display: none !important; }

/* The centered launcher search and the welcome banner are removed from the app home. */
.app-launcher-welcome,
.app-launcher-toolbar,
.launcher-no-results,
.app-launcher-footnote,
.launcher-shortcut-section { display: none !important; }

/* Theme is a single, accessible icon control. */
.app-shell-launcher .theme-toggle { width: 36px; min-width: 36px; height: 36px; padding: 0; gap: 0; }
.theme-toggle-label { display: none !important; }
.theme-toggle-icon { font-size: 19px; }

/* Profile details are revealed only after activating the avatar. */
.app-shell-launcher .topbar-account { position: relative; flex: 0 0 auto; width: auto; max-width: none; padding: 0; border: 0; }
.app-shell-launcher .account-profile-trigger { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--brand-soft); color: var(--brand-deep); font-size: 14px; font-weight: 850; cursor: pointer; }
.app-shell-launcher .account-profile-trigger svg { width: 19px; height: 19px; }
.app-shell-launcher .account-profile-trigger:hover,
.app-shell-launcher .account-profile-trigger[aria-expanded="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
.account-profile-popover[hidden] { display: none !important; }
.account-profile-popover { position: absolute; z-index: 120; inset-inline-end: 0; top: calc(100% + 10px); display: grid; gap: 12px; width: min(280px, calc(100vw - 28px)); padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 18px 48px rgba(14, 28, 48, .18); text-align: start; }
.account-profile-heading { display: grid; gap: 4px; min-width: 0; }
.account-profile-kicker { color: var(--muted); font-size: 10px; }
.account-profile-heading strong { font-size: 14px; font-weight: 800; overflow-wrap: anywhere; }
.account-profile-heading small { color: var(--muted); font-size: 11px; line-height: 1.6; }
.account-profile-username { display: flex; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11px; }
.account-profile-username span { color: var(--muted); }
.account-profile-username strong { overflow-wrap: anywhere; }
.account-profile-popover .account-logout-button { width: 100%; min-height: 38px; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--red) 28%, var(--line)); border-radius: 9px; background: color-mix(in srgb, #c53a49 7%, var(--surface)); color: var(--red); font-size: 11px; font-weight: 750; cursor: pointer; }
.account-profile-popover .account-logout-button:hover { background: color-mix(in srgb, #c53a49 13%, var(--surface)); }
:root[data-theme="dark"] .app-shell-launcher .account-profile-trigger { background: #203b5b; color: #b7dcff; border-color: #3b5675; }
:root[data-theme="dark"] .account-profile-popover { box-shadow: 0 18px 48px rgba(0, 0, 0, .42); }

/* The logo itself is the only home-return control in the topbar. */
.app-shell-launcher .topbar-active-app { display: none !important; }
.app-shell-launcher .topbar-brand { cursor: pointer; }
.app-shell-launcher .topbar-brand:focus-visible,
.app-shell-launcher .account-profile-trigger:focus-visible,
.app-shell-launcher .theme-toggle:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 50%, transparent); outline-offset: 3px; }

/* Restore the classic simple-mode quick actions without changing their workflows. */
.app-shell.simple-mode .simple-home-screen { display: grid; gap: 16px; }
.app-shell.simple-mode .simple-home-notifications { margin-top: 18px; }
.app-shell.simple-mode .simple-home-board { min-height: 0; }
.app-shell.simple-mode .simple-home-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.app-shell.simple-mode .topbar-account { display: block !important; }
.app-shell.simple-mode .topbar-tools .theme-toggle,
.app-shell.simple-mode .topbar-tools #notificationButton,
.app-shell.simple-mode .topbar-tools #appModeToggle { display: inline-flex !important; }
@media (max-width: 1050px) {
  .app-shell.simple-mode .simple-home-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .app-shell-launcher .topbar-center-zone { display: none !important; }
  .app-shell-launcher .topbar-tools { grid-column: 1 / -1; grid-row: 2; justify-content: stretch; }
  .app-shell-launcher .topbar-brand-zone { grid-column: 1 / -1; grid-row: 1; }
  .app-shell-launcher .topbar-account { max-width: none; }
  .account-profile-popover { inset-inline-end: 0; }
  .app-shell.simple-mode .simple-home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .app-shell.simple-mode .simple-home-grid { grid-template-columns: minmax(0, 1fr); }
}



/* 1.9.83 — centered four-column launcher, conditional alerts and fixed workspace tabs. */
.app-shell-launcher .app-topbar {
  grid-template-columns: minmax(240px, auto) minmax(220px, 1fr) auto;
}
.app-shell-launcher .topbar-center-zone { display: flex !important; min-width: 0; }
.app-shell-launcher .topbar-brand .brand-copy,
.app-shell-launcher .topbar-brand .brand-copy strong,
.app-shell-launcher .topbar-brand .brand-copy small {
  font-family: inherit !important;
}
.app-shell-launcher .account-profile-trigger .account-avatar-initial {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font: inherit;
  font-size: 15px;
  font-weight: 850;
  line-height: 1;
}
.app-shell-launcher .launcher-app-grid-flat {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(158px, auto);
  align-content: center;
  justify-items: stretch;
  gap: clamp(16px, 2.2vw, 28px);
  width: min(100%, 1160px);
  min-height: clamp(330px, 48vh, 560px);
  margin: 0 auto;
  padding: 18px 10px;
}
.app-launcher-clean .launcher-app-grid-flat .launcher-app-card {
  display: grid;
  min-height: 158px;
  border: 1px solid transparent;
  border-radius: 16px;
}
.app-launcher-clean .launcher-app-grid-flat .launcher-app-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-height: 156px;
  padding: 16px 10px;
  text-align: center;
}
.app-launcher-clean .launcher-app-grid-flat .launcher-app-icon {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 19px;
}
.app-launcher-clean .launcher-app-grid-flat .launcher-app-icon svg {
  width: 39px;
  height: 39px;
  stroke-width: 1.75;
}
.app-launcher-clean .launcher-app-grid-flat .launcher-app-copy strong {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}
.app-launcher-clean .launcher-app-grid-flat .launcher-app-card:hover {
  border-color: color-mix(in srgb, var(--brand) 18%, var(--line));
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(22, 39, 67, .07);
  transform: translateY(-2px);
}
@media (max-width: 1050px) {
  .app-shell-launcher .launcher-app-grid-flat {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: clamp(320px, 44vh, 500px);
  }
}
@media (max-width: 760px) {
  .app-shell-launcher .app-topbar { grid-template-columns: minmax(0, 1fr); }
  .app-shell-launcher .topbar-center-zone { display: none !important; }
  .app-shell-launcher .topbar-tools { grid-column: 1; grid-row: 2; }
  .app-shell-launcher .launcher-app-grid-flat {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(132px, auto);
    min-height: 0;
    gap: 10px;
    padding: 8px 2px;
  }
  .app-launcher-clean .launcher-app-grid-flat .launcher-app-card,
  .app-launcher-clean .launcher-app-grid-flat .launcher-app-main { min-height: 132px; }
  .app-launcher-clean .launcher-app-grid-flat .launcher-app-icon { width: 66px; height: 66px; border-radius: 15px; }
  .app-launcher-clean .launcher-app-grid-flat .launcher-app-icon svg { width: 32px; height: 32px; }
  .app-launcher-clean .launcher-app-grid-flat .launcher-app-copy strong { font-size: 12px; }
}
@media (max-width: 420px) {
  .app-shell-launcher .launcher-app-grid-flat { gap: 7px; }
  .app-launcher-clean .launcher-app-grid-flat .launcher-app-icon { width: 58px; height: 58px; }
  .app-launcher-clean .launcher-app-grid-flat .launcher-app-icon svg { width: 28px; height: 28px; }
}


/* 1.9.86 — Section navigation scrolls away with the page; only the global topbar stays sticky. */


/* 1.9.88 — Simple dashboard: remove both framing boards around daily shortcuts. */
.app-shell.simple-mode .simple-home-screen {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.app-shell.simple-mode .simple-home-board {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* 1.9.88 — compact export actions inside the activity filter row. */
.activity-export-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-inline-start: auto; }
.activity-export-actions .button { min-height: 39px; }
@media (max-width: 760px) { .activity-export-actions { width: 100%; margin-inline-start: 0; } .activity-export-actions .button { flex: 1 1 160px; } }

/* Runtime-adjusted dimensions for the Simple Mode shortcut grid. */
:root {
  --danger: #b42318;
  --simple-home-columns: 3;
  --simple-home-tile-height: 118px;
  --simple-home-icon-size: 42px;
}

/* 1.9.102 — Unified account controls, animated topbar feedback, and column-first simple shortcuts. */
.app-shell-launcher .app-topbar,
.app-shell.simple-mode .app-topbar {
  box-sizing: border-box !important;
  height: 70px !important;
  min-height: 70px !important;
  padding-block: 8px !important;
  transition: none !important;
}
.app-shell-launcher .topbar-brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  isolation: isolate;
}
.app-shell-launcher .topbar-brand .brand-mark,
.app-shell-launcher .topbar-brand .brand-copy {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity .18s ease, transform .22s ease;
}
.topbar-brand-return {
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-deep);
  opacity: 0;
  transform: translateY(-50%) scale(.78);
  transition: opacity .18s ease, transform .22s cubic-bezier(.2,.8,.2,1), background .18s ease;
  pointer-events: none;
}
.topbar-brand-return svg { width: 20px; height: 20px; }
@media (hover: hover) and (pointer: fine) {
  .app-shell-launcher .topbar-brand:hover .brand-mark,
  .app-shell-launcher .topbar-brand:hover .brand-copy { opacity: 0; transform: translateY(2px) scale(.92); }
  .app-shell-launcher .topbar-brand:hover .topbar-brand-return { opacity: 1; transform: translateY(-50%) scale(1); }
  .app-shell-launcher .topbar-brand:hover .topbar-brand-return:hover { background: var(--surface); }
}
.app-shell-launcher .topbar-brand:focus-visible .brand-mark,
.app-shell-launcher .topbar-brand:focus-visible .brand-copy { opacity: 0; transform: scale(.92); }
.app-shell-launcher .topbar-brand:focus-visible .topbar-brand-return { opacity: 1; transform: translateY(-50%) scale(1); }
.topbar-action-svg { display: block; width: 18px; height: 18px; flex: 0 0 18px; }
.topbar-sparkle-svg { width: 19px; height: 19px; }
.app-shell-launcher .topbar-utility-actions .top-icon[hidden],
.app-shell-launcher .topbar-utility-actions [hidden],
.app-shell-launcher .account-profile-trigger [hidden] { display: none !important; }
.app-shell-launcher .account-profile-trigger { position: relative; display: grid; place-items: center; overflow: hidden; padding: 0; }
.app-shell-launcher .account-profile-trigger .account-avatar-initial { display: grid; place-items: center; width: 100%; height: 100%; }
.account-avatar-photo { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.account-profile-popover {
  position: absolute;
  z-index: 80;
  top: calc(100% + 9px);
  inset-inline-end: 0;
  display: grid;
  gap: 8px;
  width: min(285px, calc(100vw - 24px));
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 16px 42px rgba(20, 32, 52, .18);
}
.account-profile-popover[hidden] { display: none !important; }
.account-profile-heading { display: grid; gap: 3px; padding: 2px 3px 10px; border-bottom: 1px solid var(--line); }
.account-profile-kicker { color: var(--muted); font-size: 10px; }
.account-profile-heading strong { color: var(--ink); font-size: 14px; }
.account-profile-heading small { color: var(--muted); font-size: 10px; }
.account-profile-menu-action {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 39px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  text-align: start;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.account-profile-menu-action:hover { border-color: var(--line); background: var(--surface-soft); color: var(--brand-deep); }
.account-profile-menu-action > span:first-child { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--brand-soft); color: var(--brand); font-size: 15px; }
.account-profile-popover .account-logout-button { width: 100%; min-height: 36px; margin-top: 2px; border-radius: 8px; }

/* Profile and subscription dialogs. */
.account-details-dialog,
.account-edit-dialog,
.subscription-details-dialog { width: min(560px, calc(100vw - 24px)); max-width: 560px; max-height: min(88dvh, 780px); }
.account-details-identity { display: flex; align-items: center; gap: 13px; padding: 3px 0 17px; }
.account-details-avatar,
.account-edit-avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 66px;
  width: 66px;
  height: 66px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 24px;
  font-weight: 800;
}
.account-details-avatar img,
.account-edit-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.account-details-avatar [hidden],
.account-edit-avatar [hidden] { display: none !important; }
.account-details-identity > div { display: grid; gap: 4px; min-width: 0; }
.account-details-identity strong { color: var(--ink); font-size: 15px; }
.account-details-identity small { color: var(--muted); font-size: 11px; }
.account-details-grid,
.subscription-details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.account-details-grid > div,
.subscription-details-grid > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}
.account-details-grid span,
.subscription-details-grid span { color: var(--muted); font-size: 10px; }
.account-details-grid strong,
.subscription-details-grid strong { overflow-wrap: anywhere; color: var(--ink); font-size: 11px; font-weight: 750; }
.account-edit-photo-row { display: flex; align-items: center; gap: 15px; margin-bottom: 17px; }
.account-edit-photo-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.account-edit-photo-actions small { flex-basis: 100%; color: var(--muted); font-size: 10px; }
.account-edit-dialog .form-field { display: grid; gap: 6px; margin-top: 12px; }
.account-edit-dialog .form-field > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.account-edit-dialog input[readonly] { background: var(--surface-soft); color: var(--muted); }
.account-edit-dialog .field-hint { margin: 10px 0 0; color: var(--danger, #b42318); font-size: 11px; }
.subscription-limits { display: grid; gap: 9px; margin-top: 18px; }
.subscription-limits h3 { margin: 0; color: var(--ink); font-size: 12px; }
.subscription-empty { display: grid; gap: 8px; padding: 18px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--surface-soft); text-align: center; }
.subscription-empty strong { color: var(--ink); font-size: 12px; }
.subscription-empty p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.subscription-empty.is-error { border-color: color-mix(in srgb, var(--danger, #b42318) 30%, var(--line)); }

/* Toast enters from the bottom and exits downward instead of appearing suddenly. */
.app-notice {
  top: auto !important;
  bottom: max(18px, env(safe-area-inset-bottom)) !important;
  left: 50%;
  opacity: 0;
  transform: translate(-50%, 18px) !important;
  transition: opacity .24s ease, transform .28s cubic-bezier(.2,.8,.2,1) !important;
  pointer-events: none;
}
.app-notice.is-visible { opacity: 1; transform: translate(-50%, 0) !important; }
.app-notice.is-leaving { opacity: 0; transform: translate(-50%, 18px) !important; }
.app-notice[hidden] { display: none !important; }

/* Simple shortcuts remain exactly three rows; additional shortcuts add columns, not rows. */
.app-shell.simple-mode .simple-home-board {
  width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  border: 0 !important;
  border-bottom: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}
.app-shell.simple-mode .simple-home-grid {
  display: grid !important;
  grid-template-columns: repeat(var(--simple-home-columns, 3), minmax(90px, 1fr)) !important;
  grid-template-rows: repeat(3, minmax(var(--simple-home-tile-height, 118px), auto)) !important;
  grid-auto-flow: column !important;
  grid-auto-columns: minmax(90px, 1fr) !important;
  grid-auto-rows: minmax(var(--simple-home-tile-height, 118px), auto) !important;
  align-content: start !important;
  align-items: stretch !important;
  width: max-content !important;
  min-width: 100% !important;
  min-height: 0 !important;
  height: auto !important;
  overflow: visible !important;
  gap: clamp(8px, .9vw, 14px) !important;
  padding: 1px 1px 3px !important;
  direction: rtl !important;
}
.app-shell.simple-mode .simple-home-action {
  min-height: var(--simple-home-tile-height, 118px) !important;
  height: auto !important;
  padding: clamp(8px, .9vw, 14px) !important;
  gap: 8px !important;
}
.app-shell.simple-mode .simple-home-icon {
  flex-basis: var(--simple-home-icon-size, 42px) !important;
  width: var(--simple-home-icon-size, 42px) !important;
  height: var(--simple-home-icon-size, 42px) !important;
}
.app-shell.simple-mode .simple-home-label { font-size: clamp(10px, 1vw, 16px) !important; line-height: 1.35 !important; }
.app-shell.simple-mode .simple-home-footer-note { display: none !important; }
.app-shell.simple-mode .simple-home-screen::after,
.app-shell.simple-mode .simple-home-board::after { display: none !important; content: none !important; }
@media (max-width: 1050px) {
  .app-shell.simple-mode .simple-home-grid { grid-template-columns: repeat(var(--simple-home-columns, 3), minmax(84px, 1fr)) !important; }
}
@media (max-width: 760px) {
  .app-shell-launcher .app-topbar,
  .app-shell.simple-mode .app-topbar { height: auto !important; min-height: 100px !important; padding-block: 8px !important; }
  .app-shell.simple-mode .simple-home-grid {
    grid-template-columns: repeat(var(--simple-home-columns, 3), minmax(78px, 1fr)) !important;
    grid-template-rows: repeat(3, minmax(90px, auto)) !important;
    grid-auto-rows: minmax(90px, auto) !important;
    gap: 7px !important;
  }
  .app-shell.simple-mode .simple-home-action { min-height: 90px !important; padding: 7px !important; border-radius: 12px !important; gap: 6px !important; }
  .app-shell.simple-mode .simple-home-icon { flex-basis: 30px !important; width: 30px !important; height: 30px !important; }
  .app-shell.simple-mode .simple-home-label { font-size: 10px !important; }
  .account-details-grid, .subscription-details-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .app-notice, .topbar-brand .brand-mark, .topbar-brand .brand-copy, .topbar-brand-return { transition: none !important; }
}

/* Report column picker: compact controls that match the report detail surface. */
.report-column-config { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line, #d8dee8); border-radius: 10px; background: var(--surface-soft, rgba(127, 140, 160, .06)); }
.report-column-config > summary { cursor: pointer; font-weight: 700; color: var(--text, inherit); }
.report-column-picker { display: flex; flex-wrap: wrap; gap: 9px 16px; padding-top: 12px; }
.report-column-picker label { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--text, inherit); }
.report-column-picker input { accent-color: var(--accent, #1677b8); }
.report-column-picker .activity-empty { flex-basis: 100%; margin: 0; }

/* 1.9.108 — custom invoice activity periods and standalone app launcher modules */
.reports-hero { align-items: center; gap: 18px; margin-bottom: 14px; background: linear-gradient(116deg, color-mix(in srgb, var(--brand) 15%, var(--surface)), var(--surface) 72%); }
.reports-hero .module-heading-actions { flex-wrap: wrap; }
.reports-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 14px; }
.reports-kpi-card { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 108px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.reports-kpi-icon { display: grid; place-items: center; flex: 0 0 43px; width: 43px; height: 43px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.reports-kpi-icon svg { width: 21px; height: 21px; stroke: currentColor; }
.reports-kpi-card > div { display: grid; gap: 3px; min-width: 0; }
.reports-kpi-card > div > span { color: var(--muted); font-size: 11px; font-weight: 650; }
.reports-kpi-card > div > strong { color: var(--ink); font-size: 25px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.reports-kpi-card > div > small { color: var(--muted); font-size: 9.5px; line-height: 1.5; }
.reports-kpi-card.is-ready .reports-kpi-icon { background: var(--green-soft); color: var(--green); }
.reports-kpi-card.is-pending .reports-kpi-icon { background: var(--orange-soft); color: var(--orange); }
.reports-kpi-card.is-rows .reports-kpi-icon { background: var(--surface-soft); color: var(--brand-deep); }
.reports-insight-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr); align-items: stretch; gap: 13px; margin-bottom: 13px; }
.reports-panel, .reports-source-panel { min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.reports-trend-panel, .reports-quick-panel { padding: 15px; }
.reports-panel-heading, .reports-source-heading, .reports-records-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; }
.reports-panel-heading h2, .reports-source-heading h2, .reports-records-heading h2 { margin: 0; color: var(--ink); font-size: 13px; font-weight: 800; }
.reports-panel-heading p, .reports-source-heading p, .reports-records-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.reports-period-toolbar { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; min-width: 0; }
.reports-period-control { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.reports-period-control select, .reports-status-filter select { min-height: 34px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 10px; }
.reports-custom-period { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.reports-custom-period label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.reports-custom-period input { width: 132px; min-width: 0; min-height: 34px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); color-scheme: light; font: inherit; font-size: 10px; }
:root[data-theme="dark"] .reports-custom-period input { color-scheme: dark; }
.reports-chart-scroll { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.reports-chart-scroll .reports-chart-plot { width: 100%; }
.reports-chart-legend { display: flex; align-items: center; gap: 14px; margin: 15px 0 5px; color: var(--muted); font-size: 10px; }
.reports-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.reports-chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 3px; background: var(--brand); }
.reports-chart-legend i.is-purchases { background: var(--brand-teal); }
.reports-chart-plot { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: end; gap: 10px; min-height: 158px; padding: 12px 5px 0; border-bottom: 1px solid var(--line); }
.reports-chart-month { display: grid; grid-template-rows: 18px minmax(88px, 1fr) 22px; align-items: end; justify-items: center; gap: 4px; min-width: 0; height: 100%; }
.reports-chart-total { color: var(--ink); font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; }
.reports-chart-bars { display: flex; align-items: end; justify-content: center; gap: 5px; width: 100%; height: 100%; min-height: 88px; padding: 0 4px; }
.reports-chart-bar { display: block; width: min(24px, 38%); min-height: 2px; border-radius: 5px 5px 2px 2px; background: var(--brand); transition: height .2s ease; }
.reports-chart-bar.is-purchases { background: var(--brand-teal); }
.reports-chart-label { color: var(--muted); font-size: 9px; white-space: nowrap; }
.reports-chart-note { margin: 10px 0 0; color: var(--muted); font-size: 9.5px; line-height: 1.6; }
.reports-chart-empty { display: grid; align-content: center; justify-items: center; gap: 5px; min-height: 130px; margin-top: 10px; padding: 14px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-soft); text-align: center; }
.reports-chart-empty strong { color: var(--ink); font-size: 11px; }
.reports-chart-empty span { max-width: 330px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.reports-count-tag { flex: none; padding: 6px 9px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface-soft); color: var(--brand-deep); font-size: 9px; font-weight: 750; white-space: nowrap; }
.reports-quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 13px; }
.reports-quick-card { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: color-mix(in srgb, var(--surface-soft) 35%, var(--surface)); }
.reports-quick-card-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.reports-quick-icon { display: grid; place-items: center; flex: 0 0 31px; width: 31px; height: 31px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); }
.reports-quick-icon svg { width: 16px; height: 16px; stroke: currentColor; }
.reports-quick-card-heading h3 { margin: 0; color: var(--ink); font-size: 10.5px; font-weight: 800; }
.reports-quick-card-heading p { margin: 2px 0 0; color: var(--muted); font-size: 8.5px; line-height: 1.45; }
.reports-type-list { display: grid; gap: 4px; }
.reports-type-link { display: flex; align-items: center; justify-content: space-between; gap: 7px; width: 100%; min-width: 0; padding: 6px 7px; border: 1px solid transparent; border-radius: 7px; background: var(--surface); color: var(--ink); font: inherit; font-size: 9px; text-align: right; cursor: pointer; }
.reports-type-link:hover { border-color: color-mix(in srgb, var(--brand) 25%, var(--line)); color: var(--brand); background: var(--brand-soft); }
.reports-type-link span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reports-type-link span:last-child { flex: none; color: var(--brand); font-size: 14px; line-height: 1; }
.reports-more-types { margin-top: 7px; }
.reports-more-types summary { padding: 5px 3px; color: var(--brand); font-size: 9px; font-weight: 700; cursor: pointer; }
.reports-more-types .reports-type-list { padding-top: 4px; }
.reports-no-types { grid-column: 1 / -1; margin: 0; padding: 16px; border-radius: 9px; background: var(--surface-soft); color: var(--muted); font-size: 10px; text-align: center; }
.reports-source-panel { margin: 0 0 13px; padding: 13px 15px; }
.reports-source-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.reports-source-metric { display: grid; gap: 2px; min-width: 0; padding: 10px 12px; border-inline-start: 2px solid var(--brand-soft); }
.reports-source-metric strong { color: var(--ink); font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.reports-source-metric span { color: var(--ink); font-size: 10px; font-weight: 700; }
.reports-source-metric small { color: var(--muted); font-size: 9px; }
.reports-records-panel { overflow: hidden; }
.reports-records-heading { align-items: center; padding: 15px 17px 12px; border-bottom: 1px solid var(--line); }
.reports-records-total { flex: none; color: var(--muted); font-size: 10px; font-weight: 700; }
.reports-list-toolbar { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.reports-search { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 170px; min-height: 37px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); }
.reports-search svg { flex: none; width: 15px; height: 15px; stroke: currentColor; }
.reports-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 10px; }
.reports-status-filter { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.reports-list-toolbar > .button { min-height: 35px; padding-inline: 10px; font-size: 10px; }
.reports-table-scroll { overflow-x: auto; }
.reports-table { width: 100%; min-width: 810px; border-collapse: separate; border-spacing: 0; }
.reports-table th { padding: 11px 13px; border-bottom: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); font-size: 9.5px; font-weight: 750; text-align: right; white-space: nowrap; }
.reports-table td { padding: 11px 13px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 10px; vertical-align: middle; }
.reports-table tbody tr:last-child td { border-bottom: 0; }
.reports-table tbody tr:hover td { background: color-mix(in srgb, var(--brand-soft) 40%, var(--surface)); }
.reports-record-title { display: grid; gap: 3px; min-width: 170px; }
.reports-record-title strong { font-size: 10.5px; font-weight: 750; }
.reports-record-title small, .reports-row-caption { color: var(--muted); font-size: 9px; }
.reports-row-count { display: block; font-size: 12px; font-variant-numeric: tabular-nums; }
.reports-row-caption { display: block; margin-top: 2px; }
.reports-row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.reports-row-action { min-height: 29px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--muted); font: inherit; font-size: 9px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.reports-row-action:hover { color: var(--brand); border-color: var(--brand); }
.reports-row-action.is-primary { border-color: color-mix(in srgb, var(--brand) 25%, var(--line)); background: var(--brand-soft); color: var(--brand-deep); }
.reports-table-empty { display: grid; justify-items: center; gap: 8px; min-height: 160px; padding: 24px 12px; color: var(--muted); text-align: center; }
.reports-table-empty strong { max-width: 520px; font-size: 10.5px; font-weight: 600; line-height: 1.8; }
.reports-table-empty .button { margin-top: 3px; }
.reports-empty-icon { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 11px; background: var(--surface-soft); color: var(--brand); }
.reports-empty-icon svg { width: 19px; height: 19px; stroke: currentColor; }
.reports-records-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.reports-records-footer > span { color: var(--muted); font-size: 9px; }
.reports-records-footer .button { min-height: 30px; padding: 4px 9px; font-size: 9px; }
.reports-records-footer [hidden] { display: none !important; }
:root[data-theme="dark"] .reports-hero { background: linear-gradient(116deg, color-mix(in srgb, var(--brand) 20%, var(--surface)), var(--surface) 72%); }
:root[data-theme="dark"] .reports-quick-card { background: color-mix(in srgb, var(--surface-soft) 55%, var(--surface)); }
:root[data-theme="dark"] .reports-type-link { background: color-mix(in srgb, var(--surface) 85%, var(--surface-soft)); }
:root[data-theme="dark"] .reports-type-link:hover { background: color-mix(in srgb, var(--brand) 18%, var(--surface)); }
@media (max-width: 1120px) {
  .reports-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reports-insight-grid { grid-template-columns: minmax(0, 1fr); }
  .reports-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .reports-kpi-grid { gap: 7px; }
  .reports-kpi-card { min-height: 86px; gap: 8px; padding: 10px; }
  .reports-kpi-icon { flex-basis: 33px; width: 33px; height: 33px; border-radius: 9px; }
  .reports-kpi-icon svg { width: 17px; height: 17px; }
  .reports-kpi-card > div > strong { font-size: 20px; }
  .reports-kpi-card > div > span { font-size: 9px; }
  .reports-kpi-card > div > small { font-size: 8px; }
  .reports-trend-panel, .reports-quick-panel { padding: 11px; }
  .reports-quick-grid { grid-template-columns: minmax(0, 1fr); }
  .reports-source-panel { padding: 11px; }
  .reports-source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reports-source-metric { padding: 8px; }
  .reports-list-toolbar { align-items: stretch; flex-wrap: wrap; padding: 9px; }
  .reports-search { flex-basis: 100%; }
  .reports-status-filter { flex: 1; justify-content: space-between; }
  .reports-status-filter select { flex: 1; }
  .reports-list-toolbar > .button { flex: 0 0 auto; }
  .reports-records-heading { align-items: flex-start; padding: 12px; }
  .reports-records-footer { padding: 8px 10px; }
}
@media (max-width: 420px) {
  .reports-kpi-card { align-items: flex-start; flex-direction: column; min-height: 105px; }
  .reports-period-toolbar { justify-content: flex-start; width: 100%; }
  .reports-period-control { align-items: flex-end; flex-direction: column; gap: 4px; }
  .reports-custom-period { flex: 1 1 100%; }
  .reports-custom-period label { flex: 1 1 0; align-items: flex-start; flex-direction: column; }
  .reports-custom-period input { width: 100%; }
  .reports-chart-plot { gap: 5px; }
  .reports-chart-bars { gap: 3px; }
  .reports-chart-label { font-size: 8px; }
  .reports-chart-total { font-size: 9px; }
  .reports-source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* 1.9.108 — Notifications open in-place and never change the active application/page. */
.app-shell-launcher .notification-center {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}
.app-shell-launcher .notification-center > #notificationButton[aria-expanded="true"] {
  color: var(--brand, #26a7d8);
  background: var(--brand-soft, rgba(38, 167, 216, .12));
}
.notification-popover {
  position: absolute;
  z-index: 180;
  top: calc(100% + 12px);
  inset-inline-end: 0;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 24px));
  max-height: min(540px, calc(100vh - 94px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 18px 48px rgba(8, 18, 38, .28);
  text-align: right;
}
.notification-popover[hidden] { display: none !important; }
.notification-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px 13px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}
.notification-popover-head > div { display: grid; gap: 4px; min-width: 0; }
.notification-popover-head strong { color: var(--ink); font-size: 13px; font-weight: 800; }
.notification-popover-head small { color: var(--muted); font-size: 10px; }
.notification-popover-total {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  min-width: 30px;
  height: 30px;
  padding-inline: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--brand, #26a7d8);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.notification-popover-body {
  display: flex;
  flex-direction: column;
  min-height: 82px;
  max-height: 390px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.notification-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 69px;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: right;
  cursor: pointer;
  transition: background .16s ease;
}
.notification-item:last-child { border-bottom: 0; }
.notification-item:hover,
.notification-item:focus-visible { outline: none; background: var(--surface-soft); }
.notification-item-mark {
  display: grid;
  place-items: center;
  flex: 0 0 29px;
  width: 29px;
  height: 29px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 900;
}
.notification-item-mark.is-urgent { background: rgba(180, 35, 24, .12); color: var(--danger, #b42318); }
.notification-item-mark.is-warning { background: rgba(217, 119, 6, .13); color: #d97706; }
.notification-item-copy { display: grid; flex: 1 1 auto; gap: 4px; min-width: 0; }
.notification-item-copy strong { overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.notification-item-copy small { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.65; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.notification-item-open { flex: 0 0 auto; color: var(--brand, #26a7d8); font-size: 10px; font-weight: 800; }
.notification-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 165px;
  padding: 22px 16px;
  text-align: center;
}
.notification-empty-icon {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  margin-bottom: 2px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--brand, #26a7d8);
  font-size: 17px;
  font-weight: 900;
}
.notification-empty-state strong { color: var(--ink); font-size: 12px; font-weight: 800; }
.notification-empty-state small { color: var(--muted); font-size: 10px; }
.notification-popover-foot {
  padding: 9px 13px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}
@media (max-width: 680px) {
  .notification-popover {
    position: fixed;
    top: auto;
    inset-inline: 12px;
    bottom: 12px;
    width: auto;
    max-height: min(70vh, 560px);
  }
  .notification-popover-body { max-height: min(48vh, 390px); }
}


/* 1.9.111 — native system typography, portrait-style modal backdrop and PWA install entry. */
:root,
body,
button,
input,
select,
textarea {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Segoe UI Variable", "SF Pro Text", "SF Arabic", "Noto Sans Arabic", "Noto Sans", Tahoma, Arial, sans-serif;
}
.dialog::backdrop {
  background: rgba(13, 20, 34, .48);
  -webkit-backdrop-filter: blur(10px) saturate(1.12);
  backdrop-filter: blur(10px) saturate(1.12);
}
.dialog[open] { animation: rasheed-dialog-enter .18s ease-out both; }
@keyframes rasheed-dialog-enter {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.account-profile-popover {
  background: color-mix(in srgb, var(--surface) 91%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.16);
  backdrop-filter: blur(16px) saturate(1.16);
}
.pwa-install-action > span:first-child { font-size: 17px; font-weight: 800; }
.pwa-install-action:disabled { cursor: default; opacity: .78; }
.pwa-install-dialog { width: min(540px, calc(100vw - 28px)); }
.pwa-install-content { gap: 11px; }
.pwa-install-status { margin: 0; padding: 11px 13px; border: 1px solid color-mix(in srgb, var(--brand) 26%, var(--line)); border-radius: 10px; background: var(--brand-soft); color: var(--brand-deep); font-size: 12px; line-height: 1.8; }
.pwa-install-step { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pwa-install-step strong { color: var(--ink); font-size: 12px; }
.pwa-install-step p,.pwa-install-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.85; }
.pwa-install-note { padding: 3px 2px 0; }
@media (prefers-reduced-motion: reduce) {
  .dialog[open] { animation: none; }
}

/* Treasury vouchers workspace */
.treasury-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:18px 0}
.treasury-kpis article{display:grid;gap:5px;min-width:0;padding:16px 18px;border:1px solid var(--border-color,#dce4ec);border-radius:14px;background:var(--surface,#fff);box-shadow:0 5px 18px rgba(28,49,71,.045)}
.treasury-kpis span,.treasury-kpis small{color:var(--muted,#68778a);font-size:12px}.treasury-kpis strong{font-size:24px;font-weight:750;color:var(--text,#172536)}
.treasury-workspace{border:1px solid var(--border-color,#dce4ec);border-radius:16px;background:var(--surface,#fff);overflow:hidden}
.treasury-tabs{display:flex;gap:7px;overflow:auto;padding:10px;border-bottom:1px solid var(--border-color,#dce4ec);background:var(--surface-muted,#f7f9fb)}
.treasury-tab{flex:0 0 auto;border:1px solid transparent;background:transparent;color:var(--text,#172536);border-radius:9px;padding:9px 13px;font:inherit;font-size:13px;cursor:pointer;white-space:nowrap}
.treasury-tab.is-active{border-color:var(--border-color,#dce4ec);background:var(--surface,#fff);color:var(--primary,#0878bd);font-weight:700;box-shadow:0 2px 8px rgba(20,45,70,.06)}
.treasury-content{padding:18px;min-width:0}.treasury-table-wrap{width:100%;overflow:auto;border:1px solid var(--border-color,#dce4ec);border-radius:10px}
.treasury-table{width:100%;border-collapse:collapse;min-width:760px;font-size:13px}.treasury-statement-closing th{background:var(--surface-soft);color:var(--text);font-weight:750}.treasury-statement-closing strong{color:var(--brand-deep)}.treasury-table th,.treasury-table td{padding:11px 12px;border-bottom:1px solid var(--border-color,#e7edf2);text-align:start;white-space:nowrap}.treasury-table th{background:var(--surface-muted,#f7f9fb);color:var(--muted,#64748b);font-weight:650}.treasury-table tr:last-child td{border-bottom:0}.treasury-table td strong{color:var(--text,#172536)}
.treasury-empty{display:grid;justify-items:center;gap:9px;padding:42px 16px;color:var(--muted,#68778a);text-align:center}.treasury-empty>span svg{width:38px;height:38px;color:var(--primary,#0878bd)}.treasury-empty strong{color:var(--text,#172536);font-size:15px}.treasury-empty p{max-width:480px;margin:0;font-size:13px}
.treasury-report-controls{display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin-bottom:18px}.treasury-report-controls .form-field{min-width:180px;max-width:280px;flex:1}.treasury-report-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:4px 0 12px}.treasury-report-heading h3{margin:0}.treasury-report-heading span{font-size:12px;color:var(--muted,#68778a)}.treasury-report-currency{margin-top:18px}.treasury-aging-card{margin-bottom:14px;padding:14px;border:1px solid var(--border-color,#dce4ec);border-radius:12px;background:var(--surface-muted,#f7f9fb)}.treasury-aging-card h3{margin:0 0 12px;font-size:14px}.treasury-aging-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px}.treasury-aging-grid>div{display:grid;gap:5px;padding:10px;border-radius:8px;background:var(--surface,#fff)}.treasury-aging-grid span{color:var(--muted,#68778a);font-size:11px}.treasury-aging-grid strong{font-size:13px;overflow-wrap:anywhere}
.treasury-footnote{margin:12px 3px;color:var(--muted,#68778a);font-size:11px;line-height:1.7}.treasury-voucher-dialog{width:min(900px,calc(100vw - 28px));max-width:900px;max-height:min(92vh,900px);overflow:auto}.treasury-voucher-form{display:grid;gap:14px}.treasury-voucher-form .dialog-header{position:sticky;top:0;z-index:2;background:var(--surface,#fff);padding-bottom:10px}.treasury-voucher-form .dialog-header h2{margin:4px 0 0}.treasury-form-intro{margin:0;padding:10px 12px;border-radius:9px;background:var(--surface-muted,#f7f9fb);color:var(--muted,#68778a);font-size:12px;line-height:1.7}.treasury-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.treasury-form-grid .form-field{min-width:0}.treasury-wide-field,.treasury-bank-fields{grid-column:1/-1}.treasury-bank-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.treasury-bank-fields[hidden]{display:none}.treasury-currency-field small{display:block;color:var(--muted,#68778a);font-size:10px;margin-top:4px}.treasury-allocation-section{grid-column:1/-1;padding:14px;border:1px solid var(--border-color,#dce4ec);border-radius:12px;background:var(--surface-muted,#f8fafc)}.treasury-section-title h3{margin:0;font-size:14px}.treasury-section-title p{margin:4px 0 12px;color:var(--muted,#68778a);font-size:11px}.treasury-allocation-entry{display:grid;grid-template-columns:minmax(0,2fr) minmax(130px,1fr) auto;align-items:end;gap:10px}.treasury-allocation-list{margin-top:10px}.treasury-allocation-summary{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:11px;font-size:12px;color:var(--muted,#68778a)}.treasury-allocation-summary strong{color:var(--text,#172536)}.treasury-form-error{margin:0;padding:10px 12px;border-radius:8px;background:rgba(194,55,55,.09);color:#b42318;font-size:12px}.related-link-inline{border:0;background:transparent;color:var(--primary,#0878bd);font:inherit;text-decoration:underline;cursor:pointer}.treasury-voucher-detail .detail-grid{margin:12px 0}.treasury-voucher-detail h3{margin-top:17px}
@media(max-width:760px){.treasury-kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.treasury-kpis article{padding:12px}.treasury-kpis strong{font-size:20px}.treasury-content{padding:12px}.treasury-form-grid{grid-template-columns:1fr}.treasury-wide-field,.treasury-bank-fields{grid-column:auto}.treasury-bank-fields{grid-template-columns:1fr}.treasury-allocation-entry{grid-template-columns:1fr}.treasury-aging-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.treasury-voucher-dialog{width:calc(100vw - 18px);max-height:94vh}}

/* Daily treasury close and book-to-cash comparison */
.treasury-cash-controls{align-items:end;margin-bottom:14px}
.treasury-cash-controls .form-field{min-width:170px;max-width:260px}
.treasury-cash-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:0 0 14px}
.treasury-cash-summary article{display:grid;gap:5px;min-width:0;padding:12px 14px;border:1px solid var(--border-color,#dce4ec);border-radius:11px;background:var(--surface-muted,#f7f9fb)}
.treasury-cash-summary span,.treasury-cash-latest{color:var(--muted,#68778a);font-size:11px}
.treasury-cash-summary strong{font-size:17px;color:var(--text,#172536);overflow-wrap:anywhere}
.treasury-cash-table{min-width:1120px}
.treasury-cash-table td{vertical-align:middle}
.treasury-cash-latest{display:block;margin-top:4px;white-space:normal;max-width:220px;line-height:1.55}
.treasury-positive{color:#16804a!important}
.treasury-negative{color:#c13b3b!important}
.treasury-cash-total th{background:var(--surface-muted,#f7f9fb);font-weight:750;border-top:1px solid var(--border-color,#dce4ec)}
.treasury-closing-status{display:inline-flex;align-items:center;justify-content:center;padding:5px 8px;border-radius:999px;font-size:11px;font-weight:700;white-space:nowrap}
.treasury-closing-status.is-balanced{background:rgba(22,128,74,.1);color:#16804a}
.treasury-closing-status.is-variance{background:rgba(193,59,59,.1);color:#b83232}
.treasury-closing-status.is-open{background:var(--surface-muted,#f1f4f7);color:var(--muted,#68778a)}
.treasury-cash-note{margin:12px 2px 0;color:var(--muted,#68778a);font-size:11px;line-height:1.75}
.treasury-close-dialog{width:min(620px,calc(100vw - 24px));max-width:620px;max-height:min(92vh,850px);overflow:auto}
.treasury-close-form{display:grid;gap:14px}
.treasury-close-form .dialog-header{position:sticky;top:0;z-index:2;padding-bottom:10px;background:var(--surface,#fff)}
.treasury-close-form .dialog-header h2{margin:4px 0 0}
.treasury-cash-account-head{display:grid;gap:4px;padding:12px 14px;border:1px solid var(--border-color,#dce4ec);border-radius:10px;background:var(--surface-muted,#f7f9fb)}
.treasury-cash-account-head strong{font-size:15px;color:var(--text,#172536)}
.treasury-cash-account-head span{font-size:11px;color:var(--muted,#68778a)}
.treasury-cash-breakdown{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.treasury-cash-breakdown>div{display:grid;gap:5px;padding:11px;border:1px solid var(--border-color,#dce4ec);border-radius:9px;min-width:0}
.treasury-cash-breakdown span,.treasury-cash-variance-preview span{font-size:11px;color:var(--muted,#68778a)}
.treasury-cash-breakdown strong{font-size:13px;overflow-wrap:anywhere;color:var(--text,#172536)}
.treasury-cash-breakdown .is-emphasized{background:var(--surface-muted,#f7f9fb);border-color:color-mix(in srgb,var(--primary,#0878bd) 28%,var(--border-color,#dce4ec))}
.treasury-cash-variance-preview{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border:1px solid var(--border-color,#dce4ec);border-radius:9px;background:var(--surface-muted,#f7f9fb)}
.treasury-cash-variance-preview strong{font-size:15px;color:#16804a;direction:ltr}
.treasury-cash-variance-preview.has-variance strong{color:#c13b3b}
.treasury-close-form .dialog-actions{position:sticky;bottom:0;display:flex;justify-content:flex-end;gap:8px;padding:12px 0 0;background:var(--surface,#fff);border-top:1px solid var(--border-color,#dce4ec)}
@media(max-width:760px){.treasury-cash-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.treasury-cash-summary article{padding:10px}.treasury-cash-summary strong{font-size:14px}.treasury-cash-controls .form-field{max-width:none;min-width:calc(50% - 8px)}.treasury-cash-breakdown{grid-template-columns:1fr 1fr}.treasury-close-dialog{width:calc(100vw - 16px);max-height:94vh}.treasury-close-form{gap:11px}}

/* Treasury control dashboard, custody handover and transit tracking */
.treasury-control-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 16px}
.treasury-control-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0 0 14px}
.treasury-control-kpis article{display:grid;gap:5px;padding:13px 15px;border:1px solid var(--border-color,#dce4ec);border-radius:11px;background:var(--surface-muted,#f7f9fb)}
.treasury-control-kpis span{font-size:11px;color:var(--muted,#68778a)}
.treasury-control-kpis strong{font-size:20px;color:var(--text,#172536)}
.treasury-operations-panel{display:grid;gap:12px;margin-top:18px}
.treasury-operations-panel>header{display:flex;align-items:center;justify-content:space-between;gap:10px}
.treasury-operations-panel h3{margin:0;font-size:15px}
.treasury-operations-panel>header span{font-size:11px;color:var(--muted,#68778a)}
.treasury-inline-actions{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.treasury-operation-dialog{width:min(720px,calc(100vw - 24px));max-width:720px;max-height:min(92vh,820px);overflow:auto}
.treasury-operation-form{display:grid;gap:14px}
.treasury-operation-form .dialog-header{position:sticky;top:0;z-index:2;background:var(--surface,#fff);padding-bottom:10px}
.treasury-operation-form .dialog-header h2{margin:4px 0 0}
@media(max-width:760px){.treasury-control-kpis{grid-template-columns:1fr 1fr}.treasury-control-actions{align-items:stretch}.treasury-control-actions .button{flex:1 1 calc(50% - 8px)}.treasury-operation-dialog{width:calc(100vw - 16px);max-height:94vh}}
@media print{
  body{background:#fff!important;color:#111!important}
  .app-sidebar,.app-topbar,.treasury-tabs,.treasury-cash-controls,.treasury-control-actions,.heading-actions,.treasury-footnote,.button,.treasury-inline-actions{display:none!important}
  .app-main,.page-host,.treasury-content,.treasury-workspace{width:100%!important;max-width:none!important;margin:0!important;padding:0!important;border:0!important;box-shadow:none!important;overflow:visible!important}
  .treasury-table-wrap{overflow:visible!important;border:0!important}
  .treasury-table{min-width:0!important;font-size:9pt!important}
  .treasury-table th,.treasury-table td{padding:5px 6px!important;white-space:normal!important}
  .treasury-control-kpis article{break-inside:avoid}
  @page{size:A4 landscape;margin:10mm}
}

.treasury-reason-dialog{width:min(520px,calc(100vw - 24px));max-width:520px}.treasury-reason-form{display:grid;gap:14px}.treasury-reason-form .dialog-header{display:flex;align-items:center;justify-content:space-between;gap:12px}.treasury-reason-form .dialog-header h2{margin:4px 0 0}


/* Customer Bankak payment inside the subscription dialog */
.customer-payment-section { display: grid; gap: 16px; margin-top: 20px; }
.customer-payment-section-title h3,
.customer-payment-history-section h3 { margin: 0 0 10px; color: var(--ink); font-size: 13px; }
.customer-bankak-panel { display: grid; gap: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.customer-payment-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.customer-payment-heading h3 { margin: 0; color: var(--ink); font-size: 13px; }
.customer-payment-heading p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.customer-payment-method { flex: none; padding: 5px 10px; border-radius: 20px; background: var(--brand-soft); color: var(--brand); font-size: 10px; font-weight: 800; }
.customer-bankak-details { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.customer-bankak-details > div { display: grid; gap: 5px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.customer-bankak-details span { color: var(--muted); font-size: 10px; }
.customer-bankak-details strong { color: var(--ink); font-size: 11px; overflow-wrap: anywhere; }
.customer-bankak-details .customer-bankak-instructions { grid-column: 1 / -1; }
.customer-bankak-instructions p { margin: 0; color: var(--ink); font-size: 11px; line-height: 1.8; white-space: pre-line; }
.customer-bankak-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.customer-bankak-form .form-field { display: grid; gap: 6px; min-width: 0; }
.customer-bankak-form .form-field > span { color: var(--muted); font-size: 10px; font-weight: 700; }
.customer-bankak-form input,
.customer-bankak-form select,
.customer-bankak-form textarea { width: 100%; min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 11px; }
.customer-bankak-form textarea { resize: vertical; }
.customer-bankak-form .customer-payment-hint,
.customer-bankak-form .customer-payment-disclaimer,
.customer-bankak-form .customer-payment-feedback { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.customer-bankak-form .customer-payment-feedback { color: var(--danger, #b42318); }
.customer-bankak-form button { justify-self: start; }
.customer-payment-history-section { display: grid; gap: 9px; }
.customer-payment-history { display: grid; gap: 8px; }
.customer-payment-request { display: grid; gap: 5px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.customer-payment-request > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.customer-payment-request strong { color: var(--ink); font-size: 11px; }
.customer-payment-request p,
.customer-payment-request small { margin: 0; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.customer-payment-status { padding: 4px 8px; border-radius: 20px; background: var(--brand-soft); color: var(--brand); font-size: 9px; font-weight: 750; }
.customer-payment-status[data-status="approved"] { background: var(--green-soft); color: var(--green); }
.customer-payment-status[data-status="rejected"] { background: var(--surface); color: var(--danger, #b42318); }
.customer-payment-empty { margin: 0; padding: 12px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); font-size: 10px; text-align: center; }
@media (max-width: 600px) {
  .customer-bankak-form,
  .customer-bankak-details { grid-template-columns: minmax(0,1fr); }
  .customer-bankak-details .customer-bankak-instructions { grid-column: auto; }
}
