:root {
  --accent: #f54c00;
  --accent-dark: #d94300;
  --black: #000000;
  --white: #ffffff;
  --ink: #151515;
  --muted: #696969;
  --soft: #f7f7f7;
  --line: #dedede;
  --line-strong: #c9c9c9;
  --success: #187c31;
  --success-bg: #eef9f0;
  --danger: #c52d2d;
  --danger-bg: #fff1f1;
  --sidebar-width: 264px;
  --topbar-height: 66px;
  --record-modal-width: 1120px;
  --control-height: 42px;
  --radius-sm: 7px;
  --radius: 10px;
  --radius-lg: 14px;
  --font-body: 17px;
  --font-callout: 16px;
  --font-subheadline: 15px;
  --font-table: 14px;
  --font-footnote: 13px;
  --font-caption: 12px;
  --font-caption-small: 11px;
  --scrollbar-track: #f1f1f1;
  --scrollbar-thumb: #b8b8b8;
  --scrollbar-thumb-hover: #929292;
  --shadow-modal: 0 24px 70px rgba(0, 0, 0, .2), 0 3px 10px rgba(0, 0, 0, .08);
  --ease: 180ms ease;
}

/* Subscription customer directory keeps identity and clinical records in their canonical modules. */
.customer-profiles-area { min-height: calc(100vh - var(--topbar-height)); padding-bottom: 0 !important; }
.customer-profiles-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 15px; border-bottom: 1px solid var(--line); }
.customer-profiles-scopes { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: #f6f6f6; }
.customer-profiles-scopes button { min-height: 35px; padding: 6px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: inherit; cursor: pointer; }
.customer-profiles-scopes button.is-active { background: var(--accent); color: #fff; font-weight: 700; }
.customer-profiles-search { display: flex; min-width: min(100%, 280px); max-width: 440px; flex: 1; gap: 5px; }
.customer-profiles-search input { min-width: 0; flex: 1; height: var(--control-height); }
.customer-profiles-search .button { width: var(--control-height); padding: 0; }
.customer-profiles-toolbar > .button { margin-left: auto; }
.customer-profiles-results { display: flex; min-height: 220px; flex: 1; }
.customer-profiles-table-wrap { width: 100%; overflow-x: auto; }
.customer-profiles-table { min-width: 700px; font-size: 14px; }
.customer-profiles-table td:first-child strong, .customer-profiles-table td:first-child small { display: block; }
.customer-profiles-table td:first-child small { margin-top: 2px; color: var(--muted); }
.customer-profiles-empty { display: grid; width: 100%; place-content: center; justify-items: center; gap: 8px; color: var(--muted); text-align: center; }
.customer-profiles-empty svg { width: 27px; height: 27px; }
.customer-profiles-empty strong { color: var(--ink); }
.customer-profiles-footer { display: flex; min-height: 57px; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 15px; border-top: 1px solid var(--line); color: var(--muted); }
.customer-profiles-footer > div { display: inline-flex; align-items: center; gap: 10px; }
.customer-profiles-footer select, .customer-profiles-footer .select2-container { width: 78px !important; }
.customer-profiles-footer .button { min-width: 34px; min-height: 34px; padding: 5px; }
.customer-profile-detail { display: grid; gap: 18px; }
.customer-profile-detail section { min-width: 0; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.customer-profile-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.customer-profile-detail h3 { margin: 0 0 11px; font-size: 16px; }
.customer-profile-detail .customer-profile-section-head h3 { margin: 0; }
.customer-profile-detail h3 span { color: var(--muted); font-weight: 400; }
.customer-profile-detail p { margin: 0; color: var(--muted); }
.customer-profile-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.customer-profile-facts > span { display: grid; gap: 3px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 12px; }
.customer-profile-facts strong { overflow-wrap: anywhere; color: var(--ink); font-size: 14px; }
.customer-profile-addresses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.customer-profile-addresses article { display: grid; gap: 5px; min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; }
.customer-profile-addresses article span, .customer-profile-addresses article small { color: var(--muted); }
.customer-profile-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.customer-profile-tag { padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fafafa; font-size: 13px; }
.customer-profile-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
@media (max-width: 700px) {
  .customer-profiles-toolbar > .button { margin-left: 0; }
  .customer-profiles-search { max-width: none; flex-basis: 100%; order: 2; }
  .customer-profile-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .customer-profile-addresses { grid-template-columns: 1fr; }
}
@media (max-width: 450px) { .customer-profile-facts { grid-template-columns: 1fr; } }

.clinical-checklist {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.clinical-checklist > strong,
.clinical-personal-info > strong { display: block; margin-bottom: 10px; font-size: 15px; }
.clinical-check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 12px; }
.clinical-check-row { display: flex; align-items: center; justify-content: space-between; min-width: 0; gap: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; }
.clinical-check-row label { display: flex; align-items: center; min-width: 0; gap: 7px; font-size: 13px; cursor: pointer; }
.clinical-check-row input[type="checkbox"] { flex: 0 0 auto; accent-color: var(--accent); }
.clinical-check-row .select2-container { width: 116px !important; flex: 0 0 116px; }
.clinical-check-row:not(.is-selected) .select2-container { display: none; }
.clinical-checklist[data-clinical-severity-mode="choices"] .clinical-check-grid { grid-template-columns: 1fr; }
.clinical-checklist[data-clinical-severity-mode="choices"] .clinical-check-row { flex-wrap: wrap; }
.clinical-checklist[data-clinical-severity-mode="choices"] .clinical-check-row > label { flex: 1 1 190px; font-weight: 600; }
.clinical-severity-choices { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px; }
.clinical-severity-choices label, .customer-allergy-severity label { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 13px; font-weight: 500; }
.clinical-severity-choices input, .customer-allergy-severity input { accent-color: var(--accent); }
.clinical-check-row:not(.is-selected) .clinical-severity-choices { opacity: .55; }
.clinical-diet-grid { grid-template-columns: 1fr; }
.clinical-diet-bariatric { flex-wrap: wrap; justify-content: flex-start; }
.clinical-diet-bariatric > label { flex: 0 0 180px; font-weight: 600; }
.clinical-diet-stages { display: flex; flex: 1 1 400px; flex-wrap: wrap; gap: 8px 18px; }
.clinical-diet-stages label { white-space: nowrap; }
.clinical-legacy-severity { color: var(--muted); font-size: 12px; }
.clinical-personal-info { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafafa; }
.clinical-personal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; }
.clinical-personal-grid span { display: grid; gap: 2px; min-width: 0; font-size: 12px; color: var(--muted); }
.clinical-personal-grid b { font-size: 14px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.clinical-personal-info small { display: block; margin-top: 10px; color: var(--muted); }
.customer-profile-checklist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.customer-profile-checklist .clinical-check-row { justify-content: flex-start; font-size: 13px; }
.customer-profile-checklist .clinical-check-row small { margin-left: auto; color: var(--muted); }
.customer-profile-checklist .clinical-check-row.is-selected { border-color: #ffb89a; background: #fff5f0; }
.customer-profile-checklist input { accent-color: var(--accent); }
.goal-history-section { min-width: 0; margin: 18px 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.goal-history-section h3 { margin: 0 0 10px; font-size: 16px; }
.goal-history-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.goal-history-note { margin: 0; color: var(--muted); font-size: 13px; }
.goal-history-toolbar .button { flex: 0 0 auto; }
.goal-history-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.goal-history-table { width: 100%; min-width: 1180px; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.goal-history-table th, .goal-history-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.goal-history-table th { background: #f1f1f1; color: #383838; text-transform: uppercase; }
.goal-history-table tbody th { background: white; font-weight: 600; }
.goal-history-entry { background: #fff9f6; }
.goal-history-entry th { min-width: 40px; }
.goal-history-entry th > span { display: block; margin-bottom: 6px; }
.goal-history-entry th > small { display: block; max-width: 130px; margin-bottom: 6px; color: var(--muted); font-weight: 400; white-space: normal; }
.goal-history-entry-actions { display: flex; gap: 4px; }
.goal-history-table .goal-history-actions { position: sticky; right: 0; z-index: 2; min-width: 136px; background: #fff; box-shadow: -1px 0 var(--line); }
.goal-history-table thead .goal-history-actions { z-index: 3; background: #f1f1f1; }
.goal-history-entry .goal-history-actions { background: #fff9f6; }
.goal-history-entry-actions .button { min-height: 30px; padding: 3px 7px; }
.goal-history-entry input { box-sizing: border-box; width: 96px; min-width: 0; height: var(--control-height); padding: 7px 8px; font-size: 13px; }
.goal-history-entry input[type="datetime-local"] { width: 178px; }
@media (max-width: 560px) { .goal-history-toolbar { align-items: flex-start; flex-direction: column; } }
.subscription-category-balances { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.subscription-category-balances span { display: flex; justify-content: space-between; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; }
.subscription-category-balances b { color: var(--accent); }
@media (max-width: 800px) {
  .clinical-check-grid, .clinical-personal-grid, .subscription-category-balances, .customer-profile-checklist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .clinical-check-grid, .clinical-personal-grid, .subscription-category-balances, .customer-profile-checklist { grid-template-columns: 1fr; }
}

.plan-rate-builder {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.form-inline-note {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid #f8ccb8;
  border-radius: 8px;
  background: #fff8f4;
  color: #733a23;
  font-size: 13px;
}

.pos-credit-summary {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid #f8ccb8;
  border-radius: 8px;
  background: #fff8f4;
  font-size: 12px;
}
.pos-credit-summary[hidden] { display: none; }
.pos-credit-summary strong { color: var(--accent); }
.pos-credit-summary span { color: #4c4c4c; }
.pos-credit-options select { width: 100%; }
.pos-credit-options small, .pos-credit-covered { color: #666; font-size: 12px; }
.subscription-balance-list { display: grid; gap: 6px; margin-top: 10px; }
.subscription-balance-list > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; }
.subscription-balance-list small { color: var(--muted); }
@media (max-width: 640px) { .subscription-balance-list > div { grid-template-columns: minmax(0, 1fr) auto; } .subscription-balance-list small { grid-column: 1 / -1; } }
.meal-tier-eligibility { display: grid; gap: 8px; margin-top: 12px; }
.meal-tier-eligibility > div { display: grid; grid-template-columns: minmax(140px, 1fr) repeat(3, minmax(70px, 110px)); align-items: center; gap: 8px; }
.meal-tier-eligibility label { display: flex; align-items: center; gap: 5px; font-size: 13px; }
@media (max-width: 640px) { .meal-tier-eligibility > div { grid-template-columns: repeat(3, 1fr); } .meal-tier-eligibility > div > strong { grid-column: 1 / -1; } }
.subscription-weekdays { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.subscription-weekdays label { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; }
.subscription-inline-customer { padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fffaf7; }
.subscription-inline-customer[hidden] { display: none; }
.subscription-inline-customer-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 10px; align-items: end; margin-top: 10px; }
.subscription-inline-customer-fields .button { min-height: var(--control-height); }
.subscription-inline-customer > small { display: block; margin-top: 8px; color: var(--muted); }
@media (max-width: 600px) { .subscription-inline-customer-fields { grid-template-columns: 1fr; } }
.subscription-inline-address { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fffaf7; }
.subscription-inline-address[hidden] { display: none; }
.subscription-inline-address-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.subscription-inline-address-fields .field-full { grid-column: 1 / -1; }
.subscription-inline-address-fields input, .subscription-inline-address-fields textarea { min-width: 0; width: 100%; }
.plan-rate-builder .pos-section-title > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
@media (max-width: 700px) { .subscription-inline-address-fields { grid-template-columns: 1fr; } }
.subscription-delivery-grid-head,
.subscription-delivery-slot-row { display: grid; grid-template-columns: minmax(145px, 1.1fr) 94px minmax(180px, 1.4fr) 140px 105px 42px; gap: 8px; align-items: center; }
.subscription-delivery-grid-head { margin-top: 12px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.subscription-delivery-slot-row { margin-top: 9px; }
.subscription-item-name { min-width: 0; font-size: var(--font-caption); }
.subscription-delivery-slot-row > select,
.subscription-delivery-slot-row > input,
.subscription-delivery-slot-row > .select2-container { width: 100% !important; min-width: 0; height: var(--control-height); }
.subscription-delivery-slot-row > select.select2-hidden-accessible { width: 1px !important; height: 1px !important; }
.subscription-delivery-slot-row > input {
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--white);
  font: inherit;
  font-size: var(--font-callout);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.subscription-delivery-slot-row > input:focus {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(245, 76, 0, .12);
}
.subscription-delivery-slot-row > output {
  display: flex;
  align-items: center;
  min-width: 0;
  height: var(--control-height);
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: #f8f8f8;
  white-space: nowrap;
  font-size: var(--font-caption);
  font-weight: 800;
}
.subscription-delivery-slot-row > button { height: var(--control-height); }
[id^="field-customer-subscriptions-"][readonly] { background: #f8f8f8; color: #555; }
@media (max-width: 700px) {
  .subscription-delivery-grid-head { display: none; }
  .subscription-delivery-slot-row { grid-template-columns: minmax(0, 1fr) 96px 42px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .subscription-delivery-slot-row > [data-subscription-choice],
  .subscription-delivery-slot-row > .select2-container:first-of-type { grid-column: 1; }
  .subscription-delivery-slot-row > [data-subscription-weekly] { grid-column: 2 / 4; }
  .subscription-delivery-slot-row > [data-subscription-slot-address],
  .subscription-delivery-slot-row > .select2-container:nth-of-type(2) { grid-column: 1 / -1; }
  .subscription-delivery-slot-row > [data-subscription-slot-time] { grid-column: 1; }
  .subscription-delivery-slot-row > output { grid-column: 2; justify-content: flex-end; }
  .subscription-delivery-slot-row > button { grid-column: 3; }
}

.plan-rate-builder > p,
.plan-rate-builder > small { color: var(--muted); }

.plan-rate-grid-head,
.plan-rate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px 42px;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.plan-rate-grid-head { font-size: 12px; font-weight: 700; text-transform: uppercase; }
.plan-rate-row > input,
.plan-rate-row > select,
.plan-rate-row > .select2-container { width: 100% !important; min-width: 0; height: var(--control-height); }
.plan-rate-row > select.select2-hidden-accessible,
.tier-choice-row > select.select2-hidden-accessible { width: 1px !important; height: 1px !important; }
.plan-rate-row > button { height: var(--control-height); }
.tier-choice-row { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 10px; margin-top: 9px; align-items: center; }
.tier-choice-row > select, .tier-choice-row > .select2-container { width: 100% !important; min-width: 0; height: var(--control-height); }
.tier-choice-row > button { height: var(--control-height); }

@media (max-width: 520px) {
  .plan-rate-grid-head,
  .plan-rate-row { grid-template-columns: minmax(0, 1fr) 80px 38px; gap: 6px; }
}

/* Nutrition */
.inbody-parser-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff8f4;
}

.inbody-parser-copy { display: grid; gap: 3px; min-width: 0; }
.inbody-parser-copy > strong { font-size: 14px; color: #202020; }
.inbody-parser-copy > span:not(.inbody-parser-status) { color: var(--muted); font-size: 12px; line-height: 1.5; }
.inbody-parser-status { display: inline-flex; align-items: center; gap: 5px; width: fit-content; color: var(--muted); font-size: 12px; font-weight: 700; }
.inbody-parser-status.is-ready { color: #16833b; }
.inbody-parser-status svg { width: 14px; height: 14px; }
.inbody-parser-selection { grid-column: 1 / -1; display: flex; min-width: 0; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #f1c8b4; border-radius: 7px; color: var(--muted); background: #fff; font-size: 12px; }
.inbody-parser-selection[hidden] { display: none; }
.inbody-parser-selection strong { flex: 0 0 auto; color: var(--accent-dark); }
.inbody-parser-selection span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbody-parser-selection.is-error { border-color: #efbcb3; color: #8e2f21; background: #fff4f2; }
.inbody-parser-selection.is-error strong { color: var(--danger); }
.inbody-parser-warning { grid-column: 1 / -1; padding: 8px 10px; border-radius: 7px; color: #7a3a00; background: #fff1df; white-space: pre-wrap; font-size: 12px; line-height: 1.45; }


.nutrition-analytics-area { min-height: calc(100vh - var(--topbar-height)); background: var(--workspace); }
.nutrition-report-toolbar { display: flex; justify-content: flex-end; padding: 10px 15px; border-bottom: 1px solid var(--line); background: #fff; }
.nutrition-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.nutrition-metric { display: grid; gap: 5px; min-height: 106px; padding: 18px 15px; border-right: 1px solid var(--line); background: #fff; }
.nutrition-metric:last-child { border-right: 0; }
.nutrition-metric span { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.nutrition-metric strong { color: #202020; font-size: 24px; line-height: 1; }
.nutrition-metric small { color: var(--muted); }
.nutrition-report-section { padding: 18px 15px 0; }
.nutrition-report-section > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 10px; }
.nutrition-report-section h2 { margin: 0 0 3px; font-size: 16px; }
.nutrition-report-section p { margin: 0; color: var(--muted); font-size: 12px; }
.nutrition-report-section .ledger-table-scroll { border: 1px solid var(--line); border-radius: 9px; }
.compact-empty-state { padding: 28px; text-align: center; color: var(--muted); }
.report-print-header { display: none; }

@media (max-width: 900px) {
  .inbody-parser-card { grid-template-columns: 1fr auto; }
  .inbody-parser-copy { grid-column: 1 / -1; }
  .nutrition-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nutrition-metric:nth-child(2) { border-right: 0; }
}

@media (max-width: 560px) {
  .inbody-parser-card { grid-template-columns: 1fr; }
  .inbody-parser-card .button { width: 100%; justify-content: center; }
  .inbody-parser-selection { align-items: flex-start; flex-direction: column; gap: 3px; }
  .inbody-parser-selection span { width: 100%; }
  .nutrition-metrics { grid-template-columns: 1fr; }
  .nutrition-metric { border-right: 0; }
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb {
  min-width: 40px;
  min-height: 40px;
  border: 2px solid var(--scrollbar-track);
  border-radius: 999px;
  background: var(--scrollbar-thumb);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

*::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}

html {
  min-height: 100%;
  max-width: 100%;
  overflow-x: clip;
  overscroll-behavior-x: none;
  color-scheme: light;
  background: var(--white);
  font-family: "Almarai", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--font-body);
}

body {
  width: 100%;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: clip;
  margin: 0;
  color: var(--ink);
  background: var(--white);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body.splash-active {
  overflow: hidden;
}

.app-splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--white);
  background: var(--black);
  opacity: 1;
  visibility: visible;
  transition: opacity 280ms ease, visibility 280ms ease;
}

.app-splash.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-splash-content {
  display: grid;
  width: min(300px, 74vw);
  place-items: center;
  gap: 26px;
  text-align: center;
  transform: translateY(0) scale(1);
  transition: transform 280ms ease;
}

.app-splash.is-leaving .app-splash-content {
  transform: translateY(-4px) scale(.985);
}

.app-splash-logo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.app-splash-loading {
  display: grid;
  place-items: center;
  gap: 11px;
  color: #b7b7b7;
  font-size: var(--font-footnote);
}

.app-splash .spinner {
  width: 25px;
  height: 25px;
  border-color: rgba(255, 255, 255, .22);
  border-top-color: var(--accent);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  outline: none;
}

:focus-visible {
  outline: 3px solid rgba(245, 76, 0, .26);
  outline-offset: 2px;
}

button {
  color: inherit;
}

.app-shell {
  max-width: 100%;
  overflow-x: clip;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  overflow: hidden;
  color: #f6f6f6;
  background: var(--black);
  transition: transform 220ms ease;
}

.sidebar-head {
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  padding-top: 25px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand-link {
  display: flex;
  width: 100%;
  max-width: 184px;
  align-items: center;
  justify-content: center;
}

.sidebar-logo {
  display: block;
  width: 100%;
  height: auto;
  max-height: 44px;
  object-fit: contain;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 18px 12px 28px;
  scrollbar-width: thin;
  scrollbar-color: #444 transparent;
}

.sidebar-nav::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-corner {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  border-color: var(--black);
  background: #444;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: #5a5a5a;
}

.nav-group {
  margin-bottom: 0;
}

.nav-standalone {
  margin-bottom: 14px;
}

.nav-group-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border: 0;
  padding: 11px 12px 9px;
  color: #9f9f9f;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
  cursor: pointer;
}

.nav-group-label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.nav-group-icon,
.nav-group-chevron {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
}

.nav-group-icon {
  color: #929292;
}

.nav-group-icon svg {
  width: 15px;
  height: 15px;
}

.nav-group-chevron svg {
  width: 14px;
  height: 14px;
  transition: transform var(--ease);
}

.nav-group.is-open .nav-group-chevron svg {
  transform: rotate(180deg);
}

.nav-group-toggle:hover,
.nav-group.is-open .nav-group-toggle {
  color: #c8c8c8;
}

.nav-group.is-open .nav-group-icon {
  color: #b4b4b4;
}

.nav-group-items {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--ease);
}

.nav-group-items > div {
  overflow: hidden;
}

.nav-group.is-open .nav-group-items {
  grid-template-rows: 1fr;
}

.nav-link {
  position: relative;
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  margin: 3px 0;
  padding: 10px 12px;
  border-radius: 8px;
  color: #ededed;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color var(--ease), background var(--ease);
}

.nav-group-items .nav-link {
  padding-left: 35px;
}

.nav-standalone .nav-link {
  padding-left: 12px;
}

.nav-link svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: #c7c7c7;
}

.nav-link:hover {
  background: #171717;
}

.nav-link.is-active {
  color: var(--accent);
  background: #1d1d1d;
  font-weight: 700;
}

.nav-link.is-active::before {
  position: absolute;
  inset: 8px auto 8px -12px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
  content: "";
}

.nav-link.is-active svg {
  color: var(--accent);
}

.workspace {
  min-width: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: clip;
  margin-left: var(--sidebar-width);
  background: var(--white);
  transition: margin-left 220ms ease;
}

body.sidebar-collapsed .sidebar {
  transform: translateX(-100%);
}

body.sidebar-collapsed .workspace {
  margin-left: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  height: var(--topbar-height);
  align-items: center;
  gap: 18px;
  padding: 0 15px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(12px);
}

.menu-button {
  display: inline-grid;
}

.breadcrumbs {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumbs strong {
  overflow: hidden;
  color: var(--ink);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumbs svg {
  width: 14px;
  color: #a2a2a2;
}

.topbar-account {
  position: relative;
  flex: 0 0 auto;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  padding: 5px 7px;
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background var(--ease);
}

.topbar-user:hover,
.topbar-user[aria-expanded="true"] {
  background: #f3f3f3;
}

.realtime-status {
  display: inline-flex;
  min-width: 84px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--white);
  font-size: 9px;
  font-weight: 700;
}

.realtime-status[hidden] {
  display: none;
}

.realtime-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #9a9a9a;
}

.realtime-status[data-state="live"] {
  border-color: #cce8d1;
  color: var(--success);
  background: var(--success-bg);
}

.realtime-status[data-state="live"] .realtime-dot {
  background: #24943d;
  box-shadow: 0 0 0 3px rgba(36, 148, 61, .12);
}

.realtime-status[data-state="connecting"] .realtime-dot,
.realtime-status[data-state="reconnecting"] .realtime-dot {
  background: var(--accent);
  animation: realtime-pulse 1.1s ease-in-out infinite;
}

@keyframes realtime-pulse {
  50% { opacity: .35; transform: scale(.8); }
}

.topbar-user-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
  text-align: left;
}

.topbar-user strong,
.account-menu-profile strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user small,
.account-menu-profile small {
  color: var(--muted);
  font-size: 10px;
}

.account-menu-chevron {
  display: inline-grid;
  width: 16px;
  place-items: center;
  color: var(--muted);
  transition: transform var(--ease);
}

.account-menu-chevron svg {
  width: 14px;
}

.topbar-user[aria-expanded="true"] .account-menu-chevron {
  transform: rotate(180deg);
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 55;
  width: min(280px, calc(100vw - 30px));
  border: 1px solid var(--line);
  padding: 7px;
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .16), 0 2px 7px rgba(0, 0, 0, .08);
  animation: account-menu-in 150ms ease both;
}

.account-menu[hidden] {
  display: none;
}

@keyframes account-menu-in {
  from { opacity: 0; transform: translateY(-5px) scale(.985); }
}

.account-menu-profile {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 9px;
}

.account-menu-profile > span:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.account-menu-divider {
  height: 1px;
  margin: 5px 0;
  background: var(--line);
}

.account-menu-item {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  border: 0;
  padding: 9px 10px;
  border-radius: 7px;
  color: #b3261e;
  background: transparent;
  font-size: var(--font-table);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--ease);
}

.account-menu-item:hover {
  background: #fff1ef;
}

.account-menu-item:disabled {
  cursor: wait;
  opacity: .6;
}

.account-menu-item svg {
  width: 18px;
  height: 18px;
}

.avatar {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--black);
  font-size: 11px;
  font-weight: 800;
}

.avatar-soft {
  color: #59200b;
  background: #ffe3d7;
}

.avatar-has-image {
  overflow: hidden;
  color: transparent;
  background: #ececec;
}

.avatar-has-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.main-content {
  display: flex;
  min-width: 0;
  width: 100%;
  min-height: calc(100vh - var(--topbar-height));
  overflow-x: clip;
  max-width: none;
  flex-direction: column;
  margin: 0 auto;
  padding: 0;
}

#resource-area {
  display: flex;
  min-width: 0;
  width: 100%;
  min-height: 0;
  max-width: 100%;
  overflow-x: clip;
  flex: 1;
  flex-direction: column;
  padding-bottom: 57px;
}

.page-loading {
  display: flex;
  min-height: 62vh;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.main-content.has-page-status,
#resource-area.has-page-status {
  height: calc(100vh - var(--topbar-height));
  min-height: 0;
  overflow: hidden;
}

#resource-area.has-page-status {
  padding-bottom: 0;
}

.page-status {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px 15px;
  color: var(--muted);
  text-align: center;
}

.page-status.page-loading {
  min-height: 0;
}

.page-status .spinner {
  width: 26px;
  height: 26px;
}

.page-status svg {
  width: 32px;
  height: 32px;
  color: #999;
}

.page-status strong {
  color: #333;
  font-size: var(--font-subheadline);
}

.page-status > span:last-child {
  max-width: 420px;
  font-size: var(--font-footnote);
}

.page-error-state .button {
  margin-top: 8px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e1e1e1;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .72s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  padding: 0 16px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--white);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease), color var(--ease), transform var(--ease), box-shadow var(--ease);
}

.button:hover {
  border-color: #a5a5a5;
  background: #fafafa;
}

.button:active {
  transform: translateY(1px);
}

.button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.button svg {
  width: 17px;
  height: 17px;
}

.button-primary {
  border-color: var(--accent);
  color: var(--white);
  background: var(--accent);
  box-shadow: 0 6px 18px rgba(245, 76, 0, .16);
}

.button-primary:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.button-danger {
  border-color: #ffd1d1;
  color: var(--danger);
  background: var(--danger-bg);
}

.button-full {
  width: 100%;
}

.button[hidden] {
  display: none;
}

.table-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 15px 15px 15px;
}

.table-search {
  width: min(560px, 100%);
  min-width: 0;
}

.search-control {
  position: relative;
}

.resource-search-button {
  position: absolute;
  top: 50%;
  right: 4px;
  display: inline-grid;
  width: 38px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  transform: translateY(-50%);
  color: var(--white);
  background: var(--accent);
  cursor: pointer;
  transition: background var(--ease), box-shadow var(--ease), transform var(--ease);
}

.resource-search-button:hover {
  background: var(--accent-dark);
}

.resource-search-button:active {
  transform: translateY(-50%) scale(.97);
}

.resource-search-button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(245, 76, 0, .2);
}

.resource-search-button svg {
  width: 18px;
  height: 18px;
}

.table-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 52px 10px 12px;
  color: var(--ink);
  background: var(--white);
  font-size: 13px;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.table-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 76, 0, .12);
  outline: 0;
}

.table-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.table-toolbar-actions .button.is-active {
  border-color: #ffc7ad;
  color: var(--accent-dark);
  background: #fff3ed;
}

.filter-count {
  display: inline-grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  border-radius: 999px;
  color: var(--white);
  background: var(--accent);
  font-size: 9px;
  font-weight: 800;
}

.control,
.field input,
.field select,
.field textarea,
.filter-row input {
  width: 100%;
  min-height: var(--control-height);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--white);
  font-size: 13px;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.field input,
.field select,
.field textarea,
.filter-row input {
  padding: 10px 12px;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field > input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.field > select {
  height: var(--control-height);
  min-height: var(--control-height);
  align-self: start;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.filter-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 76, 0, .12);
}

.select2-container {
  min-width: 0;
  max-width: 100%;
  color: var(--ink);
  font-family: "Almarai", system-ui, sans-serif;
  font-size: 13px;
}

select.select2-hidden-accessible + .select2-container {
  width: 100% !important;
}

.select2-container--default .select2-selection--single {
  height: var(--control-height);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--white);
  transition: border-color var(--ease), box-shadow var(--ease);
}

.select2-container--default .select2-selection--multiple {
  min-height: var(--control-height);
  padding: 3px 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--white);
}

.field .select2-container--default .select2-selection--multiple .select2-search__field {
  min-height: 28px;
  height: 28px;
  min-width: 155px;
  width: auto !important;
  margin: 0;
  padding: 4px 6px;
  border: 0;
  box-shadow: none;
  resize: none;
}

.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--multiple {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 76, 0, .12);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  padding-right: 40px;
  padding-left: 12px;
  color: var(--ink);
  line-height: calc(var(--control-height) - 2px);
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #777;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  top: 0;
  right: 8px;
  height: calc(var(--control-height) - 2px);
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 76, 0, .12);
}

.select2-container--default.select2-container--open .select2-selection--single {
  border-radius: var(--radius-sm);
}

.select2-dropdown {
  z-index: 115;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--white);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .14);
  font-family: "Almarai", system-ui, sans-serif;
  font-size: 12px;
}

.select2-search--dropdown {
  padding: 8px;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  padding: 8px 10px;
  border-radius: 6px;
  font: inherit;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 76, 0, .12);
  outline: 0;
}

.select2-results__option {
  padding: 9px 12px;
}

.select2-container--default .select2-results__option--selected {
  color: var(--ink);
  background: #fff1eb;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  color: var(--white);
  background: var(--accent);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

#resource-area.is-tree-resource {
  padding-bottom: 0;
}

.account-tree-frame {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border-top: 1px solid var(--line);
  background: var(--white);
  -webkit-overflow-scrolling: touch;
}

.account-tree {
  min-width: 980px;
  color: var(--ink);
  font-size: var(--font-table);
}

.account-tree-head,
.account-tree-row {
  display: grid;
  grid-template-columns: var(--tree-grid-columns, minmax(380px, 2fr) minmax(130px, .7fr) minmax(145px, .72fr) minmax(150px, .78fr) minmax(110px, .55fr) 108px);
  align-items: center;
}

.account-tree.no-actions .account-tree-head,
.account-tree.no-actions .account-tree-row {
  grid-template-columns: var(--tree-grid-columns, minmax(420px, 2fr) minmax(140px, .7fr) minmax(150px, .72fr) minmax(160px, .78fr) minmax(120px, .55fr));
}

.account-tree-head {
  position: relative;
  z-index: 12;
  min-height: 52px;
  color: #383838;
  background: #f1f1f1;
  font-size: var(--font-footnote);
  font-weight: 800;
  text-transform: uppercase;
  box-shadow: 0 1px 0 var(--line);
}

.sticky-account-tree-header {
  position: fixed;
  z-index: 24;
  visibility: hidden;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #f1f1f1;
  box-shadow: 0 7px 18px rgba(0, 0, 0, .06);
  opacity: 0;
  pointer-events: none;
}

.sticky-account-tree-header.is-visible {
  visibility: visible;
  opacity: 1;
}

.sticky-account-tree-header-scroll {
  overflow: hidden;
}

.sticky-account-tree-header .account-tree-head {
  position: static;
}

.account-tree-head > span {
  padding: 10px 15px;
}

.account-tree-head > span:last-child {
  text-align: center;
}

.account-tree-row {
  min-height: 52px;
  border-bottom: 1px solid #e8e8e8;
  background: var(--white);
  transition: background var(--ease);
}

.account-tree-row:hover {
  background: #fcfcfc;
}

.account-tree-row.is-group {
  font-weight: 700;
}

.account-tree-row[aria-level="1"] {
  background: #fafafa;
  box-shadow: inset 3px 0 0 transparent;
}

.account-tree-row[aria-level="1"]:hover,
.account-tree-row[aria-level="1"].is-expanded {
  background: #f7f7f7;
  box-shadow: inset 3px 0 0 var(--accent);
}

.account-tree-row.is-context .account-tree-name {
  color: #555;
}

.account-tree-account {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 7px 15px 7px var(--tree-indent, 15px);
}

.account-tree-toggle,
.account-tree-toggle-spacer {
  display: inline-grid;
  width: 26px;
  height: 30px;
  flex: 0 0 26px;
  place-items: center;
}

.account-tree-toggle {
  border: 0;
  border-radius: 6px;
  color: #555;
  background: transparent;
  cursor: pointer;
}

.account-tree-toggle:hover {
  color: var(--accent);
  background: #fff1eb;
}

.account-tree-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform var(--ease);
}

.account-tree-row.is-expanded > .account-tree-account .account-tree-toggle svg {
  transform: rotate(90deg);
}

.account-tree-kind {
  display: inline-grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  color: #545454;
}

.account-tree-row.is-group .account-tree-kind {
  color: var(--accent);
}

.account-tree-kind svg {
  width: 19px;
  height: 19px;
}

.item-group-tree-image-trigger {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 7px;
  cursor: zoom-in;
}

.item-group-tree-image {
  display: block;
  width: 28px;
  height: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
}

.item-group-tree-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-tree-code {
  min-width: 54px;
  flex: 0 0 auto;
  color: #3f3f3f;
  font-size: var(--font-footnote);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.account-tree-name {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-tree-value,
.account-tree-balance,
.account-tree-status,
.account-tree-actions {
  min-width: 0;
  padding: 7px 15px;
}

.account-tree-value {
  display: grid;
  gap: 2px;
}

.account-tree-value small,
.account-tree-balance small {
  color: var(--muted);
  font-size: var(--font-caption-small);
  font-weight: 500;
}

.account-tree-balance {
  color: #303030;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.account-tree-status {
  white-space: nowrap;
}

.account-tree-actions {
  border-left: 1px solid var(--line);
}

#resource-area.is-tree-resource.is-empty-resource .account-tree-frame.is-empty-tree {
  display: grid;
  min-width: 0;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  flex: 1 1 auto;
  place-items: center;
}

.account-tree-empty {
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 24px 15px;
  color: var(--muted);
  text-align: center;
}

.account-tree-empty svg {
  width: 30px;
  color: #999;
}

.account-tree-empty strong {
  color: #333;
  font-size: var(--font-subheadline);
}

.account-tree-empty span {
  max-width: 420px;
  font-size: var(--font-footnote);
}

.table-frame {
  position: relative;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: var(--white);
}

#resource-area.is-empty-resource {
  overflow: hidden;
}

#resource-area.is-empty-resource .table-frame.is-empty-table {
  display: grid;
  min-width: 0;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  flex: 1 1 auto;
  place-items: center;
}

.table-empty-state {
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 24px 15px;
  color: var(--muted);
  text-align: center;
}

.table-empty-state svg {
  width: 32px;
  height: 32px;
  color: #999;
}

.table-empty-state strong {
  color: #333;
  font-size: var(--font-subheadline);
}

.table-empty-state span {
  max-width: 420px;
  font-size: var(--font-footnote);
}

.sticky-table-header {
  position: fixed;
  z-index: 24;
  visibility: hidden;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 7px 18px rgba(0, 0, 0, .06);
  opacity: 0;
  pointer-events: none;
}

.sticky-table-header.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.sticky-table-header-scroll {
  overflow: hidden;
}

.sticky-table-header .data-table th {
  position: static;
}

.sticky-table-header .data-table {
  table-layout: fixed;
}

.sticky-table-header .data-table .actions-head {
  position: sticky;
}

.table-scroll,
.permission-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scrollbar-color: #b5b5b5 #efefef;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid #e8e8e8;
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  z-index: 3;
  height: 52px;
  padding: 10px 14px;
  color: #383838;
  background: #f1f1f1;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.data-table td {
  height: 47px;
  padding: 7px 20px;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: #fcfcfc;
}

.table-grid-row {
  pointer-events: none;
  user-select: none;
}

.data-table tbody .table-grid-row td,
.data-table tbody .table-grid-row:hover td,
.data-table tbody .table-grid-row:hover .actions-cell {
  height: var(--table-grid-row-height, 47px);
  color: transparent;
  background: var(--white);
}

.data-table .actions-cell,
.data-table .actions-head {
  position: sticky;
  right: 0;
  z-index: 5;
  width: 116px;
  min-width: 116px;
  border-left: 1px solid var(--line);
  text-align: center;
  background: var(--white);
  box-shadow: -7px 0 14px rgba(0, 0, 0, .035);
}

.data-table .actions-head {
  z-index: 8;
  background: #f1f1f1;
}

.data-table tbody tr:hover .actions-cell {
  background: #fcfcfc;
}

/* Meal Rates retain five priced records while showing every document choice on its own line. */
.data-table tbody tr.meal-rate-band-0 td,
.data-table tbody tr.meal-rate-band-0:hover td { background: #f5f5f5; }
.data-table tbody tr.meal-rate-band-1 td,
.data-table tbody tr.meal-rate-band-1:hover td { background: #eaf1fc; }
.data-table tbody tr.meal-rate-band td { vertical-align: middle; }
.data-table tbody tr.meal-rate-band .meal-rate-choices-cell { min-width: 230px; padding: 0; }
.meal-rate-choice-list { display: grid; }
.meal-rate-choice { display: flex; min-height: 43px; align-items: center; justify-content: center; padding: 8px 16px; border-bottom: 1px solid rgb(0 0 0 / 7%); font-size: 15px; font-weight: 700; text-align: center; }
.meal-rate-choice:last-child { border-bottom: 0; }

.sort-button {
  display: flex;
  width: calc(100% + 16px);
  min-height: 34px;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  border: 0;
  margin: -5px -8px;
  padding: 5px 15px;
  border-radius: 7px;
  color: inherit;
  background: transparent;
  font-size: inherit;
  font-weight: inherit;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--ease), background var(--ease);
}

.sort-button:hover {
  background: #f1f1f1;
}

.sort-button.is-active {
  color: var(--accent-dark);
}

.sort-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sort-indicator {
  display: inline-grid;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--accent);
}

.sort-indicator svg {
  width: 12px;
  height: 12px;
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.person-cell strong {
  font-size: 12px;
}

.cell-muted {
  display: inline-block;
  max-width: 250px;
  overflow: hidden;
  color: #535353;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #d5d5d5;
  padding: 5px 9px;
  border-radius: 6px;
  color: #525252;
  background: #f7f7f7;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}

.status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5e5e5e;
  content: "";
}

.status-active {
  border-color: #cce8d1;
  color: var(--success);
  background: var(--success-bg);
}

.status-active::before {
  background: #24943d;
}

.status-present,
.status-approved,
.status-paid {
  border-color: #cce8d1;
  color: var(--success);
  background: var(--success-bg);
}

.status-present::before,
.status-approved::before,
.status-paid::before {
  background: #24943d;
}

.status-pending,
.status-leave,
.status-half_day {
  border-color: #b9d7f4;
  color: #145b99;
  background: #edf6ff;
}

.status-pending::before,
.status-leave::before,
.status-half_day::before {
  background: #287fc5;
}

.status-absent,
.status-rejected {
  border-color: #efc7c7;
  color: #a32929;
  background: #fff0f0;
}

.status-absent::before,
.status-rejected::before {
  background: #c53c3c;
}

.status-draft {
  border-color: #d8d8d8;
  color: #555;
  background: #f5f5f5;
}

.status-submitted {
  border-color: #b9d7f4;
  color: #145b99;
  background: #edf6ff;
}

.status-submitted::before {
  background: #287fc5;
}

.status-cancelled {
  border-color: #efc7c7;
  color: #a32929;
  background: #fff0f0;
}

.status-cancelled::before {
  background: #c53c3c;
}

.money-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.money-cell small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.timestamp {
  border-bottom: 1px dotted #9a9a9a;
  color: #414141;
  cursor: help;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.icon-button,
.row-action {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: color var(--ease), background var(--ease);
}

.row-action {
  color: #666;
}

.row-action:hover {
  color: var(--accent);
  background: #fff1eb;
}

.row-action.is-danger:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

.row-action:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.row-action svg,
.icon-button svg {
  width: 17px;
  height: 17px;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.empty-state svg {
  width: 28px;
  color: #999;
}

.empty-state strong {
  color: #333;
  font-size: 13px;
}

.table-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: var(--sidebar-width);
  z-index: 20;
  display: flex;
  width: min(1580px, calc(100vw - var(--sidebar-width)));
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-inline: auto;
  padding: 10px 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .035);
  font-size: 11px;
  transform: none;
  backdrop-filter: blur(12px);
}

body.sidebar-collapsed .table-footer {
  left: 0;
  width: min(1580px, 100vw);
}

.table-footer-left {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 18px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.page-button {
  display: inline-grid;
  min-width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #333;
  background: var(--white);
  font-size: 11px;
  cursor: pointer;
}

.page-button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.page-button.is-current {
  border-color: var(--accent);
  color: var(--white);
  background: var(--accent);
}

.page-button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.page-button svg {
  width: 15px;
}

.page-limit {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-limit select {
  width: 74px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  background: var(--white);
  font-size: 11px;
}

.page-limit .select2-container {
  width: 74px !important;
  font-size: 11px;
}

.page-limit .select2-container--default .select2-selection--single {
  height: 36px;
  border-color: var(--line);
  border-radius: 6px;
}

.page-limit .select2-container--default .select2-selection--single .select2-selection__rendered {
  padding-right: 28px;
  padding-left: 9px;
  line-height: 34px;
}

.page-limit .select2-container--default .select2-selection--single .select2-selection__arrow {
  right: 3px;
  height: 34px;
}

#image-lightbox-root:empty {
  display: none;
}

.image-lightbox-trigger {
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
}

.image-lightbox-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.image-lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(0 0 0 / 92%);
  animation: fade-in 150ms ease both;
}

.image-lightbox-dialog {
  position: relative;
  display: grid;
  width: 80vw;
  height: 80vh;
  max-width: 1400px;
  max-height: 1000px;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 14px;
  background: #090909;
  box-shadow: 0 28px 80px rgb(0 0 0 / 55%);
}

.image-lightbox-dialog.is-shaking {
  animation: image-lightbox-shake 260ms ease both;
}

@keyframes image-lightbox-shake {
  25% { transform: translateX(-7px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
}

.image-lightbox-stage {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  overflow: hidden;
}

.image-lightbox-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 140ms ease;
}

.image-lightbox-stage.is-loaded .image-lightbox-image {
  opacity: 1;
}

.image-lightbox-loading,
.image-lightbox-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 24px;
  color: #d8d8d8;
  font-size: var(--font-footnote);
  text-align: center;
}

.image-lightbox-loading .spinner {
  border-color: rgb(255 255 255 / 30%);
  border-top-color: var(--accent);
}

.image-lightbox-stage.is-loaded .image-lightbox-loading,
.image-lightbox-stage.has-error .image-lightbox-loading,
.image-lightbox-error[hidden] {
  display: none;
}

.image-lightbox-caption {
  overflow: hidden;
  padding: 11px 56px 12px 15px;
  color: #f3f3f3;
  background: #151515;
  font-size: var(--font-footnote);
  font-weight: 700;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-lightbox-close {
  position: absolute;
  right: 12px;
  bottom: 7px;
  z-index: 2;
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--white);
  background: rgb(255 255 255 / 12%);
  cursor: pointer;
}

.image-lightbox-close:hover,
.image-lightbox-close:focus-visible {
  background: var(--accent);
  outline: 0;
}

.image-lightbox-close svg {
  width: 18px;
  height: 18px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  overflow-y: hidden;
  padding: 24px;
  background: rgb(0 0 0 / 76%);
  animation: fade-in 150ms ease both;
}

.modal {
  width: min(900px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border: 1px solid #d9d9d9;
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-modal);
  animation: modal-in 180ms ease both;
}

.modal > form {
  display: flex;
  max-height: inherit;
  min-height: 0;
  flex-direction: column;
  overflow: clip;
}

.modal-large {
  width: min(1120px, 100%);
}

.modal-xlarge {
  width: min(1360px, 100%);
}

.modal-record {
  width: min(var(--record-modal-width), 100%);
}

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(9px) scale(.986); }
}

.modal.modal-settled {
  animation: none;
}

.modal.modal-shake {
  animation: modal-shake 420ms cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes modal-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

.modal-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--accent-dark);
  color: var(--white);
  background: var(--accent);
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -.02em;
}

.modal-close {
  flex: 0 0 auto;
  color: var(--white);
}

.modal-close:hover {
  color: var(--white);
  background: rgba(255, 255, 255, .16);
}

.modal-body {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  max-height: none;
  overflow-y: auto;
  overflow-anchor: none;
  overscroll-behavior: contain;
  padding: 20px 22px;
}

.modal-body.is-loading {
  overflow: hidden;
}

.modal-body-loading {
  position: fixed;
  z-index: 30;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 28px;
  color: var(--ink);
  background: rgb(255 255 255 / 94%);
  text-align: center;
  outline: 0;
  backdrop-filter: blur(2px);
}

.modal-body-loading[hidden] {
  display: none;
}

.modal-body-loading .spinner {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

.modal-body-loading strong {
  font-size: var(--font-body);
  line-height: 1.35;
}

.modal-body-loading > span:last-child {
  max-width: 430px;
  color: var(--muted);
  font-size: var(--font-footnote);
  line-height: 1.6;
}

.modal-body.has-modal-tabs {
  padding-top: 0;
}

.modal-body.has-modal-tabs > .record-change-alert:not([hidden]) {
  margin-top: 14px;
}

.modal-tabs-sticky {
  position: sticky;
  top: 0;
  z-index: 14;
  margin: 0 -22px 18px;
  padding: 8px 22px 0;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 4px 12px rgb(0 0 0 / 3%);
}

.modal-tabs {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  overflow-x: auto;
  margin: 0;
  padding: 0;
  scrollbar-width: none;
}

.modal-tabs::-webkit-scrollbar {
  display: none;
}

.modal-tab {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: -1px;
  border: 1px solid transparent;
  border-radius: 9px 9px 0 0;
  padding: 9px 14px;
  color: #686868;
  background: transparent;
  font: inherit;
  font-size: var(--font-footnote);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--ease), background var(--ease), border-color var(--ease);
}

.modal-tab::after {
  position: absolute;
  top: -1px;
  right: 9px;
  left: 9px;
  height: 3px;
  border-radius: 0 0 999px 999px;
  background: transparent;
  content: "";
}

.modal-tab:hover {
  color: var(--ink);
  background: #f7f7f7;
}

.modal-tab.is-active {
  z-index: 1;
  color: var(--white);
  background: var(--accent);
  border-color: var(--accent);
  border-bottom-color: var(--accent);
}

.modal-tab.is-active::after {
  display: none;
}

.modal-tab:focus-visible {
  outline: 2px solid rgb(245 76 0 / 34%);
  outline-offset: 1px;
}

.modal-tab svg {
  width: 16px;
  height: 16px;
}

.modal-tab-count {
  display: inline-grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  color: #666;
  background: #dedede;
  font-size: var(--font-caption-small);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transition: color var(--ease), background var(--ease);
}

.modal-tab-count[hidden] {
  display: none;
}

.modal-tab.is-active .modal-tab-count {
  color: var(--accent-dark);
  background: var(--white);
}

.modal-tab-panel[hidden] {
  display: none;
}

.attachments-layout {
  display: grid;
  gap: 16px;
}

.attachment-uploader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 14px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafa;
}

.attachment-uploader-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.attachment-uploader-copy strong {
  color: var(--ink);
  font-size: var(--font-footnote);
}

.attachment-uploader-copy span {
  color: var(--muted);
  font-size: var(--font-caption);
}

.attachment-uploader .button svg {
  width: 16px;
  height: 16px;
}

.attachment-uploader .button.is-loading {
  opacity: .6;
  pointer-events: none;
}

.attachment-error-message {
  grid-column: 1 / -1;
  min-height: 0;
  color: var(--danger);
  font-size: var(--font-caption);
}

.attachment-error-message:empty {
  display: none;
}

.attachment-list {
  display: grid;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  list-style: none;
}

.attachment-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  min-width: 0;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
}

.attachment-item:not(:last-child) {
  border-bottom: 1px solid var(--line);
}

.attachment-file-icon {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 9px;
  color: var(--accent-dark);
  background: #fff1e9;
}

.attachment-file-icon svg {
  width: 18px;
  height: 18px;
}

.attachment-image-trigger {
  cursor: zoom-in;
  transition: color var(--ease), background var(--ease), transform var(--ease);
}

.attachment-image-trigger:hover {
  color: var(--white);
  background: var(--accent);
  transform: scale(1.04);
}

.attachment-content {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.attachment-name {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: var(--font-footnote);
  font-weight: 800;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.attachment-name-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.attachment-preview-name {
  min-width: 0;
  color: var(--ink);
  cursor: zoom-in;
  text-align: left;
}

.attachment-preview-name:hover {
  color: var(--accent-dark);
}

.attachment-inline-download {
  display: inline-grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
}

.attachment-inline-download:hover {
  color: var(--accent-dark);
  background: #fff1e9;
}

.attachment-inline-download svg {
  width: 14px;
  height: 14px;
}

.attachment-name:hover {
  color: var(--accent-dark);
}

.attachment-name svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.attachment-meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  color: var(--muted);
  font-size: var(--font-caption);
}

.attachment-meta > span:not(:last-child)::after {
  margin-left: 10px;
  color: #b3b3b3;
  content: "·";
}

.attachment-delete {
  color: var(--muted);
}

.attachments-read-only,
.attachments-limit-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--font-caption);
}

.attachments-empty,
.attachments-error,
.attachments-pending {
  display: grid;
  min-height: 190px;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.attachments-empty svg {
  width: 30px;
  height: 30px;
  color: #a5a5a5;
}

.attachments-empty strong,
.attachments-error strong {
  color: var(--ink);
  font-size: var(--font-subheadline);
}

.attachments-empty span,
.attachments-error span,
.attachments-pending span {
  font-size: var(--font-footnote);
}

.attachments-loading {
  min-height: 220px;
}

.comments-layout {
  display: grid;
  gap: 18px;
}

.comment-composer {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafa;
}

.comment-composer label {
  color: var(--ink);
  font-size: var(--font-footnote);
  font-weight: 800;
}

.comment-composer textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
  font-size: var(--font-callout);
  line-height: 1.55;
}

.comment-composer textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(245, 76, 0, .1);
}

.comment-composer-foot {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comment-error {
  flex: 1 1 auto;
  color: var(--danger);
  font-size: var(--font-caption);
}

.comment-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: var(--font-caption);
}

.comment-composer .button svg {
  width: 16px;
  height: 16px;
}

.comments-live-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #ffc591;
  border-radius: 7px;
  color: #7a2f00;
  background: #fff5ec;
  font-size: var(--font-caption);
}

.comments-live-notice[hidden] {
  display: none;
}

.comments-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.comment-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 11px;
  min-width: 0;
}

.comment-avatar .avatar {
  width: 40px;
  height: 40px;
  border: 3px solid var(--white);
  box-shadow: 0 0 0 1px var(--line);
}

.comment-content {
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.comment-content header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.comment-content header strong {
  color: var(--ink);
  font-size: var(--font-footnote);
}

.comment-content header span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: var(--font-caption);
}

.comment-content p {
  margin: 0;
  color: #3f3f3f;
  font-size: var(--font-table);
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.comments-read-only,
.comments-limit-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--font-caption);
}

.comments-empty,
.comments-error,
.comments-pending {
  display: grid;
  min-height: 190px;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.comments-empty svg {
  width: 30px;
  height: 30px;
  color: #a5a5a5;
}

.comments-empty strong,
.comments-error strong {
  color: var(--ink);
  font-size: var(--font-subheadline);
}

.comments-empty span,
.comments-error span,
.comments-pending span {
  font-size: var(--font-footnote);
}

.comments-loading {
  min-height: 220px;
}

.history-loading {
  min-height: 220px;
}

.history-timeline {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-item {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 0 0 22px;
}

.history-item:not(:last-child)::before {
  position: absolute;
  top: 38px;
  bottom: 0;
  left: 19px;
  width: 1px;
  background: var(--line);
  content: "";
}

.history-item-avatar {
  position: relative;
  z-index: 1;
}

.history-item-avatar .avatar {
  width: 40px;
  height: 40px;
  border: 3px solid var(--white);
  box-shadow: 0 0 0 1px var(--line);
}

.history-item-content {
  min-width: 0;
  padding: 3px 0 0;
}

.history-event-title {
  margin: 0;
  color: #3f3f3f;
  font-size: var(--font-table);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.history-actor,
.history-field {
  color: var(--ink);
  font-weight: 800;
}

.history-value {
  display: inline;
  color: var(--accent-dark);
  font-weight: 700;
}

.history-value.is-empty {
  color: var(--muted);
  font-style: italic;
  font-weight: 500;
}

.history-changes {
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.history-changes h4 {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: #f7f7f7;
  font-size: var(--font-footnote);
}

.history-change-head,
.history-change-row {
  display: grid;
  grid-template-columns: minmax(120px, .75fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
}

.history-change-head {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: #fcfcfc;
  font-size: var(--font-caption-small);
  font-weight: 800;
  text-transform: uppercase;
}

.history-change-head span,
.history-change-row > * {
  min-width: 0;
  padding: 8px 10px;
}

.history-change-head span:not(:last-child),
.history-change-row > *:not(:last-child) {
  border-right: 1px solid var(--line);
}

.history-change-row:not(:last-child) {
  border-bottom: 1px solid var(--line);
}

.history-change-row > .history-field {
  color: #383838;
  background: #fafafa;
  font-size: var(--font-footnote);
}

.history-change-value {
  color: var(--muted);
  font-size: var(--font-footnote);
  overflow-wrap: anywhere;
}

.history-change-value.is-new {
  background: #fff8f4;
}

.history-change-value small {
  display: none;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: var(--font-caption-small);
  font-weight: 800;
  text-transform: uppercase;
}

.history-legacy {
  display: grid;
  gap: 3px;
  margin-top: 9px;
  padding: 10px 11px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: #fafafa;
  font-size: var(--font-caption);
  line-height: 1.45;
}

.history-legacy strong {
  color: #484848;
  font-size: var(--font-footnote);
}

.history-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: var(--font-caption);
}

.history-limit-note {
  margin: 4px 0 0 52px;
  color: var(--muted);
  font-size: var(--font-caption);
}

.history-empty,
.history-error,
.history-pending {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.history-empty svg {
  width: 30px;
  height: 30px;
  color: #a5a5a5;
}

.history-empty strong,
.history-error strong {
  color: var(--ink);
  font-size: var(--font-subheadline);
}

.history-empty span,
.history-error span,
.history-pending span {
  font-size: var(--font-footnote);
}

.modal-record-loading {
  min-height: 180px;
}

.record-change-alert {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 15px;
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 10px;
  line-height: 1.5;
}

.record-presence[hidden],
.record-change-alert[hidden] {
  display: none;
}

.record-presence {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  margin-right: auto;
}

.record-presence-viewers {
  display: flex;
  min-width: 0;
  align-items: center;
  padding-left: 7px;
}

.record-viewer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: -7px;
  border-radius: 50%;
  cursor: default;
}

.record-viewer .avatar {
  width: 32px;
  height: 32px;
  border: 2px solid #fbfbfb;
  box-shadow: 0 0 0 1px #d2d2d2;
  font-size: 10px;
}

.record-viewer-overflow {
  display: inline-grid;
  min-width: 32px;
  height: 32px;
  place-items: center;
  margin-left: -7px;
  border: 2px solid #fbfbfb;
  border-radius: 999px;
  color: #4c4c4c;
  background: #e8e8e8;
  box-shadow: 0 0 0 1px #d2d2d2;
  font-size: var(--font-caption);
  font-weight: 800;
  cursor: default;
}

.record-change-alert {
  justify-content: space-between;
  border: 1px solid #ffc591;
  color: #7a2f00;
  background: #fff5ec;
}

.record-change-alert button {
  flex: 0 0 auto;
  border: 0;
  padding: 5px 7px;
  color: var(--accent-dark);
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.modal-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 15px 22px;
  border-top: 1px solid var(--line);
  background: #fbfbfb;
}

.modal-action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

.button.button-renew { border-color: #2563eb; color: #fff; background: #2563eb; }
.button.button-renew:hover { border-color: #1d4ed8; background: #1d4ed8; }
@media (max-width: 600px) {
  .modal-actions:has(.button-renew) .modal-action-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; margin-left: 0; }
  .modal-actions:has(.button-renew) .modal-action-buttons [data-modal-close] { grid-column: 1 / -1; }
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.field .read-only-value {
  display: flex;
  align-items: center;
  min-height: var(--control-height);
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #f8f8f8;
  color: var(--ink);
  font-size: 13px;
}

.medical-fields {
  margin-top: 18px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.medical-fields-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.medical-fields [data-medical-attribute-list],
.medical-fields [data-medical-result-list] {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.medical-fields [data-medical-result-list] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.medical-attribute-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.3fr) minmax(100px, .75fr) minmax(75px, .5fr) minmax(150px, 1.7fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.medical-attribute-row > input,
.medical-attribute-row > select {
  width: 100%;
  min-width: 0;
  height: var(--control-height);
}

@media (max-width: 760px) {
  .medical-fields [data-medical-result-list] { grid-template-columns: 1fr; }
  .medical-attribute-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .medical-attribute-row [data-attribute-reference] { grid-column: 1 / 3; }
}

.field {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 7px;
}

.field[hidden] {
  display: none;
}

.field-full {
  grid-column: 1 / -1;
}

.field-span-2 {
  grid-column: span 2;
}

.payment-type-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.payment-type-field legend {
  margin-bottom: 7px;
}

.payment-type-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.payment-type-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.payment-type-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.payment-type-option > span {
  display: grid;
  min-height: 64px;
  align-content: center;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
}

.payment-type-option strong {
  font-size: var(--font-action);
}

.payment-type-option small {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--font-caption);
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-type-option input:checked + span {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: #fff5f0;
  box-shadow: 0 0 0 1px var(--accent);
}

.payment-type-option input:focus-visible + span {
  outline: 3px solid rgb(245 76 0 / 22%);
  outline-offset: 2px;
}

.payment-type-field:disabled .payment-type-option {
  cursor: default;
}

.payment-type-field:disabled .payment-type-option > span {
  opacity: .78;
}

.payment-journal-link {
  display: flex;
  min-width: 0;
  min-height: 45px;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--accent-dark);
  background: #fff;
  font-size: var(--font-action);
  font-weight: 800;
  text-decoration: none;
}

.payment-journal-link:hover {
  border-color: var(--accent);
  background: #fff8f5;
}

.payment-journal-link.is-readonly {
  color: var(--text);
  background: #f8f8f8;
  font-weight: 700;
}

.payment-journal-link svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.journal-lines-field {
  gap: 9px;
}

.journal-lines-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.journal-lines-heading > div {
  display: grid;
  gap: 3px;
}

.journal-lines-heading strong {
  font-size: var(--font-subheadline);
}

.journal-lines-heading span {
  color: var(--muted);
  font-size: var(--font-caption);
}

.journal-lines-actions {
  display: flex;
  justify-content: flex-end;
}

.journal-lines-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  overscroll-behavior-inline: contain;
}

.journal-lines-table {
  width: 100%;
  min-width: 1430px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: var(--font-table);
}

.journal-lines-table th,
.journal-lines-table td {
  height: 47px;
  padding: 6px 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.journal-lines-table th:last-child,
.journal-lines-table td:last-child {
  border-right: 0;
}

.journal-lines-table thead th {
  color: #383838;
  background: #f1f1f1;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.journal-lines-table th:nth-child(1),
.journal-lines-table td:nth-child(1) {
  width: 44px;
  text-align: center;
}

.journal-lines-table th:nth-child(2),
.journal-lines-table td:nth-child(2) {
  width: 220px;
}

.journal-lines-table th:nth-child(3),
.journal-lines-table td:nth-child(3) {
  width: 155px;
}

.journal-lines-table th:nth-child(4),
.journal-lines-table td:nth-child(4) {
  width: 220px;
}

.journal-lines-table th:nth-child(5),
.journal-lines-table td:nth-child(5) {
  width: 190px;
}

.journal-lines-table th:nth-child(6),
.journal-lines-table td:nth-child(6) {
  width: 205px;
}

.journal-lines-table th:nth-child(7),
.journal-lines-table td:nth-child(7),
.journal-lines-table th:nth-child(8),
.journal-lines-table td:nth-child(8) {
  width: 130px;
}

.journal-lines-table th:nth-child(9),
.journal-lines-table td:nth-child(9) {
  width: 45px;
  text-align: center;
}

.journal-lines-table input,
.journal-lines-table .select2-container .select2-selection--single {
  min-height: 35px;
  height: 35px;
  font-size: var(--font-table);
}

.journal-lines-table input {
  width: 100%;
  padding: 6px 8px;
}

.journal-lines-table .select2-container .select2-selection--single .select2-selection__rendered {
  line-height: 33px;
}

.journal-lines-table tfoot th,
.journal-lines-table tfoot td {
  border-bottom: 0;
  background: #fafafa;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.journal-lines-table tfoot th {
  text-align: right;
}

.stock-entry-lines-table {
  min-width: 1080px;
}

.stock-entry-lines-table th:nth-child(2),
.stock-entry-lines-table td:nth-child(2) {
  width: 125px;
}

.stock-entry-lines-table th:nth-child(3),
.stock-entry-lines-table td:nth-child(3) {
  width: 285px;
}

.stock-entry-lines-table th:nth-child(4),
.stock-entry-lines-table td:nth-child(4) {
  width: 90px;
}

.stock-entry-lines-table th:nth-child(5),
.stock-entry-lines-table td:nth-child(5),
.stock-entry-lines-table th:nth-child(6),
.stock-entry-lines-table td:nth-child(6),
.stock-entry-lines-table th:nth-child(7),
.stock-entry-lines-table td:nth-child(7) {
  width: 145px;
}

.stock-entry-lines-table th:nth-child(8),
.stock-entry-lines-table td:nth-child(8) {
  width: 45px;
  text-align: center;
}

.stock-entry-uom {
  color: var(--muted);
  font-size: var(--font-footnote);
  font-weight: 700;
  white-space: nowrap;
}

.item-sizes-table {
  min-width: 1140px;
}

.item-sizes-table th:nth-child(2),
.item-sizes-table td:nth-child(2),
.item-sizes-table th:nth-child(3),
.item-sizes-table td:nth-child(3) {
  width: 120px;
}

.item-sizes-table th:nth-child(n+4):nth-child(-n+7),
.item-sizes-table td:nth-child(n+4):nth-child(-n+7) {
  width: 105px;
}

.item-sizes-table th:nth-child(8),
.item-sizes-table td:nth-child(8) {
  width: 145px;
}

.item-sizes-table th:nth-child(9),
.item-sizes-table td:nth-child(9) {
  width: 125px;
}

.item-sizes-table th:nth-child(10),
.item-sizes-table td:nth-child(10) {
  width: 50px;
  text-align: center;
}

.sales-invoice-lines-table {
  min-width: 1160px;
}

.sales-invoice-lines-table th:nth-child(2),
.sales-invoice-lines-table td:nth-child(2) {
  width: 245px;
}

.sales-invoice-lines-table th:nth-child(3),
.sales-invoice-lines-table td:nth-child(3) {
  width: 220px;
}

.sales-invoice-lines-table th:nth-child(4),
.sales-invoice-lines-table td:nth-child(4) {
  width: 90px;
}

.sales-invoice-lines-table th:nth-child(5),
.sales-invoice-lines-table td:nth-child(5),
.sales-invoice-lines-table th:nth-child(6),
.sales-invoice-lines-table td:nth-child(6) {
  width: 125px;
}

.sales-invoice-lines-table th:nth-child(7),
.sales-invoice-lines-table td:nth-child(7) {
  width: 145px;
}

.sales-invoice-lines-table th:nth-child(8),
.sales-invoice-lines-table td:nth-child(8) {
  width: 54px;
}

.sales-invoice-lines-table [data-sales-uom],
.sales-invoice-lines-table [data-purchase-uom] {
  color: var(--muted);
  white-space: nowrap;
}

.sales-invoice-totals {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: min(100%, 390px);
  margin: 12px 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafa;
}

.sales-invoice-totals > * {
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
}

.invoice-adjustment-lines {
  display: contents;
}

.invoice-adjustment-lines > * {
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
}

.invoice-adjustment-lines span small {
  margin-left: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.invoice-adjustment-lines strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.sales-invoice-totals > :nth-last-child(-n + 2) {
  border-bottom: 0;
  color: var(--accent);
  font-weight: 800;
}

.sales-invoice-totals strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tax-profile-lines-table {
  min-width: 1540px;
}

.tax-profile-lines-table th:nth-child(2),
.tax-profile-lines-table td:nth-child(2) {
  width: 190px;
}

.tax-profile-lines-table th:nth-child(3),
.tax-profile-lines-table td:nth-child(3),
.tax-profile-lines-table th:nth-child(4),
.tax-profile-lines-table td:nth-child(4),
.tax-profile-lines-table th:nth-child(6),
.tax-profile-lines-table td:nth-child(6) {
  width: 150px;
}

.tax-profile-lines-table th:nth-child(5),
.tax-profile-lines-table td:nth-child(5) {
  width: 145px;
}

.tax-profile-lines-table th:nth-child(7),
.tax-profile-lines-table td:nth-child(7),
.tax-profile-lines-table th:nth-child(8),
.tax-profile-lines-table td:nth-child(8) {
  width: 280px;
}

.tax-profile-lines-table th:nth-child(9),
.tax-profile-lines-table td:nth-child(9) {
  width: 54px;
}

.journal-line-number {
  color: var(--muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.journal-money-input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bundle-components-table {
  min-width: 760px;
}

.bundle-components-table th:nth-child(2),
.bundle-components-table td:nth-child(2) {
  width: 300px;
}

.bundle-components-table th:nth-child(3),
.bundle-components-table td:nth-child(3) {
  width: 130px;
}

.bundle-components-table th:nth-child(4),
.bundle-components-table td:nth-child(4) {
  width: 110px;
}

.bundle-components-table th:nth-child(5),
.bundle-components-table td:nth-child(5) {
  width: 155px;
}

.bundle-components-table th:nth-child(6),
.bundle-components-table td:nth-child(6) {
  width: 45px;
  text-align: center;
}

.item-ingredients-table {
  min-width: 1050px;
}

.item-ingredients-table th:nth-child(2),
.item-ingredients-table td:nth-child(2) {
  width: 390px;
}

.item-ingredients-table th:nth-child(3),
.item-ingredients-table td:nth-child(3) {
  width: 220px;
}

.item-ingredients-table th:nth-child(4),
.item-ingredients-table td:nth-child(4) {
  width: 120px;
  text-align: center;
}

.item-ingredients-table th:nth-child(5),
.item-ingredients-table td:nth-child(5) { width: 150px; }
.item-ingredients-table th:nth-child(6),
.item-ingredients-table td:nth-child(6) { width: 110px; }
.item-ingredients-table th:nth-child(7),
.item-ingredients-table td:nth-child(7) {
  width: 54px;
  text-align: center;
}

.item-ingredients-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  accent-color: var(--accent);
}

.item-side-order-groups {
  display: grid;
  gap: 14px;
}

.item-side-order-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.item-side-order-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
}

.item-side-order-group-head .field {
  margin: 0;
}

.item-side-order-allow-none {
  display: inline-flex;
  min-height: 45px;
  align-items: center;
  gap: 7px;
  padding: 0 4px;
  color: var(--ink);
  font-size: var(--font-action);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.item-side-order-allow-none input {
  flex: 0 0 auto;
  margin: 0;
}

.item-side-order-group .journal-lines-bottom-action {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.item-side-order-add-group {
  padding-top: 12px;
}

.item-side-orders-table {
  min-width: 1120px;
}

.item-side-orders-table th:nth-child(2),
.item-side-orders-table td:nth-child(2) {
  width: 140px;
}

.item-side-orders-table th:nth-child(3),
.item-side-orders-table td:nth-child(3) {
  width: 330px;
}

.item-side-orders-table th:nth-child(4),
.item-side-orders-table td:nth-child(4) {
  width: 220px;
}

.item-side-orders-table th:nth-child(5),
.item-side-orders-table td:nth-child(5) {
  width: 180px;
}

.item-side-orders-table th:nth-child(6),
.item-side-orders-table td:nth-child(6) { width: 155px; }
.item-side-orders-table th:nth-child(7),
.item-side-orders-table td:nth-child(7) {
  width: 54px;
  text-align: center;
}

.journal-lines-bottom-action {
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
}

.customer-addresses {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.modal-tab-panel > .customer-addresses {
  margin-top: 0;
}

.customer-address-list {
  display: grid;
  gap: 12px;
}

.customer-address-card {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
}

.customer-address-card > header {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px 6px 14px;
  border-bottom: 1px solid var(--line);
  background: #f7f7f7;
}

.customer-address-card > header > div,
.address-default {
  display: flex;
  align-items: center;
  gap: 8px;
}

.address-default {
  color: var(--muted);
  font-size: var(--font-caption);
  font-weight: 700;
}

.customer-address-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.customer-allergies {
  display: grid;
  gap: 12px;
}

.customer-clinical-choices { display: grid; gap: 12px; }
.customer-clinical-choices > .field-hint { margin: 0; }
.customer-ingredient-links { border-top: 1px solid var(--line); padding-top: 10px; }
.customer-ingredient-links > summary { width: fit-content; color: var(--ink); font-weight: 700; cursor: pointer; }
.customer-ingredient-links[open] > summary { margin-bottom: 12px; }

.customer-allergy-list {
  display: grid;
  gap: 8px;
}

.customer-allergy-row {
  display: grid;
  grid-template-columns: 28px minmax(240px, 1.25fr) minmax(220px, 1fr) 34px;
  align-items: end;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
}
.customer-allergy-row.has-severity { grid-template-columns: 28px minmax(220px, 1.1fr) minmax(265px, 1.2fr) minmax(180px, 1fr) 34px; }
.customer-allergy-severity { min-width: 0; margin: 0; padding: 0 0 4px; border: 0; }
.customer-allergy-severity legend { margin-bottom: 7px; padding: 0; color: var(--ink); font-size: var(--font-caption); font-weight: 700; }
.customer-allergy-severity > div { display: flex; flex-wrap: wrap; gap: 5px 10px; min-height: var(--control-height); align-items: center; }

.customer-clinical-examination-row {
  grid-template-columns: 28px minmax(200px, 1.2fr) minmax(140px, .8fr) minmax(190px, 1fr) 34px;
}

.customer-allergy-index {
  display: grid;
  width: 26px;
  height: var(--control-height);
  place-items: center;
  color: var(--muted);
  font-size: var(--font-caption);
  font-weight: 800;
}

.customer-allergy-row .row-action {
  margin-bottom: 5px;
}

.address-default-modal > span:last-child {
  display: flex;
  min-height: var(--control-height);
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  font-size: var(--font-action);
}

.item-table-image {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.item-table-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-table-image.is-empty {
  background: #f6f6f6;
}

.journal-balance-summary {
  justify-self: end;
  padding: 5px 9px;
  border-radius: 7px;
  color: #8a2d1f;
  background: #fff0ed;
  font-size: var(--font-caption);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.journal-balance-summary.is-balanced {
  color: var(--success);
  background: var(--success-bg);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.pos-receipt-print-frame {
  position: fixed;
  top: 0;
  left: -10000px;
  width: 80mm;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.user-image-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
  align-items: center;
  gap: 7px;
  height: 45px;
  min-height: 45px;
  padding: 3px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: white;
  transition: none;
  margin-top: -8px;
}

.user-image-card.is-dragging {
  border-color: var(--accent);
  background: #fff1e9;
  box-shadow: 0 0 0 3px rgba(245, 76, 0, .1);
}

.user-image-preview-wrap {
  position: relative;
  flex: 0 0 auto;
}

.user-image-preview {
  display: flex;
}

.user-image-lightbox-trigger {
  display: inline-flex;
  border-radius: 50%;
  cursor: zoom-in;
}

.user-image-preview .avatar {
  width: 34px;
  height: 34px;
  border: 1px solid var(--white);
  font-size: 10px;
  box-shadow: 0 2px 9px rgba(0, 0, 0, .09);
}

.item-group-image-placeholder,
.item-group-image-preview {
  display: inline-grid;
  width: 34px;
  height: 34px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  background: #fff4ee;
  box-shadow: 0 2px 9px rgba(0, 0, 0, .07);
}

.item-group-image-placeholder svg {
  width: 18px;
  height: 18px;
}

.item-group-image-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-group-image-field .user-image-lightbox-trigger {
  border-radius: 8px;
}

.user-image-remove {
  position: absolute;
  right: 1px;
  bottom: 1px;
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 50%;
  color: var(--white);
  background: rgba(27, 27, 27, .78);
  cursor: pointer;
  transition: background var(--ease), transform var(--ease);
}

.user-image-remove svg {
  width: 8px;
  height: 8px;
}

.user-image-remove[hidden] {
  display: none;
}

.user-image-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "meta actions"
    "error error";
  min-width: 0;
  align-items: center;
  gap: 2px 10px;
}

.user-image-meta {
  display: block;
  grid-area: meta;
  min-width: 0;
}

.user-image-meta > span {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--font-caption);
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-image-actions {
  display: flex;
  grid-area: actions;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.field .image-upload-button {
  display: inline-grid;
  width: 25px;
  min-height: 25px;
  padding: 3px;
  place-items: center;
  color: var(--accent-dark);
  background: var(--white);
  cursor: pointer;
}

.field .image-upload-button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.user-image-remove:hover {
  background: var(--danger);
  transform: scale(1.06);
}

.user-image-content > .field-error {
  grid-area: error;
}

.field label {
  color: #303030;
  font-size: 11px;
  font-weight: 700;
}

.field-hint {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.field-error {
  color: var(--danger);
  font-size: 10px;
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea,
.input-error {
  border-color: var(--danger) !important;
  background-color: #fff7f7;
  box-shadow: 0 0 0 1px rgb(199 49 49 / 16%);
}

.field.has-error .select2-container--default .select2-selection--single {
  border-color: var(--danger) !important;
  background-color: #fff7f7;
  box-shadow: 0 0 0 1px rgb(199 49 49 / 16%);
}

.column-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.column-selector label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  padding: 11px 12px;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
}

.column-selector label:hover {
  border-color: #ffc7ad;
  background: #fff8f4;
}

.column-selector label > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.column-selector strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.column-selector small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-builder-head,
.filter-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.05fr) minmax(185px, 1fr) minmax(220px, 1.25fr) 36px;
  gap: 10px;
  align-items: center;
}

.filter-builder-head {
  padding: 0 2px 7px;
  color: #555;
  font-size: 10px;
  font-weight: 800;
}

#filter-builder {
  display: grid;
  gap: 9px;
}

.filter-row {
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 9px;
  background: #fcfcfc;
}

.filter-value-wrap {
  min-width: 0;
}

.filter-no-value {
  display: flex;
  min-height: 42px;
  align-items: center;
  border: 1px dashed #d7d7d7;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: #f8f8f8;
  font-size: 10px;
}

.filter-remove {
  color: #777;
}

.filter-remove:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

.filter-builder-empty {
  border: 1px dashed #d7d7d7;
  padding: 28px 16px;
  border-radius: 9px;
  color: var(--muted);
  background: #fafafa;
  font-size: 11px;
  text-align: center;
}

.filter-builder-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.button-compact {
  min-height: 36px;
  padding: 8px 11px;
  font-size: 10px;
}

.text-button {
  border: 0;
  padding: 7px 3px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.text-button:hover {
  color: var(--accent-dark);
}

.permission-section {
  margin-top: 22px;
}

.permission-section h3 {
  margin: 0 0 5px;
  font-size: 13px;
}

.permission-section > p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.permission-scroll {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.permission-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 11px;
}

.permission-table th,
.permission-table td {
  height: 47px;
  border-bottom: 1px solid #ebebeb;
  padding: 8px 10px;
  text-align: center;
}

.permission-table th {
  background: #fafafa;
  font-weight: 800;
}

.permission-table th:first-child,
.permission-table td:first-child {
  min-width: 220px;
  text-align: left;
}

.permission-table tr:last-child td {
  border-bottom: 0;
}

.permission-page {
  display: grid;
  gap: 3px;
}

.permission-page strong {
  font-size: 11px;
}

.permission-page small {
  color: var(--muted);
  font-size: 9px;
}

.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 150;
  display: grid;
  width: min(360px, calc(100vw - 44px));
  gap: 9px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #323232;
  padding: 13px 14px;
  border-radius: 9px;
  color: var(--white);
  background: #151515;
  box-shadow: 0 14px 35px rgba(0, 0, 0, .2);
  font-size: 11px;
  line-height: 1.5;
  animation: toast-in 180ms ease both;
}

.toast svg {
  width: 17px;
  flex: 0 0 auto;
  color: var(--accent);
}

.toast-error {
  border-color: #8d2d2d;
  background: #351313;
}

.toast-error svg {
  color: #ff7066;
}

.toast-content {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.toast-content strong {
  font-size: var(--font-footnote);
  line-height: 1.4;
}

.toast-error-list {
  display: grid;
  gap: 3px;
  margin: 0;
  padding-left: 17px;
}

.toast-error-list li,
.toast-content small {
  color: #f3cece;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

#resource-area.general-ledger-area,
#resource-area.stock-ledger-area,
#resource-area.trial-balance-area {
  min-height: calc(100vh - var(--topbar-height));
  padding-bottom: 0;
  overflow-x: clip;
  background: var(--white);
}

.general-ledger-filters {
  --report-filter-surface: general-ledger;
}

.stock-ledger-filters {
  --report-filter-surface: stock-ledger;
}

.trial-balance-filters {
  --report-filter-surface: trial-balance;
}

.general-ledger-filters,
.stock-ledger-filters,
.trial-balance-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  padding: 15px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.ledger-filter-field {
  display: grid;
  min-width: 0;
}

.ledger-filter-field input,
.ledger-filter-field select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--white);
  font: inherit;
  font-size: var(--font-subheadline);
}

.ledger-filter-field input:focus,
.ledger-filter-field select:focus {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(245, 76, 0, .12);
}

.ledger-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ledger-filter-actions .spinner {
  width: 16px;
  height: 16px;
  border-color: rgba(255, 255, 255, .36);
  border-top-color: var(--white);
}

.trial-balance-zero-toggle {
  display: flex;
  grid-column: span 2;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  color: #383838;
  font-size: var(--font-subheadline);
  font-weight: 700;
  cursor: pointer;
}

.trial-balance-zero-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.trial-balance-filters .ledger-filter-actions {
  grid-column: span 2;
  justify-content: flex-end;
}

.ledger-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: var(--line);
  gap: 1px;
}

.ledger-summary-card {
  display: grid;
  min-width: 0;
  min-height: 88px;
  align-content: center;
  gap: 7px;
  padding: 14px 15px;
  background: var(--white);
}

.ledger-summary-card > span {
  color: var(--muted);
  font-size: var(--font-footnote);
  font-weight: 700;
}

.ledger-summary-card strong {
  min-width: 0;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.025em;
}

.ledger-summary-card.is-debit strong {
  color: #155f9b;
}

.ledger-summary-card.is-credit strong {
  color: #8e3a18;
}

.trial-balance-summary-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.trial-balance-summary-grid .ledger-summary-card {
  min-height: 82px;
}

.trial-balance-summary-grid .ledger-summary-card strong {
  font-size: 18px;
}

.ledger-report-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: #fafafa;
  font-size: var(--font-footnote);
}

.ledger-report-context strong {
  flex: 0 0 auto;
  color: #383838;
}

.trial-balance-context > div {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
}

.trial-balance-status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: var(--font-caption);
  font-weight: 800;
  white-space: nowrap;
}

.trial-balance-status.is-balanced {
  border-color: #b8dfc4;
  color: #167234;
  background: #eef9f1;
}

.trial-balance-status.is-different {
  border-color: #f1c6b5;
  color: #9b3412;
  background: #fff3ee;
}

.ledger-report-warning {
  padding: 10px 15px;
  border-bottom: 1px solid #efd2a6;
  color: #7b4a00;
  background: #fff8e9;
  font-size: var(--font-footnote);
}

.ledger-report-body {
  display: grid;
  min-width: 0;
  gap: 15px;
  padding: 15px;
  background: #f7f7f7;
}

.general-ledger-area.is-empty-ledger .ledger-report-body,
.stock-ledger-area.is-empty-ledger .ledger-report-body {
  display: flex;
  min-height: 310px;
  flex: 1 1 auto;
  padding: 0;
  background: var(--white);
}

.trial-balance-report-body {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  background: var(--white);
}

.trial-balance-area.is-empty-trial-balance .trial-balance-report-body {
  min-height: 310px;
}

.trial-balance-table-scroll {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.trial-balance-table {
  min-width: 1080px;
}

.trial-balance-table thead tr:first-child th {
  border-bottom-color: var(--line-strong);
}

.trial-balance-table th.is-group-heading {
  text-align: center;
}

.trial-balance-table tbody td:first-child {
  min-width: 270px;
}

.trial-balance-account {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding-left: calc(var(--trial-balance-depth, 0) * 10px);
}

.trial-balance-account > span {
  color: var(--muted);
  font-size: var(--font-caption);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.trial-balance-account > strong {
  overflow: hidden;
  font-size: var(--font-table);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trial-balance-account > small,
.trial-balance-type {
  color: var(--muted);
  font-size: var(--font-caption);
}

/* Income statement shares the responsive report surface and print lifecycle. */
.profit-loss-summary-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ledger-table.profit-loss-table { min-width: 650px; table-layout: fixed; }
.profit-loss-table thead th:nth-child(2) { width: 62px; }
.profit-loss-table thead th:nth-child(n+3) { width: 155px; }
.profit-loss-table caption { padding: 18px 20px; text-align: left; font-weight: 800; color: var(--ink); }
.profit-loss-table tbody th { text-align: left; font-weight: 400; background: var(--white); text-transform: none; white-space: normal; overflow-wrap: anywhere; font-size: var(--font-table); }
.profit-loss-table .profit-loss-section th { background: #f1f1f1; font-weight: 800; }
.profit-loss-table .profit-loss-subtotal th,
.profit-loss-table .profit-loss-subtotal td { font-weight: 800; border-top: 1px solid var(--line); background: #fafafa; }
.profit-loss-table .is-final th,
.profit-loss-table .is-final td { background: #fff2eb; border-top: 2px solid var(--accent); }
.profit-loss-account { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; padding-left: 12px; }
.profit-loss-account > span, .profit-loss-account > small { color: var(--muted); font-size: .85rem; }
.profit-loss-account > strong { font-weight: 500; }
.profit-loss-classification { padding: 12px 20px 20px; color: var(--muted); font-size: .85rem; line-height: 1.7; }
@media (max-width: 1100px) { .profit-loss-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) {
  .profit-loss-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profit-loss-summary-grid .ledger-summary-card:last-child { grid-column: 1 / -1; }
}

.trial-balance-amount {
  color: #262626;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.trial-balance-amount.is-zero {
  color: #a0a0a0;
  font-weight: 500;
}

.ledger-empty-state {
  display: grid;
  width: 100%;
  min-height: 100%;
  flex: 1 1 auto;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 32px 15px;
  color: var(--muted);
  text-align: center;
}

.ledger-empty-state svg {
  width: 32px;
  height: 32px;
  color: #9b9b9b;
}

.ledger-empty-state strong {
  color: #383838;
  font-size: var(--font-subheadline);
}

.ledger-empty-state span {
  font-size: var(--font-footnote);
}

.ledger-account-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
}

.ledger-account-head {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
}

.ledger-account-head > div:first-child {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 2px 9px;
}

.ledger-account-head > div:first-child > span {
  color: var(--accent-dark);
  font-size: var(--font-footnote);
  font-weight: 800;
}

.ledger-account-head h2 {
  margin: 0;
  font-size: var(--font-callout);
}

.ledger-account-head > div:first-child > small {
  grid-column: 2;
  color: var(--muted);
  font-size: var(--font-caption);
  text-transform: capitalize;
}

.ledger-account-totals {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: var(--font-footnote);
  white-space: nowrap;
}

.ledger-account-totals .ledger-balance {
  margin-left: 5px;
  color: var(--ink);
}

.ledger-table-scroll {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.ledger-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
  color: var(--ink);
  background: var(--white);
  font-size: var(--font-table);
}

.ledger-table th,
.ledger-table td {
  height: 47px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 7px 15px;
  text-align: left;
  vertical-align: middle;
}

.ledger-table th:last-child,
.ledger-table td:last-child {
  border-right: 0;
}

.ledger-table th {
  color: #383838;
  background: #f1f1f1;
  font-size: var(--font-footnote);
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.ledger-table .is-numeric {
  text-align: right;
  white-space: nowrap;
}

.ledger-table tbody tr:hover:not(.ledger-opening-row) td {
  background: #fffaf7;
}

.ledger-table tfoot td {
  border-bottom: 0;
  color: #303030;
  background: #f5f5f5;
  font-weight: 800;
}

.stock-ledger-table {
  min-width: 1280px;
}

.stock-ledger-difference.is-incoming .ledger-money {
  color: #155f9b;
}

.stock-ledger-difference.is-outgoing .ledger-money {
  color: #8e3a18;
}

.ledger-opening-row td {
  color: #535353;
  background: #fafafa;
  font-weight: 700;
}

.ledger-party {
  display: grid;
  gap: 2px;
}

.ledger-party small {
  color: var(--muted);
  font-size: var(--font-caption-small);
}

.ledger-entry-link {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.ledger-entry-link:hover {
  text-decoration: underline;
}

.ledger-entry-number,
.ledger-date-cell,
.ledger-money,
.ledger-balance {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ledger-money small,
.ledger-balance small {
  color: var(--muted);
  font-size: var(--font-caption-small);
  font-weight: 800;
}

.ledger-balance.is-cr small {
  color: #8e3a18;
}

.ledger-balance.is-dr small {
  color: #155f9b;
}

.ledger-description {
  display: grid;
  min-width: 180px;
  gap: 2px;
}

.ledger-description small {
  color: var(--muted);
  font-size: var(--font-caption);
}

.openai-settings-area {
  min-height: calc(100vh - var(--topbar-height));
  padding: 15px;
  background: #fafafa;
}

.openai-settings-shell {
  display: grid;
  width: min(1040px, 100%);
  margin: 0 auto;
  gap: 15px;
}

.openai-settings-status,
.openai-settings-form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.openai-settings-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
}

.openai-settings-status-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 50%;
}

.openai-settings-status-icon svg {
  width: 19px;
  height: 19px;
}

.openai-settings-status.is-configured .openai-settings-status-icon {
  color: #16803a;
  background: #eaf8ee;
}

.openai-settings-status.is-unconfigured .openai-settings-status-icon {
  color: #9a3d1b;
  background: #fff1eb;
}

.openai-settings-status > span:last-child {
  display: grid;
  gap: 3px;
}

.openai-settings-status small,
.openai-settings-copy p,
.openai-settings-remove small {
  color: var(--muted);
}

.openai-settings-form {
  overflow: hidden;
}

.openai-settings-copy {
  padding: 18px 20px 0;
}

.openai-settings-copy h2 {
  margin: 0 0 5px;
  font-size: 18px;
}

.openai-settings-copy p {
  max-width: 760px;
  margin: 0;
  line-height: 1.65;
}

.openai-settings-fields {
  grid-template-columns: 2fr 1fr 1fr;
  padding: 18px 20px;
}

.openai-settings-fields .field {
  gap: 7px;
}

.openai-settings-fields .field-hint {
  min-height: 29px;
}

.openai-settings-remove {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 20px 18px;
  padding: 11px 12px;
  border: 1px solid #f0cfc2;
  border-radius: 9px;
  background: #fff9f6;
  cursor: pointer;
}

.openai-settings-remove input {
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--accent);
}

.openai-settings-remove span {
  display: grid;
  gap: 2px;
}

.openai-settings-message {
  margin: 0 20px 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fafafa;
  font-size: var(--font-footnote);
  line-height: 1.45;
}

.openai-settings-message:empty {
  display: none;
}

.openai-settings-message.is-error {
  border-color: #f1c8be;
  color: #a02f16;
  background: #fff5f2;
}

.openai-settings-message.is-success {
  border-color: #bfe4c9;
  color: #167337;
  background: #f0faf3;
}

.openai-settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: #fafafa;
}

.dashboard-shell {
  position: relative;
  display: grid;
  gap: 12px;
  min-height: calc(100vh - var(--topbar-height));
  padding: 15px;
  background: #f7f7f8;
  transition: opacity var(--ease);
}

.dashboard-shell.is-refreshing {
  pointer-events: none;
  opacity: .58;
}

.dashboard-toolbar {
  display: flex;
  min-width: 0;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px 10px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.dashboard-toolbar > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dashboard-toolbar > div:first-child strong {
  font-size: 18px;
}

.dashboard-toolbar > div:first-child span {
  color: var(--muted);
  font-size: var(--font-caption);
}

.dashboard-toolbar-actions,
.dashboard-range {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dashboard-range {
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f5f5f5;
}

.dashboard-range-button,
.dashboard-refresh {
  height: 34px;
  border: 0;
  border-radius: 7px;
  color: #4d4d4d;
  background: transparent;
  font: inherit;
  font-size: var(--font-caption);
  font-weight: 700;
  cursor: pointer;
}

.dashboard-range-button {
  padding: 0 11px;
  white-space: nowrap;
}

.dashboard-range-button:hover,
.dashboard-range-button:focus-visible {
  color: var(--ink);
  background: #ececec;
  outline: 0;
}

.dashboard-range-button.is-active {
  color: white;
  background: var(--accent);
  box-shadow: 0 2px 6px rgb(245 76 0 / 18%);
}

.dashboard-refresh {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  background: var(--white);
}

.dashboard-refresh:hover,
.dashboard-refresh:focus-visible {
  border-color: #b9b9b9;
  color: var(--accent);
  outline: 0;
}

.dashboard-refresh svg {
  width: 15px;
  height: 15px;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line);
}

.dashboard-kpi {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr auto;
  gap: 7px 12px;
  min-width: 0;
  min-height: 122px;
  padding: 15px;
  color: var(--ink);
  background: var(--white);
  text-decoration: none;
  transition: background var(--ease);
}

.dashboard-kpi:hover,
.dashboard-kpi:focus-visible {
  background: #fff8f4;
  outline: 0;
}

.dashboard-kpi:hover .dashboard-kpi-icon,
.dashboard-kpi:focus-visible .dashboard-kpi-icon {
  color: var(--accent);
  background: #fff0e9;
}

.dashboard-kpi-label {
  align-self: center;
  color: #383838;
  font-size: var(--font-footnote);
  font-weight: 700;
}

.dashboard-kpi-icon {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: #424242;
  background: #f3f3f3;
  transition: color var(--ease), background var(--ease);
}

.dashboard-kpi-icon svg {
  width: 18px;
  height: 18px;
}

.dashboard-kpi > strong {
  align-self: end;
  overflow: hidden;
  font-size: clamp(21px, 2vw, 27px);
  line-height: 1.1;
  letter-spacing: -.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-kpi > strong small {
  color: var(--muted);
  font-size: var(--font-caption);
  letter-spacing: 0;
}

.dashboard-kpi-support {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--font-caption);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-insights-grid,
.dashboard-support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-support-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-support-grid.without-stock {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.dashboard-panel > header {
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
}

.dashboard-panel > header > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dashboard-panel > header strong {
  color: #242424;
  font-size: var(--font-callout);
}

.dashboard-panel > header span,
.dashboard-panel > header a {
  color: var(--muted);
  font-size: var(--font-caption);
}

.dashboard-panel > header a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.dashboard-chart-legends {
  display: flex;
  min-height: 43px;
  align-items: center;
  gap: 7px;
  padding: 7px 15px 0;
  overflow-x: auto;
}

.dashboard-chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 29px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #454545;
  background: var(--white);
  font: inherit;
  font-size: var(--font-caption);
  cursor: pointer;
  white-space: nowrap;
}

.dashboard-chart-legend:hover,
.dashboard-chart-legend:focus-visible {
  border-color: #bdbdbd;
  outline: 0;
}

.dashboard-chart-legend[aria-pressed="false"] {
  color: #9a9a9a;
  background: #f5f5f5;
  text-decoration: line-through;
}

.dashboard-chart-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--series-color, #343a40);
}

.dashboard-chart-legend small {
  color: #8b8b8b;
}

.dashboard-chart-wrap {
  width: 100%;
  overflow: hidden;
}

.dashboard-chart {
  display: block;
  width: 100%;
  min-height: 250px;
  padding: 2px 8px 0 0;
}

.dashboard-chart-grid {
  stroke: #e8e8e8;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.dashboard-chart-axis {
  fill: #737373;
  font-family: Almarai, sans-serif;
  font-size: 11px;
}

.dashboard-chart-zero {
  stroke: #b9b9b9;
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

[data-dashboard-series].is-hidden {
  display: none;
}

.dashboard-chart-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
}

.dashboard-chart-summary > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 11px 15px;
  background: #fcfcfc;
}

.dashboard-chart-summary small {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--font-caption-small);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-chart-summary strong {
  overflow: hidden;
  font-size: var(--font-footnote);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-operations {
  display: grid;
  padding: 2px 15px 10px;
}

.dashboard-operation {
  display: grid;
  gap: 10px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.dashboard-operation:last-child {
  border-bottom: 0;
}

.dashboard-operation > span {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
}

.dashboard-operation strong {
  font-size: var(--font-table);
}

.dashboard-operation small,
.dashboard-operation span b {
  color: var(--muted);
  font-size: var(--font-caption);
  font-weight: 400;
}

.dashboard-operation > i {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #ededed;
}

.dashboard-operation > i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.dashboard-stock-list,
.dashboard-activity-list {
  display: grid;
  padding: 0 15px;
}

.dashboard-stock-item,
.dashboard-activity-item {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 58px;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  text-align: left;
}

button.dashboard-stock-item,
button.dashboard-activity-item {
  cursor: pointer;
}

button.dashboard-stock-item:hover,
button.dashboard-activity-item:hover,
button.dashboard-stock-item:focus-visible,
button.dashboard-activity-item:focus-visible {
  background: #fff8f4;
  outline: 0;
}

.dashboard-stock-item:last-child,
.dashboard-activity-item:last-child {
  border-bottom: 0;
}

.dashboard-stock-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.dashboard-stock-item > span,
.dashboard-stock-level,
.dashboard-activity-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dashboard-stock-item strong,
.dashboard-activity-copy strong {
  font-size: var(--font-table);
}

.dashboard-stock-item small,
.dashboard-activity-copy > span,
.dashboard-activity-copy .timestamp {
  color: var(--muted);
  font-size: var(--font-caption);
}

.dashboard-stock-level {
  justify-items: end;
  padding-left: 12px;
}

.dashboard-stock-level > strong {
  color: var(--danger);
}

.dashboard-activity-item {
  grid-template-columns: auto minmax(0, 1fr);
}

.dashboard-activity-item .avatar {
  width: 34px;
  height: 34px;
  font-size: var(--font-caption);
}

.dashboard-activity-copy > span:first-child {
  overflow: hidden;
  color: #3b3b3b;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-panel-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 28px;
  color: var(--muted);
  font-size: var(--font-footnote);
  line-height: 1.6;
  text-align: center;
}

.dashboard-generated {
  padding: 0 3px 4px;
  color: var(--muted);
  font-size: var(--font-caption-small);
  text-align: right;
}

.dashboard-generated .timestamp {
  color: inherit;
}

#resource-area.recent-activity-area {
  min-height: calc(100vh - var(--topbar-height));
  padding-bottom: 0;
  overflow-x: clip;
  background: #f8f8f8;
}

.recent-activity-filters {
  display: grid;
  grid-template-columns: minmax(280px, 1.6fr) repeat(3, minmax(170px, 1fr));
  align-items: center;
  gap: 10px;
  padding: 15px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.recent-activity-filters .resource-search {
  position: relative;
  min-width: 0;
}

.recent-activity-filters input,
.recent-activity-filters select {
  width: 100%;
  min-width: 0;
  height: var(--control-height);
  min-height: var(--control-height);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
  font-size: var(--font-subheadline);
}

.recent-activity-filters input[type="search"] {
  padding-right: 52px;
}

.recent-activity-filters input:focus,
.recent-activity-filters select:focus {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(245, 76, 0, .12);
}

.recent-activity-filter-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.recent-activity-results {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  justify-content: center;
  padding: 18px 15px;
}

.recent-activity-timeline {
  position: relative;
  display: grid;
  width: min(1100px, 100%);
  align-content: start;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recent-activity-timeline::before {
  position: absolute;
  top: 19px;
  bottom: 19px;
  left: 19px;
  width: 1px;
  background: #d6d6d6;
  content: "";
}

.recent-activity-item {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
}

.recent-activity-marker {
  position: relative;
  z-index: 1;
  display: grid;
  height: 40px;
  place-items: center;
  border: 3px solid #f8f8f8;
  border-radius: 50%;
}

.recent-activity-marker .avatar {
  width: 34px;
  height: 34px;
  font-size: var(--font-caption);
}

.recent-activity-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 3px 12px rgba(0, 0, 0, .025);
}

.recent-activity-card > header {
  display: flex;
  min-height: 66px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 15px;
}

.recent-activity-card > header > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.recent-activity-card > header strong {
  color: #202020;
  font-size: var(--font-table);
}

.recent-activity-card > header span {
  color: var(--muted);
  font-size: var(--font-footnote);
  line-height: 1.55;
}

.recent-activity-card > header b {
  color: #3a3a3a;
  font-weight: 700;
}

.recent-activity-time {
  flex: 0 0 auto;
  white-space: nowrap;
}

.recent-activity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 15px 12px;
}

.recent-activity-tags span {
  padding: 4px 7px;
  border-radius: 999px;
  color: #555;
  background: #f1f1f1;
  font-size: var(--font-caption-small);
  font-weight: 700;
}

.recent-activity-details {
  border-top: 1px solid var(--line);
}

.recent-activity-details > summary {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 15px;
  color: #3f3f3f;
  font-size: var(--font-footnote);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.recent-activity-details > summary::-webkit-details-marker {
  display: none;
}

.recent-activity-details > summary svg {
  width: 15px;
  transition: transform var(--ease);
}

.recent-activity-details[open] > summary svg {
  transform: rotate(180deg);
}

.recent-activity-detail-body {
  display: grid;
  gap: 12px;
  padding: 0 15px 15px;
}

.recent-activity-metadata {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.recent-activity-metadata > div {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 10px;
  background: #fafafa;
}

.recent-activity-metadata dt {
  color: var(--muted);
  font-size: var(--font-caption-small);
  font-weight: 700;
  text-transform: uppercase;
}

.recent-activity-metadata dd {
  min-width: 0;
  overflow-wrap: anywhere;
  margin: 0;
  color: #292929;
  font-size: var(--font-footnote);
}

.recent-activity-no-changes {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border-radius: 8px;
  color: var(--muted);
  background: #f7f7f7;
  font-size: var(--font-caption);
}

.recent-activity-no-changes strong {
  color: #444;
  font-size: var(--font-footnote);
}

.recent-activity-detail-actions {
  display: flex;
  justify-content: flex-end;
}

.recent-activity-empty {
  display: grid;
  flex: 1 1 auto;
  min-height: 360px;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.recent-activity-empty svg {
  width: 31px;
  color: #999;
}

.recent-activity-empty strong {
  color: #333;
  font-size: var(--font-subheadline);
}

.recent-activity-empty span {
  max-width: 460px;
  font-size: var(--font-footnote);
}

.recent-activity-footer {
  position: sticky;
  bottom: 0;
  z-index: 8;
  display: flex;
  min-height: 57px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .035);
  font-size: var(--font-caption-small);
  backdrop-filter: blur(12px);
}

.recent-activity-footer > div {
  display: flex;
  align-items: center;
  gap: 14px;
}

.recent-activity-footer select {
  width: 72px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  color: #333;
  background: var(--white);
}

.recent-activity-page {
  min-width: 92px;
  color: #555;
  text-align: center;
}

.login-page {
  background: var(--black);
}

.login-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(380px, 1fr) minmax(480px, .82fr);
}

.login-brand {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 48px;
  color: var(--white);
  background: var(--black);
}

.login-brand::after {
  position: absolute;
  right: -120px;
  bottom: -180px;
  width: 440px;
  height: 440px;
  border: 86px solid var(--accent);
  border-radius: 50%;
  opacity: .18;
  content: "";
}

.login-brand-logo {
  width: 245px;
}

.login-brand-copy {
  position: relative;
  z-index: 1;
  max-width: 520px;
  padding-bottom: 55px;
}

.login-brand-copy h1 {
  margin: 0 0 15px;
  font-size: clamp(37px, 5vw, 66px);
  line-height: 1.02;
  letter-spacing: -.055em;
}

.login-brand-copy p {
  margin: 0;
  color: #b7b7b7;
  font-size: 15px;
}

.login-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 40px;
  background: var(--white);
}

.login-card {
  width: min(420px, 100%);
}

.login-card-logo {
  display: none;
  width: 185px;
  margin-bottom: 38px;
}

.login-card h2 {
  margin: 0 0 9px;
  font-size: 30px;
  letter-spacing: -.04em;
}

.login-intro {
  margin: 0 0 29px;
  color: var(--muted);
  font-size: 13px;
}

.login-card form {
  display: grid;
  gap: 17px;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 62px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  border: 0;
  padding: 6px;
  transform: translateY(-50%);
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.login-security {
  margin: 20px 0 0;
  color: #8c8c8c;
  font-size: 9px;
  line-height: 1.55;
  text-align: center;
}

/* Apple-style readable type scale, adapted to Almarai and dense admin tables. */
.control,
.field input,
.field select,
.field textarea,
.filter-row input,
.select2-container,
.table-search input {
  font-size: var(--font-callout);
}

.breadcrumbs,
.button,
.login-intro,
.nav-link,
.page-loading,
.permission-section h3,
.select2-dropdown {
  font-size: var(--font-subheadline);
}

.data-table,
.person-cell strong {
  font-size: var(--font-table);
}

.column-selector strong,
.data-table th,
.field label,
.filter-builder-empty,
.filter-no-value,
.page-button,
.page-limit select,
.page-limit .select2-container,
.permission-page strong,
.permission-section > p,
.permission-table,
.account-menu-profile strong,
.record-change-alert,
.record-presence,
.table-footer,
.toast,
.topbar-user strong {
  font-size: var(--font-footnote);
}

.avatar,
.button-compact,
.column-selector small,
.field-error,
.field-hint,
.filter-builder-head,
.login-security,
.nav-group-toggle,
.password-toggle,
.permission-page small,
.account-menu-profile small,
.record-change-alert button,
.realtime-status,
.status,
.text-button,
.topbar-user small {
  font-size: var(--font-caption);
}

.filter-count {
  font-size: var(--font-caption-small);
}

.modal-head h2 {
  font-size: 20px;
}

.sidebar-scrim {
  display: none;
}

@media (max-width: 1120px) {
  .general-ledger-filters,
  .stock-ledger-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .trial-balance-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trial-balance-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .recent-activity-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ledger-filter-actions {
    justify-content: flex-end;
  }

  .dashboard-insights-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-support-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-support-grid > :last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  :root {
    --topbar-height: 60px;
  }

  .sidebar {
    width: min(292px, calc(100vw - 48px));
    transform: translateX(-102%);
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    visibility: hidden;
    background: rgba(0, 0, 0, .38);
    opacity: 0;
    transition: opacity var(--ease), visibility var(--ease);
  }

  body.sidebar-open .sidebar-scrim {
    visibility: visible;
    opacity: 1;
  }

  .workspace {
    margin-left: 0;
  }

  .topbar {
    padding: 0 15px;
  }

  .main-content {
    padding: 0;
  }

  .topbar-user-copy {
    display: none;
  }

  .realtime-status {
    min-width: 0;
    padding: 7px;
  }

  .realtime-status [data-realtime-label] {
    display: none;
  }

  .table-footer {
    right: 0;
    left: 0;
    width: auto;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-inline: 0;
    padding: 10px 15px;
    transform: none;
  }

  .pagination {
    justify-content: flex-end;
  }

  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-brand {
    display: none;
  }

  .login-card-logo {
    display: block;
  }

  .login-panel {
    min-height: 100vh;
  }
}

@media (max-width: 680px) {
  #resource-area.general-ledger-area,
  #resource-area.stock-ledger-area,
  #resource-area.trial-balance-area {
    padding-bottom: 0;
  }

  .general-ledger-filters,
  .stock-ledger-filters,
  .trial-balance-filters {
    grid-template-columns: 1fr;
  }

  .trial-balance-zero-toggle,
  .trial-balance-filters .ledger-filter-actions {
    grid-column: auto;
  }

  .trial-balance-filters .ledger-filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trial-balance-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trial-balance-context {
    align-items: flex-start;
    flex-direction: column;
  }

  .trial-balance-context > div {
    width: 100%;
    justify-content: space-between;
  }

  .recent-activity-filters {
    grid-template-columns: 1fr;
  }

  .recent-activity-filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recent-activity-results {
    padding: 12px 10px;
  }

  .recent-activity-timeline::before {
    left: 16px;
  }

  .recent-activity-item {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
  }

  .recent-activity-marker {
    height: 34px;
  }

  .recent-activity-marker .avatar {
    width: 30px;
    height: 30px;
  }

  .recent-activity-card > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .recent-activity-metadata {
    grid-template-columns: 1fr;
  }

  .recent-activity-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
  }

  .recent-activity-footer > div,
  .recent-activity-footer .pagination {
    width: 100%;
    justify-content: space-between;
  }

  .ledger-filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ledger-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ledger-summary-card {
    min-height: 78px;
  }

  .ledger-summary-card strong {
    font-size: var(--font-callout);
  }

  .ledger-report-context {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .ledger-account-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .ledger-account-totals {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }

  .image-lightbox-backdrop {
    padding: 0;
  }

  .image-lightbox-caption {
    padding-left: 12px;
  }

  .image-lightbox-close {
    right: 10px;
  }

  #resource-area {
    padding-bottom: 118px;
  }

  #resource-area.is-tree-resource {
    padding-bottom: 0;
  }

  #resource-area.recent-activity-area {
    padding-bottom: 0;
  }

  .table-footer-left {
    width: 100%;
    justify-content: space-between;
  }

  .pagination {
    width: 100%;
  }

  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
    padding-inline: 15px;
  }

  .table-search {
    width: 100%;
  }

  .table-toolbar-actions {
    width: 100%;
    flex-wrap: wrap;
    margin-left: 0;
  }

  .table-toolbar-actions .button {
    flex: 1;
    min-width: 0;
    gap: 6px;
    padding-inline: 10px;
    font-size: var(--font-table);
    white-space: nowrap;
  }

  .table-toolbar:not(.account-tree-toolbar) .table-toolbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-toolbar:not(.account-tree-toolbar) .table-toolbar-actions #create-record {
    grid-column: 1 / -1;
    width: 100%;
  }

  .account-tree-toolbar .table-toolbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-tree-toolbar .table-toolbar-actions .button {
    width: 100%;
  }

  .account-tree {
    min-width: 0;
  }

  .account-tree-head {
    display: none;
  }

  .sticky-account-tree-header {
    display: none;
  }

  .account-tree-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    align-items: center;
    padding: 7px 0;
  }

  .account-tree.no-actions .account-tree-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-tree-account {
    grid-column: 1 / -1;
    min-height: 42px;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .account-tree-value,
  .account-tree-balance,
  .account-tree-status,
  .account-tree-actions {
    padding: 5px 12px;
    border-left: 0;
  }

  .account-tree-row [data-tree-label]::before {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    content: attr(data-tree-label);
    font-size: var(--font-caption-small);
    font-weight: 700;
    text-transform: uppercase;
  }

  .account-tree-actions {
    display: flex;
    grid-column: 3;
    grid-row: 2 / span 20;
    align-self: stretch;
    align-items: center;
    justify-content: center;
  }

  .column-selector {
    grid-template-columns: 1fr;
  }

  .filter-builder-head {
    display: none;
  }

  .filter-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px;
  }

  .filter-value-wrap {
    grid-column: 1 / 3;
  }

  .filter-remove {
    grid-column: 3;
    grid-row: 1 / 3;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .payment-type-switch {
    grid-template-columns: 1fr;
  }

  .payment-type-option > span {
    min-height: 51px;
  }

  .field-full,
  .field-span-2 {
    grid-column: auto;
  }

  .journal-lines-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .journal-lines-table {
    min-width: 1320px;
  }

  .stock-entry-lines-table {
    min-width: 1080px;
  }

  .sales-invoice-lines-table {
    min-width: 1160px;
  }

  .tax-profile-lines-table {
    min-width: 1540px;
  }

  .bundle-components-table {
    min-width: 760px;
  }

  .item-ingredients-table {
    min-width: 720px;
  }

  .item-side-orders-table {
    min-width: 900px;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal,
  .modal-large,
  .modal-xlarge {
    width: 100%;
    max-height: 94vh;
    border-radius: 15px 15px 0 0;
  }

  .modal-body {
    max-height: none;
  }

  .modal-tab {
    min-height: 38px;
    gap: 5px;
    padding: 8px 10px;
    font-size: var(--font-caption);
  }

  .attachment-uploader {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .attachment-item {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 10px;
  }

  .attachment-file-icon {
    width: 34px;
    height: 34px;
  }

  .comment-composer-foot {
    flex-wrap: wrap;
  }

  .comment-error {
    flex-basis: 100%;
  }

  .comment-content header {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .history-change-head {
    display: none;
  }

  .history-change-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-change-row > .history-field {
    grid-column: 1 / -1;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .history-change-value small {
    display: block;
  }

  .dashboard-shell {
    padding: 10px;
  }

  .openai-settings-area {
    padding: 10px;
  }

  .openai-settings-copy,
  .openai-settings-fields {
    padding-right: 15px;
    padding-left: 15px;
  }

  .openai-settings-fields {
    grid-template-columns: 1fr;
  }

  .openai-settings-remove,
  .openai-settings-message {
    margin-right: 15px;
    margin-left: 15px;
  }

  .openai-settings-actions {
    padding-right: 15px;
    padding-left: 15px;
  }

  .dashboard-toolbar,
  .dashboard-toolbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-range {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dashboard-range-button {
    padding: 0 6px;
  }

  .dashboard-refresh {
    justify-content: center;
  }

  .dashboard-kpis,
  .dashboard-support-grid,
  .dashboard-support-grid.without-stock {
    grid-template-columns: 1fr;
  }

  .dashboard-support-grid > :last-child {
    grid-column: auto;
  }

  .dashboard-chart {
    min-height: 220px;
  }

  .topbar-user {
    gap: 5px;
    padding: 4px;
  }

  .login-panel {
    padding: 28px 22px;
  }

  .login-card-logo {
    width: 170px;
  }

  .login-card h2 {
    font-size: 26px;
  }
}

.pos-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(390px, .75fr);
  height: calc(100vh - var(--topbar-height));
  min-height: 0;
  overflow: hidden;
  background: #f6f6f6;
}

.pos-catalog,
.pos-order {
  min-width: 0;
  min-height: 0;
}

.pos-workspace input[type="search"],
.pos-workspace input[type="number"],
.pos-workspace select {
  width: 100%;
  min-width: 0;
  height: 42px;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
  font-size: var(--font-callout);
  line-height: 1.2;
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}

.pos-workspace input[type="search"]::placeholder,
.pos-workspace input[type="number"]::placeholder {
  color: #777;
  opacity: 1;
}

.pos-workspace input[type="search"]:focus,
.pos-workspace input[type="number"]:focus,
.pos-workspace select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 76, 0, .12);
}

.pos-workspace input:disabled,
.pos-workspace select:disabled,
.pos-workspace .select2-container--disabled .select2-selection--single {
  color: #858585;
  background: #f3f3f3;
  cursor: not-allowed;
}

.pos-catalog {
  display: flex;
  overflow: hidden;
  flex-direction: column;
  border-right: 1px solid var(--line);
}

.pos-catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 15px;
  border-bottom: 1px solid var(--line);
  background: white;
}

.pos-catalog-toolbar > * {
  min-width: 0;
}

.pos-search {
  position: relative;
  width: 100%;
  max-width: none;
}

.pos-search input {
  width: 100%;
  padding-right: 48px;
}

.pos-search button {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 37px;
  height: 34px;
  border: 0;
  border-radius: 7px;
  transform: translateY(-50%);
  color: white;
  background: var(--accent);
  cursor: pointer;
  transition: background var(--ease), box-shadow var(--ease), transform var(--ease);
}

.pos-search button:hover {
  background: var(--accent-dark);
}

.pos-search button:active {
  transform: translateY(-50%) scale(.97);
}

.pos-search button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(245, 76, 0, .2);
}

.pos-category-nav {
  display: flex;
  flex: 0 0 auto;
  min-width: 0;
  gap: 7px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--line);
  background: white;
}

.pos-category-strip {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.pos-category-nav button,
.pos-order-type button,
.pos-schedule-mode button {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: white;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.pos-category-nav button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.pos-category-image {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  overflow: hidden;
  place-items: center;
  border-radius: 7px;
  background: #f1f1f1;
}

.pos-category-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pos-category-image-placeholder svg {
  width: 15px;
  height: 15px;
}

.pos-category-nav button.is-active,
.pos-order-type button.is-active,
.pos-schedule-mode button.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: #fff3ee;
}

.pos-product-grid {
  display: grid;
  flex: 1 1 0;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  grid-auto-rows: 202px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  align-content: start;
  gap: 11px;
  padding: 15px;
}

.pos-product-grid.showing-groups {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  grid-auto-rows: 180px;
}

.pos-product-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 202px;
  min-width: 0;
  align-self: start;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: left;
  background: white;
  box-shadow: 0 2px 7px rgb(0 0 0 / 4%);
  cursor: pointer;
}

.pos-product-card:hover,
.pos-product-card:focus-visible,
.pos-group-card:hover,
.pos-group-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 5px 16px rgb(245 76 0 / 12%);
}

.pos-group-card {
  position: relative;
  display: grid;
  grid-template-rows: 92px minmax(0, 1fr);
  height: 180px;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: left;
  background: white;
  box-shadow: 0 2px 7px rgb(0 0 0 / 4%);
  cursor: pointer;
}

.pos-group-card > svg {
  position: absolute;
  right: 12px;
  bottom: 15px;
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.pos-group-card-image {
  display: grid;
  width: 100%;
  height: 92px;
  overflow: hidden;
  padding: 10px;
  place-items: center;
  color: #a2a2a2;
  background: #ededed;
}

.pos-group-card-image img {
  width: auto;
  height: auto;
  max-width: 56px;
  max-height: 56px;
  object-fit: contain;
}

.pos-group-card-image svg {
  width: 38px;
  height: 38px;
}

.pos-group-card-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
  align-content: start;
  padding: 9px 38px 9px 11px;
}

.pos-group-card-copy strong {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.pos-group-card-copy small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-product-image {
  display: grid;
  aspect-ratio: 1.75;
  overflow: hidden;
  place-items: center;
  color: #a2a2a2;
  background: #ededed;
}

.pos-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pos-product-image svg {
  width: 32px;
  height: 32px;
}

.pos-product-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 10px 10px 4px;
}

.pos-product-copy small,
.pos-product-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-product-copy strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-product-card > b {
  padding: 4px 10px 11px;
  color: var(--accent);
  font-size: 13px;
}

.pos-order {
  display: flex;
  overflow: hidden;
  flex-direction: column;
  background: white;
}

.pos-order-head,
.pos-section-title,
.pos-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pos-order-head {
  min-height: 64px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--line);
}

.pos-order-head > div {
  display: grid;
  gap: 1px;
}

.pos-order-head .pos-order-head-actions {
  display: flex;
  grid-auto-flow: column;
  gap: 6px;
}

.pos-order-head span,
.pos-order-summary label > span:first-child {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.pos-order-controls {
  display: grid;
  gap: 9px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
}

.pos-order-type {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.pos-schedule {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.pos-schedule-mode,
.pos-schedule-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.pos-schedule-fields[hidden],
.pos-schedule [data-pos-schedule-status][hidden] {
  display: none;
}

.pos-schedule-fields > * {
  min-width: 0;
  width: 100%;
}

.pos-schedule-fields .select2-container,
.branch-hour-row .select2-container {
  min-width: 0;
  width: 100% !important;
}

.pos-schedule-fields input,
.branch-hour-row input {
  height: var(--control-height);
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--white);
  font: inherit;
  font-size: 12px;
}

.pos-schedule-fields input:focus,
.branch-hour-row input:focus {
  border-color: var(--accent);
  outline: 2px solid rgb(245 76 0 / 12%);
}

.pos-schedule small {
  color: var(--muted);
  font-size: 11px;
}

.branch-hours {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin-top: 16px;
}

.branch-hours[hidden] {
  display: none;
}

.branch-hours p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.branch-hours [data-branch-hours-list] {
  display: grid;
  gap: 8px;
}

.branch-hour-row {
  display: grid;
  grid-template-columns: minmax(125px, 1.1fr) minmax(115px, 1fr) minmax(95px, .85fr) auto minmax(95px, .85fr) 32px;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.branch-hour-row > * {
  min-width: 0;
}

.branch-hours-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 700px) {
  .branch-hour-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px;
  }
  .branch-hour-row [data-branch-hour-start] { grid-column: 1; }
  .branch-hour-row > span[aria-hidden="true"] { display: none; }
  .branch-hour-row [data-branch-hour-end] { grid-column: 2; }
  .branch-hour-row [data-branch-hour-remove] { grid-column: 3; grid-row: 1 / 3; }
}

.pos-delivery-address {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.pos-delivery-address[hidden] {
  display: none;
}

.pos-delivery-address .button {
  min-height: var(--control-height);
  white-space: nowrap;
}

.pos-cart {
  min-height: 130px;
  overflow: auto;
  flex: 1 1 auto;
}

.pos-cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto 30px;
  align-items: center;
  gap: 9px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.pos-cart-line-main {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 3px;
  border: 0;
  border-radius: 7px;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.pos-cart-line-main:hover {
  background: #f7f7f7;
}

.pos-cart-line-main:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pos-cart-line-main strong,
.pos-cart-line-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-cart-line-main small,
.pos-cart-line-main span {
  color: var(--muted);
  font-size: 10px;
}

.pos-quantity {
  display: grid;
  grid-template-columns: 28px 46px 28px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.pos-quantity button,
.pos-quantity input {
  width: 100%;
  height: 31px;
  min-height: 31px;
  padding: 0;
  border: 0;
  border-radius: 0;
  text-align: center;
  background: white;
}

.pos-quantity input {
  font-size: 11px;
  appearance: textfield;
}

.pos-cart-empty,
.pos-empty,
.pos-held-empty {
  display: grid;
  min-height: 100%;
  place-content: center;
  justify-items: center;
  gap: 7px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.pos-empty {
  grid-column: 1 / -1;
  min-height: 45vh;
}

.pos-cart-empty svg,
.pos-empty svg {
  width: 28px;
  height: 28px;
}

.pos-order-summary {
  display: grid;
  gap: 8px;
  padding: 11px 15px;
  border-top: 1px solid var(--line);
  background: #fbfbfb;
}

.pos-order-summary {
  grid-template-columns: minmax(0, 1fr);
}

.pos-order-summary label {
  display: grid;
  gap: 4px;
}

.pos-discount {
  position: relative;
}

.pos-discount small {
  position: absolute;
  right: 9px;
  bottom: 10px;
  color: var(--muted);
}

.pos-discount input {
  padding-right: 40px;
}

.pos-totals {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 15px;
  padding-top: 5px;
}

.pos-totals span {
  color: var(--muted);
  font-size: 11px;
}

.pos-totals strong {
  text-align: right;
  font-size: 12px;
}

.pos-totals span:last-of-type,
.pos-totals strong:last-of-type {
  color: var(--text);
  font-size: 15px;
}

.pos-quote-error {
  grid-column: 1 / -1;
  color: var(--danger);
  font-size: 11px;
}

.pos-section-title button {
  border: 0;
  color: var(--accent);
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.pos-section-title svg {
  width: 13px;
}

.pos-payment-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 140px minmax(150px, .8fr) 30px;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
}

.pos-payment-row > input,
.pos-payment-row > select {
  width: 100%;
  min-width: 0;
  height: var(--control-height);
  min-height: var(--control-height);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--ink);
  background: white;
  font: inherit;
}

.pos-payment-confirmation {
  display: grid;
  gap: 16px;
}

.pos-payment-allergy-alert {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #f0aaa0;
  border-radius: 11px;
  color: #6d2218;
  background: #fff4f2;
}

.pos-payment-allergy-title,
.pos-allergy-warning > header {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.pos-payment-allergy-title svg,
.pos-allergy-warning > header svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  color: #c43724;
}

.pos-payment-allergy-title > div,
.pos-allergy-warning > header > div {
  display: grid;
  gap: 2px;
}

.pos-payment-allergy-title span,
.pos-allergy-warning > header span {
  color: #86564f;
  font-size: 11px;
}

.pos-allergy-warning-list {
  display: grid;
  gap: 8px;
  text-align: left;
}

.pos-allergy-warning {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid #edc0b9;
  border-radius: 9px;
  background: #fff;
}

.pos-allergy-warning.is-severe {
  border-color: #d33;
  box-shadow: inset 3px 0 0 #d33;
}

.pos-allergy-warning p {
  margin: 0;
  color: #6d2218;
  font-size: 12px;
}

.pos-allergy-warning ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pos-allergy-warning li {
  display: grid;
  gap: 1px;
  padding-left: 10px;
  border-left: 2px solid #f0aaa0;
  font-size: 12px;
}

.pos-allergy-warning li span {
  color: #765852;
}

.swal-pos-allergy {
  width: min(620px, calc(100vw - 30px));
}

.modal-pos-payment {
  height: min(720px, calc(100vh - 48px));
}

.modal-pos-payment > form {
  height: 100%;
}

.modal-pos-payment .modal-body {
  overflow: hidden;
}

.pos-payment-layout {
  display: grid;
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
  min-height: 0;
  align-items: stretch;
  gap: 18px;
}

.modal-pos-payment .pos-payment-layout {
  height: 100%;
}

.modal-pos-payment .pos-payment-confirmation {
  min-height: 0;
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.pos-receipt-preview-panel {
  display: flex;
  height: 100%;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f3f3f3;
}

.pos-receipt-preview-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  background: white;
}

.pos-receipt-preview-panel > header > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.pos-receipt-preview-panel > header strong {
  font-size: 13px;
}

.pos-receipt-preview-panel > header span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.pos-receipt-preview-badge {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--accent) !important;
  background: #fff0e9;
  font-weight: 800;
  text-transform: uppercase;
}

.pos-receipt-preview-panel iframe {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  flex: 1 1 auto;
  border: 0;
  background: white;
}

.pos-payment-order-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fafafa;
}

.pos-payment-order-summary > div {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 14px;
  border-right: 1px solid var(--line);
}

.pos-payment-order-summary > div:last-child {
  border-right: 0;
}

.pos-payment-order-summary span,
.pos-payment-balance span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.pos-payment-order-summary strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-payment-order-summary .is-total strong {
  color: var(--accent);
  font-size: 20px;
}

.pos-payment-confirm-note {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 9px;
  color: #75401f;
  background: #fff4eb;
  font-size: 12px;
}

.pos-payment-confirm-note svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.pos-payment-modal-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.pos-payment-balance {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 18px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.pos-payment-balance strong {
  text-align: right;
}

.pos-payment-balance strong:last-child {
  color: var(--accent);
}

.pos-profile-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 10px 12px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
}

.pos-profile-switches legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pos-profile-switches label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  font-size: 13px;
  font-weight: 600;
}

.pos-profile-switches input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.pos-actions {
  flex: 0 0 auto;
  gap: 9px;
  padding: 12px 15px;
  border-top: 1px solid var(--line);
}

.pos-actions .button {
  min-height: 44px;
  flex: 1;
}

.pos-actions .button-primary {
  justify-content: space-between;
  flex: 1.6;
}

.pos-actions .button-primary strong {
  margin-left: 12px;
}

.pos-mobile-tabs,
.pos-mobile-review {
  display: none;
}

.pos-customizer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: start;
  gap: 10px;
}

.pos-customizer-options {
  display: grid;
  min-width: 0;
  gap: 9px;
}

.pos-customizer fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.pos-customizer legend {
  padding: 0 5px;
  font-weight: 800;
}

.pos-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 58px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.pos-option > input {
  grid-column: 1;
  grid-row: 1;
}

.pos-option:has(input:checked) {
  border-color: var(--accent);
  background: #fff5f1;
}

.pos-option span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.pos-option strong {
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.25;
}

.pos-option small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.pos-option-nutrition {
  display: flex !important;
  flex-wrap: wrap;
  gap: 2px 8px !important;
  margin-top: 1px;
  font-size: 10px;
}

.pos-nutrition-summary {
  position: sticky;
  top: 0;
  display: grid;
  gap: 6px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fafafa;
}

.pos-nutrition-summary > span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.pos-nutrition-summary > strong {
  font-size: 14px;
}

.pos-nutrition-summary > .pos-nutrition-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.pos-nutrition-summary > .pos-nutrition-grid > span {
  display: grid;
  gap: 3px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: white;
  font-size: 11px;
}

.pos-nutrition-summary b {
  color: var(--text);
  font-size: 14px;
}

.pos-nutrition-summary > small {
  color: var(--muted);
  line-height: 1.45;
}

.pos-ingredients-summary {
  display: grid;
  gap: 9px;
  margin-top: 5px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.pos-ingredients-summary > header {
  display: grid;
  gap: 2px;
}

.pos-ingredients-summary > header > span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.pos-ingredients-summary > header > small,
.pos-ingredient-source > small {
  color: var(--muted);
  line-height: 1.4;
}

.pos-ingredients-list,
.pos-ingredient-source,
.pos-ingredient-source > div {
  display: grid;
  gap: 7px;
}

.pos-ingredient-source {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.pos-ingredient-source > strong {
  font-size: 12px;
}

.pos-ingredient-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.pos-ingredient-row + .pos-ingredient-row {
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.pos-ingredient-row > input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.pos-ingredient-row > input:focus-visible {
  outline: 3px solid rgb(245 76 0 / 22%);
  outline-offset: 2px;
}

.pos-ingredient-row.is-removed > span,
.pos-ingredient-row.is-removed > b {
  color: #9a4a2d;
  text-decoration: line-through;
  opacity: .72;
}

.pos-ingredient-source b {
  color: var(--text);
  white-space: nowrap;
}

.modal-footer-content {
  display: flex;
  min-width: 0;
  align-items: center;
}

.pos-customizer-quantity {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: var(--font-caption);
  font-weight: 800;
}

.pos-customizer-quantity input {
  width: 112px;
  height: var(--control-height);
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: white;
  font: inherit;
}

.pos-customizer-quantity input:focus {
  border-color: var(--accent);
  outline: 3px solid rgb(245 76 0 / 12%);
}

.pos-held-list {
  display: grid;
  gap: 8px;
}

.pos-receipt-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pos-receipt-row > button:first-child {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  gap: 20px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  text-align: left;
  background: white;
  cursor: pointer;
}

.pos-receipt-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding-right: 10px;
}

.pos-receipt-actions .button svg {
  width: 16px;
  height: 16px;
}

.pos-receipt-row span {
  display: grid;
  gap: 2px;
}

.pos-receipt-row small {
  color: var(--muted);
}

@media (max-width: 1100px) {
  .pos-workspace {
    grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr);
  }

}

@media (max-width: 760px) {
  .customer-allergy-row {
    grid-template-columns: 28px minmax(0, 1fr) 34px;
    align-items: end;
  }

  .customer-allergy-row .field {
    grid-column: 2;
  }

  .customer-allergy-row .customer-allergy-severity { grid-column: 2; }

  .customer-allergy-row .row-action {
    grid-column: 3;
    grid-row: 1;
  }

  .pos-payment-order-summary {
    grid-template-columns: 1fr;
  }

  .pos-payment-layout {
    grid-template-columns: 1fr;
  }

  .modal-pos-payment .modal-body {
    overflow-y: auto;
  }

  .modal-pos-payment .pos-payment-layout {
    height: auto;
  }

  .modal-pos-payment .pos-payment-confirmation {
    overflow: visible;
    padding-right: 0;
  }

  .pos-receipt-preview-panel {
    height: 360px;
  }

  .pos-receipt-preview-panel iframe {
    height: auto;
    min-height: 0;
  }

  .pos-payment-order-summary > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .pos-payment-order-summary > div:last-child {
    border-bottom: 0;
  }

  .pos-payment-row {
    grid-template-columns: minmax(0, 1fr) 110px 30px;
  }

  .pos-payment-row > input[type="text"] {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .pos-workspace {
    display: block;
    position: relative;
    height: calc(100dvh - var(--topbar-height));
    padding-top: 48px;
    padding-bottom: 66px;
  }

  .pos-mobile-tabs {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    height: 48px;
    border-bottom: 1px solid var(--line);
    background: white;
  }

  .pos-mobile-tabs button {
    border: 0;
    border-bottom: 2px solid transparent;
    background: white;
    font: inherit;
    font-weight: 800;
  }

  .pos-mobile-tabs button.is-active {
    border-bottom-color: var(--accent);
    color: var(--accent);
  }

  .pos-mobile-tabs span {
    display: inline-grid;
    min-width: 20px;
    height: 20px;
    margin-left: 5px;
    place-items: center;
    border-radius: 10px;
    color: white;
    background: var(--accent);
    font-size: 10px;
  }

  .pos-catalog,
  .pos-order {
    height: 100%;
  }

  .pos-order {
    display: none;
  }

  .pos-workspace.show-order .pos-catalog {
    display: none;
  }

  .pos-workspace.show-order .pos-order {
    display: flex;
  }

  .pos-catalog-toolbar {
    padding: 10px;
  }

  .pos-category-nav {
    padding: 8px 10px;
  }

  .pos-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 202px;
    gap: 8px;
    padding: 10px;
  }

  .pos-product-grid.showing-groups {
    grid-auto-rows: 174px;
  }

  .pos-group-card {
    grid-template-rows: 84px minmax(0, 1fr);
    height: 174px;
  }

  .pos-group-card-image {
    height: 84px;
  }

  .pos-group-card-image img {
    max-width: 48px;
    max-height: 48px;
  }

  .pos-mobile-review {
    position: absolute;
    right: 10px;
    bottom: 9px;
    left: 10px;
    z-index: 4;
    display: flex;
    height: 48px;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    border: 0;
    border-radius: 9px;
    color: white;
    background: var(--accent);
    font: inherit;
    font-weight: 800;
    box-shadow: 0 5px 18px rgb(245 76 0 / 25%);
  }

  .pos-workspace.show-order .pos-mobile-review {
    display: none;
  }

  .pos-order-summary {
    grid-template-columns: 1fr 1fr;
  }

  .customer-address-grid,
  .pos-delivery-address {
    grid-template-columns: 1fr;
  }

  .pos-cart-line {
    grid-template-columns: minmax(0, 1fr) auto 30px;
  }

  .pos-cart-line > [data-pos-line-total] {
    grid-column: 2;
    grid-row: 2;
  }

  .pos-customizer fieldset {
    grid-template-columns: 1fr;
  }

  .pos-customizer {
    grid-template-columns: 1fr;
  }

  .pos-nutrition-summary {
    position: static;
  }

  .modal-actions:has(.pos-customizer-quantity) {
    flex-wrap: wrap;
  }

  .modal-actions:has(.pos-customizer-quantity) .modal-footer-content,
  .modal-actions:has(.pos-customizer-quantity) .pos-customizer-quantity {
    width: 100%;
  }

  .modal-actions:has(.pos-customizer-quantity) .pos-customizer-quantity {
    justify-content: space-between;
  }

  .modal-actions:has(.pos-customizer-quantity) .modal-action-buttons {
    width: 100%;
    margin-left: 0;
  }

  .modal-actions:has(.pos-customizer-quantity) .modal-action-buttons .button {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  body.report-printing,
  body.report-printing .workspace,
  body.report-printing .main-content,
  body.report-printing #resource-area.printable-report {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  body.report-printing .sidebar,
  body.report-printing .sidebar-scrim,
  body.report-printing .topbar,
  body.report-printing #modal-root,
  body.report-printing #toast-root,
  body.report-printing .general-ledger-filters,
  body.report-printing .stock-ledger-filters,
  body.report-printing .trial-balance-filters,
  body.report-printing .recent-activity-filters,
  body.report-printing .recent-activity-footer,
  body.report-printing .nutrition-report-toolbar,
  body.report-printing .recent-activity-detail-actions {
    display: none !important;
  }

  body.report-printing .report-print-header {
    display: block;
    margin-bottom: 5mm;
    border-bottom: 2px solid #f54c00;
    padding-bottom: 4mm;
    color: #181818;
    break-after: avoid;
  }

  body.report-printing .report-print-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8mm;
  }

  body.report-printing .report-print-heading > div:last-child {
    text-align: right;
  }

  body.report-printing .report-print-brand {
    display: grid;
    gap: 1mm;
  }

  body.report-printing .report-print-brand strong {
    color: #f54c00;
    font-size: 17pt;
    letter-spacing: -.03em;
  }

  body.report-printing .report-print-brand span,
  body.report-printing .report-print-heading time {
    color: #666;
    font-size: 8pt;
  }

  body.report-printing .report-print-heading h1 {
    margin: 0 0 1mm;
    font-size: 18pt;
  }

  body.report-printing .report-print-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2mm 5mm;
    margin: 4mm 0 0;
  }

  body.report-printing .report-print-filters > div {
    display: grid;
    min-width: 0;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2mm;
    font-size: 8pt;
  }

  body.report-printing .report-print-filters dt {
    color: #6b6b6b;
    font-weight: 700;
  }

  body.report-printing .report-print-filters dd {
    min-width: 0;
    overflow-wrap: anywhere;
    margin: 0;
    color: #202020;
    font-weight: 800;
  }

  body.report-printing .report-print-note {
    margin: 3mm 0 0;
    color: #666;
    font-size: 7.5pt;
  }

  body.report-printing .ledger-summary-grid,
  body.report-printing .nutrition-metrics {
    break-inside: avoid;
    border: 1px solid #d9d9d9;
    gap: 0;
  }

  body.report-printing .ledger-summary-card,
  body.report-printing .nutrition-metric {
    min-height: 0;
    border-right: 1px solid #d9d9d9;
    padding: 3mm;
  }

  body.report-printing .ledger-summary-card strong,
  body.report-printing .nutrition-metric strong {
    font-size: 13pt;
  }

  body.report-printing .ledger-report-context {
    padding: 2.5mm 0;
    background: transparent;
    font-size: 8pt;
  }

  body.report-printing .ledger-report-warning {
    border: 1px solid #d8c39c;
    padding: 2.5mm;
    font-size: 8pt;
    break-inside: avoid;
  }

  body.report-printing .ledger-report-body,
  body.report-printing .trial-balance-report-body,
  body.report-printing .recent-activity-results {
    display: block;
    min-height: 0;
    overflow: visible;
    padding: 4mm 0 0;
    background: #fff;
  }

  body.report-printing .ledger-account-card,
  body.report-printing .nutrition-report-section,
  body.report-printing .recent-activity-item,
  body.report-printing .recent-activity-card {
    break-inside: avoid;
    box-shadow: none;
  }

  body.report-printing .ledger-account-card {
    margin-bottom: 4mm;
    border-radius: 0;
  }

  body.report-printing .ledger-account-head {
    min-height: 0;
    padding: 2.5mm 3mm;
  }

  body.report-printing .ledger-table-scroll,
  body.report-printing .trial-balance-table-scroll {
    overflow: visible;
    border-radius: 0;
  }

  body.report-printing .ledger-table,
  body.report-printing .stock-ledger-table,
  body.report-printing .trial-balance-table {
    width: 100%;
    min-width: 0;
    font-size: 7pt;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body.report-printing .ledger-table th,
  body.report-printing .ledger-table td {
    height: auto;
    padding: 1.5mm 1.8mm;
    overflow-wrap: anywhere;
  }

  body.report-printing .ledger-table th {
    font-size: 6.5pt;
  }

  body.report-printing .trial-balance-account {
    padding-left: calc(var(--trial-balance-depth, 0) * 2mm);
  }

  body.report-printing .trial-balance-account > strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  body.report-printing .nutrition-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.report-printing .nutrition-report-section {
    padding: 5mm 0 0;
  }

  body.report-printing .nutrition-report-section > header {
    margin-bottom: 2mm;
  }

  body.report-printing .recent-activity-timeline {
    width: 100%;
    gap: 3mm;
  }

  body.report-printing .recent-activity-card,
  body.report-printing .recent-activity-metadata {
    border-radius: 0;
  }

  body.report-printing .recent-activity-card > header {
    min-height: 0;
    padding: 2.5mm 3mm;
  }

  body.report-printing .recent-activity-details > summary {
    display: none;
  }

  body.report-printing .recent-activity-detail-body {
    display: grid !important;
    padding: 0 3mm 3mm;
  }

  body.report-printing .recent-activity-marker {
    border-color: #fff;
  }

  body.report-printing a[href]::after {
    content: none !important;
  }
}

/* Shared provider settings, with contained controls on narrow screens. */
.messaging-settings-area { min-height: calc(100vh - var(--topbar-height)); padding: 15px; background: #fff; }
.messaging-intro h2 { margin: 0 0 8px; font-size: 20px; }
.messaging-intro p { margin: 0; line-height: 1.65; color: var(--muted); }
.messaging-settings-form fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
.messaging-settings-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 18px 20px; align-items: start; }
.messaging-settings-fields .field { min-width: 0; align-self: start; }
.messaging-settings-fields input:not([type="checkbox"]), .messaging-settings-fields select { height: var(--control-height); }
.messaging-remove { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.messaging-remove input { width: auto; margin: 0; }
@media (max-width: 680px) {
  .messaging-settings-fields { grid-template-columns: minmax(0, 1fr); padding: 15px; }
  .messaging-settings-area { padding: 10px; }
}

/* Customer-app receipt detail uses the shared record dialog and body scrolling. */
.sales-order-details { display: grid; gap: 24px; }
.sales-order-details h3 { margin: 0 0 12px; font-size: 15px; }
.sales-order-details p { margin: 10px 0 0; line-height: 1.7; overflow-wrap: anywhere; }
.sales-order-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sales-order-fact { display: grid; align-content: start; gap: 5px; overflow-wrap: anywhere; }
.sales-order-fact > span, .sales-order-item-meta { color: var(--muted); font-size: 12px; }
.sales-order-items { display: grid; gap: 10px; }
.sales-order-item { border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: grid; gap: 7px; overflow-wrap: anywhere; font-size: 13px; }
.sales-order-item-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sales-order-totals { display: grid; gap: 12px; }
.sales-order-totals > div { display: flex; justify-content: space-between; gap: 12px; }
@media (max-width: 480px) { .sales-order-facts { grid-template-columns: 1fr; } }

.profit-loss-note { text-align: center; }
.profit-loss-note a { color: var(--accent); text-decoration: underline; }
.profit-loss-notes, .profit-loss-eps, .profit-loss-formulas { padding: 18px 20px; }
.profit-loss-notes h2, .profit-loss-eps h2, .profit-loss-formulas h2 { font-size: 1rem; margin: 0 0 16px; }
.profit-loss-note-details { border-bottom: 1px solid var(--line); padding: 12px 0; scroll-margin-top: 12px; }
.profit-loss-note-details summary { cursor: pointer; font-weight: 700; }
.profit-loss-note-details p, .profit-loss-eps p { color: var(--muted); line-height: 1.6; }
.ledger-table.profit-loss-detail-table { min-width: 600px; table-layout: fixed; margin-top: 12px; }
.profit-loss-detail-table th:first-child { width: 50%; }
.profit-loss-detail-table tbody th { text-transform: none; white-space: normal; font-weight: 400; background: white; }
.profit-loss-detail-table tbody th > small { margin-left: 12px; color: var(--muted); }
.profit-loss-formulas dl { margin: 0; display: grid; gap: 8px; }
.profit-loss-formulas dt { font-weight: 700; }
.profit-loss-formulas dd { margin: 0 0 8px; color: var(--muted); }
@media print {
  .profit-loss-note-details > * { display: block; }
  .profit-loss-note-details table { display: table; }
  .profit-loss-note-details summary { list-style: none; }
  .profit-loss-table thead th:nth-child(n+3) { width: 130px; }
}

.balance-sheet-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ledger-table.balance-sheet-table { min-width: 0; table-layout: fixed; }
.balance-sheet-table thead th:nth-child(2) { width: 155px; }
.balance-sheet-earnings { padding: 18px 20px; }
.balance-sheet-earnings p { color: var(--muted); line-height: 1.7; }
@media (max-width: 640px) {
  .balance-sheet-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .balance-sheet-summary-grid .ledger-summary-card:last-child { grid-column: 1 / -1; }
  .balance-sheet-table thead th:nth-child(2) { width: 125px; }
}

.cash-flow-area .trial-balance-report-body { flex-direction: column; }
.cash-flow-table tbody th { overflow-wrap: anywhere; }

.equity-changes-area .trial-balance-report-body { flex-direction: column; }
.ledger-table.equity-changes-table { min-width: 1140px; table-layout: fixed; }
.equity-changes-table thead th:first-child { width: 240px; }
.equity-changes-table thead th:nth-child(n+2) { width: auto; white-space: normal; }
.equity-changes-table th { overflow-wrap: anywhere; }
.equity-changes-table .equity-row-total { font-weight: 800; }
.equity-scroll-hint { display: none; }
@media (max-width: 680px) {
  .equity-scroll-hint { display: block; margin: 0; padding: 10px 15px; color: var(--muted); font-size: 12px; }
  .ledger-table.equity-changes-table { min-width: 1130px; }
  .equity-changes-table thead th:first-child { width: 200px; }
  .equity-changes-table tbody th, .equity-changes-table thead th:first-child { position: sticky; left: 0; z-index: 1; background: #fff; }
  .equity-changes-table .profit-loss-subtotal th { background: #f8f8f8; }
  .equity-changes-table .is-final th { background: #fff3ed; }
}
@media print {
  body.report-printing .equity-changes-table { table-layout: fixed; }
  body.report-printing .equity-changes-table thead th:first-child { width: 24%; }
  body.report-printing .equity-changes-table th { position: static; }
  body.report-printing .equity-scroll-hint { display: none; }
}
#resource-area.equity-changes-area.is-empty-trial-balance { display: flex; flex-direction: column; height: calc(100dvh - var(--topbar-height)); min-height: 0; overflow: hidden; }
.equity-changes-area.is-empty-trial-balance .trial-balance-filters { flex: 0 0 auto; }
.equity-changes-area.is-empty-trial-balance .ledger-summary-grid,
.equity-changes-area.is-empty-trial-balance .ledger-report-context,
.equity-changes-area.is-empty-trial-balance .profit-loss-classification { display: none; }
.equity-changes-area.is-empty-trial-balance .trial-balance-report-body { min-height: 0; flex: 1 1 0; }
.equity-changes-area.is-empty-trial-balance .ledger-empty-state { min-height: 0; }

/* Journal Entry Audit Trail shares the authorized history and report surfaces. */
.journal-audit-filters { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; padding:15px; border-bottom:1px solid var(--line); }
.journal-audit-filters input { width:100%; min-width:0; height:var(--control-height); }
.journal-audit-filters .ledger-filter-actions { grid-column:span 3; justify-content:flex-end; }
.journal-audit-timeline { width:min(1100px,100%); list-style:none; padding:0; margin:0; display:grid; gap:15px; }
.journal-audit-item { min-width:0; }
.journal-audit-status { font-size:12px; font-weight:400; border:1px solid #dedede; padding:3px 8px; border-radius:4px; }
.journal-audit-metadata { margin:12px 15px; grid-template-columns:repeat(4,minmax(0,1fr)); }
.journal-audit-note { margin:0; padding:0 15px 12px; font-size:12px; color:#666; }
.journal-audit-area.is-empty-activity { display:flex; flex-direction:column; height:calc(100dvh - var(--topbar-height)); min-height:0; }
.journal-audit-area.is-empty-activity .ledger-summary-grid, .journal-audit-area.is-empty-activity .journal-audit-note { display:none; }
.journal-audit-area.is-empty-activity .journal-audit-filters, .journal-audit-area.is-empty-activity .recent-activity-footer { flex:0 0 auto; }
.journal-audit-area.is-empty-activity .recent-activity-results { display:flex; flex:1; min-height:0; }
.journal-audit-area.is-empty-activity .ledger-empty-state { flex:1; min-height:0; }
@media(max-width:680px) {
 .journal-audit-filters { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
 .journal-audit-filters .journal-audit-search, .journal-audit-filters .ledger-filter-actions { grid-column:1/-1; }
 .journal-audit-metadata { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .journal-audit-area .recent-activity-card header { flex-wrap:wrap; }
 .journal-audit-area .recent-activity-card header > div { min-width:0; }
}
@media print {
 .journal-audit-filters, .journal-audit-area .recent-activity-footer { display:none !important; }
 .journal-audit-area.is-empty-activity { height:auto !important; }
 .journal-audit-timeline { padding:0; }
 .journal-audit-item { break-inside:avoid; }
}

#resource-area.journal-audit-area { background:var(--white); }

.journal-audit-area .recent-activity-footer > div { flex:0 0 auto; justify-content:flex-start; }
.journal-audit-area .recent-activity-footer > div > span { white-space:nowrap; }
.journal-audit-area .recent-activity-footer .select2-container { width:88px !important; flex:0 0 88px; }
@media(max-width:680px) { .journal-audit-filters .ledger-filter-actions > button:last-child { grid-column:1/-1; } }

@media print {
 body.report-printing .journal-audit-note { display:none; }
 body.report-printing .journal-audit-item, body.report-printing .journal-audit-area .recent-activity-card { break-inside:auto; }
 body.report-printing .journal-audit-area .history-change-row { break-inside:avoid; }
 body.report-printing .journal-audit-area .recent-activity-metadata > div { padding:1.5mm 2mm; }
}

/* Accounts Receivable: contained tables and shared report / modal contracts. */
#resource-area.ar-area { background:var(--white); }
.ar-filters { grid-template-columns:repeat(4,minmax(140px,1fr)); }
.ar-table-scroll { overflow:auto; max-height:60vh; }
.ar-table { min-width:1150px; }
.ar-table th,.ar-table td { white-space:nowrap; }
.ar-aging { display:grid; grid-template-columns:repeat(5,minmax(110px,1fr)); gap:12px; margin:0 0 18px; }
.ar-aging > div { padding:14px; border:1px solid var(--border); border-radius:8px; display:flex; flex-direction:column; gap:6px; }
.ar-aging span { font-size:12px; color:var(--muted); }
.ar-allocation-actions { display:flex; justify-content:flex-end; gap:10px; margin:14px 0; }
[data-invoice-allocations] { min-width:0; }
[data-invoice-allocations] .journal-lines-scroll { max-width:100%; overflow:auto; }
[data-invoice-allocations] table { min-width:650px; }
[data-invoice-allocations] th:first-child { width:65%; }
.ar-area .recent-activity-footer > div { justify-content:flex-start; flex:0 0 auto; }
.ar-area .recent-activity-footer .select2-container { width:88px !important; flex:0 0 88px; }
.ar-area.is-empty-ar { display:flex; flex-direction:column; height:calc(100dvh - var(--topbar-height,72px)); min-height:0; overflow:hidden; }
.ar-area.is-empty-ar .ar-summary,.ar-area.is-empty-ar .ar-basis,.ar-area.is-empty-ar .ar-aging { display:none; }
.ar-area.is-empty-ar .ar-filters,.ar-area.is-empty-ar .recent-activity-footer { flex:0 0 auto; }
.ar-area.is-empty-ar .recent-activity-results { display:flex; flex:1; min-height:0; }
.ar-area.is-empty-ar .ledger-empty-state { flex:1; min-height:0; }
@media(max-width:700px) {
 .ar-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .ar-aging { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .ar-area .recent-activity-footer { gap:10px; }
 .ar-allocation-actions { flex-wrap:wrap; }
}
@media print {
 .ar-filters,.ar-area .recent-activity-footer { display:none !important; }
 .ar-table-scroll { max-height:none; overflow:visible; }
 .ar-table { min-width:0; width:100%; font-size:8pt; }
 .ar-table th,.ar-table td { white-space:normal; padding:2mm; }
 .ar-area.is-empty-ar { height:auto !important; }
}
@media print {
 .ar-area .recent-activity-results { display:block; padding:3mm 0; }
 .ar-area .ar-basis { padding:2mm 0; }
 .ar-area .ar-basis p { font-size:9pt; line-height:1.35; margin:2mm 0; }
 .ar-area .ar-basis p:first-of-type { display:none; }
 .ar-area .ar-aging { gap:2mm; margin:2mm 0; }
 .ar-area .ar-aging > div { padding:2mm; }
}

.meal-plan-section { min-width: 0; max-width: 100%; margin-top: 22px; }
.meal-plan-section h3 { margin: 24px 0 10px; }
.meal-plan-section p { color: var(--muted); line-height: 1.5; }
.meal-plan-summary { border-collapse: collapse; width: min(100%, 430px); }
.meal-plan-summary th, .meal-plan-summary td { padding: 8px 12px; border: 1px solid var(--line); text-align: left; }
.meal-plan-grid-scroll { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.meal-plan-grid { min-width: 1500px; width: 100%; border-collapse: collapse; font-size: 13px; }
.meal-plan-grid th, .meal-plan-grid td { padding: 7px; border: 1px solid var(--line); text-align: left; vertical-align: top; white-space: nowrap; }
.meal-plan-grid th { background: #f8f8f8; }
.meal-plan-grid td { vertical-align: middle; }
.meal-plan-grid .meal-plan-control {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: 38px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--white);
  font: inherit;
  font-size: var(--font-table);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.meal-plan-grid .meal-plan-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245, 76, 0, .12); outline: none; }
.meal-plan-grid .meal-plan-control--time { width: 130px; }
.meal-plan-grid .meal-plan-control--tier { width: 180px; }
.meal-plan-grid .meal-plan-control--item { width: 240px; }
.meal-plan-grid .meal-plan-control--quantity { width: 82px; font-variant-numeric: tabular-nums; }
.meal-plan-grid .meal-plan-control--side { width: 200px; }
.meal-plan-side-label { display: grid; gap: 4px; margin-bottom: 7px; }
.meal-plan-side-label:last-child { margin-bottom: 0; }
.meal-plan-side-label span { color: var(--muted); font-size: var(--font-caption); font-weight: 600; }
.meal-plan-grid tfoot th { background: #fff4ee; }
.meal-plan-add { display: flex; justify-content: flex-end; margin-top: 12px; }

/* The subscription wizard stays inside the shared record-modal/body/footer contract. */
.subscription-wizard { display:grid; gap:18px; min-width:0; }
.subscription-wizard [hidden] { display:none !important; }
.subscription-wizard-steps { display:flex; gap:10px; position:sticky; top:0; background:#fff; padding:10px 0; z-index:2; }
.subscription-wizard-steps button { width:40px; height:40px; border:1px solid #ddd; border-radius:50%; background:#fff; color:#333; cursor:pointer; }
.subscription-wizard-steps button[aria-current="step"] { background:#f54c00; color:#fff; border-color:#f54c00; }
.subscription-wizard h3 { margin:18px 0 12px; }
.subscription-radio-options { display:flex; gap:24px; flex-wrap:wrap; margin-bottom:18px; }
.subscription-radio-options label { display:flex; align-items:center; gap:8px; min-height:44px; }
.subscription-duration-control { display:flex; align-items:center; gap:12px; max-width:260px; margin:12px 0 24px; }
.subscription-duration-control input { min-width:0; width:100%; height:var(--control-height); text-align:center; }
.subscription-weekday-times { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 24px; }
.subscription-weekday-times > div { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.subscription-weekday-times label { display:flex; align-items:center; gap:8px; }
.subscription-weekday-times input[type="time"] { height:var(--control-height); width:135px; }
.subscription-meal-groups { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.subscription-meal-group { padding:16px; border:1px solid #e4e4e4; border-radius:16px; }
.subscription-meal-group h3 { margin:0 0 12px; }
.subscription-meal-choice { display:flex; align-items:center; gap:12px; margin:8px 0; }
.subscription-meal-choice > span { flex:1; }
.subscription-meal-choice button { min-width:40px; min-height:40px; padding:6px; }
.subscription-meal-choice output { min-width:24px; text-align:center; }
.subscription-credit-table { overflow-x:auto; margin-bottom:20px; }
.subscription-credit-table table { width:100%; border-collapse:collapse; }
.subscription-credit-table th,.subscription-credit-table td { padding:12px; border-bottom:1px solid #eee; text-align:left; }
.subscription-wizard-totals { display:grid; grid-template-columns:1fr auto; gap:16px; padding:20px; background:#f7f7f7; border-radius:16px; }
.subscription-wizard-totals dd { margin:0; }
@media (max-width:640px) { .subscription-weekday-times,.subscription-meal-groups { grid-template-columns:1fr; } .subscription-wizard-steps { justify-content:space-between; gap:6px; } }
.subscription-wizard input[type="checkbox"], .subscription-wizard input[type="radio"] { accent-color:#f54c00; }

.nutrition-package-options { margin-top: 20px; }
.nutrition-package-options > summary { cursor: pointer; font-weight: 700; }
.nutrition-package-options > .form-grid { margin-top: 16px; }

/* Client visits share the normal resource toolbar and record modal contracts. */
#resource-area.is-visits-calendar { display: flex; flex-direction: column; height: calc(100dvh - var(--topbar-height)); max-height: calc(100dvh - var(--topbar-height)); flex: 0 0 calc(100dvh - var(--topbar-height)); min-height: 0; padding-bottom: 0; overflow: hidden; }
.is-visits-calendar .table-toolbar { flex: 0 0 auto; }
.visit-view-switch { display: inline-flex; gap: 4px; }
.visit-view-switch .is-active { color: var(--primary, #f54c00); border-color: #f54c00; background: #fff4ef; }
.visits-month-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; flex: 0 0 auto; }
.visits-month-bar > div { display: flex; gap: 6px; }
.visits-month-bar h2 { margin: 0; font-size: 20px; }
.visits-month-bar input { height: var(--control-height); max-width: 170px; border: 1px solid #ddd; border-radius: 8px; padding: 6px 10px; background: #fff; font: inherit; }
.visits-calendar-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.visits-weekdays, .visits-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.visits-weekdays { position: sticky; top: 0; z-index: 1; background: #fff; border: 1px solid #e6e6e6; }
.visits-weekdays span { padding: 10px 4px; text-align: center; font-size: 12px; font-weight: 700; }
.visits-month-grid { border-left: 1px solid #e6e6e6; }
.visits-day { min-width: 0; min-height: 110px; padding: 5px; border-right: 1px solid #e6e6e6; border-bottom: 1px solid #e6e6e6; background: #fff; }
.visits-day.is-outside { background: #fafafa; color: #777; }
.visits-day.is-selected { box-shadow: inset 0 0 0 2px #f54c00; }
.visits-day-number { display: flex; justify-content: space-between; align-items: center; gap: 4px; width: 100%; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 700; text-align: left; cursor: pointer; padding: 5px; border-radius: 5px; }
.is-today .visits-day-number { color: #f54c00; }
.visits-day-count { font-size: 11px; color: #777; }
.visit-card { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 8px; margin: 4px 0; border: 1px solid #e3e3e3; border-left: 3px solid #f54c00; border-radius: 6px; background: #fff4ef; color: #222; font: inherit; text-align: left; overflow-wrap: anywhere; }
button.visit-card { cursor: pointer; }
.visit-card strong { font-size: 12px; }
.visit-card span { font-size: 12px; }
.visit-card small { font-size: 10px; text-transform: capitalize; color: #666; }
.visit-completed { background: #f5faf6; border-left-color: #47734c; }
.visit-cancelled, .visit-no_show { background: #f5f5f5; border-left-color: #888; color: #777; }
.visits-agenda { padding: 16px 0; }
.visits-agenda-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.visits-agenda-heading h3 { font-size: 16px; margin: 0 0 8px; }
.visits-agenda .visit-card strong, .visits-agenda .visit-card span { font-size: 14px; }
@media (max-width: 700px) {
  .is-visits-calendar .table-toolbar { flex-wrap: wrap; }
  .is-visits-calendar .table-toolbar-actions { flex-wrap: wrap; }
  .visits-month-bar { flex-wrap: wrap; gap: 8px; }
  .visits-month-bar h2 { font-size: 17px; order: -1; width: 100%; }
  .visits-month-bar input { max-width: 145px; min-width: 0; }
  .visits-day { min-height: 58px; padding: 2px; }
  .visits-day-number { flex-direction: column; padding: 4px 0; font-size: 13px; }
  .visits-day-cards { display: none; }
  .visits-weekdays span { padding: 8px 1px; font-size: 11px; }
}

/* Blog descriptions use a contained Word-style toolbar and writing surface. */
.article-rich-text { min-width: 0; width: 100%; }
.article-rich-text .ql-toolbar.ql-snow { border: 1px solid var(--line); border-radius: 8px 8px 0 0; background: #f7f7f7; padding: 8px; font-family: inherit; }
.article-rich-text .ql-container.ql-snow { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; background: #fff; font-family: inherit; font-size: 16px; height: auto; }
.article-rich-text .ql-editor { min-height: 300px; overflow-wrap: anywhere; padding: 18px; line-height: 1.8; }
.article-rich-text .ql-toolbar button { min-width: 30px; height: 30px; border-radius: 4px; }
.article-rich-text .ql-toolbar button:hover, .article-rich-text .ql-toolbar button:focus-visible { background: #fff; }
.article-rich-text .ql-snow .ql-picker.ql-expanded .ql-picker-options { z-index: 6; }
.article-rich-text .ql-snow .ql-tooltip { left: 8px !important; max-width: calc(100% - 16px); white-space: normal; }
.article-rich-text .ql-toolbar .ql-formats { margin-right: 10px; margin-bottom: 4px; }
.article-rich-text .ql-snow .ql-stroke { stroke: #383838; }
.article-rich-text .ql-snow .ql-fill { fill: #383838; }
.article-rich-text .ql-toolbar .ql-active .ql-stroke { stroke: #f54c00; }
@media (max-width: 600px) { .article-rich-text .ql-editor { min-height: 240px; padding: 12px; } .article-rich-text .ql-toolbar .ql-formats { margin-right: 6px; } }

.article-rich-text .ql-snow .ql-picker-label:hover, .article-rich-text .ql-snow .ql-picker-label.ql-active, .article-rich-text .ql-snow .ql-picker-item:hover, .article-rich-text .ql-snow .ql-picker-item.ql-selected { color: var(--accent); }
.article-rich-text .ql-snow button.ql-active .ql-stroke, .article-rich-text .ql-snow button:hover .ql-stroke, .article-rich-text .ql-snow .ql-picker-label:hover .ql-stroke { stroke: var(--accent); }
.article-rich-text .ql-snow button.ql-active .ql-fill, .article-rich-text .ql-snow button:hover .ql-fill { fill: var(--accent); }

.article-ai-tools { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--soft); }
.article-ai-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.article-ai-actions > span { flex: 1 1 240px; font-size: var(--font-subheadline); }
.article-ai-tools [data-article-ai-status] { display: block; margin-top: 8px; line-height: 1.6; overflow-wrap: anywhere; }
.article-ai-tools .spinner { width: 15px; height: 15px; }
.article-ai-tools button[hidden] { display: none; }

.article-title-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.article-rich-text-arabic .ql-editor { text-align: right; direction: rtl; }
@media (max-width: 600px) { .article-title-grid { grid-template-columns: minmax(0, 1fr); } }
