/* ==========================================================================
   GeoKurir Malang - Modern Dashboard Stylesheet
   Faithfully designed with POS IND Brand Identity (Navy & Orange)
   Colors extracted from official Logo: #1c2d5a (Navy) & #ef4123 (Orange)
   ========================================================================== */

:root {
  /* POS IND Brand Identity Palette */
  --pos-navy: #1c2d5a;
  --pos-navy-dark: #121e3d;
  --pos-navy-light: #2d4585;
  --pos-navy-subtle: #edf3fb;
  --pos-orange: #ef4123;
  --pos-orange-hover: #d83317;
  --pos-orange-subtle: #fef4f2;
  --pos-orange-border: #fcd5cf;

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-light: #edf2f7;
  --text-primary: #1c2d5a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --sidebar-bg: #ffffff;
  --sidebar-active: #edf3fb;
  --sidebar-active-text: #1c2d5a;

  --btn-primary-bg: #1c2d5a;
  --btn-primary-hover: #121e3d;
  --btn-primary-text: #ffffff;
  --btn-accent-bg: #ef4123;
  --btn-accent-hover: #d83317;
  --btn-accent-text: #ffffff;

  --btn-secondary-bg: #ffffff;
  --btn-secondary-border: #cbd5e1;
  --btn-secondary-text: #1c2d5a;

  --progress-track: #e2e8f0;
  --progress-fill: #ef4123;

  /* GIS Cluster Palette harmonious with POS IND */
  --cluster-1: #1c2d5a;  /* Pos Navy */
  --cluster-2: #ef4123;  /* Pos Orange */
  --cluster-3: #0284c7;  /* Ocean Blue */
  --cluster-4: #059669;  /* Emerald Green */
  --cluster-5: #7c3aed;  /* Royal Purple */

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 3px rgba(28, 45, 90, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(28, 45, 90, 0.08);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
}

/* --------------------------------------------------------------------------
   App Layout (Sidebar + Content)
   -------------------------------------------------------------------------- */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 245px;
  min-width: 245px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
}

.brand-logo-img {
  height: 34px;
  width: auto;
  object-fit: contain;
}

.brand-title {
  font-size: 17.5px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--pos-navy);
  white-space: nowrap;
}

.brand-title .brand-accent {
  color: var(--pos-orange);
}

.sidebar-nav {
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  border-left: 3px solid transparent;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.nav-item:hover {
  background-color: var(--pos-navy-subtle);
  color: var(--pos-navy);
}

.nav-item:hover svg {
  color: var(--pos-navy);
}

.nav-item.active {
  background-color: var(--pos-navy-subtle);
  color: var(--pos-navy);
  font-weight: 600;
  border-left-color: var(--pos-orange);
}

.nav-item.active svg {
  color: var(--pos-orange);
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top Navbar */
.top-navbar {
  height: 64px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.top-navbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.top-navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  transition: background-color 0.15s ease;
}

.user-profile-menu:hover {
  background-color: var(--pos-navy-subtle);
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--pos-navy-subtle);
  border: 1px solid #d5e2f5;
  color: var(--pos-navy);
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-avatar-circle svg {
  width: 18px;
  height: 18px;
}

.user-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--pos-navy);
}

.user-profile-menu svg.chevron-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

/* Content Container */
.content-body {
  padding: 24px 32px 48px;
  flex: 1;
}

.view-page {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.view-page.active {
  display: block;
}

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

/* Page Header */
.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--pos-navy);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.header-action-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.select-custom {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--pos-navy);
  cursor: pointer;
  min-width: 220px;
  outline: none;
  transition: all 0.15s ease;
}

.select-custom:focus {
  border-color: var(--pos-navy-light);
  box-shadow: 0 0 0 2px rgba(28, 45, 90, 0.1);
}

/* --------------------------------------------------------------------------
   Cards & Grids
   -------------------------------------------------------------------------- */
.dashboard-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.dashboard-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

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

.card-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
  margin-bottom: 14px;
}

/* KPI Summary Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.actual-kpi-grid,
.comparison-maps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.comparison-maps-grid > .dashboard-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.comparison-maps-grid .map-frame-box {
  margin-top: auto;
}

.comparison-maps-grid .map-legend-overlay {
  font-size: 10px;
  padding: 8px;
}

.comparison-note {
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.actual-baseline-panel[hidden] {
  display: none;
}

.actual-baseline-panel .metrics-row-grid {
  margin-top: 16px;
}

.distribution-tabs {
  display: flex;
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
}

.kpi-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--pos-navy);
}

.kpi-card:nth-child(2) {
  border-left-color: var(--pos-orange);
}

.kpi-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--pos-navy-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pos-navy);
  flex-shrink: 0;
}

.kpi-card:nth-child(2) .kpi-icon-wrap {
  background-color: var(--pos-orange-subtle);
  color: var(--pos-orange);
}

.kpi-icon-wrap svg {
  width: 22px;
  height: 22px;
}

.kpi-content {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--pos-navy);
}

/* Dual Column Layout (Maps & Tables) */
.dual-col-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

/* Map Containers */
.map-frame-box {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 380px;
  background-color: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.map-element {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Map Inset Legend (faithful to wireframe overlay) */
.map-legend-overlay {
  bottom: 20px;
  left: 12px;
  z-index: 999;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
  font-size: 11.5px;
  pointer-events: auto;
  max-width: 180px;
}

.map-legend-title {
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--pos-navy);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 4px;
}

.legend-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.legend-symbol {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-symbol.circle-dot {
  border-radius: 50%;
  background-color: var(--pos-navy);
  width: 8px;
  height: 8px;
  margin-left: 2px;
  margin-right: 2px;
}

.legend-symbol.line-dash {
  width: 14px;
  height: 2px;
  background-color: var(--pos-navy);
}

.legend-symbol.hub-home {
  display: flex;
  align-items: center;
  justify-content: center;
}

.legend-symbol.hub-home svg {
  width: 14px;
  height: 14px;
  color: var(--pos-orange);
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table-custom {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

.table-custom th,
.table-custom td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
}

.table-custom th {
  background-color: #f8fafc;
  font-weight: 600;
  color: var(--pos-navy);
}

.table-custom td {
  color: var(--text-secondary);
}

.table-custom tr:hover td {
  background-color: var(--pos-navy-subtle);
}

.table-custom tr.total-row td {
  font-weight: 700;
  color: var(--pos-navy);
  background-color: #f8fafc;
}

/* --------------------------------------------------------------------------
   Buttons & Inputs
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  border: none;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}

.btn-primary:hover {
  background-color: var(--btn-primary-hover);
  box-shadow: 0 2px 6px rgba(28, 45, 90, 0.25);
}

.btn-accent {
  background-color: var(--btn-accent-bg);
  color: var(--btn-accent-text);
}

.btn-accent:hover {
  background-color: var(--btn-accent-hover);
  box-shadow: 0 2px 6px rgba(239, 65, 35, 0.3);
}

.btn-secondary {
  background-color: var(--btn-secondary-bg);
  border: 1px solid var(--btn-secondary-border);
  color: var(--btn-secondary-text);
}

.btn-secondary:hover {
  background-color: var(--pos-navy-subtle);
  border-color: #94a3b8;
}

.btn-danger {
  background-color: #b91c1c;
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background-color: #991b1b;
}

.btn-danger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.delete-dataset-notice {
  padding: 14px 16px;
  margin-bottom: 20px;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  background: #fef2f2;
  color: #991b1b;
  font-size: 13px;
  line-height: 1.6;
}

.delete-dataset-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 14px;
}

#delete-dataset-status {
  margin-bottom: 12px;
}

.delete-dataset-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.delete-dataset-selection-hint {
  margin-bottom: 12px;
}

.delete-dataset-table .delete-dataset-checkbox-cell {
  width: 44px;
  text-align: center;
}

.delete-dataset-checkbox-cell input {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  accent-color: var(--pos-navy);
  cursor: pointer;
}

.delete-dataset-table td:nth-child(2) {
  min-width: 160px;
  overflow-wrap: anywhere;
}

.btn-pill-group {
  display: inline-flex;
  gap: 8px;
  background-color: transparent;
  margin-bottom: 16px;
}

.btn-tab {
  padding: 7px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.btn-tab.active {
  background-color: var(--pos-navy);
  color: #ffffff;
  border-color: var(--pos-navy);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(28, 45, 90, 0.2);
}

.input-text {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 7px 12px;
  font-size: 13px;
  outline: none;
  color: var(--pos-navy);
  transition: border-color 0.15s ease;
}

.input-text:focus {
  border-color: var(--pos-navy-light);
  box-shadow: 0 0 0 2px rgba(28, 45, 90, 0.1);
}

/* --------------------------------------------------------------------------
   Upload Page Specific Elements
   -------------------------------------------------------------------------- */
.template-card-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 24px;
  align-items: center;
}

.template-actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

/* Dropzone */
.upload-dropzone-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.dropzone-box {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background-color: #fcfdfe;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone-box:hover,
.dropzone-box.drag-over {
  border-color: var(--pos-orange);
  background-color: var(--pos-orange-subtle);
}

.dropzone-icon {
  width: 40px;
  height: 40px;
  color: var(--pos-navy);
}

.dropzone-text {
  font-size: 13px;
  color: var(--text-secondary);
}

.dropzone-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.selected-file-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
}

.selected-file-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.file-preview-pill {
  border: 1px solid var(--pos-orange-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background-color: var(--pos-orange-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.file-preview-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-preview-info svg {
  width: 24px;
  height: 24px;
  color: var(--pos-orange);
}

.file-name-text {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--pos-navy);
}

.file-meta-text {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-remove-file {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.btn-remove-file:hover {
  color: var(--pos-orange);
}

/* Geocoding Progress */
.progress-container {
  margin-top: 10px;
}

.progress-bar-track {
  width: 100%;
  height: 14px;
  background-color: var(--progress-track);
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pos-navy) 0%, var(--pos-orange) 100%);
  border-radius: 7px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.progress-percent-text {
  font-weight: 700;
  color: var(--pos-orange);
}

/* Modeling Parameters */
.parameter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.parameter-input-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.parameter-input-group label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--pos-navy);
}

.parameter-input-group input {
  width: 140px;
}

/* --------------------------------------------------------------------------
   Hasil Pembagian Zona Specific Elements
   -------------------------------------------------------------------------- */
.zona-layout-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
}

.zona-map-frame {
  height: 480px;
}

.zona-right-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.search-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.search-input-wrap svg {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.search-input-wrap input {
  padding-left: 32px;
  width: 220px;
}

.pagination-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-page {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-page:hover {
  background-color: var(--pos-navy-subtle);
  border-color: #cbd5e1;
}

.btn-page.active {
  background-color: var(--pos-navy);
  border-color: var(--pos-navy);
  color: #ffffff;
  font-weight: 600;
}

.btn-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.bottom-action-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

/* --------------------------------------------------------------------------
   Evaluasi Clustering Specific Elements
   -------------------------------------------------------------------------- */
.metrics-row-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.metric-kpi-box {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-top: 3px solid var(--pos-navy);
}

.metric-kpi-box:nth-child(2) {
  border-top-color: var(--pos-orange);
}

.metric-kpi-box:nth-child(3) {
  border-top-color: var(--cluster-3);
}

.metric-kpi-box:nth-child(4) {
  border-top-color: var(--cluster-4);
}

.metric-kpi-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 10px;
}

.metric-kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--pos-navy);
  text-align: center;
  margin-bottom: 0;
  padding-bottom: 4px;
}

.metric-meter-bar {
  width: 100%;
  height: 8px;
  background-color: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.metric-meter-fill {
  height: 100%;
  background-color: var(--pos-orange);
  border-radius: 4px;
}

.metric-meter-fill.navy {
  background-color: var(--pos-navy);
}

/* --------------------------------------------------------------------------
   Toast & Alert System
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background-color: var(--pos-navy);
  border-left: 4px solid var(--pos-orange);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(28, 45, 90, 0.25);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.25s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .comparison-maps-grid {
    grid-template-columns: 1fr;
  }
  .dual-col-grid,
  .zona-layout-grid,
  .template-card-grid,
  .upload-dropzone-grid {
    grid-template-columns: 1fr;
  }

  .metrics-row-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    box-shadow: 0 0 15px rgba(28, 45, 90, 0.15);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .mobile-menu-toggle {
    display: inline-block;
  }

  .content-body {
    padding: 16px;
  }

  .top-navbar {
    padding: 0 16px;
  }

  .kpi-grid,
  .metrics-row-grid {
    grid-template-columns: 1fr;
  }

  .header-action-control,
  .filter-group {
    min-width: 0;
    width: 100%;
  }

  .select-custom {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .template-actions {
    flex-direction: column;
  }
}


/* Simbol Cluster pada legenda */
.map-legend-overlay .legend-symbol.cluster-outline {
  display: inline-block;
  width: 18px;
  height: 18px;
  background: transparent;
  border: 2px solid #1c2d5a;
  border-radius: 2px;
  box-sizing: border-box;
  flex-shrink: 0;
}


/* Ukuran simbol Cluster pada legenda */
.map-legend-overlay .legend-symbol.cluster-outline {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #1c2d5a;
    border-radius: 2px;
    background: transparent;
    box-sizing: border-box;
    flex-shrink: 0;
}

.map-legend-overlay .legend-symbol.line-dash {
    display: inline-block;
    width: 14px;
    height: 0;
    border: none;
    border-top: 2px dashed #1c2d5a;
    background: transparent;
    flex-shrink: 0;
}

/* ==========================================================================
   Preprocessing & Geocoding Accordion Styles (Revisi 29 Oktober)
   ========================================================================== */
.prep-item-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.prep-item-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.prep-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s;
}

.prep-item-header:hover {
  background-color: #f8fafc;
}

.prep-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.prep-chevron {
  color: #64748b;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.prep-chevron.rotated {
  transform: rotate(90deg);
}

.prep-item-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.prep-item-desc {
  font-size: 12.5px;
  color: #64748b;
  margin-top: 2px;
}

.badge-count {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  background: #f1f5f9;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.badge-count.badge-red {
  color: #dc2626;
  background: #fee2e2;
}

.prep-drawer {
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
}

.table-compact th,
.table-compact td {
  padding: 8px 12px;
  font-size: 12.5px;
}

/* Clickable cluster row on Hasil Pembagian Zona */
.clickable-cluster-row {
  cursor: pointer;
  transition: background-color 0.15s, border-left-color 0.15s;
}

.clickable-cluster-row:hover {
  background-color: #f1f5f9 !important;
}

.clickable-cluster-row:active {
  background-color: #e2e8f0 !important;
}

/* Guide Badges */
.guide-badge-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
}

.guide-blue {
  background: #eff6ff;
  color: #1d4ed8;
}

.guide-red {
  background: #fef2f2;
  color: #b91c1c;
}

.guide-green {
  background: #f0fdf4;
  color: #15803d;
}

/* =====================================================
   CENTER CARD PREPROCESSING & GEOCODING
   ===================================================== */

#view-upload .metrics-row-grid {
    display: flex;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 16px;
}

#view-upload .metrics-row-grid > * {
    flex: 0 1 300px;
    min-width: 0;
}

@media (max-width: 768px) {
    #view-upload .metrics-row-grid > * {
        flex: 1 1 100%;
    }
}

/* No. Resi dapat diklik untuk melihat titik pada peta */
.resi-map-link {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: #1c2d5a;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.resi-map-link:hover {
  color: #0284c7;
  text-decoration: underline;
}

.resi-map-link:focus-visible {
  outline: 2px solid #0284c7;
  outline-offset: 3px;
  border-radius: 2px;
}


/* =====================================================
   PREPROCESSING - KONSISTENSI LEBAR KOLOM
   ===================================================== */

/* Pengaturan dasar tabel preprocessing */
.prep-drawer .table-compact {
    width: 100%;
    table-layout: fixed;
}

/* Dataset dengan Petugas - 6 kolom */
.prep-drawer .table-compact:has(.prep-petugas-header) th:nth-child(1) {
    width: 4%;
}

.prep-drawer .table-compact:has(.prep-petugas-header) th:nth-child(2) {
    width: 6%;
}

.prep-drawer .table-compact:has(.prep-petugas-header) th:nth-child(3) {
    width: 19%;
}

.prep-drawer .table-compact:has(.prep-petugas-header) th:nth-child(4) {
    width: 12%;
}

.prep-drawer .table-compact:has(.prep-petugas-header) th:nth-child(5) {
    width: 34%;
}

.prep-drawer .table-compact:has(.prep-petugas-header) th:nth-child(6) {
    width: 25%;
}

/* Dataset tanpa Petugas - 5 kolom */
.prep-drawer .table-compact:not(:has(.prep-petugas-header)) th:nth-child(1) {
    width: 4%;
}

.prep-drawer .table-compact:not(:has(.prep-petugas-header)) th:nth-child(2) {
    width: 6%;
}

.prep-drawer .table-compact:not(:has(.prep-petugas-header)) th:nth-child(3) {
    width: 22%;
}

.prep-drawer .table-compact:not(:has(.prep-petugas-header)) th:nth-child(4) {
    width: 43%;
}

.prep-drawer .table-compact:not(:has(.prep-petugas-header)) th:nth-child(5) {
    width: 25%;
}

/* Penanganan teks panjang */
.prep-drawer .table-compact th,
.prep-drawer .table-compact td {
    overflow-wrap: anywhere;
    word-break: normal;
}

/* PREPROCESSING - TABEL DI LUAR WILAYAH (7 KOLOM) */

.prep-drawer .table-compact:has(.prep-kota-header) {
    width: 100%;
    table-layout: fixed;
}

.prep-drawer .table-compact:has(.prep-kota-header) th:nth-child(1) {
    width: 4%;
}

.prep-drawer .table-compact:has(.prep-kota-header) th:nth-child(2) {
    width: 6%;
}

.prep-drawer .table-compact:has(.prep-kota-header) th:nth-child(3) {
    width: 17%;
}

.prep-drawer .table-compact:has(.prep-kota-header) th:nth-child(4) {
    width: 10%;
}

.prep-drawer .table-compact:has(.prep-kota-header) th:nth-child(5) {
    width: 28%;
}

.prep-drawer .table-compact:has(.prep-kota-header) th:nth-child(6) {
    width: 15%;
}

.prep-drawer .table-compact:has(.prep-kota-header) th:nth-child(7) {
    width: 20%;
}

/* DI LUAR WILAYAH - TANPA PETUGAS (6 KOLOM) */

.prep-drawer .table-compact:has(.prep-kota-header):not(:has(.prep-petugas-header)) th:nth-child(1) {
    width: 4%;
}

.prep-drawer .table-compact:has(.prep-kota-header):not(:has(.prep-petugas-header)) th:nth-child(2) {
    width: 6%;
}

.prep-drawer .table-compact:has(.prep-kota-header):not(:has(.prep-petugas-header)) th:nth-child(3) {
    width: 20%;
}

.prep-drawer .table-compact:has(.prep-kota-header):not(:has(.prep-petugas-header)) th:nth-child(4) {
    width: 32%;
}

.prep-drawer .table-compact:has(.prep-kota-header):not(:has(.prep-petugas-header)) th:nth-child(5) {
    width: 16%;
}

.prep-drawer .table-compact:has(.prep-kota-header):not(:has(.prep-petugas-header)) th:nth-child(6) {
    width: 22%;
}


/* =====================================================
   BASELINE AKTUAL PT POS - 4 CARD SEJAJAR
   ===================================================== */

#view-upload .actual-baseline-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
}

#view-upload .actual-baseline-metrics > .metric-kpi-box {
    flex: none;
    width: 100%;
    min-width: 0;
}

/* Tablet */
@media (max-width: 900px) {
    #view-upload .actual-baseline-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile */
@media (max-width: 480px) {
    #view-upload .actual-baseline-metrics {
        grid-template-columns: 1fr;
    }
}


/* =====================================================
   TOOLTIP INFORMASI Z2 AKTUAL PT POS
   ===================================================== */

.z2-info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
    vertical-align: middle;
    cursor: help;
    outline-offset: 3px;
}

.z2-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: 1.5px solid #2563eb;
    border-radius: 50%;
    color: #2563eb;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}


.z2-tooltip-text {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    padding: 10px 12px;
    background: #263e6b;
    color: #ffffff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    white-space: normal;
    box-shadow: 0 3px 8px rgba(28, 45, 90, 0.12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 1000;
    transition: opacity 0.15s ease;
}


.z2-info-tooltip:hover .z2-tooltip-text,
.z2-info-tooltip:focus .z2-tooltip-text,
.z2-info-tooltip:focus-within .z2-tooltip-text {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 480px) {
    .z2-tooltip-text {
        width: 200px;
    }
}


/* =====================================================
   KETERANGAN Z2 - DASHBOARD
   ===================================================== */

.z2-dashboard-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.z2-dashboard-note svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.z2-dashboard-note strong {
    color: #1c2d5a;
    font-weight: 600;
}
/* =====================================================
   UNDUH PETA - HASIL PEMBAGIAN ZONA
   ===================================================== */

/* Judul peta dan tombol unduh */
.zona-map-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}

.zona-map-heading .card-title {
    margin-bottom: 0;
}

/* Tombol Unduh Peta */
.btn-download-map {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 12px;
    background-color: #ffffff;
    border: 1px solid var(--pos-navy);
    border-radius: var(--radius-md);
    color: var(--pos-navy);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.btn-download-map svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.btn-download-map:hover:not(:disabled) {
    background-color: var(--pos-navy-subtle);
}

.btn-download-map:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Tampilan mobile */
@media (max-width: 480px) {
    .zona-map-heading {
        align-items: flex-start;
    }

    .btn-download-map {
        font-size: 11.5px;
    }
}