/* ========================================
   BRAND COLOR SYSTEM
   Palette philosophy: teal brand foundation,
   orange CTA, 4 semantic states (success /
   warning / danger / info). All 7 per-widget
   accent classes now map to 2 roles only:
   --accent-primary (teal) and --accent-cta
   (orange). Dark mode uses warm deep-teal
   backgrounds for comfortable dim-light use.
   ======================================== */
   :root {
    /* Brand */
    --brand-teal-dark: #0a5b66;
    --brand-teal:      #3fb8cc;
    --brand-teal-soft: #a7dbd8;
    --brand-orange:    #e85d00;
    --brand-orange-light: #ff8c42;
    --brand-cream:     #e0e4cc;
  
    /* Semantic states — reduced to 4 */
    --success:      #0f9d6a;
    --success-bg:   #d6f5ea;
    --success-text: #065f46;
    --warning:      #d97706;
    --warning-bg:   #fef3c7;
    --warning-text: #78350f;
    --danger:       #dc2626;
    --danger-bg:    #fee2e2;
    --danger-text:  #991b1b;
    --info:         #2563eb;
    --info-bg:      #dbeafe;
    --info-text:    #1e3a8a;
  
    /* Accent roles — only 2 now */
    --accent-primary:   #0a5b66;
    --accent-secondary: #3fb8cc;
    --accent-cta:       #e85d00;
  
    /* Backgrounds */
    --bg-primary:   #f4f7f8;
    --bg-secondary: #ffffff;
    --bg-tertiary:  #eaf1f3;
    --bg-hover:     #dce8ea;
  
    /* Text */
    --text-primary:   #0f172a;
    --text-secondary: #3d5a61;
    --text-tertiary:  #617f85;
    --text-inverse:   #ffffff;
  
    /* Borders & shadows */
    --border:        #cddde0;
    --border-strong: #adc8cc;
    --shadow-sm: 0 1px 2px 0 rgba(10,91,102,.06);
    --shadow-md: 0 4px 8px -1px rgba(10,91,102,.12);
    --shadow-lg: 0 10px 20px -3px rgba(10,91,102,.15);
  
    /* Car status — kept distinct for operational clarity */
    --status-received-color:  #2563eb;
    --status-received-bg:     #eff6ff;
    --status-received-text:   #1e3a8a;
    --status-received-border: #93c5fd;
    --status-repairing-color:  #d97706;
    --status-repairing-bg:     #fffbeb;
    --status-repairing-text:   #78350f;
    --status-repairing-border: #fcd34d;
    --status-awaiting-color:  #c2410c;
    --status-awaiting-bg:     #fff7ed;
    --status-awaiting-text:   #7c2d12;
    --status-awaiting-border: #fdba74;
    --status-released-color:  #0f9d6a;
    --status-released-bg:     #f0fdf4;
    --status-released-text:   #14532d;
    --status-released-border: #6ee7b7;
  
    /* Accounts receivable item */
    --ar-item-bg:     #fef3c7;
    --ar-item-border: #d97706;
    --ar-item-text:   #78350f;
  
    /* Financial chart — brand teal + orange only */
    --fin-profit-color:  #3fb8cc;
    --fin-profit-light:  #a7dbd8;
    --fin-expense-color: #e85d00;
    --fin-expense-light: #ff8c42;
    --fin-loss-color:    #dc2626;
    --fin-loss-light:    #fca5a5;
  
    /* Repair progress bar */
    --repair-progress-color: #0a5b66;
  
    /* Inventory alert cards */
    --inv-need-po-bg:     #fff7ed;
    --inv-need-po-border: #c2410c;
    --inv-need-po-text:   #7c2d12;
    --inv-zero-bg:        #fee2e2;
    --inv-zero-border:    #dc2626;
    --inv-zero-text:      #991b1b;
  
    /* Layout */
    --header-garage-height:  56px;
    --header-actions-height: 60px;
    --topbar-total:          116px;
  
    --space-xs:  4px;
    --space-sm:  8px;
    --space-md:  12px;
    --space-lg:  16px;
    --space-xl:  20px;
    --space-2xl: 24px;
  
    --font-display-lg:      36px;
    --font-display-md:      24px;
    --font-body-lg:         18px;
    --font-body-md:         17px;
    --font-body-sm:         16px;
    --font-label:           15px;
    --font-widget-subtitle: 18px;
    --font-list-detail:     17px;
    --font-status-badge:    16px;
  
    --container-padding: 20px;
    --border-radius:     12px;
    --border-radius-sm:  8px;
  }
  
  /* ========================================
     DARK MODE — warm deep-teal backgrounds
     Easier on eyes in dim café / bar lighting.
     Avoids cold navy; uses desaturated teal
     darks with brand teal as primary accent.
     ======================================== */
  body.dark-mode {
    --bg-primary:   #091e22;
    --bg-secondary: #0e2d33;
    --bg-tertiary:  #153b42;
    --bg-hover:     #1c4a52;
  
    --text-primary:   #e8f4f6;
    --text-secondary: #a8cdd2;
    --text-tertiary:  #7aadb4;
    --text-inverse:   #091e22;
  
    --success:      #2dd4a0;  --success-bg:   #063d2a;  --success-text: #6ee7b7;
    --warning:      #fbbf24;  --warning-bg:   #4a2100;  --warning-text: #fde68a;
    --danger:       #f87171;  --danger-bg:    #4a0f0f;  --danger-text:  #fca5a5;
    --info:         #60a5fa;  --info-bg:      #0f2456;  --info-text:    #93c5fd;
  
    --accent-primary:   #3fb8cc;
    --accent-secondary: #a7dbd8;
  
    --border:        #1e4f58;
    --border-strong: #285f6a;
    --shadow-sm: 0 1px 3px 0 rgba(0,0,0,.35);
    --shadow-md: 0 4px 10px -1px rgba(0,0,0,.5);
    --shadow-lg: 0 10px 24px -3px rgba(0,0,0,.6);
  
    /* Car status dark — slightly muted for comfort */
    --status-received-bg:     #0f2456;  --status-received-text:   #bfdbfe;  --status-received-border:  #3b82f6;
    --status-repairing-bg:    #4a2100;  --status-repairing-text:  #fde68a;  --status-repairing-border: #f59e0b;
    --status-awaiting-bg:     #4a1a00;  --status-awaiting-text:   #fed7aa;  --status-awaiting-border:  #f97316;
    --status-released-bg:     #063d2a;  --status-released-text:   #6ee7b7;  --status-released-border:  #2dd4a0;
  
    --ar-item-bg:     #4a2100;  --ar-item-border: #fbbf24;  --ar-item-text: #fde68a;
  
    /* Financial dark */
    --fin-profit-color:  #a7dbd8;
    --fin-profit-light:  #3fb8cc;
    --fin-expense-color: #ff8c42;
    --fin-expense-light: #e85d00;
    --fin-loss-color:    #f87171;
    --fin-loss-light:    #fca5a5;
  
    /* Repair progress dark */
    --repair-progress-color: #3fb8cc;
  
    /* Inventory dark */
    --inv-need-po-bg:     #4a1a00;
    --inv-need-po-border: #f97316;
    --inv-need-po-text:   #fed7aa;
    --inv-zero-bg:        #4a0f0f;
    --inv-zero-border:    #f87171;
    --inv-zero-text:      #fca5a5;
  }
  
  /* ========================================
     RESET
     ======================================== */
  * { margin: 0; padding: 0; box-sizing: border-box; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    padding-bottom: var(--container-padding);
  }
  
  /* ========================================
     HEADER BAR 1 — GARAGE NAME
     ======================================== */
  .header-garage {
    background: var(--accent-primary);
    display: flex; align-items: center; justify-content: center; gap: 12px;
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-garage-height); z-index: 110;
    padding: 0 var(--container-padding);
  }
  body.dark-mode .header-garage { background: #1c4a52; }
  
  .garage-name {
    font-size: 17px; font-weight: 800; color: #ffffff;
    letter-spacing: 0.02em; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; text-align: center;
    text-shadow: 0 1px 3px rgba(0,0,0,0.25); flex-shrink: 1; min-width: 0;
  }
  body.dark-mode .garage-name { color: var(--text-primary); text-shadow: none; }
  
  .garage-logo {
    height: calc(var(--header-garage-height) - 12px); width: auto;
    max-width: 120px; object-fit: contain; border-radius: 4px; flex-shrink: 0;
  }
  
  /* ========================================
     HEADER BAR 2 — ACTIONS
     ======================================== */
  .header-actions-bar {
    background: var(--bg-secondary); padding: var(--space-md) var(--container-padding);
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 2px solid var(--border);
    position: fixed; top: var(--header-garage-height); left: 0; right: 0;
    height: var(--header-actions-height); z-index: 100;
  }
  .header-left { display: flex; align-items: center; }
  .product-logo { height: 42px; width: auto; object-fit: contain; }
  @media (min-width: 600px) { .product-logo { height: 36px; } }
  .header-right { display: flex; align-items: center; gap: var(--space-md); }
  .header-actions { display: flex; gap: var(--space-sm); align-items: center; }
  
  .icon-btn {
    background: var(--bg-tertiary); border: none; color: var(--text-primary);
    width: 40px; height: 40px; border-radius: var(--border-radius-sm);
    font-size: 20px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s; flex-shrink: 0; position: relative;
  }
  .icon-btn:hover   { background: var(--bg-hover); }
  .icon-btn:active  { background: var(--border-strong); }
  
  .logout-btn { background: var(--danger-bg); color: var(--danger); gap: 6px; font-size: var(--font-body-sm); font-weight: 600; }
  .logout-btn .logout-text { display: none; }
  @media (min-width: 768px) { .logout-btn { width: auto; padding: 0 14px; } .logout-btn .logout-text { display: inline; } }
  .logout-btn:hover { background: var(--danger); color: white; }
  
  .notif-btn { position: relative; }
  .notif-badge {
    position: absolute; top: 2px; right: 2px;
    background: var(--danger); color: #fff;
    font-size: 11px; font-weight: 700; line-height: 1;
    min-width: 18px; height: 18px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px; pointer-events: none;
  }
  .notif-badge.hidden { display: none; }
  
  /* ========================================
     LOGIN PAGE
     ======================================== */
  .header-login {
    background: var(--bg-secondary);
    display: flex; align-items: center; justify-content: center;
    border-bottom: 2px solid var(--border);
    position: fixed; top: 0; left: 0; right: 0; height: 96px; z-index: 100;
  }
  .header-login .product-logo { height: 56px; }
  .container-login { padding-top: 96px; }
  .login-card {
    background: var(--bg-secondary); border-radius: var(--border-radius);
    border: 1px solid var(--border); box-shadow: var(--shadow-md);
    padding: var(--space-2xl); max-width: 400px; margin: var(--space-2xl) auto 0;
  }
  .login-title { font-size: var(--font-display-md); font-weight: 700; color: var(--text-primary); text-align: center; margin-bottom: var(--space-2xl); }
  .login-field { margin-bottom: var(--space-lg); }
  .login-label { display: block; font-size: var(--font-body-sm); font-weight: 600; color: var(--text-secondary); margin-bottom: var(--space-sm); }
  .login-input { width: 100%; padding: 14px; font-size: var(--font-body-md); border: 1px solid var(--border-strong); border-radius: var(--border-radius-sm); background: var(--bg-primary); color: var(--text-primary); transition: border-color 0.2s; }
  .login-input:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(10,91,102,0.15); }
  .login-error { background: var(--danger-bg); color: var(--danger-text); border: 1px solid var(--danger); border-radius: var(--border-radius-sm); padding: 12px 14px; font-size: var(--font-body-sm); font-weight: 600; margin-bottom: var(--space-lg); }
  .login-error.hidden { display: none; }
  .login-btn { width: 100%; padding: 16px; background: var(--accent-primary); color: #fff; border: none; border-radius: var(--border-radius-sm); font-size: var(--font-body-md); font-weight: 700; cursor: pointer; transition: background 0.2s; margin-top: var(--space-sm); }
  .login-btn:hover  { background: #0d7080; }
  .login-btn:active { background: #094f5a; }
  
  /* ========================================
     CONTAINER
     ======================================== */
  .container {
    padding-top: 132px; padding-left: 20px; padding-right: 20px;
    padding-bottom: 20px; max-width: 600px; margin: 0 auto;
  }
  .last-updated { text-align: center; color: var(--text-secondary); font-size: var(--font-body-md); margin-bottom: var(--container-padding); }
  
  /* ========================================
     WIDGET BASE
     ======================================== */
  .widget {
    background: var(--bg-secondary); border-radius: var(--border-radius);
    margin-bottom: var(--space-lg); border: 1px solid var(--border);
    box-shadow: var(--shadow-sm); transition: none; overflow: hidden;
  }
  .widget:hover { box-shadow: var(--shadow-md); }
  /* All widget accent bars now use 2 roles: primary (teal) or cta (orange) */
  .widget::before { content: ''; display: block; height: 4px; background: var(--widget-accent, var(--accent-primary)); }
  
  /* Consolidated accent mapping — 7 classes reduced to 2 visual outcomes */
  .widget-accent-financial,
  .widget-accent-operations,
  .widget-accent-payable,
  .widget-accent-insurance   { --widget-accent: var(--accent-primary); }
  
  .widget-accent-alert,
  .widget-accent-expenditure,
  .widget-accent-receivable  { --widget-accent: var(--accent-cta); }
  
  .widget-inner { padding: var(--container-padding); }
  .widget-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-md); }
  .widget-title { font-size: var(--font-body-lg); color: var(--text-primary); font-weight: 700; letter-spacing: -0.01em; }
  .widget-icon { font-size: 32px; line-height: 1; }
  .widget-value { font-size: var(--font-display-lg); font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-sm); }
  .widget-value-center { text-align: center; }
  .widget-subtitle { font-size: var(--font-widget-subtitle); color: var(--text-tertiary); }
  
  .widget-header-badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 20px;
    font-size: var(--font-label); font-weight: 700; line-height: 1.4; white-space: nowrap;
  }
  .widget-header-badge-danger  { background: var(--danger-bg);  color: var(--danger-text); }
  .widget-header-badge-warning { background: var(--warning-bg); color: var(--warning-text); }
  .widget-header-badge-idle    { background: var(--info-bg);    color: var(--info-text); }
  .widget-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  
  .empty-state-clear {
    text-align: center; color: var(--success-text);
    background: var(--success-bg); border: 1px solid var(--success);
    border-radius: var(--border-radius-sm);
    padding: var(--space-xl); font-size: var(--font-body-md); font-weight: 600;
  }
  
  .status-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 12px;
    font-size: 12px; font-weight: 700; line-height: 1.4;
  }
  .status-badge-working { background: var(--success-bg); color: var(--success-text); }
  .status-badge-out     { background: var(--bg-hover);   color: var(--text-tertiary); }
  
  /* ========================================
     PERIOD SELECTOR
     ======================================== */
  .period-selector {
    display: flex; gap: var(--space-sm); background: var(--bg-tertiary);
    padding: 6px; border-radius: var(--border-radius-sm);
    margin-bottom: var(--space-md); border: 1px solid var(--border);
  }
  .period-btn {
    flex: 1; padding: 10px 12px; background: transparent; border: none;
    border-radius: 6px; cursor: pointer; font-size: var(--font-body-sm);
    font-weight: 600; color: var(--text-tertiary); transition: all 0.2s;
  }
  .period-btn.active { background: var(--widget-accent, var(--accent-primary)); color: #ffffff; box-shadow: var(--shadow-md); }
  
  /* ========================================
     FINANCIAL WIDGET
     ======================================== */
  .fin-info-panel {
    display: flex; justify-content: space-between;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: var(--border-radius-sm); padding: 10px 14px;
    margin-bottom: var(--space-md); gap: 8px;
  }
  .fin-info-item { display: flex; flex-direction: column; align-items: center; flex: 1; }
  .fin-info-label { font-size: 12px; font-weight: 600; color: var(--text-tertiary); margin-bottom: 2px; text-align: center; }
  .fin-info-value { font-size: var(--font-body-lg); font-weight: 800; text-align: center; }
  .fin-info-revenue { color: var(--text-primary); }
  .fin-info-expense { color: var(--fin-expense-color); }
  .fin-info-profit  { color: var(--fin-profit-color); }
  .fin-info-loss    { color: var(--fin-loss-color); }
  
  /* Horizontal bar chart */
  .fin-chart-outer { width: 100%; }
  
  /* Fixed height containers per period */
  .fin-chart-week  { height: 296px; display: flex; flex-direction: column; justify-content: space-between; padding: 4px 0; }
  .fin-chart-month { height: 296px; display: flex; flex-direction: column; justify-content: space-between; padding: 4px 0; }
  .fin-chart-today { height: 296px; display: flex; flex-direction: column; justify-content: center; padding: 4px 0; }
  
  /* Each bar row: label on left, bar on right */
  .fin-bar-row { display: flex; align-items: center; gap: 10px; }

  .fin-chart-week  .fin-bar-row { height: 32px; }
  .fin-chart-month .fin-bar-row { height: 56px; }
  .fin-chart-today .fin-bar-row { height: 66px; }
  
  .fin-chart-week  .fin-bar-wrap,
  .fin-chart-week  .fin-bar-track { height: 28px; }
  
  .fin-chart-month .fin-bar-wrap,
  .fin-chart-month .fin-bar-track { height: 50px; }
  
  .fin-chart-today .fin-bar-wrap,
  .fin-chart-today .fin-bar-track { height: 60px; }
  
  .fin-bar-row-label {
    font-size: 11px; color: var(--text-tertiary);
    white-space: nowrap; width: 72px; flex-shrink: 0; text-align: right;
  }
  
  /* Clickable bar wrap */
  .fin-bar-wrap {
    flex: 1; position: relative; height: 28px;
    cursor: pointer; border-radius: 4px; transition: background 0.15s;
    display: flex; align-items: stretch;
  }
  .fin-bar-wrap:hover { background: transparent; }
  body.dark-mode .fin-bar-wrap:hover { background: transparent; }  

  /* Bar track — must be relative so absolute child positions correctly */
  .fin-bar-track {
    flex: 1; position: relative; height: 28px;
    overflow: hidden; background: transparent;
    border-radius: 4px; border: none;
  }
  .fin-bar-track-empty {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
  }
  
  /* Horizontal stacked bar — fills track absolutely */
  .fin-stacked-bar {
    display: flex; flex-direction: row;
    position: absolute; top: 0; bottom: 0; left: 0; right: 0;
  }
  .fin-seg {
    height: 100%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
  }
  .fin-stacked-bar .fin-seg:first-child { border-radius: 3px 0 0 3px; }
  .fin-stacked-bar .fin-seg:last-child  { border-radius: 0 3px 3px 0; }
  .fin-stacked-bar .fin-seg:only-child  { border-radius: 3px; }
  
  .fin-seg-profit       { background: var(--fin-profit-color);  }
  .fin-seg-expense      { background: var(--fin-expense-color); }
  .fin-seg-loss         { background: var(--fin-loss-color);    }
  .fin-seg-revenue      { background: var(--info);              }
  .fin-seg-revenue-fill { background: var(--info);              }
  .fin-seg-light.fin-seg-profit       { background: var(--fin-profit-light);  opacity: 0.65; }
  .fin-seg-light.fin-seg-expense      { background: var(--fin-expense-light); opacity: 0.65; }
  .fin-seg-light.fin-seg-loss         { background: var(--fin-loss-light);    opacity: 0.65; }
  .fin-seg-light.fin-seg-revenue-fill { background: #93c5fd;                  opacity: 0.65; }
  .fin-seg-label { font-size: 11px; font-weight: 700; color: #fff; text-align: center; padding: 2px; line-height: 1.2; }
  
  /* Active bar outline */
  .fin-bar-active .fin-bar-track { outline: 2px solid var(--accent-primary); outline-offset: 1px; }
  
  /* Today — single full-width bar no longer used
  .fin-today-bar-col { display: flex; flex-direction: column; gap: 6px; width: 100%; }
  .fin-bar-date-label { font-size: 12px; color: var(--text-tertiary); text-align: center; margin-top: 4px; }
  */
  .fin-legend-row  { display: flex; gap: 12px; margin-top: 12px; justify-content: center; flex-wrap: wrap; }
  .fin-legend-item { display: flex; align-items: center; gap: 6px; font-size: var(--font-label); color: var(--text-secondary); }
  .fin-legend-dot  { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
  .fin-dot-profit  { background: var(--fin-profit-color);  }
  .fin-dot-expense { background: var(--fin-expense-color); }
  .fin-dot-loss    { background: var(--fin-loss-color);    }
  .fin-currency-suffix {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.75;
    margin-left: 1px;
  }
  /* ========================================
     LIST ITEMS
     ======================================== */
  .list-item {
    background: var(--bg-primary); padding: 14px; border-radius: var(--border-radius-sm);
    margin-bottom: 10px; border-left: 4px solid var(--border); transition: box-shadow 0.2s;
  }
  .list-item:last-child { margin-bottom: 0; }
  .list-item.status-received         { background: var(--status-received-bg);  border-left-color: var(--status-received-border);  }
  .list-item.status-repairing        { background: var(--status-repairing-bg); border-left-color: var(--status-repairing-border); }
  .list-item.status-awaiting-payment { background: var(--status-awaiting-bg);  border-left-color: var(--status-awaiting-border);  }
  .list-item.status-released         { background: var(--status-released-bg);  border-left-color: var(--status-released-border);  }
  .list-item.status-received .list-item-title,
  .list-item.status-received .list-item-subtitle,
  .list-item.status-received .list-item-detail         { color: var(--status-received-text); }
  .list-item.status-repairing .list-item-title,
  .list-item.status-repairing .list-item-subtitle,
  .list-item.status-repairing .list-item-detail        { color: var(--status-repairing-text); }
  .list-item.status-awaiting-payment .list-item-title,
  .list-item.status-awaiting-payment .list-item-subtitle,
  .list-item.status-awaiting-payment .list-item-detail { color: var(--status-awaiting-text); }
  .list-item.status-released .list-item-title,
  .list-item.status-released .list-item-subtitle,
  .list-item.status-released .list-item-detail         { color: var(--status-released-text); }
  
  .list-item-title    { font-size: var(--font-body-lg);     font-weight: 600; color: var(--text-primary);   }
  .list-item-subtitle { font-size: var(--font-body-sm);     color: var(--text-secondary); margin-top: var(--space-xs); }
  .list-item-detail   { font-size: var(--font-list-detail); color: var(--text-tertiary);  margin-top: 4px; }
  
  /* ========================================
     REPAIR PROGRESS BAR
     ======================================== */
  .repair-progress-wrap { margin-top: 10px; }
  .repair-progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
  .repair-progress-label { font-size: var(--font-label); font-weight: 600; color: var(--text-secondary); text-transform: capitalize; }
  .repair-progress-count { font-size: var(--font-label); font-weight: 700; color: var(--text-primary); }
  .repair-progress-track { height: 10px; background: rgba(255,255,255,0.4); border-radius: 5px; overflow: hidden; }
  .repair-progress-fill  { height: 100%; background: var(--repair-progress-color); border-radius: 5px; transition: width 0.4s ease; }
  
  /* ========================================
     ACCOUNTS RECEIVABLE / PAYABLE
     ======================================== */
  .arp-total-center {
    font-size: var(--font-display-lg); font-weight: 700; color: var(--danger);
    text-align: center; margin-bottom: var(--space-md);
  }
  .arp-widget-body { min-height: 230px; }
  
  .ar-item {
    background: var(--bg-primary);
    border-left: 4px solid var(--ar-item-border);
    padding: 12px 14px; border-radius: var(--border-radius-sm); margin-bottom: 8px;
  }
  .ar-item:last-child { margin-bottom: 0; }
  .ar-item-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
  .ar-item-left { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
  .ar-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
  .ar-customer-name { font-size: var(--font-body-sm); font-weight: 700; color: var(--text-primary); }
  .ar-invoice-line  { font-size: var(--font-body-sm); }
  .ar-days-row { font-size: var(--font-label); color: var(--ar-item-text); }
  .ar-amount { font-size: var(--font-display-md); font-weight: 700; color: var(--danger); white-space: nowrap; }
  
  .invoice-link { color: var(--accent-primary); font-weight: 700; text-decoration: underline; cursor: pointer; white-space: nowrap; }
  .invoice-link:hover { color: var(--accent-cta); }
  
  /* Receivable accordion colors */
  .accordion-ar-overdue  .accordion-row { background: var(--danger-bg);  border-left: 4px solid var(--danger);  }
  .accordion-ar-overdue  .accordion-label,
  .accordion-ar-overdue  .accordion-count { color: var(--danger-text); }
  .accordion-ar-awaiting .accordion-row { background: var(--warning-bg); border-left: 4px solid var(--warning); }
  .accordion-ar-awaiting .accordion-label,
  .accordion-ar-awaiting .accordion-count { color: var(--warning-text); }
  
  /* Payable accordion colors */
  .accordion-ap-pending .accordion-row { background: var(--warning-bg); border-left: 4px solid var(--warning); }
  .accordion-ap-pending .accordion-label,
  .accordion-ap-pending .accordion-count { color: var(--warning-text); }
  .accordion-ap-partial .accordion-row { background: var(--info-bg); border-left: 4px solid var(--info); }
  .accordion-ap-partial .accordion-label,
  .accordion-ap-partial .accordion-count { color: var(--info-text); }
  .accordion-ap-paid    .accordion-row { background: var(--success-bg); border-left: 4px solid var(--success); }
  .accordion-ap-paid    .accordion-label,
  .accordion-ap-paid    .accordion-count { color: var(--success-text); }
  
  /* Payable status badges */
  .payable-status-badge {
    display: inline-flex; align-items: center;
    padding: 2px 8px; border-radius: 12px;
    font-size: 12px; font-weight: 700; line-height: 1.4; white-space: nowrap;
  }
  .payable-status-badge-paid     { background: var(--success-bg); color: var(--success-text); }
  .payable-status-badge-partial  { background: var(--info-bg);    color: var(--info-text);    }
  .payable-status-badge-pending  { background: var(--warning-bg); color: var(--warning-text); }
  .payable-status-badge-overdue  { background: var(--danger-bg);  color: var(--danger-text);  }
  .payable-status-badge-awaiting { background: var(--warning-bg); color: var(--warning-text); }
  
  /* ========================================
     BREAKDOWN ITEMS
     ======================================== */
  .breakdown-item {
    background: var(--bg-primary); padding: 12px 14px;
    border-radius: var(--border-radius-sm); border-left: 3px solid var(--border-strong);
    display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px;
  }
  .breakdown-item:last-child { margin-bottom: 0; }
  .breakdown-supplier  { font-size: var(--font-body-sm); font-weight: 700; color: var(--text-primary); }
  .breakdown-item-row  { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
  .breakdown-item-desc { font-size: var(--font-body-sm); color: var(--text-secondary); flex: 1; }
  .breakdown-amount    { font-size: var(--font-display-md); font-weight: 700; color: var(--danger); white-space: nowrap; }
  .breakdown-footer-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; }
  .breakdown-due       { font-size: var(--font-label); color: var(--warning); font-weight: 600; }
  
  /* ========================================
     CUSTOMER FOLLOW-UP
     ======================================== */
  .followup-total { font-size: var(--font-display-md); font-weight: 700; color: var(--text-primary); margin-bottom: 12px; }
  
  .followup-item {
    padding: 12px 14px; border-radius: var(--border-radius-sm);
    border-left: 4px solid var(--border); background: var(--bg-primary);
  }
  .followup-overdue  { background: var(--danger-bg);  border-left-color: var(--danger);  }
  .followup-soon     { background: var(--warning-bg); border-left-color: var(--warning); }
  .followup-upcoming { background: var(--success-bg); border-left-color: var(--success); }
  
  .followup-type-row   { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
  .followup-icon       { font-size: 18px; flex-shrink: 0; }
  .followup-type-label { font-size: var(--font-label); font-weight: 800; color: var(--text-secondary); flex: 1; text-transform: uppercase; letter-spacing: 0.04em; }
  .followup-due-label  { font-size: var(--font-label); font-weight: 700; }
  .followup-overdue  .followup-due-label { color: var(--danger-text); }
  .followup-soon     .followup-due-label { color: var(--warning-text); }
  .followup-upcoming .followup-due-label { color: var(--success-text); }
  .followup-customer { font-size: var(--font-body-md); font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
  .followup-note     { font-size: var(--font-label); color: var(--text-secondary); }
  
  .accordion-followup-overdue  .accordion-row { background: var(--danger-bg);  border-left: 4px solid var(--danger);  }
  .accordion-followup-overdue  .accordion-label,
  .accordion-followup-overdue  .accordion-count { color: var(--danger-text); }
  .accordion-followup-soon     .accordion-row { background: var(--warning-bg); border-left: 4px solid var(--warning); }
  .accordion-followup-soon     .accordion-label,
  .accordion-followup-soon     .accordion-count { color: var(--warning-text); }
  .accordion-followup-upcoming .accordion-row { background: var(--success-bg); border-left: 4px solid var(--success); }
  .accordion-followup-upcoming .accordion-label,
  .accordion-followup-upcoming .accordion-count { color: var(--success-text); }
  
  /* ========================================
     INVENTORY ALERTS
     ======================================== */
  .inv-summary-counts {
    display: flex; flex-wrap: wrap; gap: 8px;
    font-size: var(--font-label); margin-bottom: var(--space-md);
  }
  .inv-count-total   { font-weight: 700; color: var(--danger-text); }
  .inv-count-po { font-weight: 700; color: var(--warning-text); }
  .inv-count-pending { font-weight: 700; color: var(--warning-text); }
  
  .inv-stock-bar-wrap { margin: 8px 0 4px; }
  .inv-stock-bar-track {
    height: 14px; background: var(--bg-hover);
    border-radius: 3px; overflow: hidden;
    border: 2px solid var(--border-strong);
    margin-bottom: 4px;
  }
  .inv-stock-bar-fill {
    height: 100%;
    background: repeating-linear-gradient(
    45deg,
    var(--inv-bar-color, var(--fin-profit-color)),
    var(--inv-bar-color, var(--fin-profit-color)) 6px,
    var(--inv-stripe-color, rgba(0,0,0,0.12)) 6px,
    var(--inv-stripe-color, rgba(0,0,0,0.12)) 12px
  );
    border-radius: 2px;
    transition: width 0.4s ease;
    min-width: 4px;
  }
  .inv-stock-bar-empty { --inv-bar-color: var(--danger); }

  .alert-item-po       .inv-stock-bar-fill { --inv-bar-color: var(--warning); }
  .alert-item-need-po  .inv-stock-bar-fill { --inv-bar-color: var(--inv-need-po-border); --inv-stripe-color: rgba(255,220,0,0.5); }
  .alert-item-zero     .inv-stock-bar-fill { --inv-bar-color: var(--danger); --inv-stripe-color: rgba(255,220,0,0.6); }
  .alert-item-zero-po  .inv-stock-bar-fill { --inv-bar-color: var(--danger); --inv-stripe-color: rgba(255,220,0,0.6); }

  .inv-stock-bar-labels {
    display: flex; justify-content: space-between;
    font-size: 13px; color: var(--text-secondary);
  }
  
  .alert-item {
    padding: 14px; border-radius: var(--border-radius-sm);
    margin-bottom: 10px; border-left: 4px solid var(--border);
    background: var(--bg-primary);
  }
  .alert-item:last-child { margin-bottom: 0; }
  .alert-item .list-item-title { font-weight: 600; }
  
  .alert-item-po {
    background: var(--warning-bg);
    border-left-color: var(--warning);
  }
  .alert-item-po .list-item-title { color: var(--warning-text); }
/*  .alert-item-po .inv-stock-bar-fill { background: var(--warning); } */
  
  
  .alert-item-need-po {
    background: var(--inv-need-po-bg);
    border-left-color: var(--inv-need-po-border);
  }
  .alert-item-need-po .list-item-title { color: var(--inv-need-po-text); }
/*  .alert-item-need-po .inv-stock-bar-fill { background: var(--inv-need-po-border); } */
  
  .alert-item-zero {
    background: var(--inv-zero-bg);
    border-left-color: var(--inv-zero-border);
  }
  .alert-item-zero .list-item-title { color: var(--inv-zero-text); }
/*  .alert-item-zero .inv-stock-bar-fill { background: var(--danger); } */
  
  .alert-item-zero-po {
    background: var(--warning-bg);
    border-left-color: var(--danger);
  }
  .alert-item-zero-po .list-item-title { color: var(--warning-text); }
/*  .alert-item-zero-po .inv-stock-bar-fill { background: var(--danger); } */
    
  .po-info {
    margin-top: 6px; padding: 6px 10px;
    background: var(--po-bg, rgba(255,255,255,0.6));
    border-radius: 4px; font-size: var(--font-body-sm);
    color: var(--po-text, var(--text-secondary)); font-weight: 600;
  }
  .alert-item-po .po-info,
  .alert-item-zero-po .po-info { --po-bg: rgba(255,255,255,0.5); --po-text: var(--warning-text); }
  body.dark-mode .po-info { --po-bg: rgba(0,0,0,0.25); --po-text: #fde68a; }
  body.dark-mode .alert-item-po .po-info,
  body.dark-mode .alert-item-zero-po .po-info { --po-bg: rgba(0,0,0,0.2); --po-text: var(--warning-text); }  
  /* ========================================
     UNIFIED STAFF WIDGET
     ======================================== */
  .staff-as-of {
    font-size: var(--font-label); color: var(--text-tertiary);
    font-weight: 600; margin-bottom: var(--space-md);
  }
  .staff-widget-body { min-height: 200px; }
  
  .staff-card {
    display: flex; align-items: flex-start; gap: 10px;
    background: var(--bg-primary); padding: 12px 14px;
    border-radius: var(--border-radius-sm); border: 1px solid var(--border);
    margin-bottom: 8px;
  }
  .staff-card:last-child { margin-bottom: 0; }
  .staff-card-status-icon { font-size: 20px; flex-shrink: 0; padding-top: 1px; }
  .staff-card-body { flex: 1; min-width: 0; }
  .staff-card-name { font-size: var(--font-body-md); font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
  .staff-card-detail { font-size: var(--font-label); color: var(--text-secondary); margin-top: 2px; }
  .staff-card-detail-muted { color: var(--text-tertiary); }
  
  .adv-stats-row {
    display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap;
  }
  .adv-stat-col {
    display: flex; flex-direction: column; align-items: flex-start;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: var(--border-radius-sm); padding: 6px 10px; flex: 1; min-width: 70px;
  }
  .adv-stat-value { font-size: var(--font-body-sm); font-weight: 700; color: var(--text-primary); }
  .adv-stat-label { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
  .adv-stat-commission { color: var(--success-text); }
  
  .accordion-staff-busy .accordion-row { background: var(--success-bg); border-left: 4px solid var(--success); }
  .accordion-staff-busy .accordion-label,
  .accordion-staff-busy .accordion-count { color: var(--success-text); }
  .accordion-staff-idle .accordion-row { background: var(--info-bg); border-left: 4px solid var(--info); }
  .accordion-staff-idle .accordion-label,
  .accordion-staff-idle .accordion-count { color: var(--info-text); }
  .accordion-staff-adv-working .accordion-row { background: var(--success-bg); border-left: 4px solid var(--success); }
  .accordion-staff-adv-working .accordion-label,
  .accordion-staff-adv-working .accordion-count { color: var(--success-text); }
  .accordion-staff-out .accordion-row { background: var(--bg-hover); border-left: 4px solid var(--border-strong); }
  .accordion-staff-out .accordion-label,
  .accordion-staff-out .accordion-count { color: var(--text-tertiary); }
  
  /* ========================================
     INSURANCE SALES WIDGET
     ======================================== */
  .accordion-insurer .accordion-row {
    background: var(--bg-tertiary);
  }
  .accordion-insurer.accordion-open .accordion-row {
    background: var(--bg-hover); border-bottom: 1px solid var(--border);
  }
  
  .ins-staff-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 4px; border-bottom: 1px solid var(--border); font-size: var(--font-label);
  }
  .ins-staff-row:last-of-type { border-bottom: none; }
  .ins-staff-left  { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
  .ins-staff-right { flex-shrink: 0; text-align: right; }
  .ins-staff-name             { font-size: var(--font-body-sm); font-weight: 700; color: var(--text-primary); }
  .ins-staff-commission-label { font-size: 12px; color: var(--text-tertiary); margin-top: 1px; }
  .ins-staff-commission       { font-size: var(--font-label); color: var(--text-secondary); }
  .ins-staff-policies         { font-size: var(--font-label); font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
  
  .ins-subtotal-row {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 10px 4px; margin-top: 6px;
    background: var(--success-bg); border-radius: var(--border-radius-sm);
    border: 1px solid var(--success);
  }
  .ins-subtotal-left  { display: flex; flex-direction: column; gap: 2px; }
  .ins-subtotal-right { flex-shrink: 0; text-align: right; display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
  .ins-subtotal-label          { font-size: 12px; font-weight: 600; color: var(--success-text); }
  .ins-subtotal-commission      { font-size: var(--font-body-sm); font-weight: 800; color: var(--success-text); }
  .ins-subtotal-policies-label  { font-size: 12px; font-weight: 600; color: var(--success-text); }
  .ins-subtotal-policies        { font-size: var(--font-body-sm); font-weight: 700; color: var(--success-text); white-space: nowrap; }
  
  .insurer-no-policies { font-size: var(--font-label); color: var(--text-tertiary); padding: 8px 4px; font-style: italic; }
  
  .insurance-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px; margin-top: 12px;
    background: var(--accent-primary); border-radius: var(--border-radius-sm); color: #fff;
  }
  body.dark-mode .insurance-footer { background: #1c4a52; }
  .insurance-footer-policies   { font-size: var(--font-body-lg); font-weight: 800; }
  .insurance-footer-commission { font-size: var(--font-body-lg); font-weight: 800; }
  .insurance-footer-label { font-size: 12px; opacity: 0.8; margin-bottom: 2px; }
  
  /* ========================================
     ACCORDION
     ======================================== */
  .accordion-list    { display: flex; flex-direction: column; gap: 8px; }
  .accordion-section { border-radius: var(--border-radius-sm); border: 1px solid var(--border); overflow: hidden; }
  .accordion-row {
    display: flex; align-items: center; gap: 10px; padding: 14px;
    background: var(--bg-tertiary); cursor: pointer; user-select: none;
    min-height: 52px; transition: none;
  }
  .accordion-row:hover           { background: var(--bg-hover); }
  .accordion-row-empty           { cursor: default; opacity: 0.5; }
  .accordion-row-empty:hover     { background: var(--bg-tertiary); }
  .accordion-open .accordion-row { background: var(--bg-hover); }
  .accordion-icon    { font-size: 20px; flex-shrink: 0; }
  .accordion-label   { flex: 1; font-size: var(--font-body-md); font-weight: 600; color: var(--text-primary); }
  .accordion-count   { font-size: var(--font-body-sm); font-weight: 700; color: var(--text-secondary); white-space: nowrap; }
  .accordion-chevron { font-size: 13px; color: var(--text-tertiary); margin-left: 6px; flex-shrink: 0; }
  .accordion-chevron-placeholder { width: 19px; flex-shrink: 0; }
  .accordion-content { padding: 12px; background: var(--bg-secondary); display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border); isolation: isolate; }
  
  /* Car status accordion rows */
  .accordion-status-received .accordion-row         { background: var(--status-received-bg);  border-left: 4px solid var(--status-received-border);  }
  .accordion-status-received .accordion-label,
  .accordion-status-received .accordion-count       { color: var(--status-received-text); }
  .accordion-status-repairing .accordion-row        { background: var(--status-repairing-bg); border-left: 4px solid var(--status-repairing-border); }
  .accordion-status-repairing .accordion-label,
  .accordion-status-repairing .accordion-count      { color: var(--status-repairing-text); }
  .accordion-status-awaiting-payment .accordion-row { background: var(--status-awaiting-bg);  border-left: 4px solid var(--status-awaiting-border);  }
  .accordion-status-awaiting-payment .accordion-label,
  .accordion-status-awaiting-payment .accordion-count { color: var(--status-awaiting-text); }
  .accordion-status-released .accordion-row         { background: var(--status-released-bg);  border-left: 4px solid var(--status-released-border);  }
  .accordion-status-released .accordion-label,
  .accordion-status-released .accordion-count       { color: var(--status-released-text); }
  
  /* ========================================
     STATES
     ======================================== */
  .loading-spinner { text-align: center; font-size: var(--font-display-md); padding: var(--space-xl); color: var(--text-secondary); }
  .error-message   { color: var(--danger); text-align: center; padding: var(--space-lg); }
  .empty-state     { text-align: center; color: var(--text-tertiary); padding: var(--space-2xl); font-size: var(--font-body-md); }
  
  /* ========================================
     SETTINGS MODAL
     ======================================== */
  .settings-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    display: flex; align-items: flex-end; z-index: 300; cursor: pointer;
  }
  .settings-modal.hidden { display: none; }
  .settings-content {
    background: var(--bg-secondary); border-radius: var(--border-radius) var(--border-radius) 0 0;
    width: 100%; max-height: 85vh; display: flex; flex-direction: column; cursor: default;
  }
  .settings-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: var(--space-lg) var(--container-padding);
    border-bottom: 2px solid var(--border); background: var(--bg-secondary);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    flex-shrink: 0; position: sticky; top: 0; z-index: 10;
  }
  .settings-header h2 { font-size: var(--font-display-md); font-weight: 700; }
  .settings-header button {
    background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text-primary);
    font-size: 20px; cursor: pointer; width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; transition: background 0.2s;
  }
  .settings-header button:hover { background: var(--danger-bg); color: var(--danger); }
  .settings-body-scroll { overflow-y: auto; padding: var(--container-padding); flex: 1; }
  .settings-section { margin-bottom: var(--space-2xl); }
  .settings-section h3 { font-size: var(--font-body-lg); margin-bottom: var(--space-md); color: var(--text-secondary); font-weight: 700; }
  .settings-section-box { background: var(--bg-primary); border: 1px solid var(--border-strong); border-radius: var(--border-radius-sm); padding: var(--space-md); }
  .widget-toggle { display: flex; justify-content: space-between; align-items: center; padding: var(--space-md); background: var(--bg-primary); border-radius: var(--border-radius-sm); margin-bottom: var(--space-sm); }
  .settings-divider { text-align: center; color: var(--text-tertiary); font-size: var(--font-label); font-weight: 600; margin: var(--space-lg) 0; text-transform: uppercase; letter-spacing: 1px; }
  .settings-hint { font-size: var(--font-body-sm); color: var(--text-tertiary); margin-bottom: var(--space-md); text-align: center; }
  .settings-select { width: 100%; padding: 14px; font-size: var(--font-body-md); border-radius: var(--border-radius-sm); border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-primary); cursor: pointer; }
  
  /* ========================================
     WIDGET MANAGE + DRAG
     ======================================== */
  .widget-manage-item {
    display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md);
    background: var(--bg-primary); border-radius: var(--border-radius-sm);
    margin-bottom: var(--space-sm); border: 2px solid var(--border);
    transition: all 0.2s; min-height: 60px;
  }
  .widget-manage-item.active   { border-color: var(--accent-primary); }
  .widget-manage-item.inactive { opacity: 0.6; }
  .widget-manage-item.drag-over { border-color: var(--accent-cta); background: var(--bg-hover); transform: scale(1.01); }
  .widget-manage-item.dragging  { opacity: 0.4; }
  .drag-handle { font-size: 22px; color: var(--text-tertiary); cursor: grab; padding: 8px; border-radius: 6px; user-select: none; touch-action: none; flex-shrink: 0; }
  .drag-handle:active { cursor: grabbing; }
  .drag-handle-disabled { cursor: default; opacity: 0.3; }
  .drag-handle:hover:not(.drag-handle-disabled) { color: var(--text-primary); background: var(--bg-hover); }
  .widget-manage-name { flex: 1; font-size: var(--font-body-md); font-weight: 600; color: var(--text-primary); }
  .widget-manage-item.inactive .widget-manage-name { color: var(--text-tertiary); font-weight: 400; }
  
  /* ========================================
     TOGGLE SWITCH
     ======================================== */
  .toggle-switch { position: relative; width: 51px; height: 31px; background: var(--text-tertiary); border-radius: 16px; cursor: pointer; transition: background 0.3s; flex-shrink: 0; }
  .toggle-switch.active { background: var(--success); }
  .toggle-slider { position: absolute; top: 3px; left: 3px; width: 25px; height: 25px; background: white; border-radius: 50%; transition: transform 0.3s; }
  .toggle-switch.active .toggle-slider { transform: translateX(20px); }
  
  /* ========================================
     NOTIFICATIONS
     ======================================== */
  .notif-actions { padding: 4px 0 12px; display: flex; justify-content: flex-end; }
  .notif-mark-all-btn { background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--accent-primary); font-size: var(--font-body-sm); font-weight: 600; padding: 8px 14px; border-radius: var(--border-radius-sm); cursor: pointer; }
  .notif-mark-all-btn:hover { background: var(--bg-hover); }
  .notif-list { display: flex; flex-direction: column; gap: 8px; }
  .notif-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--border-radius-sm); border: 1px solid var(--border); position: relative; }
  .notif-unread { background: var(--info-bg); border-color: var(--info); }
  .notif-read   { background: var(--bg-primary); opacity: 0.75; }
  .notif-icon-wrap { font-size: 24px; flex-shrink: 0; padding-top: 2px; }
  .notif-body      { flex: 1; min-width: 0; }
  .notif-type-label{ font-size: 12px; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px; }
  .notif-title     { font-size: var(--font-body-md); font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
  .notif-detail    { font-size: var(--font-body-sm); color: var(--text-secondary); margin-bottom: 4px; }
  .notif-time      { font-size: var(--font-label); color: var(--text-tertiary); }
  .notif-unread .notif-title { color: var(--info-text); }
  .notif-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--info); flex-shrink: 0; margin-top: 6px; }
  
  /* ========================================
     INVOICE / PO MODAL
     These modals render on white regardless of
     dark mode — intentional: documents should
     always look like documents.
     ======================================== */
  .invoice-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.75);
    z-index: 500; display: flex; align-items: flex-end; justify-content: center;
  }
  @media (min-width: 600px) { .invoice-modal-overlay { align-items: center; } }
  .invoice-modal-sheet {
    background: #fff; border-radius: 16px 16px 0 0; width: 100%;
    max-width: 560px; max-height: 90vh; overflow-y: auto;
    padding: 20px 20px 32px; position: relative;
  }
  @media (min-width: 600px) { .invoice-modal-sheet { border-radius: 16px; max-height: 85vh; } }
  body.dark-mode .invoice-modal-sheet { background: #fff; color: #0f172a; }
  .invoice-close-btn {
    position: absolute; top: 14px; right: 14px; background: #f1f5f9;
    border: 1px solid #cbd5e1; color: #0f172a; font-size: 18px;
    width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center; z-index: 10; transition: background 0.2s;
  }
  .invoice-close-btn:hover { background: #fee2e2; color: #ef4444; }
  .invoice-doc { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #0f172a; }
  .invoice-header { text-align: center; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 2px solid #0a5b66; }
  .invoice-garage-name { font-size: 20px; font-weight: 800; color: #0a5b66; letter-spacing: 0.02em; }
  .invoice-title { font-size: 14px; font-weight: 700; color: #475569; letter-spacing: 0.12em; text-transform: uppercase; margin-top: 4px; }
  .invoice-meta { background: #f8fafb; border-radius: 8px; padding: 14px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
  .invoice-meta-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
  .invoice-meta-row span:first-child { color: #64748b; flex-shrink: 0; }
  .invoice-meta-row span:last-child, .invoice-meta-row strong { color: #0f172a; text-align: right; }
  .invoice-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 16px; }
  .invoice-table th { background: #0a5b66; color: #fff; padding: 8px 10px; font-weight: 600; text-align: left; }
  .invoice-table td { padding: 8px 10px; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
  .invoice-table tbody tr:nth-child(even) td { background: #f8fafb; }
  .invoice-table tfoot td { padding: 10px; border-top: 2px solid #0a5b66; border-bottom: none; background: #fff; font-size: 14px; }
  .invoice-status-banner { display: flex; justify-content: space-between; align-items: center; background: #fee2e2; border: 1px solid #ef4444; border-radius: 8px; padding: 12px 14px; margin-top: 4px; }
  .invoice-status-label { font-size: 13px; color: #991b1b; }
  .invoice-status-label strong { font-weight: 800; }
  .invoice-overdue-badge { background: #ef4444; color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
  .po-meta-grid { display: flex; gap: 12px; margin-bottom: 16px; }
  .po-meta-grid .invoice-meta { margin-bottom: 0; }
  @media (max-width: 480px) { .po-meta-grid { flex-direction: column; gap: 8px; } }
  .po-note { font-size: 12px; color: #64748b; font-style: italic; margin-bottom: 12px; padding: 8px 12px; background: #f8fafb; border-left: 3px solid #cbd5e1; border-radius: 0 4px 4px 0; }
  .po-status-banner { background: #d1fae5; border-color: #10b981; }
  .po-status-banner .invoice-status-label { color: #065f46; }
  .po-issued-badge { background: #10b981; color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
  
  /* ========================================
     RESPONSIVE
     ======================================== */
  @media (min-width: 768px) { .container { max-width: 800px; } }
  @media (min-width: 1024px) {
    .container { max-width: 1200px; }
    #widgetContainer { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
  }
  @media (min-width: 1440px) {
    .container { max-width: 1400px; }
    #widgetContainer { grid-template-columns: 1fr 1fr 1fr; }
  }
  @media (max-width: 399px) {
    .product-logo { height: 36px; }
    .header-actions { gap: 4px; }
    .icon-btn { width: 34px; height: 34px; font-size: 17px; }
  }
  @media print {
    .header-garage, .header-actions-bar { display: none; }
    .widget { break-inside: avoid; }
  }