/* ==========================================================================
   ClinicStock EU - design system
   Calm clinical palette (petrol / teal), generous spacing, two hero actions.
   No framework. Mobile-first adjustments at the end of the file.
   ========================================================================== */

:root {
  --bg: #f3f6f5;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --surface-3: #eef3f2;
  --ink: #12292b;
  --ink-2: #33494b;
  --muted: #667a7c;
  --line: #e1e8e6;
  --line-2: #cfdad7;

  --brand: #0c5c58;
  --brand-600: #094a47;
  --brand-500: #0c7a73;
  --brand-100: #d3e9e5;
  --brand-50: #ebf5f3;

  --add: #0e7a5a;
  --add-600: #0a6249;
  --add-50: #e6f5ee;
  --take: #2c3e8c;
  --take-600: #223273;
  --take-50: #ebeefa;

  --ok: #067647;
  --ok-50: #e7f6ee;
  --warn: #b54708;
  --warn-50: #fff4e6;
  --danger: #b42318;
  --danger-50: #fdeceb;
  --info: #175cd3;
  --info-50: #eaf2ff;

  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(18, 41, 43, .06);
  --shadow: 0 1px 2px rgba(18, 41, 43, .05), 0 8px 24px rgba(18, 41, 43, .06);
  --shadow-lg: 0 30px 70px rgba(18, 41, 43, .22);
  --ring: 0 0 0 4px rgba(12, 122, 115, .18);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Consolas, monospace;
  --sidebar-w: 252px;
  --topbar-h: 64px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.012em; font-weight: 700; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }
a { color: var(--brand-500); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: inline-block; vertical-align: middle; }
code, .mono { font-family: var(--mono); font-size: .92em; }
button, input, select, textarea { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }
:focus-visible { outline: 3px solid rgba(12, 122, 115, .45); outline-offset: 2px; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.text-warn { color: var(--warn) !important; }
.text-danger { color: var(--danger) !important; }
.text-brand { color: var(--brand-500) !important; }
.pre { white-space: pre-line; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.optional { font-weight: 400; color: var(--muted); font-size: .82rem; }
.link { font-weight: 600; font-size: .88rem; }

/* ---------- Icons ---------- */
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-xs { width: 13px; height: 13px; vertical-align: -2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .95rem; line-height: 1;
  cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-600); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--brand-500); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-light { background: #fff; color: var(--brand); }
.btn-light:hover { background: var(--brand-50); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f1c13; }
.btn-add { background: var(--add); color: #fff; }
.btn-add:hover { background: var(--add-600); }
.btn-take { background: var(--take); color: #fff; }
.btn-take:hover { background: var(--take-600); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .86rem; border-radius: 8px; }
.btn-lg { min-height: 50px; padding: 0 22px; font-size: 1rem; }
.btn-xl { min-height: 60px; padding: 0 30px; font-size: 1.12rem; border-radius: 12px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label, .label { font-weight: 600; font-size: .88rem; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=date], input:not([type]), select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
select {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667a7c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--ring); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.hint { margin: 0; font-size: .8rem; color: var(--muted); }
.field-error { margin: 2px 0 0; font-size: .84rem; color: var(--danger); font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.form-row .field { flex: 1 1 160px; }
.form-row .field.grow { flex: 3 1 240px; }
.field-end { justify-content: flex-end; flex: 0 0 auto !important; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.form-card { max-width: 860px; }
fieldset.billing { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 2px; margin: 8px 0 0; }
fieldset.billing legend { padding: 0 6px; font-weight: 700; font-size: .9rem; }

.check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 14px; font-size: .9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.switch { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; cursor: pointer; font-size: .92rem; }
.switch input {
  -webkit-appearance: none; appearance: none; flex: none;
  width: 40px; height: 24px; border-radius: 99px; background: var(--line-2); position: relative; cursor: pointer;
  transition: background .2s; margin: 0; border: 0; min-height: 0; padding: 0;
}
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s; }
.switch input:checked { background: var(--brand-500); }
.switch input:checked::after { transform: translateX(16px); }

.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 14px; }
.choice-row { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.choice-card { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 14px; border: 1.5px solid var(--line-2); border-radius: var(--radius); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.choice-card:hover { border-color: var(--brand-500); }
.choice-card input { margin-top: 3px; accent-color: var(--brand); flex: none; }
.choice-card span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.choice-card small { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.choice-card:has(input:checked) { border-color: var(--brand-500); background: var(--brand-50); box-shadow: var(--ring); }
.choice-compact { padding: 10px 12px; }
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-bottom: 14px; }
.chip-checks { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-flex; padding: 8px 14px; border-radius: 99px; border: 1.5px solid var(--line-2); font-size: .88rem; font-weight: 600; cursor: pointer; background: var(--surface); }
.chip-check input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-check input:focus-visible + span { box-shadow: var(--ring); }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 46px; }
.password-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; width: 38px; height: 38px; border-radius: 8px; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.password-toggle:hover { background: var(--surface-3); }

/* ---------- Badges & chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font-size: .74rem; font-weight: 700; letter-spacing: .01em; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; vertical-align: middle; }
.badge-ok { background: var(--ok-50); color: var(--ok); }
.badge-warn { background: var(--warn-50); color: var(--warn); }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.badge-muted { background: var(--surface-3); color: var(--muted); }
.badge-brand { background: var(--brand-50); color: var(--brand); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.chip-btn { cursor: pointer; transition: border-color .15s, background .15s; }
.chip-btn:hover { border-color: var(--brand-500); color: var(--brand); }
.chip-btn.is-active { background: var(--take); border-color: var(--take); color: #fff; }

/* ---------- Alerts, banners, callouts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: .92rem; border: 1px solid transparent; }
.alert .icon { margin-top: 1px; }
.alert-success { background: var(--ok-50); color: #05603a; border-color: #b7e4cb; }
.alert-error { background: var(--danger-50); color: #912018; border-color: #f6c5c0; }
.alert-info { background: var(--info-50); color: #1849a9; border-color: #c4d9fd; }
.alert-warn { background: var(--warn-50); color: #93370d; border-color: #fbd9a8; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 28px; font-size: .9rem; flex-wrap: wrap; }
.banner form { margin: 0; }
.banner-demo { background: linear-gradient(90deg, #0c5c58, #0e6f69); color: #e8f6f3; }
.banner-demo strong { color: #fff; }
.banner-info { background: var(--info-50); color: #1849a9; border-bottom: 1px solid #c4d9fd; }
.banner-text { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.callout { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); margin-bottom: 18px; box-shadow: var(--shadow-sm); flex-wrap: wrap; }
.callout-brand { background: var(--brand-50); border-color: var(--brand-100); }
.callout-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }
.callout-body { flex: 1 1 260px; min-width: 0; }
.callout-body p { margin: 2px 0 0; }
.copy-row { display: flex; gap: 8px; margin-top: 8px; }
.copy-row input { font-family: var(--mono); font-size: .82rem; }

/* ---------- App shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; width: var(--sidebar-w); flex: none;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px; overflow-y: auto; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; color: var(--ink); text-decoration: none !important; }
.brand-name { font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; }
.brand-eu { font-size: .7rem; font-weight: 800; color: var(--brand-500); background: var(--brand-50); padding: 2px 6px; border-radius: 6px; vertical-align: 3px; letter-spacing: .04em; }
.brand-small { padding: 0; font-weight: 700; }
.side-actions { display: grid; gap: 8px; margin: 2px 0 14px; }
.side-action {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px;
  font-weight: 700; color: #fff !important; text-decoration: none !important; font-size: .95rem;
  box-shadow: var(--shadow-sm); transition: filter .15s, transform .05s;
}
.side-action .icon { width: 22px; height: 22px; stroke-width: 2.6; }
.side-action:hover { filter: brightness(1.07); }
.side-add { background: var(--add); }
.side-take { background: var(--take); }
.side-action.is-active { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px currentColor; }
.side-add.is-active { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--add); }
.side-take.is-active { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--take); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section { margin: 16px 10px 6px; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: .93rem; text-decoration: none !important; }
.nav-item .icon { color: var(--muted); }
.nav-item:hover { background: var(--surface-3); color: var(--ink); }
.nav-item.is-active { background: var(--brand-50); color: var(--brand); }
.nav-item.is-active .icon { color: var(--brand-500); }
.side-foot { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid var(--line); }
.side-company { font-weight: 700; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-plan { font-size: .78rem; color: var(--muted); }
.sidebar-scrim { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: rgba(243, 246, 245, .86); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.menu-toggle { display: none; }
.topbar-title { font-size: 1.12rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.demo-pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; background: var(--warn-50); color: var(--warn); font-weight: 700; font-size: .82rem; text-decoration: none !important; border: 1px solid #fbd9a8; }
.demo-pill:hover { background: #ffe9cc; }
.content { padding: 26px 28px 60px; width: 100%; max-width: 1280px; }

/* User menu */
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); cursor: pointer; }
.user-btn:hover { border-color: var(--line-2); }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-100); color: var(--brand); font-weight: 800; font-size: .78rem; flex: none; }
.avatar-sm { width: 34px; height: 34px; }
.user-name { font-weight: 600; font-size: .9rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); width: 270px; z-index: 50;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 6px; display: none;
}
.user-menu.is-open .dropdown { display: block; }
.dropdown-head { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dropdown-head span { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.role-tag { margin-top: 4px; font-weight: 700; color: var(--brand) !important; }
.dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font-size: .92rem; font-weight: 500; text-align: left; cursor: pointer; text-decoration: none !important; list-style: none; }
.dropdown-item::-webkit-details-marker { display: none; }
.dropdown-item .icon { color: var(--muted); width: 18px; height: 18px; }
.dropdown-item:hover { background: var(--surface-3); }
.dropdown form { margin: 0; }
.dropdown-value { margin-left: auto; color: var(--muted); font-size: .82rem; }
.dropdown-sub[open] > summary { background: var(--surface-3); }
.lang-list { display: grid; padding: 4px 4px 6px 38px; gap: 1px; }
.lang-option { display: flex; justify-content: space-between; align-items: center; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: .9rem; text-align: left; }
.lang-option:hover { background: var(--surface-3); }
.lang-option.is-current { color: var(--brand); font-weight: 700; }

/* Bottom bar (mobile) */
.bottom-bar { display: none; }

/* ---------- Page structure ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.back-link:hover { color: var(--ink); text-decoration: none; }
.narrow-content { max-width: 780px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; align-items: start; }
.grid-2 > .card { margin-bottom: 0; }
.grid-wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }

/* ---------- Cards & tiles ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; margin-bottom: 18px; min-width: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.card-head h2 .icon { color: var(--brand-500); }
.card-title { font-size: 1.02rem; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-title .icon { color: var(--brand-500); }
details.card > summary { cursor: pointer; list-style: none; margin: 0; }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { margin-bottom: 12px; }
.empty-mini { padding: 22px 20px; color: var(--muted); display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.empty-mini .icon { color: var(--ok); }
.empty-state { text-align: center; padding: 48px 20px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); margin-bottom: 18px; }
.empty-icon { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 16px; background: var(--brand-50); color: var(--brand-500); display: grid; place-items: center; }
.empty-icon .icon { width: 28px; height: 28px; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none !important; transition: border-color .15s, transform .15s; min-width: 0; }
a.tile:hover { border-color: var(--brand-100); transform: translateY(-1px); }
.tile-label { font-size: .82rem; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.tile-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.tile-value-sm { font-size: 1.25rem; }
.tile-sub { font-size: .8rem; color: var(--muted); }
.tile-warn { border-color: #fbd9a8; background: linear-gradient(180deg, #fff, var(--warn-50)); }
.tile-warn .tile-value { color: var(--warn); }
.tile-danger { border-color: #f6c5c0; background: linear-gradient(180deg, #fff, var(--danger-50)); }
.tile-danger .tile-value { color: var(--danger); }
.tile-quiet { background: var(--surface-2); }
.tiles-admin { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* ---------- Dashboard ---------- */
.big-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.big-action {
  position: relative; display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: var(--radius-lg);
  color: #fff !important; text-decoration: none !important; overflow: hidden; min-height: 112px;
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.big-action::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.08); }
.big-action:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(18,41,43,.2); }
.big-add { background: linear-gradient(135deg, #0e7a5a, #0b6a62); }
.big-take { background: linear-gradient(135deg, #2c3e8c, #273775); }
.big-icon { width: 60px; height: 60px; border-radius: 16px; background: rgba(255,255,255,.16); display: grid; place-items: center; flex: none; }
.big-icon .icon { width: 32px; height: 32px; stroke-width: 2.6; }
.big-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.big-text strong { font-size: 1.35rem; letter-spacing: .02em; text-transform: uppercase; font-weight: 800; }
.big-text small { font-size: .9rem; opacity: .85; }
.big-arrow { margin-left: auto; opacity: .7; width: 24px; height: 24px; }

.stock-list { list-style: none; margin: 0; padding: 4px 0; }
.stock-list li + li { border-top: 1px solid var(--line); }
.stock-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 20px; color: var(--ink); text-decoration: none !important; }
.stock-row:hover { background: var(--surface-2); }
.stock-row-main { display: flex; flex-direction: column; min-width: 0; }
.stock-row-main strong { font-size: .94rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stock-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.meter { width: 110px; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; flex: none; }
.meter span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--warn), #f79009); }
.meter-brand { width: 100%; }
.meter-brand span { background: linear-gradient(90deg, var(--brand), var(--brand-500)); }

.activity-list { list-style: none; margin: 0; padding: 4px 0; }
.activity { display: flex; align-items: center; gap: 12px; padding: 11px 20px; }
.activity + .activity { border-top: 1px solid var(--line); }
.activity-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.activity-icon.tx-in { background: var(--add-50); color: var(--add); }
.activity-icon.tx-out { background: var(--take-50); color: var(--take); }
.activity-icon.tx-adjustment, .activity-icon.tx-correction { background: var(--warn-50); color: var(--warn); }
.activity-main { flex: 1; min-width: 0; }
.activity-main > div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qty { font-weight: 800; font-variant-numeric: tabular-nums; }
.qty-pos { color: var(--add); }
.qty-neg { color: var(--take); }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fbfcfc; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; width: 1%; }
.row-title { font-weight: 700; color: var(--ink); }
.row-title:hover { color: var(--brand-500); }
.row-muted td, li.row-muted { opacity: .55; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.tx-tag { display: inline-block; font-weight: 700; font-size: .78rem; padding: 2px 8px; border-radius: 6px; margin-right: 4px; }
.tx-tag.tx-in { background: var(--add-50); color: var(--add); }
.tx-tag.tx-out { background: var(--take-50); color: var(--take); }
.tx-tag.tx-adjustment, .tx-tag.tx-correction { background: var(--warn-50); color: var(--warn); }
.user-cell { display: flex; gap: 10px; align-items: center; }

/* ---------- Tabs / segmented / filters / pagination ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none !important; display: inline-flex; align-items: center; gap: 8px; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--brand); border-bottom-color: var(--brand-500); }
.tab-count { font-size: .74rem; background: var(--surface-3); color: var(--muted); padding: 1px 7px; border-radius: 99px; }
.tab-count-alert { background: var(--warn-50); color: var(--warn); }
.segmented { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; }
.segmented button { border: 0; background: transparent; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: .88rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.segmented button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; flex: 1; }
.filters select { width: auto; min-width: 150px; }
.search-input { position: relative; flex: 1 1 240px; max-width: 380px; }
.search-input .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-input input { padding-left: 36px; }
.report-filters { padding-bottom: 6px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; }
.filter-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: flex-end; margin-bottom: 12px; }
.filter-actions .segmented { margin-right: auto; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0; }

/* ---------- Key/value ---------- */
.kv { margin: 0; display: grid; gap: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.kv-total dt, .kv-total dd { font-size: 1.05rem; color: var(--ink); font-weight: 800; }
.kv-inline { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 20px; }
.kv-inline > div { flex-direction: column; gap: 2px; padding: 0; border: 0; }
.kv-inline dd { text-align: left; }
.plain-list { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.small-title { font-size: .85rem; margin: 14px 0 6px; color: var(--muted); }

/* ---------- Product page ---------- */
.product-hero { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.product-hero-main { flex: 1 1 380px; min-width: 0; }
.product-hero-main h2 { font-size: 1.4rem; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.product-hero-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); min-width: 120px; }
.stat-label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.stat-value small { font-size: .8rem; font-weight: 600; color: var(--muted); }
.stat-warn { background: var(--warn-50); border-color: #fbd9a8; }
.stat-warn .stat-value { color: var(--warn); }
.stat-danger { background: var(--danger-50); border-color: #f6c5c0; }
.stat-danger .stat-value { color: var(--danger); }
.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; border: 1px dashed var(--line-2); border-radius: var(--radius); margin-bottom: 18px; flex-wrap: wrap; }
.danger-zone p { margin: 2px 0 0; }
.danger-card { border-color: #f6c5c0; }
.danger-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.danger-row p { margin: 2px 0 0; }
.edit-list { list-style: none; margin: 0; padding: 0; }
.edit-list li { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.edit-list li:last-child { border-bottom: 0; }
.edit-list form { margin: 0; }
.inline-edit { display: flex; align-items: center; gap: 10px; flex: 1 1 320px; min-width: 0; }
.inline-edit input { flex: 1; min-width: 120px; }
.row-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.seat-summary { flex: 1 1 280px; }
.seat-meter { max-width: 360px; display: flex; flex-direction: column; gap: 6px; }
.seat-meter-label { font-weight: 700; }

/* ---------- Stock console (Add / Take) ---------- */
.stock-console { max-width: 860px; margin: 0 auto; }
.console-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.console-title { display: flex; align-items: center; gap: 14px; }
.console-title h2 { font-size: 1.5rem; margin: 0; text-transform: uppercase; letter-spacing: .02em; font-weight: 800; }
.console-title p { margin: 2px 0 0; }
.console-badge { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; color: #fff; flex: none; box-shadow: var(--shadow); }
.console-badge .icon { width: 30px; height: 30px; stroke-width: 2.8; }
.console-add .console-badge { background: var(--add); }
.console-take .console-badge { background: var(--take); }
.location-select { display: inline-flex; align-items: center; gap: 8px; padding: 0 0 0 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--muted); }
.location-select select { border: 0; min-height: 42px; background-color: transparent; font-weight: 700; color: var(--ink); width: auto; box-shadow: none !important; }

.scan-box { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.scan-field { position: relative; display: flex; align-items: center; }
.scan-icon { position: absolute; left: 18px; width: 28px; height: 28px; color: var(--muted); pointer-events: none; }
.scan-field input {
  min-height: 70px; padding: 0 110px 0 60px; font-size: 1.25rem; font-weight: 600;
  border-radius: 16px; border-width: 2px; border-color: var(--line-2); background: var(--surface-2);
}
.scan-field input::placeholder { color: #8a9a9c; font-weight: 500; }
.console-add .scan-field input:focus { border-color: var(--add); box-shadow: 0 0 0 5px rgba(14, 122, 90, .16); background: #fff; }
.console-take .scan-field input:focus { border-color: var(--take); box-shadow: 0 0 0 5px rgba(44, 62, 140, .16); background: #fff; }
.scan-clear, .scan-camera { position: absolute; display: grid; place-items: center; border: 0; cursor: pointer; background: transparent; color: var(--muted); border-radius: 12px; }
.scan-clear { right: 62px; width: 40px; height: 40px; }
.scan-field:has(.scan-camera[hidden]) input { padding-right: 56px; }
.scan-field:has(.scan-camera[hidden]) .scan-clear { right: 10px; }
.scan-camera { right: 10px; width: 48px; height: 48px; background: var(--surface-3); color: var(--ink-2); }
.scan-camera:hover, .scan-clear:hover { background: var(--line); }
.scan-status { display: flex; align-items: center; gap: 8px; margin: 10px 4px 0; font-size: .84rem; color: var(--muted); }
.scanner-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(6, 118, 71, .5); animation: pulse 2s infinite; }
.scanner-dot.is-busy { background: var(--warn); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(6,118,71,.45); } 70% { box-shadow: 0 0 0 8px rgba(6,118,71,0); } 100% { box-shadow: 0 0 0 0 rgba(6,118,71,0); } }

.results { list-style: none; margin: 12px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; max-height: 420px; overflow-y: auto; }
.result { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; }
.result:last-child { border-bottom: 0; }
.result:hover, .result.is-active { background: var(--brand-50); }
.result-main { min-width: 0; display: flex; flex-direction: column; }
.result-name { font-weight: 700; font-size: 1.02rem; }
.result-name mark { background: #fff2b8; color: inherit; border-radius: 3px; padding: 0 1px; }
.result-meta { font-size: .82rem; color: var(--muted); font-family: var(--mono); }
.result-stock { text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.result-stock strong { display: block; font-size: 1.1rem; }
.result-stock span { font-size: .78rem; color: var(--muted); }
.results-empty { padding: 16px; color: var(--muted); font-size: .92rem; }

.feedback { display: flex; align-items: center; gap: 18px; padding: 20px 22px; border-radius: var(--radius-lg); margin-bottom: 16px; animation: pop .28s ease-out; }
.feedback-ok { background: var(--ok-50); border: 2px solid #9fdcbd; color: #05603a; }
.feedback-error { background: var(--danger-50); border: 2px solid #f4b2ab; color: #912018; }
.feedback-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; }
.feedback-ok .feedback-icon { background: var(--ok); }
.feedback-error .feedback-icon { background: var(--danger); }
.feedback-icon .icon { width: 30px; height: 30px; stroke-width: 3; }
.feedback-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.25; }
.feedback-detail { font-size: 1.05rem; font-weight: 600; opacity: .9; }
@keyframes pop { from { transform: scale(.97); opacity: .4; } to { transform: scale(1); opacity: 1; } }

.not-found { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius); background: var(--warn-50); border: 1px solid #fbd9a8; margin-bottom: 16px; flex-wrap: wrap; }
.not-found-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #fff; color: var(--warn); flex: none; }
.not-found-body { display: flex; flex-direction: column; flex: 1 1 200px; }
.not-found-body strong { font-size: 1.1rem; }

.selected { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); animation: pop .2s ease-out; }
.console-add .selected { border-color: #9fdcbd; }
.console-take .selected { border-color: #b8c2ec; }
.selected-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.selected-name { font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; }
.selected-stock { text-align: right; }
.selected-stock strong { display: block; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.add-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 0 14px; }
.field-qty input { font-size: 1.5rem; font-weight: 800; min-height: 58px; text-align: center; }
.selected-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.selected-actions .btn-xl { min-width: 220px; }

.qty-picker { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.qty-label { font-weight: 800; text-transform: uppercase; letter-spacing: .05em; font-size: .82rem; color: var(--muted); }
.stepper { display: flex; align-items: center; border: 2px solid var(--line-2); border-radius: 14px; overflow: hidden; background: var(--surface); }
.stepper input { width: 90px; min-height: 56px; border: 0; border-radius: 0; text-align: center; font-size: 1.6rem; font-weight: 800; box-shadow: none !important; padding: 0; }
.stepper-btn { width: 56px; height: 56px; border: 0; background: var(--surface-3); cursor: pointer; display: grid; place-items: center; color: var(--ink); }
.stepper-btn:hover { background: var(--line); }
.stepper-btn .icon { width: 24px; height: 24px; stroke-width: 2.6; }
.qty-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.qty-chips .chip { min-width: 52px; justify-content: center; font-size: 1rem; padding: 10px 14px; }

.session-log { margin-top: 8px; }
.session-log h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.session-log ul { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.session-log li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.session-log li:last-child { border-bottom: 0; }
.demo-samples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 16px; padding: 12px 14px; border: 1px dashed var(--brand-100); background: var(--brand-50); border-radius: var(--radius); }
.demo-samples > span { width: 100%; }

.camera-card { max-width: 520px; }
.camera-view { position: relative; border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; margin-bottom: 10px; }
.camera-view video { width: 100%; height: 100%; object-fit: cover; }
.camera-frame { position: absolute; inset: 22% 12%; border: 3px solid rgba(255,255,255,.9); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }

/* ---------- Modal & toast ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(13, 29, 31, .55); backdrop-filter: blur(3px); }
.modal[hidden] { display: none; }
.modal-card { width: 100%; max-width: 620px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-lg); animation: pop .2s ease-out; }
.modal-narrow { max-width: 440px; text-align: center; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; text-align: left; }
.modal-head h2 { margin: 0; }
.modal-icon { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 18px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; }
.modal-icon .icon { width: 30px; height: 30px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; align-items: center; }
.modal-narrow .modal-actions { justify-content: center; }
.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; min-width: 240px; max-width: 360px; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); font-size: .92rem; animation: pop .2s ease-out; }
.toast-error { background: var(--danger); }
.toast-success { background: var(--ok); }

/* ---------- License ---------- */
.license-status { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
.license-status.is-active { background: linear-gradient(135deg, #fff, var(--brand-50)); }
.license-status.is-demo { background: linear-gradient(135deg, #fff, var(--warn-50)); }
.ls-main { flex: 1 1 320px; }
.ls-main h2 { margin: 10px 0 6px; }
.ls-label { margin-top: 10px; font-weight: 600; color: var(--muted); font-size: .88rem; }
.ls-date { font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.ls-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 22px; align-items: start; }
.price-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; position: sticky; top: calc(var(--topbar-h) + 16px); }
.price-box-inline { position: static; margin-bottom: 14px; }
.price-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: .92rem; font-variant-numeric: tabular-nums; }
.price-row:empty { display: none; }
.price-total { border-top: 1px solid var(--line-2); margin-top: 6px; padding-top: 12px; font-size: 1.15rem; font-weight: 800; margin-bottom: 10px; }
.new-end { margin: -4px 0 12px; font-size: .92rem; color: var(--muted); }
.new-end strong { color: var(--ink); }

/* ---------- Notices / recovery ---------- */
.notice-card { text-align: center; padding: 30px 26px; }
.notice-icon { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 18px; background: var(--warn-50); color: var(--warn); display: grid; place-items: center; }
.notice-icon .icon { width: 30px; height: 30px; }
.notice-text { font-size: 1.05rem; line-height: 1.6; max-width: 620px; margin: 0 auto 14px; font-weight: 500; }
.notice-danger { border-color: #f6c5c0; }
.notice-danger .notice-icon { background: var(--danger-50); color: var(--danger); }
.notice-brand { border-color: var(--brand-100); background: linear-gradient(180deg, #fff, var(--brand-50)); }
.notice-brand .notice-icon { background: var(--brand); color: #fff; }
.notice-card .check-list, .notice-card .kv { text-align: left; max-width: 560px; margin-left: auto; margin-right: auto; }
.recovery-steps { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.recovery-steps li { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); opacity: .6; }
.recovery-steps li.is-done, .recovery-steps li.is-current { opacity: 1; }
.recovery-steps li.is-current { border-color: var(--brand-500); box-shadow: var(--ring); }
.recovery-steps p { margin: 0; }
.step-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 800; background: var(--surface-3); color: var(--ink-2); font-size: .9rem; }
.is-done .step-n { background: var(--ok); color: #fff; }
.is-current .step-n { background: var(--brand); color: #fff; }
.decline-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 4px; flex-wrap: wrap; }

.check-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list .icon { color: var(--brand-500); margin-top: 2px; }
.check-list-muted .icon { color: var(--muted); }

.code-block { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: .8rem; white-space: pre-wrap; overflow-wrap: anywhere; margin: 10px 0 0; }

/* ---------- Public pages / landing ---------- */
body.public { background: #fbfcfc; }
.lp-header { position: sticky; top: 0; z-index: 30; background: rgba(251, 252, 252, .88); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.lp-header-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 24px; padding: 12px 24px; }
.lp-header .brand { padding: 0; }
.lp-nav { display: flex; gap: 22px; }
.lp-nav a { color: var(--ink-2); font-weight: 600; font-size: .93rem; }
.lp-header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang-select { display: flex; align-items: center; gap: 4px; margin: 0; padding-left: 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--muted); }
.lang-select select { border: 0; min-height: 38px; width: auto; background-color: transparent; font-weight: 600; color: var(--ink); padding-left: 4px; box-shadow: none !important; }
.public-main { min-height: 60vh; }
.public-alerts { max-width: 1200px; margin: 16px auto 0; padding: 0 24px; }

.lp-hero { position: relative; overflow: hidden; background:
  radial-gradient(900px 420px at 85% -10%, rgba(12, 122, 115, .14), transparent 60%),
  radial-gradient(700px 380px at -10% 110%, rgba(44, 62, 140, .08), transparent 60%); }
.lp-hero-inner { max-width: 1200px; margin: 0 auto; padding: 56px 24px 64px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, 440px); gap: 56px; align-items: start; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--brand-50); color: var(--brand); font-weight: 700; font-size: .82rem; margin-bottom: 18px; }
.lp-hero h1 { font-size: clamp(2rem, 4.2vw, 3.25rem); letter-spacing: -.035em; line-height: 1.06; margin-bottom: 18px; font-weight: 800; }
.lead { font-size: 1.12rem; color: var(--ink-2); line-height: 1.6; max-width: 620px; }
.lp-hero .check-list { margin: 22px 0 28px; }
.lp-hero .check-list li { font-weight: 600; }
.hero-proof { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hero-proof-text { margin: 0; font-weight: 700; color: var(--brand); font-size: 1.05rem; }
.mock-scan { width: 320px; max-width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 12px; }
.mock-scan-top { display: flex; align-items: center; gap: 6px; font-size: .72rem; text-transform: uppercase; font-weight: 800; letter-spacing: .06em; color: var(--take); margin-bottom: 8px; }
.mock-scan-result { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--ok-50); border: 1.5px solid #9fdcbd; color: #05603a; }
.mock-scan-result strong { display: block; font-size: 1rem; }
.mock-scan-result span { font-size: .84rem; }
.mock-check { width: 38px; height: 38px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; flex: none; }
.mock-check .icon { stroke-width: 3; }

.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 22px; scroll-margin-top: 90px; }
.auth-card h2 { font-size: 1.3rem; margin-top: 4px; }
.auth-card-single { max-width: 460px; margin: 0 auto; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--surface-3); border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.auth-tab { border: 0; background: transparent; padding: 10px; border-radius: 9px; font-weight: 700; color: var(--muted); cursor: pointer; }
.auth-tab.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-pane { display: none; }
.auth-pane.is-active { display: block; }
.auth-note { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; font-size: .82rem; color: var(--muted); }
.auth-note .icon { margin-top: 2px; }
.auth-links { margin: 12px 0 0; font-size: .9rem; text-align: center; }
.narrow-page { padding: 48px 20px 64px; }

.lp-strip { max-width: 1200px; margin: 0 auto; padding: 18px 24px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lp-strip-label { font-weight: 700; color: var(--muted); font-size: .86rem; margin-right: 6px; }
.lp-section { max-width: 1200px; margin: 0 auto; padding: 72px 24px; }
.lp-section-head { text-align: center; max-width: 720px; margin: 0 auto 40px; }
.lp-section-head h2, .split-copy h2, .lp-cta h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: -.03em; font-weight: 800; }
.lp-section-head .lead { margin: 0 auto; }
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-sm); }
.feature h3 { margin: 14px 0 6px; font-size: 1.02rem; }
.feature p { color: var(--muted); font-size: .92rem; margin: 0; }
.feature-icon { width: 46px; height: 46px; border-radius: 13px; background: var(--brand-50); color: var(--brand-500); display: grid; place-items: center; }
.feature-icon .icon { width: 24px; height: 24px; }
.lp-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 18px; }
.steps li { display: flex; gap: 14px; }
.steps p { margin: 2px 0 0; color: var(--muted); }
.steps .step-n { background: var(--brand); color: #fff; width: 34px; height: 34px; }
.mock-dash { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 18px; }
.mock-dash-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.mock-tile { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; }
.mock-tile span { font-size: .74rem; color: var(--muted); font-weight: 600; }
.mock-tile strong { font-size: 1.6rem; letter-spacing: -.03em; }
.tone-warn { color: var(--warn); }
.tone-danger { color: var(--danger); }
.mock-list { display: grid; }
.mock-line { display: flex; justify-content: space-between; gap: 10px; padding: 11px 4px; border-bottom: 1px solid var(--line); font-size: .9rem; font-weight: 600; }
.mock-line:last-child { border-bottom: 0; }

.lp-pricing { background: none; }
.pricing-wrap { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 28px; align-items: start; justify-content: center; }
.pricing-card { background: var(--surface); border: 2px solid var(--brand-100); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-lg); }
.pricing-name { font-weight: 800; color: var(--brand); text-transform: uppercase; letter-spacing: .06em; font-size: .82rem; }
.pricing-price { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 2px; }
.pricing-price .amount { font-size: 2.8rem; font-weight: 800; letter-spacing: -.04em; }
.pricing-price .per { color: var(--muted); font-weight: 600; }
.pricing-vat { color: var(--muted); font-size: .85rem; margin-bottom: 18px; }
.pricing-side h3 { font-size: 1.2rem; margin-bottom: 16px; }
.trust-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.trust-list li { display: flex; gap: 14px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.trust-list .icon { color: var(--brand-500); width: 24px; height: 24px; margin-top: 2px; }
.trust-list p { margin: 2px 0 0; color: var(--muted); font-size: .92rem; }
.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 18px; }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0; font-weight: 700; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq summary .icon { transition: transform .2s; color: var(--muted); }
.faq details p { color: var(--ink-2); padding-bottom: 16px; margin: 0; }
.lp-cta { margin: 0 24px 72px; padding: 56px 24px; border-radius: 28px; text-align: center; color: #fff; background: radial-gradient(600px 300px at 80% 0%, rgba(255,255,255,.12), transparent 60%), linear-gradient(135deg, #0c5c58, #0a3f45); }
.lp-cta h2 { color: #fff; }
.lp-cta p { opacity: .85; max-width: 560px; margin: 0 auto 22px; font-size: 1.05rem; }
@media (min-width: 1248px) { .lp-cta { max-width: 1152px; margin-left: auto; margin-right: auto; } }
.lp-footer { border-top: 1px solid var(--line); background: var(--surface); }
.lp-footer-inner { max-width: 1200px; margin: 0 auto; padding: 28px 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; font-size: .88rem; }
.lp-footer p { margin: 0; }

.error-page { text-align: center; max-width: 480px; margin: 0 auto; }
.error-code { font-size: 4.5rem; font-weight: 800; letter-spacing: -.05em; color: var(--brand-100); line-height: 1; }

/* ---------- Setup (browser installer) ---------- */
.setup-card { max-width: 560px; }
.setup-checks { list-style: none; padding: 0; margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.setup-check { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.setup-check:last-child { border-bottom: 0; }
.setup-check.is-ok .icon { color: var(--ok); }
.setup-check.is-warn .icon { color: var(--warn); }
.setup-check.is-error { background: var(--danger-50); }
.setup-check.is-error .icon { color: var(--danger); }
.setup-check > div { min-width: 0; }
.setup-hint { display: block; margin-top: 4px; font-family: var(--font); font-size: .8rem; color: var(--ink-2); overflow-wrap: anywhere; white-space: normal; }
.setup-next { padding-left: 20px; margin: 0 0 18px; display: grid; gap: 6px; }

/* ---------- Superadmin ---------- */
.sidebar-dark { background: #0d2426; border-right-color: #0d2426; color: #d9e6e4; }
.sidebar-dark .brand, .sidebar-dark .brand-name { color: #fff; }
.sidebar-dark .nav-item { color: #b9cbc8; }
.sidebar-dark .nav-item .icon { color: #7f9997; }
.sidebar-dark .nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-dark .nav-item.is-active { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-dark .side-foot { border-top-color: rgba(255,255,255,.1); }
.sidebar-dark .btn-ghost { color: #b9cbc8; padding-left: 0; }

/* ---------- Receipt / print ---------- */
.print-page { background: var(--surface); }
.receipt { max-width: 760px; margin: 32px auto; padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.receipt-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 24px; }
.receipt-title { text-align: right; }
.receipt-title h1 { margin: 0; }
.receipt-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.receipt-parties .label { display: block; margin-bottom: 4px; color: var(--muted); }
@media print {
  .no-print, .topbar, .sidebar, .bottom-bar, .banner { display: none !important; }
  .receipt { border: 0; margin: 0; padding: 0; }
  body { background: #fff; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-hero-inner { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 36px; }
}

@media (max-width: 1024px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-102%);
    transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(13, 29, 31, .45); z-index: 35; }
  .menu-toggle { display: inline-grid; margin-left: -8px; }
  .topbar { padding: 0 18px; }
  .content { padding: 20px 18px 110px; }
  .banner { padding: 10px 18px; }
  .bottom-bar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 20px rgba(18,41,43,.06);
  }
  .bb-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 2px; border: 0; background: transparent; color: var(--muted); font-size: .7rem; font-weight: 700; text-decoration: none !important; border-radius: 12px; cursor: pointer; min-width: 0; }
  .bb-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bb-item.is-active { color: var(--brand); }
  .bb-add, .bb-take { color: #fff !important; margin: 0 3px; }
  .bb-add { background: var(--add); }
  .bb-take { background: var(--take); }
  .bb-add .icon, .bb-take .icon { stroke-width: 2.8; }
  .toast-stack { bottom: 86px; }
  .lp-hero-inner { grid-template-columns: 1fr; padding-top: 36px; }
  .auth-card { max-width: 520px; width: 100%; }
  .lp-split { grid-template-columns: 1fr; gap: 32px; }
  .pricing-wrap { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
  .checkout-grid { grid-template-columns: 1fr; }
  .price-box { position: static; }
}

@media (max-width: 720px) {
  body { font-size: 15px; }
  h1 { font-size: 1.4rem; }
  .user-name { display: none; }
  .user-btn { padding: 3px; }
  .demo-pill span { display: none; }
  .demo-pill { padding: 7px; }
  .content { padding: 16px 14px 110px; }
  .grid-2, .grid-wide-left { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .big-actions { grid-template-columns: 1fr; gap: 12px; }
  .big-action { min-height: 92px; padding: 18px; }
  .big-text strong { font-size: 1.15rem; }
  .big-icon { width: 52px; height: 52px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 14px; }
  .tile-value { font-size: 1.55rem; }
  .card { padding: 16px; }
  .card-flush { padding: 0; }
  .card-head { padding: 14px 16px; }
  .stock-row, .activity { padding-left: 16px; padding-right: 16px; }
  .meter { width: 70px; }
  .activity time { display: none; }
  .add-grid { grid-template-columns: 1fr; }
  .scan-box { padding: 12px; border-radius: 16px; }
  .scan-field input { min-height: 62px; font-size: 1.08rem; padding-left: 52px; padding-right: 104px; }
  .scan-icon { left: 16px; }
  .console-title h2 { font-size: 1.2rem; }
  .console-badge { width: 46px; height: 46px; }
  .selected-actions .btn-xl { width: 100%; min-width: 0; }
  .selected-actions .btn-ghost { order: 2; width: 100%; }
  .qty-picker { padding: 12px; gap: 10px; }
  .qty-label { width: 100%; }
  .stepper input { width: 70px; }
  .feedback { padding: 16px; gap: 12px; }
  .feedback-icon { width: 46px; height: 46px; }
  .feedback-title { font-size: 1.1rem; }
  .recovery-steps { grid-template-columns: 1fr; }
  .receipt-parties { grid-template-columns: 1fr; }
  .filters select { flex: 1 1 140px; min-width: 0; }
  .search-input { max-width: none; }
  .lp-nav { display: none; }
  .lp-header-inner { padding: 10px 16px; gap: 10px; }
  .lp-login { display: none; }
  .lp-hero-inner { padding: 28px 16px 40px; }
  .lp-section { padding: 52px 16px; }
  .feature-grid { grid-template-columns: 1fr; }
  .mock-dash-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .mock-tile strong { font-size: 1.3rem; }
  .lp-cta { margin: 0 12px 48px; padding: 40px 18px; border-radius: 20px; }
  .ls-date { font-size: 1.7rem; }

  .banner { padding: 8px 14px; font-size: .82rem; }
  .banner .btn-sm { min-height: 30px; padding: 0 10px; font-size: .8rem; }
  .banner-long { display: none; }
  .banner-info .banner-text { flex: 1 1 200px; display: block; }
  .banner-info .banner-text .icon { vertical-align: -3px; }
  .console-head { margin-bottom: 12px; }
  .console-title p { display: none; }
  .console-title { gap: 10px; }
  .location-select { flex: 1 1 auto; }
  .location-select select { width: 100%; }
  .qty-label { width: auto; }
  .stepper input { width: 62px; min-height: 50px; font-size: 1.4rem; }
  .stepper-btn { width: 48px; height: 50px; }
  .qty-chips .chip { min-width: 44px; padding: 8px 10px; }

  /* Tables become stacked cards */
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table-cards tbody tr:last-child { border-bottom: 0; }
  .table-cards td { padding: 3px 0; border: 0; text-align: left !important; display: flex; justify-content: space-between; gap: 12px; }
  .table-cards td[data-label]::before { content: attr(data-label); font-size: .78rem; color: var(--muted); font-weight: 600; flex: none; max-width: 45%; }
  .table-cards td:first-child { display: block; padding-bottom: 6px; }
  .table-cards td:first-child::before { display: none; }
  .table-cards td > * { text-align: right; }
  .table-cards td:first-child > * { text-align: left; }
  .table-cards td.actions { width: 100%; justify-content: flex-end; padding-top: 8px; }
  .table tbody tr:hover td { background: transparent; }
  .table-cards td.hide-sm { display: none; }
  .table-compact tr { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; }
  .table-compact td:first-child { grid-column: 1 / -1; padding-bottom: 2px; }
  .table-compact td[data-label]::before { display: none; }
  .table-compact td { justify-content: flex-start; }
  .table-compact td:last-child { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
