/* المدار الذكي — داكن. Last screen layer after the ERP's legacy overrides.
   The preset is opt-in; typography, layout and business behavior stay unchanged. */
@media screen {
  html[data-v19-preset="smart-future"] body.ui-v19 {
    --future-accent:#24e1ce;
    --future-blue:#1679fa;
    --future-action:#1167d8;
    --future-control-line:#55799b;
    --future-raised:#102b4e;
    --future-shadow:0 12px 28px -18px rgba(0,0,0,.7);
    --danger:#ff9ca8;
    --danger-tint:#402437;
    color:var(--v19-text)!important;
    background:var(--v19-paper)!important;
    color-scheme:dark;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 :is(#appScreen,#launcherScreen,#launcherGroupScreen,#posScreen),
  html[data-v19-preset="smart-future"] body.ui-v19 #appScreen :where(.main,.page,.settings-content,.settings-tab-panel) {
    color:var(--v19-text)!important;
    background:var(--v19-paper)!important;
    background-image:none!important;
  }
  /* Match the responsive bundle's ID-level white-surface guards without changing other themes. */
  html[data-v19-preset="smart-future"] body.ui-v19[data-v19-style] #appScreen .main,
  html[data-v19-preset="smart-future"] body.ui-v19[data-v19-style] #appScreen .page,
  html[data-v19-preset="smart-future"] body.ui-v19[data-v19-style] #appScreen .settings-content,
  html[data-v19-preset="smart-future"] body.ui-v19[data-v19-style] #appScreen :where(.v197-workspace-viewport,.v192-open-screens) {
    color:var(--v19-text)!important;background:var(--v19-paper)!important;background-image:none!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19[data-v19-style] #appScreen :where(
    .settings-card,.dash-card,.kpi-card,.dashboard-widget,.card,.table-wrap,.modal-box,
    .role-sidebar,.settings-sidebar,.v19-theme-studio,.v19-custom-editor,.v201-curated-themes,
    .v19-display-preferences-panel,.v19-theme-effect-controls,.settings-hint,.report-toolbar,
    .report-tab-strip,.report-result-panel,.scope-row,.perm-category,.permission-diagnostics
  ) {
    color:var(--v19-text)!important;background:var(--v19-surface)!important;background-image:none!important;
    border-color:var(--v19-line)!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19[data-v19-style] #appScreen :where(.topbar,.page-head,.oil-page-head,.v19-theme-hero,.settings-cat-label),
  html[data-v19-preset="smart-future"] body.ui-v19[data-v19-style] #appScreen .report-screen > :where(.page-head,.oil-page-head) {
    color:var(--v19-text)!important;background:var(--future-raised)!important;background-image:none!important;
    border-color:var(--v19-line)!important;
  }
  /* The preference is retained for returning to a light preset, but is not applicable here. */
  html[data-v19-preset="smart-future"] body.ui-v19 .v253-light-colors-setting { display:none!important; }
  html[data-v19-preset="smart-future"] body.ui-v19 :where(
    .card,.dash-card,.kpi-card,.dashboard-widget,.settings-card,.table-wrap,.table-scroll,.data-table-wrap,
    .filter-card,.filter-panel,.toolbar,.form-section,.settings-sidebar,.role-sidebar,.pos-products,.pos-cart,
    .launcher-card,.smart-kpi,.smart-hub-panel,.smart-future-card,.smart-insight,.smart-vertical-card,
    .smart-forecast,.smart-proactive-note,.smart-draft,.smart-automation-row,.smart-command-result,
    .v19-theme-studio,.v19-theme-panel,.v19-display-preferences,.v19-help-card,.v201-preset-card,
    .si-lines-shell,.si-meta-grid,.si-footer-main,.si-totals,.to-section-block,.rpos-cart-line
  ) {
    color:var(--v19-text)!important;
    background:var(--v19-surface)!important;
    background-image:none!important;
    border-color:var(--v19-line)!important;
    box-shadow:var(--future-shadow)!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 :where(
    .topbar,.page-head,.page > header,.pos-topbar,.report-center-topbar,.oil-page-head,
    .dashboard-widget-head,.settings-card-head,.settings-cat-label,.v19-theme-hero,
    .modal-header,.modal-actions,.fs-sticky-header,.fs-sticky-footer,.si-workspace-header,.si-workspace-footer
  ) {
    color:var(--v19-text)!important;
    background:var(--future-raised)!important;
    background-image:none!important;
    border-color:var(--v19-line)!important;
    text-shadow:none!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 #appScreen #mainSidebar,
  html[data-v19-preset="smart-future"] body.ui-v19 #appScreen #mainSidebar :where(.sidebar-head,.sidebar-foot) {
    color:var(--v19-text)!important;
    background:var(--v19-surface)!important;
    background-image:none!important;
    border-color:var(--v19-line)!important;
    box-shadow:none!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 #appScreen #mainSidebar #navMenu > .nav-group-label {
    color:var(--v19-text)!important;
    -webkit-text-fill-color:currentColor!important;
    background:var(--future-raised)!important;
    background-image:none!important;
    border-color:var(--v19-line)!important;
    box-shadow:none!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 #appScreen #mainSidebar .nav-item {
    color:var(--v19-soft-text)!important;
    background:transparent!important;
    border-color:transparent!important;
    box-shadow:none!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 #appScreen #mainSidebar .nav-item:hover,
  html[data-v19-preset="smart-future"] body.ui-v19 #appScreen #mainSidebar .nav-item.active,
  html[data-v19-preset="smart-future"] body.ui-v19 #appScreen #mainSidebar .nav-item-pinned {
    color:var(--future-accent)!important;
    -webkit-text-fill-color:currentColor!important;
    background:var(--future-raised)!important;
    border-color:var(--future-accent)!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 #appScreen #mainSidebar :where(.nav-item,.nav-group-label) :where(i,span,strong,.nav-icon,.nav-label,.glabel-icon,.v194-svg-icon),
  html[data-v19-preset="smart-future"] body.ui-v19 #appScreen #mainSidebar .nav-item.active :where(span,strong,i,.nav-label,.nav-icon,.v194-svg-icon) {
    color:inherit!important;
    -webkit-text-fill-color:inherit!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 :is(#appScreen,#posScreen,#launcherScreen,#launcherGroupScreen,.modal-overlay) :where(h1,h2,h3,h4,h5,h6,label,legend,.company,.uname,.page-title,.kpi-value,.smart-kpi-value,.launcher-title) {
    color:var(--v19-text)!important;
    -webkit-text-fill-color:currentColor!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 :is(#appScreen,#posScreen,#launcherScreen,#launcherGroupScreen,.modal-overlay) :where(.sub,.muted,small,.subtitle,.page-subtitle,.settings-field-help,.kpi-label,.smart-kpi-label,.launcher-desc,.uemail,.company-en,.dashboard-widget-sub) {
    color:var(--v19-soft-text)!important;
    -webkit-text-fill-color:currentColor!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 :is(#appScreen,#posScreen,.modal-overlay) a:not(.btn-primary) {
    color:var(--future-accent)!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 :where(
    .btn-ghost,button.secondary,.launcher-back-btn,.settings-tab,.pm-tab,.role-btn,.report-tab,
    .mod-report-tab,.dash-period-btn,.scope-toggle button,.pos-cat-tab,.v192-screen-tab,
    .branch-chip,.rpos-cat-pill,.rpos-type-btn,.rpos-choice-btn,.smart-question-chip,
    .smart-insight-dismiss,.rpos-qty-stepper button,.v196-shortcut-picker-button
  ) {
    color:var(--v19-text)!important;
    -webkit-text-fill-color:currentColor!important;
    background:var(--v19-surface)!important;
    background-image:none!important;
    border-color:var(--future-control-line)!important;
    text-shadow:none!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 :where(.btn-ghost,button.secondary,.launcher-card,.smart-question-chip,.v196-shortcut-picker-button):hover {
    color:var(--v19-text)!important;
    background:var(--future-raised)!important;
    border-color:var(--future-accent)!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 :is(
    .btn-primary,button.primary,.fs-toggle-btn,.pos-checkout-btn,.smart-insight-open,
    #settingsTabs .settings-tab.active,.settings-tab.active,.pm-tab.active,.role-btn.active,
    .report-tab.active,.mod-report-tab.active,.dash-period-btn.active,.scope-toggle button.active,
    .pos-cat-tab.active,.v192-screen-tab.active,.v192-screen-tab.active .v192-screen-open,
    .v192-screen-tab.active .v192-screen-close,.branch-chip.active,.rpos-cat-pill.active,
    .rpos-type-btn.active,.rpos-choice-btn.active,#launcherFloatingHome
  ) {
    color:#ffffff!important;
    -webkit-text-fill-color:#ffffff!important;
    background:var(--future-action)!important;
    background-image:none!important;
    border-color:var(--future-blue)!important;
    text-shadow:none!important;
    box-shadow:var(--future-shadow)!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 :is(.btn-primary,button.primary,.pos-checkout-btn,.smart-insight-open):hover {
    background:#0d59bf!important;
    border-color:var(--future-accent)!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 :where(button,.btn-primary,.btn-ghost) :where(i,span,strong) {
    color:inherit!important;
    -webkit-text-fill-color:inherit!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 :where(.btn-danger,.danger-btn) {
    color:#ffffff!important;
    -webkit-text-fill-color:#ffffff!important;
    background:#a52e49!important;
    border-color:#ff9ca8!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 :is(#appScreen,#posScreen,.modal-overlay) :where(input,select,textarea,option,optgroup) {
    color:var(--v19-text)!important;
    -webkit-text-fill-color:currentColor!important;
    background-color:var(--v19-surface)!important;
    border-color:var(--future-control-line)!important;
    color-scheme:dark;
    caret-color:var(--future-accent);
  }
  html[data-v19-preset="smart-future"] body.ui-v19 :where(input,textarea)::placeholder { color:var(--v19-soft-text)!important; opacity:1; }
  html[data-v19-preset="smart-future"] body.ui-v19 :where(input,select,textarea)[readonly],
  html[data-v19-preset="smart-future"] body.ui-v19 :where(input,select,textarea):disabled {
    color:var(--v19-soft-text)!important;
    background-color:var(--future-raised)!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 :where(input[type="checkbox"],input[type="radio"]) { accent-color:var(--future-action); }
  html[data-v19-preset="smart-future"] body.ui-v19 :where(button,a,input,select,textarea,[tabindex]):focus-visible {
    outline:3px solid var(--future-accent)!important;
    outline-offset:3px;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 .modal-overlay {
    background:rgba(2,8,22,.78)!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 .modal-overlay > :where(.modal-box,.fullscreen-modal,.si-workspace),
  html[data-v19-preset="smart-future"] body.ui-v19 :where(
    .product-modal-box,.quick-search-results,.searchable-select-list,.searchable-select-dropdown,.searchable-select-menu,
    .searchable-select-options,.searchable-select-results,.dropdown-menu,.context-menu,
    .autocomplete-results,.autocomplete-dropdown,.select-dropdown,[role="listbox"],[role="menu"],
    .flatpickr-calendar,.flatpickr-months,.flatpickr-weekdays,.datepicker,.ui-datepicker
  ) {
    color:var(--v19-text)!important;
    background:var(--v19-surface)!important;
    background-image:none!important;
    border-color:var(--v19-line)!important;
    box-shadow:0 16px 42px rgba(0,0,0,.55)!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 :where(
    .quick-search-item,.ss-item,.search-result-item,.searchable-select-option,.searchable-select-item,
    [role="option"],[role="menuitem"],.flatpickr-day,.flatpickr-weekday,.flatpickr-current-month
  ) {
    color:var(--v19-text)!important;
    background-color:var(--v19-surface)!important;
    border-color:var(--v19-line)!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 :where(.quick-search-item,.ss-item,.searchable-select-option,.searchable-select-item,[role="option"],[role="menuitem"],.flatpickr-day):is(:hover,.active,.ss-active,.selected,[aria-selected="true"]) {
    color:var(--future-accent)!important;
    background:var(--future-raised)!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 :is(#appScreen,#posScreen,.modal-overlay) :where(table,tbody,tr,td,th) {
    color:var(--v19-text)!important;
    border-color:var(--v19-line)!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 :is(#appScreen,#posScreen,.modal-overlay) table thead th {
    color:var(--v19-text)!important;
    -webkit-text-fill-color:currentColor!important;
    background:var(--future-raised)!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 :is(#appScreen,#posScreen,.modal-overlay) table tbody td { background:var(--v19-surface)!important; }
  html[data-v19-preset="smart-future"] body.ui-v19 :is(#appScreen,#posScreen,.modal-overlay) table tbody tr:nth-child(even) td { background:#0f294a!important; }
  html[data-v19-preset="smart-future"] body.ui-v19 :is(#appScreen,#posScreen,.modal-overlay) table tbody tr:hover td { background:#143858!important; }
  html[data-v19-preset="smart-future"] body.ui-v19 :where(.dash-trend-value,.dash-trend-label) { fill:var(--v19-soft-text)!important; }
  html[data-v19-preset="smart-future"] body.ui-v19 :where(.dash-trend-grid) { stroke:var(--v19-line)!important; }
  html[data-v19-preset="smart-future"] body.ui-v19 :where(.dash-trend-summary b,.dash-branch-overview b,.dash-branch-column-card b,.dash-branch-column-card strong,.rpos-item-name,.rpos-cart-line-name,.rpos-cart-line-total) { color:var(--v19-text)!important; }
  html[data-v19-preset="smart-future"] body.ui-v19 :where(.dash-branch-margin,.smart-kpi-trend,.rpos-item-price,.rpos-cart-line-price) { color:var(--future-accent)!important; }
  html[data-v19-preset="smart-future"] body.ui-v19 :where(.dash-branch-margin.negative,.dash-branch-overview .negative b,.dash-branch-column-card b.negative,.smart-kpi-trend.negative,.smart-error) { color:#ff9ca8!important; }
  html[data-v19-preset="smart-future"] body.ui-v19 .smart-error { background:#402437!important; border-color:#ff9ca8!important; }
  html[data-v19-preset="smart-future"] body.ui-v19 :where(.smart-command-ready,.smart-result-table,.smart-search-results,.smart-note-actions,.smart-draft) button {
    color:var(--v19-text)!important;background:var(--future-raised)!important;border-color:var(--v19-line)!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 :where(.smart-proactive-note p,.smart-forecast span,.smart-automation-row>span) { color:var(--v19-soft-text)!important; }
  html[data-v19-preset="smart-future"] body.ui-v19 :where(.smart-vertical-card strong,.smart-forecast strong) { color:var(--future-accent)!important; }
  html[data-v19-preset="smart-future"] body.ui-v19 #page-restaurant-pos :where(.rpos-layout,.rpos-toprow,.rpos-item-card,.rpos-item-img-placeholder,.rpos-qty-stepper,.rpos-total-panel) {
    color:var(--v19-text)!important;
    background:var(--v19-surface)!important;
    border-color:var(--v19-line)!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 #page-restaurant-pos .rpos-total-grandrow {
    color:#ffffff!important;
    background:var(--future-action)!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 .v201-preset-card[data-preset-id="smart-future"].is-selected {
    border-color:var(--future-accent)!important;
    box-shadow:0 0 0 2px rgba(36,225,206,.3)!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 .v201-preset-copy :where(strong,small,em) {
    color:var(--v19-text)!important;-webkit-text-fill-color:currentColor!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 .v201-preset-title em {
    color:var(--v19-soft-text)!important;background:var(--future-raised)!important;border-color:var(--v19-line)!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 :where(.launcher-icon,.dashboard-title-icon,.v19-theme-hero-icon,.v19-help-card-icon) { color:var(--future-accent)!important; background:var(--future-raised)!important; }
  html[data-v19-preset="smart-future"] body.ui-v19 :where(#appScreen,#posScreen,.modal-overlay) * { scrollbar-color:#365777 #07152e; }

  /* The persisted preset reaches login too; the original logo artwork is unchanged. */
  html[data-v19-preset="smart-future"] body.ui-v19 #loginScreen {
    color:var(--v19-text)!important;background:var(--v19-paper)!important;color-scheme:dark;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 #loginScreen .login-form-panel {
    color:var(--v19-text)!important;background:var(--v19-paper)!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 #loginScreen .login-card {
    color:var(--v19-text)!important;background:var(--v19-surface)!important;border-color:var(--v19-line)!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 #loginScreen :where(h1,label) {
    color:var(--v19-text)!important;-webkit-text-fill-color:currentColor!important;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 #loginScreen :where(input,select,textarea,option,optgroup) {
    color:var(--v19-text)!important;-webkit-text-fill-color:currentColor!important;
    background:var(--v19-surface)!important;border-color:var(--future-control-line)!important;color-scheme:dark;
  }
  html[data-v19-preset="smart-future"] body.ui-v19 #loginScreen :where(.sub,small,.muted) { color:var(--v19-soft-text)!important; }
}

/* Print content must not inherit dark tokens, including on-screen print previews. */
html[data-v19-preset="smart-future"] :is(#printInvoiceArea,#printReportArea,#productsPriceMenuExportRoot,.screen-print-preview,.print-preview-page) {
  --v19-paper:#ffffff;--v19-surface:#ffffff;--v19-tint:#f8fafc;--v19-light:#f1f5f9;--v19-line:#cbd5e1;
  --v19-text:#111827;--v19-soft-text:#374151;--v19-dark:#ffffff;--v19-on-dark:#111827;
  --v19-on-paper:#111827;--v19-on-surface:#111827;--v19-on-light:#111827;--v19-on-tint:#111827;--future-raised:#f1f5f9;
  --paper:#ffffff;--surface:#ffffff;--surface-raised:#ffffff;--surface-muted:#f8fafc;
  --ink:#111827;--ink-soft:#374151;--ink-faint:#4b5563;--line:#cbd5e1;
  color:#111827!important;background-color:#ffffff!important;color-scheme:light;
}
html[data-v19-preset="smart-future"] body.ui-v19 :is(#printInvoiceArea,#printReportArea,#productsPriceMenuExportRoot,.screen-print-preview,.print-preview-page) table tbody tr:nth-child(n) td {
  color:#111827!important;background:#ffffff!important;border-color:#cbd5e1!important;
}
html[data-v19-preset="smart-future"] body.ui-v19 :is(#printInvoiceArea,#printReportArea,#productsPriceMenuExportRoot,.screen-print-preview,.print-preview-page) table thead th {
  color:#111827!important;-webkit-text-fill-color:#111827!important;background:#f1f5f9!important;border-color:#cbd5e1!important;
}
@media print {
  html[data-v19-preset="smart-future"],
  html[data-v19-preset="smart-future"] body.ui-v19 {
    --v19-paper:#ffffff!important;--v19-surface:#ffffff!important;--v19-tint:#f8fafc!important;
    --v19-light:#f1f5f9!important;--v19-line:#cbd5e1!important;--v19-text:#111827!important;
    --v19-soft-text:#374151!important;--v19-dark:#ffffff!important;--v19-on-dark:#111827!important;
    --v19-on-paper:#111827!important;--v19-on-surface:#111827!important;--v19-on-light:#111827!important;--v19-on-tint:#111827!important;
    --paper:#ffffff!important;--surface:#ffffff!important;--surface-raised:#ffffff!important;
    --ink:#111827!important;--ink-soft:#374151!important;--ink-faint:#4b5563!important;
    color:#111827!important;background:#ffffff!important;color-scheme:light!important;
  }
}
