:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.12);
  --primary-glow: rgba(99, 102, 241, 0.3);
  
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.12);
  --success-glow: rgba(16, 185, 129, 0.3);
  
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.12);
  
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.12);
  
  --bg-dark: #070a13;
  --bg-card: #0f172a;
  --bg-sidebar: #0a0f1d;
  --bg-input: #1e293b;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  
  --sidebar-w: 280px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  
  --glass: rgba(15, 23, 42, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
}


* {
  margin: 0;
  padding: 0;
  box-sizing: border-box
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-dark);
  color: var(--text-main);
  overflow-x: hidden
}

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0a0e1a 0%, #1a1040 50%, #0a0e1a 100%)
}

/* Responsive Login */
@media (max-width: 480px) {
  .login-container {
    padding: 1rem;
  }
  
  .login-card {
    padding: 1.5rem;
  }
  
  .login-logo h1 {
    font-size: 1.5rem;
  }
}

.login-bg-effects {
  position: absolute;
  inset: 0;
  pointer-events: none
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .4;
  animation: orbFloat 8s ease-in-out infinite
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: #6366f1;
  top: -100px;
  left: -100px
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: #8b5cf6;
  bottom: -50px;
  right: -50px;
  animation-delay: 3s
}

.orb-3 {
  width: 200px;
  height: 200px;
  background: #10b981;
  top: 50%;
  left: 60%;
  animation-delay: 5s
}

@keyframes orbFloat {

  0%,
  100% {
    transform: translateY(0) scale(1)
  }

  50% {
    transform: translateY(-30px) scale(1.1)
  }
}

.login-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  padding: 1.5rem
}

.login-card {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, .5)
}

.login-header {
  text-align: center;
  margin-bottom: 2rem
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem
}

.login-logo h1 {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent
}

.login-tagline {
  color: var(--text-muted);
  font-size: .85rem;
  margin-top: .25rem
}

.logo-icon {
  flex-shrink: 0
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem
}

.login-input-group label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .05em
}

.login-input-wrapper {
  position: relative
}

.login-input-wrapper .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: .6
}

.login-input-wrapper input {
  width: 100%;
  padding: .85rem 1rem .85rem 2.8rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-main);
  font-size: .95rem;
  font-family: inherit;
  transition: all .3s
}

.login-input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .15)
}

.login-error {
  background: var(--danger-light);
  border: 1px solid rgba(239, 68, 68, .3);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  color: #fca5a5;
  font-size: .85rem;
  text-align: center
}

.login-btn {
  width: 100%;
  padding: .95rem;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .3s;
  font-family: inherit;
  margin-top: .5rem
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, .4)
}

.login-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
  margin-right: 6px
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

.login-footer {
  margin-top: 1.5rem;
  text-align: center
}

.login-footer p {
  font-size: .75rem;
  color: var(--text-dim);
  margin-bottom: .75rem
}

.credential-chips {
  display: flex;
  gap: .5rem;
  justify-content: center;
  flex-wrap: wrap
}

.credential-chip {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .75rem;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .75rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .2s
}

.credential-chip:hover {
  border-color: var(--primary);
  background: var(--primary-light)
}

.chip-role {
  padding: .15rem .5rem;
  border-radius: 4px;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase
}

.chip-role.agent {
  background: var(--primary-light);
  color: var(--primary)
}

.chip-role.sales {
  background: var(--success-light);
  color: var(--success)
}

/* ===== MOBILE HEADER ===== */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  padding: 0 1.25rem;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.menu-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 1.25rem;
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.menu-toggle:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

/* ===== APP LAYOUT ===== */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 1100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.4rem;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  transform: translateX(4px);
}

.nav-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.nav-icon {
  font-size: 1.2rem;
}

.sidebar-user {
  padding: 1.2rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
}

.user-avatar {
  width: 38px;
  height: 38px;
  background: var(--primary);
  color: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.terminal-id-wrap {
  margin-top: 4px;
}

.tiny-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
  display: block;
}

.scanner-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  width: 100%;
  margin-top: 2px;
}

.scanner-select:focus {
  outline: none;
  border-color: var(--primary);
}

.logout-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 10px;
  padding: 0.6rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--danger);
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 2.5rem;
  min-height: 100vh;
  background-image: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.03) 0px, transparent 50%), radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.03) 0px, transparent 50%);
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive Overrides */
@media (max-width: 1024px) {
  .mobile-header {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding-top: 80px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 640px) {
  .kpi-grid {
    grid-template-columns: 1fr !important;
  }

  .agent-content-grid, .history-layout, .card-scan-section {
    grid-template-columns: 1fr !important;
  }

  .premium-dashboard-header {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
    gap: 1.5rem;
  }
}

/* ===== ADDITIONAL RESPONSIVE GRIDS ===== */
.content-grid, .card-scan-section, .agent-content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Specific overrides for asymmetric grids */
.agent-content-grid, .marketplace-layout, .history-layout, .card-scan-section {
  display: grid;
  gap: 1.5rem;
}

.agent-content-grid, .marketplace-layout, .card-scan-section {
  grid-template-columns: 2fr 1fr;
}

.history-layout {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 1200px) {
  .agent-content-grid, .marketplace-layout {
    grid-template-columns: 1fr;
  }
}

/* ===== PREMIUM GLASS CARDS ===== */
.glass-card {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.glass-card:hover {
  border-color: var(--primary-glow);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.glass-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  letter-spacing: -0.01em;
}

/* ===== PROFESSIONAL TABLE MOBILE VIEW ===== */
@media (max-width: 768px) {
  .data-table thead {
    display: none;
  }

  .data-table, .data-table tbody, .data-table tr, .data-table td {
    display: block;
    width: 100%;
  }

  .data-table tr {
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 0.75rem;
  }

  .data-table td {
    text-align: right;
    padding: 0.5rem 0.25rem;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .data-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
  }
}

/* ===== STATUS BADGES REFINEMENT ===== */
.status-badge {
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.65rem;
  letter-spacing: 0.02em;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ===== TYPOGRAPHY & HEADERS ===== */
.section-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-subtitle {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* ===== SCROLLBARS ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.page-section {
  display: none;
  animation: fadeIn .4s cubic-bezier(0.4, 0, 0.2, 1);
  padding-bottom: 4rem;
}

/* ===== SHARED UI COMPONENTS ===== */
.info-box {
  padding: 1.25rem;
  border-radius: 16px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  margin-top: 1.5rem;
}

.info-box p {
  font-size: 0.85rem;
  color: var(--text-main);   
  margin: 0;
  line-height: 1.5;
}

.status-box {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 1.25rem;
  border: 1px solid var(--border);
  margin-top: 2rem;
}

.status-placeholder {
  color: var(--text-dim);
  font-size: 0.9rem;
  text-align: center;
  opacity: 0.7;
}

.amount-presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

/* Card Visual Fixes */
.card-visual.small {
  transform: scale(0.85);
  transform-origin: center;
}

.page-section.active-section {
  display: block
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.section-header {
  margin-bottom: 1.5rem
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: .25rem
}

.section-subtitle {
  font-size: .875rem;
  color: var(--text-muted)
}

/* ===== CARDS / GLASS ===== */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all .3s
}

.glass-card:hover {
  border-color: var(--border-hover)
}

.glass-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .5rem
}

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: .85rem;
  transition: all .3s;
  min-width: 0;
  container-type: inline-size;
  container-name: stat-card;
}

.stat-card>div:last-child {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(99, 102, 241, .12)
}

.stat-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0
}

.stat-icon-box.purple {
  background: var(--primary-light)
}

.stat-icon-box.green {
  background: var(--success-light)
}

.stat-icon-box.amber {
  background: var(--warning-light)
}

.stat-icon-box.red {
  background: var(--danger-light)
}

.stat-label {
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: .25rem
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  word-break: break-all;
}

/* Automatically scale down font for container */
@media (max-width: 1400px) {
  .stat-value {
    font-size: 1.3rem;
  }
}

@media (max-width: 1200px) {
  .stat-value {
    font-size: 1.1rem;
  }
}

/* Use CSS container queries for better responsiveness */
@container (max-width: 200px) {
  .stat-value {
    font-size: 1.2rem;
  }
}

@container (max-width: 150px) {
  .stat-value {
    font-size: 1rem;
  }
}

/* ===== TABLE ===== */
.data-table-container {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border)
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem
}

.data-table thead {
  background: rgba(255, 255, 255, .03)
}

.data-table th {
  padding: .75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border)
}

.data-table td {
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle
}

.data-table tbody tr {
  transition: background .2s
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, .03)
}

.data-table tbody tr:last-child td {
  border-bottom: none
}

.status-badge {
  padding: .2rem .6rem;
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase
}

.status-badge.active {
  background: var(--success-light);
  color: var(--success)
}

.status-badge.suspended {
  background: var(--warning-light);
  color: var(--warning)
}

.status-badge.blocked {
  background: var(--danger-light);
  color: var(--danger)
}

.table-actions {
  display: flex;
  gap: .4rem
}

.btn-icon-sm {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  transition: all .2s;
  color: var(--text-main)
}

.btn-icon-sm:hover {
  background: rgba(255, 255, 255, .08);
  border-color: var(--border-hover)
}

.btn-icon-sm.danger:hover {
  background: var(--danger-light);
  border-color: rgba(239, 68, 68, .3)
}

/* ===== FORMS ===== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem
}

.form-grid.col-1 {
  grid-template-columns: 1fr
}

@media(max-width:768px) {
  .form-grid {
    grid-template-columns: 1fr
  }
}

.input-group {
  margin-bottom: 1rem
}

.input-group label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .35rem;
  text-transform: uppercase;
  letter-spacing: .04em
}

input:not(.passcode-digit):not(.login-input-wrapper input),
select,
textarea {
  width: 100%;
  padding: .7rem .9rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-main);
  font-family: inherit;
  font-size: .9rem;
  transition: all .25s
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .12)
}

.input-readonly {
  opacity: .6;
  cursor: not-allowed
}

/* ===== BUTTONS ===== */
.btn-primary {
  padding: .7rem 1.5rem;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  font-family: inherit;
  transition: all .25s
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, .35)
}

.btn-primary:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none
}

.btn-secondary {
  padding: .7rem 1.5rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 500;
  font-size: .875rem;
  cursor: pointer;
  font-family: inherit;
  transition: all .25s
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, .05);
  border-color: var(--border-hover);
  color: var(--text-main)
}

.btn-success {
  padding: .7rem 1.5rem;
  background: linear-gradient(135deg, var(--success), #059669);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  font-family: inherit;
  transition: all .25s
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, .35)
}

.btn-success:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none
}

.btn-danger {
  padding: .7rem 1.5rem;
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  font-family: inherit;
  transition: all .25s
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, .35)
}

.btn-full {
  width: 100%
}

/* ===== QUICK AMOUNTS ===== */
.quick-amounts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .5rem;
  margin-bottom: 1rem
}

.quick-amount-btn {
  background: var(--primary-light);
  border: 1px solid transparent;
  color: var(--primary);
  padding: .5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit
}

.quick-amount-btn:hover,
.quick-amount-btn.active {
  background: var(--primary);
  color: #fff;
  transform: scale(1.03)
}

/* ===== CARD VISUAL ===== */
.card-visual-wrap {
  perspective: 1500px;
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem
}

.card-visual {
  width: 100%;
  max-width: 340px;
  height: 210px;
  background: linear-gradient(135deg, #0f0c29, #302b63 50%, #24243e);
  border-radius: 16px;
  padding: 1.5rem;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all .4s cubic-bezier(.175, .885, .32, 1.275);
  opacity: .6;
  filter: grayscale(.4);
  overflow: hidden
}

.card-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(235, 0, 27, .12) 0%, transparent 50%), radial-gradient(circle at 80% 50%, rgba(255, 95, 0, .12) 0%, transparent 50%);
  border-radius: 16px;
  z-index: 0
}

.card-visual::after {
  content: '';
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 38px;
  height: 38px;
  background: radial-gradient(circle at 30% 50%, #eb001b, #eb001b);
  border-radius: 50%;
  z-index: 1;
  box-shadow: 19px 0 0 rgba(255, 95, 0, .9)
}

.card-visual.active {
  opacity: 1;
  filter: none;
  box-shadow: 0 25px 60px rgba(99, 102, 241, .2)
}

.card-chip {
  width: 42px;
  height: 32px;
  background: linear-gradient(135deg, #ffd700, #d4af37);
  border-radius: 5px;
  position: relative;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3)
}

.card-number {
  font-family: 'Courier New', monospace;
  font-size: 1.2rem;
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .4);
  position: relative;
  z-index: 2
}

.card-details {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  position: relative;
  z-index: 2
}

.card-label {
  font-size: .55rem;
  color: rgba(255, 255, 255, .5);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 600;
  display: block;
  margin-bottom: .2rem
}

.card-value {
  font-size: .95rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .3)
}

/* ===== MARKETPLACE ===== */
.marketplace-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1280px) {
  .marketplace-layout {
    grid-template-columns: 1fr 300px;
  }
}

@media (max-width: 1024px) {
  .marketplace-layout {
    grid-template-columns: 1fr;
  }
  
  .marketplace-sidebar {
    position: sticky;
    bottom: 0;
    z-index: 100;
  }
}

.category-filter {
  display: flex;
  gap: .4rem;
  margin-bottom: 1rem;
  flex-wrap: wrap
}

.category-btn {
  padding: .4rem .85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit
}

.category-btn.active,
.category-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary)
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem
}

.product-card {
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all .25s;
  position: relative
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 6px 18px rgba(99, 102, 241, .15)
}

.product-card.in-cart {
  border-color: var(--success);
  background: rgba(16, 185, 129, .06)
}

.product-icon {
  font-size: 2rem;
  margin-bottom: .5rem;
  display: block
}

.product-name {
  font-size: .8rem;
  font-weight: 500;
  margin-bottom: .25rem;
  color: var(--text-main)
}

.product-price {
  font-size: .9rem;
  font-weight: 700;
  color: var(--primary)
}

.product-add-hint {
  font-size: .65rem;
  color: var(--text-dim);
  margin-top: .35rem
}

.product-qty-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  margin-top: .35rem
}

.product-qty-controls .qty-btn {
  width: 26px;
  height: 26px;
  font-size: .85rem
}

.product-qty-controls .cart-item-qty {
  font-weight: 700;
  font-size: .85rem;
  min-width: 20px;
  text-align: center;
  color: var(--success)
}

.product-badge {
  position: absolute;
  top: .5rem;
  right: .5rem;
  padding: .1rem .4rem;
  border-radius: 4px;
  font-size: .6rem;
  font-weight: 600
}

.product-badge.domain {
  background: rgba(99, 102, 241, .15);
  color: #818cf8
}

.product-badge.service {
  background: rgba(245, 158, 11, .15);
  color: #fbbf24
}

.product-badge.rwandan {
  background: rgba(16, 185, 129, .15);
  color: #34d399
}

/* ===== CART ===== */
.cart-items {
  max-height: 300px;
  overflow-y: auto
}

.cart-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-dim)
}

.cart-empty-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: .5rem;
  opacity: .5
}

.cart-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem;
  border-bottom: 1px solid var(--border);
  font-size: .8rem
}

.cart-item-icon {
  font-size: 1.3rem;
  flex-shrink: 0
}

.cart-item-info {
  flex: 1;
  min-width: 0
}

.cart-item-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.cart-item-price {
  font-size: .7rem;
  color: var(--text-dim)
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: .35rem
}

.qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s
}

.qty-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary)
}

.cart-item-qty {
  font-weight: 600;
  min-width: 18px;
  text-align: center;
  font-size: .8rem
}

.cart-item-total {
  font-weight: 600;
  font-size: .8rem;
  color: var(--primary);
  min-width: 50px;
  text-align: right
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: .8rem;
  padding: 2px;
  transition: color .2s
}

.cart-item-remove:hover {
  color: var(--danger)
}

.cart-summary {
  border-top: 1px solid var(--border);
  padding-top: .75rem;
  margin-top: .5rem
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .35rem
}

.cart-total-row {
  font-weight: 700;
  color: var(--text-main);
  font-size: 1rem;
  margin-top: .5rem;
  padding-top: .5rem;
  border-top: 1px solid var(--border)
}

.checkout-hint {
  font-size: .75rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: .5rem
}

.payment-status-msg {
  font-size: .8rem;
  padding: .6rem;
  border-radius: 8px;
  margin-top: .5rem;
  display: none;
  text-align: center;
  animation: fadeIn .3s
}

.payment-status-msg.show {
  display: block
}

.payment-status-msg.success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, .2)
}

.payment-status-msg.error {
  background: var(--danger-light);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, .2)
}

/* ===== CONTENT GRID ===== */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem
}

@media(max-width:1100px) {
  .content-grid {
    grid-template-columns: 1fr
  }
}

/* ===== TRANSACTION HISTORY ===== */
.history-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem
}

@media(max-width:1000px) {
  .history-layout {
    grid-template-columns: 1fr
  }
}

.history-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem
}

.history-count {
  font-size: .75rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, .05);
  padding: .25rem .6rem;
  border-radius: 6px
}

.transaction-items {
  max-height: 400px;
  overflow-y: auto
}

.transaction-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .65rem .5rem;
  border-bottom: 1px solid var(--border);
  transition: background .15s
}

.transaction-item:hover {
  background: rgba(255, 255, 255, .02)
}

.transaction-item:last-child {
  border-bottom: none
}

.transaction-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0
}

.transaction-item.topup .transaction-icon {
  background: var(--success-light);
  color: var(--success)
}

.transaction-item.debit .transaction-icon {
  background: var(--danger-light);
  color: var(--danger)
}

.transaction-details {
  flex: 1;
  min-width: 0
}

.transaction-desc {
  font-size: .8rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.transaction-time {
  font-size: .7rem;
  color: var(--text-dim)
}

.transaction-amount {
  text-align: right
}

.amount-value {
  font-weight: 600;
  font-size: .85rem
}

.amount-value.positive {
  color: var(--success)
}

.amount-value.negative {
  color: var(--danger)
}

.balance-after {
  font-size: .65rem;
  color: var(--text-dim)
}

.empty-history {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
  font-size: .85rem
}

/* ===== SETTINGS ===== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem
}

@media(max-width:1000px) {
  .settings-grid {
    grid-template-columns: 1fr
  }
}

.settings-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem
}

.settings-status-card {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .75rem;
  background: rgba(255, 255, 255, .02);
  border-radius: 10px;
  border: 1px solid var(--border)
}

.settings-status-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0
}

.settings-status-icon.online {
  background: var(--success);
  box-shadow: 0 0 8px var(--success)
}

.settings-status-icon.offline {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger)
}

.settings-status-name {
  font-size: .8rem;
  font-weight: 500
}

.settings-status-detail {
  font-size: .7rem;
  color: var(--text-dim)
}

.settings-info-list {
  display: flex;
  flex-direction: column
}

.settings-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border)
}

.settings-info-row:last-child {
  border-bottom: none
}

.settings-info-label {
  font-size: .8rem;
  color: var(--text-muted)
}

.settings-info-value {
  font-size: .8rem;
  font-weight: 500
}

.settings-info-value.mono {
  font-family: 'Courier New', monospace;
  font-size: .75rem;
  color: var(--primary)
}

.badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: .15rem .5rem;
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 600
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn .2s
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, .5);
  animation: slideUp .3s ease
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border)
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: .25rem;
  transition: color .2s
}

.modal-close:hover {
  color: var(--text-main)
}

.modal-body {
  padding: 1.5rem
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: .5rem
}

.modal-input-group {
  margin-bottom: 1rem
}

.modal-input-group label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .35rem;
  text-transform: uppercase;
  letter-spacing: .04em
}

/* ===== PASSCODE ===== */
.passcode-input-container {
  display: flex;
  gap: .5rem;
  justify-content: center;
  margin: 1.25rem 0
}

.passcode-digit {
  width: 48px !important;
  height: 56px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text-main);
  transition: all .2s
}

.passcode-digit:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .15)
}

.passcode-error {
  text-align: center;
  color: var(--danger);
  font-size: .8rem;
  padding: .5rem;
  background: var(--danger-light);
  border-radius: 8px
}

@keyframes shake {

  10%,
  90% {
    transform: translateX(-2px)
  }

  20%,
  80% {
    transform: translateX(3px)
  }

  30%,
  50%,
  70% {
    transform: translateX(-4px)
  }

  40%,
  60% {
    transform: translateX(4px)
  }
}

.setup-passcode-container {
  display: flex;
  gap: .4rem;
  margin: .75rem 0
}

.setup-passcode-digit {
  width: 40px !important;
  height: 48px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 10px;
  color: var(--text-main)
}

.setup-passcode-digit:focus {
  outline: none;
  border-color: var(--primary)
}

.passcode-setup-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--primary)
}

.passcode-setup-hint {
  font-size: .75rem;
  color: var(--text-dim);
  margin-top: .25rem
}

.setup-passcode-error {
  text-align: center;
  color: var(--danger);
  font-size: .78rem;
  margin-top: .35rem
}

/* ===== RECEIPT ===== */
.receipt-modal {
  max-width: 420px
}

.receipt-paper {
  background: #fff;
  color: #1a1a2e;
  border-radius: 12px;
  padding: 1.75rem;
  font-size: .85rem
}

.receipt-header {
  text-align: center;
  border-bottom: 2px dashed #e2e8f0;
  padding-bottom: 1rem;
  margin-bottom: 1rem
}

.receipt-header h2 {
  font-size: 1.1rem;
  color: #1a1a2e;
  margin-bottom: .2rem
}

.receipt-header p {
  font-size: .7rem;
  color: #64748b
}

.receipt-id {
  font-family: monospace;
  font-size: .75rem;
  color: #6366f1;
  font-weight: 600;
  margin-top: .5rem
}

.receipt-detail-row {
  display: flex;
  justify-content: space-between;
  padding: .35rem 0;
  border-bottom: 1px solid #f1f5f9
}

.receipt-detail-row span:first-child {
  color: #64748b;
  font-size: .78rem
}

.receipt-detail-row span:last-child {
  font-weight: 600;
  font-size: .82rem;
  color: #1a1a2e
}

.receipt-items {
  margin: 1rem 0;
  border-top: 1px dashed #e2e8f0;
  padding-top: .75rem
}

.receipt-items h4 {
  font-size: .78rem;
  color: #64748b;
  margin-bottom: .5rem;
  text-transform: uppercase
}

.receipt-item-row {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  padding: .25rem 0
}

.receipt-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 700;
  padding: .75rem 0;
  border-top: 2px solid #1a1a2e;
  margin-top: .5rem;
  color: #1a1a2e
}

.receipt-footer {
  text-align: center;
  border-top: 2px dashed #e2e8f0;
  padding-top: 1rem;
  margin-top: 1rem
}

.receipt-footer p {
  font-size: .7rem;
  color: #94a3b8;
  line-height: 1.5
}

/* ===== TOASTS ===== */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: .5rem
}

.toast {
  padding: .75rem 1.25rem;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .5rem;
  animation: slideInRight .3s ease;
  box-shadow: 0 8px 25px rgba(0, 0, 0, .3);
  max-width: 350px
}

.toast.success {
  background: #065f46;
  color: #a7f3d0;
  border: 1px solid rgba(16, 185, 129, .3)
}

.toast.error {
  background: #7f1d1d;
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, .3)
}

.toast.info {
  background: #1e3a5f;
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, .3)
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px)
  }

  to {
    opacity: 1;
    transform: translateX(0)
  }
}

/* ===== CARD DETAILS SECTION ===== */
.card-scan-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem
}

@media(max-width:1000px) {
  .card-scan-section {
    grid-template-columns: 1fr
  }
}

.data-row {
  display: flex;
  justify-content: space-between;
  padding: .55rem 0;
  border-bottom: 1px solid var(--border)
}

.data-row:last-child {
  border-bottom: none
}

.data-label {
  font-size: .8rem;
  color: var(--text-muted)
}

.data-value {
  font-size: .85rem;
  font-weight: 600
}

.status-placeholder {
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
  padding: 1.5rem
}

.status-warning {
  text-align: center;
  padding: 1.25rem;
  margin-top: .75rem;
  background: var(--danger-light);
  border: 1px solid rgba(239, 68, 68, .2);
  border-radius: 10px
}

.status-warning p {
  color: var(--text-muted);
  font-size: .8rem;
  margin-top: .4rem
}

.status-info {
  text-align: center;
  padding: 1.25rem;
  margin-top: .75rem;
  background: var(--warning-light);
  border: 1px solid rgba(245, 158, 11, .2);
  border-radius: 10px
}

.status-info p {
  color: var(--text-muted);
  font-size: .8rem;
  margin-top: .4rem
}

/* ===== SEARCH BAR ===== */
.search-bar {
  position: relative;
  margin-bottom: 1rem
}

.search-bar input {
  padding-left: 2.5rem !important
}

.search-bar .search-icon {
  position: absolute;
  left: .85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: .5
}

/* ===== INLINE PASSCODE ===== */
.checkout-passcode-section {
  margin: .75rem 0
}

.passcode-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: .5rem;
  display: block
}

.inline-passcode-container {
  display: flex;
  gap: .35rem
}

.inline-passcode-digit {
  width: 36px !important;
  height: 44px;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text-main)
}

.inline-passcode-digit:focus {
  outline: none;
  border-color: var(--primary)
}

.inline-passcode-error {
  color: var(--danger);
  font-size: .75rem;
  margin-top: .35rem
}

/* ===== NEW CARD PASSCODE ===== */
.new-card-passcode-section {
  margin: .75rem 0;
  padding: .75rem;
  background: rgba(99, 102, 241, .06);
  border: 1px solid rgba(99, 102, 241, .15);
  border-radius: 10px
}

/* ===== RESPONSIVE ===== */
@media(max-width:768px) {
  .sidebar {
    width: 0;
    transform: translateX(-100%);
    transition: transform .3s
  }

  .sidebar.open {
    width: var(--sidebar-w);
    transform: translateX(0)
  }

  .main-content {
    margin-left: 0;
    padding: 1rem
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr
  }

  .content-grid,
  .history-layout,
  .settings-grid,
  .marketplace-layout,
  .card-scan-section {
    grid-template-columns: 1fr
  }
}

/* ===== PRINT ===== */
@media print {
  @page {
    margin: 0;
    size: portrait;
  }

  /* 1. Global Hide */
  body * {
    visibility: hidden !important;
    display: none !important;
  }

  /* 2. Selective Show - ONLY show the receipt container and its content */
  body,
  #receipt-modal,
  .modal-overlay,
  .modal-content.receipt-modal,
  .modal-body,
  .receipt-paper,
  .receipt-paper * {
    visibility: visible !important;
    display: block !important;
  }

  /* 3. HARD Hide specific UI elements (Buttons and Cross) */
  .modal-header,
  .modal-footer,
  .modal-close,
  .btn-primary,
  .btn-secondary {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Layout and Styling */
  body {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #receipt-modal {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start !important;
    background: #fff !important;
    padding: 2cm 0 !important;
    z-index: 999999 !important;
  }

  .modal-content.receipt-modal {
    max-width: 85mm !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 auto !important;
    background: transparent !important;
  }

  .modal-body {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }

  /* PREMIUM RECEIPT STYLING (Restored) */
  .receipt-paper {
    width: 80mm !important;
    margin: 0 auto !important;
    padding: 30px !important;
    background: #fff !important;
    color: #1a1a2e !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    font-size: 10pt !important;
    position: relative !important;
    border: 1px solid #eee !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
  }

  .receipt-paid-badge {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    border: 3px double #10b981 !important;
    color: #10b981 !important;
    font-weight: 900 !important;
    font-size: 14pt !important;
    padding: 5px 12px !important;
    transform: rotate(15deg) !important;
    opacity: 0.8 !important;
    display: block !important;
  }

  .receipt-header {
    text-align: center !important;
    margin-bottom: 1.5rem !important;
    display: block !important;
  }

  .receipt-logo {
    display: block !important;
    margin: 0 auto 10px !important;
    text-align: center !important;
  }

  .receipt-logo svg {
    margin: 0 auto !important;
    display: block !important;
  }

  .receipt-brand {
    font-size: 16pt !important;
    font-weight: 800 !important;
    margin-bottom: 4px !important;
    display: block !important;
  }

  .receipt-tagline {
    font-size: 8pt !important;
    color: #64748b !important;
    display: block !important;
  }

  .receipt-id-tag {
    font-family: monospace !important;
    background: #f1f5f9 !important;
    padding: 4px 12px !important;
    border-radius: 20px !important;
    font-size: 8.5pt !important;
    color: #6366f1 !important;
    margin: 10px auto !important;
    display: inline-block !important;
  }

  .receipt-divider {
    border-top: 1px dashed #cbd5e1 !important;
    margin: 1rem 0 !important;
    width: 100% !important;
    display: block !important;
  }

  .receipt-row,
  .receipt-item-line,
  .balance-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 4px 0 !important;
  }

  .receipt-row span:first-child {
    font-size: 7.5pt !important;
    font-weight: 600 !important;
    color: #64748b !important;
  }

  .receipt-mono {
    font-family: monospace !important;
    font-size: 9pt !important;
  }

  .receipt-section-title {
    font-size: 8pt !important;
    color: #94a3b8 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    padding-bottom: 4px !important;
    margin-bottom: 8px !important;
    font-weight: 800 !important;
  }

  .item-name-qty {
    display: flex !important;
    gap: 6px !important;
  }

  .receipt-total-section {
    background: #f8fafc !important;
    padding: 12px !important;
    border-radius: 6px !important;
    border: 1px solid #e2e8f0 !important;
    display: block !important;
  }

  .receipt-total-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 8px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding-bottom: 6px !important;
  }

  .total-value {
    font-size: 15pt !important;
    font-weight: 900 !important;
  }

  .receipt-footer {
    text-align: center !important;
    margin-top: 1.5rem !important;
    border-top: 1px dashed #cbd5e1 !important;
    padding-top: 1rem !important;
    display: block !important;
  }

  .receipt-barcode {
    font-family: monospace !important;
    font-size: 10pt !important;
    letter-spacing: -1px !important;
    margin-bottom: 8px !important;
    color: #94a3b8 !important;
    display: block !important;
  }
}


/* ===== CART BADGE ===== */
.cart-badge {
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 10px;
  min-width: 18px;
  text-align: center
}

/* ===== USERS TABLE ===== */
.user-management {
  margin-top: 1.25rem
}

.add-user-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  gap: .75rem;
  align-items: end;
  margin-bottom: 1rem
}

@media(max-width:900px) {
  .add-user-form {
    grid-template-columns: 1fr 1fr;
    gap: .5rem
  }
}

.no-data {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
  font-size: .85rem
}


/* ===== PASSWORD STRENGTH & VALIDATION ===== */
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  color: var(--text-dim);
  font-size: 1.2rem;
  transition: all 0.2s;
  z-index: 10;
}

.password-toggle:hover {
  color: var(--primary);
  transform: translateY(-50%) scale(1.1);
}

.password-toggle .toggle-icon {
  display: block;
  line-height: 1;
}

.login-input-wrapper {
  position: relative;
}

.login-input-wrapper input[type="password"],
.login-input-wrapper input[type="text"] {
  padding-right: 45px;
}

.password-strength {
  margin-top: 8px;
  animation: slideDown 0.3s ease;
}

.strength-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.strength-bar-fill {
  height: 100%;
  width: 0%;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.strength-bar-fill.weak {
  width: 33%;
  background: var(--danger);
}

.strength-bar-fill.medium {
  width: 66%;
  background: var(--warning);
}

.strength-bar-fill.strong {
  width: 100%;
  background: var(--success);
}

.strength-text {
  font-size: 0.75rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.strength-text.weak {
  color: var(--danger);
}

.strength-text.medium {
  color: var(--warning);
}

.strength-text.strong {
  color: var(--success);
}

.password-requirements {
  margin-top: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.requirement {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 6px;
  transition: all 0.2s ease;
}

.requirement:last-child {
  margin-bottom: 0;
}

.requirement.met {
  color: var(--success);
}

.requirement .req-icon {
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.requirement.met .req-icon::before {
  content: '✓';
}

.password-match {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.3s ease;
  animation: slideDown 0.3s ease;
}

.password-match.match {
  background: var(--success-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--success);
}

.password-match.no-match {
  background: var(--danger-light);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.password-match .match-icon {
  font-size: 0.9rem;
}

.password-match.match .match-icon::before {
  content: '✓';
}

.password-match.no-match .match-icon::before {
  content: '✗';
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Button disabled state */
.login-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--text-dim);
}

.login-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* ===== ENHANCED PRINT STYLES FOR SINGLE PAGE ===== */
@media print {

  /* Ensure receipt starts at top of page */
  #receipt-modal {
    page-break-before: avoid !important;
  }

  .modal-content {
    page-break-after: avoid !important;
    page-break-before: avoid !important;
  }

  .receipt-paper {
    padding: 1rem !important;
    page-break-inside: avoid !important;
    page-break-before: avoid !important;
    margin-top: 0 !important;
  }

  .receipt-header {
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    page-break-after: avoid !important;
  }

  .receipt-items {
    margin: 0.5rem 0 !important;
    padding-top: 0.5rem !important;
    page-break-inside: avoid !important;
  }

  .receipt-footer {
    padding-top: 0.5rem !important;
    margin-top: 0.5rem !important;
    page-break-before: avoid !important;
  }

  .receipt-detail-row {
    padding: 0.25rem 0 !important;
    page-break-inside: avoid !important;
  }

  .receipt-total-row {
    padding: 0.5rem 0 !important;
    margin-top: 0.25rem !important;
    page-break-inside: avoid !important;
  }

  .receipt-item-row {
    padding: 0.2rem 0 !important;
    page-break-inside: avoid !important;
  }
}

/* ===== RECEIPT MODAL SCROLLING FOR SMALL SCREENS ===== */
.modal-overlay {
  overflow-y: auto !important;
  padding: 1rem;
}

.modal-content {
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  margin: auto;
}

.receipt-modal {
  max-height: calc(100vh - 2rem);
}

.receipt-modal .modal-body {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

/* Smooth scrolling */
.modal-overlay,
.modal-content,
.modal-body {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--bg-input);
}

/* Custom scrollbar for webkit browsers */
.modal-overlay::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-overlay::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
  background: var(--bg-input);
  border-radius: 4px;
}

.modal-overlay::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

.modal-overlay::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}

/* Mobile specific adjustments */
@media (max-height: 700px) {
  .receipt-paper {
    padding: 1rem !important;
  }

  .receipt-header {
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.5rem !important;
  }

  .receipt-header h2 {
    font-size: 1rem !important;
  }

  .receipt-detail-row {
    padding: 0.3rem 0 !important;
    font-size: 0.8rem !important;
  }

  .receipt-items h4 {
    font-size: 0.75rem !important;
    margin-bottom: 0.3rem !important;
  }

  .receipt-item-row {
    padding: 0.2rem 0 !important;
    font-size: 0.75rem !important;
  }

  .receipt-total-row {
    padding: 0.5rem 0 !important;
    margin-top: 0.3rem !important;
    font-size: 0.9rem !important;
  }

  .receipt-footer {
    padding-top: 0.5rem !important;
    margin-top: 0.5rem !important;
  }

  .receipt-footer p {
    font-size: 0.65rem !important;
    line-height: 1.3 !important;
  }
}

/* Very small screens */
@media (max-height: 600px) {
  .modal-content {
    width: 95%;
    max-width: 100%;
  }

  .receipt-modal {
    max-width: 100%;
  }

  .modal-header {
    padding: 0.75rem 1rem !important;
  }

  .modal-header h3 {
    font-size: 0.95rem !important;
  }

  .modal-footer {
    padding: 0.75rem 1rem !important;
    flex-wrap: wrap;
  }

  .modal-footer button {
    font-size: 0.8rem !important;
    padding: 0.5rem 1rem !important;
  }
}

/* ===== ADDITIONAL PRINT FIXES ===== */
@media print {

  /* Ensure receipt content is visible and properly formatted */
  .receipt-header h2,
  .receipt-header p,
  .receipt-id,
  .receipt-detail-row,
  .receipt-items,
  .receipt-item-row,
  .receipt-total-row,
  .receipt-footer {
    visibility: visible !important;
    display: block !important;
  }

  .receipt-detail-row,
  .receipt-item-row,
  .receipt-total-row {
    display: flex !important;
  }

  /* Ensure text is black for printing */
  .receipt-paper,
  .receipt-paper * {
    color: #000 !important;
  }

  /* Keep specific colors for emphasis */
  .receipt-id {
    color: #6366f1 !important;
  }

  .receipt-total-row {
    color: #000 !important;
    font-weight: 700 !important;
  }

  /* Ensure proper spacing */
  .receipt-header {
    text-align: center;
  }

  .receipt-detail-row,
  .receipt-item-row,
  .receipt-total-row {
    justify-content: space-between;
  }

  /* Hide modal buttons */
  .modal-footer,
  .modal-close {
    display: none !important;
    visibility: hidden !important;
  }

  /* Ensure no page breaks within receipt */
  .receipt-paper,
  .receipt-paper * {
    page-break-inside: avoid !important;
  }
}

/* ===== STOCK MANAGEMENT STYLES ===== */
.stock-badge {
  padding: .2rem .5rem;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 700;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.stock-badge.low {
  background: var(--warning-light);
  color: var(--warning);
  border-color: rgba(245, 158, 11, .3);
  animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.product-stock-small {
  font-size: .7rem;
  color: var(--text-dim);
  margin-top: .25rem;
}

.product-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: .15rem .45rem;
  border-radius: 4px;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  z-index: 2;
}

.product-badge.danger { background: var(--danger); color: #fff; }
.product-badge.warning { background: var(--warning); color: #fff; }
.product-badge.info { background: var(--primary); color: #fff; }
.product-badge.rwandan { background: #00a444; color: #fff; border: 1px solid #ff0; }

.product-card.disabled {
  opacity: .6;
  filter: grayscale(0.8);
  cursor: not-allowed;
  pointer-events: none;
}

.product-card.disabled::after {
  content: 'SOLD OUT';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .9rem;
  color: #fff;
  border-radius: inherit;
  backdrop-filter: blur(1px);
}

.category-filter {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  padding-bottom: .25rem;
}

.category-btn {
  padding: .5rem .9rem;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}

.category-btn:hover {
  background: rgba(255,255,255,.08);
  color: var(--text-main);
}

.category-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, .3);
}

/* ===== PREMIUM AGENT UI ENHANCEMENTS ===== */
.premium-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2.5rem;
}

.welcome-text h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
  background: linear-gradient(to right, #fff, var(--text-muted));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;

}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

/* Updated Stat Card specifically for Agent */
.agent-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.agent-kpi-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-glow);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.agent-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, var(--primary-light), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
}

.agent-kpi-card:hover::before {
  opacity: 1;
}

.kpi-icon-wrapper {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}

.kpi-icon-wrapper.blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.kpi-icon-wrapper.green { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.kpi-icon-wrapper.indigo { background: rgba(99, 102, 241, 0.1); color: #6366f1; }
.kpi-icon-wrapper.purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }

.kpi-content {
  position: relative;
  z-index: 1;
}

.kpi-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.kpi-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
}

/* Agent Sidebar Refinement */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
}

.sidebar-nav {
  padding: 1rem 1.25rem;
}

.nav-item {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  margin-bottom: 0.4rem;
  transition: all 0.3s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.03);
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  box-shadow: 0 8px 16px rgba(99, 102, 241, 0.25);
}

/* Dashboard Content Grids */
.agent-content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

@media (max-width: 1200px) {
  .agent-content-grid {
    grid-template-columns: 1fr;
  }
}

/* Premium Card Visual for Agent */
.agent-card-preview {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border-radius: var(--radius-xl);
  padding: 2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ===== ADDITIONAL FIXES & POLISH ===== */
.login-orb { z-index: -1; }

.page-section {
  padding-bottom: 5rem;
}

@media (max-width: 640px) {
  .main-content {
    padding: 1.25rem;
  }
  
  .glass-card {
    padding: 1.25rem;
  }
  
  .btn-primary, .btn-secondary, .btn-success, .btn-danger {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
  }
}

