/* =========================================================
   FONT LOADING SPLASH SCREEN
   Mencegah FOUT (Flash of Unstyled Text) & layout acak saat refresh
   ========================================================= */
#app-font-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  opacity: 1;
  visibility: visible;
}

#app-font-loader.font-loader-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.font-loader-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #dbeafe;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: font-loader-spin 0.7s linear infinite;
}

@keyframes font-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

.font-loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.font-loader-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  animation: font-loader-pulse 1.5s ease-in-out infinite;
}

@keyframes font-loader-pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

/* Pastikan body tidak menampilkan konten sebelum font siap
   (hanya visibilitas, bukan display agar layout sudah dihitung) */
body:has(#app-font-loader:not(.font-loader-done)) {
  overflow: hidden;
}

:root {
  --primary-color: #2563eb;
  --primary-gradient: linear-gradient(135deg, #2563eb, #1e4ed8);
  --success-gradient: linear-gradient(135deg, #10b981, #059669);
  --danger-gradient: linear-gradient(135deg, #ef4444, #dc2626);
  --premium-gradient: linear-gradient(135deg, #fbbf24, #d97706);
  --secondary-color: #64748b;
  --background-color: #f8fafc;
  --card-background: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --radius: 20px;
  --radius-sm: 12px;
  --header-bg: rgba(255, 255, 255, 0.85);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-subtle {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
}

body {
  background-color: var(--background-color);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  padding-top: 0;
  /* Sticky handles this */
  padding-bottom: 80px;
  /* Space for bottom nav */
  min-height: 100vh;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 12px 100px 12px;
  min-height: auto;
}

/* Header Section */
header {
  text-align: left;
  margin-bottom: 10px;
  padding: 10px 14px;
  background: var(--header-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 0 0 var(--radius) var(--radius);
  /* Rounded bottom only for sticky */
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 1000;
  border: 1px solid rgba(255, 255, 255, 0.4);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* Transisi saat scroll (Header Beku) */
header.sticky-active {
  top: 0 !important;
  border-radius: 0;
  margin: 0;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: none;
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: translateZ(0);
}

header.sticky-active #header-full-view {
  display: none;
}

header:not(.sticky-active) #header-compact-view {
  display: none;
}

header.sticky-active #header-compact-view {
  display: flex;
}

/* Fix for container width when sticky */
@media (min-width: 501px) {
  header.sticky-active {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    left: 0;
    right: 0;
  }
}

.logo-container {
  width: 42px;
  height: 42px;
  background: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.logo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.logo-container {
  width: 44px;
  height: 44px;
  background: white;
  border-radius: 12px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.logo-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}

.logo-container .material-icons {
  font-size: 40px;
  color: black;
}

h1 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.02em;
}

.wa-info {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.wa-info .material-icons {
  font-size: 16px;
  color: #25d366;
}

/* Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-around;
  padding: 12px 0;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  z-index: 1000;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 10px;
  transition: color 0.2s ease;
  cursor: pointer;
  background: none;
  border: none;
  flex: 1;
}

.nav-item .material-icons {
  font-size: 24px;
  margin-bottom: 4px;
}

.nav-item.active {
  color: var(--primary-color);
}

.nav-item.active .material-icons {
  font-weight: 700;
}

/* Sections */
.section {
  display: none;
}

.section.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

/* Cards & Stats */
.card {
  background: var(--card-background);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.stat-card {
  background: white;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  text-align: left;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.stat-card .label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 2px;
  display: block;
}

.stat-card .value {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text-primary);
}

.stat-card:first-child .value {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-card:last-child .value {
  color: #059669;
}

/* Dashboard Menu Buttons */
.dashboard-menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.menu-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.2s, background 0.2s;
  cursor: pointer;
}

.menu-btn:active {
  transform: scale(0.95);
  background: #f1f5f9;
}

.menu-btn .material-icons {
  font-size: 32px;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.menu-btn span {
  font-weight: 600;
  font-size: 0.875rem;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

input,
select {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #fdfdfd;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  background: white;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

button.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

button.btn-primary:active {
  background: var(--primary-hover);
}

/* Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin-top: 12px;
  background: white;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
}

/* Capture helper - bypasses overflow and scaling during export */
.capturing-mode .table-container {
  overflow: visible !important;
  display: block !important;
  width: auto !important;
  max-width: none !important;
  transform: none !important;
  height: auto !important;
}

.capturing-mode table {
  width: auto !important;
  min-width: 800px !important;
  /* Force a legible width for PDF */
}

.capturing-mode .bottom-nav,
.capturing-mode .actions,
.capturing-mode .zoom-controls,
.capturing-mode .hide-on-capture,
.capturing-mode .btn-primary:not(#main-header *),
.capturing-mode .btn-export,
.capturing-mode .btn-secondary {
  display: none !important;
}

.capturing-mode #table-stok-rekap-container table td:nth-child(3) {
  min-width: 110px !important;
  max-width: none !important;
  white-space: nowrap !important;
}

.capturing-mode #table-stok-rekap-container table td:nth-child(3) div {
  display: inline-block !important;
  white-space: nowrap !important;
  box-shadow: none !important;
}

/* Sticky Column for Nama Produk - Support multiple tables */
.sticky-column {
  position: sticky;
  left: 0;
  background: white !important;
  z-index: 10;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
}

#table-produk td:first-child,
#table-stok-rekap-container td:first-child {
  position: sticky;
  left: 0;
  background: white !important;
  z-index: 5;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
}

/* Fix for zoom applying to table container or specific table scale */
.table-container {
  overflow: auto;
  position: relative;
  width: 100%;
}

.table-zoom-wrapper {
  transition: font-size 0.2s;
  display: block;
  min-width: 100%;
}

/* Hide Aksi column in specific tables during capture */
.capturing-mode #table-produk th:last-child,
.capturing-mode #table-produk td:last-child,
.capturing-mode #table-stok-history th:last-child,
.capturing-mode #table-stok-history td:last-child {
  display: none !important;
}

.zoom-controls {
  display: flex;
  gap: 4px;
}

.btn-zoom {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-secondary);
}

.btn-zoom:active {
  background: #e2e8f0;
}

.btn-zoom .material-icons {
  font-size: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: white;
}

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

/* Specific styling for REKAP tables to make columns uniform and narrow */
#table-produk th,
#table-produk td,
#table-stok-rekap-container table th,
#table-stok-rekap-container table td {
  min-width: 100px;
  /* Default for currency/data columns */
  max-width: 120px;
  text-align: center;
  padding: 8px 6px;
  word-wrap: break-word;
  white-space: normal;
  vertical-align: middle;
  line-height: 1.2;
}

/* Specific NARROW width for 'Nama Produk' label in Rekap tables ONLY */
#table-produk .sticky-column,
#table-produk td.sticky-column,
#table-stok-rekap-container .sticky-column,
#table-stok-rekap-container td.sticky-column {
  min-width: 90px !important;
  width: 95px !important;
  text-align: left !important;
  padding: 8px !important;
  font-weight: 700;
  line-height: 1.1;
  position: sticky;
  left: 0;
  background: white !important;
  z-index: 10;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
}

/* Restoring NORMAL behavior for Riwayat, Tarik Dana, and Laporan tables */
#table-stok-history th,
#table-stok-history td,
#table-tarik-rekap th,
#table-tarik-rekap td,
#table-laporan th,
#table-laporan td {
  min-width: auto;
  max-width: none;
  text-align: left;
  padding: 12px;
  white-space: nowrap;
}

#table-stok-history th:nth-child(3),
#table-stok-history td:nth-child(3),
#table-stok-history th:nth-child(4),
#table-stok-history td:nth-child(4) {
  text-align: center;
}

/* Exception for Aksi column */
#table-produk th:last-child,
#table-produk td:last-child {
  min-width: 60px !important;
  width: 60px;
}

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: #f8fafc;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Styles for table values as per blueprint */
.abu {
  color: #64748b;
}

.biru-bold {
  color: #2563eb;
  font-weight: 800;
}

.merah-bold {
  color: #ef4444;
  font-weight: 800;
}

.hitam-bold {
  color: #1e293b;
  font-weight: 800;
}

.total-value {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary-color);
  text-align: center;
  margin: 8px 0;
  letter-spacing: -0.02em;
}

/* Utils */
.mb-2 {
  margin-bottom: 8px;
}

.text-center {
  text-align: center;
}

.d-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Modal / Action Buttons */
.actions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  /* Firefox */
}

.actions::-webkit-scrollbar {
  display: none;
  /* Chrome/Safari */
}

.btn-icon {
  background: #f1f5f9;
  border: none;
  padding: 6px;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
}

.btn-icon:active {
  background: #e2e8f0;
}

.btn-export {
  background: white;
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

/* Print/Export specific styles */
#capture-area {
  padding: 20px;
  background: white;
}

@media print {
  body {
    background: white;
    padding: 0;
    margin: 0;
  }

  .bottom-nav,
  .actions,
  .zoom-controls,
  .btn-primary,
  .dashboard-menu,
  .form-group,
  header,
  nav,
  .btn-export {
    display: none !important;
  }

  .container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .section {
    display: none !important;
  }

  .section.active {
    display: block !important;
  }

  .card {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }

  /* Print Standard A4 */
  .standard-print-only {
    display: block !important;
  }

  /* Print Thermal Specific */
  .thermal-mode {
    width: 58mm !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .thermal-mode .container,
  .thermal-mode body {
    width: 58mm !important;
  }

  .thermal-mode .section.active,
  .thermal-mode #capture-tarik-dana {
    display: none !important;
  }

  .thermal-mode #thermal-receipt-template {
    display: block !important;
  }
}

/* Role Selection Specific */
.role-selection-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  margin-top: 10px;
}

@media (min-width: 360px) {
  .role-selection-container {
    grid-template-columns: 1fr 1fr;
  }
}

.role-card {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  padding: 30px 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.role-card * {
  pointer-events: none;
}

.role-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.role-card:active {
  transform: translateY(-4px) scale(0.98);
  box-shadow: var(--shadow-sm);
  background: #f8fafc;
}

.role-card.active {
  border-color: var(--primary-color);
  background: #eff6ff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.role-card .material-icons {
  font-size: 56px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 5px;
}

.role-card h3 {
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-card p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

.role-card .check-mark {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #10b981;
  display: none;
}

.role-card.active .check-mark {
  display: block;
}

.role-btn-back {
  background: #f1f5f9;
  border: none;
  color: var(--text-secondary);
  padding: 10px 15px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin-bottom: 20px;
  width: fit-content;
}

.role-badge-floating {
  background: var(--primary-gradient);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.6rem;
  font-weight: 800;
  margin-left: 8px;
  vertical-align: middle;
}

/* Snackbar / Toast for Undo */
#snackbar {
  visibility: hidden;
  min-width: 280px;
  max-width: 90%;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  border-radius: 50px;
  padding: 6px 12px 6px 16px;
  position: fixed;
  z-index: 10005;
  left: 50%;
  bottom: 80px;
  transform: translate(-50%, 20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  opacity: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
}

#snackbar.show {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
}

#snackbar .btn-close-snackbar {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 50%;
}

#snackbar .btn-undo {
  color: #fbbf24;
  background: none;
  border: none;
  font-weight: 800;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  text-transform: uppercase;
}

#snackbar .btn-undo:hover {
  background: rgba(255, 255, 255, 0.1);
}

#snackbar .btn-close-snackbar:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

@keyframes snackbar-fadein {
  from {
    bottom: 0;
    opacity: 0;
  }

  to {
    bottom: 90px;
    opacity: 1;
  }
}

/* Toast Notification System */
#toast-container {
  position: fixed;
  bottom: 85px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10006;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 90%;
  max-width: 350px;
  pointer-events: none;
}

.toast {
  background: rgba(30, 41, 59, 0.95);
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  backdrop-filter: blur(5px);
  border-left: 4px solid var(--primary-color);
  animation: toast-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: all 0.3s ease;
}

.toast.toast-success {
  border-left-color: #10b981;
}

.toast.toast-error {
  border-left-color: #ef4444;
}

.toast.toast-info {
  border-left-color: #2563eb;
}

@keyframes toast-in {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.toast.fade-out {
  opacity: 0;
  transform: translateY(-20px);
}

/* Collapsible Section Styles */
.collapsible-header {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  padding: 5px 0;
}

.collapsible-header .toggle-icon {
  transition: transform 0.3s ease;
  color: var(--primary-color);
}

.collapsible-header.active .toggle-icon {
  transform: rotate(180deg);
}

.collapse-content {
  overflow: hidden;
  transition: max-height 0.3s ease-out, opacity 0.3s ease;
}

.collapse-content.collapsed {
  display: none;
}

/* =========================================================
   STORE LIST / DIRECTORY CARDS
   ========================================================= */
.store-list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.store-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.store-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary-gradient);
  border-radius: 4px 0 0 4px;
}

.store-card:hover {
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.1);
  border-color: #bfdbfe;
}

.store-card.active-store {
  border-color: #2563eb;
  background: #f0f7ff;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.12);
}

.store-card.active-store::before {
  background: linear-gradient(180deg, #10b981, #059669);
}

.store-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.store-card-icon {
  width: 40px;
  height: 40px;
  background: #eff6ff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.store-card-icon .material-icons {
  font-size: 22px;
  color: #2563eb;
}

.store-card.active-store .store-card-icon {
  background: #dcfce7;
}

.store-card.active-store .store-card-icon .material-icons {
  color: #16a34a;
}

.store-card-info {
  flex: 1;
  min-width: 0;
}

.store-card-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 2px;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 6px;
}

.store-card-name .active-badge {
  font-size: 0.55rem;
  background: #dcfce7;
  color: #16a34a;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 800;
  white-space: nowrap;
}

.store-card-address {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.5;
  margin: 6px 0 0;
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.store-card-address .material-icons {
  font-size: 14px;
  color: #94a3b8;
  flex-shrink: 0;
  margin-top: 1px;
}

.store-card-address-text {
  word-break: break-word;
}

.store-card-no-address {
  font-size: 0.7rem;
  color: #cbd5e1;
  font-style: italic;
  margin-top: 6px;
}

.store-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.store-card-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.store-card-btn:active {
  transform: scale(0.95);
}

.store-card-btn .material-icons {
  font-size: 14px;
}

.store-card-btn.btn-maps {
  background: #eff6ff;
  color: #2563eb;
  border-color: #dbeafe;
}

.store-card-btn.btn-maps:hover {
  background: #dbeafe;
}

.store-card-btn.btn-edit {
  background: #fff7ed;
  color: #ea580c;
  border-color: #fed7aa;
}

.store-card-btn.btn-edit:hover {
  background: #ffedd5;
}

.store-card-btn.btn-delete {
  background: #fef2f2;
  color: #ef4444;
  border-color: #fecaca;
}

.store-card-btn.btn-delete:hover {
  background: #fee2e2;
}

.store-card-btn.btn-switch {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
}

.store-card-btn.btn-switch:hover {
  background: #dcfce7;
}

/* Store Edit Modal */
.store-edit-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10002;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.store-edit-modal.show {
  display: flex;
  animation: modal-fadein 0.3s ease;
}

.store-edit-modal-content {
  background: white;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px 30px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
  animation: modal-slidein 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modal-fadein {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modal-slidein {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.store-edit-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.store-edit-modal-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.store-edit-modal-header .btn-close-modal {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
}

.store-edit-form .form-group {
  margin-bottom: 14px;
}

.store-edit-form .form-group label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 4px;
}

.store-edit-form input {
  height: 42px;
  font-size: 0.85rem;
  padding: 10px 14px;
}

.store-edit-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.store-edit-form .maps-preview {
  margin-top: 10px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.store-edit-form .maps-preview iframe {
  width: 100%;
  height: 180px;
  border: none;
}

.store-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid #dbeafe;
}

/* Add store form enhanced address fields */
.add-store-address-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.add-store-address-grid input {
  height: 38px;
  font-size: 0.8rem;
  padding: 8px 12px;
}

/* Table Action Navigation (Mimics Bottom Nav & Device Sync) */
.table-action-nav {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  gap: 1px !important;
  background: white !important;
  padding: 8px 3px !important;
  margin: 12px 0 !important;
  border: 1px solid #f1f5f9 !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
  width: 100% !important;
  overflow: hidden !important;
}

.table-action-nav>div,
.table-action-nav>label {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  color: #64748b !important;
  cursor: pointer !important;
  flex: 1 1 0% !important;
  min-width: 0 !important;
  transition: all 0.2s ease !important;
  padding: 4px 0 !important;
}

.table-action-nav>div:active,
.table-action-nav>label:active {
  transform: scale(0.9) !important;
  opacity: 0.6 !important;
}

.table-action-nav .material-icons {
  font-size: 19px !important;
}

.table-action-nav span:not(.material-icons) {
  font-size: 0.5rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: -0.01em !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  width: 100% !important;
  text-align: center !important;
}

@media screen and (min-width: 480px) {
  .table-action-nav .material-icons {
    font-size: 22px !important;
  }

  .table-action-nav span:not(.material-icons) {
    font-size: 0.6rem !important;
  }
}

/* Switch Toggle Styles */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked+.slider {
  background: var(--primary-gradient);
}

input:checked+.slider:before {
  transform: translateX(22px);
}

/* Role-based Table Action Nav Colors */
.table-action-nav.nav-pedagang {
  background: #eff6ff !important;
  border-color: #dbeafe !important;
}

.table-action-nav.nav-pemilik_toko {
  background: #fffbeb !important;
  border-color: #fef3c7 !important;
}

/* Role-based Filter Action Bar Colors */
.filter-action-bar.nav-pedagang {
  background: #eff6ff !important;
  border-color: #dbeafe !important;
}

.filter-action-bar.nav-pemilik_toko {
  background: #fffbeb !important;
  border-color: #fef3c7 !important;
}

/* Category Selection styling */
.category-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-secondary);
}

.category-option .material-icons {
  font-size: 24px;
  margin-bottom: 4px;
}

.category-option span:not(.material-icons) {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.category-option:hover {
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.category-option.active {
  background: #eff6ff;
  border-color: var(--primary-color);
  color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
  transform: scale(1.05);
}

.category-option.active[data-value="makanan"] {
  background: #fdf2f8 !important;
  border-color: #db2777 !important;
  color: #db2777 !important;
}

.category-option.active[data-value="minuman"] {
  background: #ecfeff !important;
  border-color: #0891b2 !important;
  color: #0891b2 !important;
}

.category-option.active[data-value="lainnya"] {
  background: #f8fafc !important;
  border-color: #64748b !important;
  color: #64748b !important;
}