:root {
  --green-900: #14532d;
  --green-700: #15803d;
  --green-600: #16a34a;
  --green-500: #22c55e;
  --green-50:  #f0fdf4;
  --ink:       #0f172a;
  --ink-muted: #475569;
  --border:    #cbd5e1;
  --bg:        #ffffff;
  --danger:    #b91c1c;

  --radius:    14px;
  --tap-min:   56px;
  --tap-lg:    64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--green-50);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

/* ---------- Login page ---------- */

.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px 32px;
  box-shadow: 0 10px 30px rgba(20, 83, 45, 0.08);
  text-align: center;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border-radius: 20px;
  background: var(--green-600);
  color: white;
  font-weight: 800;
  font-size: 32px;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

h1 {
  margin: 0 0 4px;
  font-size: 28px;
  color: var(--green-900);
}

.subtitle {
  margin: 0 0 28px;
  color: var(--ink-muted);
  font-size: 16px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input[type="text"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="email"] {
  height: var(--tap-min);
  padding: 0 16px;
  font-size: 20px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:focus {
  border-color: var(--green-600);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.input-with-action {
  position: relative;
  display: flex;
  align-items: stretch;
}

.input-with-action input {
  flex: 1;
  padding-right: 60px;
}

.input-action {
  position: absolute;
  top: 6px;
  right: 6px;
  bottom: 6px;
  width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--green-900);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
}

.input-action:hover  { background: var(--green-50); }
.input-action:active { background: #dcfce7; }

.input-action .icon-eye-off { display: none; }
.input-action[aria-pressed="true"] .icon-eye     { display: none; }
.input-action[aria-pressed="true"] .icon-eye-off { display: inline; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-lg);
  padding: 0 24px;
  font-size: 20px;
  font-weight: 700;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: background 120ms ease, border-color 120ms ease, transform 60ms ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--green-600);
  color: white;
}
.btn-primary:hover  { background: var(--green-700); }
.btn-primary:active { background: var(--green-900); }

.btn-secondary {
  background: white;
  color: var(--green-900);
  border-color: var(--green-600);
}
.btn-secondary:hover { background: var(--green-50); }

.lang-toggle {
  margin-top: 28px;
  display: inline-flex;
  border: 2px solid var(--green-600);
  border-radius: 999px;
  overflow: hidden;
}

.lang-btn {
  min-height: 48px;
  padding: 0 22px;
  font-size: 16px;
  font-weight: 600;
  background: white;
  color: var(--green-900);
  border: none;
  cursor: pointer;
  touch-action: manipulation;
}

.lang-btn.is-active {
  background: var(--green-600);
  color: white;
}

.footer {
  margin-top: 24px;
  color: var(--ink-muted);
  font-size: 14px;
}

/* ---------- App shell (post-login) ---------- */

.app-page {
  background: var(--green-50);
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: var(--green-700);
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo.logo-sm {
  width: 48px;
  height: 48px;
  font-size: 18px;
  border-radius: 12px;
  margin: 0;
  background: white;
  color: var(--green-700);
}

.brand {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.2px;
}

.user-chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  font-weight: 600;
  font-size: 16px;
}

.timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 20px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(0,0,0,0.18);
  min-width: 84px;
  text-align: center;
}

.timer-warn {
  background: var(--danger);
  animation: pulse 1s steps(2, end) infinite;
}

@keyframes pulse {
  50% { opacity: 0.55; }
}

.btn-ghost {
  background: transparent;
  color: white;
  border-color: rgba(255,255,255,0.6);
}
.btn-ghost:hover { background: rgba(255,255,255,0.12); }

.btn-sm {
  min-height: 44px;
  font-size: 16px;
  padding: 0 16px;
}

.btn-xl {
  width: 100%;
  min-height: 80px;
  font-size: 24px;
}

.app-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 12px;
  max-width: none;
  margin: 0;
  padding: 14px 16px 24px;
}
.app-shell > .app-main { margin: 0; padding: 0; max-width: none; }

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 84px;
  align-self: start;
}
.side-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 0 18px;
  font-size: 17px;
  font-weight: 700;
  background: white;
  color: var(--green-900);
  border: 2px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  touch-action: manipulation;
  text-align: left;
}
.side-btn:hover  { background: var(--green-50); border-color: var(--green-500); }
.side-btn:active { background: #dcfce7; }
.side-btn-primary {
  background: var(--green-600);
  color: white;
  border-color: var(--green-600);
}
.side-btn-primary:hover  { background: var(--green-700); border-color: var(--green-700); }
.side-btn-primary:active { background: var(--green-900); border-color: var(--green-900); }
.side-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  font-size: 20px;
  font-weight: 800;
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar   { position: static; flex-direction: row; flex-wrap: wrap; }
  .side-btn  { flex: 1 1 calc(50% - 5px); }
  .side-btn-primary { flex: 1 1 100%; }
}

.app-main-grid {
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: min-content;
  gap: 12px;
}
.app-main-grid .row          { padding: 12px 14px; }
.app-main-grid .row-action   { grid-column: 1 / -1; }
.app-main-grid .btn-xl       { min-height: 60px; font-size: 20px; }
.app-main-grid .order-head   { gap: 8px; }
.app-main-grid .row-actions  { gap: 8px; }
.app-main-grid .order-items  { padding: 8px 10px; gap: 2px; }
.app-main-grid .order-items li { font-size: 14px; }
.app-main-grid .ticket       { font-size: 15px; }
.app-main-grid .order-status { font-size: 15px; padding: 7px 10px; }
.app-main-grid .order-meta   { font-size: 13px; }
.app-main-grid .btn          { min-height: 44px; font-size: 15px; padding: 0 14px; }

@media (max-width: 1100px) {
  .app-main-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .app-main-grid { grid-template-columns: 1fr; }
}

.row {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 4px 12px rgba(20, 83, 45, 0.05);
}

.row-order {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ticket {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.row-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.order-items {
  list-style: none;
  margin: 0;
  padding: 10px 14px;
  background: var(--green-50);
  border: 1px solid #d1fae5;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.order-items li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-size: 16px;
  color: var(--ink);
}
.order-items li > span:last-child {
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
  font-weight: 600;
  white-space: nowrap;
}
.order-items .item-discount > span:last-child { color: var(--danger); }
.order-items .item-iva { border-top: 1px dashed #bbf7d0; padding-top: 4px; margin-top: 2px; }

.order-meta {
  font-size: 14px;
  color: var(--ink-muted);
}

.order-status {
  font-size: 18px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 10px;
  display: inline-block;
  width: fit-content;
}

.status-unpaid {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.status-paid {
  background: var(--green-50);
  color: var(--green-900);
  border: 1px solid #bbf7d0;
}

/* ---------- New order page ---------- */

.app-main-wide { max-width: 1024px; }

.section-title {
  margin: 0 0 16px;
  font-size: 20px;
  color: var(--green-900);
}

.finder-search { margin-bottom: 14px; }
.finder-search input { font-size: 20px; }

/* Customer card on new-order */

.customer-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: white;
  flex-wrap: wrap;
}
.customer-card.customer-empty-state {
  border-style: dashed;
  color: var(--ink-muted);
  font-style: italic;
}
.customer-card-body { display: flex; flex-direction: column; gap: 4px; flex: 1 1 280px; font-style: normal; }
.customer-card-body .c-name { font-weight: 700; font-size: 20px; color: var(--ink); }
.customer-card-body .c-meta { font-size: 15px; color: var(--ink-muted); }

/* New customer form */

.new-cust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.new-cust-grid .chip-wide { grid-column: 1 / -1; }
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  padding: 12px 0;
}
.check-row input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: var(--green-600);
}
/* ---------- Admin page ---------- */

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.admin-tile {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 22px;
  aspect-ratio: 1.618 / 1;
  padding: 22px 26px;
  background: white;
  border: 2px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(20, 83, 45, 0.06);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 120ms ease, transform 60ms ease, box-shadow 120ms ease;
}
.admin-tile:hover {
  border-color: var(--green-500);
  box-shadow: 0 12px 30px rgba(20, 83, 45, 0.12);
}
.admin-tile:active { transform: translateY(1px); }

.admin-ico {
  font-size: 56px;
  line-height: 1;
  flex: 0 0 auto;
}
.admin-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.admin-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--green-900);
}
.admin-sub {
  font-size: 15px;
  color: var(--ink-muted);
  line-height: 1.35;
}

@media (max-width: 1100px) {
  .admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .admin-grid { grid-template-columns: 1fr; padding: 16px; gap: 14px; }
  .admin-tile { aspect-ratio: auto; min-height: 100px; padding: 16px 20px; gap: 16px; }
  .admin-ico  { font-size: 40px; }
  .admin-title { font-size: 22px; }
}

/* ---------- Admin sub-pages ---------- */

.admin-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.page-head h1 { margin: 0; font-size: 24px; color: var(--green-900); }

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.toolbar input[type="search"],
.toolbar input[type="text"],
.toolbar select {
  height: 48px;
  padding: 0 14px;
  font-size: 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: white;
  min-width: 220px;
}
.toolbar label.check-row { font-size: 15px; padding: 0; }

.admin-table-wrap {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.admin-table th,
.admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table th {
  background: var(--green-50);
  color: var(--green-900);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table td.num { font-variant-numeric: tabular-nums; text-align: right; }
.admin-table td .row-actions { justify-content: flex-end; }
.admin-table .btn { min-height: 40px; padding: 0 14px; font-size: 14px; }

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pill-ok       { background: #dcfce7; color: var(--green-900); }
.pill-warn     { background: #fef3c7; color: #92400e; }
.pill-bad      { background: #fee2e2; color: var(--danger); }
.pill-muted    { background: #e2e8f0; color: var(--ink-muted); }
.pill-admin    { background: var(--green-700); color: white; }
.pill-cashier  { background: var(--green-50); color: var(--green-900); border: 1px solid var(--green-500); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat-card .stat-label {
  font-size: 13px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-card .stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--green-900);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.stat-card .stat-sub { font-size: 13px; color: var(--ink-muted); margin-top: 2px; }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal-backdrop[hidden] { display: none; }

.modal {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  background: white;
  border-radius: 16px;
  box-shadow: 0 24px 50px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--green-700);
  color: white;
}
.modal-head h2 { margin: 0; font-size: 20px; }

.modal-close {
  width: 44px;
  height: 44px;
  font-size: 28px;
  line-height: 1;
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  border-radius: 10px;
}
.modal-close:hover { background: rgba(255,255,255,0.15); }

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
}

.modal-foot {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--green-50);
}
.modal-foot .btn-xl { flex: 1; }

.pay-ticket {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--green-50);
}
.pay-due strong { font-size: 20px; color: var(--green-900); font-variant-numeric: tabular-nums; }

.pay-methods {
  display: flex;
  gap: 0;
  border: 2px solid var(--green-600);
  border-radius: 12px;
  overflow: hidden;
}
.pay-method {
  flex: 1;
  min-height: 56px;
  font-size: 18px;
  font-weight: 700;
  background: white;
  color: var(--green-900);
  border: none;
  cursor: pointer;
  touch-action: manipulation;
}
.pay-method + .pay-method { border-left: 2px solid var(--green-600); }
.pay-method.is-active { background: var(--green-600); color: white; }

.factura-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  padding: 14px;
  background: var(--green-50);
  border: 1px dashed var(--green-500);
  border-radius: 12px;
}

.chip-input {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chip-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.customer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  background: var(--green-50);
}

.customer-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: white;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  min-height: var(--tap-min);
  white-space: nowrap;
  overflow: hidden;
}
.customer-item:hover { border-color: var(--green-500); }
.customer-item.is-selected {
  border-color: var(--green-600);
  background: #ecfdf5;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
}
.customer-item .c-name  { font-weight: 700; font-size: 18px; flex: 0 0 auto; }
.customer-item .c-phone { color: var(--ink-muted); font-size: 15px; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.customer-item .c-email { color: var(--ink-muted); font-size: 15px; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
.customer-item .badge-factura { flex: 0 0 auto; margin-left: auto; }

.customer-empty {
  padding: 18px;
  text-align: center;
  color: var(--ink-muted);
  font-style: italic;
}

.finder-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.selected-customer {
  font-weight: 600;
  color: var(--green-900);
}

/* Service items */

.svc-grid {
  display: grid;
  gap: 12px;
}

.svc-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: white;
  flex-wrap: wrap;
}

.svc-head { display: flex; flex-direction: column; gap: 2px; }
.svc-name { font-size: 19px; font-weight: 700; }
.svc-unit { font-size: 14px; color: var(--ink-muted); }

.qty {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 2px solid var(--green-600);
  border-radius: 12px;
  overflow: hidden;
  background: white;
}

.qty-btn {
  width: 56px;
  height: 56px;
  border: none;
  background: var(--green-50);
  color: var(--green-900);
  font-size: 28px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}
.qty-btn:hover  { background: #dcfce7; }
.qty-btn:active { background: var(--green-500); color: white; }

.qty-input {
  width: 88px;
  height: 56px;
  border: none;
  border-left: 2px solid var(--green-600);
  border-right: 2px solid var(--green-600);
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.qty-input:focus {
  outline: none;
  background: #f0fdf4;
  box-shadow: none;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input[type="number"] { -moz-appearance: textfield; }

.svc-addr {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}
.svc-addr .svc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  flex-wrap: wrap;
}
.svc-address {
  border-top: 2px dashed var(--green-500);
  background: var(--green-50);
  padding: 10px 12px;
}
.svc-address input { width: 100%; height: 48px; font-size: 17px; }
.svc-address .chip-input { gap: 6px; }
.addr-hint {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
}

/* Toggle switch for delivery */

.switch {
  position: relative;
  display: inline-block;
  width: 72px;
  height: 40px;
  cursor: pointer;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  transition: background 150ms ease;
}
.switch-thumb {
  position: absolute;
  top: 4px; left: 4px;
  width: 32px; height: 32px;
  background: white;
  border-radius: 50%;
  transition: transform 150ms ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}
.switch input:checked + .switch-track { background: var(--green-600); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(32px); }

/* Total + actions */

.coupon-input {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: stretch;
}
.coupon-input .combo { width: 100%; }
.coupon-input .btn { height: 56px; }

.combo {
  position: relative;
  display: flex;
  align-items: stretch;
}
.combo input {
  flex: 1;
  width: 100%;
  height: 56px;
  padding: 0 16px;
  font-size: 20px;
  letter-spacing: 0.1em;
}

.combo-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  list-style: none;
  margin: 0;
  padding: 4px;
  background: white;
  border: 2px solid var(--green-600);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.15);
  max-height: 260px;
  overflow: auto;
}
.combo-list[hidden] { display: none; }
.combo-option {
  padding: 14px 14px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  color: var(--green-900);
}
.combo-option:hover { background: var(--green-50); }

.btn-ghost-dark {
  background: transparent;
  color: var(--green-900);
  border: 2px solid var(--border);
}
.btn-ghost-dark:hover { background: var(--green-50); }

.coupon-status {
  margin: 10px 0 0;
  font-size: 15px;
  color: var(--ink-muted);
  min-height: 1.2em;
}
.coupon-status.is-ok    { color: var(--green-700); font-weight: 600; }
.coupon-status.is-error { color: var(--danger); font-weight: 600; }
.coupon-status.is-warn  { color: #b45309; font-weight: 600; }

.totals {
  background: var(--green-700);
  color: white;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 22px;
}
.totals-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
}
.totals-line .num { font-variant-numeric: tabular-nums; font-weight: 700; }
.totals-iva      { color: #d9f99d; }
.totals-discount { color: #fecaca; }
.totals-grand {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.3);
  font-size: 22px;
}
.totals-grand .num { font-size: 30px; font-weight: 800; }

.badge-factura {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: white;
  background: var(--green-700);
  border-radius: 999px;
  vertical-align: middle;
  text-transform: uppercase;
}

.row-action-bar {
  display: flex;
  gap: 12px;
  align-items: center;
}
.row-action-bar .btn-xl { flex: 1; }
