:root {
  --bg-dark: #07090e;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(24, 33, 53, 0.85);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.6);
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --accent: #8b5cf6;
  --accent-cyan: #06b6d4;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --terminal-bg: #030712;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 24px;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(139, 92, 246, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
  background-attachment: fixed;
}

.app-container {
  width: 100%;
  max-width: 1300px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* TOPBAR */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 16px 24px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 0 20px var(--primary-glow);
}

.logo-text h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-text h1 span {
  color: var(--accent-cyan);
}

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

.status-badges {
  display: flex;
  gap: 12px;
}

.badge-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  transition: all 0.2s ease;
}

.badge-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.4);
}

.badge-mode {
  background: rgba(251, 191, 36, 0.08);
}

.badge-mode:hover {
  background: rgba(251, 191, 36, 0.15);
}

.badge-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.badge-item .val {
  font-weight: 700;
  color: #fff;
}

/* MAIN LAYOUT */
.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .main-content {
    grid-template-columns: 1fr;
  }
}

.panel-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.4);
}

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

.panel-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 6px;
}

.tag-accent {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* FORMS */
.form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
}

input[type="text"], input[type="number"], input[type="url"] {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 12px 16px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.credits-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.credits-input-row input {
  font-size: 18px;
  font-weight: 700;
  width: 140px;
}

.credits-input-row .unit {
  font-weight: 600;
  color: var(--accent-cyan);
}

.calculation-hint {
  font-size: 12px;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.1);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px dashed rgba(99, 102, 241, 0.3);
}

.input-with-badge {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-badge input {
  width: 100%;
  padding-right: 110px;
}

.code-badge {
  position: absolute;
  right: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
}

.cost-summary-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.summary-line.highlight {
  color: #34d399;
  font-weight: 700;
  font-size: 14px;
  border-top: 1px solid var(--border-card);
  padding-top: 8px;
  margin-top: 4px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4338ca, #6d28d9);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.6);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-text:hover {
  text-decoration: underline;
}

/* CREDIT CARD PREVIEW */
.credit-card-visual {
  background: linear-gradient(135deg, #1e1b4b 0%, #31104b 50%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 200px;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

.credit-card-visual::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.card-chip {
  width: 42px;
  height: 32px;
  background: linear-gradient(135deg, #fbbf24, #d97706);
  border-radius: 6px;
}

.card-type-icon {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.6);
}

.card-number-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.card-info-row {
  display: flex;
  gap: 30px;
}

.card-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.card-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.address-preview {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 14px;
}

.addr-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.addr-line {
  font-size: 13px;
  color: #e2e8f0;
}

/* DATA TABLE */
.title-with-count {
  display: flex;
  align-items: center;
  gap: 12px;
}

.counter {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 12px 14px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-card);
  font-weight: 600;
}

.data-table td {
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.status-checkout_pronto {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pago {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.status-comprada {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.status-erro {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.btn-action-pay {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
}

.btn-action-pay:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.5);
}

.actions-cell {
  display: flex;
  gap: 8px;
}

/* TERMINAL */
.terminal-panel {
  padding: 18px 24px;
}

.terminal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.dot-red, .dot-yellow, .dot-green {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red { background-color: #ef4444; }
.dot-yellow { background-color: #f59e0b; }
.dot-green { background-color: #10b981; }

.terminal-body {
  background: var(--terminal-bg);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 16px;
  height: 220px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #a5b4fc;
}

.log-entry.system {
  color: #38bdf8;
}

/* MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 999;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #0f172a;
  border: 1px solid var(--border-card);
  border-radius: 18px;
  width: 100%;
  max-width: 600px;
  padding: 24px;
}

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

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.form-row {
  display: flex;
  gap: 14px;
}

.col-3 { flex: 3; }
.col-4 { flex: 4; }
.col-6 { flex: 6; }
.col-8 { flex: 8; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

/* TABS DE FILTRO & PAGINAÇÃO */
.filter-tabs-bar {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 12px;
}

.btn-filter-pill {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-filter-pill:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-filter-pill.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: #6366f1;
  color: #a5b4fc;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}

.search-input-pill {
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 8px !important;
  padding: 6px 14px !important;
  color: #f8fafc !important;
  font-size: 12px !important;
  outline: none !important;
  transition: all 0.2s ease !important;
}

.search-input-pill:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3) !important;
}

.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: #94a3b8;
  flex-wrap: wrap;
  gap: 10px;
}

/* SWITCH TOGGLE & SLIDER */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  min-width: 44px;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: all 0.25s ease;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: #f8fafc;
  transition: all 0.25s ease;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.switch-toggle input:checked + .slider-round {
  background-color: #6366f1;
  border-color: #818cf8;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.switch-toggle input:checked + .slider-round:before {
  transform: translateX(20px);
}

/* COUPON ITEMS */
.coupon-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease;
}

.coupon-item-row:last-child {
  border-bottom: none;
}

.coupon-item-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.badge-coupon-free {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-coupon-five {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}


