/* =====================================================
   STARTEC VANTAGENS - CSS Principal
   Mobile First | Design APP
   ===================================================== */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---- CSS Variables ---- */
:root {
  --primary: #0D5FB8;
  --primary-dark: #0a4d99;
  --primary-light: #1a74d4;
  --primary-ultra-light: #e8f1fb;
  --secondary: #FF6B2B;
  --secondary-light: #FF8C55;
  --success: #22c55e;
  --success-light: #dcfce7;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #06b6d4;
  --dark: #0f172a;
  --gray-900: #1e293b;
  --gray-800: #334155;
  --gray-700: #475569;
  --gray-600: #64748b;
  --gray-500: #94a3b8;
  --gray-400: #cbd5e1;
  --gray-300: #e2e8f0;
  --gray-200: #f1f5f9;
  --gray-100: #f8fafc;
  --white: #ffffff;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --header-height: 60px;
  --bottom-nav-height: 64px;
  --transition: all .2s ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }

/* ---- App Shell ---- */
.app-wrapper {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--white);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px rgba(0,0,0,.08);
}

/* ---- Header APP ---- */
.app-header {
  background: var(--primary);
  color: var(--white);
  padding: 0 16px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(13,95,184,.3);
}

.app-header .header-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.3px;
}

.app-header .header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-header .header-logo img {
  height: 32px;
  width: auto;
}

.header-logo-text {
  font-size: 16px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -.5px;
}

.header-logo-sub {
  font-size: 9px;
  font-weight: 400;
  opacity: .8;
  display: block;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.app-header .header-action {
  color: var(--white);
  opacity: .9;
  font-size: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-header .btn-back {
  color: var(--white);
  font-size: 24px;
  display: flex;
  align-items: center;
}

/* ---- Page Content ---- */
.page-content {
  flex: 1;
  padding: 16px;
  padding-bottom: calc(var(--bottom-nav-height) + 16px);
  overflow-y: auto;
}

.page-content.no-bottom-nav {
  padding-bottom: 16px;
}

/* ---- Bottom Navigation ---- */
.bottom-nav {
  background: var(--white);
  border-top: 1px solid var(--gray-300);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: var(--bottom-nav-height);
  position: sticky;
  bottom: 0;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,.06);
}

.bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 500;
  color: var(--gray-500);
  transition: var(--transition);
  position: relative;
  padding: 8px 4px;
}

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

.bottom-nav .nav-icon {
  font-size: 22px;
  color: var(--gray-500);
  transition: var(--transition);
}

.bottom-nav .nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 4px 4px;
}

/* ---- Hero Banner (cliente) ---- */
.hero-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 60%, #1e88e5 100%);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  color: var(--white);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.hero-banner::before {
  content: '';
  position: absolute;
  right: -20px;
  top: -20px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}

.hero-banner::after {
  content: '';
  position: absolute;
  right: 30px;
  bottom: -30px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}

.hero-greeting {
  font-size: 14px;
  font-weight: 400;
  opacity: .85;
  margin-bottom: 4px;
}

.hero-name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -.3px;
}

.hero-points-label {
  font-size: 12px;
  font-weight: 500;
  opacity: .8;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
}

.hero-points-value {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -2px;
}

.hero-points-unit {
  font-size: 16px;
  font-weight: 500;
  opacity: .8;
  margin-left: 4px;
}

/* ---- Cards ---- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.card-header {
  padding: 16px 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
}

.card-body { padding: 16px; }

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.stat-icon.bg-primary-soft { background: var(--primary-ultra-light); color: var(--primary); }
.stat-icon.bg-success-soft { background: var(--success-light); color: var(--success); }
.stat-icon.bg-warning-soft { background: var(--warning-light); color: var(--warning); }
.stat-icon.bg-danger-soft { background: var(--danger-light); color: var(--danger); }
.stat-icon.bg-info-soft { background: rgba(6,182,212,.1); color: var(--info); }
.stat-icon.bg-secondary-soft { background: rgba(255,107,43,.1); color: var(--secondary); }

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
}

/* Quick Action Buttons */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  text-align: center;
  cursor: pointer;
  text-decoration: none;
}

.quick-action-btn:hover, .quick-action-btn:active {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: var(--primary);
  border-color: var(--primary-ultra-light);
  background: var(--primary-ultra-light);
}

.quick-action-btn .action-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--primary-ultra-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }

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

.form-control {
  display: block;
  width: 100%;
  padding: 13px 16px;
  font-size: 15px;
  font-family: var(--font);
  line-height: 1.5;
  color: var(--gray-800);
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  transition: var(--transition);
  outline: none;
  -webkit-appearance: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,95,184,.12);
}

.form-control.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}

.form-control::placeholder { color: var(--gray-400); }

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap .form-control {
  padding-left: 46px;
}

.input-icon-wrap .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
  font-size: 20px;
  pointer-events: none;
}

.input-icon-wrap .input-icon-right {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
  font-size: 20px;
  cursor: pointer;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  border-radius: var(--radius);
  transition: var(--transition);
  cursor: pointer;
  border: 1.5px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(13,95,184,.25);
}

.btn-primary:hover, .btn-primary:active {
  background: var(--primary-dark);
  box-shadow: 0 6px 16px rgba(13,95,184,.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(255,107,43,.25);
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

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

.btn-light {
  background: var(--gray-100);
  color: var(--gray-700);
  border-color: var(--gray-300);
}

.btn-success {
  background: var(--success);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(34,197,94,.25);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-warning {
  background: var(--warning);
  color: var(--white);
}

.btn-full { width: 100%; }

.btn-lg {
  padding: 16px 24px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none !important;
}

/* ---- Login Page ---- */
.login-page {
  min-height: 100vh;
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-light) 50%, #1565C0 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 32px 24px 40px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 -8px 40px rgba(0,0,0,.15);
}

.login-hero {
  text-align: center;
  padding: 60px 24px 40px;
  color: var(--white);
  width: 100%;
  max-width: 480px;
}

.login-logo-wrap {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,.15);
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 40px;
  backdrop-filter: blur(8px);
}

.login-system-name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 6px;
}

.login-system-sub {
  font-size: 13px;
  opacity: .8;
  font-weight: 400;
}

.login-tabs {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}

.login-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  transition: var(--transition);
}

.login-tab.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 24px;
}

/* ---- Alerts/Flash ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-success { background: var(--success-light); color: #15803d; border-left: 4px solid var(--success); }
.alert-danger { background: var(--danger-light); color: #b91c1c; border-left: 4px solid var(--danger); }
.alert-warning { background: var(--warning-light); color: #92400e; border-left: 4px solid var(--warning); }
.alert-info { background: rgba(6,182,212,.1); color: #0e7490; border-left: 4px solid var(--info); }

/* ---- List Items ---- */
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--white);
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}

.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--gray-100); }

.list-item .item-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.list-item .item-content { flex: 1; min-width: 0; }
.list-item .item-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item .item-subtitle {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
}

.list-item .item-value {
  font-size: 15px;
  font-weight: 700;
  text-align: right;
}

.list-item .item-value.credit { color: var(--success); }
.list-item .item-value.debit { color: var(--danger); }

/* ---- Badge ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-primary { background: var(--primary-ultra-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: #15803d; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-danger { background: var(--danger-light); color: #b91c1c; }
.badge-gray { background: var(--gray-200); color: var(--gray-700); }

/* ---- Product Card ---- */
.produto-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.produto-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ==============================
   CATÁLOGO DE PRÊMIOS (cliente)
   ============================== */
.premios-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

@media (min-width: 480px) {
  .premios-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .premios-grid { grid-template-columns: repeat(3, 1fr); }
}

.premio-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.premio-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,.10);
}
.premio-card.premio-bloqueado {
  opacity: .85;
}

/* Wrapper quadrado 1:1 */
.premio-img-wrap {
  position: relative;
  width: 100%;
  padding-top: 100%; /* ratio 1:1 = 1080×1080 */
  background: var(--primary-ultra-light);
  overflow: hidden;
  flex-shrink: 0;
}

/* Imagem ocupa o quadrado inteiro */
.premio-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder sem imagem */
.premio-img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
}

/* Badge "Últimas X" */
.premio-badge-estoque {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #f59e0b;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
}

.premio-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.premio-nome {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.premio-desc {
  font-size: 11px;
  color: var(--gray-500);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.premio-pontos {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 10px;
  margin-top: auto;
}
.premio-pontos span { font-size: 12px; font-weight: 500; color: var(--gray-500); }

/* Manter compat com páginas que ainda usam .produto-* */
.produto-img { width:100%; height:140px; object-fit:cover; background:var(--primary-ultra-light); display:flex; align-items:center; justify-content:center; font-size:48px; color:var(--primary); }
.produto-img.no-img { display:flex; }
.produto-info { padding:12px; }
.produto-nome { font-size:14px; font-weight:700; color:var(--dark); margin-bottom:4px; }
.produto-pontos { font-size:18px; font-weight:800; color:var(--primary); margin-bottom:8px; }
.produto-pontos span { font-size:13px; font-weight:500; color:var(--gray-500); }

/* ---- QR Code Container ---- */
.qrcode-container {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 24px;
  text-align: center;
  border: 2px solid var(--primary-ultra-light);
}

.qrcode-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}

.qrcode-subtitle {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 20px;
}

#qrcode img { margin: 0 auto; }

/* ---- Admin Sidebar (tablet+) ---- */
/* ==============================
   ADMIN LAYOUT
   ============================== */
.admin-layout {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  max-width: 100%;
}

/* Sidebar visivel so no desktop */
.sidebar-desktop {
  display: none;
}

/* Botao hamburger */
.hamburger-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
}

@media (min-width: 768px) {
  .sidebar-desktop {
    display: flex !important;
    width: 240px;
    min-width: 240px;
    min-height: 100vh;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    flex-direction: column;
    flex-shrink: 0;
  }

  .hamburger-btn          { display: none !important; }
  .mobile-drawer          { display: none !important; }
  .mobile-drawer-overlay  { display: none !important; }

  .admin-main {
    flex: 1;
    overflow: hidden;
  }

  .bottom-nav { display: none; }
}

@media (max-width: 767px) {
  .sidebar-desktop { display: none !important; }
}

/* ---- Admin Sidebar styles ---- */
.admin-sidebar {
  background: var(--gray-900);
  color: var(--white);
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.3px;
}

.sidebar-logo-sub {
  font-size: 10px;
  opacity: .5;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.sidebar-nav { padding: 12px 0; flex: 1; }

.sidebar-section-title {
  padding: 8px 20px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: rgba(255,255,255,.3);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  transition: var(--transition);
  text-decoration: none;
  border-radius: 0;
  position: relative;
}

.sidebar-link:hover {
  background: rgba(255,255,255,.06);
  color: var(--white);
}

.sidebar-link.active {
  background: rgba(13,95,184,.3);
  color: var(--white);
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary-light);
  border-radius: 0 2px 2px 0;
}

.sidebar-link .link-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 13px;
  color: rgba(255,255,255,.4);
}

/* ---- Admin Header (mobile) ---- */
.admin-header {
  background: var(--primary);
  color: var(--white);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 200;
}

/* ---- Mobile drawer ---- */
.mobile-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 300;
}

.mobile-drawer {
  position: fixed;
  left: -280px;
  top: 0;
  bottom: 0;
  width: 280px;
  background: var(--gray-900);
  z-index: 301;
  transition: left .3s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.mobile-drawer.open { left: 0; }
.mobile-drawer-overlay.show { display: block; }

/* ---- Table ---- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}

table th {
  background: var(--gray-100);
  padding: 12px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
}

table td {
  padding: 12px 14px;
  font-size: 14px;
  color: var(--gray-800);
  border-top: 1px solid var(--gray-200);
  vertical-align: middle;
}

table tr:hover td { background: var(--gray-100); }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  padding: 0;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.modal-sheet {
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .3s ease;
  padding: 20px 20px 40px;
}

.modal-overlay.show .modal-sheet {
  transform: translateY(0);
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--gray-300);
  border-radius: 2px;
  margin: 0 auto 20px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}

.modal-subtitle {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 20px;
}

/* ---- Divider ---- */
.divider {
  height: 1px;
  background: var(--gray-200);
  margin: 16px 0;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: 13px;
  color: var(--gray-500);
}

.divider-text::before, .divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-300);
}

/* ---- Spinner ---- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-500);
}

.empty-state .empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: .4;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  line-height: 1.5;
}

/* ---- Utilities ---- */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-gray { color: var(--gray-500) !important; }
.text-muted { color: var(--gray-500) !important; }
.text-dark { color: var(--dark) !important; }

.fw-bold { font-weight: 700 !important; }
.fw-medium { font-weight: 500 !important; }
.fs-sm { font-size: 12px !important; }
.fs-base { font-size: 14px !important; }
.fs-md { font-size: 16px !important; }
.fs-lg { font-size: 18px !important; }

.d-flex { display: flex !important; }
.align-items-center { align-items: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.gap-2 { gap: 8px !important; }
.gap-3 { gap: 12px !important; }
.flex-1 { flex: 1 !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 12px !important; }
.mb-4 { margin-bottom: 16px !important; }
.mb-5 { margin-bottom: 24px !important; }
.mt-3 { margin-top: 12px !important; }
.mt-4 { margin-top: 16px !important; }
.mt-5 { margin-top: 24px !important; }

.p-0 { padding: 0 !important; }
.p-3 { padding: 12px !important; }
.p-4 { padding: 16px !important; }

.rounded { border-radius: var(--radius) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-full { border-radius: 50% !important; }

.w-100 { width: 100% !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title .see-all {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
}

/* ---- Notification dot ---- */
.notif-dot {
  width: 8px;
  height: 8px;
  background: var(--secondary);
  border-radius: 50%;
  position: absolute;
  top: 6px;
  right: 6px;
  border: 2px solid var(--white);
}

/* ---- Page transitions ---- */
.page-content {
  animation: fadeInUp .2s ease;
}

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

/* ---- Responsive ---- */
@media (min-width: 480px) {
  .login-page { align-items: center; }
  .login-card {
    border-radius: var(--radius-xl);
    margin: 20px;
    width: auto;
    min-width: 380px;
  }
}

@media (max-width: 360px) {
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 2px; }

/* ---- Print ---- */
@media print {
  .bottom-nav, .app-header, .admin-sidebar, .admin-header { display: none; }
  .page-content { padding: 0; }
}

/* ---- Toggle Switch ---- */
.toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-200);
}
.toggle-wrap:last-child { border-bottom: none; }

.toggle-label { font-size: 14px; font-weight: 500; color: var(--gray-700); }
.toggle-sub { font-size: 12px; color: var(--gray-500); }

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--gray-300);
  border-radius: 12px;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ---- Loading overlay ---- */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  flex-direction: column;
  gap: 16px;
}

.loading-spinner-lg {
  width: 48px;
  height: 48px;
  border: 4px solid var(--primary-ultra-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ---- Avatar ---- */
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-ultra-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: 13px; }
.avatar-lg { width: 64px; height: 64px; font-size: 24px; }
.avatar-xl { width: 80px; height: 80px; font-size: 32px; }

/* ---- Progress bar ---- */
.progress {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 4px;
  transition: width .5s ease;
}

/* ---- Scan area ---- */
.scan-area {
  background: var(--dark);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin-bottom: 16px;
}

.scan-preview {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

/* ---- Number input large ---- */
.input-money {
  font-size: 32px !important;
  font-weight: 800 !important;
  text-align: center !important;
  letter-spacing: -1px !important;
  color: var(--dark) !important;
  border: none !important;
  border-bottom: 2px solid var(--gray-300) !important;
  border-radius: 0 !important;
  padding: 8px 0 !important;
  width: 100% !important;
  box-shadow: none !important;
}

.input-money:focus {
  border-bottom-color: var(--primary) !important;
  box-shadow: none !important;
}
