/* ============================================================
   ALMERA OS — "Champagne Luxe · Light" theme overlay
   Loaded LAST, only when ?lux=1 (or localStorage luxTheme) is set.
   Remaps the dark navy system to ivory + champagne + espresso,
   Hanken Grotesk. Additive + reversible — never touches behaviour.
   ============================================================ */

/* ---- tokens ---- */
:root {
  --gold:        #b58c38;     /* champagne accent on light */
  --gold-soft:   #d9bd7f;
  --gold-deep:   #8f7126;
  --gold-glow:   rgba(181,140,56,.22);
  --gold-lit:    #e7d2a4;     /* gold on espresso */

  --bg-0:        #f3efe6;     /* ivory page */
  --bg-1:        #faf7f0;     /* ivory card */
  --bg-2:        #fffdf8;     /* raised */
  --bg-3:        #efe8da;     /* hover */

  --line:        rgba(60,45,18,.12);
  --line-soft:   rgba(60,45,18,.07);
  /* some base components (customer-results) read --hairline with a navy
     fallback — define it so they pick up the warm palette instead */
  --hairline:    rgba(60,45,18,.12);

  --text:        #221d15;     /* ink */
  --text-dim:    #5f5848;
  --text-mute:   #8a8170;
  --text-on-gold:#251c0b;

  --ok:          #3f9a6e;
  --warn:        #b9892f;
  --danger:      #c0553f;

  --es-1:        #1a1511;     /* espresso */
  --es-2:        #15110d;
  --es-3:        #100c08;

  --brand-font:  "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display-font:"Hanken Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --sans-font:   "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --shadow-sm: 0 1.5px 3px rgba(60,45,18,.08), 1px 3px 8px rgba(60,45,18,.06);
  --shadow:    0 1.5px 3px rgba(60,45,18,.08), 2px 8px 20px -4px rgba(60,45,18,.14);
  --shadow-lg: 0 2px 5px rgba(60,45,18,.10), 5px 22px 44px -14px rgba(60,45,18,.20);
}

html, body { background: transparent; color: var(--text); }
body {
  font-family: var(--sans-font);
  background:
    radial-gradient(880px 520px at 14% 0%, rgba(231,206,150,.13), transparent 60%),
    radial-gradient(135% 118% at 50% 28%, #f5f1ea 0%, #f1ebdf 46%, #ece6da 100%) fixed;
}
.app, .app-main, .view-root { background: transparent; }
.meta-color, ::selection { }
::selection { background: rgba(181,140,56,.22); }

/* ---- typography ---- */
.page-title, .login-name, .sidebar-brand-name,
.admin-greeting-name, .dash-card-head h2, .detail-section-head h2,
.page-kicker, .admin-greeting-hello {
  font-family: var(--sans-font);
}
.page-title { color: var(--text); letter-spacing: -.02em; font-weight: 800; }
.page-kicker, .admin-greeting-hello { color: var(--text-mute); letter-spacing: .16em; }
.page-sub { color: var(--text-mute); }
.brand-word, .sidebar-brand-name, .login-name { letter-spacing: .14em; }

/* ============================================================
   APP SHELL — sidebar (desktop) + top-bar (mobile)
   ============================================================ */
.sidebar {
  background: linear-gradient(180deg, #faf7f0, #f4efe4);
  border-right: 1px solid var(--line);
}
.sidebar-brand-name { color: var(--text); }
.sidebar-brand-sub  { color: var(--text-mute); }
.sidebar-nav a, .sidebar-nav button {
  color: var(--text-dim); border-radius: 12px;
}
.sidebar-nav a:hover, .sidebar-nav button:hover { background: var(--bg-3); color: var(--text); }
.sidebar-nav a.active, .sidebar-nav .active {
  background: linear-gradient(158deg, var(--es-1), var(--es-3));
  color: var(--gold-lit);
  box-shadow: 2px 5px 13px rgba(20,12,4,.22);
}
.sidebar-nav a.active svg, .sidebar-nav .active svg { color: var(--gold-lit); }
.global-search input {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
}
.global-search input::placeholder { color: var(--text-mute); }

.top-bar {
  background: linear-gradient(180deg, rgba(246,242,235,.94), rgba(246,242,235,.78));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.top-title { color: var(--text); font-weight: 800; letter-spacing: -.01em; }
.icon-btn { color: var(--text-dim); }
.icon-btn:hover { color: var(--text); background: rgba(60,45,18,.05); }

/* ============================================================
   BUTTONS + BADGES + PILLS
   ============================================================ */
.btn { font-family: var(--sans-font); font-weight: 800; letter-spacing: .005em; }
.btn-primary {
  color: #1f1505; font-weight: 800;
  background:
    linear-gradient(116deg, rgba(255,250,232,.3) 0%, transparent 34%, rgba(120,84,28,.14) 100%),
    linear-gradient(150deg, #f1d488 0%, #d9b56a 52%, #bf9646 100%);
  border: none;
  box-shadow: 0 2px 4px rgba(120,86,28,.18), 2px 9px 20px -4px rgba(120,86,28,.26),
              inset 0 1px 0 rgba(255,250,235,.5), inset 0 0 0 1px rgba(180,140,62,.2);
}
.btn-primary:hover { filter: brightness(1.03); }
.btn-ghost {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text-dim);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { color: var(--text); background: #fff; }
.btn.danger, .btn-danger { color: var(--danger); }

.badge { font-family: var(--sans-font); font-weight: 700; border-radius: 20px; }
.badge-ok    { color: var(--ok);   background: rgba(63,154,110,.12); box-shadow: inset 0 0 0 1px rgba(63,154,110,.2); }
.badge-warn  { color: var(--warn); background: rgba(185,137,47,.14); }
.badge-action{ color: var(--gold-lit); background: linear-gradient(158deg, var(--es-1), var(--es-3)); }

/* ============================================================
   CARDS / PANELS  (ivory paper)
   ============================================================ */
.dash-card, .detail-section, .notif-card, .export-card,
.chart-card, .stock-detail-hero, .machine-hero, .record-detail {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.85);
}
.dash-card-head h2, .detail-section-head h2 { color: var(--text); font-weight: 800; letter-spacing: -.015em; }
.dash-card-head a, .detail-section-head a, .home-recent-card a {
  color: var(--gold-lit); font-weight: 700; font-size: 12px;
  background: linear-gradient(158deg, var(--es-1), var(--es-3));
  padding: 6px 12px; border-radius: 20px; box-shadow: var(--shadow-sm);
}

/* ============================================================
   KPI CARDS — first (gold) = champagne hero; rest = espresso
   ============================================================ */
/* two headline KPIs → clean two-up at every width (base CSS assumed four) */
.kpi-row { gap: 14px; grid-template-columns: repeat(2, 1fr); }
.kpi-card {
  border-radius: 20px; border: 1px solid rgba(0,0,0,.42);
  background: linear-gradient(158deg, #221b13, #15100a);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,236,206,.06), inset 0 0 0 1px rgba(255,232,196,.025);
}
.kpi-card .kpi-value { color: #ece1ca; font-weight: 800; letter-spacing: -.035em; }
.kpi-card .kpi-label { color: #9a907d; font-weight: 600; }
.kpi-card .kpi-ico {
  color: var(--gold-lit); background: rgba(214,178,96,.10);
  box-shadow: inset 0 0 0 1px rgba(214,178,96,.24), inset 0 1px 1px rgba(0,0,0,.22);
}
.kpi-card .kpi-delta { color: var(--gold-lit); background: rgba(214,178,96,.10); box-shadow: inset 0 0 0 1px rgba(214,178,96,.16); }
/* champagne hero */
.kpi-card.kpi-gold {
  border: 1px solid rgba(180,140,62,.25);
  background:
    linear-gradient(116deg, rgba(255,250,232,.3) 0%, transparent 32%, rgba(120,84,28,.14) 100%),
    linear-gradient(157deg, #f4e6bf 0%, #d9b56a 56%, #b6862f 100%);
  box-shadow: var(--shadow-lg), inset 0 1.5px 0 rgba(255,250,235,.5), inset 0 0 0 1px rgba(180,140,62,.2);
}
.kpi-card.kpi-gold .kpi-value { color: #251c0b; }
.kpi-card.kpi-gold .kpi-label { color: #2c220f; }
.kpi-card.kpi-gold .kpi-ico   { color: var(--gold-lit); background: linear-gradient(158deg,#241d12,#14100a); box-shadow: 2px 5px 13px rgba(40,28,6,.32); }
.kpi-card.kpi-gold .kpi-delta { color: var(--gold-lit); background: linear-gradient(158deg,#241d12,#14100a); }

/* ============================================================
   HOME TILES (engineer)
   ============================================================ */
.home-tile {
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 18px;
  color: var(--text); box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.85);
}
.home-tile-ico { color: var(--gold-deep); }
.home-tile-title { color: var(--text); font-weight: 800; }
.home-tile-sub { color: var(--text-mute); }
.home-tile-primary {
  color: var(--text-on-gold); border: 1px solid rgba(180,140,62,.25);
  background:
    linear-gradient(116deg, rgba(255,250,232,.3) 0%, transparent 32%, rgba(120,84,28,.14) 100%),
    linear-gradient(150deg, #f4e6bf 0%, #d9b56a 54%, #b6862f 100%);
  box-shadow: var(--shadow-lg), inset 0 1.5px 0 rgba(255,250,235,.5), inset 0 0 0 1px rgba(180,140,62,.2);
}
.home-tile-primary .home-tile-ico,
.home-tile-primary .home-tile-title { color: #251c0b; }
.home-tile-primary .home-tile-sub { color: rgba(48,36,12,.74); }

/* ============================================================
   LISTS / ROWS  (recent services, records, etc.)
   ============================================================ */
.dash-list > *, .records-list > *, .detail-list > *,
.stock-detail-list > *, .admin-activity-list > * {
  border-color: var(--line) !important;
}
.dash-row-thumb, .record-thumb { border: 1px solid var(--line); }
.record-card, .records-list .record, .dash-list .dash-row {
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.mono, .serial, .dash-row-time, .record-time { color: var(--text-mute); }
.dash-used-badge, .pill, .tag { color: var(--gold-deep); background: rgba(181,140,56,.12); border-radius: 20px; }

/* ============================================================
   STOCK CARDS
   ============================================================ */
.stock-card, .stocks-list > * {
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.85);
}
.stock-card .stock-name, .stock-name { color: var(--text); font-weight: 700; }
.stock-card .stock-sku, .stock-sku { color: var(--text-mute); }

/* ============================================================
   FORMS / INPUTS / MODALS / FILTERS
   ============================================================ */
.field input, .field textarea, .field select,
.filter-input, .filter-select, .filter-date, .parts-picker-search,
input[type="search"], input[type="text"], input[type="email"],
input[type="password"], input[type="number"], input[type="date"], select, textarea {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 12px;
}
input::placeholder, textarea::placeholder { color: var(--text-mute); }
.field > span, .field legend, label > span { color: var(--text-dim); }
.form-modal-panel, .parts-picker-panel, .media-modal-content {
  background: var(--bg-1); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.form-modal-backdrop, .parts-picker-backdrop, .media-modal-backdrop {
  background: rgba(40,30,14,.42); backdrop-filter: blur(3px);
}
.form-modal-title, .parts-picker-head h2 { color: var(--text); font-weight: 800; }

/* ============================================================
   LOGIN
   ============================================================ */
.view-login { background: transparent; }
.login-name { color: var(--text); }
.login-sub, .login-version { color: var(--text-mute); }
.login-form { background: var(--bg-1); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,.85); }
.form-error { color: var(--danger); }

/* ============================================================
   MISC
   ============================================================ */
.empty-hint, .empty-state, .sync-meta, #sync-meta-text { color: var(--text-mute); }
/* `.empty-state { display:flex }` (styles.css:1937) defeats the `hidden`
   attribute — so empty-state messages showed even when the view had data
   (e.g. "Son 90 günde servis yok" under populated charts). Make [hidden] win,
   matching the same patch the codebase already applies to .badge/.sidebar. */
.empty-state[hidden], .empty[hidden], .empty-hint[hidden] { display: none !important; }
/* "new customer will be created" hint reads as info (gold), not an error */
.field-hint.field-hint-info { color: var(--gold-deep) !important; }
html[data-theme="dark"] .field-hint.field-hint-info { color: var(--gold-lit) !important; }

/* desktop global-search dropdown — base hardcodes a navy glass panel */
.global-search-panel {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}
.gs-row { color: var(--text-dim); }
.gs-row:hover, .gs-row:focus { background: var(--bg-3); color: var(--text); }

/* inline "Yükleniyor… / empty" placeholders inside dash lists */
.empty { color: var(--text-mute); }

/* ============================================================
   MOTION — quiet fade-rise on view enter + tactile press states.
   The global prefers-reduced-motion kill-switch in styles.css
   disables all of this automatically.
   ============================================================ */
.view { animation: luxViewIn .18s ease-out both; }
@keyframes luxViewIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}
/* press feedback on every tappable surface */
.kpi-card.kpi-tap, .dash-row, .record-card, .stock-card, .home-tile,
.admin-tile, .lux-bn, .lux-fab, .btn-primary, .btn-ghost { transition: transform .12s ease; }
.kpi-card.kpi-tap:active, .dash-row:active, .record-card:active, .stock-card:active,
.home-tile:active, .admin-tile:active, .fleet-card:active, .lux-bn:active,
.lux-fab:active, .btn-primary:active, .btn-ghost:active { transform: scale(.985); }
/* tappable KPIs read as buttons */
.kpi-card.kpi-tap { cursor: pointer; }
.kpi-card.kpi-tap:focus-visible { outline: 2px solid rgba(181,140,56,.4); outline-offset: 2px; }

/* numerals line up everywhere (counts, dates, KPI values) */
body { font-variant-numeric: tabular-nums; }

/* ============================================================
   SKELETONS — dashboard lists pulse softly while data loads
   instead of popping in from nothing
   ============================================================ */
#dash-recent-list:empty, #dash-mostused-list:empty {
  min-height: 132px; position: relative; overflow: hidden;
}
#dash-recent-list:empty::before, #dash-mostused-list:empty::before {
  content: ''; position: absolute; inset: 14px 18px;
  border-radius: 8px;
  background: repeating-linear-gradient(180deg, var(--bg-3) 0 16px, transparent 16px 44px);
  -webkit-mask: linear-gradient(90deg, #000 35%, rgba(0,0,0,.3));
          mask: linear-gradient(90deg, #000 35%, rgba(0,0,0,.3));
  animation: luxPulse 1.3s ease-in-out infinite;
}
@keyframes luxPulse { 50% { opacity: .45; } }

/* ============================================================
   COLLAPSIBLE EXPORT CARD — closed by default on the dashboard
   ============================================================ */
details.export-card > summary { list-style: none; cursor: pointer; }
details.export-card > summary::-webkit-details-marker { display: none; }
details.export-card > summary::after {
  content: '▾'; color: var(--text-mute); font-size: 14px;
  transition: transform .15s ease;
}
details.export-card[open] > summary::after { transform: rotate(180deg); }
details.export-card .export-body { padding-top: 0; }
.wizard-dot { color: var(--text-mute); }
.wizard-dot.active { color: var(--gold-deep); }
.wizard-dot.active .wizard-dot-num {
  background: linear-gradient(150deg, #f1d488, #bf9646); color: var(--text-on-gold);
}
.admin-tile {
  background: var(--bg-1); border: 1px solid var(--line); color: var(--text);
  box-shadow: var(--shadow-sm);
}
.admin-tile svg { color: var(--gold-deep); }

/* performance: charts + kpi strip on ivory */
.chart-card { background: var(--bg-1); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.85); }
.chart-card h3 { color: var(--text); font-weight: 700; letter-spacing: .01em; }
.kpi-strip .kpi { background: var(--bg-1); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-sm); }
.kpi-strip .kpi-label { color: var(--text-mute); }
.kpi-strip .kpi-value { color: var(--gold-deep); font-weight: 800; }
.admin-date-chip { color: var(--text-mute); background: var(--bg-2); border: 1px solid var(--line); }

/* ============================================================
   BOTTOM TAB BAR (mobile, lux only) — espresso bar; engineer FAB
   ============================================================ */
.lux-bottomnav { display: none; }
@media (max-width: 899px) {
  html[data-lux] .lux-bottomnav {
    display: flex; align-items: stretch; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 6px 8px calc(8px + var(--safe-bot));
    background: linear-gradient(180deg, #1a1511, #0e0b07);
    border-top: 1px solid rgba(214,178,96,.16);
    box-shadow: 0 -14px 36px rgba(15,9,3,.42);
  }
  /* keep content clear of the fixed bar */
  html[data-lux] .app-main { padding-bottom: 78px; }
}
.lux-bn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 0 0; font-family: var(--sans-font); font-size: 10.5px; font-weight: 600;
  color: #8a8170; cursor: pointer; background: none; border: none; position: relative; }
.lux-bn svg { width: 23px; height: 23px; display: block; }
.lux-bn span { line-height: 1; }
.lux-bn.active { color: var(--gold-lit); }
.lux-bn.active svg { filter: drop-shadow(0 0 8px rgba(224,190,110,.5)); }
.lux-bn.active::before { content: ''; position: absolute; top: 0; width: 24px; height: 3px;
  border-radius: 0 0 3px 3px; background: linear-gradient(90deg, #d6bd8c, var(--gold-lit));
  box-shadow: 0 0 10px rgba(224,190,110,.55); }
/* engineer FAB */
.lux-bn-fab { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; }
.lux-fab { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; cursor: pointer;
  border: none; color: #251b09; transform: translateY(-20px);
  background:
    linear-gradient(116deg, rgba(255,250,232,.32) 0%, transparent 34%, rgba(120,84,28,.18) 100%),
    linear-gradient(150deg, #f4e6bf 0%, #e0c27e 44%, #cba052 74%, #b6862f 100%);
  box-shadow: 0 12px 26px rgba(120,86,30,.52), 0 3px 8px rgba(60,40,8,.45),
              inset 0 1.5px 0 rgba(255,250,235,.55), inset 0 0 0 1px rgba(180,140,62,.3); }
.lux-fab svg { width: 26px; height: 26px; }
.lux-bn-fab .lux-fab-lab { position: absolute; bottom: 6px; font-size: 10px; font-weight: 700; color: var(--gold-lit); }

/* ============================================================
   FIXES — filter bars overflowed on mobile; back-button focus box
   ============================================================ */
@media (max-width: 720px) {
  .filter-bar, .filter-bar-simple { display: flex; flex-wrap: wrap; gap: 8px; }
  .filter-bar > *, .filter-bar-simple > * { flex: 1 1 auto; min-width: 0; }
  .filter-bar input[type="search"], .filter-bar .filter-input,
  .filter-bar-simple input[type="search"], .filter-bar-simple .filter-input { flex: 1 1 100%; }
  .filter-bar .filter-select, .filter-bar .filter-date,
  .filter-bar-simple .filter-select, .filter-bar-simple .filter-date { flex: 1 1 calc(50% - 6px); }
}
/* neutralise the heavy gold focus box on top-bar icon buttons */
.top-bar .icon-btn:focus, .top-bar .icon-btn:active,
#btn-back:focus, #btn-back:active { outline: none; box-shadow: none; border-color: var(--line); }
.icon-btn:focus-visible { outline: 2px solid rgba(181,140,56,.35); outline-offset: 2px; border-radius: 12px; }

/* ============================================================
   BRAND — bring the Almera logo + Ethnocentric wordmark back
   ============================================================ */
.top-bar { gap: 10px; }
.top-bar .header-logo { width: 28px; height: 28px; display: block; filter: drop-shadow(0 1px 2px rgba(60,45,18,.18)); }
.top-title {
  font-family: "Ethnocentric", "Neue Haas", var(--sans-font);
  letter-spacing: .14em; font-weight: 700; font-size: 14px;
  text-transform: uppercase; color: var(--text);
}
.sidebar-brand-name { font-family: "Ethnocentric", "Neue Haas", var(--sans-font); letter-spacing: .14em; font-size: 15px; font-weight: 700; }
.sidebar-logo { filter: drop-shadow(0 1px 2px rgba(60,45,18,.18)); }
.login-name { font-family: "Ethnocentric", "Neue Haas", var(--sans-font); letter-spacing: .14em; }
.login-logo { filter: drop-shadow(0 2px 6px rgba(60,45,18,.20)); }
.sidebar-brand-sub { font-family: "Neue Haas", var(--sans-font); letter-spacing: .04em; color: var(--text-mute); }

/* ============================================================
   AESTHETIC — bring back gold italic in the user's name
   (single weight-contrast moment, restrained — not everywhere)
   ============================================================ */
/* sans for "Merhaba," + serif italic display for the name = editorial mix
   (the moment in the mocks the user singled out as "expensive") */
.admin-greeting-name {
  font-family: "Neue Haas", var(--sans-font);
  font-size: clamp(28px, 4.4vw, 36px); font-weight: 700; letter-spacing: -.022em;
  color: var(--text); line-height: 1; display: block;
}
.admin-greeting-name b {
  font-family: "Cormorant Garamond", "Neue Haas", var(--sans-font);
  font-style: italic; font-weight: 600;
  font-size: 1.34em; line-height: .92;
  padding-right: .12em; margin-left: .05em;
  background: linear-gradient(118deg, #c8a358 8%, #8a6d22 92%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.admin-greeting-hello { font-family: "Neue Haas", var(--sans-font); }

/* same restrained sans+serif mix on the engineer home greeting */
.view-home .page-title { font-family: "Neue Haas", var(--sans-font); font-weight: 700; letter-spacing: -.015em; }
.view-home #hello-name {
  font-family: "Cormorant Garamond", "Neue Haas", var(--sans-font);
  font-style: italic; font-weight: 600;
  background: linear-gradient(118deg, #c8a358 8%, #8a6d22 92%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* ============================================================
   DEDUPE — hide the in-view page-head on mobile (top-bar carries the title);
   keep it on desktop where there's no top-bar
   ============================================================ */
@media (max-width: 899px) {
  /* hide redundant page-head on admin list views (top bar already shows the title) */
  .view-records > .page-head,
  .view-admin-stocks > .page-head,
  .view-admin-detail > .page-head,
  .view-machine-lookup > .page-head,
  .view-admin-activity > .page-head,
  .view-notifications  > .page-head { display: none; }
}

/* ============================================================
   STOK LİSTESİ YAZDIR — stronger button, no more flat look
   ============================================================ */
#admin-stocks-list ~ * #print-stocks-btn,
.btn-primary { font-weight: 800; }
/* the stock toolbar's primary print button */
button.btn-primary:not(.btn-small) {
  padding: 14px 22px; border-radius: 14px; font-size: 14.5px; letter-spacing: .03em;
  text-transform: none;
  box-shadow:
    0 2px 4px rgba(120,86,28,.22),
    3px 11px 22px -2px rgba(120,86,28,.28),
    inset 0 1.4px 0 rgba(255,250,235,.55),
    inset 0 -2px 8px rgba(120,86,28,.18),
    inset 0 0 0 1px rgba(180,140,62,.28);
}

/* ============================================================
   THEME TOGGLE — sun/moon icon swap + labeled sidebar control
   ============================================================ */
#btn-theme .ic-sun, #btn-theme .ic-moon,
#sidebar-theme .ic-sun, #sidebar-theme .ic-moon { transition: opacity .2s ease, transform .25s ease; }
#btn-theme .ic-sun, #sidebar-theme .ic-sun { display: none; }
html[data-theme="dark"] #btn-theme .ic-moon,
html[data-theme="dark"] #sidebar-theme .ic-moon { display: none; }
html[data-theme="dark"] #btn-theme .ic-sun,
html[data-theme="dark"] #sidebar-theme .ic-sun { display: block; }
html[data-theme="dark"] #btn-theme { color: var(--gold-lit); }

/* sidebar: pin the bottom section so the theme toggle is ALWAYS visible —
   the nav scrolls internally instead of pushing the bottom off-screen */
.sidebar { overflow: hidden; }
.sidebar-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

/* labeled, full-width theme button (desktop) — clearly tappable, not a tiny icon */
.sidebar-bottom-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.sidebar-theme-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: 11px; cursor: pointer;
  font-family: var(--sans-font); font-size: 13px; font-weight: 600; letter-spacing: -.005em;
  color: var(--text-dim); background: var(--bg-2); border: 1px solid var(--line);
  transition: background .15s ease, color .15s ease;
}
.sidebar-theme-btn:hover { color: var(--text); background: var(--bg-3); }
.sidebar-theme-ico { display: grid; place-items: center; width: 18px; height: 18px; color: var(--gold-deep); flex-shrink: 0; }
html[data-theme="dark"] .sidebar-theme-btn { background: var(--bg-2); border-color: var(--line); color: var(--text-dim); }
html[data-theme="dark"] .sidebar-theme-btn:hover { background: var(--bg-3); color: var(--text); }
html[data-theme="dark"] .sidebar-theme-ico { color: var(--gold-lit); }
/* smooth surface transitions when flipping theme */
body, .top-bar, .sidebar, .dash-card, .kpi-card, .home-tile,
.record-card, .stock-card, .chart-card, .panel, .info-card,
.form-modal-panel, .login-form, input, textarea, select {
  transition: background-color .25s ease, color .2s ease, border-color .25s ease;
}

/* ============================================================
   DARK THEME — espresso surfaces + champagne accents.
   Same components, inverted surface tokens. Cards/forms read
   the same vars so the whole app shifts in one place.
   ============================================================ */
html[data-theme="dark"] {
  --gold:        #c8a358;
  --gold-soft:   #e0c27e;
  --gold-deep:   #e7d2a4;        /* gold-on-dark needs to be lighter to read */
  --gold-glow:   rgba(231,210,164,.26);
  --gold-lit:    #f1dca8;

  --bg-0:        #100c08;        /* page (deep espresso) */
  --bg-1:        #1a1611;        /* card */
  --bg-2:        #221b13;        /* raised */
  --bg-3:        #2c2419;        /* hover */

  --line:        rgba(231,210,164,.10);
  --line-soft:   rgba(231,210,164,.05);
  --hairline:    rgba(231,210,164,.10);

  --text:        #ece1ca;        /* warm bone */
  --text-dim:    #b8ad95;
  --text-mute:   #8a8170;
  --text-on-gold:#1f1505;

  --ok:          #5fbd8c;
  --warn:        #e0b46a;
  --danger:      #e88373;

  --shadow-sm: 0 1.5px 3px rgba(0,0,0,.30), 1px 3px 8px rgba(0,0,0,.22);
  --shadow:    0 1.5px 3px rgba(0,0,0,.32), 2px 8px 20px -4px rgba(0,0,0,.42);
  --shadow-lg: 0 2px 5px rgba(0,0,0,.34), 5px 22px 44px -14px rgba(0,0,0,.52);
}
html[data-theme="dark"] body {
  background:
    radial-gradient(880px 520px at 14% 0%, rgba(231,210,164,.07), transparent 60%),
    radial-gradient(135% 118% at 50% 28%, #15110d 0%, #110d09 46%, #0c0906 100%) fixed;
}
html[data-theme="dark"] ::selection { background: rgba(231,210,164,.24); color: #1a1611; }

/* shell */
html[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, #1a1611, #110d09);
  border-right: 1px solid var(--line);
}
html[data-theme="dark"] .top-bar {
  background: linear-gradient(180deg, rgba(20,16,11,.94), rgba(20,16,11,.78));
  border-bottom: 1px solid var(--line);
}
html[data-theme="dark"] .top-title { color: var(--text); }
html[data-theme="dark"] .icon-btn { color: var(--text-dim); }
html[data-theme="dark"] .icon-btn:hover { color: var(--text); background: rgba(231,210,164,.06); }
html[data-theme="dark"] .sidebar-nav a, html[data-theme="dark"] .sidebar-nav button { color: var(--text-dim); }
html[data-theme="dark"] .sidebar-nav a:hover, html[data-theme="dark"] .sidebar-nav button:hover { background: var(--bg-3); color: var(--text); }
html[data-theme="dark"] .sidebar-nav a.active, html[data-theme="dark"] .sidebar-nav .active {
  background: linear-gradient(150deg, #d9b56a, #b6862f); color: #1f1505;
  box-shadow: 2px 5px 13px rgba(120,86,28,.32), inset 0 1px 0 rgba(255,250,235,.45);
}
html[data-theme="dark"] .sidebar-nav a.active svg, html[data-theme="dark"] .sidebar-nav .active svg { color: #1f1505; }
html[data-theme="dark"] .global-search input { background: var(--bg-2); color: var(--text); }

/* buttons */
html[data-theme="dark"] .btn-ghost {
  background: rgba(231,210,164,.05); border: 1px solid var(--line); color: var(--text-dim);
}
html[data-theme="dark"] .btn-ghost:hover { color: var(--text); background: rgba(231,210,164,.10); }
html[data-theme="dark"] .badge-ok { color: var(--ok); background: rgba(95,189,140,.14); box-shadow: inset 0 0 0 1px rgba(95,189,140,.24); }

/* cards / panels — slightly lifted from page */
html[data-theme="dark"] .dash-card,
html[data-theme="dark"] .detail-section,
html[data-theme="dark"] .notif-card,
html[data-theme="dark"] .export-card,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .stock-detail-hero,
html[data-theme="dark"] .machine-hero,
html[data-theme="dark"] .record-detail {
  background: var(--bg-1); border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,236,206,.04);
}
html[data-theme="dark"] .dash-card-head h2,
html[data-theme="dark"] .detail-section-head h2 { color: var(--text); }

/* Espresso cards — exclude .kpi-gold so the champagne hero stays gold.
   In dark mode, gold against dark surrounds reads even MORE luxurious. */
html[data-theme="dark"] .kpi-card:not(.kpi-gold) {
  background: linear-gradient(158deg, #221b13, #15100a);
  border: 1px solid rgba(231,210,164,.08);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,236,206,.06);
}
/* Explicit re-assertion: keep the champagne gradient on the gold KPI in
   dark mode (so its dark-on-gold text stays readable). */
html[data-theme="dark"] .kpi-card.kpi-gold {
  background:
    linear-gradient(116deg, rgba(255,250,232,.30) 0%, transparent 32%, rgba(120,84,28,.16) 100%),
    linear-gradient(157deg, #f4e6bf 0%, #d9b56a 56%, #b6862f 100%);
  border: 1px solid rgba(180,140,62,.32);
  box-shadow: var(--shadow-lg), inset 0 1.5px 0 rgba(255,250,235,.5), inset 0 0 0 1px rgba(180,140,62,.2);
}
html[data-theme="dark"] .kpi-card.kpi-gold .kpi-value { color: #251c0b; }
html[data-theme="dark"] .kpi-card.kpi-gold .kpi-label { color: #2c220f; }

/* home tiles — espresso, EXCEPT the champagne primary (Yeni Servis) which
   stays gold so its dark text stays readable */
html[data-theme="dark"] .home-tile:not(.home-tile-primary) {
  background: var(--bg-1); border: 1px solid var(--line); color: var(--text);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,236,206,.04);
}
html[data-theme="dark"] .home-tile:not(.home-tile-primary) .home-tile-ico { color: var(--gold-lit); }
html[data-theme="dark"] .home-tile:not(.home-tile-primary) .home-tile-title { color: var(--text); }
html[data-theme="dark"] .home-tile:not(.home-tile-primary) .home-tile-sub { color: var(--text-mute); }
/* keep the champagne hero gold in dark mode — its dark text needs gold underneath */
html[data-theme="dark"] .home-tile-primary {
  background:
    linear-gradient(116deg, rgba(255,250,232,.30) 0%, transparent 32%, rgba(120,84,28,.14) 100%),
    linear-gradient(150deg, #f4e6bf 0%, #d9b56a 54%, #b6862f 100%);
  border: 1px solid rgba(180,140,62,.32);
  box-shadow: var(--shadow-lg), inset 0 1.5px 0 rgba(255,250,235,.5), inset 0 0 0 1px rgba(180,140,62,.2);
}

/* lists */
html[data-theme="dark"] .record-card,
html[data-theme="dark"] .records-list .record,
html[data-theme="dark"] .dash-list .dash-row,
html[data-theme="dark"] .stock-card,
html[data-theme="dark"] .stocks-list > * {
  background: var(--bg-1); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
html[data-theme="dark"] .stock-card .stock-name { color: var(--text); }

/* inputs */
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .filter-input,
html[data-theme="dark"] .filter-select,
html[data-theme="dark"] .filter-date,
html[data-theme="dark"] .parts-picker-search,
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: var(--text-mute); }
html[data-theme="dark"] .field > span,
html[data-theme="dark"] .field legend,
html[data-theme="dark"] label > span { color: var(--text-dim); }

/* modals + login */
html[data-theme="dark"] .form-modal-panel,
html[data-theme="dark"] .parts-picker-panel,
html[data-theme="dark"] .media-modal-content,
html[data-theme="dark"] .login-form {
  background: var(--bg-1); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,236,206,.05);
}
html[data-theme="dark"] .form-modal-backdrop,
html[data-theme="dark"] .parts-picker-backdrop,
html[data-theme="dark"] .media-modal-backdrop { background: rgba(0,0,0,.55); }
html[data-theme="dark"] .form-modal-title,
html[data-theme="dark"] .parts-picker-head h2 { color: var(--text); }

/* misc */
html[data-theme="dark"] .empty-hint,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .sync-meta,
html[data-theme="dark"] #sync-meta-text { color: var(--text-mute); }
html[data-theme="dark"] .admin-tile {
  background: var(--bg-1); border: 1px solid var(--line); color: var(--text);
}
html[data-theme="dark"] .admin-tile svg { color: var(--gold-lit); }
html[data-theme="dark"] .admin-date-chip {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text-dim);
}
html[data-theme="dark"] .dash-row-thumb,
html[data-theme="dark"] .record-thumb { border: 1px solid var(--line); }
html[data-theme="dark"] .mono,
html[data-theme="dark"] .serial,
html[data-theme="dark"] .dash-row-time,
html[data-theme="dark"] .record-time { color: var(--text-mute); }
html[data-theme="dark"] .dash-used-badge,
html[data-theme="dark"] .pill,
html[data-theme="dark"] .tag { color: var(--gold-lit); background: rgba(231,210,164,.10); }

/* performance: KPI strip on dark */
html[data-theme="dark"] .kpi-strip .kpi { background: var(--bg-1); border: 1px solid var(--line); }
html[data-theme="dark"] .kpi-strip .kpi-label { color: var(--text-mute); }
html[data-theme="dark"] .kpi-strip .kpi-value { color: var(--gold-lit); }
html[data-theme="dark"] .chart-card h3 { color: var(--text); }

/* greeting: gold gradient already perfect on either theme; ensure "Merhaba," is light on dark */
html[data-theme="dark"] .admin-greeting-name,
html[data-theme="dark"] .greeting h1,
html[data-theme="dark"] .page-title { color: var(--text); }
html[data-theme="dark"] .admin-greeting-hello,
html[data-theme="dark"] .page-kicker { color: var(--text-mute); }

/* brand-mark + login-name still use Ethnocentric — only color shifts */
html[data-theme="dark"] .sidebar-brand-name,
html[data-theme="dark"] .login-name { color: var(--text); }
html[data-theme="dark"] .sidebar-brand-sub { color: var(--text-mute); }

/* engineer name italic gold stays gold — already a clipped gradient */

/* ============================================================
   MACHINE FLEET — model photos + counts on the dashboard
   ============================================================ */
.dash-fleet { margin: 4px 0 6px; }
.dash-fleet-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 11px; }
.dash-fleet-head h2 {
  display: flex; align-items: center; gap: 9px;
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-mute);
}
.dash-fleet-head h2::before { content: ''; width: 4px; height: 14px; border-radius: 3px;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold-deep)); }
.dash-fleet-total { font-size: 12px; font-weight: 700; color: var(--gold-deep);
  background: rgba(181,140,56,.12); padding: 4px 11px; border-radius: 20px; }
/* tidy responsive grid — 2 per row (mobile) → 3 → 4 (desktop), no scrolling */
.fleet-list {
  display: grid; gap: 12px; padding: 2px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 560px) { .fleet-list { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .fleet-list { grid-template-columns: repeat(4, 1fr); } }
.fleet-card {
  text-align: left; cursor: pointer; min-width: 0;
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden; padding: 0;
  background: var(--bg-1); box-shadow: var(--shadow); font-family: var(--sans-font);
  transition: transform .15s ease, box-shadow .15s ease;
}
.fleet-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.fleet-photo { aspect-ratio: 4 / 3; background: #efe9dc; display: grid; place-items: center; overflow: hidden; }
.fleet-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fleet-body { padding: 11px 13px 13px; }
.fleet-model { font-size: 14px; font-weight: 700; letter-spacing: -.01em; color: var(--text); }
.fleet-count { margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--gold-deep); }
/* dark theme */
html[data-theme="dark"] .fleet-card { background: var(--bg-1); border-color: var(--line); }
html[data-theme="dark"] .fleet-photo { background: #221b13; }
html[data-theme="dark"] .fleet-count { color: var(--gold-lit); }
html[data-theme="dark"] .dash-fleet-total { background: rgba(231,210,164,.10); color: var(--gold-lit); }

/* ============================================================
   STOCK CARD BADGES — were hardcoded navy in styles.css; bring them
   into the espresso/gold language (they overlay the part photo, so the
   same treatment reads well in both light and dark themes)
   ============================================================ */
.stock-card-qty, .stock-card-uses {
  background: linear-gradient(158deg, rgba(26,21,17,.92), rgba(16,12,8,.92)) !important;
  color: var(--gold-lit) !important;
  box-shadow: inset 0 0 0 1px rgba(214,178,96,.22), 0 2px 6px rgba(20,12,4,.3) !important;
}
.stock-card-zero .stock-card-qty {
  background: linear-gradient(158deg, rgba(48,18,12,.92), rgba(30,10,6,.92)) !important;
  color: #f0a795 !important;
  box-shadow: inset 0 0 0 1px rgba(200,90,70,.3), 0 2px 6px rgba(20,12,4,.3) !important;
}
