:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #edf3f2;
  --ink: #172126;
  --ink-soft: #354247;
  --muted: #65737b;
  --border: #d9e3e5;
  --border-strong: #c7d4d7;
  --teal: #0f766e;
  --teal-dark: #0a5b55;
  --teal-soft: #e2f3f0;
  --amber: #b7791f;
  --amber-soft: #fff3d6;
  --red: #b42318;
  --red-soft: #ffe4df;
  --green: #277a45;
  --green-soft: #e4f6eb;
  --shadow: 0 16px 40px rgba(23, 33, 38, 0.08);
  --radius: 8px;
  --radius-sm: 6px;
  --focus: 0 0 0 3px rgba(15, 118, 110, 0.24);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

a {
  color: inherit;
}

.boot-screen,
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.loader {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.loader-mark {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.auth-card {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(320px, 1fr);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-panel {
  padding: 38px;
}

.auth-brand {
  background: #172126;
  color: #f6fbfa;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 520px;
  padding: 38px;
}

.brand-mark,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--teal);
  border-radius: var(--radius-sm);
}

.auth-brand h1 {
  max-width: 330px;
  margin: 42px 0 14px;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: 0;
}

.auth-brand p {
  max-width: 380px;
  margin: 0;
  color: #b9c9c8;
  line-height: 1.65;
}

.auth-note {
  display: grid;
  gap: 10px;
  color: #d4e2e0;
  font-size: 13px;
}

.auth-note span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-panel h2 {
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.15;
}

.auth-panel > p {
  margin: 0 0 26px;
  color: var(--muted);
  line-height: 1.55;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label,
.filter-label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.field input,
.field textarea,
.field select,
.search-input,
.filter-select,
.store-page input:not([type="checkbox"]):not([type="radio"]),
.store-page select,
.use-part-form select,
.use-part-form input[type="number"] {
  width: 100%;
  min-height: 42px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  padding: 10px 12px;
}

.field textarea {
  min-height: 108px;
  resize: vertical;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.search-input:focus,
.filter-select:focus,
.store-page input:focus,
.store-page select:focus,
.use-part-form select:focus,
.use-part-form input:focus {
  border-color: var(--teal);
  box-shadow: var(--focus);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.primary-button,
.secondary-button,
.ghost-button,
.status-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  gap: 8px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.primary-button {
  color: #ffffff;
  background: var(--teal);
  padding: 0 16px;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.secondary-button,
.status-button {
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--border-strong);
  padding: 0 14px;
}

.secondary-button:hover,
.status-button:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.ghost-button {
  color: var(--muted);
  background: transparent;
  padding: 0 10px;
}

.ghost-button:hover {
  color: var(--ink);
  background: rgba(23, 33, 38, 0.06);
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.alert {
  display: none;
  margin: 0 0 16px;
  padding: 12px 13px;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid rgba(180, 35, 24, 0.22);
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.45;
}

.alert.is-visible {
  display: block;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 22px 16px;
  color: #e8f4f2;
  background: #172126;
}

.sidebar-brand {
  padding: 0 8px;
  font-size: 17px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c3d3d1;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 0 12px;
  text-align: left;
  font-size: 14px;
  font-weight: 800;
}

.nav-item.is-active,
.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.09);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
  padding: 12px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
}

.user-chip {
  min-width: 0;
}

.user-chip strong,
.user-chip span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip strong {
  font-size: 14px;
}

.user-chip span {
  margin-top: 2px;
  color: #aabbb9;
  font-size: 12px;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.search-wrap {
  position: relative;
}

.search-wrap .icon {
  position: absolute;
  top: 50%;
  left: 13px;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-input {
  padding-left: 42px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  color: var(--muted);
}

.filter-select {
  min-width: 132px;
  min-height: 40px;
  padding: 8px 34px 8px 10px;
}

.workspace {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 394px);
  gap: 18px;
  padding: 20px 22px;
}

.admin-topbar {
  grid-template-columns: 1fr;
}

.admin-topbar h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.admin-topbar p {
  margin: 5px 0 0;
  color: var(--muted);
}

.admin-workspace {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  gap: 18px;
  padding: 20px 22px;
}

.queue-column {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat-card strong {
  font-size: 26px;
  line-height: 1;
}

.table-panel,
.details-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(23, 33, 38, 0.04);
}

.table-header,
.details-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--border);
}

.table-header h2,
.details-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.table-header p,
.details-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.ticket-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.ticket-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

.ticket-table th,
.ticket-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.ticket-table th {
  color: var(--muted);
  background: #fbfcfc;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.ticket-table td {
  color: var(--ink-soft);
  font-size: 14px;
}

.ticket-row {
  transition: background 150ms ease;
}

.ticket-row:hover {
  background: #f8fbfb;
}

.ticket-row.is-selected {
  background: var(--teal-soft);
}

.ticket-id {
  color: var(--teal-dark);
  font-weight: 900;
}

.ticket-title {
  display: grid;
  gap: 4px;
}

.ticket-title strong {
  color: var(--ink);
}

.ticket-title span,
.muted {
  color: var(--muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-open {
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.status-progress {
  color: #7a4f00;
  background: var(--amber-soft);
}

.status-waiting {
  color: var(--red);
  background: var(--red-soft);
}

.status-done {
  color: var(--green);
  background: var(--green-soft);
}

.priority-low {
  color: #49646a;
  background: #e7eef0;
}

.priority-normal {
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.priority-high {
  color: #7a4f00;
  background: var(--amber-soft);
}

.priority-urgent {
  color: var(--red);
  background: var(--red-soft);
}

.details-panel {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 112px);
  overflow: auto;
}

.details-body {
  padding: 18px;
}

.details-title {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.details-title h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.22;
}

.detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.status-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.status-button.is-current {
  color: #ffffff;
  background: var(--teal);
  border-color: var(--teal);
}

.detail-form {
  display: grid;
  gap: 13px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.issue-box {
  margin: 16px 0;
  padding: 14px;
  color: var(--ink-soft);
  background: #f9fbfb;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  line-height: 1.55;
}

.activity-section {
  display: grid;
  gap: 13px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.activity-section h4,
.billing-section h4 {
  margin: 0;
  font-size: 14px;
  text-transform: uppercase;
}

.billing-section {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-title-row p {
  margin: 8px 0 0;
}

.section-title-row > strong {
  font-size: 18px;
}

.billing-form,
.billing-lines {
  display: grid;
  gap: 12px;
}

.billing-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 104px 40px;
  gap: 9px;
  align-items: end;
}

.billing-line .field {
  gap: 5px;
}

.billing-line input {
  min-height: 38px;
}

.icon-only {
  width: 40px;
  min-width: 40px;
  padding: 0;
}

.billing-actions,
.portal-url-row,
.customer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.billing-actions {
  justify-content: space-between;
}

.portal-link-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  background: #f9fbfb;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.portal-link-box strong,
.portal-link-box span {
  display: block;
}

.portal-link-box span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.portal-url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.portal-url-row input {
  min-width: 0;
  min-height: 40px;
  padding: 9px 10px;
  color: var(--ink-soft);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.invoice-link {
  justify-self: start;
}

.activity-list {
  display: grid;
  gap: 10px;
}

.activity-item {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  background: #f9fbfb;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.activity-item strong {
  font-size: 13px;
}

.activity-item span {
  color: var(--muted);
  font-size: 12px;
}

.activity-item p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 26px;
  color: var(--muted);
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 18px;
}

.empty-state p {
  max-width: 360px;
  margin: 0;
  line-height: 1.55;
}

.user-list {
  display: grid;
}

.user-row {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  color: var(--ink);
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.user-row:hover,
.user-row.is-selected {
  background: var(--teal-soft);
}

.user-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--teal);
  border-radius: var(--radius-sm);
  font-weight: 900;
  text-transform: uppercase;
}

.user-row-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.user-row-main strong,
.user-row-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-row-main span {
  color: var(--muted);
  font-size: 13px;
}

.user-editor-body {
  display: grid;
  gap: 22px;
}

.user-editor-body h3 {
  margin: 0;
  font-size: 16px;
}

.selected-user-form {
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.toggle-field {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: end;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
}

.toggle-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 33, 38, 0.52);
}

.modal {
  width: min(720px, 100%);
  max-height: min(780px, calc(100vh - 40px));
  overflow: auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.24);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.modal-header p {
  margin: 5px 0 0;
  color: var(--muted);
}

.modal-form {
  padding: 22px;
}

.customer-screen {
  min-height: 100vh;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.08), rgba(15, 118, 110, 0) 260px),
    var(--bg);
}

.customer-portal {
  width: min(1080px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.customer-portal.is-narrow {
  width: min(620px, 100%);
}

.customer-header,
.customer-summary,
.bill-panel,
.repair-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(23, 33, 38, 0.04);
}

.customer-header {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.customer-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 24px;
}

.customer-kicker {
  display: block;
  margin-bottom: 10px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.customer-summary h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.14;
}

.customer-summary p {
  margin: 8px 0 0;
  color: var(--muted);
}

.amount-due {
  display: grid;
  gap: 6px;
  text-align: right;
}

.amount-due span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.amount-due strong {
  font-size: 32px;
  line-height: 1;
}

.customer-message {
  padding: 12px 14px;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid rgba(180, 35, 24, 0.22);
  border-radius: var(--radius);
}

.customer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 18px;
}

.bill-panel,
.repair-panel {
  overflow: hidden;
}

.bill-lines {
  display: grid;
}

.bill-line,
.bill-total-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}

.bill-line div {
  display: grid;
  gap: 5px;
}

.bill-line span {
  color: var(--muted);
  font-size: 13px;
}

.bill-total-row {
  align-items: center;
  color: var(--ink-soft);
  background: #fbfcfc;
}

.bill-total-row.is-grand {
  color: var(--ink);
  background: #ffffff;
  font-size: 18px;
}

.customer-actions {
  justify-content: flex-end;
  padding: 18px;
}

.repair-panel {
  padding: 20px;
}

.repair-panel h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.repair-panel dl {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
}

.repair-panel dl div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.repair-panel dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.repair-panel dd {
  margin: 0;
  text-align: right;
}

.repair-panel p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .details-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 880px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    gap: 16px;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sidebar-footer {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .topbar {
    position: static;
    grid-template-columns: 1fr;
  }

  .top-actions {
    flex-wrap: wrap;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-card {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    min-height: auto;
    gap: 28px;
  }
}

@media (max-width: 620px) {
  .auth-screen {
    padding: 12px;
  }

  .auth-panel,
  .auth-brand {
    padding: 24px;
  }

  .auth-brand h1 {
    font-size: 28px;
  }

  .workspace {
    padding: 14px;
  }

  .admin-workspace {
    padding: 14px;
  }

  .topbar {
    padding: 14px;
  }

  .stats-grid,
  .form-row,
  .status-actions {
    grid-template-columns: 1fr;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  .top-actions,
  .filter-group {
    width: 100%;
  }

  .filter-select,
  .primary-button {
    width: 100%;
  }

  .table-header,
  .details-header {
    display: grid;
  }

  .billing-line,
  .portal-url-row,
  .customer-summary,
  .customer-grid {
    grid-template-columns: 1fr;
  }

  .customer-screen {
    padding: 14px;
  }

  .customer-header,
  .customer-summary {
    display: grid;
  }

  .amount-due {
    text-align: left;
  }

  .customer-actions,
  .billing-actions,
  .portal-link-box {
    display: grid;
  }

  .user-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .user-row .chip {
    grid-column: 2;
    justify-self: start;
  }
}

/* ---- Added in the Vacuums and Videogames rebuild ---- */

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 0.92rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast[data-kind="error"] {
  background: var(--red);
  border-color: var(--red);
}

.toast[data-kind="success"] {
  background: var(--green);
  border-color: var(--green);
}

button[aria-busy="true"] {
  cursor: progress;
  opacity: 0.7;
}

.plain-fieldset {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.plain-fieldset[disabled] {
  opacity: 0.65;
}

.billing-running-total {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: right;
}

.overdue-text {
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 600;
}

.activity-item.is-warning {
  border-color: var(--amber);
  background: var(--amber-soft);
}

.ticket-row:focus-visible {
  outline: none;
  box-shadow: inset var(--focus);
}

.portal-link-box .button-row {
  margin: 0;
}

.bill-panel > .muted {
  margin: 0;
  padding: 12px 18px;
  font-size: 13px;
}

.issue-box,
.repair-panel p,
.activity-item p {
  white-space: pre-line;
}

.customer-header .chip {
  width: fit-content;
  align-self: flex-start;
}

.setup-heading {
  margin: 0;
  font-size: 1rem;
}

.setup-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 18px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.setup-divider::before,
.setup-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.notice {
  padding: 10px 12px;
  border: 1px solid var(--green);
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.92rem;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.admin-backup-note {
  margin: 0;
  padding: 10px 24px 0;
  font-size: 0.88rem;
}

/* ---- Logo, hints, settings, price check, receipts (v2.2) ---- */

.brand-logo {
  flex: none;
  border-radius: 9px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--teal);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  background: var(--teal-soft);
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.45;
}

.hint p {
  flex: 1;
  margin: 0;
}

.hint-icon {
  color: var(--teal);
  margin-top: 1px;
}

.hint-close {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
}

.hint-close:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.06);
}

.pad { padding: 14px 18px; margin: 0; }
.pad-alert { margin: 14px 18px; }
.small-button { padding: 6px 10px; font-size: 0.85rem; min-height: 0; }
.danger-text { color: var(--red); }
.row-actions { text-align: right; white-space: nowrap; }
.empty-state.small { min-height: 0; padding: 22px 18px; }
.source-note { font-size: 0.8rem; }

.price-page,
.settings-page,
.help-page {
  display: grid;
  gap: 16px;
  padding: 20px 24px 32px;
  min-width: 0;
}

.price-search { flex: 1; }
.price-table td.offer { font-variant-numeric: tabular-nums; }
.price-table td.sell { font-weight: 700; color: var(--teal-dark); }
.form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.settings-page { max-width: 980px; }

.settings-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.settings-card > header {
  padding: 16px 18px 0;
}

.settings-card > header h2 { margin: 0; font-size: 1.05rem; }
.settings-card > header p { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
.settings-card form { padding: 16px 18px 18px; }

.settings-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.settings-tabs button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 600;
  cursor: pointer;
}

.settings-tabs button.is-active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.secret-status { font-size: 0.8rem; color: var(--green); font-weight: 600; }
.field-note { margin: 2px 0 0; color: var(--muted); font-size: 0.82rem; }
.locked-note { color: var(--amber); }

.payments-list {
  display: grid;
  gap: 6px;
  margin: 4px 0;
}

.payment-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.9rem;
}

.payment-row span { color: var(--muted); }
.balance-line { display: flex; justify-content: space-between; font-weight: 700; }

.record-payment {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}

/* Help */
.help-page { max-width: 900px; }
.help-section h2 { margin: 0 0 8px; font-size: 1.1rem; }
.help-section ol, .help-section ul { margin: 6px 0 0; padding-left: 22px; line-height: 1.6; }
.help-section p { line-height: 1.55; }
.help-toc { display: flex; flex-wrap: wrap; gap: 8px; }
.help-toc a { color: var(--teal-dark); font-weight: 600; text-decoration: none; padding: 4px 10px; border-radius: 999px; background: var(--teal-soft); }
.help-card { padding: 18px 20px; }
kbd { border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 0.85em; background: var(--surface-2); }

/* Receipt */
.receipt-screen { min-height: 100vh; background: var(--bg); padding: 24px 16px; }
.receipt-toolbar { max-width: 720px; margin: 0 auto 14px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.receipt-paper {
  max-width: 720px;
  margin: 0 auto;
  padding: 36px 40px;
  background: #fff;
  color: #111;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: var(--shadow);
  font-size: 14px;
  line-height: 1.45;
}
.receipt-paper.thermal { max-width: 302px; padding: 14px 12px; font-size: 12px; font-family: "Courier New", monospace; }
.receipt-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; border-bottom: 2px solid #111; padding-bottom: 14px; margin-bottom: 14px; }
.thermal .receipt-head { display: block; text-align: center; }
.receipt-shop { display: flex; gap: 12px; align-items: center; }
.thermal .receipt-shop { justify-content: center; flex-direction: column; gap: 4px; }
.receipt-shop h1 { margin: 0; font-size: 1.3em; }
.receipt-shop p, .receipt-meta p { margin: 0; white-space: pre-line; color: #333; }
.receipt-meta { text-align: right; }
.thermal .receipt-meta { text-align: center; margin-top: 8px; }
.receipt-meta strong { display: block; font-size: 1.2em; letter-spacing: 0.04em; }
.receipt-block { margin: 12px 0; }
.receipt-block h2 { margin: 0 0 4px; font-size: 0.85em; text-transform: uppercase; letter-spacing: 0.06em; color: #555; }
.receipt-block p { margin: 0; white-space: pre-line; }
.receipt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.thermal .receipt-grid { grid-template-columns: 1fr; gap: 6px; }
.receipt-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.receipt-table th, .receipt-table td { text-align: left; padding: 6px 0; border-bottom: 1px solid #e3e3e3; vertical-align: top; }
.receipt-table th:last-child, .receipt-table td:last-child { text-align: right; }
.receipt-table th:nth-child(2), .receipt-table td:nth-child(2) { text-align: center; width: 40px; }
.receipt-totals { margin-left: auto; width: min(280px, 100%); }
.thermal .receipt-totals { width: 100%; }
.receipt-totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.receipt-totals .grand { border-top: 2px solid #111; margin-top: 4px; padding-top: 6px; font-weight: 700; font-size: 1.1em; }
.receipt-stamp { display: inline-block; margin-top: 8px; padding: 4px 12px; border: 2px solid #277a45; color: #277a45; border-radius: 4px; font-weight: 800; letter-spacing: 0.1em; transform: rotate(-3deg); }
.receipt-stamp.due { border-color: #b42318; color: #b42318; }
.receipt-terms { margin-top: 16px; padding-top: 10px; border-top: 1px dashed #bbb; font-size: 0.85em; color: #444; white-space: pre-line; }
.receipt-footer { margin-top: 12px; text-align: center; font-weight: 600; }

@media print {
  .receipt-screen { padding: 0; background: #fff; }
  .receipt-toolbar, .toast { display: none !important; }
  .receipt-paper { box-shadow: none; border: 0; padding: 0; max-width: none; }
  .receipt-paper.thermal { max-width: 72mm; }
  @page { margin: 12mm; }
}

@media (max-width: 760px) {
  .form-row.three { grid-template-columns: 1fr; }
  .receipt-paper { padding: 20px; }
  .receipt-grid { grid-template-columns: 1fr; }
  .price-page, .settings-page, .help-page { padding: 14px; }
}

/* ---- Dark theme (per-user choice in My settings) ---- */
:root[data-theme="dark"] {
  --bg: #0f1518;
  --surface: #172025;
  --surface-2: #1d282e;
  --ink: #e7eef0;
  --ink-soft: #c5d1d4;
  --muted: #8fa0a7;
  --border: #2a383e;
  --border-strong: #37474e;
  --teal: #2bb3a5;
  --teal-dark: #5fd0c3;
  --teal-soft: #143633;
  --amber: #e2a845;
  --amber-soft: #3a2f17;
  --red: #f0776b;
  --red-soft: #3d1d1a;
  --green: #5fcf86;
  --green-soft: #173323;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

:root[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
:root[data-theme="dark"] .toast { background: #e7eef0; color: #172126; }
:root[data-theme="dark"] .toast[data-kind="error"] { background: #b42318; color: #fff; }
:root[data-theme="dark"] .toast[data-kind="success"] { background: #277a45; color: #fff; }
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea { background: var(--surface-2); color: var(--ink); border-color: var(--border-strong); }
:root[data-theme="dark"] .hint-close:hover { background: rgba(255, 255, 255, 0.08); }

.admin-hint-wrap { padding: 12px 24px 0; }
.queue-column > .hint { margin-bottom: 0; }

/* Keep wide tables scrolling inside their own panel instead of pushing the
   queue column under the ticket details panel. */
.queue-column > *,
.price-page > *,
.admin-workspace > * { min-width: 0; }
.ticket-table-wrap { overflow-x: auto; }

/* Dark theme: surfaces that the original stylesheet painted light. */
:root[data-theme="dark"] .topbar { background: rgba(15, 21, 24, 0.9); border-color: var(--border); }
:root[data-theme="dark"] .filter-select,
:root[data-theme="dark"] .status-button,
:root[data-theme="dark"] .portal-url-row input,
:root[data-theme="dark"] .user-row,
:root[data-theme="dark"] .bill-total-row.is-grand { background: var(--surface-2); color: var(--ink); }
:root[data-theme="dark"] .ticket-table th,
:root[data-theme="dark"] .bill-total-row { background: var(--surface-2); color: var(--muted); }
:root[data-theme="dark"] .ticket-row:hover,
:root[data-theme="dark"] .issue-box,
:root[data-theme="dark"] .portal-link-box,
:root[data-theme="dark"] .activity-item { background: var(--surface-2); }
:root[data-theme="dark"] .priority-low { background: #26343a; color: #b8c6cb; }
:root[data-theme="dark"] .secondary-button { background: var(--surface-2); color: var(--ink); border-color: var(--border-strong); }
:root[data-theme="dark"] .secondary-button:hover { background: #24323a; }
:root[data-theme="dark"] .ghost-button { color: var(--ink-soft); }
:root[data-theme="dark"] .chip { filter: saturate(1.1) brightness(1.15); }
:root[data-theme="dark"] .ticket-row.is-selected { background: var(--teal-soft); }
:root[data-theme="dark"] .status-progress,
:root[data-theme="dark"] .priority-high { color: #f2c46d; background: #3a2f17; }
:root[data-theme="dark"] .chip { filter: none; }

/* ---- Free price research (v2.3) ---- */
.research-body { display: grid; gap: 16px; padding: 16px 18px 18px; }
.research-links { display: flex; flex-wrap: wrap; gap: 10px; }
.research-links a { text-decoration: none; }
.shop-memory { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.shop-memory p { margin: 4px 0 0; font-size: 0.92rem; }
.calc { display: grid; gap: 8px; }
.calc label { font-size: 0.92rem; }
.calc textarea { font-size: 1.05rem; }
.calc-results .muted { margin: 0; }
.calc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 0 10px; }
.calc-grid > div { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); display: grid; gap: 2px; }
.calc-grid span { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
.calc-grid strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.calc-grid .offer-cell { background: var(--teal-soft); border-color: transparent; }
.calc-grid .offer-cell.sell strong { color: var(--teal-dark); }
.button-row.tight { margin: 0; gap: 6px; }
.file-button { cursor: pointer; display: inline-flex; align-items: center; }
.pad-box { margin: 14px 18px 0; }
.item-history { display: grid; gap: 8px; border-top: 1px solid var(--border); }
.row-actions .small-button + .small-button { margin-left: 4px; }
.price-table td .chip { font-size: 0.7rem; padding: 1px 6px; margin-right: 4px; }
@media (max-width: 760px) { .calc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Staff Access + email sign-up ---------- */
.access-page { display: grid; gap: 16px; padding: 20px 24px 32px; min-width: 0; max-width: 1180px; }
.access-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.access-grid > * { min-width: 0; }
.access-page .settings-card header h2 { display: flex; align-items: center; gap: 8px; }
.notice.warn { border-color: var(--amber); background: var(--amber-soft); color: var(--amber); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.warn-text { color: var(--amber); }
.table-scroll { overflow-x: auto; }
.access-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.access-table th, .access-table td { text-align: left; padding: 10px 18px; border-top: 1px solid var(--border); vertical-align: top; }
.access-table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.access-table td.row-actions { text-align: right; }
.settings-card form.inline-form { padding: 14px 18px; }
.plain-list { margin: 6px 0 0; padding-left: 18px; }
.plain-list li { margin: 3px 0; }
.small { font-size: 0.82rem; }
.link-button { background: none; border: 0; padding: 0; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.link-button:hover { opacity: 0.8; }
.auth-switch { margin: 6px 0 0; color: var(--muted); font-size: 0.92rem; }
.auth-switch .link-button, .notice .link-button, .field-note .link-button { color: var(--teal-dark); }
@media (max-width: 720px) {
  .access-page { padding: 0 12px 24px; }
  .access-table th, .access-table td { padding: 8px 10px; }
}

/* ---------- Store: inventory, parts, purchases, checkout, P&L ---------- */
.store-page { display: grid; gap: 16px; padding: 20px 24px 32px; min-width: 0; }
.store-page > * { min-width: 0; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat-tile { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 12px 14px; display: grid; gap: 2px; }
.stat-tile span { color: var(--muted); font-size: 0.82rem; }
.stat-tile strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.stat-tile small { color: var(--muted); font-size: 0.78rem; }
.stat-tile.warn { border-color: var(--amber); background: var(--amber-soft); }
.stat-tile.good strong { color: var(--green); }
.stat-tile.bad { border-color: var(--red); background: var(--red-soft); }
.stat-tile.bad strong { color: var(--red); }
.store-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 16px; align-items: start; }
.store-side { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.store-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.store-toolbar input[type="search"] { flex: 1 1 240px; min-width: 0; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.segmented button { border: 0; background: var(--surface); color: var(--ink-soft); padding: 7px 12px; font: inherit; font-size: 0.88rem; cursor: pointer; }
.segmented button + button { border-left: 1px solid var(--border); }
.segmented button.is-active { background: var(--teal); color: #fff; }
.store-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.store-table th, .store-table td { text-align: left; padding: 9px 14px; border-top: 1px solid var(--border); vertical-align: top; }
.store-table th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.store-table tr.is-selected td { background: var(--teal-soft); }
.store-table tr.is-dim td { opacity: 0.55; }
.row-link { display: grid; gap: 2px; text-align: left; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.row-link strong { color: var(--teal-dark); }
.row-link:hover strong { text-decoration: underline; }
.row-link .muted { font-size: 0.82rem; }
.plain-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 12px; }
.recommend-box { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; border: 1px solid var(--teal); background: var(--teal-soft); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 14px; }
.recommend-box > div:first-child { display: grid; gap: 2px; }
.recommend-box span { font-size: 0.8rem; color: var(--muted); }
.recommend-box strong { font-size: 1.25rem; color: var(--teal-dark); }
.recommend-box small { color: var(--muted); }
.history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 0.88rem; }
.restock-form { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.restock-form h3, .store-side h3 { margin: 0 0 4px; font-size: 0.95rem; }

.purchase-rows { display: grid; gap: 10px; }
.purchase-row { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface-2); display: grid; gap: 8px; }
.purchase-fields { display: flex !important; flex-wrap: wrap; gap: 10px; align-items: end; }
.purchase-fields .field { flex: 1 1 130px; min-width: 0; }
.purchase-fields .field.grow { flex: 3 1 200px; }
.purchase-fields .field.narrow { flex: 0 1 96px; }
.suggestion-line { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; font-size: 0.9rem; }
.suggestion-line strong { color: var(--teal-dark); }
.purchase-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.05rem; border-top: 1px solid var(--border); padding-top: 10px; }
.purchase-total strong { font-size: 1.3rem; }

.checkout-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.checkout-grid > * { min-width: 0; }
.pad-s { padding: 8px 10px; margin: 0; }
.checkout-search { position: relative; }
.checkout-search input { width: 100%; font-size: 1.05rem; padding: 12px 14px; }
.search-results { display: grid; margin-top: 6px; border-radius: var(--radius-sm); overflow: hidden; }
.search-results:not(:empty) { border: 1px solid var(--border); }
.result-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 12px; border: 0; border-top: 1px solid var(--border); background: var(--surface); font: inherit; color: inherit; text-align: left; cursor: pointer; }
.result-row:first-child { border-top: 0; }
.result-row:hover, .result-row:focus-visible { background: var(--teal-soft); }
.custom-line { display: flex; gap: 8px; margin-top: 12px; padding: 0 !important; }
.custom-line input:first-child { flex: 1; min-width: 0; }
.custom-line input:nth-child(2) { width: 96px; }
.cart-table .qty-input { width: 64px; }
.cart-table .price-input { width: 96px; }
.cart-table .price-input[readonly] { background: var(--surface-2); }
.totals-box { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; display: grid; gap: 4px; background: var(--surface-2); }
.total-line { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.total-line.grand { font-size: 1.4rem; font-weight: 700; border-top: 1px solid var(--border-strong); padding-top: 6px; margin-top: 2px; }
.pay-methods { display: flex; gap: 8px; flex-wrap: wrap; }
.pay-method { flex: 1 1 110px; min-height: 52px; border: 2px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; font-size: 1.1rem; font-weight: 700; cursor: pointer; }
.pay-method.is-active { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-dark); }
.pay-other { flex: 1 1 110px; min-height: 52px; }
.pay-other.is-active { border-color: var(--teal); }
.cash-box { display: grid; gap: 8px; }
.cash-box[hidden] { display: none; }
.quick-cash { display: flex; flex-wrap: wrap; gap: 6px; }
.change-due { font-size: 1.2rem; margin: 0; }
.change-due strong { color: var(--green); }
.big-button { min-height: 52px; font-size: 1.1rem; flex: 1; }
.sale-done { display: grid; gap: 8px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--green); background: var(--green-soft); }
.sale-done.has-change span { color: var(--green); font-weight: 600; }
.change-big { font-size: 2.4rem; line-height: 1.1; color: var(--green); font-variant-numeric: tabular-nums; }
.split-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }

.parts-used-section { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid var(--border); }
.parts-used-section h3 { margin: 0; font-size: 0.98rem; }
.parts-used-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.parts-used-list li { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 0.9rem; }
.use-part-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.use-part-form select { flex: 1 1 200px; min-width: 0; }
.use-part-form input[type="number"] { width: 64px; }
.bill-discount { margin-top: 8px; }
.perm-box { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; display: grid; gap: 6px; margin: 0; }
.perm-box legend { font-weight: 600; padding: 0 4px; }

.date-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.date-nav h2 { margin: 0 0 0 8px; font-size: 1.1rem; flex: 1 1 auto; }
.pl-table { display: grid; padding: 8px 18px 16px; }
.pl-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.pl-row small { display: block; color: var(--muted); font-size: 0.78rem; }
.pl-row.strong { font-weight: 700; border-bottom-color: var(--border-strong); }
.week-chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; padding: 12px 18px 4px; height: 170px; }
.week-day { display: grid; grid-template-rows: 1fr auto; gap: 4px; background: none; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 4px; cursor: pointer; font: inherit; color: var(--muted); }
.week-day.is-active { border-color: var(--teal); }
.week-day .bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 100%; }
.bar { width: 40%; max-width: 22px; border-radius: 3px 3px 0 0; min-height: 2px; }
.bar.in, .key.in { background: #9fb7bd; }
.bar.profit, .key.profit { background: var(--teal); }
.bar.loss, .key.loss { background: var(--red); }
.chart-key { display: flex; gap: 6px 14px; align-items: center; flex-wrap: wrap; padding: 0 18px 14px; margin: 0; font-size: 0.82rem; color: var(--muted); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: -8px; }

.eod-paper { max-width: 820px; }
.eod-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.eod-summary div { border: 1px solid #ddd; border-radius: 6px; padding: 8px 10px; display: grid; }
.eod-summary span, .eod-summary small { color: #666; font-size: 0.78rem; }
.eod-summary strong { font-size: 1.15rem; }
.eod-heading { font-size: 1rem; margin: 18px 0 6px; border-bottom: 2px solid #222; padding-bottom: 4px; }
.eod-txn { border: 1px solid #ddd; border-radius: 6px; padding: 8px 10px; margin: 8px 0; break-inside: avoid; }
.eod-txn header { display: flex; justify-content: space-between; gap: 10px; }
.eod-txn.voided { opacity: 0.6; text-decoration: line-through; }
.eod-who { margin: 2px 0 0; color: #555; font-size: 0.85rem; }
.eod-lines { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.85rem; color: #444; }
.eod-total td { border-top: 2px solid #222; }
.eod-sign { margin-top: 28px; font-size: 0.95rem; }

@media (max-width: 1100px) {
  .store-workspace, .checkout-grid { grid-template-columns: 1fr; }
  .store-side { position: static; max-height: none; }
}
@media (max-width: 720px) {
  .store-page { padding: 12px 12px 24px; }
  .store-table th, .store-table td { padding: 8px 8px; }
  .eod-summary { grid-template-columns: repeat(2, 1fr); }
  .week-chart { height: 130px; gap: 4px; padding: 10px 8px 4px; }
}
.receipt-stamp-row { text-align: right; }
.receipt-stamp-row.center { text-align: center; }

.cart-table input { min-height: 36px !important; padding: 6px 8px !important; }
.store-page input[type="date"] { width: auto; }
.pay-other { width: auto !important; flex: 1 1 110px; }
