/* =========================================================
   JS MAKMUR - Smoke & Tobacco Specialist Store
   Single View: Admin POS, Inventory, Struk & Real-Time Revenue
   Palet Warna: Midnight Obsidian (#0B0F17), Deep Slate (#162032),
   Golden Amber (#F59E0B), Rich Tobacco (#D97706)
   ========================================================= */

:root {
  --bg-page: #0B0F17;
  --bg-surface: #111827;
  --bg-card: #162032;
  --bg-card-hover: #1E293B;
  --bg-input: #0D131F;

  --primary: #F59E0B;
  --primary-hover: #D97706;
  --primary-light: rgba(245, 158, 11, 0.12);
  --primary-border: rgba(245, 158, 11, 0.3);

  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #F59E0B;

  --success: #10B981;
  --success-light: rgba(16, 185, 129, 0.12);
  --warning: #F59E0B;
  --warning-light: rgba(245, 158, 11, 0.15);
  --danger: #EF4444;
  --danger-light: rgba(239, 68, 68, 0.12);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 20px 30px -10px rgba(245, 158, 11, 0.15);
  --shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.75);

  --transition: all 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  letter-spacing: -0.01em;
}

.section-title-wrap p,
.recent-subtitle {
  font-family: 'Outfit', 'DM Sans', sans-serif;
  font-weight: 400;
  letter-spacing: 0.005em;
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.brand-text h1,
.auth-brand-info h2,
.kpi-header-row h2,
.section-header-bar h3,
.cart-header h3,
.recent-header h4,
.modal-header h4 {
  font-family: 'DM Serif Display', Georgia, serif;
  letter-spacing: 0.02em;
}

p,
label,
th,
td {
  line-height: 1.55;
}

/* =========================================================
   PORTAL LOGIN / AUTENTIKASI KASIR
   ========================================================= */
body.auth-locked {
  overflow: hidden;
}

body.auth-locked #mainAppContainer {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

.auth-portal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background:
    radial-gradient(circle at 15% 15%, rgba(245, 158, 11, 0.12), transparent 30%),
    radial-gradient(circle at 85% 85%, rgba(56, 189, 248, 0.08), transparent 32%),
    rgba(11, 15, 23, 0.94);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(145deg, #162032 0%, #0F172A 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 35px rgba(245, 158, 11, 0.15);
  padding: 2.25rem 2rem;
  position: relative;
  overflow: hidden;
  animation: authFadeIn 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-card::after {
  content: 'Akses aman untuk petugas resmi';
  display: block;
  color: var(--text-dim);
  font-size: 0.7rem;
  text-align: center;
  margin-top: 1.25rem;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #F59E0B, #FBBF24, #D97706);
}

@keyframes authFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.auth-logo-badge {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.1));
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
}

.auth-brand-info h2 {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  color: #FFFFFF;
  line-height: 1.2;
}

.auth-brand-info p {
  font-size: 0.75rem;
  color: #FBBF24;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-welcome {
  margin-bottom: 1.5rem;
}

.auth-welcome h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.3rem;
}

.auth-welcome p {
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.auth-error-alert {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #FCA5A5;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  animation: shake 300ms ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 0.9rem;
  font-size: 1rem;
  opacity: 0.6;
  pointer-events: none;
}

.auth-input {
  width: 100%;
  background: #0B0F17;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 2.5rem 0.75rem 2.6rem;
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.auth-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.btn-toggle-pwd {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem;
}

.btn-toggle-pwd:hover {
  color: var(--text-main);
}

.auth-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1rem 0 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.remember-label input {
  accent-color: var(--primary);
}

.btn-auth-submit {
  width: 100%;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #0B0F17;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.925rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-auth-submit:hover {
  background: linear-gradient(135deg, #FBBF24, #F59E0B);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}

.auth-hint-box {
  margin-top: 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.775rem;
  color: var(--text-muted);
}

.hint-title {
  color: #FBBF24;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.hint-details {
  color: var(--text-main);
}

/* =========================================================
   TOP STATUS BAR & LIVE INDICATOR
   ========================================================= */
.top-admin-banner {
  background: #0E1523;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.system-tag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.system-name-tag {
  color: #FBBF24;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.divider-dot {
  opacity: 0.3;
}

.system-location {
  color: var(--text-dim);
}

.live-clock-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: #F8FAFC;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.15rem 0.65rem;
  border-radius: var(--radius-full);
}

/* HEADER & NAVBAR */
.navbar {
  background-color: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #2A1F16, #162032);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  color: #FFFFFF;
  line-height: 1.15;
}

.brand-text p {
  font-size: 0.72rem;
  color: #FBBF24;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-separator {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 0.25rem;
}

.user-session-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-badge-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.775rem;
  color: var(--text-main);
}

.user-avatar-circle {
  font-size: 0.85rem;
}

.user-role-name {
  font-weight: 700;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #F87171;
  font-size: 0.775rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #EF4444;
  color: #FCA5A5;
}

.btn-undo-nav {
  color: #F87171 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}

.btn-undo-nav:hover {
  background: rgba(239, 68, 68, 0.15) !important;
}

/* =========================================================
   EXECUTIVE KPI COMMAND STRIP (BERSIH & PROFESIONAL)
   ========================================================= */
.kpi-command-section {
  background: #0B0F17;
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 1.5rem 1.75rem;
}

.kpi-container {
  max-width: 1400px;
  margin: 0 auto;
}

.kpi-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.kpi-section-tag {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #FBBF24;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.2rem;
}

.kpi-header-row h2 {
  font-size: 1.4rem;
  font-weight: 900;
  color: #FFFFFF;
  letter-spacing: -0.01em;
  margin: 0;
}

.btn-tool-subtle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-size: 0.775rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-tool-subtle:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(245, 158, 11, 0.08);
}

/* 4 KARTU METRIK KPI */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: #141C2B;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: var(--border);
}

.stat-card.revenue-card::after { background: #10B981; }
.stat-card.tempo-card::after { background: #F59E0B; }
.stat-card.orders-card::after { background: #FBBF24; }
.stat-card.stock-card::after { background: #38BDF8; }

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  flex-shrink: 0;
}

.stat-icon-green { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); color: #34D399; }
.stat-icon-amber { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); color: #F59E0B; }
.stat-icon-gold  { background: rgba(251, 191, 36, 0.15); border: 1px solid rgba(251, 191, 36, 0.3); color: #FBBF24; }
.stat-icon-cyan  { background: rgba(56, 189, 248, 0.15); border: 1px solid rgba(56, 189, 248, 0.3); color: #38BDF8; }

.stat-info .stat-val {
  font-size: 1.35rem;
  font-weight: 900;
  color: #FFFFFF;
  line-height: 1.15;
}

.stat-info .stat-val.green { color: #34D399; }
.stat-info .stat-val.amber { color: #F59E0B; }
.stat-info .stat-val.gold  { color: #FBBF24; }

.stat-info .stat-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 3px;
}

.stat-info .stat-val {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-info .stat-val.gold { color: #FBBF24; }
.stat-info .stat-val.green { color: #34D399; }
.stat-info .stat-val.amber { color: #F59E0B; }

.stat-info .stat-lbl {
  font-size: 0.725rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* SECTION PENGINGAT TEMPO TOKO - AESTHETIC & MODERN DESIGN */
.tempo-reminder-section {
  max-width: 1400px;
  margin: 1.75rem auto 0;
  padding: 0 1.5rem;
  width: 100%;
}

.tempo-reminder-card {
  background: linear-gradient(135deg, rgba(22, 32, 50, 0.95), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(245, 158, 11, 0.32);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.6rem;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 20px -3px rgba(245, 158, 11, 0.12);
  position: relative;
  overflow: hidden;
}

.tempo-reminder-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: linear-gradient(90deg, #F59E0B, #FBBF24, transparent);
}

.tempo-reminder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tempo-reminder-title-box {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.tempo-bell-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.12));
  border: 1px solid rgba(245, 158, 11, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  color: #FBBF24;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.2);
  flex-shrink: 0;
}

.tempo-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tempo-reminder-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.01em;
  margin: 0;
}

.tempo-count-badge {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #FBBF24;
  font-size: 0.725rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tempo-reminder-subtitle {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  margin-bottom: 0;
}

.btn-tempo-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-main);
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-tempo-action:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.45);
  color: #FBBF24;
  transform: translateY(-1px);
}

.btn-tempo-action .arrow-icon {
  font-size: 0.95rem;
  transition: transform 0.2s ease;
}

.btn-tempo-action:hover .arrow-icon {
  transform: translateX(3px);
}

/* GRID KARTU TIKET TEMPO */
.tempo-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1rem;
}

.tempo-ticket-card {
  background: rgba(11, 15, 23, 0.75);
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-left: 4px solid #F59E0B;
  border-radius: 12px;
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  position: relative;
}

.tempo-ticket-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.tempo-ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.tempo-ticket-store {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.ticket-store-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.ticket-store-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ticket-store-name {
  color: #FFFFFF;
  font-size: 0.925rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticket-receipt-no {
  color: var(--text-dim);
  font-size: 0.725rem;
  font-family: 'Space Mono', monospace;
  letter-spacing: 0.02em;
}

.tempo-due-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.due-normal {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #FBBF24;
}

.due-today {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #FCA5A5;
}

.due-overdue {
  background: rgba(220, 38, 38, 0.25);
  border: 1px solid #DC2626;
  color: #F87171;
}

.tempo-ticket-amount-row {
  background: rgba(245, 158, 11, 0.08);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px dashed rgba(245, 158, 11, 0.25);
}

.amount-label-small {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.amount-value-highlight {
  font-size: 1.15rem;
  font-weight: 900;
  color: #FBBF24;
}

.tempo-ticket-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.775rem;
  color: var(--text-muted);
}

.ticket-items-text {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticket-notes-box {
  background: rgba(0, 0, 0, 0.35);
  border-left: 2px solid #F59E0B;
  padding: 0.3rem 0.55rem;
  border-radius: 4px;
  color: #FCD34D;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tempo-ticket-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-tempo-ticket-open {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-tempo-ticket-open:hover {
  background: #F59E0B;
  border-color: #F59E0B;
  color: #000;
  font-weight: 700;
}

/* MAIN LAYOUT */
.main-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3.5rem;
  display: grid;
  grid-template-columns: 1fr 410px;
  gap: 2rem;
  align-items: start;
  flex: 1;
  width: 100%;
}

.catalog-section {
  min-width: 0;
}

.section-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.section-header-bar h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}

.action-tools-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-tool {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.btn-tool:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  color: var(--primary);
}

/* SEARCH & FILTER BAR */
.controls-bar {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.search-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 1.05rem;
}

.search-input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.85rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.category-filter-chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.category-filter-chips::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.cat-chip:hover {
  border-color: var(--primary-border);
  color: var(--primary);
}

.cat-chip.active {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  border-color: #F59E0B;
  color: #0F172A;
  font-weight: 800;
}

/* =========================================================
   PRODUCT GRID & KARTU PRODUK ROKOK TEBUMAS AESTHETIC
   ========================================================= */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 1.25rem;
}

.product-card {
  background: #141C2B;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
}

/* THEMES PER VARIAN TEBUMAS */
.product-card.theme-kretek::before { background: linear-gradient(90deg, #F59E0B, #D97706); }
.product-card.theme-kretek:hover { border-color: rgba(245, 158, 11, 0.4); }

.product-card.theme-filter::before { background: linear-gradient(90deg, #EF4444, #B91C1C); }
.product-card.theme-filter:hover { border-color: rgba(239, 68, 68, 0.4); }

.product-card.theme-mild::before { background: linear-gradient(90deg, #06B6D4, #0284C7); }
.product-card.theme-mild:hover { border-color: rgba(6, 182, 212, 0.4); }

.product-card.theme-menthol::before { background: linear-gradient(90deg, #10B981, #059669); }
.product-card.theme-menthol:hover { border-color: rgba(16, 185, 129, 0.4); }

.product-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.product-sku-tag {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: monospace;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.product-pack-pill {
  font-size: 0.7rem;
  font-weight: 700;
  color: #F8FAFC;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.18rem 0.6rem;
  border-radius: var(--radius-full);
}

.product-hero-badge {
  height: 80px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
  position: relative;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.04) 0%, rgba(11, 15, 23, 0.6) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.theme-kretek .product-hero-badge { background: radial-gradient(circle, rgba(245, 158, 11, 0.12) 0%, #0F172A 100%); }
.theme-filter .product-hero-badge { background: radial-gradient(circle, rgba(239, 68, 68, 0.12) 0%, #0F172A 100%); }
.theme-mild .product-hero-badge { background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, #0F172A 100%); }
.theme-menthol .product-hero-badge { background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, #0F172A 100%); }

.brand-monogram {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: #FFFFFF;
  line-height: 1;
}

.variant-accent-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 4px;
}

.theme-kretek .variant-accent-tag { color: #FBBF24; }
.theme-filter .variant-accent-tag { color: #FCA5A5; }
.theme-mild .variant-accent-tag { color: #7DD3FC; }
.theme-menthol .variant-accent-tag { color: #6EE7B7; }

.product-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-cat-pill {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
  align-self: flex-start;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.4rem;
}

.theme-kretek .product-cat-pill { background: rgba(245, 158, 11, 0.15); color: #FBBF24; border: 1px solid rgba(245, 158, 11, 0.3); }
.theme-filter .product-cat-pill { background: rgba(239, 68, 68, 0.15); color: #F87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.theme-mild .product-cat-pill { background: rgba(6, 182, 212, 0.15); color: #38BDF8; border: 1px solid rgba(6, 182, 212, 0.3); }
.theme-menthol .product-cat-pill { background: rgba(16, 185, 129, 0.15); color: #34D399; border: 1px solid rgba(16, 185, 129, 0.3); }

.product-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.25;
  margin-bottom: 0.25rem;
}

.product-desc {
  font-size: 0.775rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-bottom-box {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
}

.price-val {
  font-size: 1.25rem;
  font-weight: 900;
  color: #FFFFFF;
}

.price-unit {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.product-stock-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
}

.stock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stock-in { background: #10B981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.6); }
.stock-low { background: #F59E0B; box-shadow: 0 0 6px rgba(245, 158, 11, 0.6); }
.stock-out { background: #EF4444; }

.stock-text { color: var(--text-muted); }
.stock-text.text-amber { color: #FBBF24; font-weight: 700; }
.stock-text.text-danger { color: #F87171; font-weight: 700; }

.card-actions-row {
  display: flex;
  gap: 0.5rem;
}

.btn-add {
  flex: 1;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #0B0F17;
  border: none;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.825rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: var(--transition);
}

.btn-add:hover:not(:disabled) {
  background: linear-gradient(135deg, #FBBF24, #F59E0B);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.btn-add:disabled {
  background: #1E293B;
  color: #475569;
  cursor: not-allowed;
}

.btn-card-edit {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem;
}

.btn-card-edit:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(245, 158, 11, 0.1);
}

/* CART & RESI PANEL */
.cart-section {
  position: sticky;
  top: 5rem;
}

.cart-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-card);
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.9rem;
}

.cart-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-count {
  background-color: var(--primary-light);
  border: 1px solid var(--primary-border);
  color: #FBBF24;
  font-size: 0.725rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.btn-clear {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.775rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-clear:hover { color: var(--danger); }

/* SELECTOR NAMA TOKO */
.store-selection-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  margin-bottom: 1rem;
}

.store-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.store-header-row label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.btn-manage-stores {
  background: none;
  border: none;
  color: #FBBF24;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.select-store-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: #FFFFFF;
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
}

.select-store-input:focus {
  border-color: var(--primary);
}

/* DAFTAR ITEM BELANJA */
.cart-items {
  max-height: 200px;
  overflow-y: auto;
  padding-right: 0.35rem;
  margin-bottom: 1rem;
}

.cart-items::-webkit-scrollbar {
  width: 5px;
}
.cart-items::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

.cart-empty {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-muted);
}

.cart-empty-icon {
  font-size: 2rem;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
  opacity: 0.6;
}

.cart-empty p {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
}

.cart-item {
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.cart-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.3rem;
}

.cart-item-title {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-main);
}

.cart-item-price {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.cart-item-subtotal {
  font-size: 0.85rem;
  font-weight: 800;
  color: #FBBF24;
}

.cart-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-item-delete {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.725rem;
  cursor: pointer;
}

.btn-item-delete:hover { color: var(--danger); }

.qty-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background-color: var(--bg-card);
  overflow: hidden;
}

.qty-btn {
  background: none;
  border: none;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
}

.qty-btn:hover:not(:disabled) {
  background-color: var(--primary-light);
  color: var(--primary);
}

.qty-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.qty-number {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0 0.4rem;
  min-width: 20px;
  text-align: center;
}

/* PILIHAN METODE PEMBAYARAN */
.payment-method-selector {
  margin-bottom: 1rem;
}

.payment-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.pay-radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.pay-radio-box {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 0.55rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  transition: var(--transition);
}

.pay-radio-box input {
  accent-color: var(--primary);
}

.pay-radio-box.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: #FBBF24;
}

/* CATATAN & JATUH TEMPO PEMBAYARAN TEMPO */
.tempo-config-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed var(--primary-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 1rem;
  display: none;
}

.tempo-config-box.active {
  display: block;
}

.tempo-config-box label {
  display: block;
  font-size: 0.725rem;
  color: #FBBF24;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.tempo-input {
  width: 100%;
  padding: 0.45rem 0.65rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: #FFFFFF;
  font-size: 0.8rem;
  outline: none;
  margin-bottom: 0.5rem;
}

.tempo-input:focus { border-color: var(--primary); }

/* BLUETOOTH STRIP */
.bt-hardware-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.775rem;
}

.bt-device-name {
  color: var(--text-main);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-bt-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

/* SUMMARY */
.cart-summary {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.825rem;
  color: var(--text-muted);
}

.summary-row.total {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  padding-top: 0.55rem;
  border-top: 1px dashed var(--border);
}

.summary-row .total-amount {
  color: #FBBF24;
  font-size: 1.25rem;
  font-weight: 900;
}

/* TOMBOL CETAK STRUK */
.btn-checkout {
  width: 100%;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #0F172A;
  border: none;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.925rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
  transition: var(--transition);
}

.btn-checkout:hover:not(:disabled) {
  background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.btn-checkout:disabled {
  background: #1E293B;
  color: #475569;
  box-shadow: none;
  cursor: not-allowed;
}

/* TABEL RIWAYAT TRANSAKSI TERAKHIR */
.recent-transactions-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  width: 100%;
}

.recent-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.recent-header {
  padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.recent-header h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.admin-table th {
  background: var(--bg-card);
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.admin-table tr:hover td {
  background: var(--bg-card-hover);
}

/* BADGES */
.trx-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.725rem;
  font-weight: 700;
}

.trx-status-badge.success {
  background: var(--success-light);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.trx-status-badge.tempo {
  background: var(--warning-light);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.trx-status-badge.cancelled {
  background: var(--danger-light);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.row-cancelled {
  opacity: 0.55;
  background: rgba(239, 68, 68, 0.03);
}

.row-cancelled td strong {
  text-decoration: line-through;
}

.btn-trx-cancel {
  background: var(--danger-light);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #F87171;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.725rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-trx-delete {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #F87171;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-trx-delete:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #EF4444;
  transform: scale(1.05);
}

.btn-trx-cancel:hover {
  background: #EF4444;
  color: #FFFFFF;
}

/* MODAL OVERLAY */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(5, 8, 14, 0.8);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* SETTING LEBAR MODAL BOX STRUK PRESISI */
.modal-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: var(--transition);
}

.modal-overlay.active .modal-box {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.35rem;
  color: var(--text-dim);
  cursor: pointer;
}

.modal-close:hover { color: var(--text-main); }

.modal-body {
  padding: 1.15rem;
  max-height: 72vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 0.85rem 1.35rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* =========================================================
   PENGATURAN STRUK RESI: PRESISI UKURAN KERTAS PENCETAK THERMAL
   (58mm = ~48mm printable area / 200px, 80mm = ~72mm printable area / 280px)
   ========================================================= */
.receipt-paper-wrapper {
  display: flex;
  justify-content: center;
  background: #E2E8F0;
  padding: 1rem;
  border-radius: var(--radius-sm);
}

.receipt-paper {
  background: #FFFFFF;
  color: #111827;
  width: 72mm; /* Standard 80mm printer printable width */
  max-width: 100%;
  padding: 6mm 4mm;
  font-family: 'Space Mono', 'Courier New', Courier, monospace;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  font-size: 10.5px;
  line-height: 1.32;
  position: relative;
  box-sizing: border-box;
}

.receipt-cancelled-watermark {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-25deg);
  font-size: 1.8rem;
  font-weight: 900;
  color: rgba(239, 68, 68, 0.45);
  border: 3px dashed rgba(239, 68, 68, 0.6);
  padding: 0.2rem 0.8rem;
  border-radius: 6px;
  pointer-events: none;
  letter-spacing: 2px;
}

.receipt-center {
  text-align: center;
}

.receipt-logo {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #000000;
  margin-bottom: 2px;
}

.receipt-divider {
  border-top: 1px dashed #374151;
  margin: 4px 0;
}

.receipt-double-divider {
  border-top: 2px dashed #111827;
  margin: 5px 0;
}

.receipt-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  margin-bottom: 2px;
  color: #1F2937;
}

.receipt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
}

.receipt-table th {
  text-align: left;
  padding: 2px 0;
  border-bottom: 1px dashed #374151;
  color: #111827;
  font-weight: 700;
}

.receipt-table td {
  padding: 2.5px 0;
  border-bottom: 1px dotted #D1D5DB;
  color: #111827;
}

.receipt-table .col-right {
  text-align: right;
}

.receipt-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: #111827;
}

.receipt-summary-row.total-bold {
  font-size: 12px;
  font-weight: 900;
  color: #000000;
  margin: 3px 0;
}

.receipt-tempo-alert-box {
  background: #FEF3C7;
  border: 1px solid #D97706;
  padding: 4px 5px;
  border-radius: 4px;
  margin: 4px 0;
  font-size: 9.5px;
  color: #78350F;
  text-align: left;
}

.barcode-sim {
  text-align: center;
  margin-top: 4px;
  padding: 2px 0;
  letter-spacing: 2px;
  font-size: 11px;
  font-weight: bold;
}

/* LIST TOKO MANAGEMENT IN MODAL */
.store-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 240px;
  overflow-y: auto;
  margin-top: 1rem;
}

.store-list-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.store-item-info h5 {
  font-size: 0.875rem;
  color: var(--text-main);
  font-weight: 700;
}

.store-item-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.store-actions {
  display: flex;
  gap: 0.35rem;
}

/* FORM STYLING IN MODAL */
.form-group {
  margin-bottom: 0.85rem;
}

.form-group label {
  display: block;
  font-size: 0.775rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #FFFFFF;
  outline: none;
  font-size: 0.875rem;
}

.form-control:focus {
  border-color: var(--primary);
}

/* BUTTONS */
.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover { background: var(--bg-card-hover); }

.btn-print {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #0F172A;
  border: none;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition);
}

.btn-print:hover {
  background: linear-gradient(135deg, #FBBF24, #F59E0B);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-cancel-modal {
  background: var(--danger-light);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #F87171;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.btn-cancel-modal:hover {
  background: #EF4444;
  color: #FFFFFF;
}

/* TOAST NOTIFIKASI */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #1E293B;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-modal);
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slideIn 200ms ease;
  color: var(--text-main);
}

.toast-success { border-left: 4px solid var(--primary); }
.toast-danger { border-left: 4px solid var(--danger); }

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

/* FOOTER */
.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-top: auto;
}

.site-footer span {
  font-weight: 800;
  color: var(--primary);
}

/* =========================================================
   SETTING UKURAN KERTAS PENCETAK STRUK PRESISI (@media print)
   Menyesuaikan persis dengan rol kertas thermal printer 80mm / 58mm
   ========================================================= */
@media print {
  @page {
    /* Ukuran kertas pencetak struk thermal standar */
    size: 80mm auto;
    margin: 0mm;
  }
  html, body {
    width: 80mm !important;
    max-width: 80mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #FFFFFF !important;
  }
  body * {
    visibility: hidden;
  }
  #receiptModal, #receiptModal * {
    visibility: visible;
  }
  #receiptModal {
    position: absolute;
    left: 0;
    top: 0;
    width: 80mm !important;
    max-width: 80mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #FFFFFF !important;
    display: block !important;
  }
  .receipt-paper-wrapper {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 80mm !important;
  }
  .modal-box {
    border: none !important;
    box-shadow: none !important;
    width: 80mm !important;
    max-width: 80mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #FFFFFF !important;
  }
  .modal-header, .modal-footer, .no-print {
    display: none !important;
  }
  .modal-body {
    padding: 0 !important;
    margin: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .receipt-paper {
    width: 76mm !important;
    max-width: 76mm !important;
    margin: 0 auto !important;
    padding: 4mm 3mm !important;
    box-shadow: none !important;
    font-size: 9.5px !important;
    line-height: 1.25 !important;
    page-break-inside: avoid !important;
    page-break-after: avoid !important;
  }
}

/* =========================================================
   RESPONSIVE DESIGN (HP / TABLET / LAPTOP / DESKTOP)
   ========================================================= */

/* Tablet & Laptop Sedang (Maks 1024px) */
@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.25rem 1rem 2.5rem;
  }
  .cart-section {
    position: static;
    width: 100%;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Smartphone / Layar HP (Maks 768px) */
@media (max-width: 768px) {
  /* Top Bar & Header */
  .top-admin-banner {
    padding: 0.35rem 0.85rem;
    font-size: 0.7rem;
    min-height: 30px;
  }
  .system-location {
    display: none; /* Hemat ruang vertikal di HP */
  }
  .system-tag {
    min-width: 0;
  }
  .system-name-tag {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-container {
    padding: 0.65rem 0.85rem;
    flex-wrap: wrap;
    gap: 0.75rem;
    min-width: 0;
  }
  .brand {
    min-width: 0;
  }
  .brand-text h1 {
    font-size: 1.1rem;
  }
  .brand-text p {
    font-size: 0.65rem;
    white-space: nowrap;
  }
  .nav-actions {
    width: 100%;
    justify-content: space-between;
    min-width: 0;
    overflow: hidden;
    padding-bottom: 2px;
  }
  .toolbar-group {
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 3px;
  }
  .toolbar-group::-webkit-scrollbar {
    display: none;
  }
  .btn-tool {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }
  .btn-logout {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }

  .nav-separator {
    display: none;
  }
  .user-session-box {
    flex-shrink: 0;
  }
  .user-badge-pill {
    padding: 0.35rem 0.55rem;
  }
  .user-role-name {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* KPI Section */
  .kpi-command-section {
    padding: 1rem 0.85rem;
  }
  .kpi-header-row h2 {
    font-size: 1.15rem;
    line-height: 1.25;
  }
  .kpi-title-box {
    min-width: 0;
  }
  .kpi-header-row {
    align-items: stretch;
  }
  .kpi-actions-box,
  .kpi-actions-box .btn-tool-subtle {
    width: 100%;
  }
  .kpi-actions-box .btn-tool-subtle {
    justify-content: center;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }
  .stat-card {
    padding: 0.85rem;
    gap: 0.65rem;
  }
  .stat-icon {
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
  }
  .stat-info .stat-val {
    font-size: 1.05rem;
  }
  .stat-info .stat-lbl {
    font-size: 0.65rem;
  }

  /* Pengingat Tempo */
  .tempo-reminder-section {
    padding: 0 0.85rem;
    margin-top: 1rem;
  }
  .tempo-reminder-card {
    padding: 1rem;
  }
  .tempo-reminder-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .btn-tempo-action {
    width: 100%;
    justify-content: center;
  }
  .tempo-cards-grid {
    grid-template-columns: 1fr;
  }

  /* Katalog & Grid Produk */
  .main-layout {
    padding: 1rem 0.85rem 3rem;
    display: flex;
    flex-direction: column;
  }
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
  }
  .product-card {
    padding: 0.85rem;
  }
  .product-hero-badge {
    height: 60px;
  }
  .brand-monogram {
    font-size: 1rem;
  }
  .variant-accent-tag {
    font-size: 0.55rem;
  }
  .product-name {
    font-size: 0.9rem;
  }
  .product-desc {
    display: none; /* Sembunyikan deskripsi panjang di HP agar kartu tetap ringkas */
  }
  .price-val {
    font-size: 1.05rem;
  }
  .btn-add {
    padding: 0.5rem 0.65rem;
    font-size: 0.75rem;
  }

  /* Sidebar Kasir Resi */
  .cart-panel {
    padding: 1rem;
  }
  .cart-section {
    width: 100%;
    min-width: 0;
  }
  .pay-radio-group {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  /* Tabel Riwayat Struk */
  .recent-transactions-section {
    padding: 0 0.85rem 2rem;
  }
  .recent-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .recent-header > div:last-child {
    width: 100%;
    justify-content: flex-start;
  }
  .admin-table th, .admin-table td {
    padding: 0.5rem 0.65rem;
    font-size: 0.75rem;
  }

  /* Modal Dialog */
  .modal-box {
    width: 100%;
    max-height: calc(100vh - 1.5rem);
  }
  .modal-overlay {
    padding: 0.75rem;
  }
  .auth-portal-overlay {
    align-items: flex-end;
    padding: 0.75rem;
  }
  .auth-card {
    max-width: 520px;
    padding: 1.5rem 1.25rem;
    border-radius: 18px;
  }
  .auth-header {
    margin-bottom: 1.15rem;
  }
  .auth-welcome {
    margin-bottom: 1.15rem;
  }
  .auth-welcome h3 {
    font-size: 1.05rem;
  }
  .auth-input {
    min-height: 46px;
  }
  .btn-auth-submit {
    min-height: 48px;
  }
}

/* Smartphone Layar Sangat Kecil (Maks 480px) */
@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr; /* 1 Kolom penuh agar mudah dibaca & ditap */
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .top-admin-banner {
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }
  .nav-container {
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }
  .brand-icon {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
  }
  .brand-text h1 {
    font-size: 1rem;
  }
  .brand-text p {
    font-size: 0.58rem;
  }
  .kpi-command-section {
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }
  .stat-card {
    padding: 0.9rem 1rem;
  }
  .main-layout {
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }
  .recent-transactions-section {
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }
  .auth-portal-overlay {
    padding: 0.5rem;
  }
  .auth-card {
    padding: 1.35rem 1rem;
  }
}
