/*
 * Phone Shop Manager — PHP UI theme.
 * Material-style theme: palette, radii, shadows,
 * type scale and component shapes. Colours come from CSS variables emitted per light/dark mode by layout.php.
 */

/* ------------------------------------------------------------------ tokens */
:root {
  --font: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg: #f3f5fb;
  --paper: #ffffff;
  --text: rgba(0, 0, 0, 0.87);
  --text-2: rgba(0, 0, 0, 0.6);
  --text-3: rgba(0, 0, 0, 0.38);
  --divider: rgba(15, 23, 42, 0.08);
  --action: rgba(0, 0, 0, 0.54);
  --action-hover: rgba(0, 0, 0, 0.04);
  --action-selected: rgba(0, 0, 0, 0.08);
  --input-bg: #fff;
  --input-border: rgba(0, 0, 0, 0.23);
  --input-border-hover: rgba(0, 0, 0, 0.87);
  --card-border: rgba(15, 23, 42, 0.05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .06);
  --shadow-hover: 0 2px 6px rgba(16, 24, 40, .06), 0 14px 32px rgba(16, 24, 40, .10);
  --shadow-menu: 0px 5px 5px -3px rgba(0,0,0,0.2), 0px 8px 10px 1px rgba(0,0,0,0.14), 0px 3px 14px 2px rgba(0,0,0,0.12);
  --shadow-dialog: 0px 11px 15px -7px rgba(0,0,0,0.2), 0px 24px 38px 3px rgba(0,0,0,0.14), 0px 9px 46px 8px rgba(0,0,0,0.12);
  --grid-border: #e2e3e5;
  --chip-default: rgba(0, 0, 0, 0.08);
  --chip-outline: #bdbdbd;
  --switch-track: #000;
  --switch-track-opacity: .38;
  --appbar: rgba(255, 255, 255, 0.78);
  --radius: 14px;
  --radius-card: 16px;
  --drawer: 260px;
}
html[data-theme=dark] {
  --bg: #0a0f1e;
  --paper: #121a2f;
  --text: #fff;
  --text-2: rgba(255, 255, 255, 0.7);
  --text-3: rgba(255, 255, 255, 0.5);
  --divider: rgba(148, 163, 184, .16);
  --action: #fff;
  --action-hover: rgba(255, 255, 255, 0.08);
  --action-selected: rgba(255, 255, 255, 0.16);
  --input-bg: rgba(255, 255, 255, .02);
  --input-border: rgba(255, 255, 255, 0.23);
  --input-border-hover: #fff;
  --card-border: rgba(148, 163, 184, .10);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  --shadow-hover: 0 2px 4px rgba(0,0,0,.5), 0 14px 32px rgba(0,0,0,.45);
  --grid-border: #2a3348;
  --chip-default: rgba(255, 255, 255, 0.16);
  --chip-outline: #616161;
  --switch-track: #fff;
  --switch-track-opacity: .3;
  --appbar: rgba(18, 26, 47, 0.78);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--text);
  background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
b, strong { font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
hr.divider { border: 0; border-top: 1px solid var(--divider); margin: 0; }
[hidden], .hidden { display: none !important; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--primary-a25); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
@keyframes psFadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes psFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes psGrow { from { opacity: 0; transform: scale(.75); } to { opacity: 1; transform: none; } }
@keyframes psSpin { to { transform: rotate(360deg); } }

.icon { width: 1em; height: 1em; font-size: 24px; fill: currentColor; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.grow { flex: 1; }

/* typography (MUI variants) */
.h4 { margin: 0; font-size: 1.65rem; font-weight: 800; line-height: 1.235; letter-spacing: -0.02em; }
.h5 { margin: 0; font-size: 1.35rem; font-weight: 800; line-height: 1.334; letter-spacing: -0.01em; }
.h6 { margin: 0; font-size: 1.05rem; font-weight: 700; line-height: 1.6; }
.subtitle2 { font-size: .875rem; font-weight: 700; line-height: 1.57; }
.body2 { font-size: .875rem; line-height: 1.43; }
.caption { font-size: .75rem; line-height: 1.66; }
.text-secondary { color: var(--text-2); }
.fw600 { font-weight: 600; } .fw700 { font-weight: 700; } .fw800 { font-weight: 800; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.c-error { color: var(--error); } .c-warning { color: var(--warning); } .c-success { color: var(--success); }

/* ------------------------------------------------------------------ shell */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--drawer); z-index: 1200; background: var(--sidebar); color: #fff;
}
.sidebar-inner { display: flex; flex-direction: column; height: 100%; }
.brand { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 24px; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 21px; background: #fff; flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-logo-empty { background: rgba(255, 255, 255, .15); color: #fff; }
.brand-text { min-width: 0; }
.brand-name {
  font-weight: 800; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.brand-tag { opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-divider { border: 0; border-top: 1px solid rgba(255, 255, 255, .12); margin: 0; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .2); }
.nav-list { list-style: none; margin: 0; padding: 8px 0; }
.nav-list:has(.nav-sub) { padding-top: 0; }
.nav-sub { padding: 0 16px; line-height: 30px; font-size: 11px; font-weight: 800; letter-spacing: 1.2px; color: rgba(255, 255, 255, .55); }
.nav-item {
  display: flex; align-items: center; margin: 0 10px 3.2px; padding: 6.4px 16px; border-radius: 35px;
  color: rgba(255, 255, 255, .82); transition: background-color .15s ease, color .15s ease;
}
.nav-icon { min-width: 36px; display: flex; }
.nav-icon .icon { transition: transform .2s ease; }
.nav-text { font-size: 14px; font-weight: 600; line-height: 20.02px; margin: 4px 0; }
.nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-item:hover .nav-icon .icon { transform: scale(1.12); }
.nav-item.active { background: rgba(255, 255, 255, .16); color: #fff; }
.nav-item.active .nav-text { font-weight: 800; }
.sidebar-backdrop { display: none; }

.appbar {
  position: fixed; top: 0; right: 0; left: var(--drawer); z-index: 1100; border-bottom: 1px solid var(--divider);
  background: var(--appbar); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.toolbar { display: flex; align-items: center; gap: 8px; min-height: 64px; padding: 0 24px; }
.icon-btn.menu-btn { display: inline-flex; margin-left: -12px; }
.top-search {
  display: flex; align-items: center; flex: 1; max-width: 520px; padding: 4px 12px; border-radius: 42px;
  background: var(--primary-a07); border: 1px solid var(--primary-a12); transition: all .2s ease;
}
.top-search:focus-within { background: var(--paper); border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-a12); }
.top-search-icon { font-size: 20px; color: var(--action); }
.top-search input { flex: 1; margin-left: 8px; border: 0; outline: 0; background: transparent; padding: 4px 0 5px; line-height: 23px; min-width: 0; }
.top-search input::placeholder { color: currentColor; opacity: .42; }
.main { margin-left: var(--drawer); padding: 24px; margin-top: 64px; min-width: 0; }
.page { animation: psFadeUp .28s ease; }
html[data-theme=dark] .when-light, html:not([data-theme=dark]) .when-dark { display: none; }
.when-light, .when-dark { display: flex; }

@media (max-width: 899.95px) {
  .sidebar { transform: translateX(-100%); transition: transform .225s cubic-bezier(0, 0, .2, 1); box-shadow: 0 8px 10px -5px rgba(0,0,0,.2), 0 16px 24px 2px rgba(0,0,0,.14), 0 6px 30px 5px rgba(0,0,0,.12); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 1199; background: rgba(0, 0, 0, .5); animation: psFade .2s; }
  .appbar { left: 0; }
  .icon-btn.menu-btn { display: inline-flex; }
  .main { margin-left: 0; padding: 16px; }
}
@media (max-width: 599.95px) {
  .toolbar { padding: 0 16px; min-height: 56px; }

  .brand { padding: 8px 16px; }
}

/* ------------------------------------------------------------------ buttons */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 8px; border: 0; border-radius: 50%;
  background: transparent; color: var(--action); cursor: pointer; transition: background-color .15s cubic-bezier(.4, 0, .2, 1);
}
.icon-btn:hover { background: var(--action-hover); }
.icon-btn:disabled { color: var(--text-3); cursor: default; background: transparent; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0; border: 0; border-radius: 10px;
  padding: 6px 16px; min-width: 64px; font-size: .875rem; font-weight: 700; line-height: 1.75; cursor: pointer;
  text-transform: none; transition: all .18s ease; white-space: nowrap; background: transparent; user-select: none;
}
.btn .btn-icon, .btn > .icon { font-size: 20px; margin: 0 8px 0 -4px; }
.btn:disabled { cursor: default; opacity: 1; }
.btn-contained { background: var(--c); color: var(--cc); }
.btn-contained:hover { background: var(--cd); }
.btn-contained:disabled { background: var(--action-selected); color: var(--text-3); }
.btn-outlined { padding: 4.5px 16px; border: 1.5px solid var(--ca50); color: var(--c); }
.btn-outlined:hover { background: var(--ca04); border-color: var(--c); }
.btn-text { color: var(--c); }
.btn-text:hover { background: var(--ca04); }
.btn-text:disabled, .btn-outlined:disabled { color: var(--text-3); border-color: var(--action-selected); }
.btn-small { padding: 4px 16px; font-size: .8125rem; line-height: 1.75; }
.btn-small .btn-icon, .btn-small > .icon { font-size: 18px; }
.btn-text.btn-small { padding: 4px 16px; }
.btn-outlined.btn-small { padding: 2.5px 16px; }
.btn-large { padding: 8px 22px; font-size: .9375rem; }
.btn-block { width: 100%; }
.btn-c-primary { --c: var(--primary); --cc: var(--primary-contrast); --cd: var(--primary-dark); --ca04: var(--primary-a04); --ca50: var(--primary-a50); }
.btn-c-secondary { --c: var(--secondary); --cc: var(--secondary-contrast); --cd: var(--secondary-dark); --ca04: var(--secondary-a04); --ca50: var(--secondary-a50); }
.btn-c-error { --c: var(--error); --cc: var(--error-contrast); --cd: var(--error-dark); --ca04: var(--error-a04); --ca50: var(--error-a50); }
.btn-c-success { --c: var(--success); --cc: var(--success-contrast); --cd: var(--success-dark); --ca04: var(--success-a04); --ca50: var(--success-a50); }
.btn-c-warning { --c: var(--warning); --cc: var(--warning-contrast); --cd: var(--warning-dark); --ca04: var(--warning-a04); --ca50: var(--warning-a50); }
.btn-c-info { --c: var(--info); --cc: var(--info-contrast); --cd: var(--info-dark); --ca04: var(--info-a04); --ca50: var(--info-a50); }
.btn-c-inherit { --c: currentColor; --ca04: var(--action-hover); --ca50: var(--input-border); }

/* ------------------------------------------------------------------ avatar, chip, dot, thumb */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0; user-select: none;
}
.avatar-user { width: 34px; height: 34px; font-size: 14px; font-weight: 800; background: var(--secondary); color: var(--bg); line-height: 1; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; height: 24px; border-radius: 8px; padding: 0 8px;
  font-size: .8125rem; font-weight: 700; line-height: 1.5; white-space: nowrap; vertical-align: middle; border: 1px solid transparent;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0;
}
.chip-medium { height: 32px; padding: 0 12px; }
.chip-outlined { padding: 0 7px; }
.chip-filled.chip-c-default { background: var(--chip-default); color: var(--text); }
.chip-outlined.chip-c-default { border-color: var(--chip-outline); color: var(--text); }
.chip-filled.chip-c-primary { background: var(--primary); color: var(--primary-contrast); }
.chip-filled.chip-c-secondary { background: var(--secondary); color: var(--secondary-contrast); }
.chip-filled.chip-c-success { background: var(--success); color: var(--success-contrast); }
.chip-filled.chip-c-warning { background: var(--warning); color: var(--warning-contrast); }
.chip-filled.chip-c-error { background: var(--error); color: var(--error-contrast); }
.chip-filled.chip-c-info { background: var(--info); color: var(--info-contrast); }
.chip-outlined.chip-c-primary { border-color: var(--primary-a70); color: var(--primary); }
.chip-outlined.chip-c-secondary { border-color: var(--secondary-a70); color: var(--secondary); }
.chip-outlined.chip-c-success { border-color: var(--success-a70); color: var(--success); }
.chip-outlined.chip-c-warning { border-color: var(--warning-a70); color: var(--warning); }
.chip-outlined.chip-c-error { border-color: var(--error-a70); color: var(--error); }
.chip-outlined.chip-c-info { border-color: var(--info-a70); color: var(--info); }
.color-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.thumb {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden;
  border: 1px solid transparent; vertical-align: middle;
}
.thumb .icon { font-size: inherit; }
.thumb-photo { background: #fff; border-color: var(--divider); }
.thumb-photo img { width: 100%; height: 100%; object-fit: contain; }

/* ------------------------------------------------------------------ card & layout helpers */
.card {
  display: block; background: var(--paper); color: var(--text); border-radius: var(--radius-card); border: 1px solid var(--card-border);
  box-shadow: var(--shadow); transition: box-shadow .2s ease, transform .2s ease; overflow: hidden;
}
.card-content { padding: 16px; }
.card-content:last-child { padding-bottom: 24px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-sub { margin: 4px 0 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 599.95px) {
  .page-header { flex-direction: column; align-items: stretch; }
  .page-actions { align-self: flex-start; }
}
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.mb2 { margin-bottom: 16px; } .mb3 { margin-bottom: 24px; } .mt1 { margin-top: 8px; }

/* 12-column grid with MUI breakpoints (xs 0, sm 600, md 900, lg 1200, xl 1536) */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.grid.gap-12 { gap: 12px; }
.grid > * { grid-column: span 12; min-width: 0; }
.xs-4 { grid-column: span 4 !important; } .xs-6 { grid-column: span 6 !important; } .xs-12 { grid-column: span 12 !important; }
@media (min-width: 600px) {
  .sm-3 { grid-column: span 3 !important; } .sm-4 { grid-column: span 4 !important; } .sm-5 { grid-column: span 5 !important; }
  .sm-6 { grid-column: span 6 !important; } .sm-8 { grid-column: span 8 !important; } .sm-12 { grid-column: span 12 !important; }
}
@media (min-width: 900px) {
  .md-2 { grid-column: span 2 !important; } .md-3 { grid-column: span 3 !important; } .md-4 { grid-column: span 4 !important; }
  .md-6 { grid-column: span 6 !important; } .md-7 { grid-column: span 7 !important; } .md-8 { grid-column: span 8 !important; }
}
@media (min-width: 1200px) {
  .lg-3 { grid-column: span 3 !important; } .lg-4 { grid-column: span 4 !important; } .lg-5 { grid-column: span 5 !important; }
  .lg-8 { grid-column: span 8 !important; }
}
@media (min-width: 1536px) { .xl-2 { grid-column: span 2 !important; } }

/* ------------------------------------------------------------------ stat card */
.stat-card { height: 100%; position: relative; overflow: hidden; }
.stat-card.clickable { cursor: pointer; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.stat-card::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: var(--sa08);
}
.stat-filled { background: var(--sc); color: #fff; }
.stat-filled::after { background: rgba(255, 255, 255, .12); }
.stat-tinted { background: var(--st); }
.stat-content { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.stat-text { min-width: 0; }
.stat-label { font-weight: 600; color: var(--text-2); }
.stat-filled .stat-label, .stat-filled .stat-sub { color: inherit; opacity: .85; }
.stat-tinted .stat-sub { color: var(--text-2); }
.stat-value { margin-top: 4px; word-break: break-word; }
.stat-icon { display: flex; padding: 8.8px; border-radius: 35px; background: var(--sc); color: #fff; box-shadow: 0 6px 16px var(--sa25); }
.stat-filled .stat-icon { background: #fff; color: var(--sc); box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }
.stat-c-primary { --sc: var(--primary); --scc: var(--primary-contrast); --st: var(--primary-tint); --sa08: var(--primary-a08); --sa25: var(--primary-a25); }
.stat-c-secondary { --sc: var(--secondary); --scc: var(--secondary-contrast); --st: var(--secondary-tint); --sa08: var(--secondary-a08); --sa25: var(--secondary-a25); }
.stat-c-info { --sc: var(--info); --scc: var(--info-contrast); --st: var(--info-tint); --sa08: var(--info-a08); --sa25: var(--info-a25); }
.stat-c-success { --sc: var(--success); --scc: var(--success-contrast); --st: var(--success-tint); --sa08: var(--success-a08); --sa25: var(--success-a25); }
.stat-c-warning { --sc: var(--warning); --scc: var(--warning-contrast); --st: var(--warning-tint); --sa08: var(--warning-a08); --sa25: var(--warning-a25); }
.stat-c-error { --sc: var(--error); --scc: var(--error-contrast); --st: var(--error-tint); --sa08: var(--error-a08); --sa25: var(--error-a25); }

/* ------------------------------------------------------------------ form fields (MUI outlined, size small) */
.field { position: relative; display: inline-flex; flex-direction: column; width: 100%; min-width: 0; vertical-align: top; }
.field input, .field select, .field textarea {
  display: block; width: 100%; min-width: 0; margin: 0; border: 0; outline: 0; background: none; border-radius: 10px;
  padding: 8.5px 14px; font-size: 1rem; line-height: 1.4375em; height: 40px; position: relative; z-index: 1;
}
.field { background: var(--input-bg); border-radius: 10px; }
.field textarea { height: auto; resize: vertical; padding: 8.5px 14px; }
.field select { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer; text-overflow: ellipsis; }
.field select option { background: var(--paper); color: var(--text); }
.field input::placeholder, .field textarea::placeholder { color: currentColor; opacity: .42; transition: opacity .2s; }
.field:not(.shrink):not(:focus-within) input::placeholder, .field:not(.shrink):not(:focus-within) textarea::placeholder { opacity: 0; }
.field input[type=date]:not(:focus)::-webkit-datetime-edit { opacity: 1; }
.field input[type=number] { -moz-appearance: textfield; }
.field label {
  position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; color: var(--text-2); font-size: 1rem; line-height: 1.4375em;
  transform-origin: top left; transform: translate(14px, 9px) scale(1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: calc(100% - 24px); transition: color .2s cubic-bezier(0, 0, .2, 1), transform .2s cubic-bezier(0, 0, .2, 1), max-width .2s;
}
.field.shrink label, .field:focus-within label { transform: translate(14px, -9px) scale(.75); max-width: calc(133% - 32px); }
.field:focus-within label { color: var(--primary); }
.field fieldset {
  position: absolute; inset: -5px 0 0; margin: 0; padding: 0 8px; pointer-events: none; border-radius: inherit;
  border: 1px solid var(--input-border); overflow: hidden; min-width: 0; text-align: left;
}
.field fieldset legend {
  float: unset; width: auto; overflow: hidden; display: block; padding: 0; height: 11px; font-size: .75em; visibility: hidden;
  max-width: .01px; transition: max-width 50ms cubic-bezier(0, 0, .2, 1); white-space: nowrap;
}
.field fieldset legend > span { padding: 0 5px; display: inline-block; opacity: 0; visibility: visible; }
.field.shrink fieldset legend, .field:focus-within fieldset legend { max-width: 100%; transition: max-width 100ms cubic-bezier(0, 0, .2, 1) 50ms; }
.field:hover fieldset { border-color: var(--input-border-hover); }
.field:focus-within fieldset { border: 2px solid var(--primary); }
.field.invalid fieldset { border-color: var(--error); }
.field.invalid label { color: var(--error); }
.field .req { font-weight: 400; }
.field .select-arrow { position: absolute; right: 7px; top: calc(50% - .5em); color: var(--action); pointer-events: none; z-index: 2; }
.field.has-prefix { flex-direction: row; align-items: center; padding-left: 14px; }
.field.has-prefix input { padding-left: 0; }
.field-prefix { color: var(--text-2); margin-right: 8px; white-space: nowrap; position: relative; z-index: 1; }
.field.has-prefix label { transform: translate(14px, -9px) scale(.75); max-width: calc(133% - 32px); }
.field.has-prefix fieldset legend { max-width: 100%; }
.field.multiline textarea { min-height: 63px; }
.field-help { margin: 3px 14px 0; font-size: .75rem; line-height: 1.66; color: var(--text-2); }
.field-wrap { display: flex; flex-direction: column; }

/* switch (MUI Switch + FormControlLabel) */
.switch-label { display: inline-flex; align-items: center; margin: 0 16px 0 -11px; cursor: pointer; user-select: none; vertical-align: middle; }
.switch { position: relative; display: inline-flex; width: 58px; height: 38px; padding: 12px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 2; width: 100%; height: 100%; }
.switch-track { width: 100%; height: 100%; border-radius: 7px; background: var(--switch-track); opacity: var(--switch-track-opacity); transition: opacity .15s, background-color .15s; }
.switch-thumb {
  position: absolute; top: 9px; left: 9px; width: 20px; height: 20px; border-radius: 50%; background: #fff; pointer-events: none;
  box-shadow: 0 2px 1px -1px rgba(0,0,0,.2), 0 1px 1px 0 rgba(0,0,0,.14), 0 1px 3px 0 rgba(0,0,0,.12); transition: transform .15s cubic-bezier(.4, 0, .2, 1);
}
html[data-theme=dark] .switch-thumb { background: #e0e0e0; }
.switch::before { content: ""; position: absolute; top: 0; left: 0; width: 38px; height: 38px; border-radius: 50%; transition: transform .15s cubic-bezier(.4, 0, .2, 1), background-color .15s; }
.switch:hover::before { background: var(--action-hover); }
.switch input:checked ~ .switch-thumb { transform: translateX(20px); background: var(--primary); }
.switch input:checked ~ .switch-track { background: var(--primary); opacity: .5; }
.switch:has(input:checked)::before { transform: translateX(20px); }
.switch:has(input:checked):hover::before { background: var(--primary-a04); }
.switch-text { font-size: 1rem; line-height: 1.5; }

/* alert */
.alert {
  display: flex; align-items: flex-start; padding: 6px 16px; border-radius: var(--radius); font-size: .875rem; line-height: 1.43;
  font-weight: 400; background: var(--at); color: var(--atx);
}
.alert > .icon { margin-right: 12px; padding: 7px 0; font-size: 22px; width: 22px; height: 36px; color: var(--ac); box-sizing: content-box; opacity: .9; }
.alert > div { padding: 8px 0; min-width: 0; overflow: auto; }
.alert-error { --ac: var(--error); --at: var(--error-tint); --atx: #5f2120; --af: var(--error); --afc: var(--error-contrast); }
.alert-warning { --ac: var(--warning); --at: var(--warning-tint); --atx: #663c00; --af: var(--warning); --afc: var(--warning-contrast); }
.alert-info { --ac: var(--info); --at: var(--info-tint); --atx: #014361; --af: var(--info); --afc: var(--info-contrast); }
.alert-success { --ac: var(--success); --at: var(--success-tint); --atx: #1e4620; --af: var(--success); --afc: var(--success-contrast); }
html[data-theme=dark] .alert { --atx: var(--text); }
.alert-filled { background: var(--af); color: var(--afc); font-weight: 500; }
.alert-filled > .icon { color: inherit; }
.alert-close { margin: 2px -8px 0 auto; padding: 5px; color: inherit; align-self: flex-start; }
.alert-close .icon { font-size: 20px; }
.alert-close:hover { background: rgba(255, 255, 255, .12); }

/* ------------------------------------------------------------------ dialog */
dialog.dialog {
  padding: 0; border: 0; border-radius: 18px; background: var(--paper); color: var(--text); box-shadow: var(--shadow-dialog);
  width: calc(100% - 64px); max-height: calc(100% - 64px); overflow-y: auto; margin: auto;
}
dialog.dialog[open] { animation: psFade .225s cubic-bezier(.4, 0, .2, 1); }
dialog.dialog::backdrop { background: rgba(0, 0, 0, .5); animation: psFade .225s; }
.dialog-xs { max-width: 444px; } .dialog-sm { max-width: 600px; } .dialog-md { max-width: 900px; } .dialog-lg { max-width: 1200px; }
.dialog-title { margin: 0; padding: 16px 24px; font-size: 1.05rem; font-weight: 700; line-height: 1.6; }
.dialog-content { padding: 0 24px 20px; overflow-y: auto; }
.dialog-content > .alert { margin-bottom: 16px; }
.dialog-content > .stack { padding-top: 8px; }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 8px 24px 16px; }
@media (max-width: 599.95px) { dialog.dialog { width: calc(100% - 32px); max-height: calc(100% - 32px); } }

/* ------------------------------------------------------------------ menu / popover */
.menu-wrap { position: relative; }
.menu {
  position: absolute; z-index: 1300; right: 0; top: calc(100% + 4px); min-width: 180px; padding: 8px 0; border-radius: 16px;
  background: var(--paper); color: var(--text); box-shadow: var(--shadow-menu); display: none; transform-origin: top right;
}
html[data-theme=dark] .menu, html[data-theme=dark] .popover { background-image: linear-gradient(rgba(255,255,255,.12), rgba(255,255,255,.12)); }
.menu.open { display: block; animation: psGrow .2s cubic-bezier(.4, 0, .2, 1); }
.menu-head { padding: 8px 16px; }
.menu .divider { margin: 8px 0; }
.menu-item {
  display: flex; align-items: center; width: 100%; padding: 6px 16px; border: 0; background: none; text-align: left; cursor: pointer;
  font-size: 1rem; line-height: 1.5; min-height: auto; color: inherit; white-space: nowrap;
}
.menu-item:hover, .menu-item.focus { background: var(--action-hover); }
.menu-item.selected { background: var(--primary-a08); }
.menu-item.selected:hover { background: var(--primary-a12); }
.popover {
  position: fixed; z-index: 1400; background: var(--paper); color: var(--text); border-radius: 16px; box-shadow: var(--shadow-menu);
  padding: 8px 0; max-height: 50vh; overflow-y: auto; animation: psGrow .18s cubic-bezier(.4, 0, .2, 1); transform-origin: top center;
}

/* snackbar */
.snackbar {
  position: fixed; left: 50%; bottom: 24px; z-index: 1400; transform: translateX(-50%); min-width: 288px; max-width: calc(100% - 16px);
  box-shadow: 0 3px 5px -1px rgba(0,0,0,.2), 0 6px 10px 0 rgba(0,0,0,.14), 0 1px 18px 0 rgba(0,0,0,.12); border-radius: var(--radius);
}
.snackbar.show { animation: psGrow .225s cubic-bezier(.4, 0, .2, 1); }
.snackbar .alert { min-width: 288px; }

/* spinner */
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 3.6px solid var(--primary); border-right-color: transparent; animation: psSpin .9s linear infinite; }
.loading { display: flex; justify-content: center; padding: 64px 0; }

/* ------------------------------------------------------------------ data grid (MUI DataGrid, compact) */
.data-grid { width: 100%; }
.grid-toolbar { display: flex; align-items: center; gap: 0; padding: 4px 4px 0; flex-wrap: wrap; }
.grid-toolbar .btn > .icon { font-size: 18px; margin: 0 8px 0 -2px; }
.grid-search { display: inline-flex; align-items: center; width: 235px; max-width: 100%; padding-bottom: 4px; margin-right: 4px; position: relative; font-size: .875rem; }
.grid-search .icon { font-size: 20px; color: var(--action); margin-right: 8px; }
.grid-search input { flex: 1; border: 0; outline: 0; background: none; padding: 4px 0 5px; font-size: .875rem; line-height: 1.4375em; min-width: 0; }
.grid-search input::placeholder { color: currentColor; opacity: .42; }
.grid-search::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 4px; border-bottom: 1px solid var(--input-border);
}
.grid-search:focus-within::after { border-bottom: 2px solid var(--primary); }
.grid-search input::-webkit-search-cancel-button { cursor: pointer; }
.grid-scroll { overflow-x: auto; position: relative; }
.grid-table { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: 100%; font-size: .875rem; line-height: 1.43; }
.grid-table th {
  height: 39px; padding: 0 10px; text-align: left; font-weight: 700; border-bottom: 1px solid var(--grid-border);
  background: var(--primary-a06); position: relative; white-space: nowrap; user-select: none;
}
.grid-table th[data-sortable] { cursor: pointer; }
.grid-table th .th-inner { display: flex; align-items: center; gap: 2px; overflow: hidden; }
.grid-table th.align-right .th-inner { flex-direction: row-reverse; }
.th-title { overflow: hidden; text-overflow: ellipsis; }
.sort-icon {
  display: inline-flex; padding: 5px; border-radius: 50%; color: var(--action); opacity: 0; transition: opacity .15s, transform .2s;
}
.sort-icon .icon { font-size: 18px; }
.grid-table th[data-sortable]:hover .sort-icon { opacity: .5; }
.grid-table th.sorted .sort-icon { opacity: 1; }
.grid-table th.sorted-desc .sort-icon { transform: rotate(180deg); }
.col-sep { position: absolute; right: 0; top: 50%; height: 15px; margin-top: -7.5px; border-right: 1px solid var(--grid-border); }
.grid-table th:last-child .col-sep { display: none; }
.grid-table td { padding: 0 10px; border-top: 1px solid var(--grid-border); vertical-align: middle; }
.grid-table tbody tr:first-child td { border-top: 0; }
.grid-table td .cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; height: var(--row-h, 36px); }
.grid-table td.align-right .cell { justify-content: flex-end; }
.grid-table td .cell > span { overflow: hidden; text-overflow: ellipsis; }
.grid-table .align-right { text-align: right; }
.grid-table tbody tr:hover td { background: var(--primary-a05); }
.grid-table tbody tr.clickable { cursor: pointer; }
.grid-empty { display: flex; align-items: center; justify-content: center; height: 72px; font-size: .875rem; }
.grid-footer {
  display: flex; align-items: center; min-height: 52px; border-top: 1px solid var(--grid-border); padding: 0 8px 0 16px; gap: 0; font-size: .875rem;
}
.grid-pagesize { position: relative; display: inline-flex; align-items: center; margin: 0 32px 0 8px; }
.grid-pagesize select {
  appearance: none; -webkit-appearance: none; border: 0; background: none; font-size: .875rem; padding: 4px 24px 5px 8px; cursor: pointer; outline: 0; border-radius: 4px;
}
.grid-pagesize select option { background: var(--paper); }
.grid-pagesize .icon { position: absolute; right: 0; pointer-events: none; color: var(--action); }
.grid-count { margin-right: 20px; }
.grid-footer .icon-btn { padding: 8px; }
.grid-panel { min-width: 260px; padding: 8px 0; }
.grid-panel .menu-item { gap: 8px; }
.grid-panel-body { padding: 8px 16px; display: flex; gap: 8px; align-items: center; }
.data-grid.density-comfortable { --density: 1.3; }
@media (max-width: 599.95px) {
  .grid-toolbar .btn span { display: none; }
  .grid-toolbar .btn > .icon { margin: 0; }
  .grid-toolbar .btn { min-width: 0; padding: 4px 8px; }
  .grid-footer .body2:first-of-type { display: none; }
}

/* ------------------------------------------------------------------ lists (dashboard panels) */
.panel { height: 100%; display: flex; flex-direction: column; }
.panel > .card-content { flex: 1; display: flex; flex-direction: column; padding-bottom: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 8px; }
.panel-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.empty { flex: 1; display: grid; place-items: center; padding: 24px 0; color: var(--text-2); }
.list { list-style: none; margin: 0; padding: 0; }
.list-btn {
  display: flex; align-items: center; padding: 4px 8px; border-radius: 28px; cursor: pointer; transition: background-color .15s ease;
  min-width: 0; color: inherit;
}
.list-btn:hover { background: var(--action-hover); }
.list-text { flex: 1; min-width: 0; margin: 4px 0; }
.list-primary { font-size: .875rem; line-height: 1.43; }
.list-secondary { font-size: .875rem; line-height: 1.43; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count-badge {
  min-width: 28px; height: 22px; padding: 0 4px; border-radius: 21px; margin-right: 10px; display: grid; place-items: center;
  font-size: 12px; font-weight: 800;
}
.count-warn { background: var(--warning-a15); color: var(--warning); }
.count-ok { background: var(--success-a15); color: var(--success); }
.bar-track { height: 6px; border-radius: 3px; background: var(--action-hover); margin-top: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; }
.legend-sq { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.dot8 { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* charts */
.chart-box { flex: 1; min-height: 300px; position: relative; }
.chart-box svg { display: block; width: 100%; height: 100%; position: absolute; inset: 0; overflow: visible; }
.chart-axis text { font-size: 12px; fill: var(--text); font-family: var(--font); }
.chart-legend text { font-size: 16px; fill: var(--text); font-family: var(--font); }
.chart-axis line, .chart-axis path { stroke: var(--text); stroke-width: 1; shape-rendering: crispEdges; }
.chart-axis .tick-label { fill: var(--text); }
.chart-hover { fill: var(--action-hover); }
.chart-tip {
  position: fixed; z-index: 1500; pointer-events: none; background: var(--paper); color: var(--text); border-radius: 4px;
  box-shadow: 0 2px 1px -1px rgba(0,0,0,.2), 0 1px 1px 0 rgba(0,0,0,.14), 0 1px 3px 0 rgba(0,0,0,.12); font-size: .875rem; min-width: 140px;
  border: 1px solid var(--divider);
}
.chart-tip .tip-head { padding: 8px 16px; border-bottom: 1px solid var(--divider); color: var(--text-2); }
.chart-tip .tip-row { display: flex; align-items: center; gap: 8px; padding: 6px 16px; }
.chart-tip .tip-row b { margin-left: auto; padding-left: 16px; }
.chart-tip .tip-mark { width: 14px; height: 14px; border-radius: 2px; border: 2px solid var(--paper); box-shadow: 0 0 0 1px var(--divider); }
.donut { width: 168px; height: 168px; flex-shrink: 0; position: relative; }
.donut svg { width: 168px; height: 168px; display: block; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; text-align: center; }
.donut-wrap { display: flex; align-items: center; gap: 16px; flex: 1; }
.donut-legend { flex: 1; min-width: 0; width: 100%; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 599.95px) { .donut-wrap { flex-direction: column; } }

/* ------------------------------------------------------------------ sign-in */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--primary-a08); }
.login-card { width: 100%; max-width: 400px; animation: psFadeUp .35s ease; backdrop-filter: blur(8px); }
.login-card .card-content { padding: 32px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 24px; text-align: center; }
.login-logo { max-height: 72px; max-width: 200px; }
.login-mark { width: 52px; height: 52px; border-radius: 14px; background: var(--primary); color: var(--primary-contrast); display: grid; place-items: center; }

/* an empty select shows only its label inside the box (MUI), not the empty option's text */
.field-select:not(.shrink):not(:focus-within) select { color: transparent; }
.grid-table td .cell > .cell-v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; display: block; }
.grid-table td .cell > .cell-v:has(.thumb, .chip) { display: flex; align-items: center; }
/* MUI hides the sort button (zero width) until the header is hovered or sorted */
.sort-icon { width: 0; padding: 0; overflow: hidden; }
.grid-table th[data-sortable]:hover .sort-icon, .grid-table th.sorted .sort-icon { width: 28px; padding: 5px; }
/* the row border is part of the row height, as in DataGrid */
.grid-table td .cell { height: calc(var(--row-h, 36px) - 1px); }
.grid-table tbody tr:first-child td .cell { height: var(--row-h, 36px); }
.switch-label { min-height: 40px; }
dialog.dialog:focus { outline: none; }
/* Dialog grids: fields start 16px in and run 16px past the right edge (matches the original layout). */
.dialog-content > .stack > .grid { padding: 16px 0 0 16px; margin-right: -16px; }
/* KPI caption uses the parent 24px line height */
.stat-sub { line-height: 24px; }
/* ListItemText with a secondary line uses 6px margins (MUI "multiline") */
.list-text:has(.list-secondary) { margin: 6px 0; }
.top-search { min-width: 0; }

/* ------------------------------------------------------------------ device page (redesigned) */
.card-flat { border: 0; }
.link { color: var(--primary); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
.overline { font-size: .6875rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.device-hero { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; padding: 20px; align-items: stretch; }
.device-photo {
  position: relative; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, #ffffff 0%, #eef1f7 100%);
}
html[data-theme=dark] .device-photo { background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.08) 0%, rgba(255,255,255,.02) 100%); }
.device-photo img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.device-photo-icon .icon { font-size: 120px; opacity: .85; }
.device-summary { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 4px 0; }
.device-name { margin: 2px 0 0; font-size: 1.6rem; font-weight: 800; line-height: 1.25; letter-spacing: -0.015em; }
.device-price { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; color: var(--primary); line-height: 1.2; margin-top: 6px; }
.key-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: auto; padding-top: 18px; }
.key-fact { background: var(--bg); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.key-fact-label { font-size: .75rem; color: var(--text-2); font-weight: 600; }
.key-fact-value { font-size: 1rem; font-weight: 700; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter { height: 4px; border-radius: 2px; background: var(--action-selected); margin-top: 8px; overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 2px; background: var(--success); }
.meter span.mid { background: var(--warning); } .meter span.low { background: var(--error); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; font-size: .8125rem;
  font-weight: 700; white-space: nowrap; flex-shrink: 0; background: var(--chip-default); color: var(--text-2);
}
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-success { background: var(--success-a12); color: var(--success); }
.pill-info { background: var(--info-a12); color: var(--info); }
.pill-warning { background: var(--warning-a12); color: var(--warning); }
.pill-error { background: var(--error-a12); color: var(--error); }
.pill-primary { background: var(--primary-a08); color: var(--primary); }
.pill-secondary { background: var(--secondary-a12); color: var(--secondary); }

.fact-section { padding: 16px 0; border-top: 1px solid var(--divider); }
.fact-section:first-of-type { border-top: 0; padding-top: 0; }
.fact-section:last-child { padding-bottom: 0; }
.fact-section > .overline { margin-bottom: 12px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 20px; }
.fact { min-width: 0; }
.fact-label { font-size: .75rem; color: var(--text-2); }
.fact-value { font-size: .9375rem; font-weight: 600; word-break: break-word; margin-top: 2px; }
.line-item { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-top: 1px solid var(--divider); font-size: .875rem; }
.line-item:first-of-type { border-top: 0; padding-top: 0; }

.history-card { position: sticky; top: 88px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item { position: relative; padding: 0 0 20px 28px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: 6px; top: 18px; bottom: -2px; width: 2px; background: var(--divider); border-radius: 1px; }
.timeline-item:last-child::before { display: none; }
.timeline-dot { position: absolute; left: 0; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 3px solid var(--primary); }
.timeline-item:last-child .timeline-dot { background: var(--primary); }
.timeline-title { font-weight: 700; font-size: .9375rem; display: flex; justify-content: space-between; gap: 12px; }
.timeline-amount { font-weight: 700; white-space: nowrap; }
.timeline-details { color: var(--text-2); margin-top: 4px; }

@media (max-width: 1199.95px) { .history-card { position: static; } }
@media (max-width: 899.95px) {
  .device-hero { grid-template-columns: 220px minmax(0, 1fr); gap: 20px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .key-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 599.95px) {
  .device-hero { grid-template-columns: 1fr; padding: 16px; }
  .device-photo { max-width: 320px; width: 100%; margin: 0 auto; }
}
.key-fact-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------------ shared screen pieces */
.date-range { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding-top: 12px !important; padding-bottom: 12px !important; }
.dr-period { width: 160px; } .dr-date { width: 170px; }
.date-range > .field, .date-range > .dr-extra { width: auto; }
@media (max-width: 599.95px) { .date-range { flex-direction: column; align-items: stretch; } .dr-period, .dr-date { width: 100%; } }
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 899.95px) { .info-grid { grid-template-columns: 1fr 1fr; } }
.info-item { min-width: 0; word-break: break-word; }
.fw500 { font-weight: 500; }
.mui-link { color: var(--primary); text-decoration: underline; text-decoration-color: var(--primary-a50); text-underline-offset: 2px; }
.mui-link:hover { text-decoration-color: inherit; }
.table-simple { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table-simple th { text-align: left; font-weight: 700; color: var(--text); padding: 6px 16px; border-bottom: 1px solid var(--grid-border); white-space: nowrap; }
.table-simple td { padding: 6px 16px; border-bottom: 1px solid var(--grid-border); vertical-align: middle; }
.table-simple .num { text-align: right; white-space: nowrap; }
.table-simple tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--divider); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 10px 16px; min-height: 44px; font-weight: 700; font-size: .875rem; color: var(--text-2); border-bottom: 3px solid transparent; border-radius: 3px 3px 0 0; white-space: nowrap; background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.toggle-group { display: inline-flex; border: 1px solid var(--input-border); border-radius: 10px; overflow: hidden; }
.toggle-group > * { padding: 5px 12px; font-size: .875rem; font-weight: 700; border: 0; border-left: 1px solid var(--input-border); background: none; cursor: pointer; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.toggle-group > *:first-child { border-left: 0; }
.toggle-group > .on { background: var(--primary-a12); color: var(--primary); }
.toggle-group .icon { font-size: 20px; }

/* autocomplete */
.ac .ac-input { padding-right: 32px; }
.ac-pop { padding: 4px 0; max-height: 40vh; }
.ac-group { position: sticky; top: -4px; z-index: 1; background: var(--paper); padding: 0 16px; line-height: 36px; font-size: .875rem; font-weight: 500; color: var(--text-2); }
.ac-item { gap: 12px; white-space: normal; cursor: pointer; }
.ac-item > span:first-child { display: flex; }
.ac-text { min-width: 0; }
.ac-note { padding: 14px 16px; color: var(--text-2); font-size: 1rem; }
.grid-table input[type=number] { width: 72px; padding: 4px 8px; border: 1px solid var(--input-border); border-radius: 8px; background: var(--input-bg); text-align: right; font-size: .875rem; }
.grid-table input[type=number]:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.grid-table input[type=checkbox], .table-simple input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.chip-click { cursor: pointer; background: none; font-family: inherit; }
.chip-click:hover { background: var(--action-hover); }
.c-warning-text { color: var(--warning) !important; }
.fill-h { height: 100%; }
.stack > .card + .card { margin-top: 0; }
/* stepper (MUI Stepper, alternative labels) */
.stepper { display: flex; overflow-x: auto; padding-bottom: 8px; }
.step { flex: 1; min-width: 96px; display: flex; flex-direction: column; align-items: center; position: relative; text-align: center; }
.step + .step::before { content: ""; position: absolute; top: 12px; left: calc(-50% + 20px); right: calc(50% + 20px); border-top: 1px solid var(--chip-outline); }
.step-icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--text-3); color: #fff; font-size: .75rem; position: relative; z-index: 1; }
.step-icon .icon { font-size: 24px; color: var(--primary); background: var(--paper); border-radius: 50%; }
.step.done .step-icon { background: none; }
.step.active .step-icon { background: var(--primary); color: var(--primary-contrast); }
.step-label { margin-top: 16px; font-size: .875rem; color: var(--text-2); }
.step.done .step-label, .step.active .step-label { color: var(--text); font-weight: 500; }
.po-input { width: 100%; height: 40px; padding: 8.5px 14px; border: 1px solid var(--input-border); border-radius: 10px; background: var(--input-bg); font-size: 1rem; }
.po-input:hover { border-color: var(--input-border-hover); }
.po-input:focus { outline: 2px solid var(--primary); outline-offset: -2px; border-color: transparent; }
.po-table td { padding: 8px 16px; }
.receive-line { padding: 16px; border: 1px solid var(--divider); border-radius: 28px; }
.logo-box { width: 140px; height: 140px; border-radius: 42px; border: 1px solid var(--divider); display: grid; place-items: center; background: #fff; overflow: hidden; }
.logo-box img { max-width: 90%; max-height: 90%; }
.field-color input[type=color] { height: 40px; padding: 6px 14px; cursor: pointer; }
label.btn.disabled { opacity: .5; pointer-events: none; }
.pnl-row { padding: 4.8px 0; }
.pnl-indent { padding-left: 16px; }
.pnl-indent > span:first-child { color: var(--text-2); }
.pnl-total { border-top: 1px solid var(--divider); }
/* price lists */
.field.multi { min-height: 40px; cursor: pointer; }
.multi-box { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 36px 6px 9px; min-height: 40px; align-items: center; position: relative; z-index: 1; }
.multi-chip { height: 26px; gap: 4px; padding: 0 4px 0 10px; }
.multi-chip button { border: 0; background: rgba(0,0,0,.26); color: #fff; width: 16px; height: 16px; border-radius: 50%; font-size: 13px; line-height: 16px; padding: 0; cursor: pointer; }
.multi-ph { color: var(--text-2); opacity: .7; padding-left: 5px; }
.field.multi.open fieldset { border: 2px solid var(--primary); }
.field.multi.open label { color: var(--primary); }
.multi-pop { padding: 0 0 4px; }
.multi-search { width: 100%; border: 0; border-bottom: 1px solid var(--divider); padding: 10px 16px; background: none; outline: 0; font-size: .875rem; }
.pl-table td { padding: 4px 8px; }
.pl-edit { width: 100%; border: 1px solid transparent; background: none; border-radius: 8px; padding: 6px 8px; font-size: .875rem; }
.pl-edit:hover { border-color: var(--input-border); }
.pl-edit:focus { outline: 2px solid var(--primary); outline-offset: -1px; background: var(--input-bg); }
.pl-preview-wrap { position: sticky; top: 80px; }
.pl-pages { display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 190px); overflow-y: auto; padding-right: 4px; }
.pl-page { position: relative; }
.pl-page img { width: 100%; display: block; border-radius: 28px; box-shadow: 0 3px 3px -2px rgba(0,0,0,.2), 0 3px 4px 0 rgba(0,0,0,.14), 0 1px 8px 0 rgba(0,0,0,.12); }
.pl-page-dl { position: absolute; right: 8px; bottom: 8px; }
@media (max-width: 1199.95px) { .pl-preview-wrap { position: static; } .pl-pages { max-height: none; } }

/* full set of column spans per breakpoint */
.xs-1 { grid-column: span 1 !important; } .xs-2 { grid-column: span 2 !important; } .xs-3 { grid-column: span 3 !important; } .xs-4 { grid-column: span 4 !important; } .xs-5 { grid-column: span 5 !important; } .xs-6 { grid-column: span 6 !important; } .xs-7 { grid-column: span 7 !important; } .xs-8 { grid-column: span 8 !important; } .xs-9 { grid-column: span 9 !important; } .xs-10 { grid-column: span 10 !important; } .xs-11 { grid-column: span 11 !important; } .xs-12 { grid-column: span 12 !important; } 
@media (min-width: 600px) { .sm-1 { grid-column: span 1 !important; } .sm-2 { grid-column: span 2 !important; } .sm-3 { grid-column: span 3 !important; } .sm-4 { grid-column: span 4 !important; } .sm-5 { grid-column: span 5 !important; } .sm-6 { grid-column: span 6 !important; } .sm-7 { grid-column: span 7 !important; } .sm-8 { grid-column: span 8 !important; } .sm-9 { grid-column: span 9 !important; } .sm-10 { grid-column: span 10 !important; } .sm-11 { grid-column: span 11 !important; } .sm-12 { grid-column: span 12 !important; } }
@media (min-width: 900px) { .md-1 { grid-column: span 1 !important; } .md-2 { grid-column: span 2 !important; } .md-3 { grid-column: span 3 !important; } .md-4 { grid-column: span 4 !important; } .md-5 { grid-column: span 5 !important; } .md-6 { grid-column: span 6 !important; } .md-7 { grid-column: span 7 !important; } .md-8 { grid-column: span 8 !important; } .md-9 { grid-column: span 9 !important; } .md-10 { grid-column: span 10 !important; } .md-11 { grid-column: span 11 !important; } .md-12 { grid-column: span 12 !important; } }
@media (min-width: 1200px) { .lg-1 { grid-column: span 1 !important; } .lg-2 { grid-column: span 2 !important; } .lg-3 { grid-column: span 3 !important; } .lg-4 { grid-column: span 4 !important; } .lg-5 { grid-column: span 5 !important; } .lg-6 { grid-column: span 6 !important; } .lg-7 { grid-column: span 7 !important; } .lg-8 { grid-column: span 8 !important; } .lg-9 { grid-column: span 9 !important; } .lg-10 { grid-column: span 10 !important; } .lg-11 { grid-column: span 11 !important; } .lg-12 { grid-column: span 12 !important; } }
@media (min-width: 1536px) { .xl-1 { grid-column: span 1 !important; } .xl-2 { grid-column: span 2 !important; } .xl-3 { grid-column: span 3 !important; } .xl-4 { grid-column: span 4 !important; } .xl-5 { grid-column: span 5 !important; } .xl-6 { grid-column: span 6 !important; } .xl-7 { grid-column: span 7 !important; } .xl-8 { grid-column: span 8 !important; } .xl-9 { grid-column: span 9 !important; } .xl-10 { grid-column: span 10 !important; } .xl-11 { grid-column: span 11 !important; } .xl-12 { grid-column: span 12 !important; } }
/* SMS */
.sms-bubble { background: var(--primary-a12); border-radius: 14px 14px 14px 4px; padding: 8px 12px; margin-top: 2px; white-space: pre-wrap; font-size: 14px; }
.sms-samples { max-height: 520px; overflow-y: auto; padding-right: 4px; }
.sticky-lg { position: sticky; top: 80px; }
@media (max-width: 1199.95px) { .sticky-lg { position: static; } }
.auto-row { display: flex; align-items: center; gap: 16px; padding: 10px 0; border-top: 1px solid var(--divider); }
.auto-row:first-child { border-top: 0; }
.auto-switch { width: 260px; flex-shrink: 0; }
.fw700-label .switch-text { font-weight: 700; }
.tpl-card { height: 100%; box-shadow: none; border-color: var(--divider); }
@media (max-width: 899.95px) { .auto-row { flex-direction: column; align-items: flex-start; gap: 4px; } }
/* POS */
.pos-search { display: flex; align-items: center; gap: 12px; border: 1px solid var(--input-border); border-radius: 10px; padding: 0 14px; background: var(--input-bg); }
.pos-search:hover { border-color: var(--input-border-hover); }
.pos-search:focus-within { border: 2px solid var(--primary); padding: 0 13px; }
.pos-search .icon { color: var(--action); }
.pos-search input { flex: 1; border: 0; outline: 0; background: none; font-size: 17px; padding: 12.5px 0; min-width: 0; }
.pos-results { max-height: 340px; overflow-y: auto; margin-top: 8px; }
.pos-results:empty { display: none; }
.pos-hit { width: 100%; border: 0; background: none; text-align: left; gap: 12px; font: inherit; color: inherit; }
.pos-hit:disabled { opacity: .45; cursor: default; }
.pos-noresult { margin-top: 8px; }
.quick-head { display: block; margin: 12px 0 8px; letter-spacing: .5px; }
.quick-cats { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.quick-cats .chip { height: 32px; padding: 0 12px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 899.95px) { .quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 599.95px) { .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.quick-tile { display: flex; gap: 8px; padding: 8px; border-radius: 28px; border: 1px solid var(--divider); background: none; text-align: left; cursor: pointer; align-items: center; color: inherit; font: inherit; transition: all .15s; }
.quick-tile:hover { background: var(--primary-a06); border-color: var(--primary); }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; }
.cart-line { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--divider); }
.cart-line:first-child { border-top: 0; }
.cart-controls { gap: 8px; justify-content: flex-end; flex-shrink: 0; }
.qty-box { display: inline-flex; align-items: center; border: 1px solid var(--divider); border-radius: 28px; }
.qty-box .icon-btn { padding: 5px; } .qty-box .icon { font-size: 20px; } .qty-box b { min-width: 24px; text-align: center; }
.cart-price { width: 130px; }
.cart-total { min-width: 100px; text-align: right; }
@media (max-width: 599.95px) { .cart-line { flex-direction: column; align-items: stretch; } }
.pos-check { width: 18px; height: 18px; accent-color: var(--primary); }
.cash-box { padding: 12px; border-radius: 28px; background: var(--success-a08); margin-top: 8px; }
.pos-complete { padding-top: 11px; padding-bottom: 11px; font-size: 17px; }
.pos-held-menu { min-width: 280px; left: 0; right: auto; }

/* ------------------------------------------------------------------ collapsible sidebar (desktop icon rail) */
:root { --rail: 76px; }
html[data-theme=dark] .sidebar { border-right: 1px solid var(--divider); }
@media (min-width: 900px) {
  .sidebar { transition: width .22s cubic-bezier(.4, 0, .2, 1); overflow: hidden; }
  .appbar { transition: left .22s cubic-bezier(.4, 0, .2, 1); }
  .main { transition: margin-left .22s cubic-bezier(.4, 0, .2, 1); }
  html.sb-collapsed .sidebar { width: var(--rail); }
  html.sb-collapsed .appbar { left: var(--rail); }
  html.sb-collapsed .main { margin-left: var(--rail); }
  html.sb-collapsed .brand { padding: 8px 17px; }
  html.sb-collapsed .brand-text,
  html.sb-collapsed .nav-text { display: none; }
  html.sb-collapsed .nav-sub { font-size: 0; line-height: 0; height: 1px; margin: 10px 18px; background: rgba(255, 255, 255, .12); padding: 0; }
  html.sb-collapsed .nav-list:has(.nav-sub) { padding-top: 0; }
  html.sb-collapsed .nav-item { margin: 0 12px 4px; padding: 8px 0; justify-content: center; }
  html.sb-collapsed .nav-icon { min-width: 0; }
  html.sb-collapsed .sidebar-nav { overflow-x: hidden; }
}
/* the brand logo never squashes; long names stay inside the sidebar */
.brand-text, .nav-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-name { white-space: normal; }
/* page headers: actions wrap under the title on narrower screens instead of running off the edge */
@media (max-width: 1199.95px) {
  .page-header { flex-wrap: wrap; }
  .page-actions { justify-content: flex-start; }
}
.page-actions .toggle-group { flex-shrink: 0; }

/* Website admin */
.site-card { height: 100%; display: flex; flex-direction: column; }
.site-card.off { opacity: .6; }
.site-card-img { aspect-ratio: 2 / 1; background: #f5f5f7; display: grid; place-items: center; overflow: hidden; text-align: center; color: #86868b; font-size: .8125rem; }
.site-card-img.theme-dark { background: #000; color: #a1a1a6; }
.site-card-img img { width: 100%; height: 100%; object-fit: cover; }
.site-card-img .icon { font-size: 32px; }
.sec-preview { aspect-ratio: 2.4 / 1; border-radius: 14px; background: var(--action-hover); display: grid; place-items: center; overflow: hidden; }
.sec-preview img { width: 100%; height: 100%; object-fit: cover; }
.lineup-prev { aspect-ratio: 3 / 4; border-radius: 14px; background: #f5f5f7; display: grid; place-items: center; overflow: hidden; text-align: center; color: #86868b; font-size: .8125rem; }
.lineup-prev img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.lineup-prev .icon { font-size: 32px; }

/* ================================================================== sign-in page: enterprise style, photo (or brand colour) beside the form */
.auth { --auth-font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(420px, 1fr); background: var(--paper); font-family: var(--auth-font); }
.auth-art { position: relative; overflow: hidden; color: #fff; background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%);
  background-size: cover; background-position: center; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 12, 24, .1), rgba(8, 12, 24, .35)); }
.auth.has-photo .auth-art::before { background: linear-gradient(180deg, rgba(8, 12, 24, .35) 0%, rgba(8, 12, 24, .2) 40%, rgba(8, 12, 24, .78) 100%); }
.auth-art-in { position: relative; z-index: 1; margin-top: auto; padding: 48px 56px; display: grid; gap: 14px; max-width: 640px; }
.auth-brand { display: flex; align-items: center; gap: 14px; }
.auth-logo { width: 48px; height: 48px; border-radius: 8px; object-fit: contain; flex-shrink: 0; background: #fff; }
.auth-mark { display: grid; place-items: center; background: rgba(255, 255, 255, .14); color: #fff; font-size: 24px; }
.auth-name { font-size: 22px; font-weight: 600; letter-spacing: -.005em; line-height: 1.2; }
.auth-tag { font-size: 14px; opacity: .8; margin-top: 2px; }
.auth-meta { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; opacity: .7; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .22); }
.auth-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 32px 24px; border-left: 1px solid var(--divider); }
.auth-card { width: 100%; max-width: 360px; margin: auto 0; }
.auth-head { margin-bottom: 28px; }
.auth-head .auth-logo.sm { display: none; }
.auth-head h1 { margin: 0; font-family: var(--auth-font); font-size: 24px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; color: var(--text); }
.auth-head p { margin: 6px 0 0; color: var(--text-2); font-size: 14px; }
.auth .field, .auth .field input, .auth .btn, .auth .alert { border-radius: 4px; }
.auth .btn { font-weight: 600; letter-spacing: .01em; text-transform: none; box-shadow: none; }
.auth-foot { margin: 20px 0 0; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.auth-legal { font-size: 12px; color: var(--text-3); padding-top: 24px; }
@media (max-width: 899px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-art { min-height: 200px; }
  .auth-art-in { padding: 24px 20px; }
  .auth-meta { display: none; }
  .auth-logo { width: 40px; height: 40px; }
  .auth-name { font-size: 19px; }
  .auth-panel { border-left: 0; padding: 28px 20px 20px; justify-content: flex-start; }
  .auth-card { margin: 0; }
}
.login-bg-box { aspect-ratio: 3 / 2; border-radius: 14px; border: 1px solid var(--divider); background: var(--action-hover); display: grid; place-items: center; overflow: hidden; }
.login-bg-box img { width: 100%; height: 100%; object-fit: cover; }

/* ================================================================== users & permissions */
.perm-scroll { overflow-x: auto; margin: -4px; padding: 4px; }
.perm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.perm-table th, .perm-table td { padding: 10px 12px; border-bottom: 1px solid var(--divider); text-align: left; vertical-align: middle; }
.perm-table thead th { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); background: var(--action-hover); position: sticky; top: 0; z-index: 1; }
.perm-table .c { text-align: center; }
.perm-table tr.perm-group th { background: transparent; padding-top: 20px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); border-bottom: 1px solid var(--divider); }
.perm-table tbody tr:not(.perm-group):hover td { background: var(--action-hover); }
.perm-label { font-weight: 600; color: var(--text); }
.perm-help { font-size: 12.5px; color: var(--text-2); margin-top: 2px; max-width: 60ch; }
.perm-grid td:first-child { min-width: 280px; }
.perm-role { min-width: 110px; vertical-align: bottom !important; text-transform: none !important; letter-spacing: 0 !important; }
.perm-role-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.perm-role-count { font-size: 12px; font-weight: 400; color: var(--text-2); }
.perm-role-tools { font-size: 12px; font-weight: 400; margin-top: 4px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--error); }
.perm-check { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.perm-check:disabled { cursor: not-allowed; opacity: .55; }
.perm-select { font: inherit; font-size: 13.5px; padding: 5px 8px; border: 1px solid var(--input-border); border-radius: 4px; background: var(--input-bg); color: var(--text); min-width: 110px; }
.perm-select.mode-allow { border-color: var(--success); color: var(--success); font-weight: 600; }
.perm-select.mode-deny { border-color: var(--error); color: var(--error); font-weight: 600; }
.perm-yes { color: var(--success); font-weight: 600; font-size: 13px; }
.perm-no { color: var(--text-3); font-size: 13px; }
.perm-actions { display: flex; justify-content: flex-end; padding-top: 16px; position: sticky; bottom: 0; background: var(--paper); }

/* ================================================================== till: device picker (category → brand → model → unit) */
.pick-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--divider); margin: 14px 0 12px; }
.pick-tabs button { font: inherit; font-size: 14px; font-weight: 600; padding: 9px 16px; border: 0; background: none; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pick-tabs button.on { color: var(--text); border-bottom-color: var(--primary); }
.pick-row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.pick-label { flex: 0 0 72px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); padding-top: 7px; }
.pick-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.pick-chip { font: inherit; font-size: 13.5px; padding: 5px 11px; border: 1px solid var(--input-border); border-radius: 4px; background: var(--paper); color: var(--text); cursor: pointer; }
.pick-chip span { color: var(--text-2); font-size: 12px; margin-left: 2px; }
.pick-chip:hover { background: var(--action-hover); }
.pick-chip.on { background: var(--primary); border-color: var(--primary); color: var(--primary-contrast); }
.pick-chip.on span { color: inherit; opacity: .8; }
.pick-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 4px; }
.pick-model { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--divider); border-radius: 4px; background: var(--paper); text-align: left; cursor: pointer; font: inherit; color: inherit; min-width: 0; }
.pick-model:hover { background: var(--action-hover); border-color: var(--input-border); }
.pick-model .thumb { border-radius: 4px !important; flex-shrink: 0; }
.pick-model-text { min-width: 0; }
.pick-model-name { font-size: 14px; font-weight: 600; line-height: 1.3; }
.pick-model-sub { font-size: 12.5px; color: var(--text-2); margin-top: 1px; }
.pick-units { margin-top: 4px; border: 1px solid var(--divider); border-radius: 4px; }
.pick-units-head { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-bottom: 1px solid var(--divider); background: var(--action-hover); }
.pick-back { font: inherit; font-size: 13px; font-weight: 600; border: 1px solid var(--input-border); border-radius: 4px; background: var(--paper); padding: 5px 10px; cursor: pointer; color: var(--text); white-space: nowrap; }
.pick-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pick-table th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); padding: 8px 12px; border-bottom: 1px solid var(--divider); }
.pick-table td { padding: 9px 12px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
.pick-table tr:last-child td { border-bottom: 0; }
.pick-table .r { text-align: right; }
.pick-table .mono { font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; font-size: 13px; }
.pick-table tr.taken td { color: var(--text-3); }
.pick-sub { font-size: 11.5px; color: var(--text-2); }
.pick-add { font: inherit; font-size: 13px; font-weight: 600; padding: 5px 14px; border: 0; border-radius: 4px; background: var(--primary); color: var(--primary-contrast); cursor: pointer; }
.pick-add:disabled { background: var(--action-selected); color: var(--text-3); cursor: default; }
.pick-empty { padding: 18px 0; color: var(--text-2); font-size: 14px; text-align: center; }
@media (max-width: 599.95px) {
  .pick-row { flex-direction: column; gap: 6px; }
  .pick-label { padding-top: 0; }
  .pick-table th:nth-child(3), .pick-table td:nth-child(3), .pick-table th:nth-child(4), .pick-table td:nth-child(4) { display: none; }
}

/* ==================================================================================================================
 * ENTERPRISE THEME (applies system-wide, overrides the rounded Material look above)
 * Neutral surfaces, system fonts, 4–6 px corners, hairline neutral borders, no coloured card borders or tinted tiles,
 * no hover lifts, monochrome navigation icons, neutral greys (not navy / violet) in dark mode.
 * ================================================================================================================== */
:root {
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --bg: #f4f5f7;
  --divider: #e3e5e8;
  --card-border: #e3e5e8;
  --grid-border: #e3e5e8;
  --shadow: none;
  --shadow-hover: none;
  --shadow-menu: 0 4px 16px rgba(0, 0, 0, .12), 0 0 0 1px rgba(0, 0, 0, .06);
  --shadow-dialog: 0 12px 40px rgba(0, 0, 0, .18), 0 0 0 1px rgba(0, 0, 0, .06);
  --radius: 4px;
  --radius-card: 6px;
  --appbar: #ffffff;
  --chip-outline: #c9ccd1;
}
html[data-theme=dark] {
  --bg: #111214;
  --paper: #1a1b1e;
  --divider: #2b2d31;
  --card-border: #2b2d31;
  --grid-border: #2b2d31;
  --input-bg: #141517;
  --input-border: #3a3d42;
  --appbar: #1a1b1e;
  --sidebar: #0c0d0f;
  --chip-outline: #4a4d52;
  --shadow-menu: 0 4px 16px rgba(0, 0, 0, .5), 0 0 0 1px #2b2d31;
  --shadow-dialog: 0 12px 40px rgba(0, 0, 0, .6), 0 0 0 1px #2b2d31;
}
body { font-family: var(--font); -webkit-font-smoothing: antialiased; }

/* type: regular weights, no heavy display faces */
.h4 { font-size: 1.5rem; font-weight: 600; letter-spacing: -.01em; }
.h5 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.005em; }
.h6 { font-size: 1rem; font-weight: 600; }
.subtitle2 { font-weight: 600; }
.fw800 { font-weight: 700; }
.brand-name { font-weight: 600; }
.nav-text, .nav-item.active .nav-text { font-weight: 500; }
.nav-item.active .nav-text { font-weight: 600; }
.tab, .toggle-group > * { font-weight: 600; }
.stat-value { font-weight: 600 !important; }

/* surfaces: flat cards with a neutral hairline */
.card { border-radius: 6px; border: 1px solid var(--card-border); box-shadow: none; }
.card:hover { box-shadow: none; }
.stat-card:hover { transform: none; box-shadow: none; }
.stat-card::after, .stat-filled::after { display: none; }
.stat-filled, .stat-tinted { background: var(--paper); color: var(--text); }
.stat-filled .stat-label, .stat-filled .stat-sub { color: var(--text-2); opacity: 1; }
.stat-icon, .stat-filled .stat-icon { background: var(--action-hover); color: var(--text-2); box-shadow: none; border-radius: 4px; padding: 7px; }
.stat-label { font-weight: 500; font-size: .8125rem; text-transform: none; }
.dialog, .dialog-paper, dialog { border-radius: 6px !important; }
.menu { border-radius: 4px !important; }

/* controls */
.btn { border-radius: 4px; font-weight: 600; letter-spacing: 0; box-shadow: none !important; }
.btn-outlined { border-width: 1px; border-color: var(--input-border); }
.btn-outlined.btn-c-primary { border-color: var(--input-border); color: var(--text); }
.btn-outlined.btn-c-primary:hover { border-color: var(--text-2); background: var(--action-hover); }
.field, .field input, .field select, .field textarea, .field-wrap .field { border-radius: 4px !important; }
.top-search { border-radius: 4px !important; background: var(--action-hover); }
.toggle-group { border-radius: 4px !important; }
.chip, .chip-medium { border-radius: 3px; font-weight: 600; }
.alert { border-radius: 4px; border-left: 0 !important; }
.thumb, .thumb-photo { border-radius: 4px !important; }
.quick-tile { border-radius: 4px; }
.quick-tile:hover { background: var(--action-hover); border-color: var(--input-border); }
.logo-box { border-radius: 6px; }
.list-btn { border-radius: 4px; }
.cart-line { border-radius: 4px; }
.sec-preview, .site-card-img, .lineup-prev, .login-bg-box { border-radius: 4px; }

/* navigation: square highlight, single-colour icons */
.nav-item { border-radius: 4px; margin: 0 8px 2px; }
.nav-icon { color: inherit !important; opacity: .75; }
.nav-item.active .nav-icon, .nav-item:hover .nav-icon { opacity: 1; }
.nav-item:hover .nav-icon .icon { transform: none; }
.nav-item.active { background: rgba(255, 255, 255, .12); box-shadow: inset 3px 0 0 #fff; }
.nav-sub { font-weight: 600; letter-spacing: .08em; }
.brand-logo { border-radius: 6px; }
.appbar { backdrop-filter: none; -webkit-backdrop-filter: none; }
.avatar-user { background: var(--primary); color: var(--primary-contrast); font-weight: 600; }

/* tables */
.dt, .data-table { border-radius: 6px !important; }
dialog.dialog { border-radius: 6px; }
.popover { border-radius: 4px; }
.list-btn { border-radius: 4px; }
.count-badge { border-radius: 3px; }
.device-photo { border-radius: 6px; }
.key-fact { border-radius: 4px; }
.pill { border-radius: 3px; }
.po-input { border-radius: 4px; }
.receive-line { border-radius: 6px; }
.sms-bubble { border-radius: 6px; }
.pos-search { border-radius: 4px; }
.qty-box { border-radius: 4px; }
.cash-box { border-radius: 4px; }
.icon-btn { border-radius: 4px; }
.switch::before { border-radius: 10px; } /* toggle switches keep their pill shape */

/* ==================================================================================================================
 * COMPACT DENSITY (system-wide): ~13–14 px text, slimmer shell and controls, so more fits on screen.
 * ================================================================================================================== */
html { font-size: 14px; }
body { font-size: 13.5px; line-height: 1.5; }
:root { --drawer: 228px; }

/* sidebar */
.brand { min-height: 54px; padding: 8px 16px; gap: 10px; }
.brand-logo { width: 32px; height: 32px; border-radius: 6px; }
.brand-name { font-size: 14px; line-height: 1.25; }
.brand-tag { font-size: 11.5px; }
.sidebar-nav { padding: 6px 0; }
.nav-list { padding: 4px 0; }
.nav-sub { padding: 0 20px; line-height: 26px; font-size: 10.5px; margin-top: 6px; }
.nav-item { padding: 6px 12px; margin: 0 8px 1px; }
.nav-icon { min-width: 28px; }
.nav-icon .icon { font-size: 18px; }
.nav-text { font-size: 13px; line-height: 18px; margin: 2px 0; }

/* top bar and page */
.toolbar { min-height: 52px; padding: 0 24px; }
.main { margin-top: 52px; padding: 22px 28px; }
.top-search { max-width: 420px; padding: 2px 10px; }
.top-search input { font-size: 13px; }
.avatar-user { width: 30px; height: 30px; font-size: 13px; }
.page-header { margin-bottom: 18px; }
.page-header .h4 { font-size: 20px; }
.page-sub { font-size: 13px; margin-top: 2px; }

/* cards and stat tiles */
.card-content { padding: 14px 16px; }
.card-content:last-child { padding-bottom: 16px; }
.grid { gap: 14px; }
.stack { gap: 14px; }
.stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font-size: 22px !important; line-height: 1.25; margin-top: 6px; }
.stat-sub, .stat-card .caption { font-size: 12px; }
.stat-icon, .stat-filled .stat-icon { padding: 6px; }
.stat-icon .icon { font-size: 18px; }
.h6 { font-size: 14.5px; }

/* controls */
.btn { font-size: 13px; padding: 6px 14px; }
.btn-small { font-size: 12.5px; padding: 3px 10px; }
.btn-large { font-size: 14px; padding: 8px 18px; }
.btn-outlined { padding: 5px 13px; }
.field input, .field select { height: 36px; padding: 7px 12px; font-size: 13.5px; }
.field textarea { padding: 7px 12px; font-size: 13.5px; }
.field label { font-size: 13.5px; transform: translate(12px, 8px) scale(1); }
.field.shrink label, .field:focus-within label { transform: translate(12px, -8px) scale(.8); }
.field-color input[type=color], .po-input { height: 36px; }
.multi-box, .field.multi { min-height: 36px; }
.switch-label { min-height: 36px; font-size: 13.5px; }
.tab { min-height: 40px; padding: 8px 14px; font-size: 13px; }
.chip { font-size: 12px; height: 22px; }
.chip-medium { height: 28px; font-size: 12.5px; }
.alert { font-size: 13px; padding: 8px 12px; }

/* data tables */
.grid-toolbar { font-size: 13px; }
.grid-table { font-size: 13px; }
.grid-table th { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); height: 36px; }
.chart-legend text { font-size: 13px; }

/* till */
.pos-search input { font-size: 15px; }
@media (max-width: 899.95px) {
  .main { padding: 16px 14px; }
  .toolbar { padding: 0 14px; }
}

/* ==================================================================================================================
 * KPI TILES: tinted icon + coloured uppercase label, large value, notes, sparkline, faint watermark icon
 * ================================================================================================================== */
.stat-card { position: relative; overflow: hidden; height: 100%; color: var(--text);
  background: linear-gradient(140deg, var(--paper) 45%, color-mix(in srgb, var(--sc) 7%, var(--paper)) 100%) !important;
  border: 1px solid color-mix(in srgb, var(--sc) 16%, var(--divider)) !important; }
.stat-card.clickable:hover { border-color: color-mix(in srgb, var(--sc) 40%, var(--divider)) !important; }
.stat-card .card-content { position: relative; z-index: 1; padding: 14px 16px 12px; display: flex; flex-direction: column; height: 100%; }
.stat-head { display: flex; align-items: center; gap: 10px; }
.stat-card .stat-icon { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border-radius: 6px; flex-shrink: 0;
  background: color-mix(in srgb, var(--sc) 12%, var(--paper)); color: var(--sc); box-shadow: none; }
.stat-card .stat-icon .icon { font-size: 16px; }
.stat-card .stat-label { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--sc); }
.stat-card .stat-value { font-family: "Cascadia Mono", Consolas, ui-monospace, monospace; font-size: 24px !important; font-weight: 600 !important;
  letter-spacing: -.02em; line-height: 1.2; margin: 12px 0 6px; color: var(--text); word-break: break-word; }
.stat-sub { font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.stat-note { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.stat-mark { position: absolute; right: -10px; bottom: -14px; z-index: 0; color: var(--sc); opacity: .07; pointer-events: none; }
.stat-mark .icon { font-size: 92px; }
.spark { display: block; width: 100%; height: 30px; margin-top: auto; padding-top: 8px; overflow: visible; position: relative; z-index: 1; }
.spark-line { fill: none; stroke: var(--sc); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.spark-area { fill: color-mix(in srgb, var(--sc) 12%, transparent); }
/* tile hues: business colours, no purple */
.stat-c-primary { --sc: #2563eb; } .stat-c-info { --sc: #0284c7; } .stat-c-success { --sc: #15803d; }
.stat-c-secondary { --sc: #c2410c; } .stat-c-warning { --sc: #b45309; } .stat-c-error { --sc: #dc2626; } .stat-c-teal { --sc: #0f766e; }
html[data-theme=dark] .stat-c-primary { --sc: #60a5fa; } html[data-theme=dark] .stat-c-info { --sc: #38bdf8; } html[data-theme=dark] .stat-c-success { --sc: #4ade80; }
html[data-theme=dark] .stat-c-secondary { --sc: #fb923c; } html[data-theme=dark] .stat-c-warning { --sc: #fbbf24; } html[data-theme=dark] .stat-c-error { --sc: #f87171; }
html[data-theme=dark] .stat-c-teal { --sc: #2dd4bf; }
html[data-theme=dark] .stat-mark { opacity: .09; }

/* compact charts */
.chart-box { min-height: 220px; }
.chart-legend text { font-size: 12px; }
.chart-axis text { font-size: 11px; }
.donut, .donut svg { width: 132px; height: 132px; }
.donut-legend { font-size: 12.5px; gap: 4px; }

/* ==================================================================================================================
 * SHELL: modern sidebar and top bar. The top bar has a fixed height and the page starts exactly below it.
 * ================================================================================================================== */
:root { --topbar: 56px; --sidebar-bg: #0f1623; --sb-text: rgba(255, 255, 255, .7); --sb-accent: #60a5fa; }
html[data-theme=dark] { --sidebar-bg: #0c0d0f; }
.sidebar { background: var(--sidebar-bg); border-right: 1px solid rgba(255, 255, 255, .04); }
.sidebar-inner { display: flex; flex-direction: column; height: 100%; }
.brand { min-height: var(--topbar); height: var(--topbar); padding: 0 16px; gap: 10px; border-bottom: 1px solid rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.brand-logo { width: 32px; height: 32px; border-radius: 8px; }
.brand-name { font-size: 13.5px; font-weight: 600; -webkit-line-clamp: 1; }
.brand-tag { font-size: 11px; opacity: .55; margin-top: 1px; }
.sidebar-divider { display: none; }
.sidebar-nav { padding: 10px 0 8px; }
.nav-sub { color: rgba(255, 255, 255, .38); font-size: 10.5px; letter-spacing: .09em; padding: 0 20px; margin-top: 10px; line-height: 24px; }
.nav-item { color: var(--sb-text); padding: 6px 12px; margin: 0 10px 1px; border-radius: 6px; }
.nav-item:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, .08); color: #fff; box-shadow: inset 3px 0 0 var(--sb-accent); }
.nav-icon .icon { font-size: 17px; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid rgba(255, 255, 255, .07); color: #fff; }
.sb-avatar { width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .1); font-size: 12.5px; font-weight: 600; display: grid; place-items: center; flex-shrink: 0; }
.sb-user { min-width: 0; line-height: 1.3; }
.sb-label { font-size: 10.5px; opacity: .45; }
.sb-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-role { font-size: 11px; opacity: .55; }
html.sb-collapsed .sb-user { display: none; }
html.sb-collapsed .sidebar-foot { justify-content: center; padding: 12px 0; }

.appbar { height: var(--topbar); background: var(--paper); border-bottom: 1px solid var(--divider); }
.toolbar { height: var(--topbar); min-height: 0 !important; gap: 10px; padding: 0 24px; }
.main { margin-top: var(--topbar) !important; }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; white-space: nowrap; }
.crumb-group { color: var(--text-2); }
.crumb-sep { color: var(--text-3); }
.crumb-page { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.top-search { flex: 0 1 320px; height: 34px; max-width: 320px; padding: 0 10px; border: 1px solid transparent; background: var(--action-hover) !important; border-radius: 6px !important; }
.top-search:focus-within { border-color: var(--input-border); background: var(--paper) !important; }
.top-search input { font-size: 13px; }
.top-search .top-search-icon { font-size: 17px; color: var(--text-2); }
.icon-btn.top-icon { width: 34px; height: 34px; border-radius: 6px; color: var(--text-2); }
.icon-btn.top-icon:hover { background: var(--action-hover); color: var(--text); }
.top-sep { width: 1px; height: 24px; background: var(--divider); }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px; border: 0; background: none; border-radius: 6px; cursor: pointer; font: inherit; color: var(--text); text-align: left; }
.user-chip:hover { background: var(--action-hover); }
.user-chip .avatar-user { width: 30px; height: 30px; font-size: 12.5px; }
.user-chip-text { display: flex; flex-direction: column; line-height: 1.25; }
.user-chip-name { font-size: 13px; font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-role { font-size: 11.5px; color: var(--text-2); }
.user-chip-caret { font-size: 18px; color: var(--text-2); }
.icon-btn.menu-btn { width: 34px; height: 34px; border-radius: 6px; margin-left: -8px; color: var(--text-2); }
@media (max-width: 899.95px) {
  .crumb-group, .crumb-sep, .user-chip-text, .top-sep { display: none; }
  .top-search { flex: 1 1 auto; max-width: none; }
  .toolbar { padding: 0 12px; }
}

/* KPI rows: cards keep a sensible width instead of stretching across the page */
/* only rows made entirely of KPI tiles; grids that mix tiles with tables keep their normal 12-column layout */
.grid:has(> * > .stat-card):not(:has(> * > .card:not(.stat-card))) { grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)) !important; }
.grid:has(> * > .stat-card):not(:has(> * > .card:not(.stat-card))) > * { grid-column: auto !important; }

/* sign-in photo panel: brand centred, larger and styled */
.auth-art { justify-content: center; align-items: center; }
.auth.has-photo .auth-art::before { background: radial-gradient(ellipse 70% 55% at 50% 50%, rgba(6, 10, 22, .72) 0%, rgba(6, 10, 22, .45) 60%, rgba(6, 10, 22, .25) 100%); }
.auth-art-in { margin: 0; padding: 48px 40px; max-width: 620px; width: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0; }
.auth-brand { flex-direction: column; align-items: center; gap: 22px; }
.auth-art .auth-logo { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 18px 50px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .14); }
.auth-art .auth-name { font-size: clamp(34px, 3.6vw, 52px); font-weight: 700; letter-spacing: -.025em; line-height: 1.05; text-shadow: 0 2px 24px rgba(0, 0, 0, .45); }
.auth-art .auth-tag { font-size: clamp(16px, 1.4vw, 20px); opacity: .88; margin-top: 12px; letter-spacing: .01em; text-shadow: 0 1px 12px rgba(0, 0, 0, .5); }
.auth-art .auth-meta { margin-top: 30px; padding: 9px 18px; border: 1px solid rgba(255, 255, 255, .22); border-top: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px; background: rgba(255, 255, 255, .08); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-size: 12.5px; font-weight: 600; letter-spacing: .14em; opacity: 1; color: rgba(255, 255, 255, .9); }
@media (max-width: 899px) {
  .auth-art { min-height: 240px; }
  .auth-art-in { padding: 28px 20px; }
  .auth-brand { gap: 12px; }
  .auth-art .auth-logo { width: 60px; height: 60px; border-radius: 14px; }
  .auth-art .auth-name { font-size: 28px; }
  .auth-art .auth-tag { font-size: 14px; margin-top: 6px; }
}

/* sign-in: long shop names wrap neatly; a wide wordmark logo is shown at its own shape */
.auth-art-in { max-width: min(620px, 100%); box-sizing: border-box; }
.auth-art .auth-name { font-size: clamp(28px, 2.6vw, 42px); max-width: 100%; overflow-wrap: anywhere; text-wrap: balance; }
.auth-wordmark { display: block; width: min(440px, 100%); height: auto; border-radius: 10px; box-shadow: 0 18px 50px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .12); }
.auth-head .auth-logo.sm { object-fit: cover; }

/* sidebar: the whole shop name, on up to two lines */
.brand { height: auto; min-height: var(--topbar); padding: 10px 14px; align-items: center; }
.brand-logo { width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0; }
.brand-logo img { object-fit: cover; }
.brand-name { font-size: 13.5px; line-height: 1.25; white-space: normal; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.brand-tag { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.sb-collapsed .brand { padding: 10px 0; justify-content: center; }
.logo-wide-box { width: 100%; max-width: 280px; min-height: 56px; border: 1px solid var(--divider); border-radius: 6px; display: grid; place-items: center; overflow: hidden; background: var(--action-hover); }
.logo-wide-box img { width: 100%; height: auto; display: block; }

/* sidebar brand: logo on top, name and tagline below, centred */
.brand { flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 18px 16px 16px; min-height: 0; height: auto; }
.brand .brand-logo { width: 52px; height: 52px; border-radius: 12px; }
.brand-wide { display: block; width: 100%; max-width: 188px; border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
.brand-wide img { display: block; width: 100%; height: auto; }
.brand-wide + .brand-logo { display: none; }
.brand-text { width: 100%; }
.brand-name { font-size: 14.5px; font-weight: 600; line-height: 1.3; -webkit-line-clamp: 2; }
.brand-tag { font-size: 11.5px; margin-top: 3px; white-space: normal; overflow: visible; }
html.sb-collapsed .brand { padding: 12px 0; }
html.sb-collapsed .brand-wide { display: none; }
html.sb-collapsed .brand-wide + .brand-logo { display: flex; }
html.sb-collapsed .brand .brand-logo { width: 36px; height: 36px; border-radius: 8px; }

/* active menu item: soft highlight only, no accent border */
.nav-item.active { box-shadow: none; }

/* KPI rows fill evenly: 6 tiles -> 6 / 3 / 2 across, 4 tiles -> 4 / 2 across, by the width of the content area */
.main { container-type: inline-size; container-name: main; }
.grid:has(> :nth-child(6) > .stat-card):not(:has(> * > .card:not(.stat-card))) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.grid:has(> :nth-child(4):last-child > .stat-card):not(:has(> * > .card:not(.stat-card))) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
@container main (min-width: 620px) {
  .grid:has(> :nth-child(6) > .stat-card):not(:has(> * > .card:not(.stat-card))) { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@container main (min-width: 760px) {
  .grid:has(> :nth-child(4):last-child > .stat-card):not(:has(> * > .card:not(.stat-card))) { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}
@container main (min-width: 1100px) {
  .grid:has(> :nth-child(6) > .stat-card):not(:has(> * > .card:not(.stat-card))) { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
}
@container main (max-width: 380px) {
  .grid:has(> * > .stat-card):not(:has(> * > .card:not(.stat-card))) { grid-template-columns: 1fr !important; }
}

/* sign-in: the shop name set as a styled title (no logo) */
.auth-brand { gap: 0; }
.auth-rule { display: block; width: 56px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, #fb923c, #f97316); margin-bottom: 26px; box-shadow: 0 2px 12px rgba(249, 115, 22, .45); }
.auth-title { font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif; font-size: clamp(36px, 3.8vw, 60px); font-weight: 800; line-height: 1.02;
  letter-spacing: -.035em; color: #fff; max-width: 13ch; text-wrap: balance; overflow-wrap: anywhere; text-shadow: 0 4px 30px rgba(0, 0, 0, .45); margin: 0; }
.auth-title em { font-style: normal; background: linear-gradient(100deg, #fed7aa 0%, #fb923c 55%, #f97316 100%); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 4px 24px rgba(0, 0, 0, .35)); }
.auth-art .auth-tag { margin-top: 18px; font-size: clamp(16px, 1.3vw, 19px); }
.auth-art .auth-meta { margin-top: 28px; }
@media (max-width: 899px) {
  .auth-rule { width: 40px; height: 3px; margin-bottom: 14px; }
  .auth-title { font-size: 32px; max-width: 16ch; }
  .auth-art .auth-tag { margin-top: 10px; font-size: 14px; }
}

/* sign-in: phone icon above the heading */
.auth-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; margin-bottom: 20px;
  background: linear-gradient(145deg, #fff7ed, #ffedd5); color: #ea580c; box-shadow: inset 0 0 0 1px rgba(234, 88, 12, .18); }
.auth-icon .icon { font-size: 28px; }
html[data-theme=dark] .auth-icon { background: rgba(249, 115, 22, .12); color: #fb923c; box-shadow: inset 0 0 0 1px rgba(251, 146, 60, .25); }
@media (max-width: 899px) { .auth-icon { width: 44px; height: 44px; border-radius: 10px; margin-bottom: 14px; } .auth-icon .icon { font-size: 24px; } }

/* browser autofill: float the label (Chrome fills before any input event) and keep the field's own colours */
.field:has(input:-webkit-autofill) label, .field:has(input:autofill) label { transform: translate(12px, -8px) scale(.8); max-width: calc(133% - 32px); }
.field:has(input:-webkit-autofill) fieldset legend, .field:has(input:autofill) fieldset legend { max-width: 100%; }
.field input:-webkit-autofill, .field input:-webkit-autofill:hover, .field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text); -webkit-box-shadow: 0 0 0 40px var(--input-bg) inset; caret-color: var(--text); transition: background-color 9999s ease 0s; }

/* fields with a leading icon / trailing button */
.field.has-icon input { padding-left: 38px; }
.field-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); z-index: 2; display: flex; color: var(--text-3); pointer-events: none; transition: color .15s; }
.field-icon .icon { font-size: 18px; }
.field.has-icon:focus-within .field-icon { color: var(--primary); }
.field.has-icon:not(.shrink):not(:focus-within) label { transform: translate(38px, 8px) scale(1); }
.field.has-icon:has(input:-webkit-autofill) label, .field.has-icon:has(input:autofill) label { transform: translate(12px, -8px) scale(.8); }
.field.has-trail input { padding-right: 40px; }
.field-trail-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); z-index: 2; display: grid; place-items: center; width: 32px; height: 30px;
  border: 0; border-radius: 4px; background: none; color: var(--text-3); cursor: pointer; }
.field-trail-btn:hover { color: var(--text); background: var(--action-hover); }
.field-trail-btn .icon { font-size: 18px; }
.field-trail-btn .when-shown, .field-trail-btn.on .when-hidden { display: none; }
.field-trail-btn.on .when-shown { display: flex; }
.field-trail-btn .when-hidden { display: flex; }
input::-ms-reveal, input::-ms-clear { display: none; } /* Edge's own eye button: ours replaces it */

/* sign-in notice with a shield */
.auth-foot { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 12px 14px; border-radius: 6px; background: var(--action-hover); }
.auth-foot-icon { display: flex; color: var(--text-2); margin-top: 1px; }
.auth-foot-icon .icon { font-size: 18px; }

/* sign-in header: centred, with phone / accessory / chart icons describing the system */
.auth-head { text-align: center; }
.auth-icons { display: flex; justify-content: center; gap: 12px; margin-bottom: 22px; }
.auth-icons .auth-icon { margin: 0; width: 48px; height: 48px; border-radius: 12px; }
.auth-icons .auth-icon .icon { font-size: 24px; }
.auth-icons .ai-phone { background: linear-gradient(145deg, #fff7ed, #ffedd5); color: #ea580c; box-shadow: inset 0 0 0 1px rgba(234, 88, 12, .18); }
.auth-icons .ai-acc { background: linear-gradient(145deg, #eff6ff, #dbeafe); color: #2563eb; box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .16); }
.auth-icons .ai-chart { background: linear-gradient(145deg, #f0fdf4, #dcfce7); color: #15803d; box-shadow: inset 0 0 0 1px rgba(21, 128, 61, .16); }
html[data-theme=dark] .auth-icons .ai-acc { background: rgba(59, 130, 246, .12); color: #60a5fa; }
html[data-theme=dark] .auth-icons .ai-chart { background: rgba(34, 197, 94, .12); color: #4ade80; }
@media (max-width: 899px) { .auth-icons .auth-icon { width: 42px; height: 42px; } .auth-icons .auth-icon .icon { font-size: 21px; } }

/* autofill paints the input's own background: keep the outline border drawn on top of it */
.field fieldset { z-index: 2; }
.field label { z-index: 3; }

/* sidebar brand: orange phone icon + styled shop name (no logo image) */
.brand-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(145deg, #fb923c, #ea580c); color: #fff; box-shadow: 0 6px 18px rgba(234, 88, 12, .35), inset 0 1px 0 rgba(255, 255, 255, .25); }
.brand-icon .icon { font-size: 24px; }
.brand-name { font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif; font-size: 17px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; color: #fff; -webkit-line-clamp: 3; }
.brand-name em { font-style: normal; background: linear-gradient(100deg, #fed7aa 0%, #fb923c 60%, #f97316 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-tag { margin-top: 5px; }
html.sb-collapsed .brand-icon { width: 36px; height: 36px; border-radius: 9px; }
html.sb-collapsed .brand-icon .icon { font-size: 20px; }

/* one photo for several products */
.bp-photo { display: flex; gap: 16px; align-items: center; }
.bp-preview { width: 96px; height: 96px; flex-shrink: 0; border: 1px solid var(--divider); border-radius: 6px; background: #fff; display: grid; place-items: center; overflow: hidden; text-align: center; padding: 6px; }
.bp-preview img { width: 100%; height: 100%; object-fit: contain; }
.bp-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.bp-search { flex: 1 1 220px; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid var(--input-border); border-radius: 4px; background: var(--input-bg); }
.bp-search .icon { font-size: 18px; color: var(--text-3); }
.bp-search input { flex: 1; border: 0; outline: 0; background: none; font: inherit; font-size: 13.5px; color: var(--text); min-width: 0; }
.bp-select { height: 36px; padding: 0 10px; border: 1px solid var(--input-border); border-radius: 4px; background: var(--input-bg); color: var(--text); font: inherit; font-size: 13.5px; }
.bp-nophoto { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.bp-bar { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.bp-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--divider); border-radius: 6px; }
.bp-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--divider); cursor: pointer; }
.bp-row:last-child { border-bottom: 0; }
.bp-row:hover { background: var(--action-hover); }
.bp-row input { width: 16px; height: 16px; accent-color: var(--primary); flex-shrink: 0; }
.bp-row .thumb { border-radius: 4px !important; }
.bp-text { display: flex; flex-direction: column; min-width: 0; }
.bp-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-cat { font-size: 12px; color: var(--text-2); }
.bp-empty { padding: 20px; text-align: center; color: var(--text-2); font-size: 13.5px; }
.wa-body { margin: 0; white-space: pre-wrap; font-family: var(--font); font-size: 13px; color: var(--text-2); background: var(--action-hover); border-radius: 6px; padding: 10px 12px; line-height: 1.5; }

/* swap pricing tables */
.sw-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.sw-search { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 1px solid var(--input-border); border-radius: 4px; background: var(--input-bg); min-width: 240px; }
.sw-search .icon { font-size: 18px; color: var(--text-3); }
.sw-search input { border: 0; outline: 0; background: none; font: inherit; font-size: 13.5px; color: var(--text); flex: 1; min-width: 0; }
.sw-scroll { overflow-x: auto; border: 1px solid var(--divider); border-radius: 6px; max-height: 62vh; overflow-y: auto; }
.sw-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.sw-table th { position: sticky; top: 0; z-index: 1; background: var(--paper); text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); padding: 9px 10px; border-bottom: 1px solid var(--divider); }
.sw-table td { padding: 5px 10px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
.sw-table tr:last-child td { border-bottom: 0; }
.sw-table .r { text-align: right; } .sw-table .c { text-align: center; }
.sw-in { width: 100%; height: 32px; padding: 0 8px; border: 1px solid transparent; border-radius: 4px; background: transparent; font: inherit; font-size: 13.5px; color: var(--text); }
.sw-in:hover { border-color: var(--divider); }
.sw-in:focus { outline: 0; border-color: var(--primary); background: var(--input-bg); }
.sw-in:disabled { color: var(--text-3); }
select.sw-in { border-color: var(--divider); }
.sw-sm { max-width: 120px; } .sw-xs { width: 80px; }
.sw-help { height: 26px; font-size: 12px; color: var(--text-2); }
.sw-money { display: flex; align-items: center; gap: 4px; justify-content: flex-end; color: var(--text-2); }
.sw-money input { width: 120px; font-weight: 600; color: var(--text); }
.sw-check { width: 16px; height: 16px; accent-color: var(--primary); }
.sw-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
