/* ==========================================================================
   ARAK SERVICE CENTER — APPLICATION LAYOUT & SCREEN STYLES
   Uses ONLY CSS custom properties defined in /tokens.css and primitives
   in /ds-components.css.
   Zero hardcoded hex colors, zero gradients, zero blur/glow, zero Inter font.
   ========================================================================== */

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Custom Scrollbar (Tokenized) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ==========================================================================
   TYPOGRAPHY & UTILITY HELPERS
   ========================================================================== */
.t-xs { font-size: var(--text-xs); }
.t-sm { font-size: var(--text-sm); }
.t-base { font-size: var(--text-base); }
.t-lg { font-size: var(--text-lg); }
.t-xl { font-size: var(--text-xl); }
.t-2xl { font-size: var(--text-2xl); }
.t-bold { font-weight: 700; }
.t-semi { font-weight: 600; }
.t-muted { color: var(--muted); }
.t-accent { color: var(--accent); }
.t-ok { color: var(--status-ok-fg); }
.t-warn { color: var(--status-warn-fg); }
.t-danger { color: var(--status-danger-fg); }

[data-theme="neo-light"] .t-accent {
  color: var(--text);
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.upper {
  text-transform: uppercase;
}

.stack-1 { display: flex; flex-direction: column; gap: 4px; }
.stack-2 { display: flex; flex-direction: column; gap: 8px; }
.stack-3 { display: flex; flex-direction: column; gap: 12px; }
.stack-4 { display: flex; flex-direction: column; gap: 16px; }

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.row-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

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

.min-w-0 { min-width: 0; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }
.w-full { width: 100%; }

/* Inline SVG Icon sizing */
.ic {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: square;
  stroke-linejoin: miter;
  flex-shrink: 0;
}

.ic-sm {
  width: 15px;
  height: 15px;
}

.ic-fill {
  fill: currentColor;
  stroke: none;
}

/* ==========================================================================
   1. LOGIN SCREEN (Flat, Clean, No Centered Hero / No Gradient)
   ========================================================================== */
.login-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.login-topbar {
  background: var(--surface);
  border-bottom: var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.login-body {
  flex: 1;
  width: 100%;
  max-width: 460px;
  margin: 24px auto;
  padding: 0 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--accent);
  color: var(--accent-fg);
  border: var(--border);
  border-radius: var(--radius);
  flex-shrink: 0;
}

[data-theme="neo-dark"] .brand-mark {
  border-color: var(--accent);
}

[data-theme="odoo"] .brand-mark {
  border-color: var(--accent);
}

.alert-error {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--status-danger-bg);
  color: var(--status-danger-fg);
  border: var(--border-width) solid var(--status-danger-border);
  font-size: var(--text-sm);
  font-weight: 600;
}

.alert-warn {
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--status-warn-bg);
  color: var(--status-warn-fg);
  border: var(--border-width) solid var(--status-warn-border);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* ==========================================================================
   2. MAIN APP SHELL, STICKY TOP HEADER & FIXED BOTTOM DOCK
   ========================================================================== */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--surface);
  border-bottom: var(--border);
}

[data-theme="neo-light"] .app-header {
  background: var(--surface);
}

[data-theme="odoo"] .app-header {
  background: var(--surface);
}

.app-header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 14px;
  min-height: var(--header-height);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (min-width: 768px) {
  .app-header-inner {
    padding: 10px 20px;
  }
}

.app-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.app-header-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

#headerDateDisplay {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.user-meta-text {
  display: none;
}

@media (min-width: 560px) {
  .user-meta-text {
    display: flex;
    flex-direction: column;
    text-align: end;
    min-width: 0;
  }
}

.user-name {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
}

.user-role {
  font-size: 12px;
  color: var(--muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
}

#logoutBtn {
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 36px;
  height: 36px;
  padding: 0 12px;
}

/* Main Content Area — leaves space for Pinned Bottom Primary CTA + 3-Tab Bar */
.app-main {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 14px calc(var(--tabbar-height) + var(--btn-height) + 42px);
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}

@media (min-width: 768px) {
  .app-main {
    padding: 18px 20px calc(var(--tabbar-height) + var(--btn-height) + 46px);
  }
}

/* Fixed Bottom Dock: One Pinned Primary Button + 3-Item Tab Bar */
.app-bottom-dock {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: var(--z-tabbar);
  background: var(--tabbar-bg);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.app-bottom-dock-inner {
  max-width: 1120px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .app-bottom-dock-inner {
    border-inline: var(--border);
  }
}

/* Toast Notification Banner */
.toast-banner {
  position: fixed;
  bottom: calc(var(--tabbar-height) + var(--btn-height) + 28px);
  inset-inline: 14px;
  z-index: 70;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: var(--border-width) solid var(--border-color);
  box-shadow: var(--shadow-card);
  font-size: var(--text-sm);
  font-weight: 700;
}

.toast-banner--ok {
  background: var(--status-ok-bg);
  color: var(--status-ok-fg);
  border-color: var(--status-ok-border);
}

.toast-banner--error {
  background: var(--status-danger-bg);
  color: var(--status-danger-fg);
  border-color: var(--status-danger-border);
}

/* ==========================================================================
   3. GRIDS & KPI METRICS (Theme-Distinct Layouts)
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 768px) {
  .kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Linear dark collapses KPIs into a dense 1px bordered grid */
[data-theme="neo-dark"] .kpi-grid {
  gap: 1px;
  background: var(--border-color);
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.kpi-cell {
  background: var(--surface);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

[data-theme="neo-light"] .kpi-cell {
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

[data-theme="odoo"] .kpi-cell {
  border: var(--border);
  border-radius: var(--radius);
}

.kpi-label {
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 600;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text);
  direction: ltr;
  unicode-bidi: isolate;
  text-align: start;
}

.kpi-sub {
  font-size: 12px;
  color: var(--muted);
}

/* Responsive 2-column & 3-column layout grids */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--section-gap);
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.grid-form-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .grid-form-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.grid-form-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .grid-form-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

@media (min-width: 640px) {
  .grid-form-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ==========================================================================
   4. BAYS GRID (Dashboard)
   ========================================================================== */
.bays-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 768px) {
  .bays-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

[data-theme="neo-dark"] .bays-grid {
  gap: 10px;
}

.bay-box {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bay-head {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: var(--divider);
  background: var(--surface);
}

.bay-box--empty .bay-head {
  padding: 10px 14px;
  border-bottom: 0;
}

[data-theme="odoo"] .bay-head {
  background: var(--surface-subtle);
}

.bay-name {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.bay-body {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.bay-box:not(.bay-box--empty) .bay-body {
  padding: 8px;
  gap: 8px;
  background: var(--surface-subtle);
}

.bay-order-row {
  padding: 12px 14px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: background-color 100ms ease;
}

.bay-order-row:hover {
  background: var(--surface-hover);
}

.bay-empty {
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==========================================================================
   5. FILTER STRIP & SEGMENTED CONTROLS
   ========================================================================== */
.filter-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-tab {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface);
  color: var(--muted);
  border: var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  flex-shrink: 0;
}

.filter-tab:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.filter-tab.is-active {
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 700;
}

[data-theme="neo-dark"] .filter-tab.is-active,
[data-theme="odoo"] .filter-tab.is-active {
  border-color: var(--accent);
}

.filter-count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  opacity: 0.85;
}

.search-bar-panel {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.segmented-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.segmented-btn {
  appearance: none;
  border: 0;
  border-inline-end: var(--border);
  min-height: var(--touch-min);
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 700;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.segmented-btn:last-child {
  border-inline-end: 0;
}

.segmented-btn.is-active {
  background: var(--accent);
  color: var(--accent-fg);
}

/* ==========================================================================
   6. PROGRESS BARS (Timer / Standard Hours)
   ========================================================================== */
.progress-track {
  width: 100%;
  height: 6px;
  background: var(--stage-track-bg);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
}

.progress-fill--ok {
  background: var(--status-ok-fg);
}

.progress-fill--danger {
  background: var(--status-danger-fg);
}

/* ==========================================================================
   7. MODALS & DRAWERS (Solid Opaque Backdrop — Zero Blur / Zero Glow)
   ========================================================================== */
.overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  justify-content: flex-end;
}

.overlay-backdrop--center {
  justify-content: center;
  align-items: flex-end;
  padding: 0;
}

.overlay-backdrop--nested {
  z-index: calc(var(--z-modal) + 20);
}

.product-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

@media (min-width: 640px) {
  .overlay-backdrop--center {
    align-items: center;
    padding: 16px;
  }
}

.drawer-panel {
  width: 100%;
  max-width: 820px;
  height: 100%;
  background: var(--bg);
  border-inline-start: var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-panel {
  width: 100%;
  max-width: 720px;
  max-height: 94vh;
  background: var(--bg);
  border: var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 640px) {
  .modal-panel {
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
  }
}

.modal-panel--sm {
  max-width: 520px;
}

.panel-header {
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: var(--border);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}

.panel-footer {
  flex-shrink: 0;
  background: var(--surface);
  border-top: var(--border);
  padding: 10px 16px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}

/* Inner 4-Tab Bar inside Repair Order Detail */
.ro-subtabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.ro-subtab-btn {
  appearance: none;
  border: 0;
  border-inline-end: var(--border);
  min-height: 44px;
  padding: 6px 4px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
}

.ro-subtab-btn:last-child {
  border-inline-end: 0;
}

.ro-subtab-btn.is-active {
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 700;
}

.ro-subtab-count {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 2px;
  background: var(--surface-subtle);
  color: var(--text);
}

.ro-subtab-btn.is-active .ro-subtab-count {
  background: rgba(0, 0, 0, 0.14);
  color: var(--accent-fg);
}

.ro-subtab-count--live {
  background: var(--status-ok-bg);
  color: var(--status-ok-fg);
  font-weight: 700;
}

/* Expandable Compact Accordion Items (Inspections / Jobs / Parts) */
.acc-list {
  display: flex;
  flex-direction: column;
  gap: var(--row-gap);
}

.acc-item {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.acc-item--running {
  border-inline-start: 4px solid var(--status-ok-fg);
}

.acc-item--issue {
  border-inline-start: 4px solid var(--status-warn-fg);
}

.acc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--touch-min);
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
}

.acc-head:hover {
  background: var(--surface-hover);
}

.acc-body {
  padding: 12px;
  border-top: var(--divider);
  background: var(--surface-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

[data-theme="neo-light"] .acc-body {
  background: var(--surface-hover);
}

[data-theme="odoo"] .acc-body {
  background: var(--surface);
}

/* Compact Inline Action Buttons (smaller utility buttons inside rows) */
.ds-btn-sm {
  min-height: 38px;
  padding: 6px 12px;
  font-size: var(--text-sm);
}

.ds-btn-icon {
  min-width: 42px;
  min-height: 40px;
  padding: 0 10px;
}

/* Live Part Search Results Dropdown */
.part-results-box {
  margin-top: 6px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
}

.part-result-btn {
  appearance: none;
  border: 0;
  border-bottom: var(--divider);
  width: 100%;
  text-align: start;
  padding: 10px 12px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.part-result-btn:last-child {
  border-bottom: 0;
}

.part-result-btn:hover {
  background: var(--surface-hover);
}

.part-selected-box {
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--accent-soft);
  border: var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Form Checkbox Row */
.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  font-size: var(--text-sm);
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Read-only Key/Value Summary Grid */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 640px) {
  .specs-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.spec-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.spec-label {
  font-size: 12px;
  color: var(--muted);
}

.spec-val {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
}

/* Textarea */
.ds-textarea {
  width: 100%;
  min-height: 82px;
  padding: 10px var(--input-px);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--input-bg);
  border: var(--input-border);
  border-bottom: var(--input-border-bottom);
  border-radius: var(--input-radius);
  box-shadow: var(--shadow-input);
  outline: none;
  resize: vertical;
}

.ds-textarea:focus {
  border-color: var(--input-focus-border);
  outline: var(--input-focus-outline);
}

[data-theme="odoo"] .ds-textarea {
  background: var(--surface-subtle);
  padding: 8px 10px;
}

[data-theme="odoo"] .ds-textarea:focus {
  border-bottom: 2px solid var(--input-focus-border);
}

/* Settings Sub-View Back Header */
.subview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Empty State Box */
.empty-box {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: var(--text-sm);
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
}

/* Desktop List View Table inside Settings Views (Equipment, Products, Employees, Customers, Logs) */
.ds-data-table-wrap {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow-x: auto;
}

.ds-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  text-align: start;
}

.ds-data-table thead th {
  padding: 10px 14px;
  background: var(--surface-subtle);
  border-bottom: var(--divider);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  text-align: start;
  white-space: nowrap;
}

.ds-data-table tbody tr {
  border-bottom: var(--divider);
}

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

[data-theme="odoo"] .ds-data-table tbody tr:nth-child(even) {
  background: var(--surface-subtle);
}

.ds-data-table tbody tr:hover {
  background: var(--surface-hover);
}

.ds-data-table tbody td {
  padding: 12px 14px;
  vertical-align: middle;
}

@media (max-width: 767px) {
  .ds-data-table-wrap {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }

  .ds-data-table thead {
    display: none;
  }

  .ds-data-table,
  .ds-data-table tbody,
  .ds-data-table tr,
  .ds-data-table td {
    display: block;
    width: 100%;
  }

  .ds-data-table tbody {
    display: flex;
    flex-direction: column;
    gap: var(--row-gap);
  }

  [data-theme="neo-dark"] .ds-data-table tbody,
  [data-theme="odoo"] .ds-data-table tbody {
    background: var(--surface);
    border: var(--border);
    border-radius: var(--radius);
    overflow: hidden;
  }

  .ds-data-table tbody tr {
    background: var(--surface);
    padding: 10px 14px;
  }

  [data-theme="neo-light"] .ds-data-table tbody tr {
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
  }

  .ds-data-table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  .ds-data-table tbody td:last-child {
    border-bottom: 0;
    padding-top: 8px;
  }

  .ds-data-table tbody td[data-label]::before {
    content: attr(data-label);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--muted);
    margin-inline-end: auto;
  }

  .ds-data-table tbody td.cell-stack {
    flex-direction: column;
    align-items: stretch;
  }

  .ds-data-table tbody td[colspan] {
    display: block;
    text-align: center;
    padding: 20px 12px;
    border-bottom: 0;
  }
}

/* Odoo Form-View Grid Enhancement inside Forms */
[data-theme="odoo"] .odoo-sheet {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

/* Goodwill Highlight Container (uses semantic warn tokens only) */
.goodwill-box {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--status-warn-bg);
  border: var(--border-width) solid var(--status-warn-border);
}

[data-theme="neo-light"] .goodwill-box {
  background: var(--accent-soft);
}

/* Mini 4-Segment Stage Bar on Repair Order List Rows (matches mockup!) */
.mini-stage-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
}

.mini-stage-seg {
  height: 5px;
  border-radius: 2px;
  background: var(--stage-track-bg);
}

.mini-stage-seg.is-filled {
  background: var(--accent);
}

[data-theme="neo-light"] .mini-stage-seg {
  height: 6px;
}

/* Status indicator square (replaces emoji circles) */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--muted);
  flex-shrink: 0;
}

.status-dot--ok { background: var(--status-ok-fg); }
.status-dot--warn { background: var(--accent); }
.status-dot--danger { background: var(--status-danger-fg); }

/* Star / Focus Toggle Button (Odoo priority='1' sync) */
.ro-star-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.ro-star-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-color);
  color: var(--text);
}

.ro-star-btn:focus-visible {
  outline: var(--input-focus-outline, 2px solid var(--accent));
  outline-offset: 1px;
}

.ro-star-btn.is-starred {
  color: var(--star-active);
}

.ro-star-btn.is-starred:hover {
  background: var(--surface-hover);
  border-color: var(--star-active);
}

.ro-star-inline {
  display: inline-flex;
  align-items: center;
  color: var(--star-active);
  flex-shrink: 0;
}
