:root {
  --bg: #F4F6F9;
  --bg-outer: #E8ECF1;
  --surface: #FFFFFF;
  --surface-soft: #F1F4F8;
  --border: #D9E0E8;
  --border-strong: #B9C4D1;
  --text: #111827;
  --text-muted: #526071;
  --primary: #1B365D;
  --primary-hover: #142947;
  --primary-soft: #EBF0F7;
  --primary-border: #C5D3E6;
  --green: #0F6B4A;
  --green-hover: #0B553B;
  --green-bg: #ECFDF5;
  --green-border: #B7EBD5;
  --red: #B42318;
  --red-hover: #912018;
  --red-bg: #FEF2F2;
  --red-border: #F5C2C0;
  --wa: #166534;
  --wa-hover: #14532D;
  --shadow-sm: 0 1px 3px rgba(17, 24, 39, 0.06);
  --shadow-md: 0 8px 24px rgba(17, 24, 39, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --nav-height: 68px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 16px;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

.hidden {
  display: none !important;
}

/* Monochrome SVG icon utility */
.ico {
  width: 20px;
  height: 20px;
  display: inline-block;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.ico-sm {
  width: 16px;
  height: 16px;
}

.ico-lg {
  width: 24px;
  height: 24px;
}

/* ==================== LAYOUT SHELL (CLEAN & SIMPLE) ==================== */
.app-shell {
  max-width: 580px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}

@media (min-width: 620px) {
  body {
    background: var(--bg-outer);
  }
  .app-shell {
    box-shadow: 0 0 36px rgba(17, 24, 39, 0.08);
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--primary);
  color: #FFFFFF;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 1px 6px rgba(17, 24, 39, 0.14);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.topbar-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topbar-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
}

.topbar-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  transition: background 0.12s ease;
}

.topbar-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.main-content {
  flex: 1;
  padding: 16px 16px calc(var(--nav-height) + 24px);
}

/* ==================== BOTTOM NAVIGATION ==================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 580px;
  height: var(--nav-height);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 30;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -2px 10px rgba(17, 24, 39, 0.05);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  position: relative;
  transition: color 0.15s ease;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22%;
  right: 22%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--primary);
}

/* ==================== LOCK SCREEN (PIN) ==================== */
.lock-screen {
  min-height: 100vh;
  max-width: 580px;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--primary) 0%, #142947 38%, var(--bg) 38%);
  padding: 32px 20px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lock-card {
  width: 100%;
  max-width: 390px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 22px 24px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.lock-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lock-title {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.lock-subtitle {
  margin: 6px 0 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 14px 0 8px;
  min-height: 20px;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: transparent;
  transition: all 0.14s ease;
}

.pin-dot.filled {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.1);
}

.pin-hint {
  font-size: 13px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  padding: 8px 12px;
  border-radius: 8px;
  margin: 10px 0 12px;
}

.pin-error {
  color: var(--red);
  font-weight: 600;
  font-size: 14px;
  min-height: 22px;
  margin-bottom: 6px;
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.pin-key {
  height: 58px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s ease, transform 0.08s ease;
}

.pin-key:active {
  transform: scale(0.96);
  background: #E2E8F0;
}

.pin-key.action-ok {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 600;
}

.pin-key.action-del {
  color: var(--text-muted);
}

.portal-link-box {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.portal-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
}

/* ==================== CARDS & KPIs ==================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

.card-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-title-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.card-title-left .ico {
  color: var(--primary);
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 15px;
  box-shadow: var(--shadow-sm);
}

.kpi-card.highlight {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.82;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.kpi-value {
  font-size: 25px;
  font-weight: 700;
  margin-top: 4px;
  line-height: 1.15;
  letter-spacing: -0.3px;
}

.kpi-sub {
  font-size: 13px;
  margin-top: 4px;
  opacity: 0.8;
}

/* ==================== SMART QUICK ENTRY ==================== */
.quick-box {
  background: var(--surface);
  border: 1.5px solid var(--primary-border);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

.quick-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.quick-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.quick-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.quick-input {
  flex: 1;
  min-width: 0;
  padding: 12px 13px;
  border: 1.5px solid var(--border-strong);
  border-radius: 9px;
  font-size: 16px;
  font-weight: 500;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.quick-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 54, 93, 0.12);
}

.mic-btn {
  width: 48px;
  border-radius: 9px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mic-btn.listening {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red-border);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.example-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.example-chip {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 6px;
}

.example-chip:hover {
  border-color: var(--primary-border);
  color: var(--primary);
  background: var(--primary-soft);
}

.smart-preview {
  margin-top: 12px;
  border-radius: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.smart-preview.type-payment {
  background: var(--green-bg);
  border-color: var(--green-border);
}

.smart-preview.type-sale {
  background: var(--red-bg);
  border-color: var(--red-border);
}

.preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.type-toggle {
  display: inline-flex;
  background: rgba(17, 24, 39, 0.07);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}

.type-toggle button {
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.type-toggle button.active-sale {
  background: var(--red);
  color: #FFFFFF;
}

.type-toggle button.active-payment {
  background: var(--green);
  color: #FFFFFF;
}

.preview-amount {
  font-size: 22px;
  font-weight: 800;
}

.preview-amount.sale { color: var(--red); }
.preview-amount.payment { color: var(--green); }

.preview-line {
  font-size: 14px;
  margin: 6px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-label {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.preview-balance {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 11px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(17, 24, 39, 0.06);
  margin-top: 8px;
}

.client-pick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.client-match-alert {
  font-size: 13px;
  font-weight: 600;
  color: #7D5A0B;
  background: #FEF9E7;
  border: 1px solid #EED99B;
  border-radius: 8px;
  padding: 7px 10px;
  margin: 8px 0 6px;
}

.client-match-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.client-match-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #FFFFFF;
  border: 1.5px solid var(--border-strong);
  text-align: left;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.client-match-option:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.client-match-option.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 1px var(--primary);
}

.client-match-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.client-match-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.client-match-bal {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.pick-chip {
  padding: 7px 12px;
  border-radius: 7px;
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  font-size: 14px;
  font-weight: 600;
}

.pick-chip.selected {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

.pick-chip.new-client {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-border);
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.12s ease, transform 0.08s ease;
}

.btn:active {
  transform: scale(0.985);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-sale {
  background: var(--red);
  color: #FFFFFF;
}

.btn-sale:hover {
  background: var(--red-hover);
}

.btn-payment {
  background: var(--green);
  color: #FFFFFF;
}

.btn-payment:hover {
  background: var(--green-hover);
}

.btn-wa {
  background: var(--wa);
  color: #FFFFFF;
}

.btn-wa:hover {
  background: var(--wa-hover);
}

.btn-soft {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-soft:hover {
  background: var(--surface-soft);
}

.btn-danger-soft {
  background: var(--red-bg);
  border-color: var(--red-border);
  color: var(--red);
}

.btn-sm {
  min-height: 36px;
  padding: 6px 11px;
  font-size: 13px;
  border-radius: 7px;
}

.big-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.big-action-btn {
  min-height: 54px;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* ==================== LISTS ==================== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 9px;
  padding: 0 13px;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 54, 93, 0.1);
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 11px 0;
  outline: none;
  font-size: 15px;
  color: var(--text);
}

.filter-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
}

.filter-pill {
  white-space: nowrap;
  padding: 7px 13px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-pill.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

.client-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 15px;
  margin-bottom: 9px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.12s ease;
}

.client-card:hover {
  border-color: var(--primary-border);
}

.client-info {
  min-width: 0;
  flex: 1;
}

.client-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.client-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.balance-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
}

.balance-badge.debt {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-border);
}

.balance-badge.clear {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.tx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid var(--surface-soft);
}

.tx-item:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.tx-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tx-icon.sale {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-border);
}

.tx-icon.payment {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.tx-body {
  flex: 1;
  min-width: 0;
}

.tx-desc {
  font-weight: 600;
  font-size: 15px;
}

.tx-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.tx-right {
  text-align: right;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tx-amount {
  font-size: 16px;
  font-weight: 700;
}

.tx-amount.sale { color: var(--red); }
.tx-amount.payment { color: var(--green); }

.icon-trash {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-trash:hover {
  background: var(--red-bg);
  color: var(--red);
}

/* ==================== CATALOG ==================== */
.catalog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.catalog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.catalog-card.unavailable {
  opacity: 0.6;
}

.catalog-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.catalog-info {
  flex: 1;
  min-width: 0;
}

.catalog-name {
  font-size: 15px;
  font-weight: 700;
}

.catalog-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.catalog-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

/* ==================== FORMS & MODALS ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 620px) {
  .modal-backdrop {
    align-items: center;
    padding: 20px;
  }
}

.modal-sheet {
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  padding: 20px 18px 26px;
  box-shadow: var(--shadow-md);
}

@media (min-width: 620px) {
  .modal-sheet {
    border-radius: 14px;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--border);
  color: var(--text);
}

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.form-input, .form-select {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 54, 93, 0.12);
}

.quick-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.amt-chip {
  padding: 7px 12px;
  border-radius: 7px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
}

.amt-chip:hover {
  border-color: var(--primary-border);
  color: var(--primary);
}

/* ==================== DETAIL HERO & ACCESS CODE ==================== */
.detail-hero {
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  margin-bottom: 14px;
}

.detail-hero.debt {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
}

.detail-hero.clear {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
}

.detail-balance {
  font-size: 32px;
  font-weight: 800;
  margin: 4px 0;
  letter-spacing: -0.4px;
}

.access-code-box {
  background: var(--primary-soft);
  border: 1px dashed var(--primary-border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}

.code-pill {
  display: inline-block;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 3px;
  background: #FFFFFF;
  color: var(--primary);
  padding: 5px 14px;
  border-radius: 8px;
  border: 1px solid var(--primary-border);
}

/* ==================== SWITCH & MISC ==================== */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

.switch-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
}

.empty-state {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.empty-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border-radius: 11px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 14px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #FFFFFF;
  padding: 11px 18px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  z-index: 90;
  max-width: 92%;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.info-banner {
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  border-radius: 9px;
  padding: 11px 13px;
  font-size: 14px;
  margin-bottom: 12px;
}

.warn-banner {
  background: #FEF9E7;
  color: #7D5A0B;
  border: 1px solid #EED99B;
  border-radius: 9px;
  padding: 11px 13px;
  font-size: 14px;
  margin-bottom: 12px;
}

/* ==================== CART & ORDERS ==================== */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  overflow: hidden;
  background: var(--surface);
}

.qty-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: var(--surface-soft);
}

.qty-btn:hover {
  background: var(--primary-soft);
}

.qty-val {
  min-width: 28px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.cart-box {
  background: var(--surface);
  border: 1.5px solid var(--primary-border);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 14px;
  box-shadow: var(--shadow-sm);
}

.cart-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--surface-soft);
  font-size: 14px;
}

.cart-line:last-child {
  border-bottom: none;
}

.cart-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 12px;
  margin-top: 4px;
  border-top: 1.5px solid var(--border);
  font-size: 16px;
  font-weight: 700;
}

.order-card {
  border: 1px solid var(--primary-border);
  background: var(--primary-soft);
  border-radius: 10px;
  padding: 12px 13px;
  margin-bottom: 10px;
}

.order-card:last-child {
  margin-bottom: 0;
}

.order-items-list {
  margin: 8px 0;
  padding: 8px 10px;
  background: #FFFFFF;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
}

.device-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-pill.ok {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.status-pill.warn {
  background: #FEF9E7;
  color: #7D5A0B;
  border: 1px solid #EED99B;
}
