/* =========================================================
   PHIEXE – The Laundry Manager
   Material Design Flat UI · Complete Redesign
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800&family=DM+Mono:wght@400;500&display=swap');

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  --bg:            #EEF2F8;
  --surface:       #FFFFFF;
  --surface-2:     #F5F8FC;
  --surface-3:     #EDF1F7;
  --text:          #18253A;
  --text-2:        #5B6F8A;
  --line:          #DDE4EF;
  --line-strong:   #C4D0E2;
  --primary:       #1455B3;
  --primary-mid:   #1565C0;
  --primary-light: #E3EEFF;
  --secondary:     #00877A;
  --secondary-light:#DDFAF6;
  --accent:        #F57C00;

  --c-blue:        #1455B3;
  --c-teal:        #007B6E;
  --c-green:       #277A30;
  --c-orange:      #D44A14;
  --c-purple:      #641BA0;
  --c-red:         #BB2525;
  --c-amber:       #E07B00;
  --c-indigo:      #263290;
  --c-cyan:        #005960;

  /* Stat Tile Backgrounds */
  --tile-1: #1455B3;
  --tile-2: #1E8A3A;
  --tile-3: #D44A14;
  --tile-4: #007B88;
  --tile-5: #641BA0;
  --tile-6: #0271A8;
  --tile-7: #BB2525;
  --tile-8: #263290;

  /* Sidebar */
  --sidebar-bg:    #0C1829;
  --sidebar-hover: rgba(255,255,255,0.07);
  --sidebar-text:  rgba(255,255,255,0.80);
  --sidebar-muted: rgba(255,255,255,0.38);
  --sidebar-w:     272px;

  /* Elevation (flat Material style — subtle) */
  --elev-0: none;
  --elev-1: 0 1px 4px rgba(15,30,55,0.07);
  --elev-2: 0 2px 10px rgba(15,30,55,0.08);
  --elev-3: 0 4px 18px rgba(15,30,55,0.10);
  --elev-4: 0 8px 28px rgba(15,30,55,0.12);
  --elev-5: 0 16px 48px rgba(15,30,55,0.15);

  --r:    10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-2xl:22px;
}

body[data-theme='dark'] {
  --bg:            #0B1220;
  --surface:       #121D32;
  --surface-2:     #192740;
  --surface-3:     #1E2F4C;
  --text:          #DDE8F8;
  --text-2:        #7993B2;
  --line:          #1E3050;
  --line-strong:   #264068;
  --primary-light: rgba(20,85,179,0.18);
  --secondary-light:rgba(0,135,122,0.16);
  --sidebar-bg:    #07101C;
  --elev-1: 0 1px 4px rgba(0,0,0,0.30);
  --elev-2: 0 2px 10px rgba(0,0,0,0.38);
  --elev-3: 0 4px 18px rgba(0,0,0,0.42);
  --elev-4: 0 8px 28px rgba(0,0,0,0.48);
  --elev-5: 0 16px 48px rgba(0,0,0,0.55);
}

/* ── Base Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; min-height: 100%;
  font-family: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 700; }

/* ── Global Utilities ─────────────────────────────────────── */
.hidden  { display: none !important; }
.muted   { color: var(--text-2); font-size: 0.875rem; }
.hint    { color: var(--text-2); font-size: 0.82rem; }
.eyebrow {
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.7rem;
  font-weight: 700;
}
.amount { font-weight: 700; font-variant-numeric: tabular-nums; }
#app    { min-height: 100vh; }

/* ═══════════════════════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════════════════════ */
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
}

.login-visual {
  background: var(--sidebar-bg);
  background-image:
    radial-gradient(ellipse at 15% 85%, rgba(20,85,179,0.55) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 15%, rgba(0,135,122,0.45) 0%, transparent 50%);
  padding: 60px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
}
.login-visual h1 {
  font-size: 2.1rem; font-weight: 800;
  color: #fff; margin: 18px 0 14px;
}
.login-visual > p { color: rgba(255,255,255,0.72); font-size: 1rem; max-width: 400px; line-height: 1.7; }
.login-bullets {
  display: grid; gap: 16px; margin-top: 40px;
}
.login-bullets div {
  display: flex; align-items: center; gap: 14px;
  color: rgba(255,255,255,0.78); font-size: 0.9rem;
}
.login-bullets div::before {
  content: '';
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  flex-shrink: 0;
}

.login-card {
  background: var(--surface);
  padding: 52px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  border-left: 1px solid var(--line);
}
.login-card h2 { font-size: 1.5rem; font-weight: 800; }

.brand-logo {
  width: 50px; height: 50px;
  border-radius: var(--r-lg);
  display: grid;
  place-items: center;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  box-shadow: 0 6px 18px rgba(20,85,179,0.32);
  flex-shrink: 0;
}
.brand-logo.large {
  width: 68px; height: 68px; border-radius: 20px;
  font-size: 0.95rem; margin-bottom: 14px;
}

.check-line {
  display: flex; gap: 10px; align-items: center;
  color: var(--text-2); font-size: 0.88rem; cursor: pointer;
}
.full-width { width: 100%; }

/* ═══════════════════════════════════════════════════════════
   APP SHELL
   ═══════════════════════════════════════════════════════════ */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
  z-index: 25;
}
.sidebar::-webkit-scrollbar { display: none; }

.brand-block {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 22px 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.brand-block strong { font-size: 0.9rem; font-weight: 700; color: #fff; display: block; }
.brand-block p { margin: 2px 0 0; color: var(--sidebar-muted); font-size: 0.75rem; }

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 10px;
  flex: 1;
}

.nav-link {
  border: 0;
  background: transparent;
  color: var(--sidebar-text);
  padding: 11px 14px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.14s ease;
  text-align: left;
  width: 100%;
}
.nav-link span { font-size: 0.95rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.nav-link.active {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(20,85,179,0.45);
}

.sidebar-footer {
  padding: 14px 18px;
  background: rgba(255,255,255,0.04);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-footer .muted { color: var(--sidebar-muted); font-size: 0.73rem; }
.sidebar-footer strong { color: #fff; display: block; margin: 4px 0 2px; font-size: 0.88rem; }

/* ── Topbar ───────────────────────────────────────────────── */
.main-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 26px;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--elev-1);
}
.topbar-left { display: flex; gap: 14px; align-items: center; }
.topbar-right, .inline-actions, .table-actions, .machine-actions {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.topbar h1 { font-size: 1.1rem; font-weight: 700; }
.topbar-left .eyebrow { display: block; margin-bottom: 1px; }
.space-between { justify-content: space-between; }
.end { justify-content: flex-end; }

.topbar-chip {
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-2);
  font-family: 'DM Mono', monospace;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 8px 12px;
  border-radius: var(--r);
  cursor: pointer;
  color: var(--text);
  font-size: 1rem;
  align-items: center;
}

#section-content { flex: 1; padding: 26px; }

/* ═══════════════════════════════════════════════════════════
   PAGE SECTION BASE
   ═══════════════════════════════════════════════════════════ */
.page-section { display: grid; gap: 18px; }
.section-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.section-head h2 { font-size: 1.2rem; font-weight: 800; }
.section-head p  { margin: 4px 0 0; color: var(--text-2); font-size: 0.86rem; }
.section-head.compact { align-items: center; }
.section-head.compact h3 { font-size: 0.97rem; font-weight: 700; }

/* ═══════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════ */
.glass-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--elev-1);
  padding: 20px 22px;
}

/* Hero / Welcome card */
.hero-card {
  border-radius: var(--r-2xl);
  padding: 26px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  color: #fff;
  background: linear-gradient(120deg, var(--primary) 0%, #1E88E5 55%, var(--secondary) 100%);
  box-shadow: 0 6px 22px rgba(20,85,179,0.28);
  position: relative; overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute; right: -60px; top: -60px;
  width: 240px; height: 240px; border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.hero-card::after {
  content: '';
  position: absolute; right: 40px; bottom: -50px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.hero-card .eyebrow  { color: rgba(255,255,255,0.72); }
.hero-card h2 { font-size: 1.55rem; color: #fff; margin: 6px 0 8px; }
.hero-card p  { color: rgba(255,255,255,0.80); max-width: 480px; font-size: 0.93rem; }
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }

/* ═══════════════════════════════════════════════════════════
   STAT TILES – colorful dashboard KPIs
   ═══════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  border-radius: var(--r-xl);
  padding: 18px 20px;
  color: #fff;
  border: none;
  background: var(--tile-1);
  box-shadow: var(--elev-2);
  display: grid;
  gap: 6px;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; right: -16px; top: -16px;
  width: 90px; height: 90px; border-radius: 50%;
  background: rgba(255,255,255,0.10);
}
.stat-card span   { font-size: 0.77rem; font-weight: 600; opacity: 0.88; letter-spacing: 0.02em; }
.stat-card strong { font-size: 1.85rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.05; }
.stat-card small  { font-size: 0.76rem; opacity: 0.72; }

.stats-grid .stat-card:nth-child(1) { background: var(--tile-1); box-shadow: 0 4px 16px rgba(20,85,179,0.30); }
.stats-grid .stat-card:nth-child(2) { background: var(--tile-2); box-shadow: 0 4px 16px rgba(30,138,58,0.30); }
.stats-grid .stat-card:nth-child(3) { background: var(--tile-3); box-shadow: 0 4px 16px rgba(212,74,20,0.30); }
.stats-grid .stat-card:nth-child(4) { background: var(--tile-4); box-shadow: 0 4px 16px rgba(0,123,136,0.28); }
.stats-grid .stat-card:nth-child(5) { background: var(--tile-5); box-shadow: 0 4px 16px rgba(100,27,160,0.28); }
.stats-grid .stat-card:nth-child(6) { background: var(--tile-6); box-shadow: 0 4px 16px rgba(2,113,168,0.28); }
.stats-grid .stat-card:nth-child(7) { background: var(--tile-7); box-shadow: 0 4px 16px rgba(187,37,37,0.28); }
.stats-grid .stat-card:nth-child(8) { background: var(--tile-8); box-shadow: 0 4px 16px rgba(38,50,144,0.28); }

/* Mini stat grid */
.stats-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.mini-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 15px 18px;
  box-shadow: var(--elev-1);
}
.mini-card span   { color: var(--text-2); font-size: 0.80rem; font-weight: 600; display: block; margin-bottom: 8px; }
.mini-card strong { font-size: 1.25rem; font-weight: 800; color: var(--text); }

/* ═══════════════════════════════════════════════════════════
   STATUS ALERT BANNERS
   ═══════════════════════════════════════════════════════════ */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border-radius: var(--r-lg);
  font-weight: 600;
  font-size: 0.88rem;
  border-left: 5px solid;
}
.alert-banner .alert-icon { font-size: 1.15rem; flex-shrink: 0; }
.alert-banner .alert-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 1px; }
.alert-banner .alert-desc  { font-size: 0.8rem; opacity: 0.78; }
.alert-banner.success { background: #EAF6EC; color: #1B5E20; border-color: #43A047; }
.alert-banner.warning { background: #FFF4E5; color: #BF360C; border-color: #FB8C00; }
.alert-banner.error   { background: #FFF0F0; color: #B71C1C; border-color: #E53935; }
.alert-banner.info    { background: #E8F3FE; color: #0D47A1; border-color: #1E88E5; }

body[data-theme='dark'] .alert-banner.success { background: rgba(46,125,50,0.14); color: #81C784; }
body[data-theme='dark'] .alert-banner.warning { background: rgba(230,74,25,0.14); color: #FFAB91; }
body[data-theme='dark'] .alert-banner.error   { background: rgba(198,40,40,0.14); color: #EF9A9A; }
body[data-theme='dark'] .alert-banner.info    { background: rgba(20,85,179,0.14); color: #90CAF9; }

/* ═══════════════════════════════════════════════════════════
   DASHBOARD / CHARTS LAYOUT
   ═══════════════════════════════════════════════════════════ */
.dashboard-grid  { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
.reports-layout  { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }

.chart-card      { min-height: 290px; }
.chart-card.wide { grid-column: span 1; }
.chart-canvas    { width: 100%; height: 220px; display: block; margin-top: 10px; }

.legend-list { display: grid; gap: 9px; margin-top: 12px; }
.legend-list div {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.85rem; color: var(--text-2);
}
.legend-dot {
  width: 10px; height: 10px; border-radius: 3px;
  display: inline-block; margin-right: 8px; vertical-align: middle;
  background: var(--primary);
}
.legend-dot.status-running     { background: var(--c-blue); }
.legend-dot.status-idle        { background: #9BB4CA; }
.legend-dot.status-paused      { background: var(--c-purple); }
.legend-dot.status-maintenance { background: var(--c-amber); }
.legend-dot.status-offline     { background: var(--c-red); }

.list-stack { display: grid; gap: 8px; }

.record-item {
  padding: 12px 14px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.record-item strong { font-size: 0.88rem; }
.record-item .muted { font-size: 0.78rem; margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════
   KPI BANNER (Reports section)
   ═══════════════════════════════════════════════════════════ */
.kpi-banner {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.kpi-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  border-left: 4px solid var(--primary);
  box-shadow: var(--elev-1);
}
.kpi-item:nth-child(2) { border-left-color: var(--secondary); }
.kpi-item:nth-child(3) { border-left-color: var(--accent); }
.kpi-item:nth-child(4) { border-left-color: var(--c-purple); }
.kpi-item span   { font-size: 0.75rem; color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; display: block; margin-bottom: 6px; }
.kpi-item strong { font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ═══════════════════════════════════════════════════════════
   FORMS & INPUTS
   ═══════════════════════════════════════════════════════════ */
.filters-grid, .form-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 13px;
}
.filters-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.two-col    { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.field { display: grid; gap: 6px; }
.field label { font-size: 0.80rem; color: var(--text-2); font-weight: 600; letter-spacing: 0.01em; }

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--r);
  padding: 10px 13px;
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
  font-size: 0.88rem;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary-mid);
  box-shadow: 0 0 0 3px rgba(20,85,179,0.12);
}
.field input[readonly] { background: var(--surface-3); color: var(--text-2); cursor: default; }
.field textarea { resize: vertical; min-height: 84px; }

.stack-md { display: grid; gap: 14px; }
.stack-lg { display: grid; gap: 20px; }
.full-span { grid-column: 1 / -1; }

/* Financial Summary Strip */
.summary-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  background: var(--primary-light);
  border: 1.5px solid rgba(20,85,179,0.16);
  border-radius: var(--r-lg);
  padding: 14px 16px;
}
body[data-theme='dark'] .summary-strip {
  background: rgba(20,85,179,0.10);
  border-color: rgba(20,85,179,0.25);
}
.summary-strip div { display: grid; gap: 3px; }
.summary-strip span { font-size: 0.72rem; color: var(--text-2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.summary-strip strong { font-size: 0.92rem; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }

/* ═══════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════ */
.table-wrap { width: 100%; overflow: auto; border-radius: var(--r); }
table { width: 100%; min-width: 860px; }
th {
  text-align: left;
  padding: 11px 14px;
  background: var(--surface-2);
  border-bottom: 2px solid var(--line);
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 0.87rem;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); transition: background 0.1s; }

/* ═══════════════════════════════════════════════════════════
   MACHINES
   ═══════════════════════════════════════════════════════════ */
.machine-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.machine-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 18px;
  position: relative; overflow: hidden;
  box-shadow: var(--elev-1);
  transition: box-shadow 0.18s;
}
.machine-card:hover { box-shadow: var(--elev-3); }

/* Status color accent on top */
.machine-card.status-running     { border-top: 4px solid var(--c-blue); }
.machine-card.status-paused      { border-top: 4px solid var(--c-purple); }
.machine-card.status-idle        { border-top: 4px solid #9BB4CA; }
.machine-card.status-maintenance { border-top: 4px solid var(--c-amber); }
.machine-card.status-offline     { border-top: 4px solid var(--c-red); }

.machine-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.machine-top h3 { font-size: 0.97rem; font-weight: 700; }
.machine-top p  { color: var(--text-2); font-size: 0.80rem; margin-top: 4px; }
.machine-body   { display: grid; gap: 0; margin: 14px 0; }

.metric-line {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 0.83rem; padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.metric-line:last-of-type { border-bottom: none; }
.metric-line span   { color: var(--text-2); }
.metric-line strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.machine-note {
  padding: 9px 12px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 0.80rem;
  font-style: italic;
}
.machine-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */
.btn, .icon-btn {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  transition: background 0.13s, transform 0.11s, box-shadow 0.11s, opacity 0.11s;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  line-height: 1;
}
.btn     { padding: 10px 20px; font-size: 0.86rem; }
.icon-btn { padding: 7px 12px; font-size: 0.80rem; }
.btn:hover, .icon-btn:hover   { transform: translateY(-1px); }
.btn:active, .icon-btn:active { transform: translateY(0); opacity: 0.88; }

.btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 3px 12px rgba(20,85,179,0.32);
}
.btn.primary:hover { background: var(--primary-mid); box-shadow: 0 5px 16px rgba(20,85,179,0.40); }

.btn.secondary {
  background: var(--secondary-light);
  color: var(--secondary);
  border: 1.5px solid rgba(0,135,122,0.22);
}
body[data-theme='dark'] .btn.secondary {
  background: rgba(0,135,122,0.16);
  border-color: rgba(0,135,122,0.3);
}

.btn.ghost, .icon-btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1.5px solid var(--line);
}
.btn.ghost:hover, .icon-btn:hover { background: var(--surface-3); border-color: var(--line-strong); }

.btn.danger, .icon-btn.danger {
  background: rgba(187,37,37,0.08);
  color: var(--c-red);
  border: 1.5px solid rgba(187,37,37,0.22);
}
.btn.danger:hover, .icon-btn.danger:hover { background: rgba(187,37,37,0.15); }

/* ═══════════════════════════════════════════════════════════
   STATUS BADGES
   ═══════════════════════════════════════════════════════════ */
.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border: 1.5px solid transparent;
}

/* Flat badge palette */
.status-neutral, .status-received {
  background: #ECEFF1; color: #546E7A; border-color: #CFD8DC;
}
.status-washing, .status-running {
  background: #E3F2FD; color: #0D47A1; border-color: #BBDEFB;
}
.status-drying, .status-partial {
  background: #FBE9E7; color: #BF360C; border-color: #FFCCBC;
}
.status-folding, .status-paused {
  background: #EDE7F6; color: #4527A0; border-color: #D1C4E9;
}
.status-ready, .status-paid, .status-active {
  background: #E8F5E9; color: #1B5E20; border-color: #C8E6C9;
}
.status-claimed {
  background: #E0F2F1; color: #004D40; border-color: #B2DFDB;
}
.status-cancelled, .status-offline, .status-inactive {
  background: #FFEBEE; color: #B71C1C; border-color: #FFCDD2;
}
.status-maintenance, .status-unpaid {
  background: #FFF8E1; color: #E65100; border-color: #FFE0B2;
}
.status-idle { background: #F5F5F5; color: #616161; border-color: #E0E0E0; }

/* Dark mode badges */
body[data-theme='dark'] .status-neutral,
body[data-theme='dark'] .status-received  { background: rgba(84,110,122,0.18); color: #B0BEC5; border-color: rgba(84,110,122,0.3); }
body[data-theme='dark'] .status-washing,
body[data-theme='dark'] .status-running   { background: rgba(20,85,179,0.18); color: #90CAF9; border-color: rgba(20,85,179,0.3); }
body[data-theme='dark'] .status-drying,
body[data-theme='dark'] .status-partial   { background: rgba(212,74,20,0.18); color: #FFCCBC; border-color: rgba(212,74,20,0.3); }
body[data-theme='dark'] .status-folding,
body[data-theme='dark'] .status-paused    { background: rgba(69,39,160,0.18); color: #CE93D8; border-color: rgba(69,39,160,0.3); }
body[data-theme='dark'] .status-ready,
body[data-theme='dark'] .status-paid,
body[data-theme='dark'] .status-active    { background: rgba(27,94,32,0.18); color: #A5D6A7; border-color: rgba(27,94,32,0.3); }
body[data-theme='dark'] .status-claimed   { background: rgba(0,77,64,0.18); color: #80CBC4; border-color: rgba(0,77,64,0.3); }
body[data-theme='dark'] .status-cancelled,
body[data-theme='dark'] .status-offline,
body[data-theme='dark'] .status-inactive  { background: rgba(183,28,28,0.18); color: #EF9A9A; border-color: rgba(183,28,28,0.3); }
body[data-theme='dark'] .status-maintenance,
body[data-theme='dark'] .status-unpaid    { background: rgba(230,81,0,0.18); color: #FFCC80; border-color: rgba(230,81,0,0.3); }
body[data-theme='dark'] .status-idle      { background: rgba(97,97,97,0.18); color: #BDBDBD; border-color: rgba(97,97,97,0.3); }

/* ═══════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════ */
.modal {
  position: fixed; inset: 0;
  background: rgba(8,18,34,0.52);
  display: grid; place-items: center;
  padding: 20px; z-index: 50;
  backdrop-filter: blur(3px);
}
.modal-card {
  width: min(900px, 100%);
  max-height: 90vh;
  overflow: auto;
  border-radius: var(--r-2xl);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--elev-5);
}
.modal-head {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0;
  background: var(--surface); z-index: 5;
}
.modal-head h3  { font-size: 1rem; font-weight: 700; }
.modal-body     { padding: 22px; }

.detail-grid { display: grid; gap: 13px; }
.detail-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-grid label { display: block; color: var(--text-2); font-size: 0.78rem; margin-bottom: 4px; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════
   TOASTS
   ═══════════════════════════════════════════════════════════ */
.toast-wrap {
  position: fixed; right: 18px; bottom: 18px;
  display: grid; gap: 10px; z-index: 60;
}
.toast {
  min-width: 250px; max-width: 360px;
  padding: 13px 16px;
  border-radius: var(--r-lg);
  transform: translateX(20px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
  box-shadow: var(--elev-4);
  font-weight: 600; font-size: 0.87rem;
  display: flex; align-items: center; gap: 9px;
}
.toast::before { font-size: 0.95rem; flex-shrink: 0; font-weight: 800; }
.toast.show    { transform: translateX(0); opacity: 1; }
.toast.success { background: #277A30; color: #fff; }
.toast.success::before { content: '✓'; }
.toast.error   { background: #BB2525; color: #fff; }
.toast.error::before   { content: '✕'; }

/* ═══════════════════════════════════════════════════════════
   EMPTY STATES
   ═══════════════════════════════════════════════════════════ */
.empty-state {
  border-radius: var(--r-lg);
  border: 1.5px dashed var(--line-strong);
  background: var(--surface-2);
  padding: 30px 20px;
  text-align: center;
  color: var(--text-2);
  font-size: 0.88rem;
}
.empty-state.small { padding: 16px; }

/* ═══════════════════════════════════════════════════════════
   SETTINGS PRICING GRID
   ═══════════════════════════════════════════════════════════ */
.pricing-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1280px) {
  .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dashboard-grid, .reports-layout { grid-template-columns: 1fr; }
  .machine-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-banner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

@media (max-width: 960px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-visual { min-height: 260px; padding: 40px 36px; }

  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(285px, 86vw);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 30;
    height: 100vh;
  }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .menu-toggle { display: inline-flex; }

  .topbar { padding: 0 18px; }
  .topbar-right .topbar-chip { display: none; }

  .stats-mini-grid,
  .machine-grid,
  .form-grid.two-col,
  .filters-grid.compact,
  .summary-strip { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  #section-content  { padding: 14px; }
  .hero-card        { padding: 20px; flex-direction: column; gap: 16px; }
  .hero-card h2     { font-size: 1.2rem; }
  .login-card       { padding: 30px 22px; }
  .glass-card       { padding: 16px; }
  .stats-grid       { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card strong { font-size: 1.5rem; }
  .filters-grid, .form-grid { grid-template-columns: 1fr; }
  .kpi-banner       { grid-template-columns: 1fr; }
  .pricing-grid     { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  table             { min-width: 720px; }
  .topbar h1        { font-size: 0.97rem; }
  .summary-strip    { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
  .stats-grid       { grid-template-columns: 1fr; }
  .login-visual h1  { font-size: 1.55rem; }
}


/* Enhanced logo image support */
.brand-logo.image-logo {
  background: rgba(255,255,255,0.96);
  box-shadow: 0 10px 24px rgba(20,85,179,0.18);
  border: 1px solid rgba(20,85,179,0.12);
  overflow: hidden;
}
.brand-logo.image-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

/* Machine card visual */
.machine-top { gap: 16px; }
.machine-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.machine-visual {
  width: 84px;
  min-width: 84px;
  height: 84px;
  position: relative;
  display: grid;
  place-items: center;
}
.machine-visual::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 24px;
  background: radial-gradient(circle at 30% 30%, rgba(90,195,255,0.25), rgba(20,85,179,0.06) 62%, transparent 75%);
}
.washer-shell {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  position: relative;
  background: linear-gradient(180deg, #fbfdff 0%, #dce9fb 100%);
  border: 2px solid #9fc1ea;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.9), 0 10px 20px rgba(20,85,179,0.14);
}
.washer-panel {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.washer-slot, .washer-display {
  display: block;
  width: 16px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3273c7, #174d98);
  opacity: 0.95;
}
.washer-display { width: 14px; border-radius: 6px; }
.washer-knob {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #d9edff 45%, #7eb0e6 100%);
  border: 1px solid #7aa8db;
}
.washer-door {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(180deg, #c8def7, #8bb1dc);
  padding: 5px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.5);
}
.washer-glass {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.95) 0%, rgba(187,232,255,0.92) 22%, #2f6fb7 70%, #133d74 100%);
}
.washer-water {
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -6%;
  height: 52%;
  background: linear-gradient(180deg, rgba(101,231,255,0.95) 0%, rgba(18,156,229,0.95) 100%);
  border-radius: 48% 52% 58% 42% / 38% 42% 58% 62%;
}
.washer-bubbles span,
.washer-sparkles span { position: absolute; display: block; }
.washer-bubbles span {
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.95), rgba(131,226,255,0.65));
  box-shadow: 0 0 10px rgba(151,227,255,0.55);
}
.washer-bubbles span:nth-child(1) { width: 7px; height: 7px; left: 10px; top: 20px; }
.washer-bubbles span:nth-child(2) { width: 5px; height: 5px; left: 24px; top: 13px; }
.washer-bubbles span:nth-child(3) { width: 6px; height: 6px; right: 9px; top: 18px; }
.washer-bubbles span:nth-child(4) { width: 4px; height: 4px; left: 18px; top: 27px; }
.washer-sparkles span { width: 10px; height: 10px; opacity: 0; }
.washer-sparkles span::before,
.washer-sparkles span::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(255,255,255,0.95);
  transform: translate(-50%, -50%);
  border-radius: 999px;
}
.washer-sparkles span::before { width: 2px; height: 10px; }
.washer-sparkles span::after { width: 10px; height: 2px; }
.washer-sparkles span:nth-child(1) { left: -2px; top: 18px; }
.washer-sparkles span:nth-child(2) { right: 0; top: 8px; }
.washer-sparkles span:nth-child(3) { right: 6px; bottom: 10px; }
.machine-visual.dryer .washer-water {
  height: 18%;
  bottom: 18%;
  background: linear-gradient(180deg, rgba(255,185,85,0.95) 0%, rgba(245,124,0,0.95) 100%);
}
.machine-visual.dryer .washer-glass {
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.95) 0%, rgba(255,239,191,0.92) 24%, #ffb341 68%, #a55007 100%);
}
.machine-visual.is-running .washer-shell {
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.9), 0 0 0 6px rgba(86,190,255,0.10), 0 14px 26px rgba(20,85,179,0.22);
}
.machine-visual.is-running .washer-door { animation: washer-spin 1.6s linear infinite; }
.machine-visual.is-running .washer-water { animation: water-slosh 1.15s ease-in-out infinite alternate; }
.machine-visual.is-running .washer-bubbles span { animation: bubble-float 1.8s ease-in-out infinite; }
.machine-visual.is-running .washer-bubbles span:nth-child(2) { animation-delay: .25s; }
.machine-visual.is-running .washer-bubbles span:nth-child(3) { animation-delay: .45s; }
.machine-visual.is-running .washer-bubbles span:nth-child(4) { animation-delay: .7s; }
.machine-visual.is-running .washer-sparkles span { animation: sparkle-pop 1.6s ease-in-out infinite; }
.machine-visual.is-running .washer-sparkles span:nth-child(2) { animation-delay: .35s; }
.machine-visual.is-running .washer-sparkles span:nth-child(3) { animation-delay: .8s; }
@keyframes washer-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes water-slosh {
  0% { transform: translateY(2px) rotate(-6deg) scaleX(0.98); }
  100% { transform: translateY(-1px) rotate(6deg) scaleX(1.03); }
}
@keyframes bubble-float {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.65; }
  50% { transform: translateY(-7px) scale(1.18); opacity: 1; }
}
@keyframes sparkle-pop {
  0%, 100% { transform: scale(0.4) rotate(0deg); opacity: 0; }
  40% { transform: scale(1) rotate(45deg); opacity: 1; }
  70% { transform: scale(0.85) rotate(80deg); opacity: 0.65; }
}
