/* Optional Graphite theme, based on the staff write-off workspace.
   Appearance only: layouts, touch targets, quantities, status colours and role
   permissions stay in their original components. All rules require opt-in. */
html[data-admin-theme="graphite"] {
  color-scheme: dark;
  --bg: #0c1015;
  --panel: #191e25;
  --panel-2: #202730;
  --panel-3: #29333f;
  --panel-solid: #191e25;
  --panel-soft: #202730;
  --card: #191e25;
  --surface: #191e25;
  --line: #343b46;
  --border: #343b46;
  --text: #f4f6fa;
  --muted: #acb5c1;
  --gold: #ff7d85;
  --gold-light: #ffadb3;
  --gold-soft: #ff7d8518;
  --ui-panel: #191e25;
  --ui-line: #343b46;
  --ui-line-strong: #697384;
  --ui-accent: #ff7d85;
  --shadow: 0 6px 24px #0002;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
html[data-admin-theme="graphite"] body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
html[data-admin-theme="graphite"] body::before { background: none; }
html[data-admin-theme="graphite"] :is(.login-page,.sidebar,.topbar,.admin-workspace-header,.admin-pos-nav,.integrated-invent-bridgebar) {
  background: #11161d;
  border-color: var(--line);
  color: var(--text);
  box-shadow: none;
}
html[data-admin-theme="graphite"] :is(.card,.login-card,.ticket,.queue-filter-panel,.queue-order-card,.pass-handoff-card,.owner-module-card,.owner-branch-card,.owner-quick-card,.owner-dashboard-card,.owner-network-branch,.inventory-card,.catalog-item-card,.temperature-card,.modal,.keeper-more-panel,.checkout-shell,.checkout-section,.cart-stage,.cart-stage-one,.menu-stage,.menu-panel,.menu-card,.menu-item,.owner-hub255>button,.owner-hub255>a) {
  background: var(--panel);
  color: var(--text);
  border-color: var(--line);
  box-shadow: 0 6px 24px #0002;
}
html[data-admin-theme="graphite"] :is(.modal,.login-card,.keeper-more-panel) { border-radius: 20px; }
html[data-admin-theme="graphite"] :is(.menu-card,.menu-item,.category-card,.menu-category-card,.menu-category-tile,.queue-order-card,.owner-network-branch,.owner-hub255>button,.owner-hub255>a) { border-radius: 14px; }
html[data-admin-theme="graphite"] :is(.category-card,.menu-category-card,.menu-category-tile,.cart-stage-footer,.checkout-footer,.ticket-meta,.queue-archive,.checkout-summary,.brand-mark) {
  background: var(--panel-2);
  border-color: var(--line);
}
html[data-admin-theme="graphite"] :is(input,select,textarea) {
  background: #11161d;
  border-color: #697384;
  color: var(--text);
  border-radius: 10px;
}
html[data-admin-theme="graphite"] :is(input,textarea)::placeholder { color: var(--muted); opacity: 1; }
html[data-admin-theme="graphite"] :is(button,input,select,textarea,a):focus-visible {
  outline: 2px solid #ff7d85;
  outline-offset: 3px;
}
html[data-admin-theme="graphite"] :is(.primary,.pin-key.primary) {
  background: #c74152;
  border-color: #ff7d85;
  color: #fff;
  box-shadow: none;
}
html[data-admin-theme="graphite"] :is(.secondary,.ghost,.pin-key:not(.primary),.queue-filter-chip) {
  background: var(--panel-2);
  border-color: var(--line);
  color: var(--text);
  box-shadow: none;
}
html[data-admin-theme="graphite"] :is(.nav-button.active,.queue-order-card.selected,.category-card.selected,.category-card.active,.menu-item.selected-in-cart) {
  background: #32232c;
  border-color: #ff7d85;
  color: #fff;
}
html[data-admin-theme="graphite"] :is(.owner-hub255>button,.owner-hub255>a,.menu-card,.menu-item,.category-card,.menu-category-tile):hover { border-color: #ff7d85; background: #202730; }
html[data-admin-theme="graphite"] :is(.eyebrow,.brand-mark,.cart-total strong,.owner-hub255>button:hover strong) { color: #ffadb3; }
html[data-admin-theme="graphite"] :is(.muted,.small-note,.field-note) { color: var(--muted); }
html[data-admin-theme="graphite"] :is(th,td) { border-color: var(--line); }
html[data-admin-theme="graphite"] th { background: #202730; color: #d5dce5; }

/* Invent loads its stylesheet on demand. Extra scope wins over its legacy
   embedded skin without changing dimensions or hiding report columns. */
html[data-admin-theme="graphite"] #integrated-invent-host :is(.page-card,.side-card,.hero-card,.restaurant-box,.module-tile,.modal-card,.data-item,.activity-item,.inside-topbar,.module-page-header,.placeholder-box) {
  background: #191e25 !important;
  border-color: #343b46 !important;
  color: #f4f6fa !important;
  box-shadow: none !important;
}
html[data-admin-theme="graphite"] #integrated-invent-host :is(.app-title,.inside-title,.module-title,.modal-title,.page-card h3,.side-card h3,.module-tile-title) { color: #f4f6fa !important; }
html[data-admin-theme="graphite"] #integrated-invent-host :is(.inside-label,.modal-label) { color: #ffadb3 !important; }
html[data-admin-theme="graphite"] #integrated-invent-host :is(.small-note,.inside-subtitle,.app-subtitle,.module-tile-text) { color: #acb5c1 !important; }
html[data-admin-theme="graphite"] #integrated-invent-host :is(input,select,textarea) { background: #11161d !important; color: #f4f6fa !important; border-color: #697384 !important; }
html[data-admin-theme="graphite"] #integrated-invent-host :is(.btn-dark,.tab-btn) { background: #202730 !important; color: #f4f6fa !important; border-color: #697384 !important; }
html[data-admin-theme="graphite"] #integrated-invent-host :is(.btn-gold,.tab-btn-active) { background: #32232c !important; color: #ffadb3 !important; border-color: #ff7d85 !important; box-shadow: none !important; }
html[data-admin-theme="graphite"] #integrated-invent-host .sheet-table th { background: #202730 !important; color: #d5dce5 !important; border-color: #343b46 !important; }
html[data-admin-theme="graphite"] #integrated-invent-host .sheet-table td { background: #191e25 !important; border-color: #343b46 !important; }
html[data-admin-theme="graphite"] #integrated-invent-host .sheet-table tr:hover td { background: #202730 !important; }
html[data-admin-theme="graphite"] #integrated-invent-host .save-status-global { background: #191e25; color: #f4f6fa; border-color: #343b46; }

/* Standalone pages opt in only after the theme is selected in the workplace. */
html[data-admin-theme="graphite"] body[data-lc-surface] :is(.panel,.metric,.delivery-card,.network-order,.network-courier,.network-map-section,.courier-modal,.owner-meal-dialog,.entry,.today-grid>div,.empty) {
  background: #191e25;
  border-color: #343b46;
  color: #f4f6fa;
  box-shadow: none;
}
html[data-admin-theme="graphite"] body[data-lc-surface] :is(.top,.courier-language,.courier-payment,.mixed-payment-rows label,.norm-auto-value) { background: #11161d; border-color: #343b46; color: #f4f6fa; }
html[data-admin-theme="graphite"] body[data-lc-surface="courier"] :is(.shift-card:not(.active),.pair-screen) { background: #191e25; border-color: #343b46; color: #f4f6fa; }
html[data-admin-theme="graphite"] body[data-lc-surface] :is(.muted,.entry small,.metric span,.metric small,.note span,.today-grid span,.courier-head p,label) { color: #acb5c1; }
html[data-admin-theme="graphite"] body[data-lc-surface] :is(.metric strong,.money,.meal-charge) { color: #f4f6fa; }
html[data-admin-theme="graphite"] body[data-lc-surface="meals"] button:not(.secondary):not(.negative),
html[data-admin-theme="graphite"] body[data-lc-surface="courier"] :is(.courier-main-action,.delivery-actions button:first-child,.route,button[data-shift-start],.pair-screen button[type="submit"]) { background: #c74152; color: #fff; border-color: #ff7d85; }
html[data-admin-theme="graphite"] body[data-lc-surface] :is(button.secondary,.ghost) { background: #202730; color: #f4f6fa; border-color: #697384; }
html[data-admin-theme="graphite"] body[data-lc-surface] :is(.tabs button.active,.courier-view-tabs button.active,.courier-auth-tabs button.active) { background: #32232c; color: #ffadb3; border-color: #ff7d85; }
