/* ============================
   QINCAY.COM - DESIGN SYSTEM v2.0
   BUMDes Platform Kerinci 2026
   Offline-First + Auth + CRUD
   ============================*/

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Brand Colors */
  --brand-primary: #16c784;
  --brand-dark: #0f4c35;
  --brand-mid: #0a7a53;
  --brand-light: #d1fae5;
  /* Neutrals */
  --bg-base: #0d1117;
  --bg-surface: #161b22;
  --bg-card: #1c2333;
  --bg-card-hover: #21293a;
  --border: #2d3748;
  --border-light: #3d4d63;
  /* Text */
  --text-primary: #f0f6fc;
  --text-secondary: #8b9cad;
  --text-muted: #586174;
  /* Status */
  --green: #16c784;
  --blue: #3b82f6;
  --orange: #f7931a;
  --red: #ef4444;
  --purple: #a855f7;
  /* Sidebar */
  --sidebar-w: 272px;
  /* Shadow */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 8px 32px rgba(22, 199, 132, 0.15);
  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  /* Transition */
  --t: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* ===== SIDEBAR – ENTERPRISE ACCORDION v4.0 ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--t);
  overflow: hidden;
  /* outer overflow hidden; inner div scrolls */
}

/* ── Sticky Header (brand + user) ── */
.sidebar-sticky-head {
  flex-shrink: 0;
  background: var(--bg-surface);
  z-index: 2;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 12px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--brand-primary);
  letter-spacing: -0.3px;
}

.brand-sub {
  font-size: 9.5px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin: 0 12px 12px;
  background: rgba(22, 199, 132, 0.06);
  border-radius: var(--r-md);
  border: 1px solid rgba(22, 199, 132, 0.18);
}

.user-avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-mid));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(22, 199, 132, 0.3);
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  font-size: 9.5px;
  font-weight: 600;
  background: rgba(22, 199, 132, 0.15);
  color: var(--brand-primary);
  padding: 1px 7px;
  border-radius: 20px;
  width: fit-content;
}

/* ── Scrollable Nav Body ── */
.sidebar-scroll-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 8px;
}

.sidebar-scroll-body::-webkit-scrollbar {
  width: 3px;
}

.sidebar-scroll-body::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-scroll-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* ── Nav Container ── */
.sidebar-nav {
  padding: 6px 0 4px;
}

/* ── Nav Group (Accordion Parent) ── */
.nav-group {
  margin: 1px 0;
}

.nav-group-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px 9px 12px;
  margin: 0 6px;
  width: calc(100% - 12px);
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: all 0.2s ease;
  position: relative;
}

.nav-group-trigger:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.nav-group-trigger[aria-expanded="true"] {
  color: var(--brand-primary);
  background: rgba(22, 199, 132, 0.07);
}

.nav-group-trigger[aria-expanded="true"] .nav-trigger-icon {
  filter: drop-shadow(0 0 6px rgba(22, 199, 132, 0.5));
}

.nav-trigger-left {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
}

.nav-trigger-icon {
  font-size: 15px;
  flex-shrink: 0;
  line-height: 1;
}

.nav-trigger-label {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-trigger-label-sm {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chevron rotation */
.nav-chevron {
  flex-shrink: 0;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-muted);
  margin-left: auto;
}

.nav-group-trigger[aria-expanded="true"] .nav-chevron {
  transform: rotate(90deg);
  color: var(--brand-primary);
}

/* Badge on trigger */
.nav-trigger-badge {
  background: var(--red);
  color: white;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 17px;
  text-align: center;
  flex-shrink: 0;
}

.nav-trigger-badge.new {
  background: var(--brand-primary);
  color: #0a2918;
}

/* ── Accordion Sub-menu (Level 2) ── */
.nav-sub {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.nav-sub.open {
  grid-template-rows: 1fr;
}

.nav-sub>* {
  overflow: hidden;
}

/* Sub-menu inner wrapper trick for grid animation */
.nav-sub {
  padding-left: 0;
}

.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 36px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  border-radius: var(--r-sm);
  margin: 1px 8px;
  transition: all 0.18s ease;
  position: relative;
}

.nav-sub-item:hover {
  background: var(--bg-card-hover);
  color: #16c784;
}

.nav-sub-item:hover .nav-sub-dot {
  background: var(--brand-primary);
  box-shadow: 0 0 6px rgba(22, 199, 132, 0.5);
}

.nav-sub-item.active {
  color: #16c784;
  font-weight: 700;
  background: rgba(22, 199, 132, 0.1);
}

.nav-sub-item.active .nav-sub-dot {
  background: var(--brand-primary);
  box-shadow: 0 0 8px rgba(22, 199, 132, 0.6);
  transform: scale(1.3);
}

.nav-sub-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-light);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.nav-sub-dot-parent {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
}

.nav-sub-dot-sm {
  width: 4px;
  height: 4px;
}

/* Hint tag */
.nav-sub-hint {
  margin-left: auto;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 5px;
  white-space: nowrap;
}

.nav-sub-badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  color: #0a2918;
  background: var(--brand-primary);
  padding: 1px 5px;
  border-radius: 5px;
  white-space: nowrap;
}

/* ── Level-3 Nested Groups ── */
.nav-group-nested {
  margin: 2px 0;
}

.nav-trigger-nested {
  padding: 7px 12px 7px 28px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.nav-trigger-nested:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.nav-trigger-nested[aria-expanded="true"] {
  color: var(--brand-primary);
  background: transparent;
}

.nav-sub-nested .nav-sub-item-deep {
  padding-left: 52px;
  font-size: 11.5px;
}

/* Green left border active indicator for open group */
.nav-group-trigger[aria-expanded="true"]::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 2.5px;
  background: var(--brand-primary);
  border-radius: 0 2px 2px 0;
}

/* ── Bottom Utility Links ── */
.nav-bottom-links {
  display: flex;
  gap: 4px;
  padding: 8px 10px 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.nav-bottom-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 4px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  transition: all var(--t);
  text-align: center;
}

.nav-bottom-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border);
}

.nav-bottom-item.active {
  color: var(--brand-primary);
  background: rgba(22, 199, 132, 0.1);
  border-color: rgba(22, 199, 132, 0.25);
}

/* ── Legacy nav-item compatibility ── */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  margin: 1px 8px;
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--t);
  position: relative;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(22, 199, 132, 0.18), rgba(22, 199, 132, 0.08));
  color: var(--brand-primary);
  border: 1px solid rgba(22, 199, 132, 0.25);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.nav-badge.new {
  background: var(--brand-primary);
}

/* ── Sync Status Footer ── */
.sidebar-sync {
  flex-shrink: 0;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.sync-dot.online {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}

.sync-dot.offline {
  background: var(--orange);
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.sync-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(22, 199, 132, 0.1);
  border: 1px solid rgba(22, 199, 132, 0.3);
  color: var(--brand-primary);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--t);
}

.sync-btn:hover {
  background: rgba(22, 199, 132, 0.2);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== TOP BAR ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--text-secondary);
}

.topbar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.offline-badge {
  display: none;
  align-items: center;
  gap: 5px;
  background: rgba(247, 147, 26, 0.15);
  border: 1px solid rgba(247, 147, 26, 0.4);
  color: var(--orange);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.offline-badge.visible {
  display: flex;
}

.notif-btn {
  position: relative;
  background: transparent;
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t);
}

.notif-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.notif-count {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--red);
  color: white;
  font-size: 9px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.role-switcher select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: inherit;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  outline: none;
}

/* Notifications Panel */
.notifications-panel {
  position: fixed;
  top: 60px;
  right: 20px;
  z-index: 200;
  width: 340px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notifications-panel.open {
  display: flex;
}

.notif-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 14px;
}

.notif-header button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
}

.notif-list {
  max-height: 400px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t);
  cursor: pointer;
}

.notif-item:hover {
  background: var(--bg-card);
}

.notif-item.unread {
  background: rgba(22, 199, 132, 0.04);
}

.notif-item div strong {
  font-size: 13px;
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

.notif-item div p {
  font-size: 12px;
  color: var(--text-secondary);
}

.notif-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.notif-icon.green {
  background: rgba(22, 199, 132, 0.15);
  color: var(--green);
}

.notif-icon.blue {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue);
}

.notif-icon.orange {
  background: rgba(247, 147, 26, 0.15);
  color: var(--orange);
}

.notif-icon.purple {
  background: rgba(168, 85, 247, 0.15);
  color: var(--purple);
}

.notif-icon.red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
}

.notif-time {
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== PAGES ===== */
.page {
  display: none;
  padding: 28px;
  flex: 1;
  animation: fadeIn 0.3s ease;
}

/* Legacy: .page.active shows a page */
.page.active {
  display: block;
}

/* SPA v4.1: .page-content pages are hidden via .d-none, NOT via .page {display:none} */
/* When .d-none is removed by MapsTo(), the page becomes visible */
.page.page-content {
  /* Reset: do not rely on .page's display:none — use d-none class instead */
  display: block;
}

/* d-none MUST win over .page.page-content display:block */
.page.page-content.d-none {
  display: none !important;
}

/* Also hide .page-content that don't have .active when first loaded */
.page-content:not(.active):not(.d-none) {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--brand-primary);
  color: #0a2918;
  border-color: var(--brand-primary);
}

.btn-primary:hover {
  background: #12a96e;
  box-shadow: 0 4px 16px rgba(22, 199, 132, 0.35);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}

.btn-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--t);
}

.btn-icon:hover {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

/* ===== KPI CARDS ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: all var(--t);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-primary), transparent);
  opacity: 0;
  transition: opacity var(--t);
}

.kpi-card:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.kpi-card:hover::before {
  opacity: 1;
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon.green {
  background: rgba(22, 199, 132, 0.15);
  color: var(--green);
}

.kpi-icon.blue {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue);
}

.kpi-icon.orange {
  background: rgba(247, 147, 26, 0.15);
  color: var(--orange);
}

.kpi-icon.purple {
  background: rgba(168, 85, 247, 0.15);
  color: var(--purple);
}

.kpi-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.kpi-change {
  font-size: 11px;
  font-weight: 600;
}

.kpi-change.positive {
  color: var(--green);
}

.kpi-change.negative {
  color: var(--red);
}

.kpi-sparkline {
  width: 60px;
  height: 36px;
  flex-shrink: 0;
}

/* ===== CHARTS ===== */
.charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.chart-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.green {
  background: var(--green);
}

.legend-dot.blue {
  background: var(--blue);
}

.donut-legend {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ===== BOTTOM ROW ===== */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.section-header h3 {
  font-size: 14px;
  font-weight: 700;
}

.see-all {
  font-size: 12px;
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 600;
}

.see-all:hover {
  text-decoration: underline;
}

.unit-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.unit-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  transition: all var(--t);
}

.unit-card:hover {
  border-color: var(--border-light);
}

.unit-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.unit-info {
  flex: 1;
}

.unit-name {
  font-size: 13px;
  font-weight: 600;
  display: block;
}

.unit-revenue {
  font-size: 15px;
  font-weight: 800;
  color: var(--brand-primary);
  display: block;
  margin: 2px 0;
}

.unit-bar {
  background: var(--border);
  border-radius: 4px;
  height: 4px;
  overflow: hidden;
}

.unit-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-mid));
  border-radius: 4px;
}

.recent-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
}

.transaction-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.txn-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.txn-item:last-child {
  border-bottom: none;
}

.txn-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.txn-icon.green {
  background: rgba(22, 199, 132, 0.15);
  color: var(--green);
}

.txn-icon.red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
}

.txn-icon.orange {
  background: rgba(247, 147, 26, 0.15);
  color: var(--orange);
}

.txn-info {
  flex: 1;
}

.txn-info strong {
  font-size: 13px;
  font-weight: 600;
  display: block;
}

.txn-info span {
  font-size: 11px;
  color: var(--text-muted);
}

.txn-amount {
  font-size: 13px;
  font-weight: 700;
}

.txn-amount.positive {
  color: var(--green);
}

.txn-amount.negative {
  color: var(--red);
}

.txn-amount.pending {
  color: var(--orange);
}

.offline-tag {
  background: rgba(247, 147, 26, 0.2);
  color: var(--orange);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-left: 4px;
}

.txn-item.offline {
  opacity: 0.8;
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ===== SEARCH BAR ===== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 16px;
  margin-bottom: 20px;
  transition: border-color var(--t);
}

.search-bar:focus-within {
  border-color: var(--brand-primary);
}

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ===== PRODUCT GRID ===== */
/* ===== LOGIN OVERLAY ===== */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-overlay.active {
  display: flex;
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 36px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7);
  animation: loginIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  position: relative;
}

@keyframes loginIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-card.shake {
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes shake {

  10%,
  90% {
    transform: translateX(-3px);
  }

  20%,
  80% {
    transform: translateX(6px);
  }

  30%,
  50%,
  70% {
    transform: translateX(-6px);
  }

  40%,
  60% {
    transform: translateX(6px);
  }
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.login-brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--brand-primary);
}

.login-brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.login-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}

.login-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.login-offline-note {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(247, 147, 26, 0.1);
  border: 1px solid rgba(247, 147, 26, 0.3);
  color: var(--orange);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  margin-bottom: 16px;
}

.login-error {
  color: var(--red);
  font-size: 12px;
  font-weight: 600;
  min-height: 18px;
  margin: 8px 0;
}

.login-btn {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  margin-top: 4px;
  border-radius: var(--r-md);
}

.pass-toggle {
  position: absolute;
  right: 12px;
  bottom: 10px;
  cursor: pointer;
  font-size: 16px;
  user-select: none;
  opacity: 0.6;
}

.pass-toggle:hover {
  opacity: 1;
}

.demo-accounts {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.demo-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 10px;
}

.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.demo-btn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  transition: all var(--t);
}

.demo-btn:hover {
  border-color: var(--brand-primary);
  background: rgba(22, 199, 132, 0.06);
}

.demo-role {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-primary);
}

.demo-email {
  font-size: 10px;
  color: var(--text-muted);
}

.demo-pass-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
  text-align: center;
}

.demo-pass-hint code {
  background: var(--bg-card);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--brand-primary);
  font-size: 12px;
}

/* ===== LOGOUT BUTTON ===== */
.logout-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--t);
}

.logout-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ===== SYNC INDICATORS ===== */
.sync-indicator {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.sync-indicator.synced {
  background: rgba(22, 199, 132, 0.15);
  color: var(--green);
}

.sync-indicator.pending {
  background: rgba(247, 147, 26, 0.15);
  color: var(--orange);
}

.sync-indicator.failed {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
}

.sync-badge-float {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
}

.sync-badge-float.pending {
  background: rgba(247, 147, 26, 0.85);
  color: white;
}

.sync-badge-float.synced {
  background: rgba(22, 199, 132, 0.85);
  color: white;
}

/* ===== PRODUCT ACTIONS ===== */
.product-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  align-items: center;
}

.btn-edit {
  color: var(--blue) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}

.btn-edit:hover {
  background: rgba(59, 130, 246, 0.1) !important;
  border-color: var(--blue) !important;
}

.btn-delete {
  color: var(--red) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

.btn-delete:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: var(--red) !important;
}

/* Audit trail on products */
.audit-trail {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.4;
}

.audit-trail em {
  font-style: normal;
  color: var(--text-secondary);
}

.audit-trail strong {
  color: var(--brand-primary);
}

/* ===== FINANCE TABLE EXTRAS ===== */
.num-cell {
  font-variant-numeric: tabular-nums;
}

.audit-cell {
  font-size: 11px;
  color: var(--text-muted);
}

.action-cell {
  white-space: nowrap;
}

.action-cell .btn-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
}

.legend-inline {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Edit transaction preview */
.edit-txn-preview {
  margin-top: 8px;
  padding: 12px 16px;
  background: rgba(22, 199, 132, 0.08);
  border: 1px solid rgba(22, 199, 132, 0.25);
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  transition: color 0.3s;
}

.sak-note {
  margin-top: 8px;
  padding: 10px 14px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Offline hint in modals */
.offline-hint {
  display: none;
  background: rgba(247, 147, 26, 0.1);
  border: 1px solid rgba(247, 147, 26, 0.3);
  color: var(--orange);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  margin-top: 4px;
}

/* Modal desc */
.modal-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===== PRODUCT GRID ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--t);
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--brand-primary);
}

.product-img {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  background: linear-gradient(135deg, var(--bg-card-hover), var(--border));
}

.product-body {
  padding: 14px;
}

.product-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.product-seller {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.product-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--brand-primary);
}

.product-stock {
  font-size: 11px;
  color: var(--text-muted);
}

.product-cat {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.cat-pertanian {
  background: rgba(22, 199, 132, 0.15);
  color: var(--green);
}

.cat-kb {
  background: rgba(247, 147, 26, 0.15);
  color: var(--orange);
}

.cat-wisata {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue);
}

.cat-jasa {
  background: rgba(168, 85, 247, 0.15);
  color: var(--purple);
}

/* ===== LOGISTICS ===== */
.logistics-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 16px;
}

.logistics-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.delivery-list {
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.delivery-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t);
}

.delivery-item:hover {
  background: var(--bg-card-hover);
}

.delivery-item:last-child {
  border-bottom: none;
}

.delivery-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--orange);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.delivery-info {
  flex: 1;
}

.delivery-id {
  font-size: 13px;
  font-weight: 600;
}

.delivery-route {
  font-size: 11px;
  color: var(--text-secondary);
}

.delivery-status {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
}

.ds-pickup {
  background: rgba(247, 147, 26, 0.15);
  color: var(--orange);
}

.ds-transit {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue);
}

.ds-delivered {
  background: rgba(22, 199, 132, 0.15);
  color: var(--green);
}

.calc-form {
  padding: 16px 20px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-base);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color var(--t);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--brand-primary);
}

.calc-result {
  margin-top: 16px;
  padding: 14px;
  background: rgba(22, 199, 132, 0.08);
  border: 1px solid rgba(22, 199, 132, 0.25);
  border-radius: var(--r-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calc-result.large {
  font-size: 16px;
}

.calc-label {
  font-size: 13px;
  font-weight: 600;
}

.calc-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--brand-primary);
}

.map-card .map-container {
  height: 420px;
}

.map-placeholder {
  width: 100%;
  height: 100%;
  position: relative;
}

.map-svg-container {
  width: 100%;
  height: 100%;
}

.map-svg {
  width: 100%;
  height: 100%;
}

.map-overlay-info {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
}

.map-stat {
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
}

/* ===== FINANCE ===== */
.finance-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.finance-summary-card {
  padding: 20px;
  border-radius: var(--r-lg);
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.finance-summary-card.income {
  background: rgba(22, 199, 132, 0.08);
  border-color: rgba(22, 199, 132, 0.25);
}

.finance-summary-card.expense {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
}

.finance-summary-card.profit {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.25);
}

.fs-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fs-value {
  font-size: 24px;
  font-weight: 800;
}

.finance-summary-card.income .fs-value {
  color: var(--green);
}

.finance-summary-card.expense .fs-value {
  color: var(--red);
}

.finance-summary-card.profit .fs-value {
  color: var(--blue);
}

.fs-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.select-period {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  outline: none;
  cursor: pointer;
}

.finance-table {
  width: 100%;
  border-collapse: collapse;
}

.finance-table th {
  padding: 10px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-base);
}

.finance-table td {
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.finance-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.finance-table tfoot .total-row td {
  font-weight: 800;
  font-size: 14px;
  border-top: 2px solid var(--brand-primary);
  border-bottom: none;
}

.profit-cell {
  color: var(--green);
  font-weight: 700;
}

.unit-badge {
  font-size: 13px;
  font-weight: 600;
}

.margin-bar {
  background: var(--border);
  border-radius: 4px;
  height: 20px;
  overflow: hidden;
}

.margin-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-mid));
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--bg-base);
}

.status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
}

.status-badge.active {
  background: rgba(22, 199, 132, 0.15);
  color: var(--green);
}

/* ===== EDUCATION ===== */
.edu-progress-banner {
  background: linear-gradient(135deg, rgba(22, 199, 132, 0.15), rgba(22, 199, 132, 0.05));
  border: 1px solid rgba(22, 199, 132, 0.25);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.edu-progress-title {
  font-size: 15px;
  font-weight: 700;
}

.edu-progress-pct {
  font-size: 22px;
  font-weight: 800;
  color: var(--brand-primary);
}

.progress-bar-full {
  background: var(--border);
  border-radius: 6px;
  height: 8px;
}

.progress-fill-full {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-primary), #12a96e);
  border-radius: 6px;
  transition: width 1s ease;
}

.edu-progress-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
  display: block;
}

.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--t);
}

.edu-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.edu-thumb {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  position: relative;
}

.edu-type-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
}

.type-video {
  background: rgba(239, 68, 68, 0.8);
  color: white;
}

.type-pdf {
  background: rgba(59, 130, 246, 0.8);
  color: white;
}

.type-quiz {
  background: rgba(168, 85, 247, 0.8);
  color: white;
}

.edu-body {
  padding: 14px;
}

.edu-cat {
  font-size: 10px;
  font-weight: 700;
  color: var(--brand-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.edu-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.edu-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.edu-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.edu-duration {
  font-size: 11px;
  color: var(--text-muted);
}

.edu-progress-bar {
  background: var(--border);
  border-radius: 3px;
  height: 3px;
  margin-bottom: 10px;
  overflow: hidden;
}

.edu-progress-fill {
  height: 100%;
  background: var(--brand-primary);
  border-radius: 3px;
}

.btn-edu {
  width: 100%;
  padding: 8px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--t);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.btn-edu-primary {
  background: var(--brand-primary);
  color: var(--bg-base);
}

.btn-edu-primary:hover {
  background: #12a96e;
}

.btn-edu-continue {
  background: rgba(22, 199, 132, 0.1);
  color: var(--brand-primary);
  border-color: rgba(22, 199, 132, 0.3);
}

.btn-edu-continue:hover {
  background: rgba(22, 199, 132, 0.2);
}

/* ===== CONSULTATION ===== */
.consultation-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  height: calc(100vh - 200px);
}

.mentors-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow-y: auto;
}

.panel-title {
  padding: 16px;
  font-size: 14px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}

.mentor-list {
  display: flex;
  flex-direction: column;
}

.mentor-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--t);
}

.mentor-item:hover,
.mentor-item.active {
  background: rgba(22, 199, 132, 0.08);
}

.mentor-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mentor-name {
  font-size: 13px;
  font-weight: 600;
  display: block;
}

.mentor-field {
  font-size: 11px;
  color: var(--text-secondary);
}

.mentor-online {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: auto;
  flex-shrink: 0;
}

.mentor-online.on {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.mentor-online.off {
  background: var(--text-muted);
}

.chat-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-with {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-name {
  font-size: 14px;
  font-weight: 700;
  display: block;
}

.chat-status {
  font-size: 11px;
}

.chat-status.online {
  color: var(--green);
}

.chat-actions {
  display: flex;
  gap: 6px;
}

.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: var(--r-md);
  position: relative;
}

.mentor-bubble {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.user-bubble {
  background: linear-gradient(135deg, rgba(22, 199, 132, 0.2), rgba(22, 199, 132, 0.1));
  border: 1px solid rgba(22, 199, 132, 0.3);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

.chat-bubble p {
  font-size: 13px;
  line-height: 1.5;
}

.bubble-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.file-bubble {
  display: flex;
  align-items: center;
  gap: 8px;
}

.file-bubble .btn-sm {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--blue);
  margin-left: auto;
}

.chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}

.chat-input-area input {
  flex: 1;
  background: var(--bg-base);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 20px;
  outline: none;
  transition: border-color var(--t);
}

.chat-input-area input:focus {
  border-color: var(--brand-primary);
}

.send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-base);
  transition: all var(--t);
}

.send-btn:hover {
  transform: scale(1.08);
  background: #12a96e;
}

/* ===== ANALYTICS ===== */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.analytics-card.wide {
  grid-column: 1 / -1;
}

.geo-list {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.geo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.geo-name {
  font-size: 13px;
  font-weight: 600;
}

.geo-bar-wrap {
  flex: 1;
  margin: 0 12px;
  background: var(--border);
  border-radius: 4px;
  height: 6px;
}

.geo-bar {
  height: 100%;
  background: var(--brand-primary);
  border-radius: 4px;
}

.geo-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-primary);
  width: 36px;
  text-align: right;
}

/* ===== SETTINGS ===== */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.settings-form {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.setting-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.setting-toggle span {
  font-size: 13px;
  font-weight: 600;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--t);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--t);
}

.toggle input:checked+.toggle-slider {
  background: var(--brand-primary);
}

.toggle input:checked+.toggle-slider::before {
  transform: translateX(20px);
}

.sync-info-card {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: none;
}

.modal-overlay.open {
  display: block;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 310;
  width: 90%;
  max-width: 500px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  display: none;
  flex-direction: column;
  animation: modalIn 0.25s ease forwards;
}

@keyframes modalIn {
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.modal.open {
  display: flex;
}

.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 800;
}

.modal-header button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 400;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-card);
  display: none;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.show {
  display: flex;
}

.toast.success {
  border-color: rgba(22, 199, 132, 0.4);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.4);
}

/* ===== SPA ROUTING UTILITIES (v4.1) ===== */

/* Hard hide — used by MapsTo() engine */
.d-none {
  display: none !important;
}

/* Every routable section gets this class for animation */
.page-content {
  animation: spaFadeIn 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes spaFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Override: page-content takes precedence over the old .page display:none */
.page.page-content:not(.d-none) {
  display: block;
}

/* ── Placeholder Module Card ── */
.placeholder-module {
  margin: 0 auto;
  max-width: 640px;
  border: 1px dashed var(--border-light);
  border-radius: var(--r-xl);
  padding: 60px 40px;
  text-align: center;
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
}

.placeholder-module::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(22, 199, 132, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.placeholder-icon {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 20px;
  display: block;
  filter: drop-shadow(0 0 20px var(--p-color, rgba(22, 199, 132, 0.4)));
  animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.placeholder-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(22, 199, 132, 0.1);
  border: 1px solid rgba(22, 199, 132, 0.3);
  color: var(--brand-primary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 18px;
}

.placeholder-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-primary);
  animation: pulse 2s infinite;
}

.placeholder-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.placeholder-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 400px;
  margin: 0 auto 28px;
}

.placeholder-progress {
  background: var(--bg-base);
  border-radius: 20px;
  height: 6px;
  overflow: hidden;
  margin: 0 auto 8px;
  max-width: 280px;
}

.placeholder-progress-fill {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--brand-primary), #0a8f5a);
  animation: progressPulse 2s ease-in-out infinite alternate;
}

@keyframes progressPulse {
  from {
    opacity: 0.6;
    width: 30% !important;
  }

  to {
    opacity: 1;
    width: 72% !important;
  }
}

.placeholder-eta {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.placeholder-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 28px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-row {
    grid-template-columns: 1fr;
  }

  .bottom-row {
    grid-template-columns: 1fr;
  }

  .logistics-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .menu-toggle {
    display: flex;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .finance-summary {
    grid-template-columns: 1fr;
  }

  .consultation-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .page {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }
}

/* ════════════════════════════════════════════════
   EDUCATION MODULE — VIDEO IFRAME STYLES
   ════════════════════════════════════════════════ */

/* Thumbnail container untuk tipe video (iframe embed) */
.edu-thumb-video {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-md) var(--r-md) 0 0;
  background: var(--bg-base);
  min-height: 170px;
}

/* Pastikan badge tipe tidak tertutup iframe */
.edu-thumb-video .edu-type-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

/* Modal Video — lebih lebar untuk menonton konten */
.modal.modal-video {
  width: min(860px, 95vw);
  max-width: 95vw;
  max-height: 90vh;
  overflow: hidden;
}

/* Wrapper responsif 16:9 untuk iframe di modal */
.video-iframe-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  /* Rasio 16:9 */
  height: 0;
  overflow: hidden;
  background: #000;
}

.video-iframe-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Preview URL di form Tambah Materi */
#matUrlPreview code {
  font-family: 'Courier New', monospace;
  background: var(--bg-base);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: block;
  margin-top: 4px;
  word-break: break-all;
}

/* ── Iframe Access Warning ── */
.iframe-access-note {
  margin-top: 16px;
  padding: 10px 14px;
  background: rgba(247, 147, 26, 0.08);
  border: 1px solid rgba(247, 147, 26, 0.3);
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.iframe-access-note strong,
.iframe-modal-note strong {
  color: var(--orange);
}

.iframe-access-note em,
.iframe-modal-note em {
  color: var(--text-primary);
  font-style: normal;
  font-weight: 600;
}

/* ── Iframe Note inside Modal ── */
.iframe-modal-note {
  padding: 10px 16px;
  background: rgba(247, 147, 26, 0.07);
  border-top: 1px solid rgba(247, 147, 26, 0.2);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ════════════════════════════════════════════════
   KATALOG PRODUK & VARIAN (v4.3)
   ════════════════════════════════════════════════ */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.katalog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--t);
  position: relative;
  overflow: hidden;
}

.katalog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(22, 199, 132, 0.3);
}

.katalog-icon {
  font-size: 42px;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--r-sm);
  margin-bottom: 8px;
}

.katalog-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.katalog-cat {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  width: fit-content;
  text-transform: uppercase;
}

.katalog-cat.cat-pertanian {
  background: rgba(22, 199, 132, 0.15);
  color: #16c784;
}

.katalog-cat.cat-kopi {
  background: rgba(247, 147, 26, 0.15);
  color: #f7931a;
}

.katalog-cat.cat-wisata {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.katalog-cat.cat-jasa {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.katalog-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.katalog-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-primary);
}

.katalog-price small {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.katalog-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: auto;
}

.katalog-rating {
  color: var(--orange);
}

.katalog-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.katalog-actions .btn {
  flex: 1;
  padding: 8px;
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  border-radius: var(--r-sm);
}

.katalog-actions .edit-btn {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.katalog-actions .edit-btn:hover {
  background: #3b82f6;
  color: #fff;
}

.katalog-actions .delete-btn {
  background: rgba(239, 68, 68, 0.05);
  color: #ef4444;
  border: 1px solid #ef4444;
}

.katalog-actions .delete-btn:hover {
  background: #ef4444;
  color: #fff;
}

/* ════════════════════════════════════════════════
   POINT OF SALES (POS)
   ════════════════════════════════════════════════ */
.pos-layout {
  display: flex;
  gap: 20px;
  height: calc(100vh - 160px);
  overflow: hidden;
}

.pos-products {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#posProductGrid {
  flex: 1;
  overflow-y: auto;
  padding-right: 5px;
}

.pos-cart {
  width: 340px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.cart-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(22, 199, 132, 0.05);
}

.cart-header h3 {
  margin: 0;
  font-size: 15px;
}

.cart-count {
  font-size: 12px;
  background: var(--brand-primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: bold;
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}

.cart-item-info {
  display: flex;
  justify-content: space-between;
}

.cart-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.cart-item-price {
  font-size: 13px;
  font-weight: bold;
  color: var(--brand-primary);
}

.cart-item-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qty-control {
  display: flex;
  align-items: center;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.qty-btn {
  background: transparent;
  border: none;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
}

.qty-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.qty-input {
  width: 30px;
  text-align: center;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
}

.cart-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.1);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  margin-bottom: 8px;
}

.cart-total-row span {
  font-size: 14px;
  color: var(--text-secondary);
}

.cart-total-row strong {
  color: var(--brand-primary);
}

.d-none {
  display: none !important;
}

.page-content,
.page-section {
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ════════════════════════════════════════════════
   DYNAMIC CATALOG (V4.3)
   ════════════════════════════════════════════════ */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.katalog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.katalog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
  border-color: rgba(22, 199, 132, 0.3);
}

.katalog-icon {
  font-size: 40px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  background: var(--bg-surface);
}

.katalog-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.katalog-cat {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  width: fit-content;
  margin-bottom: 8px;
}

.katalog-cat.cat-pertanian {
  background: rgba(22, 199, 132, 0.15);
  color: #16c784;
}

.katalog-cat.cat-wisata {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.katalog-cat.cat-jasa {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.katalog-cat.cat-kopi {
  background: rgba(247, 147, 26, 0.15);
  color: #f7931a;
}

.katalog-name {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: var(--text-primary);
}

.katalog-price {
  font-size: 16px;
  color: #16c784;
  font-weight: 800;
  margin-bottom: auto;
}

.katalog-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.katalog-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.katalog-actions .btn {
  flex: 1;
  padding: 8px;
  font-size: 13px;
}

/* Edit button format */
.katalog-actions .edit-btn {
  background-color: #3b82f6 !important;
  border-color: #3b82f6 !important;
  color: white !important;
}

.katalog-actions .edit-btn:hover {
  background-color: #2563eb !important;
}

/* Delete button format */
.katalog-actions .delete-btn {
  background-color: transparent !important;
  border-color: #ef4444 !important;
  color: #ef4444 !important;
}

.katalog-actions .delete-btn:hover {
  background-color: rgba(239, 68, 68, 0.1) !important;
}
/* GOJEK-STYLE MAPS CSS */
@keyframes gojekPulse {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(2.5); opacity: 0; }
}
.gojek-pulse-ring {
  position: absolute;
  width: 36px; height: 36px;
  background: #00AA13;
  border-radius: 50%;
  animation: gojekPulse 1.5s ease-out infinite;
  z-index: -1;
  top: 0; left: 0;
}
.gojek-icon-container {
  position: relative;
  width: 36px; height: 36px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #00AA13;
  z-index: 10;
}
.gojek-icon-gudang { border-color: #a855f7; }
.gojek-icon-pembeli { border-color: #f7931a; }

/* ═══════════════════════════════════════════════════════════════
   RIDE-HAILING UI v4.36 — FULLSCREEN MAP + BOTTOM SHEET
   ═══════════════════════════════════════════════════════════════ */

/* ── Wrapper: mengambil seluruh ruang halaman tracking ── */
.tracking-page-wrapper {
  position: relative;
  /* Tinggi = viewport dikurangi topbar (~56px) */
  height: calc(100vh - 56px);
  overflow: hidden;
  background: #0d1117;
}

/* Jika section page-tracking aktif, hilangkan padding default page-content */
#page-tracking.active {
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

/* ── FULLSCREEN MAP ── */
#real-map-container {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  border-radius: 0 !important;
  display: block !important;
}

/* ── BOTTOM SHEET ── */
.bottom-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: 70vh;
  background: var(--bg-surface, #161b22);
  border-radius: 20px 20px 0 0;
  z-index: 1000;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.45), 0 -1px 0 rgba(255,255,255,0.06);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  /* Tinggi collapsed = 80px agar header terlihat */
  --bs-collapsed-offset: calc(100% - 80px);
}

/* State: collapsed (hanya header terlihat) */
.bottom-sheet--collapsed {
  transform: translateY(var(--bs-collapsed-offset));
}

/* State: expanded (terbuka penuh) */
.bottom-sheet--expanded {
  transform: translateY(0);
}

/* ── Header Bottom Sheet ── */
.bottom-sheet-header {
  flex-shrink: 0;
  cursor: pointer;
  padding: 0 16px 12px;
  user-select: none;
  -webkit-user-select: none;
}

.bottom-sheet-header:hover .bottom-sheet-drag-handle {
  background: var(--brand-primary);
  width: 48px;
}

/* Drag Handle (garis abu di atas header) */
.bottom-sheet-drag-handle {
  width: 36px;
  height: 4px;
  background: var(--border-light, #3d4d63);
  border-radius: 2px;
  margin: 10px auto 12px;
  transition: all 0.2s ease;
}

/* Header content: judul + tombol */
.bottom-sheet-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

/* Tombol Toggle */
.bottom-sheet-toggle-btn {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-mid));
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(22,199,132,0.3);
  flex-shrink: 0;
}

.bottom-sheet-toggle-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(22,199,132,0.45);
}

/* Tanda panah saat expanded */
.bottom-sheet--expanded .bottom-sheet-toggle-btn {
  background: linear-gradient(135deg, #586174, #3d4d63);
  box-shadow: none;
}

/* ── Body Bottom Sheet (scrollable) ── */
.bottom-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px 24px;
  overscroll-behavior: contain;
}

.bottom-sheet-body::-webkit-scrollbar {
  width: 4px;
}
.bottom-sheet-body::-webkit-scrollbar-track {
  background: transparent;
}
.bottom-sheet-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* ── FLOATING ACTIVE TASK CARD ── */
.active-task-card {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  min-width: 280px;
  max-width: 360px;
  background: rgba(22, 27, 34, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(22, 199, 132, 0.35);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(22,199,132,0.1);
  animation: slideDownCard 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideDownCard {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.active-task-card .atc-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.active-task-card .atc-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-primary);
  box-shadow: 0 0 8px var(--brand-primary);
  animation: pulse 1.5s ease infinite;
  flex-shrink: 0;
}

.active-task-card .atc-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-primary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.active-task-card .atc-order-id {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.active-task-card .atc-dest {
  font-size: 12px;
  color: var(--text-secondary);
}

.active-task-card .atc-action {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

/* ── OVERLAY CONTROLS (Admin/Manajer, mengambang di atas peta) ── */
.tracking-header-overlay {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 500;
  background: rgba(22,27,34,0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  max-width: 320px;
  pointer-events: none;
}

.tracking-controls-overlay {
  position: absolute;
  top: 60px;
  left: 14px;
  z-index: 500;
  background: rgba(22,27,34,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 300px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}

.tracking-controls-overlay select,
.tracking-controls-overlay input[type="number"] {
  background: var(--bg-card, #1c2333);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-family: inherit;
  width: 100%;
}

.tracking-controls-overlay button {
  background: #10b981;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease;
}

.tracking-controls-overlay button:hover {
  background: #059669;
}

#smart-eta-display {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
}

/* ── RESPONSIVE: mobile ── */
@media (max-width: 768px) {
  .tracking-page-wrapper {
    height: calc(100vh - 56px);
  }
  .active-task-card {
    min-width: 240px;
    top: 10px;
  }
  .bottom-sheet {
    max-height: 80vh;
  }
}

/* ===== BUYER ORDERS DASHBOARD ===== */
#buyerOrdersOverlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2000;
  display: none; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(4px);
}
#buyerOrdersOverlay.open { display: flex; animation: slideUp 0.3s ease; }
@keyframes slideUp { from{transform:translateY(100%)} to{transform:translateY(0)} }
#buyerOrdersPanel {
  background: var(--bg-base); width: 100%; max-width: 600px; max-height: 85vh;
  border-radius: 20px 20px 0 0; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
}
.bo-header {
  padding: 20px; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border); background: var(--bg-card);
}
.bo-title { font-size: 18px; font-weight: 800; }
.bo-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); }

/* Tabs */
.bo-tabs {
  display: flex; background: var(--bg-card); padding: 10px 20px 0; gap: 15px; border-bottom: 1px solid var(--border);
}
.bo-tab {
  padding: 10px 15px; background: none; border: none; font-size: 14px; font-weight: 600; cursor: pointer;
  color: var(--text-muted); border-bottom: 3px solid transparent; transition: all var(--t);
}
.bo-tab:hover { color: var(--text-primary); }
.bo-tab.active {
  color: var(--brand-primary); border-bottom-color: var(--brand-primary);
}

.bo-body { padding: 20px; overflow-y: auto; background: #f8fafc; flex: 1; }

.bo-empty { text-align: center; padding: 40px 20px; color: var(--text-secondary); }

/* Modern Card UI */
.bo-card {
  background: white; border-radius: 16px; padding: 20px; margin-bottom: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03); border: 1px solid rgba(0,0,0,0.05);
}
.bo-card-header {
  display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px;
}
.bo-order-id-wrap { display: flex; flex-direction: column; gap: 4px; }
.bo-order-label { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.bo-order-id { font-size: 14px; font-weight: 800; color: var(--brand-primary); cursor: pointer; display: flex; align-items: center; gap: 6px; }
.bo-date { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* Stepper Timeline */
.bo-stepper {
  display: flex; align-items: center; justify-content: space-between; margin: 20px 0; padding: 0 10px;
}
.bo-step {
  display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 2; position: relative;
  opacity: 0.4; filter: grayscale(1); transition: all 0.3s;
}
.bo-step.active { opacity: 1; filter: grayscale(0); }
.bo-step-icon {
  width: 32px; height: 32px; background: white; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); border: 2px solid var(--border);
}
.bo-step.active .bo-step-icon { border-color: var(--brand-primary); transform: scale(1.1); box-shadow: 0 0 12px rgba(22,199,132,0.3); }
.bo-step-label { font-size: 10px; font-weight: 700; color: var(--text-primary); text-align: center; }

.bo-step-line {
  flex: 1; height: 3px; background: var(--border); margin: -20px 10px 0; position: relative; z-index: 1;
}
.bo-step-line.active { background: var(--brand-primary); }

/* Blinking Courier Badge */
.bo-kurir-anim {
  background: rgba(247,147,26,0.1); border: 1px solid rgba(247,147,26,0.3); border-radius: 8px; padding: 10px 15px;
  font-size: 13px; color: var(--orange); display: flex; align-items: center; gap: 8px; margin-bottom: 15px; font-weight: 500;
  animation: pulseBg 2s infinite;
}
@keyframes pulseBg { 0%{box-shadow: 0 0 0 0 rgba(247,147,26,0.2)} 70%{box-shadow: 0 0 0 6px rgba(247,147,26,0)} 100%{box-shadow: 0 0 0 0 rgba(247,147,26,0)} }

/* Card Body */
.bo-card-body {
  background: #f8fafc; border-radius: 12px; padding: 15px; border: 1px dashed var(--border);
}
.bo-box-title { font-size: 11px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; margin-bottom: 10px; }
.bo-items-list { list-style: none; padding: 0; margin: 0 0 15px 0; font-size: 13px; color: var(--text-primary); }
.bo-items-list li { display: flex; justify-content: space-between; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid rgba(0,0,0,0.03); }
.bo-items-list li:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.bo-item-qty { font-weight: 600; color: var(--text-muted); }

.bo-summary-box { border-top: 1px dashed var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.bo-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-secondary); }
.bo-total-row { font-size: 15px; font-weight: 800; color: var(--text-primary); align-items: center; margin-top: 4px; }
.bo-total { color: var(--brand-primary); font-size: 18px; }

/* Proof Button */
.bo-card-footer { margin-top: 15px; display: flex; justify-content: flex-end; }
.bo-proof-btn {
  background: linear-gradient(135deg, var(--brand-primary), #12a96e); color: white; border: none; padding: 10px 20px;
  border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(22,199,132,0.3); display: flex; align-items: center; gap: 6px;
}
.bo-proof-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(22,199,132,0.4); }
