:root {
  /* 01 / Black Edition Palette · Coffee Run Shop */
  --primary: #C5A059;          /* Rich Metallic Champagne Gold */
  --primary-dark: #9F7E3B;
  --primary-light: rgba(197, 160, 89, 0.15);
  --secondary: #388E3C;
  --secondary-light: rgba(56, 142, 60, 0.15);
  --gold: #D4AF37;
  --gold-light: rgba(212, 175, 55, 0.15);
  --dark-bg: #0A0B0E;         /* Deep Carbon Black */
  --dark-surface: #14161C;     /* Elegant Dark Charcoal */
  --body-bg: #0D0E12;
  --surface: #171922;          /* Slate Card Surface */
  --card-bg: #1B1E28;
  --card-hover: #222634;
  --text-main: #F4F5F8;        /* Crisp White Text */
  --text-muted: #959AA8;       /* Subtle Cool Gray */
  --border: #262936;           /* Subtle Charcoal Border */
  --border-focus: #C5A059;
  --bts-accent: #9A7BDE;       /* BTS Subtle Purple Glow */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.6);
  --app-max-width: 480px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #07080A;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

/* App Viewport Container */
#app-container {
  width: 100%;
  max-width: var(--app-max-width);
  height: 100vh;
  max-height: 940px;
  background-color: var(--body-bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

@media (max-width: 480px) {
  body {
    background-color: var(--body-bg);
  }
  #app-container {
    height: 100vh;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (min-width: 481px) {
  #app-container {
    border-radius: 36px;
    border: 3px solid #242734;
  }
}

/* Top App Bar */
.top-bar {
  background: linear-gradient(135deg, #101217 0%, #181A22 100%);
  color: #FFFFFF;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid rgba(197, 160, 89, 0.4);
  z-index: 100;
  flex-shrink: 0;
}

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

.btn-back {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #FFF;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-back:hover {
  background: var(--primary);
  color: #0A0B0E;
}

.brand-logo-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
  background: #141416;
}

.brand-title-group h1 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-title-group h1 span {
  color: var(--primary);
}

.brand-subtitle {
  font-size: 9.5px;
  color: var(--primary);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-weight: 700;
}

/* Header Status Badge */
.header-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(197, 160, 89, 0.12);
  border: 1px solid rgba(197, 160, 89, 0.35);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: #E6CE9F;
}

.status-dot {
  width: 7px;
  height: 7px;
  background-color: #4CAF50;
  border-radius: 50%;
  box-shadow: 0 0 6px #4CAF50;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Screen Content Area */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 85px 16px;
  position: relative;
  scroll-behavior: smooth;
}

.screen {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Screen Header */
.screen-header {
  margin-bottom: 16px;
}

.screen-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary);
  background: rgba(197, 160, 89, 0.12);
  border: 1px solid rgba(197, 160, 89, 0.25);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.screen-title {
  font-size: 22px;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.2;
}

.screen-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Card Styles */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 14px;
}

.card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-input, .form-select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: #FFFFFF;
  background-color: #111319;
  transition: all 0.2s;
  font-family: inherit;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.2);
}

.form-input::placeholder {
  color: #636979;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #D4AF37 0%, #A88330 100%);
  color: #0A0B0E;
  box-shadow: 0 4px 12px rgba(197, 160, 89, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #E2BE4A 0%, #B8923A 100%);
  box-shadow: 0 6px 16px rgba(197, 160, 89, 0.4);
}

.btn-dark {
  background: #101217;
  border: 1px solid var(--border);
  color: #FFFFFF;
}

.btn-dark:hover {
  background: #181B24;
  border-color: var(--primary);
}

.btn-secondary {
  background: #1B1E28;
  color: var(--text-main);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  background: #242836;
  border-color: rgba(255,255,255,0.2);
}

.btn-green {
  background: #2E7D32;
  color: #FFF;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  width: auto;
}

/* Chips / Filter Pills */
.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  padding: 6px 14px;
  background: #14161E;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
}

.chip:hover {
  color: #FFF;
  border-color: rgba(197, 160, 89, 0.4);
}

.chip.active {
  background: var(--primary);
  color: #0A0B0E;
  font-weight: 700;
  border-color: var(--primary);
}

/* Scanner Frame */
.scanner-viewport {
  width: 100%;
  height: 280px;
  background: #000000;
  border-radius: var(--radius-md);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #FFF;
  margin-bottom: 16px;
  border: 2px solid #2A2D3A;
}

.scanner-reticle {
  width: 180px;
  height: 180px;
  border: 2px solid rgba(197, 160, 89, 0.4);
  border-radius: 16px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scanner-laser {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  box-shadow: 0 0 10px #D4AF37;
  animation: scanAnim 2.5s infinite linear;
}

@keyframes scanAnim {
  0% { top: 0; }
  50% { top: 178px; }
  100% { top: 0; }
}

.scanner-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--primary);
  border-style: solid;
}
.c-tl { top: -2px; left: -2px; border-width: 3px 0 0 3px; }
.c-tr { top: -2px; right: -2px; border-width: 3px 3px 0 0; }
.c-bl { bottom: -2px; left: -2px; border-width: 0 0 3px 3px; }
.c-br { bottom: -2px; right: -2px; border-width: 0 3px 3px 0; }

/* Saldo Badge & Hero */
.saldo-hero {
  background: linear-gradient(135deg, #101217 0%, #1A1D27 100%);
  color: #FFF;
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
  border-top: 4px solid var(--primary);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.saldo-hero::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(197, 160, 89, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.saldo-hero .client-name {
  font-size: 18px;
  font-weight: 800;
  color: #FFF;
}

.saldo-hero .saldo-amount {
  font-size: 38px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.1;
  margin: 8px 0;
  text-shadow: 0 2px 10px rgba(197, 160, 89, 0.2);
}

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

/* Quick Action Tiles Grid */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.action-tile {
  background: #171922;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.action-tile:hover {
  border-color: var(--primary);
  background: #20232E;
  transform: translateY(-2px);
}

.action-tile-icon {
  font-size: 22px;
}

.action-tile-label {
  font-size: 12px;
  font-weight: 700;
  color: #FFFFFF;
}

/* Quick Amount Selector in Abonos */
.amount-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.amount-chip-btn {
  background: #14161E;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 4px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.amount-chip-btn:hover {
  border-color: var(--primary);
  background: #1E212D;
}

.amount-chip-btn.active {
  background: var(--primary);
  color: #0A0B0E;
  border-color: var(--primary);
}

/* Rewards Grid in Canjes */
.rewards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.reward-card-btn {
  background: #171922;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 125px;
}

.reward-card-btn:hover {
  border-color: var(--primary);
  background: #202430;
}

.reward-card-btn.selected {
  border-color: var(--primary);
  background: rgba(197, 160, 89, 0.12);
  box-shadow: 0 0 0 1px var(--primary);
}

.reward-icon-box {
  font-size: 32px;
  margin-bottom: 6px;
}

.reward-name {
  font-size: 12px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 6px;
  line-height: 1.2;
}

.reward-pts-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  background: rgba(197, 160, 89, 0.15);
  padding: 3px 8px;
  border-radius: 12px;
}

/* Signature Canvas Area */
.signature-box {
  width: 100%;
  height: 140px;
  background: #0E1015;
  border: 1.5px dashed #343848;
  border-radius: var(--radius-sm);
  position: relative;
  margin-bottom: 10px;
  touch-action: none;
}

.signature-box canvas {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm);
  cursor: crosshair;
}

.signature-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  color: #555B6E;
  pointer-events: none;
  font-style: italic;
}

/* Tables / Histories */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table-custom {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.table-custom th {
  background: #111319;
  color: var(--text-muted);
  font-weight: 700;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1.5px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.table-custom td {
  padding: 10px;
  border-bottom: 1px solid #1E212B;
  color: var(--text-main);
}

.badge-pts-plus {
  color: #81C784;
  font-weight: 800;
}

.badge-pts-minus {
  color: #FF8A80;
  font-weight: 800;
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #101217;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: #6C7282;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 10px;
  transition: all 0.15s;
  font-family: inherit;
}

.nav-tab .tab-icon {
  font-size: 19px;
}

.nav-tab:hover {
  color: #FFFFFF;
}

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

/* Modals */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 16px;
  animation: fadeIn 0.2s;
}

.modal-content {
  background: #171922;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

/* Google Wallet Pass Visual Replica (01 / Black Edition) */
.wallet-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 16px;
  animation: fadeIn 0.2s;
}

.wallet-card-modal {
  width: 100%;
  max-width: 380px;
  max-height: 95vh;
  overflow-y: auto;
}

.wallet-pass-card {
  background: #141416;
  border-radius: 20px;
  border: 1px solid #2B2E3C;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0,0,0,0.8);
  color: #FFF;
}

.pass-top-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.pass-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--primary);
  background: #000;
  object-fit: cover;
}

.pass-issuer {
  font-size: 11px;
  font-weight: 600;
  color: #BBB;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pass-program {
  font-size: 14px;
  font-weight: 800;
  color: #FFF;
}

.pass-hero-img-wrap {
  width: 100%;
  height: 190px;
  position: relative;
  overflow: hidden;
  background: #000;
}

.pass-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pass-hero-overlay-tag {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #FFF;
  letter-spacing: 0.4px;
}

.pass-balance-section {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.pass-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary);
  font-weight: 800;
}

.pass-points {
  font-size: 24px;
  font-weight: 900;
  color: #FFF;
}

.pass-equiv {
  font-size: 16px;
  font-weight: 800;
  color: #81C784;
}

.pass-details-row {
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.pass-val {
  font-size: 13px;
  font-weight: 700;
  color: #FFF;
  margin-top: 2px;
}

.pass-barcode-box {
  background: #FFFFFF;
  padding: 14px;
  border-radius: 12px;
  text-align: center;
  margin: 14px;
}

/* Empty state styling */
.empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 42px;
  margin-bottom: 10px;
  display: block;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 6px;
}

.empty-state-desc {
  font-size: 13px;
  max-width: 260px;
  margin: 0 auto 16px auto;
  line-height: 1.4;
}
