/* dwcrm admin — light by default, dark through the toggle (html[data-theme="dark"]). */
:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --border: #e3e8ef;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #94a3b8;
  --primary: #0d9488;
  --primary-2: #14b8a6;
  --primary-soft: #ccfbf1;
  --primary-ink: #0f766e;
  --green: #16a34a; --green-soft: #dcfce7;
  --amber: #d97706; --amber-soft: #fef3c7;
  --red: #dc2626;   --red-soft: #fee2e2;
  --blue: #2563eb;  --blue-soft: #dbeafe;
  --violet: #7c3aed; --violet-soft: #ede9fe;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .18);
  --radius: 18px;
  --sidebar: 264px;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #0b1017;
  --surface: #121a24;
  --surface-2: #18222e;
  --border: #223041;
  --text: #e6edf5;
  --text-2: #a9b6c6;
  --muted: #6b7b8f;
  --primary: #14b8a6;
  --primary-2: #2dd4bf;
  --primary-soft: rgba(20, 184, 166, .16);
  --primary-ink: #5eead4;
  --green: #4ade80; --green-soft: rgba(74, 222, 128, .14);
  --amber: #fbbf24; --amber-soft: rgba(251, 191, 36, .14);
  --red: #f87171;   --red-soft: rgba(248, 113, 113, .14);
  --blue: #60a5fa;  --blue-soft: rgba(96, 165, 250, .14);
  --violet: #a78bfa; --violet-soft: rgba(167, 139, 250, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px; line-height: 1.5;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background .2s, color .2s;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex: none; }
/* Database updates waiting, in the user menu (Toky, 2026-11-14). */
.menu-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #f59e0b; color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
/* An icon takes its room before lucide draws it (end of the page), so nothing jumps when it appears. */
i[data-lucide] { display: inline-block; width: 18px; height: 18px; flex: none; }
.crumbs i[data-lucide] { width: 14px; height: 14px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 16px auto 16px 16px; width: var(--sidebar);
  background: var(--surface); border: 1px solid var(--border); border-radius: 24px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; padding: 20px 14px; z-index: 40;
  transition: transform .25s;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; }
.brand img { width: 100px; height: 100px; border-radius: 50%; object-fit: contain; background: #fff; flex: none; }
.brand b { display: block; font-size: 16px; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: 12px; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--text-2); font-weight: 500; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 8px 18px rgba(13, 148, 136, .28); }
.nav a .count { margin-left: auto; font-size: 11px; font-weight: 600; background: var(--surface-2); color: var(--text-2); padding: 1px 8px; border-radius: 99px; }
.nav a.active .count { background: rgba(255, 255, 255, .22); color: #fff; }
.nav .sub { padding-left: 18px; }
.nav .sub a { padding: 8px 12px; font-size: 13.5px; }
.nav .sub a.current { color: var(--primary-ink); background: var(--primary-soft); }
.sidebar-foot { margin-top: auto; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, #0f172a, #134e4a); color: #e2f8f5; }
.sidebar-foot b { display: block; font-size: 13px; }
.sidebar-foot span { font-size: 12px; opacity: .75; }

.main { flex: 1; margin-left: calc(var(--sidebar) + 32px); padding: 16px 24px 40px 0; min-width: 0; }

/* ---------- Topbar ---------- */
.topbar { display: flex; align-items: center; gap: 14px; padding: 6px 0 22px; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.crumbs a:hover { color: var(--primary); }
.crumbs .current { color: var(--text); font-weight: 600; }
.crumbs svg.lucide { width: 14px; height: 14px; }
.topbar .spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px; width: 320px; max-width: 34vw;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 12px; height: 42px; color: var(--muted);
}
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; color: var(--text); }
.search kbd { font-size: 11px; border: 1px solid var(--border); border-radius: 6px; padding: 0 6px; color: var(--muted); font-family: inherit; }
.icon-btn {
  position: relative; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); cursor: pointer; transition: color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; background: var(--red); border-radius: 50%; border: 2px solid var(--surface); }
.menu-btn { display: none; }
.theme-dark { display: none; }
html[data-theme="dark"] .theme-dark { display: block; }
html[data-theme="dark"] .theme-light { display: none; }

.user { position: relative; }
.user > button {
  display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px 0 5px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.avatar { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; background: linear-gradient(135deg, var(--primary), #0ea5e9); flex: none; }
.user .who { text-align: left; line-height: 1.15; }
.user .who b { display: block; font-size: 13px; }
.user .who small { color: var(--muted); font-size: 11px; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; padding: 6px; z-index: 50;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-6px); pointer-events: none; transition: .15s;
}
.dropdown.open { opacity: 1; transform: none; pointer-events: auto; }
.dropdown a, .dropdown .item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text-2); }
.dropdown a:hover { background: var(--surface-2); color: var(--text); }
.dropdown .danger { color: var(--red); }
.dropdown hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.dropdown .head { padding: 8px 10px 10px; }
.dropdown .head small { color: var(--muted); }
.notif { min-width: 320px; }
.notif .item { align-items: flex-start; }
.notif .item p { margin: 0; font-size: 13px; color: var(--text); }
.notif .item small { color: var(--muted); font-size: 12px; }

/* ---------- Page ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h3 { margin: 0; font-size: 15px; }
.card-head small { color: var(--muted); }
.link { color: var(--primary); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }

.grid { display: grid; gap: 18px; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.cols-3 { grid-template-columns: 2fr 1fr; margin-bottom: 18px; }
.cols-2 { grid-template-columns: 1fr 1fr; margin-bottom: 18px; }

.kpi { display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; }
.kpi .top { display: flex; align-items: center; justify-content: space-between; }
.kpi .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; }
.kpi .ico svg.lucide { width: 20px; height: 20px; }
.kpi .label { color: var(--text-2); font-weight: 500; }
.kpi .value { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.kpi .meta { color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; }
.kpi.hero { background: linear-gradient(135deg, #0f766e, #0d9488 45%, #22d3ee); color: #fff; border: 0; }
.kpi.hero .label, .kpi.hero .meta { color: rgba(255, 255, 255, .82); }
.kpi.hero .ico { background: rgba(255, 255, 255, .18); color: #fff; }
.kpi.hero::after { content: ""; position: absolute; width: 180px; height: 180px; right: -60px; bottom: -80px; border-radius: 50%; background: rgba(255, 255, 255, .12); }

.t-teal { background: var(--primary-soft); color: var(--primary-ink); }
.t-green { background: var(--green-soft); color: var(--green); }
.t-amber { background: var(--amber-soft); color: var(--amber); }
.t-red { background: var(--red-soft); color: var(--red); }
.t-blue { background: var(--blue-soft); color: var(--blue); }
.t-violet { background: var(--violet-soft); color: var(--violet); }

.chart-box { position: relative; height: 270px; }
.chart-box.sm { height: 220px; }
.legend { display: grid; gap: 10px; margin-top: 14px; }
.legend div { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend b { margin-left: auto; color: var(--text); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px -20px; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 12px 20px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
table.list td { padding: 14px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr { transition: background .12s; }
table.list tbody tr:hover { background: var(--surface-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }
.company { display: flex; align-items: center; gap: 12px; }
.company img, .company .ph { width: 40px; height: 40px; border-radius: 12px; object-fit: contain; background: #fff; border: 1px solid var(--border); padding: 3px; flex: none; }
.company .ph { display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--primary-ink); background: var(--primary-soft); border: 0; padding: 0; }
.company b { display: block; }
.company small { color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .search { width: 280px; height: 40px; }
.chips { display: flex; gap: 6px; }
.chip { border: 1px solid var(--border); background: var(--surface); padding: 7px 14px; border-radius: 99px; cursor: pointer; color: var(--text-2); font-weight: 500; }
.chip.on { background: var(--text); color: var(--surface); border-color: var(--text); }

.activity { display: grid; gap: 4px; }
.activity .row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.activity .row:last-child { border-bottom: 0; }
.activity .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.activity .ico svg.lucide { width: 16px; height: 16px; }
.activity p { margin: 0; font-size: 13px; }
.activity small { color: var(--muted); font-size: 12px; }
.bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--red), var(--amber)); }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 600; cursor: pointer; transition: transform .1s, box-shadow .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 8px 18px rgba(13, 148, 136, .28); }
.btn-primary:hover { box-shadow: 0 10px 24px rgba(13, 148, 136, .38); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { color: var(--text); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field input, .field select {
  height: 42px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface-2); outline: 0; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); background: var(--surface); }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: 1 / -1; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 20px; background: rgba(15, 23, 42, .45); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity .2s; }
.modal.open { opacity: 1; pointer-events: auto; }
.modal .box { width: min(860px, 100%); max-width: 100%; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg); transform: translateY(12px) scale(.98); transition: transform .2s; }
.modal.open .box { transform: none; }
/* Long unbroken content (CSV/ZPL <pre> in Process order) used to widen the grid track past the viewport and push the box off-screen; the track is now capped to the viewport so every modal stays centered (Toky, 2026-11-16). */
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.modal header h3 { margin: 0; font-size: 17px; }
.modal header p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.modal .body { padding: 22px; }
.modal footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; top: 120px; right: 24px; /* under the top bar: never over the user name (Toky, 2026-11-14) */ z-index: 100; display: grid; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 12px; min-width: 300px; max-width: 420px; padding: 14px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: toast-in .25s ease-out;
}
.toast .ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.toast.out { opacity: 0; transform: translateX(20px); transition: .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); }
.auth-art {
  position: relative; overflow: hidden; padding: 48px; color: #e6fffb; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(1200px 600px at 10% 10%, #115e59 0%, transparent 60%), radial-gradient(900px 500px at 90% 90%, #0e7490 0%, transparent 55%), #0b1220;
}
.auth-art::before {
  content: ""; position: absolute; inset: 0; opacity: .18;
  background-image: linear-gradient(rgba(255, 255, 255, .25) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .25) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.auth-art > * { position: relative; }
.auth-art .brand { padding: 0; }
.auth-art .brand img { width: 56px; height: 56px; box-shadow: 0 0 0 4px rgba(255, 255, 255, .08); }
.auth-art .brand small { color: rgba(230, 255, 251, .7); }
.auth-art h2 { font-size: 40px; line-height: 1.1; letter-spacing: -.03em; margin: 0 0 14px; max-width: 520px; }
.auth-art h2 span { background: linear-gradient(90deg, #5eead4, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-art p { color: rgba(230, 255, 251, .72); max-width: 460px; margin: 0; font-size: 15px; }
.glass-stats { display: flex; gap: 14px; flex-wrap: wrap; }
.glass-stats div { padding: 14px 18px; border-radius: 16px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(8px); }
.glass-stats b { display: block; font-size: 22px; }
.glass-stats small { color: rgba(230, 255, 251, .7); }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-form .box { width: min(400px, 100%); }
.auth-form .logo-sm { display: none; width: 64px; height: 64px; border-radius: 50%; margin-bottom: 18px; }
.auth-form h1 { margin: 0; font-size: 28px; letter-spacing: -.02em; }
.auth-form .sub { color: var(--text-2); margin: 6px 0 28px; }
.auth-form form { display: grid; gap: 16px; }
.input-icon { position: relative; }
.input-icon svg.lucide { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; height: 17px; }
.input-icon input { width: 100%; padding-left: 40px; height: 48px; background: var(--surface); }
.input-icon .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; cursor: pointer; color: var(--muted); width: 36px; height: 36px; display: grid; place-items: center; }
.input-icon .eye svg.lucide { position: static; transform: none; }
.auth-form .btn { height: 48px; justify-content: center; width: 100%; font-size: 15px; }
.alert { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--red-soft); color: var(--red); font-weight: 500; }
.auth-foot { margin-top: 28px; color: var(--muted); font-size: 12px; text-align: center; }
.auth-theme { position: fixed; top: 18px; right: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3, .cols-2 { grid-template-columns: 1fr; } }
@media (max-width: 960px) {
  .sidebar { transform: translateX(calc(-100% - 24px)); }
  body.nav-open .sidebar { transform: none; }
  .main { margin-left: 0; padding: 12px 16px 32px; }
  .menu-btn { display: grid; }
  .search.global, .user .who { display: none; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-form .logo-sm { display: block; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
}
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr; } .crumbs { display: none; } }

.brand img { box-shadow: 0 0 0 2px var(--border); }
.company b, td small { overflow-wrap: anywhere; }

/* Collapsible menu groups (options with submenus). */
.sidebar .nav { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; }
.nav-toggle { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--text-2); font-weight: 500; cursor: pointer; text-align: left; transition: background .15s, color .15s; }
.nav-toggle:hover { background: var(--surface-2); color: var(--text); }
.nav-toggle.active-parent { color: var(--primary-ink); }
.nav-toggle .chev { margin-left: auto; width: 16px; height: 16px; transition: transform .2s; }
.nav-group .sub { padding-left: 22px; overflow: hidden; transition: max-height .25s ease; }
.nav-group:not(.open) .sub { max-height: 0; }
.nav-group.open .sub { max-height: 400px; }
.nav-group.open .chev { transform: rotate(180deg); }
.nav .sub a .bullet { width: 6px; height: 6px; border-radius: 50%; background: var(--border); flex: none; }
.nav .sub a.current .bullet, .nav .sub a:hover .bullet { background: var(--primary); }
.sidebar-foot { margin-top: 14px; }
.empty-state { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 56px 24px; }
.empty-state .ico { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; }
.empty-state .ico svg.lucide { width: 28px; height: 28px; }
.empty-state h3 { margin: 6px 0 0; font-size: 18px; }
.empty-state p { margin: 0 0 8px; color: var(--text-2); }

/* Company the session works for */
.company-chip { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px 0 6px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; font-size: 13px; white-space: nowrap; }
.company-chip img { width: 30px; height: 30px; border-radius: 8px; object-fit: contain; background: #fff; padding: 2px; }
.company-chip svg.lucide { margin-left: 6px; }
@media (max-width: 1100px) { .company-chip { display: none; } }

/* Header cart with its counter */
.cart-btn { position: relative; }
.cart-count { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 1; border: 2px solid var(--surface); }

/* Print view: every print opens in this modal on the same page */
.modal.print-view .box { width: min(1100px, calc(100vw - 40px)); max-width: none; height: calc(100vh - 40px); display: flex; flex-direction: column; overflow: hidden; }
.modal.print-view header { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal.print-view .pv-actions { display: flex; align-items: center; gap: 8px; }
.modal.print-view .pv-actions [hidden] { display: none; }
.modal.print-view iframe { flex: 1; width: 100%; border: 0; background: #fff; }
/* Print views (Toky, 2026-11-12): Print quote / Highlighted / Only final price / No prices. */
.modal.print-view .pv-views { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.modal.print-view .pv-views[hidden] { display: none; }
.modal.print-view .pv-view { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.modal.print-view .pv-view svg.lucide { width: 15px; height: 15px; }
.modal.print-view .pv-view:hover { color: var(--text); border-color: var(--primary); }
.modal.print-view .pv-terms { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; white-space: nowrap; }
.modal.print-view .pv-terms input { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 30px; height: 18px; margin: 0; border-radius: 999px; background: #cbd5e1; cursor: pointer; transition: background .15s; }
.modal.print-view .pv-terms input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.25); transition: transform .15s; }
.modal.print-view .pv-terms input:checked { background: var(--primary); }
.modal.print-view .pv-terms input:checked::after { transform: translateX(12px); }
.modal.print-view .pv-terms:has(input:checked) { color: var(--primary); border-color: var(--primary); }
.modal.print-view .pv-view.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.modal.print-view .pv-view .pv-opt { margin: -3px -8px -3px 2px; padding: 2px 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }/* Data tables: every list of the app (Toky, 2026-11-11). */
.dt-top { display: flex; justify-content: flex-end; gap: 12px; margin-bottom: 14px; }
.dt-search { width: min(320px, 100%); height: 40px; }
.dt-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0 0; color: var(--text-2); font-size: 13px; }
.dt-foot[hidden] { display: none; }
.table-wrap + .dt-foot { margin-top: 36px; }
.dt-length { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.dt-length select { height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.dt-info { margin-right: auto; }
.dt-pages { display: flex; gap: 6px; align-items: center; }
.dt-page { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; cursor: pointer; }
.dt-page:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-ink); }
.dt-page.on { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-color: transparent; color: #fff; }
.dt-page:disabled { opacity: .4; cursor: not-allowed; }
.dt-gap { color: var(--muted); padding: 0 4px; }
table.list th.dt-sortable { cursor: pointer; user-select: none; position: relative; padding-right: 26px; }
table.list th.dt-sortable::after { content: "↕"; position: absolute; right: 10px; opacity: .35; }
table.list th.asc::after { content: "↑"; opacity: 1; color: var(--primary); }
table.list th.desc::after { content: "↓"; opacity: 1; color: var(--primary); }
/* Drag and drop picture boxes (every file upload). */
.dropzone { position: relative; display: flex; align-items: center; min-height: 92px; padding: 12px; border: 2px dashed var(--border); border-radius: 14px; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .dz-input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; z-index: 1; }
.dropzone .dz-file:not([hidden]) ~ .dz-input, .dropzone .dz-file:not([hidden]) + .dz-input { pointer-events: none; }
.dz-empty { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; text-align: center; color: var(--text-2); }
.dz-empty[hidden], .dz-file[hidden] { display: none; }
.dz-empty svg { width: 24px; height: 24px; color: var(--primary); margin-bottom: 2px; }
.dz-empty b { font-size: 13px; color: var(--text); }
.dz-empty small { font-size: 11.5px; color: var(--muted); }
.dz-file { display: flex; align-items: center; gap: 10px; width: 100%; position: relative; z-index: 2; }
.dz-file img { width: 64px; height: 64px; object-fit: contain; border-radius: 10px; background: #fff; border: 1px solid var(--border); flex: none; }
.dz-file > span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dz-file b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dz-file small { font-size: 11.5px; color: var(--muted); }
/* Picture viewer (data-zoom). */
img.zoomable { cursor: zoom-in; transition: transform .15s; }
img.zoomable:hover { transform: scale(1.06); }
.zoom-view .box { width: min(760px, 100%); }
.zoom-view header h3 { font-size: 15px; }
.zoom-body { display: grid; place-items: center; padding: 20px; background: #fff; border-radius: 0 0 22px 22px; }
.zoom-body img { max-width: 100%; max-height: 70vh; object-fit: contain; }
/* Bell and cart: the icon centered in its button (they sit in .user, whose button style is for the profile). */
.user > .icon-btn { display: grid; place-items: center; width: 42px; padding: 0; gap: 0; }
.user > .icon-btn svg.lucide { margin: 0; }
/* Company: only its logo, bigger. */
.company-chip.logo-only { padding: 3px 8px; background: #fff; border: 1px solid var(--border); }
.company-chip.logo-only img { width: auto; height: 34px; max-width: 140px; padding: 0; border-radius: 6px; background: transparent; }
/* Company logo, bigger (Toky, 2026-11-11). */
.company-chip.logo-only { height: 54px; padding: 3px 10px; }
.company-chip.logo-only img { height: 46px; max-width: 220px; }
.company-chip.logo-only { height: 62px; padding: 3px 10px; }
.company-chip.logo-only img { height: 54px; max-width: 270px; }
/* Compact print modal (the employee credential). */
.modal.print-view.compact .box { width: min(680px, calc(100vw - 40px)); height: min(640px, calc(100vh - 40px)); }
/* Header logo: no white box, the transparent logo on the bar (Toky, 2026-11-11). Dark red / black logo, so in dark mode it gets a light outline to stay visible. */
.company-chip.logo-only { background: transparent; border: 0; box-shadow: none; padding: 0 4px; }
html[data-theme="dark"] .company-chip.logo-only img { filter: drop-shadow(0 0 1px rgba(255, 255, 255, .9)) drop-shadow(0 0 4px rgba(255, 255, 255, .35)); }
/* Notifications (Toky, 2026-11-12). */
.notif-count { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; line-height: 1; box-shadow: 0 0 0 2px var(--surface); }
.icon-btn { position: relative; }
.notif-item { text-decoration: none; color: inherit; }
.notif-item.unread { background: var(--primary-soft); }
.notif-item p { margin: 0; font-weight: 700; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.notif-clear { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.notif-clear svg { width: 13px; height: 13px; }
.notif-clear:hover { color: var(--red); border-color: var(--red); }
.notif-row { position: relative; }
.notif-row .notif-item { padding-right: 34px; }
.notif-del { position: absolute; top: 10px; right: 8px; display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; opacity: .6; }
.notif-del svg { width: 14px; height: 14px; }
.notif-row:hover .notif-del { opacity: 1; }
.notif-del:hover { background: var(--surface-2); color: var(--red); }
.notif-del-form { position: absolute; top: 0; right: 0; }
.cart-count:empty, .cart-count[data-cart-count="0"] { display: none; }
/* Cart › production requests, as cards (Toky, 2026-11-12). */
#cart-menu { width: 340px; }
.req-card { position: relative; margin: 6px 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.req-card:hover { border-color: var(--primary); box-shadow: 0 8px 20px rgba(15, 23, 42, .08); }
.req-card-main { display: flex; gap: 12px; padding: 12px 44px 12px 12px; color: var(--text); text-decoration: none; }
.req-av { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; font-weight: 800; font-size: 17px; }
.req-body { display: grid; gap: 3px; min-width: 0; flex: 1; }
.req-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.req-top b { font-size: 16px; letter-spacing: -.01em; }
.req-top em { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; background: var(--amber-soft); color: #b45309; font-style: normal; font-size: 11px; font-weight: 700; white-space: nowrap; }
.req-top em svg { width: 11px; height: 11px; }
.req-dealer { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req-dealer small { font-weight: 500; color: var(--text-2); }
.req-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--text-2); }
.req-meta span { display: inline-flex; align-items: center; gap: 4px; }
.req-meta svg { width: 12px; height: 12px; }
.req-meta .req-total { color: var(--primary-ink); font-weight: 800; }
.req-del { position: absolute; top: 10px; right: 10px; }
.req-del button { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.req-del button svg { width: 15px; height: 15px; }
.req-del button:hover { border-color: #fecaca; background: #fef2f2; color: var(--red); }
.req-dealer { display: flex; align-items: center; gap: 5px; }
.req-dealer svg { flex: none; width: 13px; height: 13px; color: var(--primary); }
.req-by { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req-card-main { padding-right: 12px; }
.req-del { top: auto; bottom: 8px; right: 8px; }
/* Bell and cart: about 3 notifications / requests, then a vertical scroll (Toky, 2026-11-13). */
.notif-list { max-height: 228px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; margin-right: -4px; padding-right: 4px; }
.notif-list.req-list { max-height: 352px; }
/* Accounting dashboard (Toky, 2026-11-13). */
.acc-periods { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.acc-periods a { padding: 7px 14px; border-radius: 9px; color: var(--text-2); font-weight: 600; font-size: 13px; white-space: nowrap; }
.acc-periods a:hover { color: var(--text); background: var(--surface-2); }
.acc-periods a.on { background: var(--primary); color: #fff; }
.acc-kpis .value { font-size: 28px; }
.acc-bar { display: inline-block; width: 60px; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.acc-bar i { display: block; height: 100%; border-radius: 99px; background: var(--green); }
.acc-legend { display: flex; gap: 12px; font-size: 12px; color: var(--text-2); }
.acc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.acc-legend i { width: 9px; height: 9px; border-radius: 3px; }
.acc-pipe { display: grid; gap: 4px; padding: 14px 16px; border-radius: 14px; background: linear-gradient(135deg, var(--primary-soft, rgba(20,184,166,.1)), transparent); border: 1px solid var(--border); }
.acc-pipe b { font-size: 24px; letter-spacing: -.02em; }
.acc-pipe span { color: var(--text-2); font-size: 13px; }
.acc-pipe em { color: var(--amber); font-style: normal; font-weight: 700; }
.acc-amt { white-space: nowrap; color: var(--green); }
.acc-vendors { display: grid; gap: 14px; }
.acc-vendor { display: grid; grid-template-columns: 170px 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
.acc-vendor span { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-vendor b { white-space: nowrap; }
@media (max-width: 700px) { .acc-periods { width: 100%; } .acc-periods a { flex: 1; text-align: center; padding: 7px 6px; } .acc-vendor { grid-template-columns: 1fr auto; } .acc-vendor .bar { grid-column: 1 / -1; } }
.acc-table td.num, .acc-table th.num { white-space: nowrap; }
.acc-table .bar i, .acc-vendor .bar i { background: linear-gradient(90deg, var(--primary), #6366f1); }
.acc-vendor .bar i { background: linear-gradient(90deg, #f59e0b, #f97316); }
.chart-box.acc-donut { height: 170px; }
/* User menu › Switch company (Toky, 2026-11-13). */
#user-menu { min-width: 250px; }
.sw-head { padding: 2px 10px 4px; }
.sw-head small { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.sw-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.sw-item > span:not(.sw-logo) { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.sw-item b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-item small { color: var(--muted); font-size: 11px; }
.sw-item > svg { width: 15px; height: 15px; color: var(--muted); }
button.sw-item:hover { background: var(--primary-soft); }
button.sw-item:hover > svg { color: var(--primary); }
.sw-current > svg { color: var(--green); }
.sw-logo { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); color: var(--text-2); font-size: 11px; font-weight: 800; object-fit: contain; }
.sw-current .sw-logo { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }

/* The user's license in the top bar (Toky, 2026-11-14): a modern pill — soft tint, colored text, thin border, a dot */
.license-badge { --lc: #475569; display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap;
  color: var(--lc); background: color-mix(in srgb, var(--lc) 12%, transparent); border: 1px solid color-mix(in srgb, var(--lc) 35%, transparent); }
.license-badge svg.lucide, .license-badge i { display: none; } /* the dot is enough */
.license-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--lc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lc) 22%, transparent); }
.license-badge.lic-free { --lc: #64748b; }
.license-badge.lic-gold { --lc: #d97706; }
.license-badge.lic-premium { --lc: #7c3aed; }
@media (max-width: 760px) { .license-badge { display: none; } }

/* Reports › Report (Toky, 2026-11-14) */
.rp-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.rp-range { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font-size: 13px; color: var(--text-2); }
.rp-range input[type=date] { border: 0; background: transparent; color: var(--text); font: inherit; padding: 4px; }
.rp-head-r { display: flex; align-items: center; gap: 10px; }
.rp-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rp-mini > div { padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; display: grid; gap: 2px; }
.rp-mini span { color: var(--muted); font-size: 12px; }
.rp-mini b { font-size: 17px; letter-spacing: -.01em; }
.rp-bars, .rp-aging { display: grid; gap: 12px; }
.rp-aging { margin-bottom: 16px; }
.rp-aging > div { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
.rp-aging > div span { font-weight: 600; }
.rp-aging .bar i { background: var(--amber); }
.rp-cats { display: flex; height: 12px; border-radius: 99px; overflow: hidden; gap: 2px; margin-bottom: 10px; }
.rp-cat-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); margin-bottom: 14px; }
.rp-cat-legend span { display: inline-flex; align-items: center; gap: 5px; }
.rp-cat-legend i { width: 9px; height: 9px; border-radius: 3px; }
@media print {
  .sidebar, .topbar, .no-print, .rp-tools { display: none !important; }
  .main { margin: 0 !important; padding: 0 !important; }
  .card { break-inside: avoid; box-shadow: none !important; }
  .kpi.hero { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
table.rp-table th, table.rp-table td { padding: 10px 12px; }
table.rp-table td { white-space: nowrap; }
table.rp-table td:first-child, table.rp-table th:first-child { padding-left: 20px; }

/* Reports › Report Real Time (Toky, 2026-11-14) */
.rt-live { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #047857; background: rgba(16, 185, 129, .12); border: 1px solid rgba(16, 185, 129, .35); white-space: nowrap; }
.rt-live i { width: 8px; height: 8px; border-radius: 50%; background: #10b981; animation: rt-pulse 1.6s infinite; }
.rt-live.off { color: var(--text-2); background: var(--surface-2); border-color: var(--border); }
.rt-live.off i { background: var(--muted); animation: none; }
@keyframes rt-pulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .55); } 70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
.rt-kpis .meta { flex-wrap: wrap; }
.rt-up { color: var(--green); font-weight: 700; }
.rt-down { color: var(--red, #ef4444); font-weight: 700; }
.kpi.hero .rt-up, .kpi.hero .rt-down { color: #fff; }
.rt-flat { color: var(--muted); }
.rt-kinds { display: grid; gap: 12px; }
.rt-kind { display: grid; grid-template-columns: 112px minmax(30px, 1fr) auto auto; align-items: center; gap: 10px; font-size: 13px; }
.rt-kind span { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.rt-kind span i { width: 9px; height: 9px; border-radius: 3px; }
.rt-kind small { color: var(--muted); text-align: right; }
.rt-sellers { display: grid; gap: 10px; }
.rt-seller { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.rt-seller small { display: block; color: var(--muted); font-size: 12px; }
.rt-rank { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; font-size: 12px; }
.rt-feed { max-height: 460px; overflow-y: auto; }

/* Setting › Notifications window (Toky, 2026-11-14): everything inside it, and a modern message box */
.modal .box.bc-box { width: min(560px, calc(100vw - 32px)); max-width: 100%; overflow: hidden; }
.bc-box form, .bc-box .field { min-width: 0; }
.bc-box select { width: 100%; max-width: 100%; min-width: 0; text-overflow: ellipsis; }
.bc-text { position: relative; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); transition: border-color .15s, box-shadow .15s, background .15s; }
.bc-text:focus-within { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.bc-text textarea { display: block; width: 100%; box-sizing: border-box; min-height: 130px; resize: vertical; border: 0; outline: 0; background: transparent; padding: 14px 16px 30px; font: inherit; font-size: 14px; line-height: 1.5; color: var(--text); box-shadow: none; }
.bc-text textarea::placeholder { color: var(--muted); }
.bc-count { position: absolute; right: 12px; bottom: 8px; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
/* Company settings › General › System online (Toky, 2026-11-14) */
.sys-card { margin-bottom: 16px; }
.sys-row { display: flex; align-items: center; gap: 14px; }
.sys-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.sys-card.on .sys-ico { background: rgba(16, 185, 129, .14); color: #047857; }
.sys-card.off .sys-ico { background: rgba(245, 158, 11, .16); color: #b45309; }
.sys-card.off { border-color: #fcd34d; background: color-mix(in srgb, #fef3c7 45%, var(--surface)); }
.sys-txt { flex: 1; display: grid; gap: 3px; }
.sys-txt b { font-size: 15px; }
.sys-txt small { color: var(--text-2); font-size: 13px; }
.sys-switch { position: relative; width: 54px; height: 30px; border-radius: 999px; border: 0; cursor: pointer; flex: none; background: #cbd5e1; transition: background .2s; padding: 0; }
.sys-switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.sys-switch[aria-checked="true"] { background: #10b981; }
.sys-switch[aria-checked="true"] i { transform: translateX(24px); }
/* App Sound switch in the sidebar, under Sign out (Toky, 2026-11-14) */
.app-sound { display: flex; align-items: center; gap: 10px; margin: 6px 0 0; padding: 9px 12px; border-radius: 10px; color: var(--text-2); font-size: 14px; font-weight: 500; cursor: pointer; user-select: none; }
.app-sound:hover { background: var(--surface-2); color: var(--text); }
.app-sound svg.lucide { width: 18px; height: 18px; flex: none; }
.app-sound span { flex: 1; }
.app-sound input { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 34px; height: 20px; margin: 0; border-radius: 999px; background: #cbd5e1; cursor: pointer; transition: background .15s; }
.app-sound input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.3); transition: transform .15s; }
.app-sound input:checked { background: var(--primary); }
.app-sound input:checked::after { transform: translateX(14px); }
.app-sound input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Loading in the middle of the screen (assets/loading.js, Toky 2026-11-14): only when a load takes over 300 ms. */
.app-loading { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: rgba(15, 23, 42, .18); opacity: 0; visibility: hidden; transition: opacity .15s, visibility .15s; }
.app-loading.on { opacity: 1; visibility: visible; }
.app-loading-card { display: flex; align-items: center; gap: 12px; padding: 16px 22px; border-radius: 16px; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 18px 50px rgba(15, 23, 42, .22); font-size: 14px; }
.app-loading-spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--primary-soft, rgba(13, 148, 136, .2)); border-top-color: var(--primary, #0d9488); animation: app-spin .8s linear infinite; }
@keyframes app-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .app-loading-spin { animation-duration: 2s; } }
