/*
 * Parking Management — component stylesheet (plain CSS, no build step).
 * Component vocabulary: neutral zinc surfaces, compact 13px Geist type, outline buttons,
 * card header strips, toned metric tiles and badges, icon-tile navigation, sun/moon switch,
 * stacked toasts. Parking green is the single accent.
 */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('./fonts/geist-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('./fonts/geist-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+20B1, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  --background: #ffffff;
  --foreground: #09090b;
  --card: #ffffff;
  --muted: #f4f4f5;
  --muted-foreground: #71717a;
  --accent: #f4f4f5;
  --border: #e4e4e7;
  --input: #e4e4e7;
  --ring: #a1a1aa;
  --brand: #0b7a45;
  --brand-strong: #075f35;
  --brand-foreground: #ffffff;
  --success: #168a42;
  --warning: #c26a04;
  --info: #2563eb;
  --danger: #dc2626;
  --sidebar: #fafafa;
  --page: #f8f8f8;
  --lane: rgba(9, 9, 11, 0.06);
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.08);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.08);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 8px;
  --ease: cubic-bezier(0.22, 0.9, 0.3, 1);
  color-scheme: light;
}
html[data-theme='dark'] {
  --background: #09090b;
  --foreground: #fafafa;
  --card: #0e0e11;
  --muted: #27272a;
  --muted-foreground: #a1a1aa;
  --accent: #27272a;
  --border: #27272a;
  --input: #2f2f33;
  --ring: #71717a;
  --brand: #2fbf71;
  --brand-strong: #46d386;
  --brand-foreground: #052e16;
  --success: #34c46a;
  --warning: #f5a524;
  --info: #5b9bff;
  --danger: #ef4d4d;
  --sidebar: #0c0c0e;
  --page: #09090b;
  --lane: rgba(255, 255, 255, 0.05);
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
  --shadow-md: 0 4px 10px -2px rgb(0 0 0 / 0.6);
  --shadow-lg: 0 12px 24px -6px rgb(0 0 0 / 0.7);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*,
::before,
::after {
  box-sizing: border-box;
  border-color: var(--border);
}
html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--foreground);
  font: 400 13px/1.5 'Geist', ui-sans-serif, system-ui, 'Segoe UI', sans-serif;
  font-feature-settings: 'cv11', 'ss01';
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  margin-bottom: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
h2 {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h3 {
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
}
p {
  margin-bottom: 12px;
}
a {
  color: inherit;
}
small {
  font-size: 11px;
  color: var(--muted-foreground);
}
hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}
::selection {
  background: color-mix(in oklab, var(--brand) 22%, transparent);
}
[hidden] {
  display: none !important;
}
.muted {
  color: var(--muted-foreground);
}
.tabular {
  font-variant-numeric: tabular-nums;
}
svg.i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Buttons ---------- */
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--input);
  border-radius: 6px;
  background: var(--background);
  color: var(--foreground);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  box-shadow: var(--shadow-xs);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
}
button:hover,
.btn:hover {
  background: var(--accent);
}
button:active,
.btn:active {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.5;
  pointer-events: none;
}
.btn.primary,
button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--brand-foreground);
  box-shadow: var(--shadow-sm);
}
.btn.primary:hover,
button.primary:hover {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
}
.btn.danger,
button.danger {
  border-color: color-mix(in oklab, var(--danger) 28%, transparent);
  color: var(--danger);
}
.btn.danger:hover,
button.danger:hover {
  background: color-mix(in oklab, var(--danger) 10%, transparent);
}
.btn.small,
button.small {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}
.btn.ghost,
.icon-btn,
.menu-toggle {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.btn.ghost:hover,
.icon-btn:hover,
.menu-toggle:hover {
  background: var(--accent);
}
.icon-btn,
.menu-toggle {
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--muted-foreground);
}
.icon-btn:hover,
.menu-toggle:hover {
  color: var(--foreground);
}
.icon-btn svg.i,
.menu-toggle svg.i {
  width: 16px;
  height: 16px;
}
.btn.block {
  width: 100%;
  height: 36px;
}
.link-btn {
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--brand);
  font-weight: 500;
}
.link-btn:hover {
  background: none;
  text-decoration: underline;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.btn-group {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in oklab, var(--muted) 60%, transparent);
}
.btn-group .btn {
  height: 26px;
  padding: 0 9px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted-foreground);
  font-size: 11.5px;
}
.btn-group .btn:hover {
  background: var(--background);
  color: var(--foreground);
  box-shadow: var(--shadow-xs);
}

/* ---------- Form controls ---------- */
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--input);
  border-radius: 6px;
  background: var(--background);
  color: var(--foreground);
  font: inherit;
  font-size: 13px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea {
  height: auto;
  min-height: 64px;
  padding: 6px 10px;
}
input.readonly,
input[readonly] {
  background: color-mix(in oklab, var(--muted) 55%, transparent);
  color: var(--muted-foreground);
  cursor: default;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted-foreground);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 22%, transparent);
}
button:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 35%, transparent);
}
input[type='checkbox'] {
  width: 16px;
  height: 16px;
  padding: 0;
  box-shadow: none;
  cursor: pointer;
  accent-color: var(--brand);
}
input[type='file'] {
  padding: 3px 4px;
  font-size: 12px;
}
input[type='file']::file-selector-button {
  height: 24px;
  margin-right: 10px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  background: var(--muted);
  color: var(--foreground);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.field {
  display: grid;
  gap: 6px;
  align-content: start;
}
.field > span {
  font-size: 12px;
  font-weight: 500;
  color: color-mix(in oklab, var(--foreground) 88%, transparent);
}
.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.form-stack {
  display: grid;
  gap: 14px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-grid > .full,
.form-grid > .check-field {
  grid-column: 1 / -1;
}
.hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted-foreground);
}
.input-icon {
  position: relative;
}
.input-icon > svg.i {
  position: absolute;
  left: 10px;
  top: 50%;
  translate: 0 -50%;
  color: var(--muted-foreground);
  pointer-events: none;
}
.input-icon > input {
  padding-left: 32px;
}
.error {
  padding: 8px 12px;
  border: 1px solid color-mix(in oklab, var(--danger) 25%, transparent);
  border-radius: 6px;
  background: color-mix(in oklab, var(--danger) 9%, transparent);
  color: var(--danger);
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* ---------- Surfaces ---------- */
.card {
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.card-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  margin: 0;
  font-size: 13px;
  line-height: 20px;
}
.card-head h2 svg.i {
  width: 16px;
  height: 16px;
  color: var(--muted-foreground);
}
.card-body {
  padding: 16px;
}
.card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  background: color-mix(in oklab, var(--muted) 35%, transparent);
  font-size: 12px;
  color: var(--muted-foreground);
}
.card-foot.end {
  justify-content: flex-end;
}
.card-foot > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
}
.badge.tone-good,
.badge.tone-warn,
.badge.tone-bad,
.badge.tone-info {
  --t: var(--success);
  border-color: color-mix(in oklab, var(--t) 22%, transparent);
  background: color-mix(in oklab, var(--t) 10%, transparent);
  color: var(--t);
}
.badge.tone-good::before,
.badge.tone-warn::before,
.badge.tone-bad::before,
.badge.tone-info::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge.tone-warn {
  --t: var(--warning);
}
.badge.tone-bad {
  --t: var(--danger);
}
.badge.tone-info {
  --t: var(--info);
}

/* ---------- Tables ---------- */
.tablewrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead {
  background: color-mix(in oklab, var(--muted) 45%, transparent);
}
th {
  height: 34px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
td:has(details) {
  white-space: normal;
}
td small {
  display: block;
}
tbody tr {
  transition: background-color 0.15s;
  animation: pk-fade 0.3s ease both;
}
tbody tr:hover {
  background: color-mix(in oklab, var(--muted) 45%, transparent);
}
tbody tr:last-child td {
  border-bottom: 0;
}
td .actions {
  flex-wrap: nowrap;
  gap: 6px;
}
.cell-main {
  font-weight: 500;
}
.mono {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 12px;
}
details summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 500;
}
pre.details {
  max-width: 460px;
  margin: 8px 0 0;
  padding: 8px;
  border-radius: 6px;
  background: var(--muted);
  font-size: 11px;
  white-space: pre-wrap;
}

/* Empty / loading states */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--muted-foreground);
}
.empty::before {
  content: '';
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--muted) center / 16px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E");
}
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 16px;
  color: var(--muted-foreground);
}
.loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--foreground);
  border-radius: 50%;
  animation: pk-spin 0.7s linear infinite;
}

/* ---------- Icon tiles (navigation + portals) ---------- */
.tile {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 6px;
  color: var(--c);
  background: color-mix(in oklab, var(--c) 14%, transparent);
  transition: transform 0.2s, background-color 0.2s, color 0.2s;
}
.tile.lg {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}
.tile.lg svg.i {
  width: 20px;
  height: 20px;
}
:root { --c: #64748b; }
.ic-green { --c: #16a34a; }
.ic-emerald { --c: #10b981; }
.ic-teal { --c: #14b8a6; }
.ic-cyan { --c: #06b6d4; }
.ic-sky { --c: #0ea5e9; }
.ic-blue { --c: #3b82f6; }
.ic-indigo { --c: #6366f1; }
.ic-violet { --c: #8b5cf6; }
.ic-pink { --c: #ec4899; }
.ic-rose { --c: #f43f5e; }
.ic-orange { --c: #f97316; }
.ic-amber { --c: #f59e0b; }
.ic-lime { --c: #65a30d; }
.ic-slate { --c: #64748b; }

/* ---------- Brand lockup ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--foreground);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.brand-mark {
  display: block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.brand-logo {
  height: 28px;
  width: auto;
  border-radius: 6px;
  object-fit: contain;
}
.brand-text {
  display: grid;
  min-width: 0;
}
.brand-text strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}
.brand-text small {
  font-size: 11px;
  font-weight: 400;
}

/* ---------- Theme switch ---------- */
.theme-switch {
  position: relative;
  justify-content: flex-start;
  width: 52px;
  height: 28px;
  padding: 2px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--muted) 70%, transparent);
  box-shadow: none;
}
.theme-switch:hover {
  background: var(--muted);
}
.theme-switch > svg.i {
  position: absolute;
  width: 12px;
  height: 12px;
  color: var(--muted-foreground);
  transition: opacity 0.3s, transform 0.3s;
}
.theme-switch > .ts-sun {
  left: 8px;
  opacity: 0;
  transform: scale(0.5);
}
.theme-switch > .ts-moon {
  right: 8px;
}
.theme-switch .thumb {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--background);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--border);
  transition: transform 0.3s cubic-bezier(0.3, 1.5, 0.6, 1);
}
.theme-switch .thumb svg.i {
  position: absolute;
  width: 13px;
  height: 13px;
  transition: opacity 0.3s, transform 0.3s;
}
.theme-switch .thumb .ts-sun {
  color: #f59e0b;
}
.theme-switch .thumb .ts-moon {
  color: #7dd3fc;
  opacity: 0;
  transform: rotate(-90deg) scale(0);
}
html[data-theme='dark'] .theme-switch > .ts-sun {
  opacity: 1;
  transform: none;
}
html[data-theme='dark'] .theme-switch > .ts-moon {
  opacity: 0;
  transform: scale(0.5);
}
html[data-theme='dark'] .theme-switch .thumb {
  transform: translateX(24px);
}
html[data-theme='dark'] .theme-switch .thumb .ts-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0);
}
html[data-theme='dark'] .theme-switch .thumb .ts-moon {
  opacity: 1;
  transform: none;
}
.theme-fade,
.theme-fade * {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

/* ---------- Workspace shell ---------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: 248px;
  border-right: 1px solid var(--border);
  background: var(--sidebar);
  transition: transform 0.2s ease;
}
.sidebar-head {
  display: flex;
  align-items: center;
  height: 52px;
  flex-shrink: 0;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
}
.sidebar nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 12px;
  scrollbar-width: thin;
}
.nav-group {
  padding-top: 12px;
}
.nav-group + .nav-group {
  margin-top: 6px;
  border-top: 1px dashed var(--border);
}
.nav-label {
  display: block;
  margin-bottom: 4px;
  padding: 0 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--muted-foreground) 85%, transparent);
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  color: color-mix(in oklab, var(--foreground) 78%, transparent);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.nav-item + .nav-item {
  margin-top: 1px;
}
.nav-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-item:hover {
  background: var(--accent);
  color: var(--foreground);
}
.nav-item:hover .tile {
  transform: scale(1.08);
  background: color-mix(in oklab, var(--c) 22%, transparent);
}
.nav-item.active {
  background: var(--background);
  color: var(--foreground);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--border);
}
.nav-item.active .tile {
  background: var(--c);
  color: #fff;
}
.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}
.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  background: color-mix(in oklab, var(--brand) 14%, transparent);
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
}
.user-meta {
  display: grid;
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}
.user-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 500;
}
.scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgb(0 0 0 / 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.workspace {
  min-height: 100vh;
  padding-left: 248px;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--background) 82%, transparent);
  backdrop-filter: blur(10px);
}
.crumbs {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
}
.crumbs span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted-foreground);
}
.crumbs span:last-child {
  font-weight: 500;
  color: var(--foreground);
}
.crumbs .sep {
  color: color-mix(in oklab, var(--muted-foreground) 50%, transparent);
}
.vsep {
  width: 1px;
  height: 20px;
  margin: 0 4px;
  flex-shrink: 0;
  background: var(--border);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted-foreground);
  font-size: 12px;
  white-space: nowrap;
}
.chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--success) 20%, transparent);
}
.menu-toggle {
  display: none;
}
.content {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 22px 24px 40px;
  animation: pk-rise 0.32s var(--ease) both;
}
.pagehead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.pagehead-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.pagehead p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted-foreground);
}
#page-error {
  margin-bottom: 16px;
}

/* Filter toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-xs);
}
.toolbar .field {
  flex: 1 1 150px;
}
.toolbar .field.search {
  flex: 2 1 240px;
}
.toolbar .field > span {
  font-size: 11px;
  color: var(--muted-foreground);
}
.toolbar .export {
  margin-left: auto;
}

/* ---------- Metrics ---------- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.metric {
  position: relative;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: pk-rise 0.4s var(--ease) both;
}
.metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.metric small {
  display: block;
  padding-right: 40px;
  font-size: 12px;
  font-weight: 500;
}
.metric strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.metric-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--muted);
  color: var(--muted-foreground);
  transition: transform 0.3s;
}
.metric:hover .metric-icon {
  transform: rotate(-6deg) scale(1.1);
}
.metric-icon svg.i {
  width: 16px;
  height: 16px;
}
.t-brand { background: color-mix(in oklab, var(--brand) 12%, transparent); color: var(--brand); }
.t-good { background: color-mix(in oklab, var(--success) 12%, transparent); color: var(--success); }
.t-warn { background: color-mix(in oklab, var(--warning) 12%, transparent); color: var(--warning); }
.t-info { background: color-mix(in oklab, var(--info) 12%, transparent); color: var(--info); }
.t-bad { background: color-mix(in oklab, var(--danger) 12%, transparent); color: var(--danger); }
.metric-grid > :nth-child(2) { animation-delay: 40ms; }
.metric-grid > :nth-child(3) { animation-delay: 80ms; }
.metric-grid > :nth-child(4) { animation-delay: 120ms; }
.metric-grid > :nth-child(n + 5) { animation-delay: 160ms; }

/* Charts */
.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px;
}
.bar-row {
  display: grid;
  grid-template-columns: 84px 1fr 96px;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  font-size: 12px;
}
.bar-row > span {
  color: var(--muted-foreground);
}
.bar-row > strong {
  text-align: right;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--muted);
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--brand);
  transform-origin: left;
  animation: pk-grow 0.6s var(--ease) both;
}
.split-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.split-row:last-child {
  border-bottom: 0;
}
.split-row strong {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ---------- POS ---------- */
.pos-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.pos-layout > .card:first-child {
  position: sticky;
  top: 68px;
}
.notice {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  background: color-mix(in oklab, var(--muted) 60%, transparent);
  font-size: 12px;
  color: var(--muted-foreground);
}
.notice svg.i {
  margin-top: 2px;
}
#entry-result:not(:empty) {
  display: grid;
}
.summary-panel {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: color-mix(in oklab, var(--muted) 40%, transparent);
}
.summary-panel strong {
  font-size: 15px;
}

/* Rates */
.rate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}
.rate-tile {
  display: flex;
  flex-direction: column;
  margin: 0;
  animation: pk-rise 0.4s var(--ease) both;
  transition: transform 0.2s, box-shadow 0.2s;
}
.rate-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.rate-tile .card-body {
  flex: 1;
}
.rate-tile .amount {
  margin: 10px 0 4px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.rate-tile .card-body p {
  margin: 0;
  font-size: 12px;
  color: var(--muted-foreground);
}

/* Static info rows */
.detail {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.detail:last-child {
  border-bottom: 0;
}
.detail > strong {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
}

/* ---------- Dialogs ---------- */
dialog {
  width: calc(100% - 32px);
  max-width: 560px;
  max-height: 90vh;
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--background);
  color: var(--foreground);
  box-shadow: var(--shadow-lg);
}
dialog::backdrop {
  background: rgb(0 0 0 / 0.55);
  backdrop-filter: blur(2px);
}
dialog[open] {
  animation: pk-zoom 0.15s ease-out;
}
.dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}
.dialog-head h2 {
  margin: 0;
  font-size: 14px;
}
.dialog-body {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
}
.dialog-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin: 4px -20px -18px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--muted) 35%, transparent);
}
.image-dialog img {
  display: block;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 6px;
}

/* ---------- Toasts ---------- */
#toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  display: grid;
  gap: 8px;
  max-width: calc(100vw - 32px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 356px;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: pk-toast 0.25s var(--ease);
}
.toast-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
}
.toast-icon svg.i {
  width: 12px;
  height: 12px;
  stroke-width: 3;
}
.toast-error .toast-icon {
  background: var(--danger);
}
.toast-message {
  flex: 1;
  line-height: 1.4;
}
.toast .icon-btn {
  width: 24px;
  height: 24px;
}
.toast.leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}

/* ---------- Public pages: launcher, sign-in, scanner ---------- */
.lot {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
}
/* Painted parking-bay lines and a soft green glow */
.lot::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    repeating-linear-gradient(90deg, var(--lane) 0 2px, transparent 2px 120px),
    linear-gradient(to bottom, transparent 0 72%, var(--page) 100%);
  mask-image: linear-gradient(to bottom, #000 0, transparent 46%);
}
.lot::after {
  content: '';
  position: absolute;
  top: -280px;
  left: 50%;
  z-index: -1;
  width: 820px;
  height: 520px;
  translate: -50% 0;
  border-radius: 50%;
  background: color-mix(in oklab, var(--brand) 16%, transparent);
  filter: blur(110px);
}
.lot-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 24px;
}
.lot-main {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 24px 40px;
}
.lot-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  padding: 20px 24px 28px;
  font-size: 12px;
  color: var(--muted-foreground);
}
.lot-foot a {
  text-decoration: none;
}
.lot-foot a:hover {
  color: var(--foreground);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--background);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted-foreground);
  box-shadow: var(--shadow-xs);
}
.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}
.hero {
  max-width: 620px;
  margin: 6vh auto 36px;
  text-align: center;
  animation: pk-rise 0.5s var(--ease) both;
}
.hero h1 {
  font-size: clamp(28px, 4.2vw, 40px);
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.hero p {
  margin: 12px auto 0;
  max-width: 460px;
  font-size: 14px;
  color: var(--muted-foreground);
}
.hero .logo {
  display: block;
  max-height: 64px;
  margin: 0 auto 18px;
}
.hero .app-logo {
  width: 72px;
  height: 72px;
  max-height: none;
}
.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.portal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  animation: pk-rise 0.45s var(--ease) both;
}
.portal-card:nth-child(2) { animation-delay: 60ms; }
.portal-card:nth-child(3) { animation-delay: 120ms; }
.portal-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in oklab, var(--c) 45%, var(--border));
  box-shadow: var(--shadow-md);
}
.portal-card:hover .tile {
  background: var(--c);
  color: #fff;
}
.portal-card h2 {
  margin: 0;
  font-size: 15px;
}
.portal-card p {
  flex: 1;
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted-foreground);
}
.portal-go {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
}
.portal-go svg.i {
  transition: transform 0.2s;
}
.portal-card:hover .portal-go {
  color: var(--foreground);
}
.portal-card:hover .portal-go svg.i {
  transform: translateX(3px);
}

/* Sign-in */
.auth-wrap {
  display: grid;
  place-items: center;
  flex: 1;
  padding: 16px 16px 40px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  margin: 0;
  overflow: hidden;
  animation: pk-rise 0.35s var(--ease) both;
}
.auth-card .card-head {
  gap: 12px;
  padding: 16px 20px;
}
.auth-card .card-head > div {
  flex: 1;
}
.auth-card .card-head h1 {
  font-size: 17px;
}
.auth-card .card-head p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted-foreground);
}
.auth-card .card-body {
  padding: 20px;
}
.auth-card input {
  height: 36px;
}
.auth-card .card-foot {
  justify-content: space-between;
  padding: 12px 20px;
}
.auth-card .card-foot a {
  text-decoration: none;
  font-weight: 500;
}
.auth-card .card-foot a:hover {
  color: var(--foreground);
}
.auth-stripe {
  height: 4px;
  background: repeating-linear-gradient(135deg, var(--c, var(--brand)) 0 12px, transparent 12px 20px);
  opacity: 0.85;
}

/* Scanner kiosk */
.kiosk {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: 16px;
  align-items: start;
}
.kiosk-side {
  display: grid;
  gap: 16px;
}
.kiosk-side .card {
  margin: 0;
}
.camera-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  max-height: 480px;
  overflow: hidden;
  border-radius: 8px;
  background: #09090b;
}
.camera-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.camera-guide {
  position: absolute;
  inset: 16% 26%;
  border-radius: 16px;
  pointer-events: none;
  background:
    linear-gradient(var(--brand), var(--brand)) top left / 28px 3px,
    linear-gradient(var(--brand), var(--brand)) top left / 3px 28px,
    linear-gradient(var(--brand), var(--brand)) top right / 28px 3px,
    linear-gradient(var(--brand), var(--brand)) top right / 3px 28px,
    linear-gradient(var(--brand), var(--brand)) bottom left / 28px 3px,
    linear-gradient(var(--brand), var(--brand)) bottom left / 3px 28px,
    linear-gradient(var(--brand), var(--brand)) bottom right / 28px 3px,
    linear-gradient(var(--brand), var(--brand)) bottom right / 3px 28px;
  background-repeat: no-repeat;
}
.camera-guide::after {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  height: 2px;
  background: color-mix(in oklab, var(--brand) 70%, transparent);
  box-shadow: 0 0 12px var(--brand);
  animation: pk-scan 2.4s ease-in-out infinite;
}
.camera-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: #a1a1aa;
  font-size: 12px;
  pointer-events: none;
}
.camera-empty svg.i {
  width: 28px;
  height: 28px;
}
.camera-frame.live .camera-empty {
  display: none;
}
.camera-select {
  width: auto;
  max-width: 220px;
  height: 28px;
  font-size: 12px;
}
#camera-status {
  margin: 12px 0;
  font-size: 12.5px;
  color: var(--muted-foreground);
}
.steps {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  background: color-mix(in oklab, var(--brand) 12%, transparent);
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
}
.steps li + li::after {
  content: '';
  position: absolute;
  left: 10px;
  top: -6px;
  width: 2px;
  height: 12px;
  background: var(--border);
}
.scan-result:not(:empty) {
  padding: 14px 16px;
  border: 1px solid color-mix(in oklab, var(--success) 25%, transparent);
  border-radius: 8px;
  background: color-mix(in oklab, var(--success) 9%, transparent);
  animation: pk-zoom 0.2s ease-out;
}
.scan-result h2 {
  margin: 0 0 2px;
  color: var(--success);
  font-size: 15px;
}
.scan-result p {
  margin: 0;
}
.scan-result.error {
  border-color: color-mix(in oklab, var(--danger) 25%, transparent);
  background: color-mix(in oklab, var(--danger) 9%, transparent);
  color: var(--danger);
}

.upload-drop {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 18px 12px;
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  background: color-mix(in oklab, var(--muted) 35%, transparent);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.upload-drop:hover,
.upload-drop.dragging {
  border-color: var(--brand);
  background: color-mix(in oklab, var(--brand) 7%, transparent);
}
.upload-drop svg.i {
  color: var(--brand);
}
.upload-drop strong {
  font-size: 13px;
  font-weight: 500;
}
.upload-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.upload-drop:has(input:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}
.upload-drop:focus-within {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 22%, transparent);
}

/* Document / privacy */
.doc-card {
  max-width: 720px;
  margin: 8px auto 0;
}
.doc-card .card-body p {
  font-size: 13.5px;
  line-height: 1.65;
}

/* ---------- Thermal print documents ---------- */
.print-document {
  min-height: 100vh;
  padding: 24px 16px;
}
.print-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}
.thermal {
  width: var(--paper, 80mm);
  max-width: 100%;
  margin: 0 auto;
  padding: 14px 12px;
  background: #fff;
  color: #000;
  text-align: center;
  font: 600 11.5px/1.45 Arial, Helvetica, sans-serif;
  box-shadow: var(--shadow-lg);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.thermal h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 800;
}
.thermal h3 {
  margin: 10px 0;
  padding: 8px 0;
  border-block: 1px dashed #000;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.thermal p {
  margin: 6px 0;
}
.receipt-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 5px 0;
  text-align: left;
}
.receipt-line strong {
  text-align: right;
  overflow-wrap: anywhere;
}
.qr-image,
#employee-qr {
  display: flex;
  justify-content: center;
  margin: 16px auto;
}
.qr-image img,
#employee-qr img,
#employee-qr canvas {
  max-width: 100%;
  border-radius: 6px;
}
.qr-card {
  margin: 0 auto;
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  text-align: center;
}
.qr-card h3 {
  margin: 0;
  font-size: 15px;
}
.qr-card p {
  margin: 0;
  color: var(--muted-foreground);
}

/* ---------- Text-mode receipt slips (same lines as the thermal printer) ---------- */
/* Monospace sized so the printer's columns fill the printable width: 58 mm → 32 cols, 80 mm → 48 cols. */
.receipt {
  width: calc(32ch + 6mm);
  margin: 0 auto;
  padding: 3mm;
  background: #fff;
  color: #000;
  font: 400 calc(48mm / 32 / 0.6) / 1.25 'Courier New', Consolas, monospace;
  box-shadow: var(--shadow-md);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.receipt[data-width='80'] {
  width: calc(48ch + 6mm);
  font-size: calc(72mm / 48 / 0.6);
}
.receipt .rl {
  min-height: 1.25em;
  white-space: pre;
}
.receipt .c { text-align: center; }
.receipt .b { font-weight: 700; }
.receipt .dh { height: 2.5em; line-height: 2.5em; }
.receipt .dh span { display: inline-block; transform: scaleY(2); }
.receipt .big { font-size: 2em; line-height: 1.25; }
.receipt-logo {
  display: block;
  width: 46%;
  height: auto;
  margin: 0 auto 1.25em;
  filter: grayscale(1);
}
.receipt-qr {
  display: flex;
  justify-content: center;
  margin: 0.6em 0;
}
.receipt-qr canvas {
  width: 55%;
  height: auto;
  image-rendering: pixelated;
}
.receipt-stack {
  display: grid;
  justify-content: center;
  gap: 20px;
  padding: 16px;
  overflow: auto;
  border-radius: 8px;
  background: color-mix(in oklab, var(--muted) 45%, transparent);
}
@media screen {
  .receipt { zoom: 1.45; }
}
.receipt-dialog {
  max-width: 640px;
}
.receipt-dialog .receipt-stack {
  max-height: 58vh;
}
.receipt-actions {
  align-items: center;
}
.receipt-actions .printer-status {
  margin-right: auto;
}
.printer-status {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--muted-foreground);
}
.printer-status.on {
  border-color: color-mix(in oklab, var(--success) 30%, transparent);
  background: color-mix(in oklab, var(--success) 10%, transparent);
  color: var(--success);
}
.printer-status a {
  color: inherit;
  text-decoration: none;
}
.printer-status a:hover {
  color: var(--foreground);
}
.printer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.printer-grid > .card {
  margin-bottom: 16px;
}
.printer-state {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in oklab, var(--muted) 35%, transparent);
}
.printer-state > div {
  display: grid;
}
.printer-state strong {
  font-size: 14px;
}
.printer-dot {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: 50%;
  background: color-mix(in oklab, var(--muted-foreground) 45%, transparent);
}
.printer-dot.on {
  background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--success) 20%, transparent);
}

/* Register status strip on the POS */
.register-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-xs);
  font-size: 13px;
}
.register-strip > span {
  flex: 1;
  min-width: 220px;
}
.register-strip > svg.i {
  width: 16px;
  height: 16px;
}
.register-strip.open {
  border-color: color-mix(in oklab, var(--success) 30%, var(--border));
}
.register-strip.open > svg.i {
  color: var(--success);
}
.register-strip.closed {
  border-color: color-mix(in oklab, var(--warning) 40%, var(--border));
  background: color-mix(in oklab, var(--warning) 7%, var(--card));
}
.register-strip.closed > svg.i {
  color: var(--warning);
}

/* ---------- Motion ---------- */
@keyframes pk-rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes pk-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes pk-zoom {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes pk-toast {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes pk-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes pk-spin {
  to { transform: rotate(360deg); }
}
@keyframes pk-scan {
  0%, 100% { top: 12%; }
  50% { top: 88%; }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1360px) {
  .pos-layout {
    grid-template-columns: 1fr;
  }
  .pos-layout > .card:first-child {
    position: static;
  }
  .pos-layout .form-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pos-layout .form-stack > :is(.check-field, .notice, .error, button, #entry-result) {
    grid-column: 1 / -1;
  }
}
@media (max-width: 640px) {
  .pos-layout .form-stack {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 1180px) {
  .pos-layout,
  .kiosk {
    grid-template-columns: 1fr;
  }
  .pos-layout > .card:first-child {
    position: static;
  }
}
@media (max-width: 1023.98px) {
  .sidebar {
    width: 264px;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .nav-open .sidebar {
    transform: none;
  }
  .nav-open .scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .workspace {
    padding-left: 0;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .topbar {
    padding: 0 12px;
  }
  .content {
    padding: 18px 14px 32px;
  }
  .chart-grid,
  .portal-grid {
    grid-template-columns: 1fr;
  }
  .topbar .hide-sm {
    display: none;
  }
}
@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .toolbar .export {
    margin-left: 0;
  }
  .toolbar > button {
    flex: 1;
  }
  .detail {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .lot-bar,
  .lot-main {
    padding-left: 16px;
    padding-right: 16px;
  }
  .lot-bar .chip,
  .lot-bar .brand-text small {
    display: none;
  }
  .lot-bar .actions {
    flex-wrap: nowrap;
  }
  .auth-card .card-foot > span:last-child {
    display: none;
  }
  .hero {
    margin-top: 2vh;
  }
  .bar-row {
    grid-template-columns: 70px 1fr 84px;
  }
}

/* ---------- Print ---------- */
@media print {
  body {
    background: #fff;
  }
  .no-print,
  #toasts {
    display: none !important;
  }
  .print-document {
    padding: 0;
  }
  .thermal {
    margin: 0 auto;
    padding: 5px;
    box-shadow: none;
  }
  .thermal .qr-image {
    break-inside: avoid;
  }
  .qr-printing body > * {
    display: none !important;
  }
  /* System print from the receipt pop-up: print only the slip, not the page behind it */
  body.print-modal > *:not(.receipt-dialog) {
    display: none !important;
  }
  body.print-modal .receipt-dialog {
    position: static !important;
    display: block !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    animation: none !important;
  }
  body.print-modal .receipt-dialog::backdrop {
    background: transparent !important;
  }
  body.print-modal .receipt-dialog .dialog-head,
  body.print-modal .receipt-actions {
    display: none !important;
  }
  body.print-modal .receipt-dialog .dialog-body,
  body.print-modal .receipt-stack {
    display: block !important;
    max-height: none !important;
    padding: 0 !important;
    background: none !important;
  }
  .receipt {
    margin: 0;
    box-shadow: none;
    zoom: 1;
  }
  .qr-printing #qr-print-region {
    display: block !important;
  }
}
