@import url("theme.css?v=20261026a");

:root {
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
}

/* ========== shadcn-like primitives ========== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0 1rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid transparent;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 2px hsl(214 40% 16% / 0.22);
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn:hover { background: hsl(214 65% 22%); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
[hidden] { display: none !important; }
.btn-block { width: 100%; }
.btn-sm { height: 2rem; padding: 0 0.75rem; font-size: 0.875rem; }
.btn-outline {
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  border-color: hsl(var(--input));
  box-shadow: none;
}
.btn-outline:hover { background: hsl(var(--accent)); border-color: hsl(var(--border)); }
.btn-ghost {
  background: transparent;
  color: hsl(var(--foreground));
  border-color: transparent;
  box-shadow: none;
}
.btn-ghost:hover { background: hsl(var(--accent)); }
.btn-pill {
  border-radius: 9999px;
  height: 2rem;
  padding: 0 0.875rem;
}
.btn-pill.is-active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.btn-pill.is-active:hover { opacity: 0.85; }

.input,
.select,
.textarea,
.field input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.field textarea,
.field select {
  display: flex;
  width: 100%;
  height: 2.25rem;
  padding: 0 0.75rem;
  border: 1px solid hsl(var(--input));
  border-radius: 0.25rem;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  outline: none;
}
.input[hidden],
.select[hidden],
.textarea[hidden],
.btn[hidden],
button[hidden] {
  display: none !important;
}
.textarea,
.field textarea {
  height: auto;
  min-height: 4.5rem;
  padding: 0.5rem 0.75rem;
  resize: vertical;
}
.input:focus,
.select:focus,
.textarea:focus,
.field input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.field textarea:focus,
.field select:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 1px hsl(var(--ring));
}
.input[readonly] { background: hsl(var(--muted) / 0.4); cursor: default; }

/* Hide up/down spinners on number fields */
input[type="number"],
.input[type="number"],
.field input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button,
.input[type="number"]::-webkit-outer-spin-button,
.input[type="number"]::-webkit-inner-spin-button,
.field input[type="number"]::-webkit-outer-spin-button,
.field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Date / time pickers: full-field click opens calendar; no manual typing */
input[type="date"].input,
input[type="datetime-local"].input,
input[type="time"].input,
input[type="date"].is-date-picker,
input[type="datetime-local"].is-date-picker,
input[type="time"].is-date-picker,
.field input[type="date"],
.field input[type="datetime-local"],
.field input[type="time"] {
  position: relative;
  cursor: pointer;
  caret-color: transparent;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0;
}
.label,
label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.label,
.field > label {
  color: hsl(var(--muted-foreground));
}
.panel {
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.field { margin-bottom: 1rem; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 600px) {
  .field-row { grid-template-columns: 1fr; }
}

/* Between cards / card grids: --space-3 (0.75rem). Tab button row is separate (space-4 / 0). */
.card {
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid hsl(var(--border));
}
.card-title { margin: 0; font-size: 1.125rem; font-weight: 700; }
.card-desc { margin: 0.15rem 0 0; font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.card-body { padding: 1rem 1.25rem; }
.card-footer {
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem;
  border-top: 1px solid hsl(var(--border));
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.125rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  text-transform: capitalize;
}
.badge-in,
.badge-ok,
.badge-cash { background: hsl(var(--success-soft)); color: hsl(var(--success)); }
.badge-out,
.badge-danger { background: hsl(var(--destructive) / 0.12); color: hsl(var(--destructive)); }
.badge-warn,
.tk-badge-warn { background: hsl(var(--warning-soft)); color: hsl(var(--warning)); }
.badge-muted { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.badge-card { background: hsl(var(--secondary)); color: hsl(var(--foreground)); }
.badge-bank { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }

.flash {
  padding: 0.75rem 0.9rem;
  border-radius: calc(var(--radius) - 2px);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  border: 1px solid hsl(var(--border));
}
.flash-error { background: hsl(0 84% 97%); color: hsl(var(--destructive)); }
.flash-success { background: hsl(152 76% 95%); color: hsl(152 60% 25%); }
.flash-info { background: hsl(210 100% 96%); color: hsl(215 70% 35%); }

.table-wrap { width: 100%; overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
table.data th,
table.data td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid hsl(var(--border));
  vertical-align: middle;
}
table.data th {
  color: hsl(var(--muted-foreground));
  font-weight: 600;
  white-space: nowrap;
  background: hsl(214 28% 96%);
}
table.data td { font-variant-numeric: tabular-nums; }
table.data tbody tr { background: hsl(var(--card)); }
table.data th .sort-btn,
.rd-table th .sort-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
table.data th .sort-btn::after,
.rd-table th .sort-btn::after {
  content: '↕';
  font-size: 1em;
  opacity: 0.45;
  line-height: 1;
}
table.data th .sort-btn.is-asc::after,
.rd-table th .sort-btn.is-asc::after {
  content: '↑';
  opacity: 1;
  color: hsl(var(--primary));
}
table.data th .sort-btn.is-desc::after,
.rd-table th .sort-btn.is-desc::after {
  content: '↓';
  opacity: 1;
  color: hsl(var(--primary));
}
table.data tbody tr:hover,
.rd-table tbody tr:hover {
  background: hsl(214 42% 96%);
}

.icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}
.icon-sm { width: 0.875rem; height: 0.875rem; }

/* ========== Auth layout ========== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: hsl(var(--muted));
}
@media (min-width: 768px) {
  .auth-body { padding: 2.5rem; }
}
.auth-wrap {
  width: min(48rem, 100%);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.auth-card {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0;
}
@media (min-width: 768px) {
  .auth-card { grid-template-columns: 1fr 1fr; }
}
.auth-card-form { padding: 1.5rem; }
@media (min-width: 768px) {
  .auth-card-form { padding: 2rem; }
}
.auth-aside {
  display: none;
  position: relative;
  min-height: 16rem;
  background: hsl(var(--card));
  border-left: 1px solid hsl(var(--border));
}
@media (min-width: 768px) {
  .auth-aside { display: block; }
}
.auth-aside img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12.5rem;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: contain;
}
.auth-brand { text-align: center; margin-bottom: 0.25rem; }
.auth-brand h1 { margin: 0 0 0.25rem; font-size: 1.5rem; font-weight: 700; }
.auth-legal {
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.4;
  text-wrap: balance;
}
.auth-legal a { text-decoration: underline; text-underline-offset: 4px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 2.75rem; }
.password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 2.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.password-toggle:hover { background: transparent; opacity: 0.85; }

/* ========== App shell (Next DashboardContext dual layout) ========== */

.app-body {
  display: flex;
  min-height: 100vh;
  background: hsl(214 28% 96%);
}

/* Layout mode from html[data-layout] (set before paint via inline script) */
html[data-layout="horizontal"] .shell-sidebar,
html[data-layout="horizontal"] .topbar-vertical { display: none !important; }
html[data-layout="vertical"] .topbar-horizontal,
html[data-layout="vertical"] .breadcrumb-bar { display: none !important; }

.shell-sidebar,
.sidebar {
  width: 16rem;
  flex-shrink: 0;
  background: hsl(var(--sidebar-background));
  color: hsl(var(--sidebar-foreground));
  border-right: 1px solid hsl(var(--sidebar-border));
  display: flex;
  flex-direction: column;
  z-index: 20;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  position: sticky;
  top: 0;
  align-self: flex-start;
  overflow: hidden;
}
.sidebar-header {
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  padding: 0.5rem;
  flex-shrink: 0;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.5rem;
  background: hsl(var(--background));
  border-bottom: 1px solid hsl(var(--border));
  -webkit-overflow-scrolling: touch;
}
.sidebar-nav .nav-link,
.sidebar-nav .nav-group-summary,
.sidebar-nav .nav-sub a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  color: hsl(var(--sidebar-foreground));
  text-decoration: none;
  border: 0;
  background: transparent;
  width: 100%;
  cursor: pointer;
  text-align: left;
}
.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-group-summary:hover,
.sidebar-nav .nav-sub a:hover {
  background: hsl(var(--sidebar-accent));
  color: hsl(var(--sidebar-accent-foreground));
}
.sidebar-nav .nav-link.is-active,
.sidebar-nav .nav-sub a.is-active {
  background: hsl(var(--sidebar-accent));
  font-weight: 550;
}
.sidebar-group-label {
  padding: 0.5rem 0.75rem 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}
.nav-group { margin: 0; }
.nav-group-summary {
  list-style: none;
  justify-content: flex-start;
}
.nav-group-summary::-webkit-details-marker { display: none; }
.nav-group-summary .nav-chevron {
  margin-left: auto;
  transition: transform 0.15s;
}
.nav-group[open] > .nav-group-summary .nav-chevron {
  transform: rotate(90deg);
}
.nav-sub {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding: 0.15rem 0 0.35rem 1.65rem;
}
.nav-sub-row {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.nav-sub-row > a:first-child { flex: 1; min-width: 0; }
.nav-sub-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  color: inherit;
  flex-shrink: 0;
  text-decoration: none;
}
.nav-sub-plus:hover { background: hsl(var(--foreground) / 0.08); }
.nav-group-nested > .nav-group-summary-nested {
  padding-left: 0;
  font-weight: 500;
}
.nav-group-nested > .nav-sub {
  padding-left: var(--space-4);
}
.sidebar-footer {
  padding: 0.5rem;
  background: hsl(var(--background));
  margin-top: auto;
  position: relative;
  flex-shrink: 0;
}

.team-switcher {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border-radius: calc(var(--radius) - 2px);
}
.team-switcher-inline { width: auto; max-width: 14rem; flex-shrink: 0; }
.team-switcher-logo {
  width: 2rem;
  height: 2rem;
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.team-switcher-text {
  display: grid;
  min-width: 0;
  line-height: 1.25;
  text-align: left;
}
.team-switcher-name {
  font-size: 0.875rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.team-switcher-role {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-loadbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 200;
  pointer-events: none;
  background: hsl(var(--primary));
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0;
}
.page-loadbar.is-on { opacity: 1; }
html[data-layout="horizontal"] .page-loadbar { background: #fff; }
@media print { .page-loadbar { display: none !important; } }

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.shell-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: hsl(var(--background));
  backdrop-filter: blur(8px);
  overflow: visible;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 4rem;
  padding: 0 1rem;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  overflow: visible;
}
.topbar-inner {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  overflow: visible;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.topbar-vertical {
  justify-content: space-between;
}

html[data-layout="horizontal"] .shell-header .topbar-horizontal {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-bottom-color: hsl(0 0% 100% / 0.12);
}
html[data-layout="horizontal"] .shell-header .topbar-horizontal .page-title,
html[data-layout="horizontal"] .shell-header .topbar-horizontal .team-switcher-name,
html[data-layout="horizontal"] .shell-header .topbar-horizontal .menubar-trigger,
html[data-layout="horizontal"] .shell-header .topbar-horizontal .menubar-link-top {
  color: hsl(var(--primary-foreground));
}
html[data-layout="horizontal"] .shell-header .topbar-horizontal .team-switcher-role {
  color: hsl(var(--primary-foreground) / 0.75);
}
html[data-layout="horizontal"] .shell-header .topbar-horizontal .icon-btn,
html[data-layout="horizontal"] .shell-header .topbar-horizontal .avatar-btn {
  color: hsl(var(--primary-foreground));
}
html[data-layout="horizontal"] .shell-header .topbar-horizontal .icon-btn:hover,
html[data-layout="horizontal"] .shell-header .topbar-horizontal .avatar-btn:hover,
html[data-layout="horizontal"] .shell-header .topbar-horizontal .menubar-trigger:hover,
html[data-layout="horizontal"] .shell-header .topbar-horizontal .menubar-link-top:hover,
html[data-layout="horizontal"] .shell-header .topbar-horizontal .menubar-item.is-open > .menubar-trigger {
  background: hsl(0 0% 100% / 0.14);
  color: hsl(var(--primary-foreground));
}
html[data-layout="horizontal"] .shell-header .topbar-horizontal .team-switcher-logo {
  background: hsl(0 0% 100% / 0.12);
  border-color: hsl(0 0% 100% / 0.28);
  color: hsl(var(--primary-foreground));
}
html[data-layout="horizontal"] .shell-header .topbar-horizontal .sep-v {
  background: hsl(0 0% 100% / 0.28);
}
html[data-layout="horizontal"] .shell-header .topbar-horizontal .avatar {
  background: hsl(0 0% 100% / 0.18);
  color: hsl(var(--primary-foreground));
}
html[data-layout="horizontal"] .shell-header .topbar-horizontal .breadcrumb a,
html[data-layout="horizontal"] .shell-header .topbar-horizontal .breadcrumb-sep {
  color: hsl(var(--primary-foreground) / 0.75);
}
html[data-layout="horizontal"] .shell-header .topbar-horizontal .breadcrumb a:hover,
html[data-layout="horizontal"] .shell-header .topbar-horizontal .breadcrumb-current {
  color: hsl(var(--primary-foreground));
}

html[data-layout="vertical"] .topbar-vertical .topbar-user { display: none; }
html[data-layout="vertical"] .app-body.sidebar-collapsed .topbar-vertical .topbar-user { display: block; }

html[data-layout="vertical"] .shell-sidebar {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-right-color: hsl(0 0% 100% / 0.12);
}
html[data-layout="vertical"] .sidebar-header,
html[data-layout="vertical"] .sidebar-nav,
html[data-layout="vertical"] .sidebar-footer {
  background: transparent;
  border-color: hsl(0 0% 100% / 0.12);
}
html[data-layout="vertical"] .sidebar-nav .nav-link,
html[data-layout="vertical"] .sidebar-nav .nav-group-summary,
html[data-layout="vertical"] .sidebar-nav .nav-sub a,
html[data-layout="vertical"] .sidebar-group-label,
html[data-layout="vertical"] .team-switcher-name,
html[data-layout="vertical"] .nav-user-name {
  color: hsl(var(--primary-foreground));
}
html[data-layout="vertical"] .team-switcher-role,
html[data-layout="vertical"] .sidebar-group-label,
html[data-layout="vertical"] .shell-sidebar .nav-user-email {
  color: hsl(var(--primary-foreground) / 0.72);
}
html[data-layout="vertical"] .sidebar-nav .nav-link:hover,
html[data-layout="vertical"] .sidebar-nav .nav-group-summary:hover,
html[data-layout="vertical"] .sidebar-nav .nav-sub a:hover,
html[data-layout="vertical"] .sidebar-nav .nav-link.is-active,
html[data-layout="vertical"] .sidebar-nav .nav-sub a.is-active,
html[data-layout="vertical"] .shell-sidebar .nav-user-btn:hover {
  background: hsl(0 0% 100% / 0.12);
  color: hsl(var(--primary-foreground));
}
html[data-layout="vertical"] .team-switcher-logo {
  background: hsl(0 0% 100% / 0.12);
  border-color: hsl(0 0% 100% / 0.28);
  color: hsl(var(--primary-foreground));
}
html[data-layout="vertical"] .shell-sidebar .avatar {
  background: hsl(0 0% 100% / 0.18);
  color: hsl(var(--primary-foreground));
}
html[data-layout="vertical"] .shell-sidebar .dropdown-menu {
  background: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
}
html[data-layout="vertical"] .shell-sidebar .dropdown-menu .nav-user-email {
  color: hsl(var(--muted-foreground));
}
html[data-layout="vertical"] .shell-sidebar .dropdown-menu .nav-user-name,
html[data-layout="vertical"] .shell-sidebar .dropdown-menu .avatar {
  color: hsl(var(--popover-foreground));
}
html[data-layout="vertical"] .shell-sidebar .dropdown-menu .avatar {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.page-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}
.sep-v {
  width: 1px;
  height: 1rem;
  background: hsl(var(--border));
  flex-shrink: 0;
}
.content {
  padding: 0;
  flex: 1;
}
.content-pad { padding: 1rem; }
.content-pad + .content-pad { padding-top: 0; }

.icon-btn,
.avatar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: calc(var(--radius) - 2px);
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
  padding: 0;
}
.icon-btn:hover,
.avatar-btn:hover { background: hsl(var(--accent)); }

/* Horizontal menubar (Next NavMain variant=horizontal) */
.menubar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  gap: 0.15rem;
  overflow: visible;
  padding: 0 0.5rem;
}
.menubar-item { position: relative; flex-shrink: 0; }
.menubar-trigger,
.menubar-link-top {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  height: 2.25rem;
  padding: 0 0.75rem;
  border: 0;
  background: transparent;
  border-radius: calc(var(--radius) - 2px);
  font-size: 1rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.menubar-trigger:hover,
.menubar-link-top:hover,
.menubar-item.is-open > .menubar-trigger {
  background: hsl(var(--accent));
}
.menubar-content,
.menubar-sub-content {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 14rem;
  background: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  box-shadow: 0 8px 24px hsl(var(--foreground) / 0.08);
  padding: 0.25rem;
  z-index: 80;
}
.menubar-content[hidden],
.menubar-sub-content[hidden] {
  display: none !important;
}
.menubar-sub { position: relative; }
.menubar-sub-content {
  top: 0;
  left: calc(100% - 0.15rem);
}
.menubar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  border-bottom: 1px solid hsl(var(--border));
}
.menubar-row:last-child { border-bottom: 0; }
.menubar-link,
.menubar-sub-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 0;
  background: transparent;
  font-size: 1rem;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  border-radius: calc(var(--radius) - 4px);
}
.menubar-link:hover,
.menubar-sub-trigger:hover { text-decoration: underline; }
.menubar-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-right: 0.35rem;
  border-radius: 9999px;
  background: hsl(var(--foreground) / 0.05);
  color: inherit;
  flex-shrink: 0;
}
.menubar-plus:hover { background: hsl(var(--foreground) / 0.1); }

/* Reports mega menu (RepairDesk-style panel) */
.menubar-item-reports {
  position: static;
}
.reports-mega {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: min(56rem, calc(100vw - 2rem));
  min-width: min(56rem, calc(100vw - 2rem));
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: 0 12px 40px hsl(var(--foreground) / 0.12);
}
.reports-mega-toolbar {
  display: flex;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--background));
}
.reports-mega-search {
  position: relative;
  flex: 1;
  min-width: 0;
  margin: 0;
}
.reports-mega-search .icon-sm {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
  pointer-events: none;
}
.reports-mega-search .input {
  width: 100%;
  height: 40px;
  padding-left: var(--space-8);
}
.reports-mega-body {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  min-height: 18rem;
  max-height: min(28rem, calc(100vh - 8rem));
}
.reports-mega-cats {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3);
  border-right: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.35);
  overflow: auto;
}
.reports-mega-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3) var(--space-3);
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: hsl(var(--foreground));
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.reports-mega-cat:hover {
  background: hsl(var(--background));
}
.reports-mega-cat.is-active {
  background: hsl(var(--background));
  box-shadow: 0 0 0 1px hsl(var(--border));
}
.reports-mega-cat .icon-sm {
  color: hsl(var(--muted-foreground));
  flex-shrink: 0;
}
.reports-mega-panels {
  padding: var(--space-5);
  overflow: auto;
  background: hsl(var(--background));
}
.reports-mega-panel[hidden] {
  display: none !important;
}
.reports-mega-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-8);
  row-gap: var(--space-1);
}
.reports-mega-link {
  display: block;
  padding: var(--space-3) var(--space-2);
  border-radius: calc(var(--radius) - 4px);
  color: hsl(var(--foreground));
  font-size: 14px;
  text-decoration: none;
}
.reports-mega-link:hover {
  background: hsl(var(--muted) / 0.5);
  color: hsl(var(--primary));
}
.reports-mega-link.is-hidden {
  display: none;
}
.reports-mega-empty {
  margin: 0;
  padding: var(--space-4);
}
@media (max-width: 900px) {
  .reports-mega {
    left: 0.5rem;
    right: 0.5rem;
    transform: none;
    width: auto;
    min-width: 0;
  }
  .reports-mega-body {
    grid-template-columns: 1fr;
    max-height: min(32rem, calc(100vh - 8rem));
  }
  .reports-mega-cats {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid hsl(var(--border));
  }
  .reports-mega-cat {
    width: auto;
  }
  .reports-mega-grid {
    grid-template-columns: 1fr;
  }
}

.breadcrumb-bar {
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--background));
}
.breadcrumb-bar-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  min-width: 0;
  flex-wrap: wrap;
}
.breadcrumb a { color: hsl(var(--muted-foreground)); }
.breadcrumb a:hover { color: hsl(var(--foreground)); text-decoration: underline; }
.breadcrumb-current { color: hsl(var(--foreground)); font-weight: 500; }
.breadcrumb-sep { color: hsl(var(--muted-foreground)); }

/* Dropdowns (user menus) */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 14rem;
  background: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  box-shadow: 0 8px 24px hsl(var(--foreground) / 0.08);
  padding: 0.35rem;
  z-index: 60;
}
.dropdown-menu-up {
  top: auto;
  bottom: calc(100% + 0.35rem);
  left: 0;
  right: auto;
  width: 100%;
  min-width: 14rem;
}
.dropdown-menu-end { right: 0; left: auto; }
.dropdown-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
}
.dropdown-sep {
  height: 1px;
  background: hsl(var(--border));
  margin: 0.35rem 0;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 0;
  background: transparent;
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.875rem;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}
.dropdown-item:hover { background: hsl(var(--accent)); }
.dropdown-item:disabled { opacity: 0.5; cursor: not-allowed; }
.dropdown-item-danger:hover { color: hsl(var(--destructive)); }
.muted-icon { color: hsl(var(--muted-foreground)); margin-left: auto; width: 0.9rem; height: 0.9rem; }

.apps-menu {
  display: grid;
  grid-template-columns: repeat(3, minmax(10rem, 1fr));
  gap: var(--space-1);
  min-width: 36rem;
  max-width: min(42rem, calc(100vw - 2rem));
  padding: var(--space-3);
}
.apps-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border: 0;
  background: transparent;
  border-radius: calc(var(--radius) - 2px);
  color: inherit;
  text-decoration: none;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.apps-menu-item:hover { background: hsl(var(--accent)); }
.apps-menu-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--muted));
  color: hsl(var(--primary));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.apps-menu-icon .icon { width: 1.1rem; height: 1.1rem; }
@media (max-width: 720px) {
  .apps-menu {
    grid-template-columns: 1fr;
    min-width: 16rem;
  }
}

.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 0;
  background: transparent;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  color: inherit;
  text-align: left;
}
.nav-user-btn:hover { background: hsl(var(--sidebar-accent)); }
.nav-user-meta {
  display: grid;
  min-width: 0;
  flex: 1;
  line-height: 1.25;
}
.nav-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-user-email {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar-lg {
  width: 2rem;
  height: 2rem;
  border-radius: calc(var(--radius) - 2px);
}

.app-body.sidebar-collapsed .shell-sidebar { display: none; }

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: hsl(var(--foreground) / 0.45);
}

@media (max-width: 1023px) {
  html[data-layout="horizontal"] .topbar-horizontal,
  html[data-layout="horizontal"] .breadcrumb-bar { display: none !important; }
  html[data-layout="horizontal"] .topbar-vertical { display: flex !important; }

  .app-body.sidebar-collapsed .shell-sidebar { display: flex; }

  .shell-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    display: flex !important;
    box-shadow: 8px 0 24px hsl(var(--foreground) / 0.18);
  }
  html[data-sidebar-open="true"] .shell-sidebar {
    transform: translateX(0);
  }
  html[data-sidebar-open="true"] {
    overflow: hidden;
  }
  .topbar-vertical .topbar-user { display: none; }
}

/* Settings appearance cards */
.settings-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 1rem 1rem 4rem;
}
@media (min-width: 1024px) {
  .settings-layout-body {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
  }
  .settings-side { width: 20%; min-width: 11rem; flex-shrink: 0; }
  .settings-main { flex: 1; min-width: 0; }
}
.settings-nav { display: flex; flex-direction: column; gap: 0.15rem; }
.settings-nav a {
  padding: 0.5rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.settings-nav a:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }
.settings-nav a.is-active {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  font-weight: 550;
}
.appearance-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 28rem;
  padding-top: 0.5rem;
}
@media (min-width: 768px) {
  .appearance-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
.appearance-option {
  cursor: pointer;
  display: block;
}
.appearance-option input { position: absolute; opacity: 0; pointer-events: none; }
.appearance-preview {
  border: 2px solid hsl(var(--muted));
  border-radius: calc(var(--radius) - 2px);
  padding: 0.25rem;
  transition: border-color 0.15s;
}
.appearance-option:hover .appearance-preview,
.appearance-option:has(input:checked) .appearance-preview {
  border-color: hsl(var(--primary));
}
.appearance-label {
  display: block;
  text-align: center;
  padding: 0.5rem;
  font-weight: 400;
}
.appearance-mock {
  border-radius: calc(var(--radius) - 4px);
  background: hsl(var(--background));
  padding: 0.5rem;
}
.appearance-mock-vert {
  display: flex;
  height: 7rem;
}
.appearance-mock-vert .rail {
  width: 3.5rem;
  margin-right: 0.5rem;
  background: hsl(var(--foreground) / 0.25);
}
.appearance-mock-vert .pane,
.appearance-mock-horiz .pane {
  flex: 1;
  background: hsl(var(--foreground) / 0.1);
}
.appearance-mock-horiz { display: flex; flex-direction: column; gap: 0.5rem; }
.appearance-mock-horiz .rail { height: 2.5rem; background: hsl(var(--foreground) / 0.25); }
.appearance-mock-horiz .pane { height: 4rem; }

/* ========== Dashboard widgets ========== */

.dash-range {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
}
.dash-range-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 2.25rem;
  padding: 0 var(--space-4);
  border-radius: 999px;
  border: 1px solid hsl(var(--input));
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
}
.dash-range-btn:hover {
  background: hsl(var(--accent));
  border-color: hsl(var(--border));
}
.dash-range-btn[aria-expanded="true"] {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.15);
}
.dash-range-chevron {
  opacity: 0.7;
}
.dash-range-menu {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2));
  z-index: 40;
  min-width: 16rem;
  padding: var(--space-2);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0;
}
.dash-range-menu[hidden] { display: none !important; }
.dash-range-preset {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
}
.dash-range-preset:hover {
  background: hsl(var(--accent));
}
.dash-range-preset.is-active {
  background: hsl(var(--accent));
  color: hsl(var(--primary));
}
.dash-range-custom {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-2);
  padding: var(--space-3);
  border-top: 1px solid hsl(var(--border));
}
.dash-range-custom-title {
  font-size: 0.875rem;
  font-weight: 600;
}
.dash-range-custom .field { margin-bottom: 0; }
.dash-range-apply {
  width: 100%;
  border-radius: 999px;
  margin-top: var(--space-1);
}
.dash-need-repair-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.dash-split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}
@media (min-width: 800px) {
  .dash-split-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .dash-split-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.dash-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.dash-col-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
.dash-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  padding: 0;
  cursor: help;
}
.dash-info .icon { width: 16px; height: 16px; }
.dash-info:hover,
.dash-info:focus-visible {
  border-color: hsl(var(--primary));
  color: hsl(var(--primary));
  outline: none;
}
.dash-daily-scroll { max-height: 24rem; overflow: auto; }
.dash-daily-scroll thead th {
  position: sticky;
  top: 0;
  background: hsl(var(--card));
  z-index: 1;
}
.dash-daily-check { width: 40px; }
.dash-daily-action { width: 40px; text-align: right; }
.dash-row-dl {
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  cursor: pointer;
}
.dash-row-dl:hover,
.dash-row-dl:focus-visible {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
  outline: none;
}
.kpi-value.is-positive { color: hsl(var(--primary)); }
.kpi-value.is-negative { color: hsl(var(--destructive)); }
.dash-type-child-label { padding-left: var(--space-5) !important; color: hsl(var(--muted-foreground)); }
.dash-stock-banner {
  margin: 0 var(--space-4) var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: hsl(var(--destructive) / 0.12);
  color: hsl(var(--destructive));
  font-size: 0.875rem;
  font-weight: 500;
}
.dash-pay-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  align-items: stretch;
}
@media (min-width: 900px) {
  .dash-pay-row {
    grid-template-columns: minmax(0, 1fr) minmax(12rem, 16rem);
    gap: var(--space-6);
  }
}
.dash-pay-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}
.dash-pay-methods,
.dash-pay-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0;
  align-items: start;
}
.dash-pay-col {
  display: grid;
  gap: var(--space-1);
  padding: 0 var(--space-4);
  min-width: 0;
}
.dash-pay-methods .dash-pay-col:first-child,
.dash-pay-totals .dash-pay-col:first-child {
  padding-left: 0;
}
.dash-pay-methods .dash-pay-col + .dash-pay-col,
.dash-pay-totals .dash-pay-col + .dash-pay-col {
  border-left: 1px solid hsl(var(--border));
}
.dash-pay-name {
  font-size: 14px;
  font-weight: 600;
  color: hsl(var(--primary));
}
.dash-pay-total {
  font-size: 18px;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-top: 4px;
}
.dash-pay-io { font-size: 14px; }
.dash-pay-col-out .dash-pay-name,
.dash-pay-col-out .dash-pay-total {
  color: hsl(var(--destructive));
}
.dash-pay-totals {
  padding-top: var(--space-4);
  border-top: 1px solid hsl(var(--border));
}
.dash-pay-chart-wrap {
  position: relative;
  height: 200px;
  width: 100%;
  border-left: none;
  padding-left: 0;
}
@media (min-width: 900px) {
  .dash-pay-chart-wrap {
    border-left: 1px solid hsl(var(--border));
    padding-left: var(--space-5);
  }
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}
@media (min-width: 768px) {
  .kpi-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); }
}
.kpi {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: var(--space-3);
  background: hsl(var(--card));
  box-shadow: var(--shadow);
  min-width: 0;
}
.kpi-label {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-1);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25;
  color: hsl(var(--muted-foreground));
}
.kpi-sub {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}
.kpi-value {
  margin-top: var(--space-2);
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}
@media (min-width: 1280px) {
  .kpi-value { font-size: 0.9375rem; }
}
.kpi-wide { grid-column: span 1; }

.dash-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}
@media (min-width: 1280px) {
  .dash-two-col { grid-template-columns: 1fr 1fr; }
}

.chart-wrap {
  position: relative;
  height: 250px;
  width: 100%;
  padding: 0.5rem 0.25rem 0;
}
.chart-wrap-sm { height: 200px; }
.chart-wrap-donut { height: 200px; width: 200px; margin: 0 auto; }

/* Dashboard tabs + Store / Business KPIs */
:root {
  --dash-trend-up: #16a34a;
  --dash-trend-down: #dc2626;
}
#dashboard-page .content-pad + .content-pad {
  padding-top: 0;
}
/* Tab buttons only: space-4 above, 0 below */
#dashboard-page > .content-pad.dash-tabs-pad {
  padding-top: var(--space-4);
  padding-bottom: 0;
}
#dashboard-page .stack {
  gap: var(--space-3);
}
.dash-tabs-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.dash-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0;
  min-width: 0;
}
.dash-tabs-row > .dash-range {
  margin-left: auto;
}
.rd-date-range-host {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}
.rd-list-actions .rd-date-range-host {
  flex-shrink: 0;
}
.rd-chips-bar:not(:has(.rd-chips)):not(:has(.tk-bulk:not([hidden]))) {
  display: none;
}
.dash-tab {
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  border-radius: 999px;
  padding: var(--space-2) var(--space-5);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
}
.dash-tab.is-active {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.dash-section-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 var(--space-3);
}
.dash-store-section + .dash-store-section {
  margin-top: var(--space-3);
}
.dash-store-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.dash-store-head-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  font-size: 14px;
}
.dash-store-top,
.dash-store-lower {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  align-items: start;
}
@media (min-width: 1100px) {
  .dash-store-top {
    grid-template-columns: minmax(14rem, 18rem) minmax(0, 1.4fr) minmax(16rem, 20rem);
  }
  .dash-store-lower {
    grid-template-columns: minmax(14rem, 18rem) minmax(0, 1.2fr) minmax(16rem, 20rem);
  }
}
.dash-store-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}
.dash-store-chart-card { min-height: 100%; }
.chart-wrap-store-visitors {
  height: 280px;
}
.dash-trend-grid,
.dash-biz-extra {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}
@media (min-width: 900px) {
  .dash-biz-extra { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.dash-trend-card {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: flex-start;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: 0 1px 2px hsl(var(--foreground) / 0.04);
}
.dash-trend-card.is-unavailable { opacity: 0.85; }
.dash-trend-label {
  font-size: 14px;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: var(--space-2);
}
.dash-trend-value {
  font-size: 24px;
  font-weight: 600;
  color: hsl(var(--primary));
  line-height: 1.2;
}
.dash-trend-sub {
  margin-top: var(--space-1);
  font-size: 14px;
}
.dash-trend-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
  min-width: 4.5rem;
}
.dash-trend-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.dash-trend-pill.is-up { background: var(--dash-trend-up); }
.dash-trend-pill.is-down { background: var(--dash-trend-down); }
.dash-side-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  font-size: 14px;
}
.dash-performer {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: var(--space-3);
  align-items: center;
}
.dash-performer-rank {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.dash-performer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
}
.dash-performer-name { font-size: 14px; font-weight: 600; }
.dash-performer-sales { font-size: 14px; font-weight: 600; color: hsl(var(--primary)); }
.dash-tech-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: var(--space-4);
}
.dash-tech-stats { margin-left: auto; text-align: right; }
.dash-tech-value {
  font-size: 18px;
  font-weight: 600;
  color: hsl(var(--primary));
}
.dash-pay-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.dash-pay-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  flex-shrink: 0;
}
.dash-pay-item-meta { flex: 1; min-width: 0; }
.dash-pay-item-amt { font-weight: 600; white-space: nowrap; }

.dash-biz-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  align-items: stretch;
  margin-bottom: var(--space-3);
}
@media (min-width: 1100px) {
  .dash-biz-top {
    grid-template-columns: minmax(18rem, 26rem) minmax(14rem, 18rem) minmax(0, 1fr);
  }
}
.dash-biz-quad {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}
@media (min-width: 640px) {
  .dash-biz-quad { grid-template-columns: 1fr 1fr; }
}
.dash-biz-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: var(--space-4);
  min-height: 112px;
}
.dash-biz-card.is-primary {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.dash-biz-card-label { font-size: 14px; font-weight: 600; margin-bottom: var(--space-2); }
.dash-biz-card-value { font-size: 28px; font-weight: 600; }
.dash-target-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  height: 100%;
  justify-content: center;
}
.dash-target-illus { color: hsl(var(--muted-foreground)); opacity: 0.55; }
.dash-target-card .field { width: 100%; text-align: left; }
.chart-wrap-biz-profit,
.chart-wrap-biz-health { height: 260px; }
.dash-biz-bottom {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
@media (min-width: 1100px) {
  .dash-biz-bottom { grid-template-columns: minmax(0, 1.5fr) minmax(16rem, 22rem); }
}
.dash-donut-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  justify-content: center;
}
.dash-donut-legend {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.dash-legend-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
}
.dash-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.stack { display: flex; flex-direction: column; gap: 1rem; }
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-3);
}
.company-card {
  position: relative;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  padding: 1.25rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: background 0.15s;
}
.company-card:hover { background: hsl(var(--accent) / 0.5); }
.company-card h3 { margin: 0.25rem 0; font-size: 1.05rem; }
.company-card .badge { align-self: flex-end; }
.company-card .btn { margin-top: 0.75rem; align-self: flex-start; }

.modal {
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 2px);
  padding: 1.25rem;
  width: min(420px, calc(100% - 2rem));
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  box-shadow: 0 16px 48px hsl(var(--foreground) / 0.12);
}
.modal::backdrop { background: hsl(var(--foreground) / 0.45); }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
}

@media print {
  .shell-sidebar, .shell-header, .btn, .preset-row { display: none !important; }
}

/* SHELL-2 notifications */
.notif-root { position: relative; }
.notif-root { position: relative; }
.icon-btn.has-unread,
.icon-btn.has-unread { animation: notif-shake 0.5s ease-in-out 0s 2; }
.notif-dot,
.notif-dot {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 9999px;
  background: hsl(0 84% 60%);
  pointer-events: none;
}
@keyframes notif-shake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(8deg); }
  75% { transform: rotate(-8deg); }
}
.notif-panel,
.notif-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  width: 20rem;
  max-height: 24rem;
  overflow: auto;
  z-index: 60;
  background: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  box-shadow: 0 12px 40px hsl(var(--foreground) / 0.12);
}
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem 0.5rem;
}
.notif-head h4 { margin: 0; font-size: 0.95rem; }
.btn-link {
  background: none;
  border: 0;
  color: hsl(var(--primary));
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0;
}
.notif-sep { height: 1px; background: hsl(var(--border)); }
.notif-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid hsl(var(--border));
  color: inherit;
  text-decoration: none;
}
a.notif-item:hover { background: hsl(var(--accent)); }
.notif-item.is-read { opacity: 0.7; }
.notif-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.notif-icon-repair { background: hsl(var(--chart-1)); }
.notif-icon-message { background: hsl(var(--primary)); }
.notif-icon-inventory { background: hsl(var(--chart-5)); }
.notif-icon-appointment { background: hsl(var(--chart-4)); }
.notif-icon-review { background: hsl(var(--chart-4)); }
.notif-icon-system { background: hsl(var(--muted-foreground)); }
.notif-icon-invitation { background: hsl(var(--primary)); }
.notif-title { font-size: 0.875rem; font-weight: 600; }
.notif-desc { font-size: 0.875rem; color: hsl(var(--muted-foreground)); margin-top: 0.15rem; }
.notif-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; }
.notif-date { font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.notif-dismiss {
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: 0;
  line-height: 0;
}
.notif-empty { padding: 1.5rem; text-align: center; color: hsl(var(--muted-foreground)); font-size: 0.875rem; }

.icon-btn { position: relative; }

.modal.modal-wide { width: min(800px, calc(100% - 2rem)); }
.ti-popup {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.ti-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.ti-popup-head h3 { margin: 0; font-size: 18px; font-weight: 600; }
.ti-popup-head-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}
.ti-popup-x {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}
#od-tradein-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.ti-popup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}
.ti-popup-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid hsl(var(--border));
  border-radius: 0.25rem;
}
.ti-popup-card h4 { margin: 0; font-size: 16px; font-weight: 600; }
.ti-popup-actions,
.ti-popup-ticket {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.ti-popup-link {
  color: hsl(var(--primary));
  font-weight: 600;
  text-decoration: underline;
}
.ti-popup-link:hover { color: hsl(var(--primary)); }
.ti-detail-row,
.ti-detail-line {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
  font-size: 14px;
}
.ti-detail-line { grid-template-columns: minmax(0, 1fr) auto; }
.ti-detail-row span { color: hsl(var(--muted-foreground)); }
.device-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4) var(--space-6);
}
.device-info-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}
.device-info-item span {
  color: hsl(var(--muted-foreground));
  font-size: 14px;
}
.device-info-item strong {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.device-info-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid hsl(var(--border));
}
@media (max-width: 800px) {
  .ti-popup-grid { grid-template-columns: 1fr; }
  .device-info-grid { grid-template-columns: 1fr; }
}

.shift-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.shift-chip:hover {
  background: hsl(var(--accent));
}
.shift-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: hsl(var(--muted-foreground));
  flex-shrink: 0;
}
.shift-chip.is-on .shift-chip-dot {
  background: #22c55e;
}
.shift-chip.is-break .shift-chip-dot {
  background: hsl(var(--destructive));
}
html[data-layout="horizontal"] .shell-header .topbar-horizontal .shift-chip {
  background: hsl(0 0% 100% / 0.12);
  border-color: hsl(0 0% 100% / 0.28);
  color: hsl(var(--primary-foreground));
}
html[data-layout="horizontal"] .shell-header .topbar-horizontal .shift-chip:hover {
  background: hsl(0 0% 100% / 0.2);
}
html[data-layout="horizontal"] .shell-header .topbar-horizontal .shift-chip-dot {
  background: hsl(var(--primary-foreground) / 0.55);
}
html[data-layout="horizontal"] .shell-header .topbar-horizontal .shift-chip.is-on .shift-chip-dot {
  background: #22c55e;
}
html[data-layout="horizontal"] .shell-header .topbar-horizontal .shift-chip.is-break .shift-chip-dot {
  background: #f87171;
}

.shell-shift-panel { gap: 16px; }
.shell-shift-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--muted));
}
.shell-shift-status[data-state="on"] {
  background: hsl(var(--secondary));
  border-color: hsl(var(--border));
}
.shell-shift-status[data-state="break"] {
  background: hsl(var(--destructive) / 0.08);
  border-color: hsl(var(--border));
}
.shell-shift-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.shell-shift-actions .btn {
  width: 100%;
  min-height: 40px;
}
@media (max-width: 480px) {
  .shell-shift-actions { grid-template-columns: 1fr; }
}
.shell-shift-status-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.shell-shift-status-label {
  font-size: 18px;
  font-weight: 600;
}
.shell-shift-elapsed { font-size: 16px; }
.shell-shift-meta { font-size: 14px; }
.shell-shift-recent-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid hsl(var(--border));
}
.shell-shift-row {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid hsl(var(--border));
  font-size: 14px;
}
.shell-shift-row:last-child { border-bottom: 0; }
.form-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.form-grid .span-all { grid-column: 1 / -1; }
.section-title { font-size: 1.05rem; font-weight: 600; margin: 0.25rem 0 0; }
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: var(--space-2) var(--space-4);
}
.check-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
  cursor: pointer;
}
.check-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: hsl(var(--primary));
}
.table-toolbar { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 0; flex-wrap: wrap; }
.col-menu { position: relative; }
.col-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 40;
  width: 12.5rem;
  max-height: 18.75rem;
  overflow: auto;
  background: hsl(var(--popover));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  padding: 0.35rem;
}
.col-menu-list label {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  padding: 0.3rem 0.4rem;
  font-size: 0.875rem;
  text-transform: capitalize;
}
.data td .cell-clip { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-selected { background: hsl(var(--muted) / 0.5); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; flex-wrap: wrap; }
.pager-right { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.toast-stack { position: fixed; right: 1rem; bottom: 1rem; z-index: 80; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  padding: 0.65rem 0.9rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
}
.toast-error {
  background: hsl(0 72% 45%);
  color: #fff;
}
.cust-thumb { width: 2.5rem; height: 2.5rem; object-fit: cover; border-radius: 0.375rem; background: hsl(var(--muted)); }
.preview-wrap { position: relative; display: inline-block; margin-top: 0.5rem; }
.notif-root { position: relative; }
.notif-item.is-read { opacity: 0.7; }
.notif-icon-repair { background: hsl(var(--chart-1)); }
.notif-icon-message { background: hsl(var(--primary)); }
.notif-icon-inventory { background: hsl(var(--chart-5)); }
.notif-icon-appointment { background: hsl(var(--chart-4)); }
.notif-icon-review { background: hsl(var(--chart-4)); }
.notif-icon-system { background: hsl(var(--muted-foreground)); }
.btn-link { background: none; border: 0; color: hsl(var(--primary)); font-size: 0.875rem; cursor: pointer; padding: 0; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem 0.5rem; }
.notif-head h4 { margin: 0; font-size: 0.95rem; }
.notif-sep { height: 1px; background: hsl(var(--border)); }
.notif-body { min-width: 0; }
.notif-list { }
.icon-btn.has-unread { animation: notif-shake 0.5s ease-in-out 0s 2; }
.form-grid { display: grid; gap: 0.75rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .form-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.span-all { grid-column: 1 / -1; }
.section-title { font-size: 1.05rem; font-weight: 600; margin: 0.25rem 0 0; }
.col-menu { position: relative; }
.col-menu-list {
  position: absolute; right: 0; top: calc(100% + 0.35rem); z-index: 40; width: 12.5rem; max-height: 18.75rem;
  overflow: auto; background: hsl(var(--popover)); border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px); padding: 0.35rem;
}
.col-menu-list label { display: flex; gap: 0.4rem; align-items: center; padding: 0.3rem 0.4rem; font-size: 0.875rem; text-transform: capitalize; }
.cust-thumb { width: 2.5rem; height: 2.5rem; object-fit: cover; border-radius: 0.375rem; background: hsl(var(--muted)); }
.preview-wrap { position: relative; display: inline-block; margin-top: 0.5rem; }
.remove-img {
  position: absolute; top: -0.4rem; right: -0.4rem; width: 1.25rem; height: 1.25rem; border: 0;
  border-radius: 9999px; background: #ef4444; color: #fff; cursor: pointer; line-height: 0;
}
.toast-stack { position: fixed; right: 1rem; bottom: 1rem; z-index: 80; display: flex; flex-direction: column; gap: 0.5rem; }
.sort-btn {
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  color: inherit;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
.flash-error { background: hsl(0 84% 97%); color: hsl(var(--destructive)); }
.modal-wide { width: min(800px, calc(100% - 2rem)); }
.row-selected { background: hsl(var(--muted) / 0.5); }
.cell-clip { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
.dropdown-item-danger { color: hsl(var(--destructive)); }
.table-toolbar { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 0; flex-wrap: wrap; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; flex-wrap: wrap; }
.pager-right { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.btn-ghost {
  background: transparent;
  color: hsl(var(--foreground));
  border-color: transparent;
}
.btn-ghost:hover { background: hsl(var(--accent)); }

.stock-type-tabs { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; overflow-x: auto; }
.stock-swatch { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 9999px; margin-right: 0.35rem; vertical-align: middle; }
.stock-color { display: inline-flex; align-items: center; min-width: 6.25rem; }
.stock-qty-low { background: hsl(var(--destructive)); }
.stock-qty-mid { background: hsl(var(--chart-5)); }
.stock-qty-ok { background: hsl(var(--primary)); }
.badge.stock-badge-new { background: hsl(var(--secondary)); color: hsl(var(--primary)); border: 1px solid hsl(var(--border)); text-transform: none; }
.badge.stock-badge-old { background: hsl(var(--muted)); color: hsl(var(--foreground)); border: 1px solid hsl(var(--border)); text-transform: none; }
.badge.stock-badge-acc { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); border: 1px solid hsl(var(--border)); text-transform: none; }
.badge.stock-badge-part { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); border: 1px solid hsl(var(--border)); text-transform: none; }

.media-field { display: flex; flex-direction: column; gap: 0.5rem; }
.media-drop { border: 1px dashed hsl(var(--border)); border-radius: 0.5rem; padding: 1rem; background: hsl(var(--muted) / 0.3); }
.media-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.media-thumb { position: relative; width: 5rem; height: 5rem; border: 1px solid hsl(var(--border)); border-radius: 0.4rem; overflow: hidden; background: hsl(var(--background)); }
.media-thumb img, .media-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-thumb .media-remove { position: absolute; top: 0; right: 0; }
.media-preview .media-list { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.media-preview img { width: 5rem; height: 5rem; object-fit: cover; border-radius: 0.4rem; border: 1px solid hsl(var(--border)); }
.media-doc-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.media-preview-card {
  position: relative;
  display: inline-block;
  max-width: 8rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
  background: hsl(var(--muted));
}
.media-preview-card img { width: 5rem; height: 5rem; border: 0; border-radius: 0; }
.media-preview-card .media-file-name { display: block; padding: var(--space-2); word-break: break-word; }
.media-preview-card .media-remove {
  position: absolute;
  top: var(--space-1);
  right: var(--space-1);
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1;
  cursor: pointer;
}
.media-capture-dialog { width: min(40rem, calc(100% - var(--space-8))); }
.media-capture-dialog video.is-flipped { transform: scaleX(-1); }
#media-capture-flip[aria-pressed="true"] {
  background: hsl(var(--accent));
  border-color: hsl(var(--primary));
}
.media-capture-dialog video:not([hidden]) {
  display: block;
  width: 100%;
  min-height: 12rem;
  max-height: 24rem;
  object-fit: contain;
  background: hsl(var(--foreground));
  border-radius: var(--radius);
}
.media-crop-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
}
.media-crop-stage img {
  width: auto;
  max-width: 100%;
  max-height: 24rem;
  height: auto;
  display: block;
}
.media-crop-box {
  position: absolute;
  border: 2px solid hsl(var(--primary));
  box-shadow: 0 0 0 999px hsl(var(--foreground) / 0.45);
  cursor: move;
  touch-action: none;
}
.media-crop-handle {
  position: absolute;
  width: var(--space-4);
  height: var(--space-4);
  padding: 0;
  border: 2px solid hsl(var(--primary));
  border-radius: var(--radius);
  background: hsl(var(--background));
  touch-action: none;
}
.media-crop-handle[data-handle="nw"] { top: calc(var(--space-2) * -1); left: calc(var(--space-2) * -1); cursor: nwse-resize; }
.media-crop-handle[data-handle="ne"] { top: calc(var(--space-2) * -1); right: calc(var(--space-2) * -1); cursor: nesw-resize; }
.media-crop-handle[data-handle="sw"] { bottom: calc(var(--space-2) * -1); left: calc(var(--space-2) * -1); cursor: nesw-resize; }
.media-crop-handle[data-handle="se"] { bottom: calc(var(--space-2) * -1); right: calc(var(--space-2) * -1); cursor: nwse-resize; }
.filter-panel { border: 1px solid hsl(var(--border)); border-radius: 0.5rem; padding: 1rem; background: hsl(var(--background)); }
.filter-panel.pinned { position: sticky; top: 0; z-index: 5; }
.radio-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.radio-row label { display: flex; align-items: center; gap: 0.35rem; font-weight: 400; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; border: 1px solid hsl(var(--border)); border-radius: 0.5rem; padding: 0.75rem; }
.switch-row > input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: hsl(var(--primary));
  flex-shrink: 0;
}
.btn-danger {
  background: hsl(0 72% 45%);
  color: #fff;
  border: 1px solid hsl(0 72% 40%);
}
.btn-danger:hover { filter: brightness(0.95); }
.switch { position: relative; }
.switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch .switch-ui {
  width: 2.5rem;
  height: 1.4rem;
  border-radius: 999px;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  position: relative;
  flex-shrink: 0;
  transition: background .15s ease;
}
.switch .switch-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
  transition: transform .15s ease;
}
.switch input:checked + .switch-ui {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
}
.switch input:checked + .switch-ui::after {
  transform: translateX(1.05rem);
}
.switch input:disabled + .switch-ui { opacity: 0.6; }
dialog.app-modal.import-modal {
  border: none;
  padding: 0;
  margin: auto;
  background: transparent;
  color: inherit;
  max-width: none;
  box-shadow: none;
}
dialog.app-modal.import-modal::backdrop {
  background: hsl(var(--foreground) / 0.45);
}
.import-dialog {
  width: min(440px, calc(100vw - 2rem));
  margin: 0;
  padding: var(--space-5);
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 2px);
  box-shadow: 0 16px 48px hsl(var(--foreground) / 0.12);
}
.import-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.import-dialog-titles h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}
.import-dialog-titles .muted {
  margin: var(--space-2) 0 0;
  font-size: 0.875rem;
}
.import-dialog-head .ti-popup-x {
  flex: 0 0 auto;
  margin: calc(var(--space-1) * -1) calc(var(--space-1) * -1) 0 0;
}
.import-example {
  margin: 0;
}
.import-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.import-drop-hint {
  font-size: 0.875rem;
}
.import-drop {
  border: 2px dashed hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.import-drop.is-drag {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.08);
}

.repair-block { border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 1rem; background: hsl(var(--card)); }
.ticket-lines { display: flex; flex-direction: column; gap: 0.5rem; }
.ticket-lines-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.ticket-lines-head .card-title { margin: 0; }
.ticket-lines-head .input { max-width: 18rem; height: 2rem; font-size: 0.875rem; }
.ticket-line-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.ticket-line-table th,
.ticket-line-table td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid hsl(var(--border)); vertical-align: middle; }
.ticket-line-table th { color: hsl(var(--muted-foreground)); font-weight: 500; font-size: 0.875rem; }
.ticket-line-table .input { height: 2rem; font-size: 0.875rem; }
.ticket-line-empty { margin: 0; padding: 0.35rem 0.15rem; font-size: 0.875rem; }
.ticket-line-picker {
  max-height: 14rem;
  overflow: auto;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--background));
}
.ticket-line-hit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-bottom: 1px solid hsl(var(--border));
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 0.875rem;
}
.ticket-line-hit:last-child { border-bottom: 0; }
.ticket-line-hit:hover { background: hsl(var(--accent)); }
.ticket-line-hit-name { font-weight: 500; }
.ticket-line-hit-meta { color: hsl(var(--muted-foreground)); white-space: nowrap; }
.ticket-line-hint { margin: 0; padding: 0.65rem 0.75rem; font-size: 0.875rem; }

#ticket-form-page.content-pad {
  background: hsl(var(--muted));
  padding: 1.25rem;
}
#ticket-form-page .card {
  background: hsl(var(--card));
  box-shadow: 0 1px 2px hsl(240 10% 3.9% / 0.06);
}
.tk-page {
  --tk-accent: 173 52% 32%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.tk-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.tk-crumb { font-size: 0.875rem; margin-bottom: 0.25rem; }
.tk-crumb a { color: hsl(var(--tk-accent)); text-decoration: none; }
.tk-title-row { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }
.tk-title { margin: 0; font-size: 1.35rem; font-weight: 650; }
.tk-rush-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  color: hsl(var(--muted-foreground));
  border-radius: 999px;
  height: 1.75rem;
  padding: 0 var(--space-3);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}
.tk-rush-btn:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--accent));
}
.tk-rush-btn.is-on {
  background: hsl(48 86% 92%);
  border-color: hsl(var(--border));
  color: hsl(0 72% 40%);
}
.tk-rush-btn.is-on:hover {
  background: hsl(48 80% 88%);
  color: hsl(0 72% 32%);
}
.tk-rush-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}
.tk-rush-btn .tk-rush-pin {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}
.tk-rush-btn.is-on .tk-rush-pin {
  color: hsl(0 72% 48%);
}
.tk-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  justify-content: flex-end;
}
.tk-more { position: relative; }
.tk-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.3rem);
  min-width: 11rem;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  box-shadow: 0 8px 24px hsl(var(--foreground) / 0.08);
  padding: 0.35rem;
  z-index: 30;
}
.tk-more-label {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  padding: 0.25rem 0.5rem;
}
.tk-more-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.4rem 0.5rem;
  font-size: 0.875rem;
  border-radius: 0.3rem;
  cursor: pointer;
}
.tk-more-item:hover, .tk-more-item.is-on { background: hsl(var(--accent)); }
a.tk-more-item { color: inherit; text-decoration: none; }
.tk-save {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  height: 2rem;
  padding: 0 0.9rem;
}
#ticket-form-page .card.tk-device {
  overflow: visible;
}
#ticket-form-page .card.tk-side-card,
#ticket-form-page .card.tk-activity {
  overflow: hidden;
}
.tk-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22rem;
  gap: 1.25rem;
  align-items: start;
}
.tk-layout > .tk-activity { grid-column: 1 / -1; }
@media (max-width: 1100px) { .tk-layout { grid-template-columns: 1fr; } }
.tk-main,
.tk-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.tk-block { border-top: 1px solid hsl(var(--border)); }
.tk-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 1.25rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.tk-block-head:hover,
.tk-card-sum:hover,
.tk-side-card > summary:hover { background: hsl(var(--muted) / 0.45); }
.tk-block-head strong { font-size: 0.9375rem; }
.tk-block-body { padding: 0 1.25rem 1.25rem; }
.tk-device-pickers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid hsl(var(--border));
}
.tk-device-pickers .field { margin: 0; }
.tk-device-pickers .field > label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.tk-device-model { grid-column: 1 / -1; max-width: calc(50% - 0.5rem); }
@media (max-width: 720px) {
  .tk-device-pickers { grid-template-columns: 1fr; }
  .tk-device-model { max-width: none; }
}
.tk-device-top,
.tk-device-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
}
.tk-device-top { border-bottom: 1px solid hsl(var(--border)); }
.tk-device-kicker { color: hsl(var(--tk-accent)); font-weight: 600; font-size: 0.9rem; }
.tk-no-imei {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  margin-top: var(--space-1);
  cursor: default;
}
.tk-no-imei input { accent-color: hsl(var(--primary)); margin: 0; }
.tk-device-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.tk-add-wrap { position: relative; }
.tk-add-new {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.tk-add-new:hover { opacity: 0.92; }
.tk-add-menu {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-1));
  min-width: 9rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  box-shadow: 0 8px 24px hsl(240 10% 3.9% / 0.08);
  z-index: 20;
  padding: var(--space-1);
  display: flex;
  flex-direction: column;
}
.tk-add-item {
  border: 0;
  background: transparent;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.tk-add-item:hover,
.tk-add-item:focus-visible { background: hsl(var(--accent)); outline: none; }
.tk-empty-device {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-8) var(--space-4);
  min-height: 20rem;
  text-align: center;
}
.tk-empty-art { color: hsl(var(--muted-foreground)); opacity: 0.55; }
.tk-empty-copy {
  margin: 0;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.tk-new-service { min-width: 9rem; }
.tk-setup-panel { padding: var(--space-4) var(--space-5) var(--space-5); }
.tk-setup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
.tk-setup-hint { margin: 0 0 var(--space-4); font-size: 0.875rem; }
.tk-setup-done {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-4);
}
.tk-bill-empty {
  text-align: center;
  padding: var(--space-6) var(--space-3);
}
.tk-bill-empty-title {
  margin: 0 0 var(--space-2);
  font-weight: 600;
  font-size: 0.9375rem;
}
.tk-bill-empty .muted { margin: 0; font-size: 0.875rem; }
.tk-bill-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: var(--space-3);
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
}
.tk-bill-totals .tk-chip {
  text-align: center;
  border-radius: calc(var(--radius) - 4px);
  padding: var(--space-2) var(--space-3);
}
.tk-bill-totals .tk-chip-profit {
  grid-column: 1 / -1;
}
.tk-device-hero { align-items: flex-start; }
.tk-device-thumb {
  width: 3rem;
  height: 3rem;
  border-radius: 0.5rem;
  background: hsl(var(--muted));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tk-device-main { flex: 1; min-width: 0; }
.tk-device-title { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.tk-device-title strong { font-size: 1.05rem; }
.tk-price { color: hsl(var(--tk-accent)); font-weight: 700; }
.tk-status { width: auto; max-width: 11rem; }
.tk-device-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(8rem, 1fr));
  align-items: start;
  gap: 1rem;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid hsl(var(--border));
}
@media (max-width: 900px) {
  .tk-device-meta { grid-template-columns: 1fr 1fr; }
}
.tk-device-meta label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: hsl(var(--muted-foreground));
  min-width: 0;
  font-size: 0.875rem;
}
.tk-device-meta .input,
.tk-device-meta .select { width: 100%; }
.tk-card {
  border: 0;
  border-top: 1px solid hsl(var(--border));
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.tk-device > .tk-card:last-child { border-bottom: 0; }
.tk-card-sum {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.9375rem;
}
.tk-card-sum::-webkit-details-marker { display: none; }
.tk-card-sum::after,
.tk-side-card > summary::after {
  content: '+';
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  color: hsl(var(--tk-accent));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  flex-shrink: 0;
}
.tk-card[open] > .tk-card-sum::after,
.tk-side-card[open] > summary::after { content: '\2212'; }
.tk-card-body { padding: 0 1.25rem 1.25rem; }
.tk-side-card {
  display: block;
}
.tk-side-card[open] > summary { border-bottom: 1px solid hsl(var(--border)); }
.tk-side-card > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: hsl(var(--foreground));
}
.tk-side-card > summary::-webkit-details-marker { display: none; }
.tk-side-body { padding: 1rem 1.25rem 1.25rem; }
.tk-side-body.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.tk-cust-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}
.cust-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.tk-meta-row {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
}
.tk-meta-row > span {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  line-height: 1.4;
}
.tk-meta-row .input,
.tk-meta-row .select,
.tk-meta-row strong { min-width: 0; }
.tk-cust-hits {
  display: flex;
  flex-direction: column;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  max-height: 12rem;
  overflow: auto;
  background: hsl(var(--background));
}
.tk-cust-hit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  border: 0;
  border-bottom: 1px solid hsl(var(--border));
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 0.875rem;
}
.tk-cust-hit:last-child { border-bottom: 0; }
.tk-cust-hit:hover { background: hsl(var(--accent)); }
.tk-kv { display: grid; gap: 1rem; font-size: 0.875rem; }
.tk-kv > div { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.tk-kv span { color: hsl(var(--muted-foreground)); }
.tk-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  color: hsl(var(--tk-accent));
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  padding: 0;
  box-sizing: border-box;
}
.tk-issue { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0; font-size: 0.875rem; }
.tk-issue-n { color: hsl(var(--muted-foreground)); width: 1.25rem; }
.tk-issue-name { color: hsl(var(--tk-accent)); flex: 1; min-width: 0; }
.tk-icon-btn { background: none; border: 0; cursor: pointer; color: hsl(var(--muted-foreground)); font-size: 1rem; }
.tk-picker-wrap { margin-top: 0.75rem; display: grid; gap: 0.75rem; }
.tk-seg { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.tk-seg button {
  border: 0;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
}
.tk-seg button.is-on { background: hsl(var(--tk-accent) / 0.12); color: hsl(var(--tk-accent)); font-weight: 600; }
.tk-img-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.tk-img {
  position: relative;
  width: 5.5rem;
  height: 4.5rem;
}
.tk-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.5rem;
  display: block;
}
.tk-img-remove {
  position: absolute;
  top: var(--space-1);
  right: var(--space-1);
  width: 1.25rem;
  height: 1.25rem;
  border: 0;
  border-radius: 999px;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  cursor: pointer;
  line-height: 1;
}
.tk-img-add {
  width: 5.5rem;
  height: 4.5rem;
  border: 1px dashed hsl(var(--border));
  border-radius: 0.5rem;
  background: hsl(var(--muted) / 0.4);
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.875rem;
  padding: var(--space-1);
}
.tk-cond-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 800px) { .tk-cond-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .tk-cond-grid { grid-template-columns: 1fr; } }
.tk-cond { display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.875rem; }
.tk-cond-select { max-width: 10rem; }
.tk-warr { padding: 0.75rem 0; border-bottom: 1px solid hsl(var(--border)); font-size: 0.875rem; }
.tk-warr:first-child { padding-top: 0; }
.tk-warr-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.tk-badge { font-size: 0.875rem; border-radius: 999px; padding: 0.15rem 0.5rem; background: hsl(var(--muted)); }
.tk-badge-warn { background: hsl(var(--warning-soft)); color: hsl(var(--warning)); }
.tk-badge-muted { background: #fef3c7; color: #92400e; }
.tk-bill-count { color: hsl(var(--tk-accent)); font-weight: 600; font-size: 0.875rem; margin-bottom: 0.5rem; }
.tk-bill-item { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid hsl(var(--border)); font-size: 0.875rem; }
.tk-chip { font-size: 0.875rem; border-radius: 999px; padding: 0.25rem 0.6rem; background: #dbeafe; color: #1e40af; }
.tk-chip-paid { background: #d1fae5; color: #065f46; }
.tk-chip-due { background: #fee2e2; color: #991b1b; }
.tk-chip-profit { background: #d1fae5; color: #065f46; }
.tk-activity {
  padding: 0;
  display: flex;
  flex-direction: column;
}
.tk-act-body {
  padding: var(--space-4) var(--space-5) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.tk-task-status { position: relative; flex-shrink: 0; }
.tk-task-status-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  padding: var(--space-2) var(--space-3);
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  min-height: 2.5rem;
}
.tk-task-status-chevron { width: 1rem; height: 1rem; opacity: 0.9; }
.tk-task-status-menu {
  position: absolute;
  top: calc(100% + var(--space-1));
  right: 0;
  z-index: 40;
  min-width: 14rem;
  max-height: 18rem;
  overflow: auto;
  padding: var(--space-1) 0;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 8px 24px hsl(var(--foreground) / 0.1);
}
.tk-task-status-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: var(--space-2) var(--space-4);
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  cursor: pointer;
}
.tk-task-status-item:hover,
.tk-task-status-item.is-on { background: hsl(var(--muted)); }
.tk-task-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.tk-task-tone-pending { background-color: hsl(45 93% 47%); }
.tk-task-tone-progress { background-color: hsl(210 90% 48%); }
.tk-task-tone-done { background-color: hsl(142 55% 38%); }
.tk-task-tone-unlocked { background-color: hsl(270 55% 52%); }
.tk-task-tone-waiting { background-color: hsl(24 95% 50%); }
.tk-task-tone-reply { background-color: hsl(187 75% 40%); }
.tk-task-tone-parts { background-color: hsl(197 55% 42%); }
.tk-task-tone-warranty { background-color: hsl(239 55% 55%); }
.tk-task-tone-cancelled { background-color: hsl(var(--destructive)); }
.tk-task-tone-transfer { background-color: hsl(215 16% 47%); }
.tk-act-badge {
  display: inline-flex;
  align-items: center;
  margin-left: var(--space-2);
  padding: 2px var(--space-2);
  border-radius: 999px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
}
.tk-act-compose-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}
.tk-act-sys {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin: 0;
  cursor: pointer;
}
.tk-act-sys input { accent-color: hsl(var(--primary)); }
.tk-act-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
  margin: 0;
  padding: 0 var(--space-4);
  gap: 0;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.tk-act-tab {
  position: relative;
  flex: 0 0 auto;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: hsl(var(--muted-foreground));
  padding: var(--space-4) var(--space-4);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tk-act-tab:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--muted) / 0.45);
}
.tk-act-tab.is-on {
  color: hsl(var(--primary));
  font-weight: 600;
  border-bottom-color: hsl(var(--primary));
}
.tk-act-tab:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: -2px;
}
.tk-act-compose { display: grid; gap: var(--space-3); margin: 0; }
.tk-act-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.tk-act-row label { font-size: 0.875rem; color: hsl(var(--muted-foreground)); display: flex; align-items: center; gap: 0.5rem; }
.tk-act-list { display: grid; gap: 0.75rem; }
.tk-act-item { display: flex; gap: 0.75rem; font-size: 0.875rem; }
.tk-act-av {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
}
.tk-act-text { font-weight: 500; }

.cond-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem 1rem; }
@media (max-width: 700px) { .cond-grid { grid-template-columns: 1fr; } }
.cond-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.875rem; }
.kpi-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.kpi-chip { padding: 0.5rem 0.75rem; border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px); background: hsl(var(--background)); font-size: 0.875rem; }

#estimate-form-page.content-pad {
  background: hsl(var(--muted));
  padding: 1.25rem;
}
.est-page { display: flex; flex-direction: column; gap: 1.25rem; }
.est-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.est-crumb { font-size: 0.875rem; color: hsl(var(--muted-foreground)); margin-bottom: 0.25rem; }
.est-crumb a { color: hsl(var(--muted-foreground)); text-decoration: none; }
.est-title-row { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.est-title { margin: 0; font-size: 1.75rem; font-weight: 600; }
.est-inv-link { font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.est-status {
  display: inline-flex;
  align-items: center;
  margin-top: var(--space-3);
  margin-bottom: var(--space-5);
  padding: 0.35rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}
.est-status-converted { background: #22d3ee; color: #083344; }
.est-status-approved { background: #86efac; color: #14532d; }
.est-status-declined { background: #fecaca; color: #7f1d1d; }
.est-status-awaiting {
  background: hsl(32 95% 48%);
  color: #fff;
  border-radius: 2px;
}
.est-head-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.est-action-group {
  display: inline-flex;
  align-items: stretch;
  border-radius: var(--radius);
  overflow: visible;
  border: 1px solid hsl(var(--border));
}
.est-action-group > .btn:first-child,
.est-action-group > .est-more:first-child .est-btn-action {
  border-top-left-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
}
.est-action-group > .btn:last-child,
.est-action-group > .est-more:last-child .est-btn-action {
  border-top-right-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}
.est-action-group > .btn,
.est-action-group .est-btn-action {
  border-radius: 0;
  border: 0;
  margin: 0;
}
.est-action-group > .btn + .btn,
.est-action-group > .btn + .est-more,
.est-action-group .est-more + .btn {
  border-left: 1px solid hsl(var(--border));
}
.est-btn-approve {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.est-btn-approve:hover { filter: brightness(0.96); }
.est-btn-decline {
  background: hsl(0 65% 42%);
  color: #fff;
}
.est-btn-decline:hover { filter: brightness(0.96); }
.est-btn-action {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: hsl(var(--card));
  color: hsl(var(--foreground));
}
.est-more { position: relative; }
.est-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 12rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  box-shadow: 0 8px 24px hsl(240 10% 3.9% / 0.08);
  padding: 0.35rem;
  z-index: 40;
}
.est-more-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 0.3rem;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}
.est-more-item:hover, .est-more-item.is-on { background: hsl(var(--accent)); }
.est-save {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.est-hero { padding: 1.25rem; }
.est-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 960px) { .est-hero-grid { grid-template-columns: 1fr; } }
.est-h2 {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.est-logo {
  display: block;
  width: 10rem;
  height: auto;
  max-height: 4.5rem;
  object-fit: contain;
  background: #fff;
  border: 1px solid hsl(var(--border));
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}
.est-co-name { font-weight: 700; margin-bottom: 0.35rem; }
.est-co-meta { font-size: 0.875rem; color: hsl(var(--foreground)); line-height: 1.45; }
.est-cust-name { font-weight: 700; margin-bottom: 0.5rem; }
.est-pencil {
  border: 0;
  background: none;
  cursor: pointer;
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
}
.est-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
.est-dates .field { margin: 0; }
.est-dates .field > span { display: block; margin-bottom: 0.5rem; font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.est-sum-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.est-sum-table th,
.est-sum-table td {
  border: 1px solid hsl(var(--border));
  padding: 0.65rem 0.75rem;
  text-align: left;
}
.est-sum-table th {
  width: 46%;
  font-weight: 500;
  background: hsl(var(--card));
}
.est-sum-table .est-status { margin-top: 0; padding: 0.2rem 0.5rem; }
.est-lines { padding: 0; overflow: hidden; }
.est-items { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.est-items th,
.est-items td {
  border: 1px solid hsl(var(--border));
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
  background: hsl(var(--card));
}
.est-items th {
  background: hsl(var(--muted));
  font-weight: 600;
  white-space: nowrap;
}
.est-desc { max-width: 16rem; white-space: pre-wrap; }
.est-items .input,
.est-items .select { min-width: 6.5rem; }
.est-line-total { display: flex; align-items: center; gap: 0.5rem; justify-content: space-between; }
.est-add { padding: 0.75rem 1.25rem; }
.est-totals-wrap { display: flex; justify-content: flex-end; padding: 0 1.25rem 1.25rem; }
.est-totals { width: min(22rem, 100%); border-collapse: collapse; font-size: 0.875rem; }
.est-totals th,
.est-totals td {
  border: 1px solid hsl(var(--border));
  padding: 0.65rem 0.75rem;
}
.est-totals th { text-align: left; font-weight: 600; width: 60%; }
.est-totals td { text-align: right; }
.est-totals-grand th,
.est-totals-grand td { font-weight: 700; }
.est-activity { padding: 0; overflow: hidden; }
.est-act-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.65rem 1rem;
  background: hsl(var(--muted));
  border-bottom: 1px solid hsl(var(--border));
}
.est-act-tab {
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  font-size: 0.875rem;
}
.est-act-tab.is-on {
  color: hsl(var(--foreground));
  font-weight: 600;
  border-bottom: 2px solid hsl(var(--foreground));
}
.est-act-body { padding: 0; display: grid; }
.est-act-row {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-4);
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(152 60% 94%);
}
.est-act-row.est-act-warn { background: hsl(0 70% 96%); }
.est-act-row.est-act-mail { background: hsl(210 80% 96%); }
.est-act-av {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.est-act-main { min-width: 0; flex: 1; }
.est-act-text { font-size: 14px; }
.est-act-text strong { color: hsl(var(--primary)); font-weight: 600; }
.est-attach-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  color: hsl(var(--primary));
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.est-attach-bar span { display: inline-flex; align-items: center; gap: var(--space-2); }
.est-attach-chevron { color: hsl(var(--muted-foreground)); }
.est-act-tab-icon { margin-right: var(--space-1); opacity: 0.85; }
.est-act-tabs .est-act-tab.is-on {
  color: hsl(var(--primary));
  border-bottom-color: hsl(var(--primary));
}
.est-dropzone {
  display: grid;
  place-items: center;
  gap: var(--space-2);
  padding: var(--space-8) var(--space-5);
  border: 2px dashed hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--muted));
  text-align: center;
}
.est-dropzone.is-drag {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.06);
}
.est-dropzone p { margin: 0; }
.est-choose-file { cursor: pointer; }
.est-attach-max { font-size: 14px; }
.est-attach-list {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.est-attach-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
}
.est-email-chip-wrap { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.est-email-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  background: hsl(210 80% 92%);
  color: hsl(210 70% 35%);
  font-size: 14px;
  font-weight: 600;
}
.est-email-chip-x {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.est-send-email {
  background: #111;
  border-color: #111;
  color: #fff;
}
.est-send-email:hover { filter: brightness(1.1); }
.est-act-detail { color: hsl(var(--primary)); font-size: 14px; margin-top: var(--space-1); }
.est-email-status {
  margin-left: auto;
  text-align: right;
  font-size: 14px;
  display: grid;
  gap: var(--space-1);
  justify-items: end;
}
.est-email-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  background: hsl(142 70% 40%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.est-act-row { flex-wrap: wrap; }
.est-items-rd .select,
.est-items-rd .input,
.est-items-rd .textarea { min-width: 6.5rem; }
.est-sheet { margin-bottom: var(--space-4); }
.est-foot {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 0.85rem 1.25rem;
  font-size: 0.875rem;
  border-radius: calc(var(--radius) - 2px);
}

.content-pad.rd-list {
  background: transparent;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
/* Tickets (and similar) wrap filters/table — keep the same section gap */
#ticket-listing-view,
#ticket-calendar-view {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.rd-list-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.rd-list-head h1 { margin: 0; font-size: 1.75rem; font-weight: 600; }
.rd-list-head h1 .rd-list-count {
  margin-left: var(--space-2);
  font-size: 1rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}
.rd-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  justify-content: flex-end;
}
.rd-list-actions > .btn,
.rd-list-actions > a.btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.rd-list-actions .btn .icon,
.rd-list-actions a.btn .icon {
  flex-shrink: 0;
}
.rd-inline-filters {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.rd-inline-filters-label {
  flex: 0 0 auto;
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  white-space: nowrap;
  line-height: 1;
}
.rd-inline-filters-row {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.rd-inline-filters-row > .input,
.rd-inline-filters-row > .select,
.rd-inline-filters-row > .search-select {
  box-sizing: border-box;
  width: auto;
  flex: 1 1 calc(12.5% - var(--space-3));
  min-width: calc(12.5% - var(--space-3));
  max-width: calc(16.666% - var(--space-3));
  background: #fff;
}
.rd-inline-filters-row > .input,
.rd-inline-filters-row > .input[readonly],
.rd-inline-filters-row > .search-select .search-select-input {
  background: #fff;
}
.rd-inline-filters-row > .search-select .search-select-input {
  width: 100%;
}
.rd-inline-filters-tools {
  flex: 0 0 auto;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.rd-inline-filters-tools .rd-col-gear-wrap {
  width: auto;
}
/* Filter sits as the white toolbar of the table card */
.rd-table-card > .rd-inline-filters {
  position: relative;
  z-index: 6;
  padding: var(--space-3) var(--space-4);
  background: #fff;
  border-bottom: 1px solid hsl(var(--border));
  overflow: visible;
}
/* Reports: keep filters on one inventory-style toolbar row */
.rpt-page .rd-inline-filters {
  flex-wrap: nowrap;
  align-items: center;
}
.rpt-page .rd-inline-filters-row {
  flex-wrap: nowrap;
  overflow-x: auto;
}
.rpt-page .rd-inline-filters-row > .input,
.rpt-page .rd-inline-filters-row > .select,
.rpt-page .rd-inline-filters-row > .search-select {
  flex: 0 1 auto;
  width: auto;
  min-width: 8rem;
  max-width: 14rem;
}
.rpt-page .rd-inline-filters-row > .input[type="search"],
.rpt-page .rd-inline-filters-row > input[type="search"] {
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: 20rem;
}
.rpt-page .rd-inline-filters-row > .input[type="date"] {
  width: 10rem;
  min-width: 10rem;
  max-width: 10rem;
  flex: 0 0 10rem;
}
.rpt-page .rd-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}
.rd-inline-filters-row > .search-select.is-open {
  z-index: 30;
}
.rd-inline-filters-row > .rd-clear-filter {
  flex: 0 0 auto;
  min-width: auto;
  max-width: none;
  white-space: nowrap;
  align-self: center;
}
.rd-inline-filters-row > .rd-inline-filter-check {
  flex: 0 0 auto;
  margin: 0;
  min-width: auto;
  max-width: none;
  white-space: nowrap;
}
.rd-create {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.rd-create:hover { background: hsl(214 65% 22%); }
.rd-filter-toggle::after {
  content: "";
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.rd-filters.card { padding: var(--space-4); }
.rd-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}
@media (max-width: 1100px) { .rd-filter-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .rd-filter-grid { grid-template-columns: 1fr; } }
.rd-filter-grid .field { margin: 0; }
.rd-filter-grid .field > span,
.rd-filter-grid label { display: block; margin-bottom: var(--space-2); font-size: 0.875rem; font-weight: 500; color: hsl(var(--muted-foreground)); }
.rd-filter-dates { display: flex; align-items: center; gap: var(--space-2); }
.rd-filter-dates .input { flex: 1; min-width: 0; }
.rd-filter-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-4);
}
.rd-filter-actions-right { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.ex-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  align-items: end;
}
.ex-detail-grid-simple {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ex-detail-grid .field { margin-bottom: 0; }
.ex-line-table th,
.ex-line-table td { padding: var(--space-2); vertical-align: middle; }
.ex-line-table .input,
.ex-line-table .select { width: 100%; min-height: 2.5rem; }
.ex-total-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}
.ex-total-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
}
.ex-total-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: hsl(var(--foreground));
}
.ex-employee-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-4);
}
.ex-employee-card[hidden] { display: none; }
.ex-employee-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.ex-employee-bar {
  display: flex;
  width: 100%;
  height: 40px;
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--muted) / 0.35);
}
.ex-employee-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 100%;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 1px rgb(0 0 0 / 0.2);
  white-space: nowrap;
  overflow: hidden;
}
.ex-employee-seg span {
  padding: 0 var(--space-2);
}
.ex-employee-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
}
.ex-employee-legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.ex-employee-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}
@media (max-width: 1100px) {
  .ex-detail-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 800px) {
  .ex-detail-grid,
  .ex-detail-grid-simple { grid-template-columns: 1fr; }
}

/* Date / datetime inputs with Apply confirmation */
.app-date-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.app-date-wrap > .input {
  width: 100%;
}
input[type="date"].is-app-date,
input[type="datetime-local"].is-app-date {
  color-scheme: light;
  cursor: pointer;
}
input[type="date"].is-app-date::-webkit-calendar-picker-indicator,
input[type="datetime-local"].is-app-date::-webkit-calendar-picker-indicator {
  display: none;
}
.dash-range-date-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  text-align: left;
  cursor: pointer;
  background: #fff;
}
[data-app-date-host] {
  position: relative;
}
.app-date-panel {
  position: fixed;
  z-index: 220;
  left: 0;
  top: 0;
  min-width: min(18rem, 100vw - 2rem);
  width: min(18rem, 100vw - 2rem);
  padding: var(--space-3);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  box-sizing: border-box;
}
.app-date-panel.is-placed,
.app-date-panel.is-open {
  position: fixed;
  right: auto;
  bottom: auto;
  margin: 0;
}
.app-date-panel[hidden] { display: none !important; }
.app-date-panel.has-time {
  min-width: min(18rem, 100vw - 2rem);
}
.app-date-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.app-date-month {
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  flex: 1;
}
.app-date-nav {
  min-width: 2rem;
  padding-inline: var(--space-2);
}
.app-date-weekdays,
.app-date-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-1);
}
.app-date-weekdays span {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  padding: var(--space-1) 0;
}
.app-date-day {
  appearance: none;
  border: 0;
  background: transparent;
  border-radius: var(--radius);
  height: 2rem;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  color: hsl(var(--foreground));
}
.app-date-day.is-out {
  visibility: hidden;
  pointer-events: none;
}
.app-date-day.is-today {
  box-shadow: inset 0 0 0 1px hsl(var(--border));
}
.app-date-day.is-selected,
.app-date-day:hover {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.app-date-time {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
.app-date-time .field { margin: 0; }
.app-date-panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.app-date-panel .input { width: 100%; }
.app-date-panel-inline {
  left: 0;
  right: 0;
  width: auto;
  min-width: 0;
}
.rd-filter-actions-right .btn,
.pos-history-filters .btn { height: 2.25rem; }
.rd-chips-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}
/* Chips + table read as one card (no double gap / double border) */
.rd-chips-bar:has(+ .rd-table-card) {
  border-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.rd-chips-bar + .rd-table-card {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  /* Cancel parent flex gap so chips sit flush on the table card */
  margin-top: calc(-1 * var(--space-3));
}
.rd-chips-bar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
}
.tk-bulk {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  overflow: visible;
  position: relative;
}
.tk-bulk-count,
.tk-bulk-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4);
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  white-space: nowrap;
  border: 0;
  background: transparent;
  line-height: 1.25;
}
.tk-bulk-count {
  border-right: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
}
.tk-bulk-btn {
  cursor: pointer;
  border-right: 1px solid hsl(var(--border));
}
.tk-bulk-btn:last-child,
.tk-bulk-status .tk-bulk-btn {
  border-right: 0;
}
.tk-bulk-btn:hover {
  background: hsl(var(--muted));
}
.tk-bulk-status {
  position: relative;
  display: flex;
}
.tk-bulk-chevron {
  width: 1rem;
  height: 1rem;
  color: hsl(var(--muted-foreground));
}
.tk-bulk-status-menu {
  position: absolute;
  top: calc(100% + var(--space-1));
  right: 0;
  z-index: 40;
  min-width: 12rem;
  max-height: 20rem;
  overflow: auto;
  padding: var(--space-1) 0;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 8px 24px hsl(var(--foreground) / 0.08);
}
.tk-bulk-status-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: var(--space-2) var(--space-4);
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  cursor: pointer;
}
.tk-bulk-status-item:hover {
  background: hsl(var(--muted));
}
#ticket-cols,
#inv-cols,
#est-cols,
#inq-cols {
  color: hsl(var(--primary));
}
.rd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.rd-chip {
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  border-radius: calc(var(--radius) - 2px);
  padding: var(--space-1) var(--space-3);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
}
.rd-chip:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.rd-chip.is-on { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.ticket-col-menu {
  width: 15.5rem;
  max-height: 22rem;
  padding: var(--space-2);
}
.ticket-col-menu label {
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: calc(var(--radius) - 2px);
  text-transform: none;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
}
.ticket-col-menu label:hover { background: hsl(var(--accent)); }
.ticket-col-menu label.is-on { color: hsl(var(--primary)); }
.ticket-col-menu label.is-on input { accent-color: hsl(var(--primary)); }
.ticket-col-menu label.is-off { color: hsl(var(--muted-foreground)); }
.rd-table-card { padding: 0; overflow: visible; }
.rd-table-card > .table-wrap { width: 100%; overflow-x: auto; }
.rd-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.rd-table th,
.rd-table td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid hsl(var(--border));
  vertical-align: middle;
}
.rd-table th {
  color: hsl(var(--muted-foreground));
  font-weight: 600;
  white-space: nowrap;
  background: hsl(214 28% 96%);
  position: sticky;
  top: 0;
  z-index: 1;
}
.rd-table td { font-variant-numeric: tabular-nums; }
.rd-table td[data-col="email"],
.rd-table td[data-col="phoneNo"],
.rd-table td[data-col="organization"],
.rd-table td[data-col="created"],
.rd-table td[data-col="updated"],
.rd-table td[data-col="due"],
.rd-table td[data-col="customerGroup"] {
  color: hsl(var(--muted-foreground));
}
.rd-table td[data-col="ticketsAmount"],
.rd-table td[data-col="receivables"],
.rd-table td[data-col="total"],
.rd-table td[data-col="retailPrice"],
.rd-table td[data-col="unitCost"] {
  font-weight: 600;
  color: hsl(var(--foreground));
}
.rd-table td[data-col="id"],
.rd-table td[data-col="sku"],
.rd-table td[data-col="stock"],
.rd-table td[data-col="stockWarning"],
.rd-table td[data-col="retailPrice"],
.rd-table td[data-col="unitCost"],
.rd-table td[data-col="markUp"],
.rd-table td[data-col="margin"],
.rd-table td[data-col="condition"] {
  white-space: nowrap;
}
.rd-table td[data-col="name"],
.rd-table td[data-col="modelName"],
.rd-table td[data-col="brandName"],
.rd-table td[data-col="supplierName"] {
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rd-table td[data-col="type"] {
  white-space: nowrap;
}
.rd-table tbody tr { background: hsl(var(--card)); }
.rd-table a.rd-id { color: hsl(var(--primary)); font-weight: 600; text-decoration: none; }
.rd-table a.rd-id:hover { text-decoration: underline; }
.rd-stack { display: grid; gap: var(--space-2); }
.rd-row-sep {
  height: 1px;
  background: hsl(var(--border));
  margin: var(--space-2) 0 0;
}
.rd-muted { color: hsl(var(--muted-foreground)); font-size: 0.875rem; }
.rd-svc { display: flex; gap: var(--space-2); align-items: flex-start; }
.rd-dot {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.rd-assignee { display: flex; align-items: center; gap: var(--space-2); }
.rd-av {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
}
.rd-ticket-table { min-width: 72rem; }
.rd-ticket-table tbody tr { background: hsl(var(--card)); }
.rd-ticket-table tbody tr:hover { background: hsl(var(--accent) / 0.55); }
.rd-ticket-table tbody tr.tk-row-progress {
  background: hsl(12 76% 61% / 0.1);
}
.rd-ticket-table tbody tr.tk-row-progress:hover {
  background: hsl(12 76% 61% / 0.16);
}
.rd-ticket-table tbody tr.row-selected {
  background: hsl(var(--primary) / 0.08);
}
.rd-ticket-table tbody tr.row-selected:hover {
  background: hsl(var(--primary) / 0.12);
}
.rd-ticket-table tbody tr.tk-row-progress.row-selected {
  background: hsl(12 76% 61% / 0.18);
}
.tk-pager-left {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.tk-id-cell {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}
.tk-pin-th {
  width: 2.5rem;
  min-width: 2.5rem;
  padding-left: var(--space-3) !important;
  padding-right: var(--space-2) !important;
}
.tk-pin-cell {
  width: 2.5rem;
  min-width: 2.5rem;
  padding-left: var(--space-3) !important;
  padding-right: var(--space-2) !important;
  vertical-align: middle;
}
.tk-pin,
.tk-pin-btn {
  color: hsl(var(--muted-foreground));
  opacity: 0.75;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  padding: var(--space-1);
  margin: 0;
  cursor: pointer;
  border-radius: calc(var(--radius) - 2px);
}
.tk-pin-btn:hover {
  opacity: 1;
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
}
.tk-pin-btn.is-on {
  color: hsl(0 72% 48%);
  opacity: 1;
}
.tk-pin-btn.is-on:hover {
  color: hsl(0 72% 40%);
  background: hsl(0 72% 48% / 0.1);
}
.tk-pin-btn:disabled {
  opacity: 0.45;
  cursor: wait;
}
.tk-pin svg,
.tk-pin-btn svg {
  width: 1rem;
  height: 1rem;
}
.rd-ticket-table tbody tr.tk-row-rush {
  background: hsl(48 86% 92%);
}
.rd-ticket-table tbody tr.tk-row-rush:hover {
  background: hsl(48 80% 88%);
}
.rd-ticket-table tbody tr.tk-row-rush.row-selected {
  background: hsl(48 70% 86%);
}
.rd-ticket-table tbody tr.tk-row-rush.row-selected:hover {
  background: hsl(48 65% 82%);
}
.tk-customer { display: grid; gap: var(--space-1); }
.tk-phone { color: hsl(var(--primary)); font-weight: 600; }
.tk-status {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  padding: var(--space-1) 1.5rem var(--space-1) var(--space-2);
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  max-width: 10.5rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.35rem center;
}
.tk-status:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}
.tk-status-waiting { background-color: hsl(197 37% 40%); }
.tk-status-progress { background-color: hsl(189 80% 42%); }
.tk-status-done { background-color: hsl(var(--chart-2)); }
.tk-status-cancelled { background-color: hsl(var(--destructive)); }
.tk-row-menu {
  position: fixed;
  z-index: 90;
  min-width: 13.5rem;
  padding: var(--space-2) 0;
  background: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 8px 24px hsl(var(--foreground) / 0.12);
}
.tk-row-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-size: 0.875rem;
  line-height: 1.25;
  cursor: pointer;
}
.tk-row-menu-item:hover,
.tk-row-menu-item:focus-visible {
  background: hsl(var(--accent));
  outline: none;
}
.tk-row-menu-item.has-sub { font-weight: 500; }
.tk-row-menu-chevron {
  width: 0.9rem;
  height: 0.9rem;
  color: hsl(var(--muted-foreground));
  flex-shrink: 0;
}
.tk-row-menu-sep {
  height: 1px;
  background: hsl(var(--border));
  margin: var(--space-2) 0;
}
.tk-row-menu-flyout { position: relative; }
.tk-row-submenu {
  position: absolute;
  left: calc(100% - 0.25rem);
  top: 0;
  min-width: 10.5rem;
  padding: var(--space-2) 0;
  background: hsl(var(--popover));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 8px 24px hsl(var(--foreground) / 0.12);
  z-index: 91;
}
.tk-row-menu.is-flip-sub .tk-row-submenu {
  left: auto;
  right: calc(100% - 0.25rem);
}
.tk-row-submenu[hidden] { display: none; }
@media (max-width: 720px) {
  .tk-row-submenu,
  .tk-row-menu.is-flip-sub .tk-row-submenu {
    left: auto;
    right: 0;
    top: 100%;
  }
}
.rd-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.875rem;
  font-weight: 600;
}
.rd-status-draft { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); }
.rd-status-awaiting { background: hsl(32 95% 48%); color: #fff; }
.rd-status-declined, .rd-status-refunded { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); }
.rd-status-converted { background: hsl(var(--chart-2)); color: hsl(var(--primary-foreground)); }
.rd-status-approved, .rd-status-paid { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.rd-status-due, .rd-status-unpaid { background: hsl(var(--chart-5)); color: hsl(var(--primary-foreground)); }
.rd-status-partial { background: hsl(var(--chart-4)); color: hsl(var(--foreground)); }
.rd-actions-th {
  width: 7rem;
  text-align: right !important;
  position: sticky;
  right: 0;
  z-index: 2;
}
.rd-col-gear-wrap {
  display: inline-flex;
  justify-content: flex-end;
  width: 100%;
}
.rd-col-gear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: hsl(var(--primary));
  cursor: pointer;
  padding: 0;
}
.rd-col-gear:hover,
.rd-col-gear.is-active {
  background: hsl(var(--primary) / 0.1);
}
.rd-col-customizer {
  width: 16.5rem;
  max-height: 22rem;
  padding: var(--space-2);
  box-shadow: 0 8px 24px hsl(var(--foreground) / 0.12);
}
.rd-col-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: calc(var(--radius) - 2px);
  cursor: grab;
}
.rd-col-item:hover { background: hsl(var(--accent)); }
.rd-col-item.is-dragging { opacity: 0.55; }
.rd-col-item.is-drag-over { outline: 1px dashed hsl(var(--primary)); }
.rd-col-item.is-off { color: hsl(var(--muted-foreground)); }
.rd-col-drag {
  display: inline-flex;
  color: hsl(var(--muted-foreground));
  flex-shrink: 0;
  line-height: 0;
}
.rd-col-item label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  flex: 1;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: none;
  color: inherit;
}
.rd-col-item input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: hsl(var(--primary));
  flex-shrink: 0;
}
.cust-gdpr-no {
  color: hsl(var(--destructive));
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
}
.cust-gdpr-yes {
  color: hsl(var(--chart-2));
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
}
.rd-pager-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
#od-table th.rd-actions-col,
#od-table td.rd-icon-actions {
  width: auto;
  min-width: 12rem;
  text-align: right;
}
.rd-icon-actions {
  white-space: nowrap;
  text-align: right;
  vertical-align: middle;
}
.rd-icon-actions > * {
  vertical-align: middle;
}
.rd-icon-actions > * + * {
  margin-left: var(--space-1);
}
.rd-icon-actions a,
.rd-icon-actions button:not(.btn) {
  border: 0;
  background: none;
  color: hsl(var(--primary));
  cursor: pointer;
  padding: var(--space-1);
  text-decoration: none;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 2px);
}
.rd-icon-actions a:hover,
.rd-icon-actions button:not(.btn):hover {
  color: hsl(var(--primary));
  background: hsl(var(--accent));
}
.rd-icon-actions .js-need-repair {
  margin-right: var(--space-1);
  white-space: nowrap;
}
.rd-icon-actions .js-del:hover,
.rd-icon-actions [data-del]:hover,
.btn-del:hover {
  color: hsl(var(--destructive));
  background: hsl(0 84% 97%);
}
.rd-icon-actions .icon {
  width: 18px;
  height: 18px;
}
.ti-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}
.ti-status-stock { background: hsl(var(--primary)); }
.ti-status-sold { background: hsl(32 95% 48%); }
.ti-status-pending { background: hsl(32 95% 48%); }
.ti-status-refurb { background: hsl(var(--chart-5)); }
.ti-status-transfer { background: hsl(var(--muted-foreground)); }
.ti-status-moved { background: hsl(var(--muted-foreground)); }
.ti-attrs {
  min-width: 18rem;
  vertical-align: top;
}
.ti-attr-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: 14px;
  line-height: 1.4;
}
.ti-attr {
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
  white-space: nowrap;
}
.ti-attr span { color: hsl(var(--muted-foreground)); }
.ti-attr strong { font-weight: 600; }
.ti-imei {
  color: hsl(var(--primary));
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}
.rd-print-barcode {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
}
/* Keep outline button look (ti-more .js-more otherwise strips border/bg). */
.rd-print-barcode.ti-more > .js-more.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid hsl(var(--input));
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: none;
  padding: 0 0.75rem;
  height: 2rem;
  border-radius: calc(var(--radius) - 2px);
}
.rd-print-barcode.ti-more > .js-more.btn:hover {
  background: hsl(var(--accent));
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}
.rd-print-barcode .ti-more-menu {
  min-width: 11rem;
  z-index: 50;
}
.ti-more { position: relative; display: inline-flex; vertical-align: middle; }
.ti-more .js-more {
  border: 0;
  background: none;
  color: hsl(var(--primary));
  cursor: pointer;
  padding: var(--space-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 2px);
}
.ti-more .js-more:hover {
  background: hsl(var(--accent));
}
.ti-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 14rem;
  z-index: 40;
}
.rd-pager .pager-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.rd-pager .pager-right {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}
.ti-purchase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 900px) {
  .ti-purchase-grid { grid-template-columns: 1fr; }
}
.ti-purchase-card {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  padding: var(--space-4);
}
.ti-purchase-card h2 {
  margin: 0 0 var(--space-4);
  font-size: 16px;
  font-weight: 600;
}
.ti-seller-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.ti-seller-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: hsl(var(--muted));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ti-line-add {
  width: 100%;
  margin-top: var(--space-3);
  justify-content: center;
  background: hsl(var(--primary) / 0.08);
  border: 1px dashed hsl(var(--border));
  color: hsl(var(--primary));
}
.ti-purchase-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-4);
}
@media (max-width: 900px) {
  .ti-purchase-footer { grid-template-columns: 1fr; }
}
.ti-purchase-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.btn-del {
  color: hsl(var(--muted-foreground));
}
.rd-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}
#inq-kpis.rd-kpis {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
@media (max-width: 1100px) {
  #inq-kpis.rd-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.stock-line {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  overflow-x: auto;
  padding: var(--space-3) var(--space-4);
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}
.stock-line-item {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  white-space: nowrap;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
}
.stock-line-item + .stock-line-item {
  padding-left: var(--space-4);
  border-left: 1px solid hsl(var(--border));
}
.stock-line-item strong {
  font-weight: 600;
  color: hsl(var(--primary));
}
@media (max-width: 1100px) { .rd-kpis { grid-template-columns: 1fr 1fr; } }
.rd-kpi { padding: 1rem 1.25rem; }
.rd-kpi-label { font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.rd-kpi-val { font-size: 1.15rem; font-weight: 700; margin-top: 0.35rem; }
.rd-kpi-val.is-teal,
.rd-kpi-val.is-primary { color: hsl(var(--primary)); }
.rd-kpi-val.is-red { color: hsl(var(--destructive)); }
.rd-kpi-val.is-orange { color: hsl(var(--chart-5)); }
.rd-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.rd-charts-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .rd-charts-3 { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .rd-charts { grid-template-columns: 1fr; } }
.rd-thumb {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--muted));
  display: inline-block;
  vertical-align: middle;
}
.rd-check { color: hsl(var(--primary)); font-size: 1.1rem; font-weight: 700; }
.rd-select-link { color: hsl(var(--primary)); font-weight: 600; text-decoration: none; }
.rd-kpi .rd-kpi-label { display: flex; align-items: center; gap: 0.35rem; }

/* Inquiries create dialog sections */
.inq-section {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 0 var(--space-4) var(--space-4);
  background: hsl(var(--card));
}
.inq-section-summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  padding: var(--space-4) 0 var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.inq-section-summary::-webkit-details-marker { display: none; }
.inq-section-summary::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid hsl(var(--muted-foreground));
  border-bottom: 2px solid hsl(var(--muted-foreground));
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.inq-section[open] > .inq-section-summary::before {
  transform: rotate(45deg);
}

/* Inquiry create/edit — 70 / 30 split */
.inq-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.inq-form-title {
  margin: var(--space-1) 0 0;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
}
.inq-breadcrumb { font-size: 14px; }
.inq-form-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.inq-form-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  align-items: start;
}
@media (max-width: 960px) {
  .inq-form-layout { grid-template-columns: 1fr; }
}
.inq-form-side {
  position: sticky;
  top: var(--space-4);
}
.inq-cust-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.inq-cust-ss { flex: 1; min-width: 12rem; }
.inq-subhead {
  margin: var(--space-4) 0 0;
  font-size: 16px;
  font-weight: 600;
}
.inq-type-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-1);
  padding: var(--space-1);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--muted));
}
@media (max-width: 720px) {
  .inq-type-tabs { grid-template-columns: 1fr 1fr; }
}
.inq-type-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  padding: var(--space-2) var(--space-1);
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  min-height: 40px;
}
.inq-type-tab:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--card) / 0.7);
}
.inq-type-tab.is-active {
  color: hsl(var(--primary-foreground));
  background: hsl(var(--primary));
  box-shadow: var(--shadow);
}
.inq-side-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-end;
  padding-top: var(--space-2);
}
.inq-type-panel { gap: var(--space-4); }
.inq-rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-2);
  border: 1px solid hsl(var(--border));
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: hsl(var(--muted));
}
.inq-rte-btn {
  appearance: none;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  min-height: 32px;
  padding: 0 var(--space-2);
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
}
.inq-rte-btn:hover { background: hsl(var(--accent)); }
.inq-rte {
  min-height: 220px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid hsl(var(--border));
  border-radius: 0 0 var(--radius) var(--radius);
  background: hsl(var(--card));
  font-size: 14px;
  line-height: 1.5;
  overflow: auto;
}
.inq-rte:focus {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 1px;
}
.inq-rte a { color: hsl(var(--primary)); }
.inq-product-ss { width: 100%; }
.inq-sales-row { align-items: end; }
.inq-sales-table-wrap {
  overflow-x: auto;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}
.inq-sales-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.inq-sales-table th,
.inq-sales-table td {
  padding: var(--space-3) var(--space-3);
  border-bottom: 1px solid hsl(var(--border));
  text-align: left;
  vertical-align: top;
}
.inq-sales-table th {
  font-weight: 600;
  background: hsl(var(--muted));
  white-space: nowrap;
}
.inq-sales-table tr:last-child td { border-bottom: 0; }
.inq-warranty-card {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: var(--space-4);
  display: grid;
  gap: var(--space-4);
  background: hsl(var(--card));
}
.inq-warranty-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.inq-caps {
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 12px;
}
.inq-blank-panel {
  border: 1px dashed hsl(var(--border));
  border-radius: var(--radius);
  padding: var(--space-8) var(--space-4);
  text-align: center;
}
.cat-icon-btn {
  border: 0;
  background: transparent;
  color: hsl(var(--primary));
  padding: var(--space-1);
  border-radius: calc(var(--radius) - 2px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.cat-icon-btn:hover {
  background: hsl(var(--accent));
}
.cat-icon-btn.cat-icon-del:hover {
  color: hsl(var(--destructive));
  background: hsl(0 84% 97%);
}
.cat-icon-btn .icon {
  width: 18px;
  height: 18px;
}
.inq-cust-cell { display: grid; gap: var(--space-1); }
.inq-cust-meta { font-size: 12px; }
.inq-subject-cell {
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rd-info {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  font-size: 0.875rem;
  align-items: center;
  justify-content: center;
  color: hsl(var(--muted-foreground));
}
.rd-filter-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.875rem;
}
.rd-table td { vertical-align: middle; }
.rd-chart-card { padding: 1.25rem; }
.rd-chart-card h2 { margin: 0 0 1rem; font-size: 1rem; }
.rd-chart-row { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.rd-legend { display: grid; gap: 0.35rem; font-size: 0.875rem; }
.rd-legend span { display: inline-block; width: 0.65rem; height: 0.65rem; border-radius: 999px; margin-right: 0.35rem; }
.rd-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 0 0;
  font-size: 0.875rem;
}
.rd-pager-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.rd-page-size-label { font-size: 14px; }
.rd-page-size {
  width: auto;
  min-width: 4.5rem;
  height: 40px;
}
.rd-pager-pages { display: flex; gap: 0.25rem; align-items: center; flex-wrap: wrap; }
.rd-page-btn {
  min-width: 2rem;
  height: 2rem;
  border: 0;
  background: transparent;
  border-radius: 0.25rem;
  cursor: pointer;
}
.rd-page-btn.is-on { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.rd-filter-toggle.is-active,
.rd-toolbar-btn.is-active,
#ticket-filter-toggle.is-active,
#ticket-overview-toggle.is-active,
#ticket-insights.is-active,
#ticket-cols.is-active {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.rd-filter-toggle.is-active:hover,
.rd-toolbar-btn.is-active:hover,
#ticket-filter-toggle.is-active:hover,
#ticket-overview-toggle.is-active:hover,
#ticket-insights.is-active:hover,
#ticket-cols.is-active:hover {
  opacity: 0.92;
}
.tk-view-switch {
  display: inline-flex;
  align-items: stretch;
  padding: 2px;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background: hsl(var(--card));
  gap: 0;
}
.tk-view-switch-btn {
  border: 0;
  background: hsl(var(--card));
  color: hsl(var(--muted-foreground));
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: var(--space-1) var(--space-4);
  border-radius: 999px;
  cursor: pointer;
  line-height: 1.4;
  min-height: 1.75rem;
}
.tk-view-switch-btn:hover { color: hsl(var(--foreground)); }
.tk-view-switch-btn.is-active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  box-shadow: 0 1px 2px hsl(var(--foreground) / 0.12);
}
.tk-view-switch-btn.is-active:hover { opacity: 0.95; color: hsl(var(--primary-foreground)); }
#ticket-listing-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.tk-cal-filters { padding: var(--space-4); }
.tk-cal-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 14rem));
  gap: var(--space-4);
}
@media (max-width: 700px) {
  .tk-cal-filter-grid { grid-template-columns: 1fr; }
}
.tk-cal-shell { padding: 0; overflow: hidden; }
.tk-cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  background: hsl(var(--muted));
  border-bottom: 1px solid hsl(var(--border));
}
.tk-cal-nav { display: inline-flex; align-items: center; gap: var(--space-2); }
.tk-cal-title {
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.tk-cal-mode {
  display: inline-flex;
  gap: 0;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
  background: hsl(var(--card));
}
.tk-cal-mode-btn {
  border: 0;
  border-radius: 0;
  min-width: 4rem;
}
.tk-cal-mode-btn.is-active {
  background: hsl(var(--accent));
  color: hsl(var(--primary));
  font-weight: 600;
}
.tk-cal-scroll {
  overflow: auto;
  max-height: min(70vh, 44rem);
}
.tk-cal-day,
.tk-cal-week {
  min-width: 64rem;
}
.tk-cal-day-head,
.tk-cal-day-row,
.tk-cal-week-head,
.tk-cal-week-row {
  display: grid;
  grid-template-columns: 8.5rem repeat(10, minmax(6.5rem, 1fr));
}
.tk-cal-week-head,
.tk-cal-week-row {
  grid-template-columns: 5.5rem repeat(7, minmax(7rem, 1fr));
}
.tk-cal-corner,
.tk-cal-hour,
.tk-cal-dayname,
.tk-cal-tech {
  padding: var(--space-3);
  border-bottom: 1px solid hsl(var(--border));
  border-right: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.45);
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
}
.tk-cal-tech {
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  font-weight: 500;
  position: sticky;
  left: 0;
  z-index: 2;
}
.tk-cal-corner { position: sticky; left: 0; z-index: 3; }
.tk-cal-cell {
  min-height: 5.5rem;
  padding: var(--space-2);
  border-bottom: 1px solid hsl(var(--border));
  border-right: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  vertical-align: top;
}
.tk-cal-week-row .tk-cal-cell { min-height: 3.25rem; }
.tk-cal-empty { padding: var(--space-6); }
.tk-cal-card {
  position: relative;
  display: block;
  color: inherit;
  background: hsl(214 65% 26% / 0.08);
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  padding: var(--space-2) var(--space-3);
  padding-right: 1.75rem;
  font-size: 0.875rem;
  line-height: 1.35;
}
.tk-cal-card:hover {
  background: hsl(214 65% 26% / 0.14);
}
.tk-cal-card-body {
  display: block;
  text-decoration: none;
  color: inherit;
}
.tk-cal-card-title {
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 2px;
}
.tk-cal-card-meta {
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tk-cal-go {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.15rem;
  height: 1.15rem;
  border: 0;
  border-radius: 999px;
  background: hsl(var(--foreground) / 0.75);
  color: hsl(var(--background));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.tk-cal-go:hover,
.tk-cal-go.is-open {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.tk-cal-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: inherit;
  background: hsl(var(--muted));
  border-radius: calc(var(--radius) - 2px);
  padding: var(--space-1) 1.75rem var(--space-1) 0;
  font-size: 0.875rem;
  font-weight: 600;
  overflow: hidden;
}
.tk-cal-pill:hover { background: hsl(var(--accent)); }
.tk-cal-pill-bar {
  width: 3px;
  align-self: stretch;
  background: hsl(var(--primary));
  flex-shrink: 0;
}
.tk-cal-pill-text {
  padding-left: var(--space-2);
  text-decoration: none;
  color: inherit;
  font-weight: 600;
}
.tk-cal-menu {
  position: fixed;
  z-index: 95;
  min-width: 11.5rem;
  padding: var(--space-2) 0;
  background: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 8px 24px hsl(var(--foreground) / 0.12);
}
.tk-cal-menu-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: var(--space-2) var(--space-4);
  font-size: 0.875rem;
  cursor: pointer;
}
.tk-cal-menu-item:hover,
.tk-cal-menu-item:focus-visible {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  outline: none;
}
.tk-cal-menu-sep {
  height: 1px;
  background: hsl(var(--border));
  margin: var(--space-2) 0;
}

#ticket-overview {
  padding: var(--space-4);
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
}
#ticket-overview .rd-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-3);
}
@media (max-width: 1100px) {
  #ticket-overview .rd-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  #ticket-overview .rd-kpis {
    grid-template-columns: 1fr 1fr;
  }
}
#ticket-overview .tk-ov-card {
  position: relative;
  padding: var(--space-4) var(--space-4) var(--space-4) var(--space-5);
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 1px 2px hsl(var(--foreground) / 0.04);
  overflow: hidden;
}
#ticket-overview .tk-ov-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: hsl(var(--primary));
}
#ticket-overview .tk-ov-card .rd-kpi-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground) / 0.72);
  letter-spacing: 0.01em;
}
#ticket-overview .tk-ov-card .rd-kpi-val {
  margin-top: var(--space-2);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  color: hsl(var(--foreground));
}
#ticket-overview .tk-ov-card.is-waiting::before { background: hsl(197 37% 40%); }
#ticket-overview .tk-ov-card.is-progress::before { background: hsl(189 80% 42%); }
#ticket-overview .tk-ov-card.is-done::before,
#ticket-overview .tk-ov-card.is-closed::before { background: hsl(var(--chart-2)); }
#ticket-overview .tk-ov-card.is-total::before { background: hsl(var(--primary)); }
#ticket-overview .tk-ov-card.is-open::before { background: hsl(24 95% 53%); }
#ticket-overview .tk-ov-card.is-cancelled::before { background: hsl(var(--destructive)); }
#ticket-overview .tk-ov-card.is-hold::before { background: hsl(214 80% 52%); }
#ticket-overview .tk-ov-card.is-warranty::before { background: hsl(var(--chart-4)); }
#ticket-overview .tk-ov-card.is-waiting .rd-kpi-val { color: hsl(197 37% 32%); }
#ticket-overview .tk-ov-card.is-progress .rd-kpi-val { color: hsl(189 80% 32%); }
#ticket-overview .tk-ov-card.is-done .rd-kpi-val,
#ticket-overview .tk-ov-card.is-closed .rd-kpi-val { color: hsl(var(--chart-2)); }
#ticket-overview .tk-ov-card.is-total .rd-kpi-val { color: hsl(var(--primary)); }
#ticket-overview .tk-ov-card.is-open .rd-kpi-val { color: hsl(24 90% 40%); }
#ticket-overview .tk-ov-card.is-cancelled .rd-kpi-val { color: hsl(var(--destructive)); }
#ticket-overview .tk-ov-card.is-hold .rd-kpi-val { color: hsl(214 80% 40%); }
#ticket-overview .tk-ov-card.is-warranty .rd-kpi-val { color: hsl(38 70% 35%); }
.rd-filter-check-field { justify-content: flex-end; }
.rd-filter-check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
  margin: 0;
}
.rd-filter-check .badge { margin-left: var(--space-1); }

/* ========== Point of Sale ========== */
.app-body:has(.pos-page) {
  height: 100dvh;
  overflow: hidden;
}
.app-body:has(.pos-page) .app-main,
.app-body:has(.pos-page) .content {
  min-height: 0;
  overflow: hidden;
}
.app-body:has(.pos-page) .content {
  display: flex;
  flex-direction: column;
}
.pos-page {
  max-width: 100%;
  --pos-accent: var(--primary);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.btn-icon {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  flex-shrink: 0;
}
.btn-icon.btn-sm { width: 2rem; height: 2rem; }
.pos-header-bar {
  margin-bottom: 0.75rem;
  padding: 0.35rem 1rem;
  flex-shrink: 0;
}
.pos-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  overflow-x: auto;
}
.pos-tab {
  height: 2.25rem;
  padding: 0 1rem;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.pos-tab:hover { background: hsl(var(--accent)); }
.pos-tab.is-active {
  background: hsl(var(--foreground) / 0.1);
  color: hsl(var(--foreground));
}
.pos-layout {
  display: grid;
  grid-template-columns: minmax(300px, 44%) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
@media (max-width: 960px) {
  .app-body:has(.pos-page) { height: auto; overflow: auto; }
  .pos-layout { grid-template-columns: 1fr; min-height: auto; overflow: visible; }
  .pos-tabs { justify-content: flex-start; }
  .pos-cart, .pos-catalog { min-height: 70vh; max-height: none; }
}
.pos-cart, .pos-catalog {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  padding: 0;
  overflow: hidden;
}
.pos-customer-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid hsl(var(--border));
}
.pos-customer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
}
.pos-customer-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.pos-customer-links[hidden] { display: none !important; }
.pos-customer-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0;
  border: 0;
  background: none;
  color: hsl(var(--primary));
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.pos-customer-link:hover { text-decoration: underline; }
.pos-customer-extra {
  font-size: 14px;
  color: hsl(var(--muted-foreground));
  line-height: 1.4;
}
.pos-customer-main { display: flex; align-items: flex-start; gap: 0.75rem; min-width: 0; flex: 1; }
.pos-customer-main[hidden],
.pos-customer-search-wrap[hidden],
.pos-customer-results[hidden] {
  display: none !important;
}
.pos-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}
.pos-customer-meta { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.pos-customer-name { font-weight: 500; font-size: 0.9375rem; }
.pos-customer-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: fit-content;
  max-width: 100%;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--foreground) / 0.05);
  border-radius: 0.25rem;
  padding: 0.05rem 0.35rem;
}
.pos-customer-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-customer-actions { display: flex; align-items: center; gap: 0.35rem; }
.pos-customer-search-wrap { flex: 1; position: relative; min-width: 0; }
.pos-customer-results {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 0.25rem);
  max-height: 16rem;
  overflow: auto;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  box-shadow: 0 8px 24px hsl(var(--foreground) / 0.08);
  z-index: 20;
}
.pos-customer-hit {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.pos-customer-hit:hover { background: hsl(var(--accent)); }
.pos-menu { position: relative; }
.pos-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  min-width: 10rem;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  padding: 0.35rem;
  z-index: 20;
  box-shadow: 0 8px 24px hsl(var(--foreground) / 0.08);
}
.pos-menu-item {
  display: block;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 0.875rem;
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
}
.pos-menu-item:hover { background: hsl(var(--accent)); }
[data-theme="dark"] .pos-page,
.dark .pos-page { --pos-accent: var(--primary); }
.pos-inv-search { position: relative; padding: 0.75rem 0.9rem; border-bottom: 1px solid hsl(var(--border)); }
.pos-inv-search .input {
  padding-right: 2.5rem;
  height: 2.15rem;
  font-size: 0.875rem;
}
.pos-inv-search-icon {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
  pointer-events: none;
}
.pos-cart-table-wrap {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.pos-cart-table {
  margin: 0;
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.3;
  flex: 0 0 auto;
}
.pos-cart-table th,
.pos-cart-table td {
  padding: 10px 10px 12px;
  vertical-align: top;
  border: 0;
  font-weight: 400;
}
.pos-cart-table thead th {
  padding: 8px 10px;
  border-bottom: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
}
.pos-cart-table tbody tr { border-bottom: 1px solid hsl(var(--border)); }
.pos-cart-table th:nth-child(1),
.pos-cart-table td:nth-child(1) { width: 2.75rem; padding-left: 12px; padding-right: 6px; }
.pos-cart-table th:nth-child(2),
.pos-cart-table td:nth-child(2) {
  min-width: 10rem;
  padding-right: var(--space-3);
}
.pos-cart-table th:nth-child(3),
.pos-cart-table td:nth-child(3) {
  width: 5.75rem;
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}
.pos-cart-table th:nth-child(4),
.pos-cart-table td:nth-child(4) {
  width: 7.5rem;
  min-width: 7.5rem;
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}
.pos-cart-table th:nth-child(5),
.pos-cart-table td:nth-child(5) {
  width: 4.5rem;
  text-align: right;
  white-space: nowrap;
  padding-left: var(--space-2);
  padding-right: 14px;
}
.pos-cart-empty {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-3);
  text-align: center;
}
.pos-cart-empty[hidden] {
  display: none !important;
}
.pos-qty-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 1px;
}
.pos-qty-stack .pos-qty {
  width: 32px;
  height: 32px;
  text-align: center;
  padding: 0;
  font-size: 14px;
  font-weight: 400;
  border-radius: 6px;
  border-color: hsl(var(--border));
  -moz-appearance: textfield;
}
.pos-qty-stack .pos-qty::-webkit-outer-spin-button,
.pos-qty-stack .pos-qty::-webkit-inner-spin-button,
.pos-price::-webkit-outer-spin-button,
.pos-price::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.pos-qty-stack .pos-remove {
  color: hsl(240 5% 64%);
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  line-height: 0;
}
.pos-qty-stack .pos-remove svg { width: 15px; height: 15px; }
.pos-qty-stack .pos-remove:hover {
  color: hsl(var(--destructive));
  background: transparent;
}
.pos-item-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
  padding-top: 2px;
  padding-right: var(--space-2);
}
.pos-item-device {
  color: hsl(var(--pos-accent));
  font-weight: 400;
  font-size: 12px;
  line-height: 1.3;
}
.pos-item-title {
  color: hsl(var(--pos-accent));
  font-weight: 500;
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.pos-item-sku {
  color: hsl(240 4% 46%);
  font-size: 12px;
  line-height: 1.35;
  margin-top: 0;
}
.pos-item-sku strong { font-weight: 600; color: hsl(240 5% 34%); }
.pos-item-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-1);
  font-size: 12px;
}
.pos-info-btn,
.pos-note-btn,
.pos-stock-btn,
.pos-disc-btn {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: hsl(var(--pos-accent));
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
}
.pos-item-sep { color: hsl(var(--pos-accent)); opacity: 0.7; }
.pos-stock-btn {
  display: inline-block;
  width: max-content;
  max-width: 100%;
  margin-top: var(--space-1);
  font-size: 12px;
  white-space: nowrap;
}
.pos-price-cell { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); padding-top: 1px; }
.pos-disc-row {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.pos-disc-clear {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  color: hsl(var(--destructive));
  opacity: 0.85;
}
.pos-disc-clear:hover { opacity: 1; }
.pos-price-cell .pos-price {
  box-sizing: border-box;
  width: 58px;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  text-align: center;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 400;
  line-height: 30px;
  border-radius: 6px;
  -moz-appearance: textfield;
}
.pos-disc-btn {
  font-size: 13px;
  color: hsl(240 6% 25%);
  font-weight: 400;
}
.pos-tax-cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-1);
  padding-top: 1px;
  min-width: 0;
}
.pos-tax-pct {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  line-height: 1.3;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  align-self: flex-start;
  order: 2;
}
.pos-tax-pct:hover { color: hsl(var(--primary)); }
.pos-tax {
  box-sizing: border-box;
  order: 1;
  width: 100%;
  max-width: 7.25rem;
  min-width: 0;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  padding: 0 24px 0 var(--space-2);
  font-size: 12px;
  font-weight: 400;
  line-height: 30px;
  border-radius: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
.pos-line-total {
  font-weight: 400;
  font-size: 14px;
  color: hsl(240 6% 20%);
  padding-top: 8px !important;
}
.pos-line-total.pos-line-credit {
  color: var(--destructive, #b91c1c);
  font-weight: 600;
}
#pos-credit-row strong {
  color: var(--destructive, #b91c1c);
}
.pos-info-dl { display: grid; gap: 0.5rem; margin: 0; }
.pos-info-dl > div { display: grid; grid-template-columns: 6rem 1fr; gap: 0.5rem; font-size: 0.875rem; }
.pos-info-dl dt { color: hsl(var(--muted-foreground)); margin: 0; }
.pos-info-dl dd { margin: 0; }
.pos-totals {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid hsl(var(--border));
}
.pos-totals > div {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  font-weight: 500;
}
.pos-total-final {
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 0.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid hsl(var(--border));
}
.pos-catalog { padding: 1rem; gap: 0.75rem; overflow: hidden; min-height: 0; }
.pos-catalog-modes { flex-shrink: 0; }
.pos-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.75rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  flex-shrink: 0;
}
.pos-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.75rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.pos-breadcrumb button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font: inherit;
}
.pos-breadcrumb button:hover { text-decoration: underline; }
.pos-breadcrumb button.is-current {
  color: hsl(var(--primary));
  font-weight: 600;
}
.pos-breadcrumb button.is-muted { opacity: 0.55; cursor: default; }
.pos-breadcrumb .pos-bc-sep { opacity: 0.5; }
.pos-catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}
.pos-catalog-toolbar-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.pos-section-search { position: relative; flex: 1; min-width: 8rem; max-width: 20rem; }
.pos-section-search-icon {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
  pointer-events: none;
  display: flex;
  align-items: center;
  z-index: 1;
}
.pos-section-search .input { padding-left: 2.25rem; }
#pos-category-add { flex-shrink: 0; white-space: nowrap; }
.pos-catalog-tools { display: flex; gap: 8px; flex-shrink: 0; margin-left: auto; }
.pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  grid-auto-rows: max-content;
  gap: var(--space-3);
  flex: 1 1 0;
  align-content: start;
  min-height: 0;
  overflow: auto;
}
.pos-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
  padding: 0.75rem;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--background));
  cursor: pointer;
  min-height: 4.5rem;
}
.pos-card:hover { background: hsl(var(--accent)); }
.pos-card strong { font-size: 0.875rem; font-weight: 600; line-height: 1.25; }
.pos-card .muted { font-size: 0.875rem; }
.pos-card-cat {
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 8.75rem;
  gap: 0.7rem;
  padding: 1rem 0.75rem;
}
.pos-card-icon {
  width: 2.35rem;
  height: 2.35rem;
  color: hsl(var(--foreground));
  flex-shrink: 0;
}
.pos-card-img {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
  border-radius: calc(var(--radius) - 2px);
  flex-shrink: 0;
  background: hsl(var(--muted) / 0.35);
}
.cat-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  vertical-align: middle;
}
.pos-grid-label {
  grid-column: 1 / -1;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
  margin-top: 0.5rem;
}
.pos-grid-more {
  grid-column: 1 / -1;
  text-align: center;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  padding: var(--space-4) 0;
}
.pos-grid-empty {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 10rem;
  color: hsl(var(--muted-foreground));
}
.pos-details {
  grid-column: 1 / -1;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 40rem;
}
.pos-details .card-title { margin: 0; }
.tk-pattern-pad {
  margin: var(--space-2) auto var(--space-3);
}
.pos-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid hsl(var(--border));
  flex-shrink: 0;
}
@media (max-width: 720px) {
  .pos-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.pos-action { height: 2.5rem; width: 100%; text-decoration: none; }
.pos-action-ticket {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: transparent;
}
.pos-action-ticket:hover { background: hsl(var(--primary)); opacity: 0.9; }
.pos-action-cancel {
  background: hsl(var(--destructive) / 0.2);
  color: hsl(var(--destructive));
  border-color: transparent;
}
.pos-action-cancel:hover { background: #f87171; opacity: 1; }
.pos-action-checkout {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: transparent;
}
.pos-action-checkout:hover { background: hsl(var(--primary)); opacity: 0.9; }
.pos-add-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.pos-add-grid .span-all { grid-column: 1 / -1; }
.pos-dialog-wide { max-width: 32rem; }
.pos-dialog.pos-ti-dialog {
  width: min(68rem, calc(100vw - var(--space-8)));
  max-width: 68rem;
  max-height: calc(100vh - var(--space-8));
  overflow: auto;
}
.pos-ti-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4) var(--space-6);
  align-items: start;
}
.pos-ti-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  align-items: start;
}
.pos-ti-grid .field,
.pos-ti-split > .field,
.pos-ti-dialog .field { margin-bottom: 0; }
.pos-ti-sign {
  display: block;
  width: 100%;
  height: 10rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.25rem;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}
.pos-ti-grid .span-all { grid-column: 1 / -1; }
.pos-warranty-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-height: 20rem;
  overflow: auto;
}
.pos-warranty-card {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: hsl(var(--card));
}
.pos-warranty-card-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: flex-start;
}
.pos-warranty-meta {
  display: grid;
  gap: var(--space-2);
  font-size: 14px;
}
.pos-warranty-meta div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: var(--space-3);
}
.pos-warranty-meta span:first-child { color: hsl(var(--muted-foreground)); }
.pos-search-results {
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  max-height: 12rem;
  overflow: auto;
  background: hsl(var(--background));
}
.pos-search-hit {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-bottom: 1px solid hsl(var(--border));
  background: transparent;
  cursor: pointer;
  font-size: 0.875rem;
  text-align: left;
}
.pos-search-hit:hover { background: hsl(var(--accent)); }
.pos-dialog {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.25rem;
  max-width: 24rem;
  width: calc(100% - 2rem);
}
.pos-dialog::backdrop { background: rgba(0, 0, 0, 0.35); }
.pos-confirm-dialog {
  max-width: 36rem;
  padding: var(--space-5);
}
.pos-more-dialog {
  max-width: 40rem;
  padding: var(--space-5);
}
.pos-more-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.pos-more-grid .pos-confirm-btn {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: transparent;
  min-height: 6.5rem;
}
.pos-more-grid .pos-confirm-ico { color: inherit; }
.pos-more-grid .pos-confirm-btn:hover {
  background: hsl(var(--primary));
  border-color: transparent;
  filter: brightness(1.08);
}
.pos-more-grid .pos-confirm-btn.is-on {
  background: color-mix(in srgb, hsl(var(--primary)) 72%, white);
}
.pos-confirm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}
.pos-confirm-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 5.5rem;
  padding: var(--space-3);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}
.pos-confirm-btn:hover {
  border-color: hsl(var(--primary));
  background: hsl(var(--accent));
}
.pos-confirm-ico {
  display: inline-flex;
  color: hsl(var(--primary));
}
.pos-confirm-btn .badge {
  display: inline-block;
  margin-left: var(--space-1);
  padding: 0 var(--space-1);
  border-radius: 4px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  vertical-align: middle;
}
@media (max-width: 800px) {
  .pos-ti-split { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .pos-confirm-grid,
  .pos-more-grid,
  .pos-ti-grid { grid-template-columns: 1fr; }
}

/* Invoice History modal (RepairDesk-style) */
.pos-history-dialog {
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  width: min(1180px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  flex-direction: column;
  overflow: hidden;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: 0 16px 48px hsl(var(--foreground) / 0.2);
}
.pos-history-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.pos-history-dialog[open] { display: flex; }
.pos-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid hsl(var(--border));
}
.pos-history-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.pos-history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-5);
}
.pos-history-pager-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-left: auto;
}
.pos-history-pages {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pos-history-pages button {
  min-width: 32px;
  height: 32px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
}
.pos-history-pages button.is-active,
.pos-history-pages button:hover {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.pos-history-filters {
  padding: 0 var(--space-5) var(--space-3);
}
.pos-history-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.pos-history-table-wrap {
  overflow: auto;
  padding: 0 var(--space-5) var(--space-5);
  flex: 1;
}
.pos-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.pos-history-table th,
.pos-history-table td {
  border: 1px solid hsl(var(--border));
  padding: var(--space-2) var(--space-3);
  vertical-align: top;
  text-align: left;
}
.pos-history-table th {
  background: hsl(var(--muted));
  font-weight: 600;
  white-space: nowrap;
}
.pos-history-table a {
  color: hsl(var(--primary));
  font-weight: 600;
  text-decoration: underline;
}
.pos-history-date { white-space: nowrap; }
.pos-history-date small { display: block; color: hsl(var(--muted-foreground)); }
.pos-history-contact { white-space: nowrap; font-size: 14px; }
.pos-history-products { max-width: 14rem; }
.pos-history-products div + div { margin-top: 2px; }
.pos-history-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.pos-history-status.is-due { background: hsl(var(--chart-5, 25 90% 48%)); }
.pos-history-status.is-partial { background: hsl(38 92% 45%); }
.pos-history-status.is-refunded { background: hsl(var(--destructive)); }
.pos-history-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 7.5rem;
}
.pos-history-actions .btn {
  justify-content: flex-start;
  height: 28px;
  padding: 0 var(--space-2);
  font-size: 14px;
  background: #fff;
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
}
.pos-history-refund-note {
  color: hsl(var(--destructive));
  font-size: 14px;
  margin-top: 2px;
}
.pos-pay-history-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: var(--space-2);
}
@media (max-width: 900px) {
  .pos-history-filter-grid { grid-template-columns: 1fr 1fr; }
}
.pos-tender-quick { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.pos-mode-toggle {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}
.pos-grid .pos-mode-toggle { grid-column: 1 / -1; }
.pos-grid .pos-tradein-hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 14px;
}
.pos-mode-toggle .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.pos-product-modes { margin-bottom: 0.35rem; }
.pos-product-card {
  min-height: 10rem;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
}
.pos-product-card strong,
.pos-product-stock,
.pos-product-condition {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.pos-product-img {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: contain;
  border-radius: 0.25rem;
}
.pos-product-img-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  background: hsl(var(--muted) / 0.35);
  border-radius: calc(var(--radius) - 2px);
  color: hsl(var(--muted-foreground));
}
.pos-product-img-empty .pos-card-icon {
  width: 2rem;
  height: 2rem;
}
.pos-product-price {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 0.35rem;
  background: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
  font-weight: 600;
  font-size: 0.875rem;
}
.pos-product-condition {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.pos-product-stock {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.pos-product-stock.is-out,
.stock-out-label {
  color: hsl(var(--destructive));
  font-weight: 600;
}
.pos-card-add {
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 8.75rem;
  gap: var(--space-3);
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
  text-decoration: none;
}
a.pos-card-add { color: hsl(var(--primary-foreground)); }
.pos-card-add:hover { filter: brightness(0.95); background: hsl(var(--primary)); }
.pos-bill-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  max-width: 100%;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
}
.pos-bill-plan strong { font-size: 1.125rem; font-weight: 600; }
.pos-card-add-plus { font-size: 1.75rem; line-height: 1; font-weight: 600; }
.pos-card-add strong { color: inherit; font-size: 0.875rem; font-weight: 600; }
.pos-grid.pos-grid-issues {
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
}
.pos-grid.pos-grid-details { display: block; }
.pos-grid-empty { grid-column: 1 / -1; }
.pos-bundle-save {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
}
.pos-issue {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 10rem;
  padding: var(--space-4);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--background));
  text-align: center;
  cursor: pointer;
}
.pos-issue:hover,
.pos-issue.is-on { border-color: hsl(var(--primary)); }
.pos-issue.is-on { box-shadow: inset 0 0 0 1px hsl(var(--primary)); }
.pos-issue strong { font-size: 14px; font-weight: 600; line-height: 20px; }
.pos-issue .pos-card-icon { width: 24px; height: 24px; color: hsl(var(--primary)); }
.pos-issue-check {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  width: 16px;
  height: 16px;
  border: 1px solid hsl(var(--border));
  border-radius: 4px;
  background: hsl(var(--background));
}
.pos-issue-check.is-on {
  display: flex;
  align-items: center;
  justify-content: center;
  border-color: hsl(var(--primary));
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.pos-price-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px var(--space-2);
  border-radius: var(--radius);
  background: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
  font-size: 14px;
  font-weight: 600;
}
.pos-issue-stock { font-size: 14px; font-weight: 600; }
.pos-issue-stock.is-out { color: hsl(var(--destructive)); }
.pos-issue-hand { height: auto; padding: 0; }
.pos-issue-add { min-height: 10rem; }
button.pos-card {
  font: inherit;
  width: 100%;
}
button.pos-card-add { color: hsl(var(--primary-foreground)); }
.pos-misc-menu {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  z-index: 2;
}
.pos-misc-menu .btn { color: hsl(var(--muted-foreground)); }
.pos-misc-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 40px;
  margin: 0;
  padding: 0 var(--space-3);
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--background));
}
.pos-misc-toggle > span {
  font-size: 14px;
  font-weight: 500;
}
.pos-misc-toggle .switch {
  display: inline-flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
  line-height: 0;
}
.pos-misc-toggle .switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.pos-misc-toggle .switch-ui {
  display: inline-block;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  position: relative;
  transition: background .15s ease, border-color .15s ease;
}
.pos-misc-toggle .switch-ui::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px hsl(var(--foreground) / 0.18);
  transition: transform .15s ease;
}
.pos-misc-toggle .switch input:checked + .switch-ui {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
}
.pos-misc-toggle .switch input:checked + .switch-ui::after {
  transform: translateX(16px);
}
.pos-misc-toggle .switch input:focus-visible + .switch-ui {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}
.pos-repair-details { display: flex; flex-direction: column; gap: var(--space-4); }
.pos-repair-toolbar { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.pos-repair-toolbar-gap { flex: 1; }
.pos-repair-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.pos-repair-col { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4); }
.pos-split { display: flex; gap: var(--space-2); }
.pos-split .select { max-width: 7.5rem; }
.pos-split .input { flex: 1; }
.pos-split-suffix {
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  min-width: 4.5rem;
}
.pos-lock-tabs { display: flex; border: 1px solid hsl(var(--border)); border-radius: var(--radius); overflow: hidden; }
.pos-lock-tab {
  flex: 1;
  height: 40px;
  border: 0;
  background: hsl(var(--background));
  cursor: pointer;
  font: inherit;
  font-size: 14px;
}
.pos-lock-tab.is-on { background: hsl(var(--accent)); font-weight: 600; }
.pos-charge-row,
.pos-check-line { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.pos-check-line { justify-content: flex-start; }
.pos-charge-row {
  padding: var(--space-3);
  border-radius: var(--radius);
  background: hsl(var(--accent));
}
.pos-charge-row strong { font-size: 16px; }
.pos-repair-col .badge { align-self: flex-start; }
.pos-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.pos-dialog-head h2 { margin: 0; font-size: 18px; }
.pos-dialog-checklist { width: min(52rem, calc(100vw - 32px)); max-width: 52rem; }
.pos-cond-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.pos-cond {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
}
.pos-cond-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px var(--space-3);
  border-radius: var(--radius);
  background: hsl(var(--accent));
  color: hsl(var(--muted-foreground));
  font-size: 14px;
}
.pos-cond-pill.is-working { background: hsl(var(--primary) / 0.15); color: hsl(var(--primary)); }
.pos-cond-pill.is-notWorking { background: hsl(var(--destructive) / 0.12); color: hsl(var(--destructive)); }
.pos-image-tools { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.pos-image-tab {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 var(--space-4);
  border-radius: var(--radius);
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-weight: 600;
}
.pos-image-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  min-height: 16rem;
  padding: var(--space-6);
  border: 1px dashed hsl(var(--border));
  border-radius: var(--radius);
}
.pos-image-list { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.pos-image-thumb { position: relative; margin: 0; }
.pos-image-thumb img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--radius); }
.pos-image-thumb button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: hsl(var(--background));
  cursor: pointer;
}
.pos-image-video { width: min(100%, 24rem); border-radius: var(--radius); }
@media (max-width: 800px) {
  .pos-repair-cols,
  .pos-cond-grid { grid-template-columns: 1fr; }
}
.pos-pricing-card {
  grid-column: 1 / -1;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pos-grade-row { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.muted { color: hsl(var(--muted-foreground)); }

.inv-page {
  background: hsl(var(--muted));
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.inv-sheet {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: var(--space-5);
}
.inv-title-row { margin-bottom: var(--space-5); }
.inv-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.inv-title-edit {
  font-size: 1rem;
  color: hsl(var(--muted-foreground));
  font-weight: 400;
}
.inv-hero {
  display: grid;
  grid-template-columns: 1.15fr 1.1fr 1fr;
  gap: var(--space-6);
  align-items: start;
}
@media (max-width: 1100px) {
  .inv-hero { grid-template-columns: 1fr; }
}
.inv-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.inv-cust-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr auto auto;
  gap: var(--space-2);
  align-items: center;
}
.inv-cust-combo,
.inv-cust-ss,
.lead-cust-ss,
.tk-cust-ss {
  min-width: 10rem;
  flex: 1;
}
.inv-walkin {
  grid-column: 2 / -1;
  margin-top: var(--space-2);
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.inv-new-btn,
.inv-cta,
.inv-add-row {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.inv-new-btn:hover,
.inv-cta:hover,
.inv-add-row:hover { opacity: 0.9; }
.inv-notes-btn {
  background: hsl(var(--secondary));
  border-color: hsl(var(--border));
  color: hsl(var(--secondary-foreground));
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.inv-dates {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.inv-field-inline {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: var(--space-3);
  align-items: center;
}
.inv-due-wrap { display: flex; flex-direction: column; gap: var(--space-1); }
.inv-upon {
  color: hsl(var(--destructive));
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.inv-hero-col .field { margin-bottom: var(--space-4); }
.inv-hero-col .field:last-child { margin-bottom: 0; }
.inv-terms { min-height: 7.5rem; }
.inv-pay { padding: var(--space-4); }
.inv-pay-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}
@media (max-width: 900px) {
  .inv-pay-grid { grid-template-columns: 1fr 1fr; }
}
.inv-pay-hist { margin: var(--space-3) 0 0; }
.inv-table-wrap {
  overflow: auto;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
}
.inv-items {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 72rem;
}
.inv-items th,
.inv-items td {
  border: 1px solid hsl(var(--border));
  padding: var(--space-2);
  vertical-align: top;
  background: hsl(var(--card));
}
.inv-items th {
  background: hsl(var(--muted));
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.inv-items .input,
.inv-items .select,
.inv-items .textarea { width: 100%; }
.inv-cell-area { min-height: 6rem; resize: vertical; }
.inv-td-sku { width: 9rem; }
.inv-td-name { width: 14rem; }
.inv-td-money {
  min-width: 5.5rem;
  padding-top: var(--space-3);
}
.inv-link {
  border: 0;
  background: none;
  color: hsl(var(--primary));
  font-size: 0.875rem;
  padding: var(--space-1) 0 0;
  cursor: pointer;
}
.inv-add-row { white-space: nowrap; }
.inv-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-5);
  flex-wrap: wrap;
  padding: var(--space-4) 0 var(--space-6);
}
.inv-add-btns { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.inv-totals {
  width: min(22rem, 100%);
  border-collapse: collapse;
  font-size: 0.875rem;
  background: hsl(var(--card));
}
.inv-totals th,
.inv-totals td {
  border: 1px solid hsl(var(--border));
  padding: var(--space-3);
}
.inv-totals th {
  text-align: left;
  font-weight: 600;
  width: 46%;
  background: hsl(var(--card));
}
.inv-totals td { text-align: right; }
.inv-totals-grand th,
.inv-totals-grand td {
  font-weight: 700;
  background: hsl(var(--muted));
}
.inv-savebar {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  background: transparent;
}
.inv-save,
.inv-save-list {
  min-height: 2.5rem;
  padding-inline: var(--space-4);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.inv-save {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.inv-save:hover,
.inv-save-list:hover { opacity: 0.9; }
.inv-combo { position: relative; }
.inv-menu {
  /* JS sets position:fixed so .inv-table-wrap overflow cannot clip it. */
  position: absolute;
  z-index: 300;
  left: 0;
  right: auto;
  min-width: 100%;
  width: max(100%, 22rem);
  top: calc(100% + 4px);
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  box-shadow: 0 8px 24px hsl(240 10% 3.9% / 0.08);
  max-height: 16rem;
  overflow: auto;
}
.inv-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  font-size: 0.875rem;
  color: inherit;
}
.inv-menu-item:hover { background: hsl(var(--accent)); }
.inv-td-name .inv-menu { min-width: 24rem; }
.inv-menu-sku,
.inv-menu-meta,
.inv-menu-price {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}
.inv-menu-price { margin-left: auto; }
.inv-menu-empty {
  padding: var(--space-3);
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}
#recharge-page.stack {
  gap: var(--space-6);
}
#recharge-page .rc-section .card-header {
  align-items: flex-start;
}
#recharge-page .rc-section .card-desc {
  margin-top: var(--space-1);
}
#recharge-page .rd-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  vertical-align: middle;
}

.po-page .po-pick-wrap { position: relative; }
.po-page .table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
}
.po-page .po-pick-menu {
  z-index: 300;
  width: 20rem;
  max-width: min(20rem, calc(100vw - 16px));
  min-width: 0;
}
.po-page .po-pick-menu .inv-menu-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: var(--space-2);
  row-gap: 2px;
  align-items: start;
}
.po-page .po-pick-main {
  grid-column: 1;
  grid-row: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.po-page .po-pick-sub {
  grid-column: 1;
  grid-row: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.po-page .po-pick-menu .inv-menu-price {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  margin-left: 0;
  white-space: nowrap;
}
/* Tax / supplier search-select menus already use position:fixed via search-select.js */
.po-page #po-kpis,
#po-list-page #po-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 16rem));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.po-page .form-grid.span-all,
.po-page .form-grid .span-all { grid-column: 1 / -1; }
.inv-modal {
  position: fixed;
  inset: 0;
  background: hsl(240 10% 3.9% / 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: var(--space-5);
}
.inv-modal-card {
  width: min(28rem, 100%);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.inv-modal-title { margin: 0; font-size: 1.125rem; font-weight: 600; }
.inv-td-disc {
  display: grid;
  gap: var(--space-1);
  min-width: 6.5rem;
}
.inv-disc-display {
  text-align: right;
  cursor: pointer;
  justify-content: flex-end;
}
.inv-disc-reason { font-size: 0.875rem; line-height: 1.3; }
.inv-totals-disc {
  display: grid;
  gap: var(--space-1);
  justify-items: end;
}
.inv-totals-disc-val { font-weight: 500; }
.inv-disc-modal { width: min(28rem, 100%); }
.inv-disc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.inv-disc-banner {
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  background: hsl(var(--primary) / 0.08);
  color: hsl(var(--foreground));
  font-size: 0.875rem;
}
.inv-disc-banner-title {
  font-weight: 600;
  color: hsl(var(--primary));
  margin-bottom: var(--space-1);
}
.inv-disc-banner p { margin: 0 0 var(--space-2); color: hsl(var(--muted-foreground)); }
.inv-disc-banner-link { color: hsl(var(--primary)); font-weight: 600; font-size: 0.875rem; }
.inv-disc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.inv-disc-label { font-size: 0.875rem; font-weight: 500; }
.inv-disc-name { font-weight: 600; }
.inv-disc-type {
  display: inline-flex;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
}
.inv-disc-type-btn {
  border: 0;
  background: hsl(var(--card));
  min-width: 2.5rem;
  height: 2.25rem;
  cursor: pointer;
  color: hsl(var(--foreground));
}
.inv-disc-type-btn.is-on {
  background: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
  box-shadow: inset 0 0 0 1px hsl(var(--primary));
}
.inv-activity {
  margin-top: var(--space-5);
  padding: 0;
  overflow: hidden;
}
.inv-act-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  width: 100%;
  padding: 0 var(--space-4);
  border-bottom: 1px solid hsl(var(--border));
  overflow-x: auto;
}
.inv-act-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: hsl(var(--muted-foreground));
  padding: var(--space-4);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.inv-act-tab:hover { color: hsl(var(--foreground)); }
.inv-act-tab.is-on {
  color: hsl(var(--primary));
  font-weight: 600;
  border-bottom-color: hsl(var(--primary));
}
.inv-act-body { padding: var(--space-4) var(--space-5) var(--space-5); display: grid; gap: var(--space-4); }
.inv-act-compose { display: grid; gap: var(--space-3); }
.inv-act-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.inv-act-row label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin: 0;
}
.inv-act-row .input,
.inv-act-row .select { min-width: 8rem; }
.inv-priv-write {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}
.inv-priv-write .textarea { flex: 1; }
.inv-act-list { display: grid; gap: var(--space-3); }
.inv-act-item { display: flex; gap: var(--space-3); font-size: 0.875rem; }
.inv-act-av {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
}
.inv-act-text { font-weight: 500; }
.inv-act-text strong { color: hsl(var(--primary)); }
.inv-act-empty { margin: 0; padding: var(--space-3) 0; }

/* ========== Lock screen ========== */
.lock-screen {
  --lock-bg: var(--primary);
  --lock-fg: var(--primary-foreground);
  margin: 0;
  min-height: 100vh;
  background: hsl(var(--lock-bg));
  color: hsl(var(--lock-fg));
  font-family: var(--font-sans);
  overflow: hidden;
  position: relative;
}
[data-theme="dark"] .lock-screen,
.dark .lock-screen {
  --lock-bg: var(--background);
  --lock-fg: var(--foreground);
}
.lock-screen-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.lock-screen-lines path {
  fill: none;
  stroke: hsl(var(--lock-fg) / 0.18);
  stroke-width: 1.25;
}
.lock-user {
  position: absolute;
  top: var(--space-4);
  right: var(--space-8);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-3);
}
.lock-user-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: hsl(var(--lock-fg) / 0.12);
  border: 1px solid hsl(var(--lock-fg) / 0.2);
  border-radius: 999px;
  padding: var(--space-1) var(--space-3) var(--space-1) var(--space-1);
  font-size: 0.875rem;
  font-weight: 500;
  color: inherit;
}
.lock-user-chip-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: hsl(var(--lock-fg) / 0.2);
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
}
.lock-logout {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: inherit;
  text-decoration: none;
  font-size: 0.875rem;
  background: transparent;
  border: 0;
  white-space: nowrap;
}
.lock-logout:hover { opacity: 0.8; }
.lock-main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
  gap: var(--space-3);
  text-align: center;
}
.lock-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: hsl(var(--lock-fg) / 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}
.lock-badge .icon { width: 18px; height: 18px; }
.lock-clock {
  font-size: 4.5rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  color: inherit;
}
.lock-date {
  font-size: 0.875rem;
  color: hsl(var(--lock-fg) / 0.72);
  margin-bottom: var(--space-4);
}
.lock-avatar {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background: hsl(var(--lock-fg) / 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 600;
  color: inherit;
}
.lock-name {
  font-size: 0.9375rem;
  font-weight: 500;
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
}
.lock-pin-form {
  width: min(16rem, 100%);
}
.lock-screen .lock-pin-input {
  height: 40px;
  text-align: center;
  background: hsl(var(--lock-fg) / 0.12);
  border-color: hsl(var(--lock-fg) / 0.22);
  color: hsl(var(--lock-fg));
}
.lock-screen .lock-pin-input::placeholder {
  color: hsl(var(--lock-fg) / 0.65);
}
.lock-screen .lock-pin-input:focus {
  box-shadow: 0 0 0 2px hsl(var(--lock-fg) / 0.28);
}
.lock-error {
  margin: var(--space-2) 0 0;
  font-size: 0.875rem;
  color: hsl(var(--destructive));
}
.lock-hint {
  margin: 0;
  font-size: 0.875rem;
  color: hsl(var(--lock-fg) / 0.72);
}
.lock-method-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.pattern-pad {
  width: 14rem;
  height: 14rem;
  position: relative;
  margin: 0 auto;
  align-self: center;
  touch-action: none;
  user-select: none;
  cursor: pointer;
}
.pattern-pad-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.pattern-pad-svg line {
  stroke: hsl(var(--primary));
  stroke-width: 3;
  stroke-linecap: round;
}
.lock-screen .pattern-pad-svg line {
  stroke: hsl(var(--lock-fg));
}
.pattern-pad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 100%;
  height: 100%;
  position: relative;
}
.pattern-pad-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.pattern-pad-dot::after {
  content: '';
  width: var(--space-4);
  height: var(--space-4);
  border-radius: 999px;
  border: 2px solid hsl(var(--primary));
  background: transparent;
}
.pattern-pad-dot.is-on::after {
  width: var(--space-6);
  height: var(--space-6);
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
}
.pattern-pad-step {
  position: relative;
  z-index: 1;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  color: hsl(var(--primary-foreground));
  pointer-events: none;
}
.lock-screen .pattern-pad-dot::after {
  border-color: hsl(var(--lock-fg) / 0.85);
}
.lock-screen .pattern-pad-dot.is-on::after {
  background: hsl(var(--lock-fg));
  border-color: hsl(var(--lock-fg));
}
.lock-screen .pattern-pad-step {
  color: hsl(var(--lock-bg));
}
.pattern-pad.is-error .pattern-pad-dot.is-on::after {
  background: hsl(var(--destructive));
  border-color: hsl(var(--destructive));
}
.pattern-pad.is-error .pattern-pad-svg line {
  stroke: hsl(var(--destructive));
}

.seg-tabs {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}
.cash-stmt-kpis {
  padding: 0;
  gap: var(--space-3);
  margin: var(--space-4) 0;
}
.cash-stmt-kpis .kpi {
  padding: var(--space-4);
  background: hsl(var(--card));
}
.cash-stmt-num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.cash-stmt-in { color: hsl(var(--primary)); }
.cash-stmt-out { color: hsl(var(--destructive)); }
@media print {
  .cash-no-print { display: none !important; }
  #cash-mgmt-tab-list { display: none !important; }
  #cash-mgmt-tab-statement { display: block !important; }
}

/* ========== Searchable select (combobox) ========== */
.search-select {
  position: relative;
  width: 100%;
}
.search-select.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}
.search-select.is-invalid .search-select-input {
  border-color: hsl(var(--destructive));
}
.search-select-input {
  width: 100%;
  padding-right: 2rem;
  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='%2371717a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}
.search-select.is-open .search-select-input {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}
.search-select-menu {
  position: absolute;
  z-index: 200;
  left: 0;
  right: 0;
  top: calc(100% + var(--space-1));
  display: flex;
  flex-direction: column;
  max-height: 18rem;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--popover));
  box-shadow: 0 8px 24px hsl(var(--foreground) / 0.08);
}
/* Keep Device Details inside the page; menus use position:fixed so they still escape clip. */
.lead-card .table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}
.lead-lines-table {
  width: max-content;
  min-width: 100%;
}
.lead-lines-table td {
  position: relative;
}
.rd-inline-filters .search-select.is-open {
  position: relative;
  z-index: 30;
}
.search-select-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  max-height: 12rem;
  padding: var(--space-1);
}
.search-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}
.field:has(.search-select.is-open),
td:has(.search-select.is-open) {
  position: relative;
  z-index: 20;
}
.search-select-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-radius: calc(var(--radius) - 2px);
  font: inherit;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  cursor: pointer;
}
.search-select-option-name {
  font-weight: 500;
}
.search-select-option-meta {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
}
.search-select-option:hover,
.search-select-option.is-active {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}
.search-select-option.is-selected {
  font-weight: 600;
  color: hsl(var(--primary));
}
.search-select-empty {
  padding: var(--space-3);
  font-size: 0.875rem;
}
.search-select-add {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--muted));
  font-size: 0.875rem;
}
.search-select-add-hint {
  color: hsl(var(--muted-foreground));
}
.search-select-add-link {
  color: hsl(var(--primary));
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}
.search-select-add-link:hover {
  text-decoration: underline;
}

/* IMEI field feedback */
.input.is-invalid,
.field .input.is-invalid {
  border-color: hsl(var(--destructive));
}
.imei-hint {
  margin: var(--space-1) 0 0;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.imei-hint.is-error {
  color: hsl(var(--destructive));
}

/* ========== Employees / Permissions ========== */
.staff-page-desc {
  margin: var(--space-2) 0 0;
  max-width: 40rem;
}
.staff-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
}
.staff-filter-field {
  flex: 1 1 18rem;
  margin: 0;
  max-width: 28rem;
}
.staff-filter-meta {
  font-size: 14px;
  padding-bottom: var(--space-2);
}
.staff-table tbody tr:hover {
  background: hsl(var(--accent));
}
.staff-person {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}
.staff-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.staff-person-meta { min-width: 0; }
.staff-person-name {
  font-weight: 600;
  color: hsl(var(--foreground));
  text-decoration: none;
}
.staff-person-name:hover { color: hsl(var(--primary)); }
.staff-contact { display: grid; gap: var(--space-1); }
.staff-bank-ok { font-size: 14px; }
.staff-col-actions { width: 1%; white-space: nowrap; }
.staff-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-end;
}
.staff-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid hsl(var(--border));
}
.staff-dialog {
  max-width: 36rem;
  width: calc(100% - 2rem);
  padding: var(--space-5);
}
.staff-dialog-head { margin-bottom: var(--space-1); }
.staff-dialog-head .card-title { margin: 0; }
.staff-dialog-head .muted { margin: var(--space-1) 0 0; }
.staff-dialog-section {
  padding-top: var(--space-2);
  border-top: 1px solid hsl(var(--border));
}
.staff-dialog-section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.staff-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding-top: var(--space-2);
}

.emp-detail .emp-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(16rem, 3fr);
  gap: var(--space-5);
  align-items: start;
}
.emp-detail .emp-main,
.emp-detail .emp-side {
  min-width: 0;
  gap: var(--space-4);
}
.emp-detail .emp-side {
  position: sticky;
  top: var(--space-4);
}
@media (max-width: 1100px) {
  .emp-detail .emp-layout { grid-template-columns: 1fr; }
  .emp-detail .emp-side { position: static; }
}
.emp-detail .card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
}
.emp-detail .card-header .card-title { margin: 0; }
.emp-detail .card-body { gap: var(--space-4); }
.emp-detail .emp-card-head .muted {
  margin: 0 0 0 auto;
}
.emp-detail .emp-section {
  padding-top: var(--space-4);
  border-top: 1px solid hsl(var(--border));
  display: grid;
  gap: var(--space-4);
}
.emp-detail .emp-section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.emp-detail .emp-perm-grid {
  display: grid;
  gap: var(--space-2);
}
.emp-detail .emp-sched-time {
  max-width: 8rem;
}
.emp-detail .emp-payout-due {
  font-weight: 600;
  color: hsl(var(--destructive));
}
.emp-detail .emp-payout-paid {
  font-weight: 600;
  color: hsl(142 70% 32%);
}

.staff-role-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 768px) {
  .staff-role-cards { grid-template-columns: 1fr 1fr; }
}
.staff-role-card {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.staff-role-card.is-current {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 1px hsl(var(--primary) / 0.25);
}
.staff-role-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.staff-role-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: var(--space-1) var(--space-3);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.staff-role-pill-owner {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.staff-role-pill-employee {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}
.staff-role-stat {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  color: hsl(var(--foreground));
}
.staff-role-card .muted { margin: 0; }

.staff-perm-group { padding: 0; overflow: hidden; }
.staff-perm-group-head {
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 1px solid hsl(var(--border));
}
.staff-perm-group-head .card-title { margin: 0; }
.staff-perm-table .staff-perm-col {
  width: 8rem;
  text-align: center;
}
.staff-perm-label { font-weight: 500; }
.staff-perm-key { font-size: 14px; margin-top: var(--space-1); }
.staff-perm-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.5rem;
  border-radius: 999px;
  padding: var(--space-1) var(--space-3);
  font-size: 14px;
  font-weight: 600;
}
.staff-perm-badge.is-allowed {
  background: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
}
.staff-perm-badge.is-denied {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

/* Invoice view (post-save detail) */
.inv-view-page { display: flex; flex-direction: column; gap: var(--space-4); }
#invoice-view-root {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.inv-view-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  font-size: 14px;
}
.inv-view-crumb a { color: inherit; text-decoration: none; }
.inv-view-crumb a:hover { text-decoration: underline; }
.inv-view-flash { margin: 0; }
.inv-view-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: flex-start;
  justify-content: space-between;
}
.inv-view-title-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}
.inv-view-title {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
}
.inv-view-status {
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.inv-view-status-paid { background: hsl(152 76% 90%); color: hsl(152 60% 28%); }
.inv-view-status-due { background: hsl(0 76% 94%); color: hsl(0 60% 35%); }
.inv-view-status-partial { background: hsl(40 90% 90%); color: hsl(30 70% 30%); }
.inv-view-status-refunded { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.inv-view-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.inv-view-dd { position: relative; }
.inv-view-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  min-width: 14rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 8px 24px hsl(240 10% 3.9% / 0.08);
  display: flex;
  flex-direction: column;
  padding: var(--space-1);
}
.inv-view-menu a,
.inv-view-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
}
.inv-view-menu a:hover,
.inv-view-menu button:hover { background: hsl(var(--accent)); }
.inv-view-danger { color: hsl(var(--destructive)) !important; }
.inv-view-hero { padding: var(--space-5); }
.inv-view-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}
@media (max-width: 960px) {
  .inv-view-cols { grid-template-columns: 1fr; }
}
.inv-view-col-h {
  margin: 0 0 var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid hsl(var(--border));
  font-size: 18px;
  font-weight: 600;
}
.inv-view-logo {
  display: block;
  max-width: 160px;
  height: auto;
  margin-bottom: var(--space-4);
  object-fit: contain;
}
.inv-view-co { display: grid; gap: var(--space-1); font-size: 14px; }
.inv-view-co-name { font-weight: 600; font-size: 16px; }
.inv-view-slogan {
  font-style: italic;
  margin-bottom: var(--space-3);
  color: hsl(var(--muted-foreground));
  font-size: 14px;
}
.inv-view-meta {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.inv-view-meta th,
.inv-view-meta td {
  padding: var(--space-2) 0;
  vertical-align: top;
  border-bottom: 1px solid hsl(var(--border));
}
.inv-view-meta th {
  text-align: left;
  font-weight: 600;
  width: 42%;
  padding-right: var(--space-3);
}
.inv-view-meta td { text-align: right; }
.inv-view-table-card { padding: var(--space-4); display: grid; gap: var(--space-4); }
.inv-view-table-wrap { overflow-x: auto; }
.inv-view-items {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.inv-view-items th,
.inv-view-items td {
  border: 1px solid hsl(var(--border));
  padding: var(--space-3);
  vertical-align: top;
  text-align: left;
}
.inv-view-items th {
  background: hsl(var(--muted));
  font-weight: 600;
}
.inv-view-items .num { text-align: right; white-space: nowrap; }
.inv-view-pre { white-space: pre-wrap; }
.inv-view-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  align-items: flex-start;
}
.inv-view-terms {
  flex: 1;
  min-width: 16rem;
  display: grid;
  gap: var(--space-4);
}
.inv-view-terms-body {
  font-size: 14px;
  line-height: 1.5;
  text-align: justify;
  color: hsl(var(--muted-foreground));
  white-space: pre-wrap;
}
.inv-view-del-link { color: hsl(var(--destructive)); justify-self: start; }
.inv-view-totals {
  width: min(18rem, 100%);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
}
.inv-view-totals > div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid hsl(var(--border));
  font-size: 14px;
}
.inv-view-totals > div:last-child { border-bottom: 0; }
.inv-view-total { font-weight: 700; background: hsl(var(--muted)); }
.inv-view-pay-h { font-weight: 600; }
.inv-view-pay-row { font-size: 14px; color: hsl(var(--muted-foreground)); }
.inv-view-payhist { padding: var(--space-4); display: grid; gap: var(--space-3); }
.inv-view-act { padding: var(--space-4); }
.inv-view-when { font-size: 14px; margin-top: var(--space-1); }

/* —— Leads —— */
.lead-cust-cell { display: grid; gap: var(--space-1); }
.lead-cust-meta { font-size: 14px; }
.lead-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.lead-form-title { margin: var(--space-1) 0 0; font-size: 28px; font-weight: 600; }
.lead-breadcrumb { font-size: 14px; }
.lead-top-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
@media (max-width: 960px) {
  .lead-top-grid { grid-template-columns: 1fr; }
}
.lead-card .card-header { padding: var(--space-4) var(--space-5); }
.lead-card .card-body { padding: var(--space-4) var(--space-5); }
.lead-cust-row {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}
.lead-cust-combo,
.lead-cust-ss { position: relative; flex: 1; min-width: 0; }
.lead-cust-menu {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + var(--space-1));
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 8px 24px hsl(var(--foreground) / 0.08);
  max-height: 16rem;
  overflow: auto;
}
.lead-cust-item {
  display: grid;
  gap: var(--space-1);
  width: 100%;
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.lead-cust-item:hover { background: hsl(var(--muted)); }
.lead-toggle-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.lead-toggle-field input[type="checkbox"] {
  width: 2.5rem;
  height: 1.25rem;
}
.lead-sublink {
  display: inline-block;
  margin-top: var(--space-2);
  font-size: 14px;
  padding: 0;
  border: 0;
  background: none;
  color: hsl(var(--primary));
  cursor: pointer;
}
.lead-lines-table th,
.lead-lines-table td { vertical-align: top; }
.lead-lines-table .select,
.lead-lines-table .input,
.lead-lines-table .search-select {
  min-width: 8rem;
  max-width: 12rem;
  width: 100%;
  box-sizing: border-box;
}
.lead-lines-table .search-select-input {
  min-width: 0;
  width: 100%;
}
.lead-lines-table input[data-k="leadValue"] {
  min-width: 6rem;
  max-width: 8rem;
}
.lead-lines-table input[type="datetime-local"] {
  min-width: 11rem;
  max-width: 14rem;
}
.lead-bottom {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-4);
}
.lead-totals {
  width: min(16rem, 100%);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
  border-collapse: collapse;
}
.lead-totals th,
.lead-totals td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid hsl(var(--border));
  font-size: 14px;
  text-align: left;
}
.lead-totals td { text-align: right; }
.lead-totals tr:last-child th,
.lead-totals tr:last-child td { border-bottom: 0; }
.lead-totals-total { font-weight: 700; background: hsl(var(--muted)); }

/* Inventory count */
.ic-products-cell {
  max-width: 14rem;
  font-size: 14px;
  line-height: 1.35;
}
.ic-products-cell .cell-clip {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 14rem;
}

/* Sales reports */
.rpt-page { gap: var(--space-4); }
.rpt-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}
.rpt-head-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.rpt-crumb { font-size: 14px; margin-bottom: var(--space-2); }
.rpt-crumb a { color: inherit; text-decoration: none; }
.rpt-crumb a:hover { color: hsl(var(--primary)); }
.rpt-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
}
.rpt-exports { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.rpt-export-csv { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.rpt-export-pdf { background: #b91c1c; color: #fff; border-color: #b91c1c; }
.rpt-export-print { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: hsl(var(--primary)); }
.rpt-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-4);
}
.rpt-filters > .field { flex: 1 1 14rem; max-width: 25%; min-width: 12rem; margin-bottom: 0; }
.rpt-filters > .field:has(.field-row) { flex-basis: 22rem; max-width: 50%; }
@media (max-width: 900px) {
  .rpt-filters > .field,
  .rpt-filters > .field:has(.field-row) { max-width: none; }
}
.rpt-filter-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  align-self: end;
}
.rpt-filter-actions .btn { height: 2.25rem; }
#rpt-pnl-page .rpt-filters,
#rpt-tax-page .rpt-filters,
#rpt-cashio-page .rpt-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
}
#rpt-tax-page .rpt-filters > .field,
#rpt-cashio-page .rpt-filters > .field { flex: 1 1 14rem; min-width: 12rem; }
#rpt-tax-page .rpt-filter-actions,
#rpt-cashio-page .rpt-filter-actions { flex: 0 0 auto; }
#rpt-pnl-page .rpt-filters > .field { flex: 1 1 16rem; min-width: 0; }
#rpt-pnl-page .rpt-filter-actions { flex: 0 0 auto; }
#rpt-bill-page .rpt-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
}
#rpt-bill-page .rpt-filters > .field { flex: 1 1 16rem; min-width: 0; }
#rpt-bill-page .rpt-filter-actions { flex: 0 0 auto; }
#rpt-bill-page .rpt-filter-actions .btn { height: 2.25rem; }
#rpt-bill-page .rpt-table-wrap { overflow: visible; }
.rpt-table-bill {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}
.rpt-table.rpt-table-bill th,
.rpt-table.rpt-table-bill td {
  white-space: normal;
  overflow-wrap: break-word;
  vertical-align: top;
  padding: var(--space-2);
  font-size: 14px;
}
.rpt-range-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid hsl(var(--border));
}
.rpt-range-label { font-size: 14px; font-weight: 600; }
.rpt-presets { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.rpt-preset {
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: var(--space-2) var(--space-3);
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
}
.rpt-preset:hover { color: hsl(var(--foreground)); background: hsl(var(--muted) / 0.5); }
.rpt-preset.is-on {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.rpt-table-wrap { overflow: auto; }
.rpt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 64rem;
}
#rpt-paytype-page .rpt-table-wrap { display: none; }
#rpt-paytype-page .rpt-print-tables { display: block; }
.rpt-print-tables { display: none; }
.rpt-table.rpt-print-chunk {
  min-width: 0;
  width: 100%;
  margin-bottom: var(--space-4);
}
.rpt-print-chunk th,
.rpt-print-chunk td { white-space: nowrap; }
.rpt-table th,
.rpt-table td {
  padding: var(--space-3) var(--space-3);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid hsl(var(--border));
}
.rpt-table.rpt-table-fit {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}
.rpt-table.rpt-table-fit th,
.rpt-table.rpt-table-fit td {
  white-space: normal;
  overflow-wrap: break-word;
  vertical-align: top;
}
#rpt-cashio-page .rpt-table-wrap,
#rpt-tax-page .rpt-table-wrap { overflow: visible; }
.rpt-table th {
  font-size: 14px;
  font-weight: 700;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted) / 0.35);
  border-bottom: 1px solid hsl(var(--border));
}
.rpt-table-txn { min-width: 56rem; }
.rpt-num { text-align: right; }
.rpt-em { color: hsl(var(--primary)); font-weight: 600; }
.rpt-store-cell { font-weight: 600; }
.rpt-shift-row td { background: hsl(var(--muted) / 0.25); }
.rpt-totals-row td {
  border-top: 1px solid hsl(var(--border));
  border-bottom: 0;
  vertical-align: top;
  padding-top: var(--space-4);
}
.rpt-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-top: 1px solid hsl(var(--border));
}
.rpt-pager-btns {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  justify-content: center;
}
.rpt-page-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 var(--space-2);
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.rpt-page-btn:hover:not(:disabled) {
  border-color: hsl(var(--primary));
  color: hsl(var(--primary));
}
.rpt-page-btn.is-on {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.rpt-page-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.rpt-note-new {
  background: hsl(var(--secondary));
  color: hsl(var(--primary));
  text-transform: none;
  font-weight: 600;
}
.rpt-payroll-pay .staff-page-desc,
#my-payments-page .staff-page-desc {
  margin: var(--space-2) 0 0;
  max-width: 40rem;
}
.rpt-payroll-pay .rpt-kpi-row,
.my-pay-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.my-pay-kpis {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .rpt-payroll-pay .rpt-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .my-pay-kpis { grid-template-columns: 1fr; }
}
.rpt-payroll-pay .rpt-kpi,
.my-pay-kpis .rpt-kpi {
  padding: var(--space-4) var(--space-5);
  display: grid;
  gap: var(--space-1);
}
.rpt-payroll-pay .rpt-kpi-val,
.my-pay-kpis .rpt-kpi-val {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}
.rpt-payroll-pay .rd-inline-filters {
  flex-wrap: nowrap;
  align-items: center;
}
.rpt-payroll-pay .rd-inline-filters-row {
  flex-wrap: nowrap;
  overflow-x: auto;
}
.rpt-payroll-pay .rd-inline-filters-row > .input,
.rpt-payroll-pay .rd-inline-filters-row > .select,
.rpt-payroll-pay .rd-inline-filters-row > .search-select {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  max-width: none;
}
.rpt-payroll-pay .rd-inline-filters-row > #rpt-employee,
.rpt-payroll-pay .rd-inline-filters-row > .search-select:has(#rpt-employee) {
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: 18rem;
}
.rpt-payroll-pay .rd-inline-filters-row > #rpt-from,
.rpt-payroll-pay .rd-inline-filters-row > #rpt-to {
  width: 10rem;
  min-width: 10rem;
  max-width: 10rem;
}
.rpt-payroll-pay .rd-inline-filters-row > #rpt-status {
  width: 9rem;
  min-width: 8rem;
  max-width: 10rem;
}
.rpt-payroll-pay .rd-table-card > .rpt-pay-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.45);
}
.rpt-payroll-pay .rpt-pay-bar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.rpt-payroll-pay .rd-table td,
.rpt-payroll-pay .rd-table th {
  vertical-align: middle;
}
.rpt-payroll-pay .rpt-check-col {
  width: 40px;
  text-align: center;
}
.rpt-payroll-pay .rpt-status-unpaid,
.rpt-payroll-pay .rpt-status-paid,
.rpt-payroll-pay .rpt-status-partial {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  font-size: 12px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius);
}
.rpt-payroll-pay .rpt-status-unpaid {
  background: hsl(0 84% 94%);
  color: hsl(0 70% 35%);
}
.rpt-payroll-pay .rpt-status-paid {
  background: hsl(142 60% 92%);
  color: hsl(142 70% 28%);
}
.rpt-status-partial {
  background: hsl(40 90% 90%);
  color: hsl(30 70% 30%);
}
.rpt-check-col { width: 2.5rem; text-align: center; }
.rpt-col-commission,
.rpt-table th.rpt-col-commission {
  background: hsl(48 90% 92%);
}
.rpt-col-netpay,
.rpt-table th.rpt-col-netpay {
  background: hsl(200 70% 94%);
}
.rpt-status-unpaid {
  background: hsl(24 95% 53%);
  color: #fff;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.rpt-status-paid {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.02em;
}
#rpt-pay-now {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}
.rpt-badge-new {
  vertical-align: middle;
  margin-left: var(--space-2);
  background: hsl(var(--secondary));
  color: hsl(var(--primary));
  text-transform: none;
  font-size: 14px;
  font-weight: 700;
}
.rpt-brand-grid,
.od-brand-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-3);
}
.od-brand-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-bottom: var(--space-4);
}
.rpt-brand-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: 4.5rem;
  padding: var(--space-3);
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--card));
  text-align: center;
  cursor: pointer;
}
button.rpt-brand-card { width: 100%; font: inherit; color: inherit; }
.rpt-brand-card:hover,
.rpt-brand-card.is-on { border-color: hsl(var(--primary)); }
.rpt-brand-card.is-on { box-shadow: inset 0 0 0 1px hsl(var(--primary)); }
.rpt-brand-img {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
  border-radius: 0.25rem;
}
.rpt-brand-img-empty {
  display: inline-block;
  background: hsl(var(--muted) / 0.45);
}
.rpt-brand-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.rpt-brand-count { font-size: 14px; font-weight: 600; }
.rpt-brand-split {
  display: flex;
  gap: var(--space-3);
  font-size: 14px;
  font-weight: 600;
}
@media (max-width: 1100px) {
  .rpt-brand-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .od-brand-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .rpt-brand-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .od-brand-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.rpt-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: var(--space-4);
}
.rpt-kpi .card-body { padding: var(--space-4); }
.rpt-kpi-val {
  margin-top: var(--space-2);
  font-size: 1.25rem;
  font-weight: 700;
}
.rpt-kpi-accent { color: hsl(var(--destructive)); }
.rpt-kpi-ok { color: hsl(var(--primary)); }
.rpt-check-field { justify-content: flex-end; }
.rpt-store-expand {
  color: hsl(var(--muted-foreground));
  font-weight: 600;
  margin-right: var(--space-1);
}
.rpt-col-panel {
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.25);
}
.rpt-col-checks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
}
#rpt-filter-toggle {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
  margin-top: var(--space-2);
}
.rpt-module-switch {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.rpt-module-btn {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.rpt-module-btn:hover { border-color: hsl(var(--primary)); color: hsl(var(--primary)); }
.rpt-module-btn.is-on {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.rpt-insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: var(--space-4);
}
.rpt-insight-card .card-body {
  min-height: 16rem;
  position: relative;
}
.rpt-insight-card canvas {
  max-height: 14rem;
}
.rpt-row-action {
  width: auto;
  min-width: 7rem;
}
.rpt-totals-split {
  display: grid;
  grid-template-columns: repeat(3, minmax(4rem, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-2);
  text-align: right;
}
.rpt-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: var(--space-3);
}
.rpt-kpi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  font-size: 14px;
}
.rpt-kpi strong { font-size: 1.1rem; }
.rpt-kpi-inline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
}
.rpt-kpi-chip {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: 14px;
  color: hsl(var(--muted-foreground));
}
.rpt-kpi-chip strong { font-size: 1rem; color: hsl(var(--foreground)); }
.rpt-kpi-chip .is-danger { color: hsl(var(--destructive)); }
.rpt-kpi .is-teal,
.rpt-kpi-chip .is-teal,
strong.is-teal { color: hsl(var(--primary)); }
.rpt-kpi .is-orange,
strong.is-orange { color: hsl(var(--chart-5)); }
.rpt-kpi .is-blue,
strong.is-blue { color: hsl(var(--chart-2)); }
.rpt-pnl-present {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: 0 var(--space-5) var(--space-5);
}
.rpt-pnl-chart { height: 16rem; }
.rpt-pnl-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.pnl-group,
.pnl-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
}
.pnl-group h3 { margin: 0; font-size: 16px; font-weight: 600; }
.pnl-line { display: flex; flex-direction: column; gap: var(--space-1); }
.pnl-line-label {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: 14px;
}
.pnl-track {
  height: 8px;
  border-radius: 999px;
  background: hsl(var(--muted));
  overflow: hidden;
}
.pnl-fill {
  height: 100%;
  border-radius: 999px;
  background: hsl(var(--primary));
}
.pnl-line.is-total .pnl-fill { background: hsl(var(--chart-2)); }
.pnl-summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}
.pnl-summary-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: 14px;
}
.pnl-summary-item strong { font-size: 16px; }
@media (max-width: 900px) {
  .rpt-pnl-groups,
  .pnl-summary { grid-template-columns: 1fr; }
}
.rpt-pnl-head {
  text-align: center;
  padding: var(--space-5) var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.rpt-table-pnl { min-width: 36rem; }
.rpt-section-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-right: var(--space-2);
  border: 0;
  border-radius: 9999px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-weight: 700;
  cursor: pointer;
}
.rpt-section-head td { background: hsl(var(--muted) / 0.25); }
.rpt-bold td { font-weight: 700; }

.cat-board {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: hsl(var(--muted) / 0.45);
  min-height: 100%;
}
.cat-board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}
.cat-board-head h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
}
.cat-board-head .btn { flex-shrink: 0; }
.cat-board-head .breadcrumb { margin-top: var(--space-2); }
.cat-board-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 1fr);
  gap: var(--space-3);
  align-items: start;
}
.cat-board-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid hsl(var(--border));
}
.cat-board-toolbar .input { flex: 1; min-width: 0; }
.cat-board-toolbar .btn { flex-shrink: 0; }
.cat-check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
  font-weight: 500;
}
.cat-board-rows { max-height: 36rem; overflow: auto; }
.cat-node { min-width: 0; }
.cat-children {
  display: block;
  margin-left: var(--space-6);
  padding-left: var(--space-3);
  border-left: 2px solid hsl(var(--primary));
}
.cat-children .cat-row {
  background: hsl(var(--muted) / 0.45);
}
.cat-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 2.5rem;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
  border-bottom: 1px solid hsl(var(--border));
  box-sizing: border-box;
}
.cat-row:hover,
.cat-row.is-active { background: hsl(var(--accent)); }
.cat-chevron {
  width: 1rem;
  height: 1rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cat-chevron svg { width: 1rem; height: 1rem; }
.cat-chevron.is-open svg { transform: rotate(90deg); }
.cat-chevron-spacer { width: 1rem; flex-shrink: 0; }
.cat-row-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.cat-row-count { color: hsl(var(--primary)); font-weight: 500; }
.cat-row-actions {
  display: none;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
  height: 2.5rem;
}
.cat-row-actions .btn {
  height: auto;
  min-height: 0;
  padding: 0;
  line-height: 1.25rem;
}
.cat-row:hover .cat-row-actions,
.cat-row.is-active .cat-row-actions { display: flex; }
.cat-side-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.cat-side-head h2 { margin: 0; font-size: 1.125rem; font-weight: 600; }
.cat-rename {
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: var(--space-1);
  display: inline-flex;
}
.cat-detail-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--muted) / 0.55);
}
.cat-detail-card h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.cat-detail-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.cat-image-well {
  width: 8rem;
  min-height: 8rem;
  border: 1px dashed hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: hsl(var(--card));
}
.cat-image-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: hsl(var(--muted-foreground));
  cursor: pointer;
}
.cat-image-plus {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
}
.cat-image-well img {
  width: 8rem;
  height: 8rem;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
}
.cat-image-well [data-media-clear] { display: none; }
.cat-image-well:has(img) [data-media-clear] { display: inline-flex; }
.cat-image-well:has(img) .cat-image-add { display: none; }
.cat-fields-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid hsl(var(--border));
  border-bottom: 1px solid hsl(var(--border));
}
.cat-fields-head h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.cat-fields-actions { display: flex; align-items: center; gap: var(--space-2); }
.cat-empty { padding: var(--space-6) var(--space-4); }
@media (max-width: 960px) {
  .cat-board-grid { grid-template-columns: 1fr; }
  .cat-row-actions { display: flex; }
}
.stock-multi { position: relative; }
@media print {
  .card, .panel, .kpi { box-shadow: none !important; }
  html, body, .app-body, .app-main, .content, .rpt-page, .rd-list, .card, .rpt-table-wrap, .table-wrap {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }
  .shell-sidebar, .sidebar, .shell-header, .topbar, .breadcrumb-bar,
  .rpt-exports, .rpt-filters, .rpt-presets, .rpt-pager, .toast-stack,
  .rpt-module-switch, .rpt-col-panel, .rd-filters, .rd-list-actions, .rd-chips, .rd-pager,
  .rpt-head-actions, .rd-date-range-host, .dash-range,
  dialog { display: none !important; }
  .rpt-page .card:has(.rpt-filters),
  #rpt-filter-card { display: none !important; }

  /* Prefer printable column chunks when present (avoids crushed 1-char headers). */
  .rpt-page:has(#rpt-print-tables .rpt-print-chunk) .rpt-table-wrap {
    display: none !important;
  }
  .rpt-print-tables {
    display: block !important;
  }

  .rpt-table, .rpt-table-txn, .rd-table {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    table-layout: auto !important;
  }
  .rpt-table.rpt-table-fit {
    width: 100% !important;
    table-layout: auto !important;
  }
  .rpt-table th, .rpt-table td, .rd-table th, .rd-table td {
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    font-size: 8pt !important;
    line-height: 1.25 !important;
    padding: 3px 5px !important;
  }
  .rpt-table thead, .rd-table thead, .rpt-print-chunk thead {
    display: table-header-group;
  }
  .rpt-table tr, .rd-table tr, .rpt-print-chunk tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  #rpt-paytype-page .rpt-table-wrap { display: none !important; }
  #rpt-paytype-page .rpt-print-tables { display: block !important; }

  .rpt-print-chunk {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
    margin: 0 0 8mm;
    break-after: page;
    page-break-after: always;
    break-inside: avoid;
  }
  .rpt-print-chunk:last-child {
    break-after: auto;
    page-break-after: auto;
  }
  .rpt-print-chunk th,
  .rpt-print-chunk td {
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }
  .rpt-print-chunk th {
    font-weight: 600;
    border-bottom: 1px solid #111;
  }
}

.cust-page { display: flex; flex-direction: column; gap: var(--space-4); }
.cust-stats {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-4);
  background: hsl(var(--muted) / 0.45);
  border-radius: var(--radius);
}
.cust-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: 4.5rem;
  padding: var(--space-3);
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  text-align: center;
}
.cust-stat span { font-size: 14px; font-weight: 600; line-height: 1.3; }
.cust-stat strong { font-size: 16px; font-weight: 600; }
.cust-stat.is-teal { color: hsl(168 72% 32%); }
.cust-stat.is-coral { color: hsl(6 74% 61%); }
.cust-stat.is-warm { color: hsl(32 88% 48%); }
.cust-identity { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); }
.cust-identity h1 { margin: 0; font-size: 28px; font-weight: 600; }
.cust-id { color: hsl(var(--primary)); }
.cust-identity-top, .cust-identity-actions, .cust-identity-body, .cust-notify, .cust-flag {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.cust-flag .switch { display: inline-flex; align-items: center; }
.cust-identity-top, .cust-notify { justify-content: space-between; }
.cust-identity-body { align-items: flex-start; gap: var(--space-6); }
.cust-identity-meta { display: flex; flex-direction: column; gap: var(--space-2); min-width: 12rem; }
.cust-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: hsl(var(--muted));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  object-fit: cover;
  flex-shrink: 0;
}
.cust-notify { padding-top: var(--space-4); border-top: 1px solid hsl(var(--border)); }
.cust-tabs {
  display: flex;
  gap: var(--space-4);
  padding: 0 var(--space-4);
  border-bottom: 1px solid hsl(var(--border));
  overflow-x: auto;
}
.cust-tab {
  padding: var(--space-3) 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: hsl(var(--muted-foreground));
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.cust-tab.is-on { color: hsl(var(--primary)); border-bottom-color: hsl(var(--primary)); }
.cust-panel-body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); }
.cust-panel-body[hidden] { display: none !important; }
.cust-filters { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.cust-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(8rem, 1fr)); gap: var(--space-4); flex: 1; }
.cust-filter-actions { display: flex; gap: var(--space-2); }
.cust-empty {
  margin: var(--space-4) 0;
  padding: var(--space-4);
  text-align: center;
  color: hsl(var(--primary));
  background: hsl(var(--muted) / 0.45);
  border-radius: calc(var(--radius) - 2px);
}
.cust-count { margin: 0; }
.cust-gift-head, .cust-asset-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.cust-gift-head h2 { margin: 0; font-size: 20px; }
.cust-gift-balance { display: block; color: hsl(var(--primary)); font-size: 16px; }
.cust-note-form, .cust-mail-row { display: flex; align-items: flex-start; gap: var(--space-3); }
.cust-note-form .textarea, .cust-mail-row .field { flex: 1; }
.cust-note-list { display: flex; flex-direction: column; gap: var(--space-3); }
.cust-note { display: flex; flex-direction: column; gap: var(--space-1); padding-top: var(--space-3); border-top: 1px solid hsl(var(--border)); }
.cust-note p { margin: 0; }
.cust-mail-send { display: flex; justify-content: flex-end; }
.cust-quiet { text-align: center; color: hsl(var(--muted-foreground)); }
.cust-drop-wrap .import-drop { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); max-width: 28rem; margin: 0 auto; }
@media (max-width: 1100px) {
  .cust-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cust-filter-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .cust-stats, .cust-filter-grid, .cust-mail-row { grid-template-columns: 1fr 1fr; }
  .cust-identity-top, .cust-identity-body { flex-direction: column; align-items: flex-start; }
}

/* Product edit (RepairDesk-style section navigator) */
.product-edit {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}
.product-edit-nav {
  position: sticky;
  top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4);
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}
.product-edit-nav-label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.product-edit-nav-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.product-edit-nav-link {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: calc(var(--radius) - 2px);
  color: hsl(var(--foreground));
  text-decoration: none;
  font-size: 14px;
  line-height: 1.3;
}
.product-edit-nav-link:hover {
  background: hsl(var(--muted) / 0.6);
}
.product-edit-nav-link.is-active {
  background: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
  font-weight: 600;
}
.product-edit-quick {
  padding-top: var(--space-3);
  border-top: 1px solid hsl(var(--border));
  gap: var(--space-2);
}
.product-edit-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: 14px;
  line-height: 1.35;
  cursor: pointer;
}
.product-edit-check input {
  margin-top: 2px;
}
.product-edit-main {
  min-width: 0;
}
.product-edit-main .form-section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.product-edit-main .panel {
  scroll-margin-top: var(--space-6);
}
.product-edit-actions {
  position: sticky;
  bottom: 0;
  padding: var(--space-3) 0;
  background: linear-gradient(to top, hsl(var(--background)) 70%, transparent);
}
@media (max-width: 960px) {
  .product-edit {
    grid-template-columns: 1fr;
  }
  .product-edit-nav {
    position: static;
  }
  .product-edit-nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-2);
  }
}
