/*
 * KobiMES "sade" package, after the sade reference (open and folded menu, plain page header, card grid).
 * Loaded after klasik.css. Every rule is scoped to body:has(.sm-tpl-sade); the default package is untouched.
 * Colours come from the --sd-* tokens; dark mode redefines them under html.dark.
 */

body:has(.sm-tpl-sade) {
  --sd-surface: #ffffff;
  --sd-page: #f2f4f7;
  --sd-line: #e3e8f0;
  --sd-ink: #0f2347;
  --sd-text: #1e2a3d;
  --sd-muted: #6b7a90;
  --sd-faint: #98a4b8;
  --sd-accent: #1f5fbf;
  --sd-accent-soft: #eaf1fb;
  --sd-navy: #0f2347;
  --sd-run: #16a34a;
  --sd-break: #f97316;
  --sd-idle: #64748b;
  --sd-off: #334155;
  --sd-maint: #ca8a04;
  --sd-danger: #dc2626;
  --sd-ok: #16a34a;
}
html.dark body:has(.sm-tpl-sade) {
  --sd-surface: #2b3036;
  --sd-page: #1f2328;
  --sd-line: #434a52;
  --sd-ink: #f1f4f8;
  --sd-text: #dfe4ea;
  --sd-muted: #adb5bd;
  --sd-faint: #8f979e;
  --sd-accent: #4c8dff;
  --sd-accent-soft: #2c3a52;
  --sd-navy: #0b1a33;
  --sd-run: #4ade80;
  --sd-break: #fb923c;
  --sd-idle: #94a3b8;
  --sd-off: #cbd5e1;
  --sd-maint: #facc15;
  --sd-danger: #f87171;
  --sd-ok: #4ade80;
}

/* ------------------------------------------------------------------ Sidebar: navy, flat. Folded = icon rail */

/* open width: narrower than the default 250px; Filament and the top bar read --sidebar-width */
body:has(.sm-tpl-sade) { --sidebar-width: 220px; }

body:has(.sm-tpl-sade) .fi-main-sidebar {
  background: var(--sd-navy) !important;
  background-image: none !important;
  border-right: 0;
  box-shadow: none;
}
body:has(.sm-tpl-sade) .fi-main-sidebar::before,
body:has(.sm-tpl-sade) .fi-main-sidebar::after { display: none; }
body:has(.sm-tpl-sade) .fi-main-sidebar .fi-sidebar-header,
body:has(.sm-tpl-sade) .fi-main-sidebar .fi-sidebar-nav,
body:has(.sm-tpl-sade) .fi-main-sidebar .fi-sidebar-footer { border-color: rgba(255, 255, 255, .08); background: transparent; box-shadow: none; }
body:has(.sm-tpl-sade) .fi-main-sidebar .fi-sidebar-header .fi-logo,
body:has(.sm-tpl-sade) .fi-main-sidebar .sm-brand-logo { color: #fff; }
body:has(.sm-tpl-sade) .fi-main-sidebar .fi-sidebar-group-label { color: #6f86a8; }
body:has(.sm-tpl-sade) .fi-main-sidebar .fi-sidebar-item-label,
body:has(.sm-tpl-sade) .fi-main-sidebar .fi-sidebar-item-icon,
body:has(.sm-tpl-sade) .fi-main-sidebar .fi-sidebar-group-collapse-btn { color: #c9d6ea; }
body:has(.sm-tpl-sade) .fi-main-sidebar .fi-sidebar-item-btn { border-radius: 10px; }
body:has(.sm-tpl-sade) .fi-main-sidebar .fi-sidebar-item-btn:hover { background-color: rgba(255, 255, 255, .08); }
body:has(.sm-tpl-sade) .fi-main-sidebar .fi-sidebar-item-btn:hover .fi-sidebar-item-label,
body:has(.sm-tpl-sade) .fi-main-sidebar .fi-sidebar-item-btn:hover .fi-sidebar-item-icon { color: #fff; }
/* the active item is a solid accent block, as in the reference */
body:has(.sm-tpl-sade) .fi-main-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn { background-color: var(--sd-accent); }
body:has(.sm-tpl-sade) .fi-main-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label,
body:has(.sm-tpl-sade) .fi-main-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-icon { color: #fff; }
/* sub-items: a single hairline, like the reference */
body:has(.sm-tpl-sade) .fi-main-sidebar .fi-sidebar-item .fi-sidebar-item-btn .fi-sidebar-item-label { font-size: 14px; }
body:has(.sm-tpl-sade) .fi-main-sidebar .sm-nav-heading > .fi-sidebar-item-btn .fi-sidebar-item-label,
body:has(.sm-tpl-sade) .fi-main-sidebar .sm-nav-heading > .fi-sidebar-item-btn:hover .fi-sidebar-item-label { font-size: 11px; color: #5b7296; }

/* ------------------------------------------------------------------ Top bar: bell and user, plus the pills when folded */

body:has(.sm-tpl-sade) .fi-topbar { background: var(--sd-surface); box-shadow: none; border-bottom: 1px solid var(--sd-line); }
body:has(.sm-tpl-sade) .fi-topbar .sm-navbar-link { color: var(--sd-muted); }

body:has(.sm-tpl-sade) .sd-nav { display: flex; align-items: center; gap: 12px; }
body:has(.sm-tpl-sade) .sd-nav-toggle {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  border: 1px solid var(--sd-line); background: var(--sd-surface); color: var(--sd-muted);
}
body:has(.sm-tpl-sade) .sd-nav-toggle svg { width: 18px; height: 18px; }
body:has(.sm-tpl-sade) .sd-pills {
  display: flex; gap: 2px; padding: 4px; border-radius: 999px;
  background: var(--sd-surface); border: 1px solid var(--sd-line);
}
body:has(.sm-tpl-sade) .sd-pill {
  height: 34px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center;
  color: var(--sd-muted); font-size: 14px; text-decoration: none; white-space: nowrap;
}
body:has(.sm-tpl-sade) .sd-pill:hover { color: var(--sd-ink); }
body:has(.sm-tpl-sade) .sd-pill.is-active { background: var(--sd-navy); color: #fff; font-weight: 500; }

/* ------------------------------------------------------------------ Page background and header */

body:has(.sm-tpl-sade) .fi-body { background: var(--sd-page); }

body:has(.sm-tpl-sade) .sd { display: grid; gap: 16px; }
body:has(.sm-tpl-sade) .sd-stack { display: grid; gap: 16px; }
body:has(.sm-tpl-sade) .sd-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }

body:has(.sm-tpl-sade) .sd-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
body:has(.sm-tpl-sade) .sd-eyebrow { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--sd-muted); letter-spacing: .02em; text-transform: uppercase; }
body:has(.sm-tpl-sade) .sd-title { margin: 6px 0 0; font-size: 40px; font-weight: 500; letter-spacing: -.02em; color: var(--sd-ink); line-height: 1.15; }
body:has(.sm-tpl-sade) .sd-sub { margin: 6px 0 0; font-size: 15px; color: var(--sd-muted); }
body:has(.sm-tpl-sade) .sd-actions { display: flex; gap: 10px; }
body:has(.sm-tpl-sade) .sd-btn {
  height: 42px; padding: 0 18px; border-radius: 999px; display: inline-flex; align-items: center;
  border: 1px solid var(--sd-line); background: var(--sd-surface); color: var(--sd-text); font-weight: 500; text-decoration: none;
}
body:has(.sm-tpl-sade) .sd-btn.is-dark { background: var(--sd-navy); border-color: var(--sd-navy); color: #fff; }

/* ------------------------------------------------------------------ Cards */

body:has(.sm-tpl-sade) .sd-card {
  background: var(--sd-surface); border: 1px solid var(--sd-line); border-radius: 16px;
  padding: 20px 22px; color: var(--sd-text); min-width: 0;
}
body:has(.sm-tpl-sade) .sd-empty { color: var(--sd-muted); font-size: 14px; }
body:has(.sm-tpl-sade) .sd-card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
body:has(.sm-tpl-sade) .sd-card-h h2 { margin: 0; flex: 1; font-size: 16px; font-weight: 500; color: var(--sd-ink); }
body:has(.sm-tpl-sade) .sd-card-h h2 { display: flex; align-items: center; gap: 8px; }
/* heroicons inside the sade page are sized here; without it they render at full width */
body:has(.sm-tpl-sade) .sd svg,
body:has(.sm-tpl-sade) .sd-card svg { width: 18px; height: 18px; flex-shrink: 0; }
body:has(.sm-tpl-sade) .sd-card-h h2 svg { color: var(--sd-accent); }
body:has(.sm-tpl-sade) .sd-muted { font-size: 12px; color: var(--sd-muted); }
body:has(.sm-tpl-sade) .sd-open { color: var(--sd-muted); display: inline-flex; }
body:has(.sm-tpl-sade) .sd-open:hover { color: var(--sd-accent); }
body:has(.sm-tpl-sade) .sd-open svg { width: 16px; height: 16px; }
body:has(.sm-tpl-sade) .sd-subtitle { margin: 0 0 8px; font-size: 13px; font-weight: 500; color: var(--sd-ink); }
body:has(.sm-tpl-sade) .sd-note { margin-top: 12px; font-size: 12.5px; color: var(--sd-muted); }
/* Bakım planı: past / now / future, one line each */
body:has(.sm-tpl-sade) .sd-flow { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
body:has(.sm-tpl-sade) .sd-flow-item { display: grid; grid-template-columns: 9.5rem 1fr auto; gap: 10px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--sd-line, rgba(127,127,127,.18)); font-size: 13px; }
body:has(.sm-tpl-sade) .sd-flow-when { color: var(--sd-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
body:has(.sm-tpl-sade) .sd-flow-what { min-width: 0; overflow-wrap: anywhere; }
body:has(.sm-tpl-sade) .sd-flow-tag { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: rgba(127,127,127,.12); white-space: nowrap; }
body:has(.sm-tpl-sade) .sd-flow-item.is-past { opacity: .6; }
body:has(.sm-tpl-sade) .sd-flow-item.is-now .sd-flow-tag { background: #ffc107; color: #1f2d3d; }
body:has(.sm-tpl-sade) .sd-flow-item.is-future .sd-flow-tag { background: rgba(31,95,191,.14); }
@media (max-width: 640px) { body:has(.sm-tpl-sade) .sd-flow-item { grid-template-columns: 1fr; gap: 2px; } }
/* tarihi geçen bakım: uyarı, en üstte */
body:has(.sm-tpl-sade) .sd-flow-item.is-overdue { opacity: 1; background: rgba(220,53,69,.08); border-top-color: rgba(220,53,69,.35); padding-left: 8px; border-left: 3px solid var(--sd-danger); }
body:has(.sm-tpl-sade) .sd-flow-item.is-overdue .sd-flow-tag { background: var(--sd-danger); color: #fff; font-weight: 600; }
body:has(.sm-tpl-sade) .sd-flow-item.is-overdue .sd-flow-when { color: var(--sd-danger); font-weight: 600; }
body:has(.sm-tpl-sade) .sd-flow-count { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--sd-danger); color: #fff; margin-left: auto; margin-right: 8px; }
body:has(.sm-tpl-sade) .sd-ok { font-size: 13px; color: var(--sd-ok); }
body:has(.sm-tpl-sade) .sd-danger { color: var(--sd-danger); }

/* Canlı: four figures, one card each */
body:has(.sm-tpl-sade) .sd-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
body:has(.sm-tpl-sade) .sd-kpis.is-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
body:has(.sm-tpl-sade) .sd-stat {
  background: var(--sd-surface); border: 1px solid var(--sd-line); border-radius: 16px; padding: 18px 20px;
}
/* live cards: a coloured edge, the status icon in a tinted circle, the note under a line (colour = --c) */
body:has(.sm-tpl-sade) .sd-kpis .sd-stat { border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 4%, var(--sd-surface)); }
body:has(.sm-tpl-sade) .sd-stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
body:has(.sm-tpl-sade) .sd-stat-k { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--sd-muted); }
body:has(.sm-tpl-sade) .sd-stat-i { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); flex-shrink: 0; }
body:has(.sm-tpl-sade) .sd-stat-i svg { width: 18px; height: 18px; }
body:has(.sm-tpl-sade) .sd-kpis .sd-stat-d { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--sd-line); }
body:has(.sm-tpl-sade) .sd-stat-v { font-size: 36px; font-weight: 500; margin-top: 6px; color: var(--sd-ink); font-variant-numeric: tabular-nums; }
body:has(.sm-tpl-sade) .sd-stat-d { font-size: 12.5px; color: var(--sd-muted); margin-top: 2px; }
body:has(.sm-tpl-sade) .sd-run { --c: var(--sd-run); }
body:has(.sm-tpl-sade) .sd-break { --c: var(--sd-break); }
body:has(.sm-tpl-sade) .sd-idle { --c: var(--sd-idle); }
body:has(.sm-tpl-sade) .sd-off { --c: var(--sd-off); }
body:has(.sm-tpl-sade) .sd-maint { --c: var(--sd-maint); }
body:has(.sm-tpl-sade) .sd-offjob { --c: var(--sd-danger); }

/* tables: rows and hairlines only */
body:has(.sm-tpl-sade) .sd-table { width: 100%; border-collapse: collapse; font-size: 14px; }
body:has(.sm-tpl-sade) .sd-table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--sd-muted); padding: 8px; border-bottom: 1px solid var(--sd-line); }
body:has(.sm-tpl-sade) .sd-table td { padding: 10px 8px; border-bottom: 1px solid var(--sd-line); }
body:has(.sm-tpl-sade) .sd-table tr:last-child td { border-bottom: 0; }
body:has(.sm-tpl-sade) .sd-table .num { text-align: right; font-variant-numeric: tabular-nums; }

body:has(.sm-tpl-sade) .sd-kv { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--sd-line); font-size: 14px; }
body:has(.sm-tpl-sade) .sd-kv b { font-weight: 500; font-variant-numeric: tabular-nums; color: var(--sd-ink); }

/* OEE and shift tiles are drawn by kobimes-kpi.js / kobimes-oee.js as .lx-kpi; restyle them inside .sd only */
body:has(.sm-tpl-sade) .sd-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
body:has(.sm-tpl-sade) .sd-tiles .lx-kpi { box-shadow: none; border: 1px solid var(--sd-line); border-radius: 12px; background: var(--sd-surface); }
body:has(.sm-tpl-sade) .sd-chart { margin-top: 14px; height: 180px; }
body:has(.sm-tpl-sade) .sd-chart canvas { width: 100% !important; height: 100% !important; }
body:has(.sm-tpl-sade) #hpIssues .mk-chips { margin-bottom: 10px; }

@media (max-width: 1100px) {
  body:has(.sm-tpl-sade) :is(.sd-kpis, .sd-kpis.is-6) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  body:has(.sm-tpl-sade) .sd-title { font-size: 30px; }
  body:has(.sm-tpl-sade) .sd-pill { padding: 0 12px; }
}

/* ------------------------------------------------------------------ Lists (Filament tables) */

body:has(.sm-tpl-sade) .fi-resource-list-records-page .fi-header-heading { font-size: 40px; font-weight: 500; letter-spacing: -.02em; color: var(--sd-ink); }
body:has(.sm-tpl-sade) .fi-resource-list-records-page .fi-header-actions .fi-btn { border-radius: 999px; height: 40px; padding: 0 16px; }
body:has(.sm-tpl-sade) .fi-ta-ctn { background: var(--sd-surface); border: 1px solid var(--sd-line); border-radius: 16px; overflow: hidden; box-shadow: none; }
body:has(.sm-tpl-sade) .fi-ta-header-cell-label { font-size: 12px; font-weight: 500; color: var(--sd-muted); }
body:has(.sm-tpl-sade) .fi-ta-row { border-color: var(--sd-line); }
body:has(.sm-tpl-sade) .fi-ta-row:hover { background-color: var(--sd-accent-soft); }
body:has(.sm-tpl-sade) .fi-ta-header-ctn { background: var(--sd-surface); }

/* ------------------------------------------------------------------ Forms (create / edit / correct pages and modals)
 * One look for every form: plain cards without the 3px line, the label above a bordered 44px input,
 * suffix units inside the input, row tables as plain rows (no cell borders around the inputs), pill buttons.
 * The klasik compact form table (.sm-form-table) is flattened into the same grid. */

body:has(.sm-tpl-sade) .fi-section:not(.fi-section-not-contained) {
  border: 1px solid var(--sd-line); border-radius: 16px; box-shadow: none; background: var(--sd-surface);
}
body:has(.sm-tpl-sade) .fi-section:not(.fi-section-not-contained)::before { display: none; }
body:has(.sm-tpl-sade) .fi-section-header { padding: 20px 24px 4px; border: 0; }
body:has(.sm-tpl-sade) .fi-section-content-ctn { border: 0; }
body:has(.sm-tpl-sade) .fi-section-content { padding: 16px 24px 24px; }
body:has(.sm-tpl-sade) .fi-section-header-heading { font-size: 16px; font-weight: 600; color: var(--sd-ink); }
body:has(.sm-tpl-sade) .fi-section-header-description { font-size: 13px; color: var(--sd-muted); margin-top: 2px; }
body:has(.sm-tpl-sade) .fi-section-header-icon { color: var(--sd-accent); }

body:has(.sm-tpl-sade) .fi-fo-field-label-content { font-size: 13px; font-weight: 500; color: var(--sd-ink); }
body:has(.sm-tpl-sade) :is(.fi-fo-field-label-required-mark, .fi-fo-table-repeater-header-required-mark) { color: var(--sd-faint); }
body:has(.sm-tpl-sade) .fi-fo-field-wrp-hint, body:has(.sm-tpl-sade) .fi-sc-text { font-size: 12px; color: var(--sd-muted); }

body:has(.sm-tpl-sade) .fi-fo-field .fi-input-wrp {
  min-height: 44px; border: 1px solid var(--sd-line); border-radius: 10px; background: var(--sd-surface);
  box-shadow: none !important; transition: border-color .15s, box-shadow .15s;
}
body:has(.sm-tpl-sade) .fi-fo-field .fi-input-wrp:focus-within { border-color: var(--sd-accent); box-shadow: 0 0 0 3px var(--sd-accent-soft) !important; }
body:has(.sm-tpl-sade) .fi-fo-field .fi-input-wrp.fi-invalid { border-color: var(--sd-danger); }
body:has(.sm-tpl-sade) .fi-fo-field .fi-input-wrp.fi-disabled { background: var(--sd-page); }
body:has(.sm-tpl-sade) .fi-fo-field .fi-input, body:has(.sm-tpl-sade) .fi-fo-field .fi-select-input { font-size: 14px; color: var(--sd-text); }
body:has(.sm-tpl-sade) .fi-fo-field .fi-input::placeholder { color: var(--sd-faint); }
body:has(.sm-tpl-sade) .fi-fo-field .fi-input-wrp-suffix, body:has(.sm-tpl-sade) .fi-fo-field .fi-input-wrp-prefix { border: 0; color: var(--sd-muted); font-size: 13px; }
body:has(.sm-tpl-sade) .fi-fo-field-wrp-error-message { font-size: 12px; color: var(--sd-danger); }

/* row tables (Duruşlar, Fire, rota adımları): header = small labels, rows = inputs side by side, no grid lines */
body:has(.sm-tpl-sade) .fi-fo-table-repeater > table { box-shadow: none; background: transparent; border-spacing: 0; overflow: visible; border-radius: 0; }
body:has(.sm-tpl-sade) .fi-fo-table-repeater > table > thead > tr > th {
  background: transparent; border: 0; padding: 0 12px 6px 0; text-align: left;
  font-size: 13px; font-weight: 500; color: var(--sd-ink);
}
body:has(.sm-tpl-sade) .fi-fo-table-repeater > table > tbody > tr { border: 0; }
body:has(.sm-tpl-sade) .fi-fo-table-repeater > table > tbody > tr > td { border: 0; padding: 0 12px 10px 0; vertical-align: top; }
body:has(.sm-tpl-sade) .fi-fo-table-repeater > table > tbody > tr > td:last-child { padding-right: 0; width: 1%; }
body:has(.sm-tpl-sade) .fi-fo-table-repeater > table > :is(thead, tbody) > tr > :is(th, td) { border-inline: 0; }
body:has(.sm-tpl-sade) .fi-fo-table-repeater-actions-cell { padding-top: 10px !important; }
body:has(.sm-tpl-sade) .fi-fo-repeater-add, body:has(.sm-tpl-sade) .fi-fo-table-repeater-add { justify-content: flex-start; margin-top: 2px; }
body:has(.sm-tpl-sade) :is(.fi-fo-repeater-add, .fi-fo-table-repeater-add) .fi-btn {
  box-shadow: none; background: transparent; border: 1px dashed var(--sd-line); border-radius: 10px; color: var(--sd-accent); font-weight: 500;
}
body:has(.sm-tpl-sade) :is(.fi-fo-repeater-add, .fi-fo-table-repeater-add) .fi-btn:hover { border-color: var(--sd-accent); background: var(--sd-accent-soft); }

/* check lists (bakım kontrol listesi): one bordered box, hairline rows, borderless inputs, checkbox centred */
body:has(.sm-tpl-sade) .sm-checklist > table { border: 1px solid var(--sd-line); border-radius: 10px; border-collapse: separate; overflow: hidden; }
body:has(.sm-tpl-sade) .sm-checklist > table > thead > tr > th {
  padding: 8px 12px; background: var(--sd-page); border-bottom: 1px solid var(--sd-line); font-size: 12px; color: var(--sd-muted);
}
body:has(.sm-tpl-sade) .sm-checklist > table > tbody > tr > td { padding: 0 12px; vertical-align: middle; }
body:has(.sm-tpl-sade) .sm-checklist > table > tbody > tr + tr > td { border-top: 1px solid var(--sd-line); }
body:has(.sm-tpl-sade) .sm-checklist .fi-fo-table-repeater-actions-cell { padding-top: 0 !important; }
body:has(.sm-tpl-sade) .sm-checklist .fi-fo-field .fi-input-wrp { min-height: 40px; border: 0; border-radius: 0; background: transparent; }
body:has(.sm-tpl-sade) .sm-checklist .fi-fo-field .fi-input-wrp:focus-within { box-shadow: none !important; }
body:has(.sm-tpl-sade) .sm-checklist .fi-fo-field .fi-input-wrp.fi-invalid { box-shadow: inset 2px 0 var(--sd-danger) !important; }
body:has(.sm-tpl-sade) .sm-checklist .fi-fo-field .fi-input { padding-inline: 0; }

/* klasik's compact form table → the same plain grid */
body:has(.sm-tpl-sade) .sm-form-table { box-shadow: none; background: transparent; border-radius: 0; overflow: visible; }
body:has(.sm-tpl-sade) .sm-form-table > .fi-sc { gap: 16px 20px; background: transparent; }
body:has(.sm-tpl-sade) .sm-form-table > .fi-sc > .fi-grid-col { background: transparent; }
body:has(.sm-tpl-sade) .sm-form-table .fi-fo-field { row-gap: 8px; height: auto; }
body:has(.sm-tpl-sade) .sm-form-table .fi-fo-field-label-col { padding: 0; background: transparent; border: 0; }
body:has(.sm-tpl-sade) .sm-form-table .fi-fo-field-label-ctn { justify-content: flex-start; }
body:has(.sm-tpl-sade) .sm-form-table .fi-fo-field-content-col { padding: 0; }
body:has(.sm-tpl-sade) .sm-form-table .fi-fo-field .fi-input-wrp { border-radius: 10px; background: var(--sd-surface); }
body:has(.sm-tpl-sade) .sm-form-table .fi-fo-field-wrp-error-message { padding: 0; }

/* page header and the Kaydet / İptal row */
body:has(.sm-tpl-sade) .fi-page:is([class*=fi-resource-]):not(.fi-resource-list-records-page) .fi-header-heading { font-size: 28px; font-weight: 500; letter-spacing: -.01em; color: var(--sd-ink); }
body:has(.sm-tpl-sade) .fi-header-subheading { font-size: 14px; color: var(--sd-muted); }
body:has(.sm-tpl-sade) :is(.fi-main form > .fi-sc > .fi-grid-col > .fi-sc-component > .fi-sc-actions, .fi-modal-footer-actions) .fi-btn { border-radius: 999px; min-height: 42px; padding: 0 20px; font-size: 14px; }
body:has(.sm-tpl-sade) :is(.fi-main form > .fi-sc > .fi-grid-col > .fi-sc-component > .fi-sc-actions, .fi-modal-footer-actions) .fi-btn.fi-color-primary { background: var(--sd-navy); }
body:has(.sm-tpl-sade) :is(.fi-main form > .fi-sc > .fi-grid-col > .fi-sc-component > .fi-sc-actions, .fi-modal-footer-actions) .fi-btn.fi-color-primary:hover { background: var(--sd-accent); }
html.dark body:has(.sm-tpl-sade) :is(.fi-main form > .fi-sc > .fi-grid-col > .fi-sc-component > .fi-sc-actions, .fi-modal-footer-actions) .fi-btn.fi-color-primary { background: var(--sd-accent); }

/* ------------------------------------------------------------------ Canlı (templates/sade/.../live.blade.php)
 * Same header as the home page; four narrow status tiles (icon · label · count, the note is the tooltip) filter
 * the grid. Station card: status edge and pill in the state colour (--c), summary (iş emri · adım, personel),
 * start → end with % and a thin bar. */

body:has(.sd-lv) .fi-page > .fi-page-header-main-ctn > .fi-header { display: none; }
body:has(.sm-tpl-sade) .sd-lv .sd-btn { gap: 8px; cursor: pointer; }

body:has(.sm-tpl-sade) .sd-lv .sd-kpis { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 180px); gap: 10px; }
body:has(.sm-tpl-sade) .sd-lv .sd-all { --c: var(--sd-accent); }
body:has(.sm-tpl-sade) .sd-lv .sd-stat {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; border-left-width: 3px;
  text-align: left; cursor: pointer; font: inherit; transition: box-shadow .15s, transform .15s;
}
body:has(.sm-tpl-sade) .sd-lv .sd-stat:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(15, 35, 71, .08); }
body:has(.sm-tpl-sade) .sd-lv .sd-stat.is-picked { box-shadow: 0 0 0 2px var(--c); }
body:has(.sm-tpl-sade) .sd-lv .sd-stat-i { width: 28px; height: 28px; }
body:has(.sm-tpl-sade) .sd-lv .sd-stat-i svg { width: 15px; height: 15px; }
body:has(.sm-tpl-sade) .sd-lv .sd-stat-k { flex: 1; min-width: 0; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body:has(.sm-tpl-sade) .sd-lv .sd-stat-v { margin: 0; font-size: 22px; font-weight: 600; line-height: 1; }

body:has(.sm-tpl-sade) .sd-lv-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
body:has(.sm-tpl-sade) .sd-lv-card {
  display: flex; flex-direction: column; min-width: 0; color: var(--sd-text);
  background: var(--sd-surface); border: 1px solid var(--sd-line); border-top: 3px solid var(--c); border-radius: 12px;
  padding: 10px 14px; cursor: grab;
}
body:has(.sm-tpl-sade) .sd-lv-card.is-dragging { opacity: .5; }
body:has(.sm-tpl-sade) .sd-lv-card:is(.sd-idle, .sd-off) { background: color-mix(in srgb, var(--sd-page) 50%, var(--sd-surface)); }
body:has(.sm-tpl-sade) .sd-lv-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
body:has(.sm-tpl-sade) .sd-lv-name { min-width: 0; }
body:has(.sm-tpl-sade) .sd-lv-name b { display: block; font-size: 15px; font-weight: 600; color: var(--sd-ink); white-space: nowrap; }
body:has(.sm-tpl-sade) .sd-lv-name span { display: block; font-size: 12px; color: var(--sd-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body:has(.sm-tpl-sade) .sd-lv-state {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent);
}
body:has(.sm-tpl-sade) .sd-lv-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
body:has(.sm-tpl-sade) .sd-run .sd-lv-state::before { animation: sd-pulse 1.6s ease-in-out infinite; }
body:has(.sm-tpl-sade) .sd-lv-state.is-long { color: #fff; background: var(--sd-danger); }
@keyframes sd-pulse { 50% { opacity: .3; } }

body:has(.sm-tpl-sade) .sd-lv-sum { margin-top: 8px; font-size: 13px; color: var(--sd-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body:has(.sm-tpl-sade) .sd-lv-card .lx-machine { margin-top: 8px; padding: 0; border: 0; background: none; font-size: 12px; }
body:has(.sm-tpl-sade) .sd-lv-card .lx-machine.is-mismatch .lx-machine-note { color: var(--sd-danger); }
body:has(.sm-tpl-sade) .sd-lv-card.sd-offjob { border-color: var(--sd-danger); }
body:has(.sm-tpl-sade) .sd-lv-sum a { color: var(--sd-accent); font-weight: 600; text-decoration: none; }
body:has(.sm-tpl-sade) .sd-lv-sum a:hover { text-decoration: underline; }
body:has(.sm-tpl-sade) .sd-lv-sum span { display: block; color: var(--sd-text); overflow: hidden; text-overflow: ellipsis; }

body:has(.sm-tpl-sade) .sd-lv-f { margin-top: auto; padding-top: 8px; }
body:has(.sm-tpl-sade) .sd-lv-card > .sd-lv-f { border-top: 1px solid var(--sd-line); margin-top: auto; }
/* the footer sits at the bottom, so time and bar line up across a row even when one card has a machine row (x-lx.machine) */
body:has(.sm-tpl-sade) .sd-lv-card > :nth-last-child(2) { margin-bottom: 8px; }
body:has(.sm-tpl-sade) .sd-lv-time { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--sd-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
body:has(.sm-tpl-sade) .sd-lv-time b { color: var(--sd-ink); font-weight: 600; }
body:has(.sm-tpl-sade) .sd-lv-time b.sd-danger { color: var(--sd-danger); }
body:has(.sm-tpl-sade) .sd-lv-pct { font-size: 13px; }
body:has(.sm-tpl-sade) .sd-lv-bar { margin-top: 6px; height: 4px; border-radius: 999px; background: var(--sd-line); overflow: hidden; }
body:has(.sm-tpl-sade) .sd-lv-bar span { display: block; height: 100%; border-radius: inherit; background: var(--sd-run); transition: width .4s; }
body:has(.sm-tpl-sade) .sd-lv-bar.is-warn span { background: #f59e0b; }
body:has(.sm-tpl-sade) .sd-lv-bar.is-danger span { background: var(--sd-danger); }
body:has(.sm-tpl-sade) .sd-lv-bar.is-muted span { background: var(--sd-idle); }
body:has(.sm-tpl-sade) .sd-lv-nomatch { text-align: center; padding: 24px 0; }

@media (max-width: 1000px) {
  body:has(.sm-tpl-sade) .sd-lv .sd-kpis { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (max-width: 700px) {
  body:has(.sm-tpl-sade) .sd-lv .sd-head { align-items: flex-start; }
  body:has(.sm-tpl-sade) .sd-lv .sd-lv-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------------ Raporlar (MES KPI, Grafik rapor, OEE, Üretim İzleme, Denetim kaydı)
 * The report pages keep their markup and scripts; only the look follows the sade line: plain tiles with a thin
 * accent edge, 40px rounded inputs, pill buttons, hairline tables, soft status bars, tinted small boxes. */

body:has(.sm-tpl-sade) .fi-page:not([class*=fi-resource-]) .fi-header-heading { font-size: 28px; font-weight: 500; letter-spacing: -.01em; color: var(--sd-ink); }

/* KPI tiles (also drawn by kobimes-kpi.js / -oee.js): no shadow, left edge instead of the 3px top line */
body:has(.sm-tpl-sade) .lx-kpi {
  background: var(--sd-surface); box-shadow: none; border: 1px solid var(--sd-line); border-left: 3px solid var(--lx-accent);
  border-radius: 12px; padding: 12px 14px 10px;
}
body:has(.sm-tpl-sade) .lx-kpi-label { font-weight: 600; color: var(--sd-muted); }
body:has(.sm-tpl-sade) .lx-kpi-value { font-weight: 500; color: var(--sd-ink); }
body:has(.sm-tpl-sade) .lx-kpi.is-warn .lx-kpi-value { color: var(--sd-break); }
body:has(.sm-tpl-sade) .lx-kpi-foot { border-top-color: var(--sd-line); color: var(--sd-muted); }
body:has(.sm-tpl-sade) .lx-kpi-foot b { color: var(--sd-ink); font-weight: 600; }

/* filters: same inputs as the forms, pill buttons */
body:has(.sm-tpl-sade) .mk-label { font-size: 13px; font-weight: 500; color: var(--sd-ink); }
body:has(.sm-tpl-sade) .mk-input {
  min-height: 40px; border: 1px solid var(--sd-line); border-radius: 10px; background: var(--sd-surface); color: var(--sd-text);
}
body:has(.sm-tpl-sade) .mk-input:focus { border-color: var(--sd-accent); box-shadow: 0 0 0 3px var(--sd-accent-soft); }
body:has(.sm-tpl-sade) .mk-btn { min-height: 40px; border-radius: 999px; border-color: var(--sd-line); background: var(--sd-surface); color: var(--sd-text); font-weight: 500; padding: .35rem 1rem; }
body:has(.sm-tpl-sade) .mk-btn:hover:not(:disabled) { border-color: var(--sd-accent); color: var(--sd-accent); }
body:has(.sm-tpl-sade) .mk-btn.is-primary { background: var(--sd-navy); border-color: var(--sd-navy); color: #fff; }
body:has(.sm-tpl-sade) .mk-btn.is-primary:hover:not(:disabled) { background: var(--sd-accent); border-color: var(--sd-accent); color: #fff; }
html.dark body:has(.sm-tpl-sade) .mk-btn.is-primary { background: var(--sd-accent); border-color: var(--sd-accent); }
body:has(.sm-tpl-sade) .mk-btn.is-xs { min-height: 28px; padding: .1rem .7rem; }
body:has(.sm-tpl-sade) .mk-filter-sub { border-top-color: var(--sd-line); }
body:has(.sm-tpl-sade) .mk-seg { border-color: var(--sd-line); border-radius: 999px; }
body:has(.sm-tpl-sade) .mk-seg button + button { border-left-color: var(--sd-line); }
body:has(.sm-tpl-sade) .mk-seg button.is-active { background: var(--sd-navy); }
html.dark body:has(.sm-tpl-sade) .mk-seg button.is-active { background: var(--sd-accent); }

/* status bars: soft, rounded */
body:has(.sm-tpl-sade) .mk-status { border-radius: 10px; font-size: 13px; }
body:has(.sm-tpl-sade) .mk-status.is-loading { background: var(--sd-accent-soft); color: var(--sd-accent); }

/* report tables: rows and hairlines, muted small headers, the totals row on the page tint */
body:has(.sm-tpl-sade) :is(.mk-dt, .lx-table) th,
body:has(.sm-tpl-sade) :is(.mk-dt, .lx-table) td { border: 0; border-bottom: 1px solid var(--sd-line); }
body:has(.sm-tpl-sade) :is(.mk-dt, .lx-table) th { background: transparent; font-size: 12px; font-weight: 500; color: var(--sd-muted); }
body:has(.sm-tpl-sade) :is(.mk-dt, .lx-table) tbody tr:hover { background: var(--sd-accent-soft); }
body:has(.sm-tpl-sade) .mk-dt tfoot td { background: var(--sd-page); border-top: 1px solid var(--sd-line); font-weight: 600; }
body:has(.sm-tpl-sade) .mk-dt tr.is-selected td { background: var(--sd-accent-soft); }

/* Grafik rapor small boxes: tinted, not solid (the colour stays the meaning) */
body:has(.sm-tpl-sade) .lx-smallbox {
  --c: var(--sd-accent); border-radius: 12px; box-shadow: none; color: var(--sd-text);
  background: color-mix(in srgb, var(--c) 7%, var(--sd-surface)); border: 1px solid var(--sd-line); border-left: 3px solid var(--c);
}
body:has(.sm-tpl-sade) .lx-smallbox h3 { font-weight: 500; color: var(--sd-ink); }
body:has(.sm-tpl-sade) .lx-smallbox p { color: var(--sd-muted); }
body:has(.sm-tpl-sade) .lx-smallbox-icon { color: var(--c); opacity: .25; width: 48px; height: 48px; }
body:has(.sm-tpl-sade) .lx-smallbox.is-info { --c: #0891b2; }
body:has(.sm-tpl-sade) .lx-smallbox.is-success { --c: var(--sd-run); }
body:has(.sm-tpl-sade) .lx-smallbox.is-primary { --c: var(--sd-accent); }
body:has(.sm-tpl-sade) .lx-smallbox.is-warning { --c: #d97706; }
body:has(.sm-tpl-sade) .lx-smallbox.is-danger { --c: var(--sd-danger); }
body:has(.sm-tpl-sade) .lx-smallbox.is-secondary { --c: var(--sd-idle); }
body:has(.sm-tpl-sade) .lx-smallbox.is-dark { --c: var(--sd-off); }
body:has(.sm-tpl-sade) .gr-picker, body:has(.sm-tpl-sade) .gr-list { border-color: var(--sd-line); border-radius: 10px; }

/* ------------------------------------------------------------------ Tab bar (kobimes-tabs.js)
 * Buttons as soft round icon buttons inside the bar, no solid red block: "Sekmeleri kapat" turns red only
 * on hover. The menu is a rounded card. */

body:has(.sm-tpl-sade) .sm-tabs-bar { background: var(--sd-surface); border-bottom-color: var(--sd-line); padding: 0 6px; gap: 2px; }
body:has(.sm-tpl-sade) .sm-tabs-btn,
body:has(.sm-tpl-sade) .sm-tabs-btn-danger {
  width: 32px; height: 32px; margin: auto 0; border: 1px solid var(--sd-line); border-radius: 10px;
  background: var(--sd-surface); color: var(--sd-muted); transition: color .15s, background-color .15s, border-color .15s;
}
body:has(.sm-tpl-sade) .sm-tabs-btn svg { width: 16px; height: 16px; }
body:has(.sm-tpl-sade) .sm-tabs-btn:hover { color: var(--sd-ink); background: var(--sd-page); border-color: var(--sd-line); }
body:has(.sm-tpl-sade) .sm-tabs-btn-danger:hover {
  color: var(--sd-danger); background: color-mix(in srgb, var(--sd-danger) 10%, var(--sd-surface)); border-color: color-mix(in srgb, var(--sd-danger) 35%, var(--sd-line));
}
body:has(.sm-tpl-sade) .sm-tabs-menu { margin-right: 6px; }
body:has(.sm-tpl-sade) .sm-tabs-fullscreen-btn { margin-left: 6px; }
body:has(.sm-tpl-sade) .sm-tabs-scroll[data-scroll="1"] { border-left: 1px solid var(--sd-line); }
body:has(.sm-tpl-sade) .sm-tabs-dropdown {
  top: calc(100% + 6px); padding: 6px; border: 1px solid var(--sd-line); border-radius: 12px;
  background: var(--sd-surface); box-shadow: 0 12px 32px rgba(15, 35, 71, .14);
}
body:has(.sm-tpl-sade) .sm-tabs-dropdown button { border-radius: 8px; padding: 8px 12px; font-size: 13.5px; color: var(--sd-text); }
body:has(.sm-tpl-sade) .sm-tabs-dropdown button:hover { background: var(--sd-page); }
body:has(.sm-tpl-sade) .sm-tab { color: var(--sd-muted); }
body:has(.sm-tpl-sade) .sm-tab:hover { color: var(--sd-ink); background: transparent; }
body:has(.sm-tpl-sade) .sm-tab.is-active { color: var(--sd-accent); font-weight: 500; box-shadow: inset 0 -2px 0 var(--sd-accent); }

/* ------------------------------------------------------------------ Ürün ağacı editor (Pages\ProductTreeEditor)
 * Its two boxes are plain HTML, not Filament sections: same sade card (no 3px top line, hairline border, 16px). */

body:has(.sm-tpl-sade) :is(.pt-catalog, .pt-tree) {
  background: var(--sd-surface); border: 1px solid var(--sd-line); border-radius: 16px; box-shadow: none; padding: 16px 18px;
}
body:has(.sm-tpl-sade) :is(.pt-search, .pt-qty, .pt-add) { min-height: 36px; border-color: var(--sd-line); border-radius: 10px; background: var(--sd-surface); }
body:has(.sm-tpl-sade) :is(.pt-card, .pt-types button) { border-color: var(--sd-line); }
body:has(.sm-tpl-sade) .pt-toolbar { border-bottom-color: var(--sd-line); }
body:has(.sm-tpl-sade) .pt-save { border-radius: 999px; padding: .5rem 1.1rem; background: var(--sd-navy); }
body:has(.sm-tpl-sade) .pt-save:hover:not(:disabled) { background: var(--sd-accent); }
html.dark body:has(.sm-tpl-sade) .pt-save { background: var(--sd-accent); }

/* ------------------------------------------------------------------ Card top line (trial)
 * Every card gets the 3px accent line on top, curving into the corners. Cards that already show a state colour on an
 * edge (Canlı station cards, status tiles, KPI tiles) keep theirs. Last in the file so it wins over the hairline borders. */

body:has(.sm-tpl-sade) :is(.fi-section:not(.fi-section-not-contained), .fi-ta-ctn, .sd-card, .pt-catalog, .pt-tree, .fi-modal-window) {
  /* pastel: the accent mixed with the card surface (dark mode mixes with its dark surface) */
  border-top: 3px solid color-mix(in srgb, var(--sd-accent) 45%, var(--sd-surface));
}

/* ------------------------------------------------------------------ KPI tiles by group (MES KPI, Bugünkü Vardiya, Sarf ihtiyacı, …)
 * The klasik accent groups as pastels: edge and icon in the pastel, the number in a deeper tone of it. A tile over its
 * threshold (is-warn) keeps its group colour; the ⚠ after the number marks it. The OEE tiles below get one colour each. */

body:has(.sm-tpl-sade) .lx-kpi-volume { --lx-accent: #86cfd9; --kpi-ink: #24808f; }
body:has(.sm-tpl-sade) .lx-kpi-loss { --lx-accent: #f2a7b3; --kpi-ink: #c4526a; }
body:has(.sm-tpl-sade) .lx-kpi-time { --lx-accent: #8fa3f0; --kpi-ink: #4f63c9; }
body:has(.sm-tpl-sade) .lx-kpi-target { --lx-accent: #95d4a8; --kpi-ink: #3b8f58; }
body:has(.sm-tpl-sade) .lx-kpi:is(.lx-kpi-volume, .lx-kpi-loss, .lx-kpi-time, .lx-kpi-target) {
  background: color-mix(in srgb, var(--lx-accent) 6%, var(--sd-surface));
}
body:has(.sm-tpl-sade) .lx-kpi:is(.lx-kpi-volume, .lx-kpi-loss, .lx-kpi-time, .lx-kpi-target) .lx-kpi-value,
body:has(.sm-tpl-sade) .lx-kpi.is-warn:is(.lx-kpi-volume, .lx-kpi-loss, .lx-kpi-time, .lx-kpi-target) .lx-kpi-value { color: var(--kpi-ink); }
body:has(.sm-tpl-sade) .lx-kpi .mk-kpi-flag { color: #e8833a; }
html.dark body:has(.sm-tpl-sade) .lx-kpi:is(.lx-kpi-volume, .lx-kpi-loss, .lx-kpi-time, .lx-kpi-target) .lx-kpi-value { color: var(--lx-accent); }

/* ------------------------------------------------------------------ OEE tiles (Ana Sayfa #hpOeeTiles, OEE #oeKpis)
 * Both draw OEE, Kullanılabilirlik, Performans, Kalite (+ Plansız duruş, Boşta on the OEE page) in this order.
 * Each gets its own pastel: the edge and icon in the pastel (--lx-accent), the number in a deeper tone of it
 * (--kpi-ink), also when it is under its threshold; the ⚠ after the number still marks that. */

body:has(.sm-tpl-sade) :is(#hpOeeTiles, #oeKpis) > .lx-kpi:nth-child(1) { --lx-accent: #8fa3f0; --kpi-ink: #4f63c9; } /* OEE: periwinkle */
body:has(.sm-tpl-sade) :is(#hpOeeTiles, #oeKpis) > .lx-kpi:nth-child(2) { --lx-accent: #e6c58a; --kpi-ink: #a3741c; } /* Kullanılabilirlik: sand */
body:has(.sm-tpl-sade) :is(#hpOeeTiles, #oeKpis) > .lx-kpi:nth-child(3) { --lx-accent: #86cfd9; --kpi-ink: #24808f; } /* Performans: aqua */
body:has(.sm-tpl-sade) :is(#hpOeeTiles, #oeKpis) > .lx-kpi:nth-child(4) { --lx-accent: #95d4a8; --kpi-ink: #3b8f58; } /* Kalite: sage */
body:has(.sm-tpl-sade) :is(#hpOeeTiles, #oeKpis) > .lx-kpi:nth-child(5) { --lx-accent: #f2a7b3; --kpi-ink: #c4526a; } /* Plansız duruş: rose */
body:has(.sm-tpl-sade) :is(#hpOeeTiles, #oeKpis) > .lx-kpi:nth-child(6) { --lx-accent: #b4bfcf; --kpi-ink: #5f6f86; } /* Boşta: slate */
body:has(.sm-tpl-sade) :is(#hpOeeTiles, #oeKpis) > .lx-kpi .lx-kpi-value,
body:has(.sm-tpl-sade) :is(#hpOeeTiles, #oeKpis) > .lx-kpi.is-warn .lx-kpi-value { color: var(--kpi-ink); }
body:has(.sm-tpl-sade) :is(#hpOeeTiles, #oeKpis) > .lx-kpi { background: color-mix(in srgb, var(--lx-accent) 6%, var(--sd-surface)); }
body:has(.sm-tpl-sade) :is(#hpOeeTiles, #oeKpis) .mk-kpi-flag { color: #e8833a; }
/* dark: the pastel itself reads well on the dark surface */
html.dark body:has(.sm-tpl-sade) :is(#hpOeeTiles, #oeKpis) > .lx-kpi .lx-kpi-value { color: var(--lx-accent); }

/* ------------------------------------------------------------------ Sidebar in dark mode (trial)
 * Anthracite from the same family as the dark page (#1f2328) and cards (#2b3036) instead of navy, a hairline to the
 * content, quieter labels; the active item keeps the accent. */

html.dark body:has(.sm-tpl-sade) .fi-main-sidebar { background: #16181b !important; border-right: 1px solid rgba(255, 255, 255, .06); }
html.dark body:has(.sm-tpl-sade) .fi-main-sidebar .fi-sidebar-group-label { color: #7d8590; }
html.dark body:has(.sm-tpl-sade) .fi-main-sidebar .sm-nav-heading > .fi-sidebar-item-btn .fi-sidebar-item-label { color: #6e7681; }
html.dark body:has(.sm-tpl-sade) .fi-main-sidebar :is(.fi-sidebar-item-label, .fi-sidebar-item-icon, .fi-sidebar-group-collapse-btn) { color: #b9c0c8; }
html.dark body:has(.sm-tpl-sade) .fi-main-sidebar .fi-sidebar-item-btn:hover { background-color: rgba(255, 255, 255, .06); }
/* the active item: the accent dimmed into the anthracite, so it marks the page without glaring */
html.dark body:has(.sm-tpl-sade) .fi-main-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn { background-color: color-mix(in srgb, var(--sd-accent) 50%, #16181b); }

/* Pastel card colours for figures that are not a station state (Üretim Takip totals); the home page's run / break /
   idle / off keep their state colours. The number stays ink, like the home cards. */
body:has(.sm-tpl-sade) .sd-p-blue { --c: #8fa3f0; }
body:has(.sm-tpl-sade) .sd-p-green { --c: #95d4a8; }
body:has(.sm-tpl-sade) .sd-p-rose { --c: #f2a7b3; }
body:has(.sm-tpl-sade) .sd-p-sand { --c: #e6c58a; }
body:has(.sm-tpl-sade) .sd-kpis :is(.sd-p-blue, .sd-p-green, .sd-p-rose, .sd-p-sand) .sd-stat-i { color: color-mix(in srgb, var(--c) 60%, #000); }
html.dark body:has(.sm-tpl-sade) .sd-kpis :is(.sd-p-blue, .sd-p-green, .sd-p-rose, .sd-p-sand) .sd-stat-i { color: var(--c); }

/* Üretim Takip totals: compact (icon · label · number on one line, the note under it in small text) */
body:has(.sm-tpl-sade) .sd-kpis-table { gap: 10px; }
body:has(.sm-tpl-sade) .sd-kpis-table .sd-stat {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "i k v" "i d v"; align-items: center;
  column-gap: 10px; row-gap: 0; padding: 8px 14px; border-radius: 12px; border-left-width: 3px;
}
body:has(.sm-tpl-sade) .sd-kpis-table .sd-stat-top { display: contents; }
body:has(.sm-tpl-sade) .sd-kpis-table .sd-stat-i { grid-area: i; width: 30px; height: 30px; }
body:has(.sm-tpl-sade) .sd-kpis-table .sd-stat-i svg { width: 16px; height: 16px; }
body:has(.sm-tpl-sade) .sd-kpis-table .sd-stat-k { grid-area: k; font-size: 11.5px; }
body:has(.sm-tpl-sade) .sd-kpis-table .sd-stat-v { grid-area: v; margin: 0; font-size: 22px; font-weight: 600; line-height: 1; }
body:has(.sm-tpl-sade) .sd-kpis-table .sd-stat-d { grid-area: d; margin: 0; padding: 0; border: 0; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* station info box: bakım akışı (Tamamlandı / Tamamlanmadı, tıklanınca balon) */
body:has(.sm-tpl-sade) .sm-maint > dd { display: flex; flex-direction: column; gap: 6px; }
body:has(.sm-tpl-sade) .sm-maint-row { position: relative; }
body:has(.sm-tpl-sade) .sm-maint-item { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--sd-line); border-radius: 8px; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; }
body:has(.sm-tpl-sade) .sm-maint-item:hover { background: rgba(127,127,127,.08); }
body:has(.sm-tpl-sade) .sm-maint-balloon { margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: var(--sd-surface); border: 1px solid var(--sd-line); box-shadow: 0 6px 18px rgba(0,0,0,.12); font-size: 13px; }
body:has(.sm-tpl-sade) .sm-maint-balloon p { margin: 0 0 6px; }
body:has(.sm-tpl-sade) .sm-maint-desc { white-space: pre-line; color: var(--sd-muted); }
body:has(.sm-tpl-sade) .sm-maint-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
body:has(.sm-tpl-sade) .sm-maint-checks li { display: flex; gap: 8px; }
body:has(.sm-tpl-sade) .sm-maint-checks li.is-done span:last-child { text-decoration: line-through; opacity: .65; }

/* Maliyet screens */
body:has(.sm-tpl-sade) :is(.sm-cost-bar, .sm-cost-card) { box-shadow: none; border: 1px solid var(--sd-line); border-radius: 12px; background: var(--sd-surface); }
body:has(.sm-tpl-sade) .sm-cost-head { border-color: var(--sd-line); }
body:has(.sm-tpl-sade) .sm-cost-sheet :is(th, td), body:has(.sm-tpl-sade) .sm-cost-sheet td.cell { border-color: var(--sd-line); }
body:has(.sm-tpl-sade) .sm-cost-sheet th { background: transparent; color: var(--sd-muted); font-weight: 500; }
body:has(.sm-tpl-sade) .sm-cost-sums b, body:has(.sm-tpl-sade) .sm-cost-report .strong { color: var(--sd-ink); }
