:root {
  --bg: #0b1020;
  --surface: #111827;
  --surface-2: #182235;
  --surface-3: #202d44;
  --text: #f8fbff;
  --muted: #aab8cc;
  --line: rgba(160, 174, 198, .22);
  --primary: #22c7ff;
  --primary-2: #28d17c;
  --accent: #ff9f1c;
  --danger: #ff4d67;
  --warning: #ffd166;
  --purple: #a78bfa;
  --shadow: 0 24px 70px rgba(0, 0, 0, .30);
}

body[data-theme="light"] {
  --bg: #eef4fb;
  --surface: #ffffff;
  --surface-2: #f5f8fc;
  --surface-3: #e7eef7;
  --text: #101828;
  --muted: #607089;
  --line: rgba(38, 58, 84, .16);
  --primary: #0878d9;
  --primary-2: #059669;
  --accent: #e76f00;
  --danger: #d92d20;
  --warning: #a16207;
  --purple: #6d5bd0;
  --shadow: 0 18px 50px rgba(15, 23, 42, .12);
}

* { box-sizing: border-box; }
html { min-height: 100%; overflow-x: hidden; }
body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at 8% 0%, rgba(34, 199, 255, .18), transparent 31%),
    radial-gradient(circle at 94% 8%, rgba(255, 159, 28, .14), transparent 28%),
    linear-gradient(145deg, #080d19 0%, var(--bg) 52%, #0d1526 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: 0;
}
body[data-theme="light"] {
  background:
    radial-gradient(circle at 0% 0%, rgba(8, 120, 217, .14), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(231, 111, 0, .11), transparent 28%),
    linear-gradient(145deg, #f8fbff 0%, var(--bg) 100%);
}

h1, h2, h3, p { margin: 0; }
p, small { color: var(--muted); }
button, input, select, textarea { font: inherit; }
button {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 900;
  color: var(--text);
}
button.small { min-height: 36px; padding: 8px 11px; font-size: 13px; }
button.primary, .primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 28px color-mix(in srgb, var(--primary), transparent 78%);
}
button.ghost, .ghost {
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.danger-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--danger), var(--accent));
}
input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--surface-2);
}
textarea { min-height: 96px; resize: vertical; }

.app-frame {
  width: min(1540px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 34px;
}
.command-center {
  position: sticky;
  top: 10px;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(245px, .9fr) minmax(360px, 1.5fr) minmax(170px, auto);
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface), transparent 6%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.brand {
  min-width: 0;
  display: flex;
  gap: 12px;
  align-items: center;
}
.brand-mark {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  font-size: 18px;
  font-weight: 950;
  background: linear-gradient(145deg, var(--primary), var(--primary-2));
}
.brand strong, .brand span { display: block; }
.brand strong { font-size: 16px; line-height: 1.1; color: var(--text); }
.brand span { margin-top: 3px; font-size: 12px; color: var(--muted); }
.login-body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 12%, color-mix(in srgb, var(--primary), transparent 70%), transparent 30%),
    radial-gradient(circle at 82% 20%, rgba(255, 138, 76, .18), transparent 28%),
    linear-gradient(135deg, #071827, #0c1220 54%, #161018);
}
.login-wrap {
  width: min(100%, 440px);
}
.login-card {
  padding: 28px;
  border: 1px solid color-mix(in srgb, var(--line), #fff 10%);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface), transparent 4%);
  box-shadow: 0 26px 70px rgba(0, 0, 0, .38);
}
.login-brand {
  margin-bottom: 24px;
}
.login-form {
  display: grid;
  gap: 14px;
}
.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.login-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  color: var(--text);
  background: var(--surface-2);
  outline: none;
}
.login-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary), transparent 82%);
}
.login-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
}
.login-error {
  min-height: 20px;
  margin-top: 14px;
  color: var(--danger);
  font-weight: 850;
}
.command-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface-2);
}
.nav-item {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 950;
}
.nav-item:hover, .nav-item.active {
  color: var(--text);
  border-color: color-mix(in srgb, var(--primary), transparent 55%);
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary), transparent 76%), color-mix(in srgb, var(--primary-2), transparent 82%));
}
.system-card {
  justify-self: end;
  min-width: 156px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}
.system-card b, .system-card small { display: block; }
.system-card small { margin-top: 2px; }
.pulse {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--primary-2);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--primary-2), transparent 84%);
}
.pulse.offline {
  background: var(--danger);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--danger), transparent 84%);
}

.main { width: 100%; min-width: 0; }
.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, auto);
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface), transparent 2%), color-mix(in srgb, var(--surface-2), transparent 6%));
  box-shadow: var(--shadow);
}
.topbar h1 {
  font-size: clamp(30px, 4.6vw, 56px);
  line-height: .96;
  color: var(--text);
}
.topbar p {
  max-width: 880px;
  margin-top: 8px;
  font-size: 15px;
}
.top-actions, .modal-actions, .quick-actions, .finance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.top-actions { justify-content: flex-end; }
.live-pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--primary-2), transparent 58%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-2), transparent 86%);
  font-weight: 900;
}
.live-pill span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--primary-2);
}

.page { display: none; }
.page.active { display: block; }
.filterbar, .finance-hero, .card, .metric, .insight-card, .finance-board article, .tab-panel, dialog {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 20px;
}
.filterbar label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}
.filterbar input { min-width: 150px; }
.chip {
  min-height: 38px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-2);
}
.chip.active {
  color: #fff;
  background: var(--primary);
}

.top-actions .ghost.active {
  border-color: color-mix(in srgb, var(--primary), transparent 40%);
  background: color-mix(in srgb, var(--primary), transparent 86%);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.dash-metrics {
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  overflow-x: auto;
  padding-bottom: 3px;
  margin-bottom: 14px;
}
.details-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.finance-metrics { margin: 14px 0; }
.metric {
  min-height: 122px;
  padding: 16px;
  border-radius: 20px;
}
.metric small {
  display: block;
  margin: 10px 0 5px;
  font-weight: 900;
  color: var(--muted);
}
.metric strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: clamp(22px, 2.3vw, 32px);
  line-height: 1.08;
}
.metric-icon {
  min-width: 38px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  background: var(--surface-2);
}
.blue { color: var(--primary); background: color-mix(in srgb, var(--primary), transparent 86%); }
.green, .ok { color: var(--primary-2); background: color-mix(in srgb, var(--primary-2), transparent 86%); }
.purple { color: var(--purple); background: color-mix(in srgb, var(--purple), transparent 86%); }
.warning { color: var(--warning); background: color-mix(in srgb, var(--warning), transparent 86%); }
.danger { color: var(--danger); background: color-mix(in srgb, var(--danger), transparent 86%); }
.metric.hidden-card { display: none; }
.metric.warning-state { border-color: color-mix(in srgb, var(--warning), transparent 48%); }
.metric.danger-state { border-color: color-mix(in srgb, var(--danger), transparent 45%); }

.insight-grid, .finance-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.insight-card, .finance-board article {
  min-height: 120px;
  padding: 14px;
  border-radius: 18px;
}
.insight-card span, .finance-board span {
  display: block;
  font-size: 12px;
  font-weight: 950;
  color: var(--muted);
  text-transform: uppercase;
}
.insight-card b, .finance-board b {
  display: block;
  margin: 8px 0;
  font-size: 23px;
  line-height: 1.1;
}
.insight-card.warn { border-color: color-mix(in srgb, var(--warning), transparent 48%); }
.insight-card.danger { border-color: color-mix(in srgb, var(--danger), transparent 45%); }
.finance-board article.warn { border-color: color-mix(in srgb, var(--warning), transparent 48%); }
.finance-board article.danger { border-color: color-mix(in srgb, var(--danger), transparent 45%); }
.finance-board .wide { grid-column: span 2; }

.layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}
.span-4 { grid-column: span 4; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
.card {
  min-width: 0;
  padding: 16px;
  border-radius: 20px;
}
.card-head, .section-head {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.card-head h2, .section-head h2 { font-size: 19px; }
.section-head.compact { margin-top: 4px; margin-bottom: 4px; }
.badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.chart {
  min-height: 280px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface-2);
}
.chart svg { width: 100%; height: auto; display: block; }

.table-wrap {
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}
.table-wrap.fixed, .table-wrap.mini { max-height: none; }
table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}
th, td {
  padding: 10px 9px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
  word-break: break-word;
}
th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted);
  background: var(--surface-3);
  font-size: 12px;
  text-transform: uppercase;
}
td { color: var(--text); }
.payment-person {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.payment-person span,
.payment-pix-key span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  line-height: 1.1;
  text-transform: uppercase;
}
.payment-person b {
  display: block;
  font-size: 14px;
  line-height: 1.15;
}
.payment-person small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}
.payment-ref {
  margin-top: 7px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.25;
}
.payment-pix-key {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.payment-pix-key b {
  display: block;
  color: var(--text);
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.actions, .action-stack { display: flex; flex-wrap: nowrap; gap: 10px; min-width: 0; justify-content: flex-end; align-items: center; }
.actions button {
  white-space: nowrap;
  min-width: 82px;
}
.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  background: var(--surface-3);
}
.status.online { color: var(--primary-2); background: color-mix(in srgb, var(--primary-2), transparent 86%); }
.status.offline { color: var(--danger); background: color-mix(in srgb, var(--danger), transparent 86%); }
.status.pending { color: var(--warning); background: color-mix(in srgb, var(--warning), transparent 86%); }
.empty-page {
  min-height: 160px;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
}

.status-list { display: grid; gap: 10px; }
.status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 170px) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}
.status-info { min-width: 0; }
.status-info b, .status-info small { display: block; }
.status-info small { margin: 3px 0 6px; }
.display-chip {
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary), transparent 88%);
}
.display-chip span,
.display-chip b {
  display: block;
}
.display-chip span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.display-chip b {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.15;
}
.display-chip.offline {
  background: color-mix(in srgb, var(--danger), transparent 88%);
}
.camera-thumb {
  width: 126px;
  min-height: 86px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-3);
}
.camera-thumb img, .camera-thumb video, .camera-thumb iframe, .camera-frame img, .camera-frame video, .camera-frame iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  object-fit: cover;
}
.camera-thumb span {
  display: block;
  padding: 5px;
  font-size: 11px;
}
.camera-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  color: var(--muted);
}
.camera-empty-mini { min-height: 64px; font-size: 11px; }
.camera-empty p { margin-top: 4px; font-size: 12px; }

.finance-hero {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border-radius: 22px;
}
.finance-hero h2 { margin-top: 2px; font-size: clamp(24px, 2.7vw, 36px); }
.finance-hero p { margin-top: 6px; }
#financeiroPage table th:nth-child(1), #financeiroPage table td:nth-child(1) { width: 12%; }
#financeiroPage table th:nth-child(2), #financeiroPage table td:nth-child(2) { width: 26%; }
#financeiroPage table th:nth-child(3), #financeiroPage table td:nth-child(3) { width: 17%; }
#financeiroPage table th:nth-child(4), #financeiroPage table td:nth-child(4) { width: 11%; }
#financeiroPage table th:nth-child(5), #financeiroPage table td:nth-child(5) { width: 9%; }
#financeiroPage table th:nth-child(6), #financeiroPage table td:nth-child(6) { width: 9%; }
#financeiroPage table th:nth-child(7), #financeiroPage table td:nth-child(7) { width: 9%; }
#financeiroPage table th:nth-child(8), #financeiroPage table td:nth-child(8) { width: 12%; }
.eyebrow {
  color: var(--primary-2);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.payment-main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}
.payment-main h2 {
  margin: 5px 0 8px;
  font-size: clamp(24px, 3vw, 34px);
}
.payment-main p {
  margin-top: 5px;
  font-size: 15px;
}
.payment-facts {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}
.payment-facts span,
.payment-facts b {
  min-width: 0;
  overflow-wrap: anywhere;
}
.config-panel {
  padding: 16px;
}
.compact-dialog {
  width: min(620px, calc(100vw - 18px));
}

dialog {
  width: min(1240px, calc(100vw - 18px));
  max-height: 94dvh;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
}
dialog::backdrop { background: rgba(0, 0, 0, .62); backdrop-filter: blur(4px); }
.modal-head {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
#dialogContent, #paymentContent, #machineForm {
  max-height: calc(94dvh - 82px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
}
.details-shell { min-width: 0; }
.detail-tabs {
  position: sticky;
  top: -16px;
  z-index: 6;
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  padding: 8px;
  overflow-x: hidden;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}
.tab-btn {
  flex: 1 1 150px;
  min-height: 38px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
}
.tab-btn.active {
  color: #fff;
  background: var(--primary);
}
.detail-tab-panel { display: none; }
.detail-tab-panel.active { display: block; }
.tab-panel {
  min-width: 0;
  padding: 16px;
  border-radius: 18px;
}
.tab-panel h2 { margin-bottom: 8px; }
.tab-panel p { margin-bottom: 12px; line-height: 1.45; }
.two-cols, .detail-two-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.camera-cols { align-items: start; }
.camera-frame {
  min-height: 370px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #050914;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-grid label {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}
.form-grid .wide, .wide { grid-column: 1 / -1; }
.check {
  display: flex !important;
  grid-template-columns: auto minmax(0, 1fr);
  flex-direction: row;
  align-items: center;
  gap: 9px !important;
  color: var(--text) !important;
}
.check input { width: 18px; min-height: 18px; }
.password-field > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.info-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.info-list > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}
.info-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.info-list b {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}
.qr-box {
  min-height: 220px;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}
.qr-box img { max-width: 100%; height: auto; }
.muted-note { margin-top: 10px; color: var(--muted); }

.display-preview {
  min-height: 236px;
  padding: 16px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.28);
  color: #fff;
  background: linear-gradient(160deg, #243bff, #14c89b 52%, #f0b84a);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 18px 38px rgba(0,0,0,.24);
}
.display-preview.colorido { background: linear-gradient(160deg, #243bff, #14c89b 52%, #f0b84a); }
.display-preview.bolinhas { background: radial-gradient(circle at 18% 22%, rgba(255,255,255,.22), transparent 18%), linear-gradient(160deg,#050b18,#0d78d6 58%,#f4c430); }
.display-preview.cards { background: linear-gradient(160deg,#101936,#0ea5e9 52%,#f97316); }
.display-preview.arcade { background: linear-gradient(160deg,#06020f,#7c3aed 42%,#00f5d4 76%); }
.display-preview.premium { background: linear-gradient(160deg,#050608,#1f2937 58%,#d6a83c); }
.mini-screen-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.mini-screen-head b {
  font-size: 32px;
  line-height: 1;
  text-shadow: 0 3px 8px rgba(0,0,0,.35);
}
.mini-screen-head span { font-size: 16px; font-weight: 950; opacity: .95; }
.display-preview.arcade .mini-screen-head b { font-size: 38px; }
.display-preview.premium .mini-screen-head b { font-size: 28px; }
.mini-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.mini-buttons div {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 14px;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(4px);
}
.display-preview.bolinhas .mini-buttons div { border-radius: 999px; }
.display-preview.premium .mini-buttons div { background: rgba(255,255,255,.08); border-color: rgba(214,168,60,.55); }
.mini-buttons b { font-size: 28px; line-height: 1; }
.mini-buttons span { font-size: 20px; font-weight: 950; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  max-width: min(420px, calc(100vw - 36px));
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: .18s ease;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1260px) {
  .command-center { grid-template-columns: 1fr; position: static; }
  .system-card { justify-self: stretch; }
  .topbar { grid-template-columns: 1fr; align-items: start; }
  .top-actions { justify-content: flex-start; }
  .metrics-grid, .insight-grid, .finance-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-metrics { grid-template-columns: repeat(3, minmax(190px, 1fr)); }
  .span-8, .span-4 { grid-column: span 12; }
}

@media (max-width: 760px) {
  .app-frame { width: min(100vw - 16px, 100%); padding: 8px 0 20px; }
  .command-center, .topbar, .filterbar, .finance-hero, .card { border-radius: 18px; }
  .command-nav { grid-template-columns: 1fr; }
  .top-actions, .finance-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .top-actions .live-pill { grid-column: 1 / -1; justify-content: center; }
  .metrics-grid, .dash-metrics, .details-metrics, .insight-grid, .finance-board, .form-grid, .two-cols, .detail-two-cols, .info-list, .mini-buttons {
    grid-template-columns: 1fr;
  }
  .payment-main { grid-template-columns: 1fr; }
  .layout { display: block; }
  .layout > * { margin-bottom: 12px; }
  .filterbar label { width: 100%; }
  .filterbar input { min-width: 0; }
  .finance-hero { flex-direction: column; align-items: stretch; }
  .table-wrap.fixed { max-height: none; }
  .status-row { grid-template-columns: 1fr; }
  .camera-thumb { width: 100%; }
  table { min-width: 0; }
  dialog { width: calc(100vw - 12px); max-height: 96dvh; border-radius: 18px; }
  #dialogContent, #paymentContent, #machineForm { max-height: calc(96dvh - 78px); padding: 12px; }
  .detail-tabs { top: -12px; }
  .camera-frame { min-height: 260px; }
  button, .primary, .ghost, .danger-btn { width: 100%; }
  .modal-head .ghost { width: auto; }
}
