/* =========================================================
   IMP LOCATION - RED WHITE THEME
   CodeIgniter 3
========================================================= */

:root {
  --red: #ed1c24;
  --red-dark: #cf171e;
  --red-soft: #fff0f1;
  --red-line: #ffd1d4;

  --bg: #f5f6f8;
  --card: #ffffff;

  --text: #101828;
  --muted: #667085;
  --line: #e4e7ec;

  --sidebar-width: 262px;

  --shadow: 0 12px 34px rgba(16, 24, 40, 0.07);
}

/* =========================================================
   RESET
========================================================= */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

body {
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

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

/* =========================================================
   APP SHELL
========================================================= */

.app-shell {
  min-height: 100vh;
}

/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
  position: fixed;

  top: 0;
  left: 0;
  bottom: 0;

  width: var(--sidebar-width);
  height: 100vh;

  padding: 18px 20px;

  display: flex;
  flex-direction: column;

  background: #fffafa;

  border-right: 1px solid #ececef;

  box-shadow: 4px 0 24px rgba(16, 24, 40, 0.02);

  z-index: 30;

  overflow-y: auto;
  overflow-x: hidden;

  scrollbar-width: thin;
  scrollbar-color: #d5d5d5 transparent;

  transition: transform 0.25s ease;
}

/* Chrome / Edge scrollbar */

.sidebar::-webkit-scrollbar {
  width: 5px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #d4d4d4;
  border-radius: 20px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: #b8b8b8;
}

/* =========================================================
   SIDEBAR BRAND
========================================================= */

.brand-card {
  display: flex;
  align-items: center;

  gap: 12px;

  min-height: 90px;

  padding: 14px;

  background: #ffffff;

  border: 1px solid var(--red-line);
  border-radius: 18px;

  flex-shrink: 0;
}

.brand-mark {
  width: 46px;
  height: 46px;

  flex: 0 0 46px;

  display: grid;
  place-items: center;

  border-radius: 12px;

  background: linear-gradient(145deg, #f22b32, var(--red-dark));

  color: #ffffff;

  font-size: 14px;
  font-weight: 900;

  box-shadow: 0 10px 24px rgba(237, 28, 36, 0.22);
}

.brand-copy {
  min-width: 0;
}

.brand-copy b {
  display: block;

  font-size: 16px;
  font-weight: 700;

  white-space: nowrap;
}

.brand-copy small {
  display: block;

  margin-top: 4px;

  color: #77809a;

  font-size: 10px;
}

/* =========================================================
   SIDEBAR NAVIGATION
========================================================= */

.side-nav {
  display: flex;
  flex-direction: column;

  gap: 7px;

  margin-top: 18px;

  flex-shrink: 0;
}

.side-nav a {
  position: relative;

  display: flex;
  align-items: center;

  gap: 11px;

  min-height: 50px;

  padding: 8px 12px;

  border-radius: 13px;

  color: #1f2937;
  background: transparent;

  font-size: 13px;
  font-weight: 500;

  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.side-nav a:hover {
  background: #fff5f5;
  color: var(--red-dark);
}

.side-nav a.active {
  background: var(--red);
  color: #ffffff;

  font-weight: 600;

  box-shadow: 0 10px 22px rgba(237, 28, 36, 0.18);
}

/* =========================================================
   SIDEBAR ICON
========================================================= */

.nav-icon {
  width: 32px;
  height: 32px;

  min-width: 32px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 10px;

  background: var(--red-soft);
  color: var(--red);

  font-size: 15px;

  transition:
    background 0.18s ease,
    color 0.18s ease;
}

.nav-icon i {
  line-height: 1;
}

.side-nav a.active .nav-icon {
  background: rgba(255, 255, 255, 0.17);
  color: #ffffff;
}

.nav-label {
  flex: 1;

  overflow: hidden;

  white-space: nowrap;
  text-overflow: ellipsis;
}

/* =========================================================
   SIDEBAR BADGE
========================================================= */

.nav-badge {
  margin-left: auto;

  padding: 3px 7px;

  border-radius: 999px;

  background: #ffe5e6;
  color: var(--red);

  font-size: 9px;
}

.side-nav a.active .nav-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* =========================================================
   SIDEBAR FOOTER
========================================================= */

.side-foot {
  margin-top: 20px;

  padding: 14px;

  border-radius: 16px;

  background: #111827;
  color: #ffffff;

  flex-shrink: 0;
}

.side-foot b,
.side-foot small {
  display: block;
}

.side-foot b {
  margin: 9px 0 6px;

  font-size: 12px;
}

.side-foot small {
  color: #d0d5dd;

  font-size: 10px;
  line-height: 1.55;
}

.side-chip {
  display: inline-flex;

  padding: 5px 8px;

  border-radius: 999px;

  background: var(--red);

  font-size: 9px;
  font-weight: 800;
}

/* =========================================================
   MAIN CONTENT
========================================================= */

.app-content {
  width: calc(100% - var(--sidebar-width));

  min-height: 100vh;

  margin-left: var(--sidebar-width);
}

/* =========================================================
   TOPBAR
========================================================= */

.topbar-wrap {
  position: sticky;

  top: 0;

  z-index: 20;

  padding: 16px 20px 0;

  background: linear-gradient(var(--bg) 75%, transparent);
}

.topbar {
  min-height: 70px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 16px;

  padding: 12px 16px;

  background: #ffffff;

  border: 1px solid #eef0f3;
  border-radius: 18px;

  box-shadow: var(--shadow);
}

.top-left {
  display: flex;
  align-items: center;

  gap: 12px;
}

.topbar h1 {
  margin: 2px 0 0;

  font-size: 21px;
  line-height: 1.15;
}

.eyebrow {
  color: var(--red);

  font-size: 10px;
  font-weight: 900;

  letter-spacing: 0.14em;
}

.menu-toggle {
  display: none;

  padding: 9px 11px;

  border: 0;
  border-radius: 9px;

  background: #f2f4f7;

  cursor: pointer;
}

.top-actions {
  display: flex;
  align-items: center;

  gap: 9px;

  flex-wrap: wrap;
}

.user-pill {
  padding: 9px 12px;

  border-radius: 999px;

  background: #f6f7f9;

  color: #344054;

  font-size: 12px;
}

/* =========================================================
   PAGE
========================================================= */

.page-body {
  padding: 16px 20px 28px;
}

/* =========================================================
   CARD
========================================================= */

.card,
.stat-card {
  background: #ffffff;

  border: 1px solid #eceef1;
  border-radius: 18px;

  box-shadow: var(--shadow);
}

.card {
  padding: 16px;

  margin-bottom: 16px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  gap: 16px;

  margin-bottom: 14px;
}

.card-head.compact {
  margin-bottom: 8px;
}

.card h2 {
  margin: 0;

  font-size: 17px;
}

.card p {
  margin: 5px 0 0;

  color: var(--muted);

  font-size: 12px;
  line-height: 1.45;
}

/* =========================================================
   ANALYSIS PAGE
========================================================= */

.analysis-workspace {
  display: grid;

  grid-template-columns: 300px minmax(0, 1fr);

  gap: 14px;

  align-items: stretch;
}

.control-card,
.map-card {
  margin-bottom: 0;
}

.control-card {
  padding: 14px;
}

.map-card {
  padding: 0;

  overflow: hidden;
}

.dashboard-map {
  width: 100%;

  height: 436px !important;

  margin: 0 !important;

  border: 0 !important;
  border-radius: 18px !important;
}

/* =========================================================
   FORM
========================================================= */

.form-grid {
  display: grid;

  gap: 12px;

  margin: 13px 0;
}

.form-grid.single {
  grid-template-columns: 1fr;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-form {
  gap: 10px;
}

label {
  display: grid;

  gap: 6px;

  color: #344054;

  font-size: 11px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;

  padding: 10px 11px;

  outline: none;

  background: #ffffff;

  border: 1px solid #d7dce5;
  border-radius: 10px;

  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  border-color: #f3767b;

  box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.08);
}

/* =========================================================
   BUTTON
========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 6px;

  padding: 9px 13px;

  border: 1px solid transparent;
  border-radius: 10px;

  cursor: pointer;

  font-size: 12px;
  font-weight: 800;

  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--red);
  color: #ffffff;
}

.btn.primary:hover {
  background: var(--red-dark);
}

.btn.ghost {
  background: #ffffff;

  border-color: #dfe3e8;

  color: #101828;
}

.btn.ghost:hover {
  background: #f8fafc;
}

.btn.danger {
  background: #fff0f1;

  border-color: #ffc9cc;

  color: #b42318;
}

.btn.mini {
  padding: 6px 9px;

  font-size: 10px;
}

.btn.full {
  width: 100%;
}

/* =========================================================
   SUMMARY / RESULT
========================================================= */

.summary-title {
  margin: 8px 0 7px;

  font-size: 12px;
  font-weight: 800;
}

.mini-summary {
  padding: 10px;

  border: 1px solid var(--line);
  border-radius: 10px;

  background: #f8fafc;

  color: #475467;

  font-size: 11px;
}

.result-card {
  min-height: 105px;

  margin-top: 14px;
}

.result-box {
  margin-top: 10px;

  padding: 14px;

  border: 1px solid var(--line);
  border-radius: 12px;

  background: #f8fafc;

  font-size: 12px;
  line-height: 1.65;

  white-space: pre-wrap;
}

.result-clean {
  padding: 0;

  border: 0;

  background: #ffffff;
}

.muted,
.empty {
  color: var(--muted);
}

/* =========================================================
   DASHBOARD
========================================================= */

.stats-grid {
  display: grid;

  grid-template-columns: repeat(4, minmax(0, 1fr));

  gap: 14px;

  margin-bottom: 16px;
}

.stat-card {
  padding: 17px;
}

.stat-card span {
  display: block;

  color: var(--muted);

  font-size: 12px;
}

.stat-card b {
  display: block;

  margin-top: 7px;

  font-size: 26px;
}

.grid-2 {
  display: grid;

  grid-template-columns: 1.35fr 0.65fr;

  gap: 16px;
}

.grid-chat {
  display: grid;

  grid-template-columns: 320px minmax(0, 1fr);

  gap: 16px;
}

/* =========================================================
   MAP
========================================================= */

.map {
  height: 410px;

  margin-bottom: 14px;

  overflow: hidden;

  border: 1px solid var(--line);
  border-radius: 14px;
}

.map.small {
  height: 340px;
}

.map.large {
  height: 70vh;
}

/* =========================================================
   LIST
========================================================= */

.list {
  display: grid;

  gap: 9px;
}

.list-row,
.history-item {
  padding: 13px;

  background: #ffffff;

  border: 1px solid var(--line);
  border-radius: 12px;
}

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 12px;
}

.list-row b,
.list-row small {
  display: block;
}

.list-row small {
  margin-top: 4px;

  color: var(--muted);

  font-size: 11px;
}

/* =========================================================
   BADGE
========================================================= */

.badge {
  display: inline-block;

  padding: 6px 9px;

  border-radius: 999px;

  background: #eef2f7;

  font-size: 10px;
  font-weight: 900;
}

.badge.ok {
  background: #ddf7e8;

  color: #087333;
}

.badge.wait {
  background: #fff1df;

  color: #9a5b00;
}

/* =========================================================
   TABLE
========================================================= */

.table-wrap {
  width: 100%;

  overflow-x: auto;
}

table {
  width: 100%;

  min-width: 760px;

  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;

  border-bottom: 1px solid var(--line);

  text-align: left;
  vertical-align: middle;

  font-size: 12px;
}

th {
  color: #667085;

  font-size: 10px;

  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td small {
  display: block;

  margin-top: 4px;

  color: var(--muted);
}

.actions {
  display: flex;
  align-items: center;

  gap: 7px;

  flex-wrap: wrap;
}

/* =========================================================
   FILTER
========================================================= */

.filter-row {
  display: grid;

  grid-template-columns: minmax(0, 1fr) 200px auto;

  gap: 10px;

  margin-bottom: 16px;
}

.inline {
  display: inline;
}

/* =========================================================
   ALERT
========================================================= */

.alert {
  padding: 12px 14px;

  margin-bottom: 14px;

  border-radius: 10px;

  font-size: 12px;
}

.alert.success {
  background: #e8f8ed;

  color: #126b31;
}

.alert.error {
  background: #fff0f1;

  color: #991b1b;
}

.alert.warn {
  background: #fff9e7;

  color: #805b00;
}

/* =========================================================
   HISTORY
========================================================= */

.history-item {
  margin-bottom: 10px;
}

.history-top {
  display: flex;
  justify-content: space-between;

  gap: 16px;
}

.history-top b,
.history-top small {
  display: block;
}

.history-top small {
  margin-top: 5px;

  color: var(--muted);
}

.analysis-text {
  margin: 12px 0;

  color: #475569;

  font-size: 12px;
  line-height: 1.6;
}

/* =========================================================
   CHAT
========================================================= */

.chat-card {
  min-height: 650px;

  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;

  display: flex;
  flex-direction: column;

  gap: 10px;

  padding: 5px;

  overflow-y: auto;
}

.chat-msg {
  max-width: 78%;

  padding: 11px 13px;

  border-radius: 13px;

  background: #f1f5f9;

  white-space: pre-wrap;

  font-size: 12px;
  line-height: 1.55;
}

.chat-msg.user {
  align-self: flex-end;

  background: #fee8e9;
}

.chat-msg.system {
  align-self: flex-start;
}

.chat-input {
  display: grid;

  grid-template-columns: minmax(0, 1fr) auto;

  gap: 10px;

  margin-top: 14px;
}

.chat-input textarea {
  min-height: 76px;
}

/* =========================================================
   LOGIN
========================================================= */

.login-page {
  min-height: 100vh;

  display: grid;
  place-items: center;

  padding: 24px;

  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 55%, #fee2e2 100%);
}

.login-card {
  width: min(440px, 100%);

  padding: 32px;

  background: #ffffff;

  border: 1px solid var(--line);
  border-radius: 22px;

  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.14);
}

.login-brand {
  margin-bottom: 26px;
}

.login-card h1 {
  margin: 0 0 8px;

  font-size: 27px;
}

.login-card > p {
  color: var(--muted);

  line-height: 1.6;
}

.google-box {
  margin-top: 24px;

  padding: 18px;

  display: flex;
  justify-content: center;

  background: #f8fafc;

  border: 1px solid var(--line);
  border-radius: 13px;
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1100px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .app-content {
    width: 100%;

    margin-left: 0;
  }

  .menu-toggle {
    display: block;
  }

  .analysis-workspace {
    grid-template-columns: 1fr;
  }

  .dashboard-map {
    height: 400px !important;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-2,
  .grid-chat {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 700px) {
  .sidebar {
    width: 260px;
  }

  .page-body {
    padding: 12px;
  }

  .topbar-wrap {
    padding: 12px 12px 0;
  }

  .topbar {
    padding: 11px 12px;

    border-radius: 14px;
  }

  .topbar h1 {
    font-size: 17px;
  }

  .top-actions .user-pill,
  .top-actions .btn.primary {
    display: none;
  }

  .stats-grid,
  .form-grid.two,
  .form-grid.three {
    grid-template-columns: 1fr;
  }

  .filter-row {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 14px;
  }

  .map,
  .dashboard-map {
    height: 330px !important;
  }

  .chat-input {
    grid-template-columns: 1fr;
  }
}
/* =========================================================
   DATA TOKO TABLE
========================================================= */

.table-scroll-top {
  width: 100%;

  height: 15px;

  margin-bottom: 5px;

  overflow-x: auto;
  overflow-y: hidden;
}

.table-scroll-top-inner {
  height: 1px;
}

.table-wrap {
  width: 100%;

  overflow-x: auto;
  overflow-y: hidden;
}

#tokoTable {
  min-width: 1250px;
}

#tokoTable th {
  white-space: nowrap;
}

#tokoTable td {
  white-space: nowrap;
}

#tokoTable td:nth-child(2) {
  min-width: 170px;
}

#tokoTable td:nth-child(3) {
  min-width: 120px;
}

#tokoTable td:nth-child(4) {
  min-width: 125px;
}

#tokoTable td:nth-child(5) {
  min-width: 140px;
}

#tokoTable td:nth-child(6) {
  min-width: 110px;
}

#tokoTable td:nth-child(8) {
  min-width: 145px;
}

#tokoTable td:nth-child(9) {
  min-width: 120px;
}

#tokoTable td:nth-child(10) {
  min-width: 145px;
}

#tokoTable td:nth-child(11) {
  min-width: 135px;
}

.coordinate-text {
  line-height: 1.45;

  color: #475467;

  font-size: 11px;
}

.map-link {
  margin-top: 7px;
}
/* =========================================================
   DASHBOARD TOKO
========================================================= */

.page-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 16px;

  margin-bottom: 16px;
}

.page-section-head h2 {
  margin: 0;

  font-size: 23px;
}

.page-section-head p {
  margin: 4px 0 0;

  color: var(--muted);

  font-size: 12px;
}

/* =========================================================
   TOKO SUMMARY CARDS
========================================================= */

.toko-stats {
  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 14px;

  margin-bottom: 16px;
}

.toko-stat-card {
  min-height: 106px;

  padding: 20px;

  display: flex;
  flex-direction: column;
  justify-content: center;

  background: #ffffff;

  border: 1px solid #eceef1;
  border-radius: 20px;

  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.05);
}

.toko-stat-card span {
  color: #667085;

  font-size: 12px;
  font-weight: 700;
}

.toko-stat-card strong {
  display: block;

  margin-top: 7px;

  color: var(--red);

  font-size: 34px;
  line-height: 1;

  font-weight: 800;
}

/* =========================================================
   TOKO FILTER
========================================================= */

.toko-filter-card {
  display: grid;

  grid-template-columns: minmax(0, 1fr) 220px auto;

  gap: 10px;

  align-items: center;

  padding: 13px 14px;

  margin-bottom: 16px;

  background: #ffffff;

  border: 1px solid #eceef1;
  border-radius: 18px;

  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.04);
}

.toko-search {
  position: relative;
}

.toko-search i {
  position: absolute;

  left: 13px;
  top: 50%;

  transform: translateY(-50%);

  color: #98a2b3;

  font-size: 14px;
}

.toko-search input {
  padding-left: 38px;

  min-height: 45px;
}

.toko-filter-card select {
  min-height: 45px;
}

.toko-export-btn {
  min-height: 45px;

  background: #198754;

  color: #ffffff;

  white-space: nowrap;
}

.toko-export-btn:hover {
  background: #146c43;
}

/* =========================================================
   TOKO TABLE CARD
========================================================= */

.toko-table-card {
  padding: 14px;

  overflow: hidden;
}

.table-scroll-top {
  width: 100%;

  height: 16px;

  margin-bottom: 6px;

  overflow-x: auto;
  overflow-y: hidden;
}

.table-scroll-top-inner {
  height: 1px;
}

.table-wrap {
  width: 100%;

  overflow-x: auto;
}

#tokoTable {
  min-width: 1320px;
}

#tokoTable th {
  padding: 12px 14px;

  background: #f8fafc;

  white-space: nowrap;
}

#tokoTable td {
  padding: 15px 14px;

  white-space: nowrap;
}

#tokoTable tbody tr:hover {
  background: #fffafa;
}

.coordinate-text {
  color: #475467;

  font-size: 11px;

  line-height: 1.4;
}

.map-link {
  margin-top: 6px;
}

/* =========================================================
   RESPONSIVE TOKO
========================================================= */

@media (max-width: 900px) {
  .toko-stats {
    grid-template-columns: 1fr;
  }

  .toko-filter-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .page-section-head {
    align-items: flex-start;

    flex-direction: column;
  }
}
/* =========================================================
   STORE FILTER TABS
========================================================= */

.store-tabs {
  display: flex;
  align-items: center;

  gap: 8px;

  margin-bottom: 14px;

  overflow-x: auto;

  padding-bottom: 4px;
}

.store-tab {
  flex: 0 0 auto;

  padding: 9px 15px;

  border: 1px solid #e4e7ec;
  border-radius: 999px;

  background: #fff;

  color: #344054;

  font-size: 12px;
  font-weight: 700;

  cursor: pointer;

  transition: 0.18s;
}

.store-tab:hover {
  border-color: var(--red);
  color: var(--red);
}

.store-tab.active {
  background: var(--red);
  border-color: var(--red);

  color: #fff;

  box-shadow: 0 8px 18px rgba(237, 28, 36, 0.18);
}

/* =========================================================
   MAP STORE
========================================================= */

.toko-map-card {
  padding: 14px;

  margin-bottom: 16px;
}

#storeMap {
  width: 100%;

  height: 430px;

  border-radius: 16px;

  overflow: hidden;

  background: #f2f4f7;
}

/* =========================================================
   FILTER
========================================================= */

.toko-filter-card {
  display: grid;

  grid-template-columns:
    minmax(300px, 1fr)
    190px
    190px
    auto;

  gap: 10px;

  align-items: center;

  padding: 13px 14px;

  margin-bottom: 16px;

  background: #fff;

  border: 1px solid #eceef1;
  border-radius: 18px;

  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.04);
}

@media (max-width: 900px) {
  .toko-filter-card {
    grid-template-columns: 1fr;
  }

  #storeMap {
    height: 360px;
  }
}
/* =====================================================
   DASHBOARD STORE / TOKO MAP
===================================================== */

.toko-dashboard-map-card {
  padding: 16px;
  margin-bottom: 16px;
}

.dashboard-toko-map {
  width: 100%;
  height: 440px;

  border-radius: 18px;

  overflow: hidden;

  background: #eef2f6;
}

.map-legend {
  display: flex;
  align-items: center;
  gap: 16px;

  font-size: 12px;
  font-weight: 700;

  color: #475467;
}

.map-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend-store,
.legend-toko {
  display: block;

  width: 13px;
  height: 13px;

  border-radius: 50%;
}

.legend-store {
  background: #ed1c24;
}

.legend-toko {
  background: #2563eb;
}

/* STORE MARKER */

.map-store-marker {
  width: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 12px 12px 12px 3px;

  background: #ed1c24;

  border: 3px solid #fff;

  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);

  color: #fff;

  font-size: 18px;
}

/* TOKO MARKER */

.map-toko-marker {
  width: 30px;
  height: 30px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50% 50% 50% 3px;

  background: #2563eb;

  border: 3px solid #fff;

  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);

  color: #fff;

  font-size: 14px;
}

/* POPUP */

.map-popup strong {
  display: block;

  margin-bottom: 5px;

  font-size: 14px;
}

.popup-type {
  display: inline-block;

  margin-bottom: 6px;

  padding: 2px 7px;

  border-radius: 999px;

  font-size: 9px;
  font-weight: 800;
}

.popup-type.store {
  background: #fee2e2;
  color: #b91c1c;
}

.popup-type.toko {
  background: #dbeafe;
  color: #1d4ed8;
}

/* =====================================================
   FORM LOCATION
===================================================== */

.location-title {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;

  margin-top: 20px;
  margin-bottom: 10px;
}

.location-title div {
  display: flex;
  flex-direction: column;

  gap: 2px;
}

.location-title small {
  color: #667085;
}

.toko-input-map {
  width: 100%;

  height: 400px;

  border-radius: 16px;

  margin-bottom: 14px;

  overflow: hidden;
}

.submit-wide {
  margin-top: 16px;

  min-width: 180px;
}

/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 768px) {
  .store-tabs {
    width: 100%;

    overflow-x: auto;

    padding-bottom: 5px;
  }

  .store-tab {
    white-space: nowrap;
  }

  .dashboard-toko-map {
    height: 340px;
  }

  .toko-input-map {
    height: 320px;
  }

  .map-legend {
    margin-top: 8px;

    flex-wrap: wrap;
  }

  .location-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .location-title .btn {
    width: 100%;
  }

  .form-grid.two {
    grid-template-columns: 1fr;
  }

  .submit-wide {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .dashboard-toko-map {
    height: 290px;
  }

  .toko-input-map {
    height: 280px;
  }
}
/* =========================================================
   MOBILE RESPONSIVE FIX
========================================================= */

@media (max-width: 768px) {

    body {
        overflow-x: hidden;
    }

    /* SIDEBAR */
    .sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;

        width: 280px !important;
        max-width: 85vw;

        height: 100vh !important;

        background: #fff;

        z-index: 9999;

        transform: translateX(-105%);
        transition: transform .25s ease;

        overflow-y: auto;
        overflow-x: hidden;

        box-shadow: 12px 0 30px rgba(15, 23, 42, .16);
    }

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

    /* OVERLAY */
    .sidebar-overlay {
        position: fixed;

        inset: 0;

        background: rgba(15, 23, 42, .38);

        z-index: 9998;

        opacity: 0;
        visibility: hidden;

        transition:
            opacity .2s ease,
            visibility .2s ease;
    }

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    /* MAIN CONTENT */
    .main-content,
    .content,
    .app-main {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* HEADER */
    .topbar-wrap {
        position: sticky;
        top: 0;
        z-index: 900;

        width: 100%;
    }

    .topbar {
        padding: 10px 12px;

        min-height: 64px;

        display: flex;
        align-items: center;
        justify-content: space-between;

        gap: 8px;
    }

    .top-left {
        display: flex;
        align-items: center;
        gap: 10px;

        min-width: 0;
    }

    .top-left h1 {
        font-size: 18px;
        line-height: 1.2;

        margin: 0;

        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .top-left .eyebrow {
        font-size: 9px;
    }

    /* HAMBURGER HARUS MUNCUL */
    .menu-toggle {
        display: inline-flex !important;

        align-items: center;
        justify-content: center;

        flex: 0 0 42px;

        width: 42px;
        height: 42px;

        border: 1px solid #e5e7eb;
        border-radius: 12px;

        background: #fff;

        color: #111827;

        font-size: 22px;
        font-weight: 700;

        cursor: pointer;
    }

    /* HEADER ACTION */
    .top-actions {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .top-actions .user-pill {
        display: none;
    }

    .top-actions .btn {
        min-height: 40px;

        padding: 8px 11px;

        font-size: 12px;
    }

    /* hide button tambahan agar header tidak penuh */
    .top-actions .btn:not(:last-child) {
        display: none;
    }

    /* PAGE */
    .page-content,
    .content-inner,
    main {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* CARD */
    .card {
        border-radius: 16px;
    }

    /* FORM */
    .form-grid.two,
    .form-grid {
        grid-template-columns: 1fr !important;
    }

    .form-card {
        padding: 14px !important;
    }

    /* MAP */
    .map,
    .map.small,
    .map.large,
    .dashboard-toko-map,
    #dashboardTokoMap,
    #storeFormMap,
    #storesMap {
        width: 100% !important;

        height: 340px !important;
        min-height: 340px !important;

        border-radius: 14px;
    }

    /* TABLE */
    .table-wrap {
        width: 100%;

        overflow-x: auto;

        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 900px;
    }

    /* DASHBOARD HEADER */
    .page-section-head {
        flex-direction: column;
        align-items: flex-start;

        gap: 12px;
    }

    .page-section-head > .btn {
        width: 100%;
        justify-content: center;
    }

    /* STATS */
    .toko-stats {
        grid-template-columns: 1fr !important;
    }

    /* FILTER */
    .toko-filter-card {
        display: grid !important;

        grid-template-columns: 1fr;

        gap: 10px;
    }

    .toko-filter-card > * {
        width: 100%;
    }

    .store-tabs {
        width: 100%;

        overflow-x: auto;

        white-space: nowrap;

        padding-bottom: 6px;
    }

    /* LEAFLET */
    .leaflet-container {
        z-index: 1 !important;
    }
}


/* lebih kecil lagi */
@media (max-width: 480px) {

    .sidebar {
        width: 86vw !important;
        max-width: 320px;
    }

    .topbar {
        padding: 8px 10px;
    }

    .top-left h1 {
        font-size: 16px;
    }

    .menu-toggle {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .map,
    .map.small,
    .map.large,
    .dashboard-toko-map,
    #dashboardTokoMap,
    #storeFormMap,
    #storesMap {
        height: 300px !important;
        min-height: 300px !important;
    }
}
/* =========================================================
   FINAL MOBILE LAYOUT FIX
   HARUS DITARUH PALING BAWAH app.css
========================================================= */


/* DESKTOP */

.menu-toggle {
    display: none;
}

.sidebar-overlay {
    display: none;
}


/* =========================================================
   MOBILE
========================================================= */

@media screen and (max-width: 768px) {

    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }


    /*
    |--------------------------------------------------------------------------
    | APP SHELL
    |--------------------------------------------------------------------------
    */

    .app-shell {
        display: block !important;

        width: 100% !important;
        max-width: 100% !important;

        min-height: 100vh;
    }


    /*
    |--------------------------------------------------------------------------
    | CONTENT
    |--------------------------------------------------------------------------
    */

    .app-content {
        display: block !important;

        width: 100% !important;
        max-width: 100% !important;

        margin-left: 0 !important;
        padding-left: 0 !important;

        min-width: 0 !important;
    }


    /*
    |--------------------------------------------------------------------------
    | SIDEBAR
    |--------------------------------------------------------------------------
    */

    .sidebar {
        position: fixed !important;

        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;

        width: 300px !important;
        max-width: 86vw !important;

        height: 100dvh !important;

        margin: 0 !important;

        overflow-y: auto !important;
        overflow-x: hidden !important;

        background: #ffffff !important;

        transform: translateX(-105%) !important;

        transition:
            transform .25s ease !important;

        z-index: 10002 !important;

        box-shadow:
            14px 0 40px
            rgba(15, 23, 42, .18);
    }


    /*
     * Sidebar muncul setelah hamburger ditekan
     */

    .sidebar.open {
        transform: translateX(0) !important;
    }


    /*
    |--------------------------------------------------------------------------
    | OVERLAY
    |--------------------------------------------------------------------------
    */

    .sidebar-overlay {
        display: block !important;

        position: fixed !important;

        inset: 0 !important;

        background:
            rgba(15, 23, 42, .45);

        opacity: 0;

        visibility: hidden;

        pointer-events: none;

        transition:
            opacity .2s ease,
            visibility .2s ease;

        z-index: 10001 !important;
    }


    .sidebar-overlay.show {
        opacity: 1;

        visibility: visible;

        pointer-events: auto;
    }


    /*
    |--------------------------------------------------------------------------
    | HEADER
    |--------------------------------------------------------------------------
    */

    .topbar-wrap {
        position: sticky !important;

        top: 0 !important;

        width: 100% !important;

        z-index: 9000 !important;

        padding: 8px !important;

        background:
            rgba(245, 247, 250, .96);
    }


    .topbar {
        width: 100% !important;

        min-height: 64px !important;

        padding:
            9px 10px !important;

        display: flex !important;

        align-items: center !important;

        justify-content:
            space-between !important;

        gap: 8px !important;

        border-radius: 16px !important;
    }


    /*
    |--------------------------------------------------------------------------
    | HEADER LEFT
    |--------------------------------------------------------------------------
    */

    .top-left {
        display: flex !important;

        align-items: center !important;

        gap: 10px !important;

        min-width: 0 !important;

        flex: 1 1 auto !important;
    }


    .top-left > div {
        min-width: 0;
    }


    .top-left .eyebrow {
        display: block;

        font-size: 8px !important;

        line-height: 12px !important;
    }


    .top-left h1 {
        margin: 0 !important;

        font-size: 17px !important;

        line-height: 22px !important;

        white-space: nowrap;

        overflow: hidden;

        text-overflow: ellipsis;
    }


    /*
    |--------------------------------------------------------------------------
    | HAMBURGER
    |--------------------------------------------------------------------------
    */

    .menu-toggle {
        display: inline-flex !important;

        position: relative !important;

        top: auto !important;
        left: auto !important;

        flex:
            0 0 42px !important;

        width: 42px !important;
        height: 42px !important;

        min-width: 42px !important;
        min-height: 42px !important;

        padding: 0 !important;

        margin: 0 !important;

        align-items: center !important;

        justify-content:
            center !important;

        border:
            1px solid #e4e7ec !important;

        border-radius:
            12px !important;

        background:
            #ffffff !important;

        color:
            #101828 !important;

        font-size:
            24px !important;

        line-height:
            1 !important;

        cursor:
            pointer !important;

        box-shadow:
            0 2px 8px
            rgba(16, 24, 40, .06);

        z-index:
            9999 !important;
    }


    .menu-toggle i {
        display: block !important;

        font-size: 25px !important;

        line-height: 1 !important;
    }


    /*
    |--------------------------------------------------------------------------
    | HEADER ACTIONS
    |--------------------------------------------------------------------------
    */

    .top-actions {
        display: flex !important;

        align-items: center !important;

        justify-content:
            flex-end !important;

        gap: 6px !important;

        flex:
            0 0 auto !important;
    }


    /*
     * Mobile tidak perlu tampilkan
     * Buka Chat dan Input Toko di header.
     *
     * Sudah tersedia di sidebar.
     */

    .header-chat-btn,
    .header-input-btn {
        display: none !important;
    }


    /*
     * Username terlalu panjang di HP.
     */

    .user-pill {
        display: none !important;
    }


    /*
     * Logout tetap tampil.
     */

    .header-logout-btn {
        display: inline-flex !important;

        align-items: center !important;

        justify-content: center !important;

        min-height: 40px !important;

        padding:
            8px 12px !important;

        font-size:
            11px !important;

        white-space:
            nowrap !important;
    }


    /*
    |--------------------------------------------------------------------------
    | PAGE BODY
    |--------------------------------------------------------------------------
    */

    .page-body {
        width: 100% !important;

        max-width: 100% !important;

        margin: 0 !important;

        padding:
            10px !important;

        overflow-x:
            hidden !important;
    }


    /*
    |--------------------------------------------------------------------------
    | CARD
    |--------------------------------------------------------------------------
    */

    .card {
        width: 100% !important;

        max-width: 100% !important;

        box-sizing:
            border-box !important;
    }


    /*
    |--------------------------------------------------------------------------
    | FORM
    |--------------------------------------------------------------------------
    */

    .form-grid,
    .form-grid.two {
        display: grid !important;

        grid-template-columns:
            minmax(0, 1fr) !important;

        width: 100% !important;

        gap: 12px !important;
    }


    .form-grid label {
        min-width: 0 !important;

        width: 100% !important;
    }


    input,
    select,
    textarea {
        max-width: 100% !important;

        box-sizing:
            border-box !important;
    }


    /*
    |--------------------------------------------------------------------------
    | MAP
    |--------------------------------------------------------------------------
    */

    .map,
    .map.small,
    .map.large,
    #storesMap,
    #storeFormMap,
    #dashboardTokoMap,
    .dashboard-toko-map {
        width: 100% !important;

        max-width: 100% !important;

        height: 330px !important;

        min-height:
            330px !important;

        border-radius:
            16px !important;

        overflow:
            hidden !important;
    }


    .leaflet-container {
        z-index: 1 !important;
    }


    /*
    |--------------------------------------------------------------------------
    | DASHBOARD TOKO STATS
    |--------------------------------------------------------------------------
    */

    .toko-stats {
        display: grid !important;

        grid-template-columns:
            1fr !important;

        gap: 10px !important;
    }


    /*
    |--------------------------------------------------------------------------
    | FILTER
    |--------------------------------------------------------------------------
    */

    .toko-filter-card {
        display: grid !important;

        grid-template-columns:
            minmax(0, 1fr) !important;

        gap: 10px !important;
    }


    .toko-search,
    .toko-filter-card select,
    .toko-export-btn {
        width: 100% !important;

        max-width: 100% !important;

        box-sizing:
            border-box !important;
    }


    /*
    |--------------------------------------------------------------------------
    | TABLE
    |--------------------------------------------------------------------------
    */

    .table-wrap {
        width: 100% !important;

        max-width: 100% !important;

        overflow-x:
            auto !important;

        -webkit-overflow-scrolling:
            touch;
    }


    /*
    |--------------------------------------------------------------------------
    | STORE TABS
    |--------------------------------------------------------------------------
    */

    .store-tabs {
        display: flex !important;

        width: 100% !important;

        max-width: 100% !important;

        gap: 7px !important;

        overflow-x:
            auto !important;

        white-space:
            nowrap !important;

        padding-bottom:
            5px !important;

        -webkit-overflow-scrolling:
            touch;
    }


    .store-tab {
        flex:
            0 0 auto !important;
    }

}



/* =========================================================
   SMALL PHONE
========================================================= */

@media screen and (max-width: 480px) {

    .sidebar {
        width: 86vw !important;

        max-width:
            310px !important;
    }


    .topbar-wrap {
        padding:
            6px !important;
    }


    .topbar {
        min-height:
            60px !important;

        padding:
            7px 8px !important;
    }


    .menu-toggle {
        width:
            40px !important;

        height:
            40px !important;

        min-width:
            40px !important;

        min-height:
            40px !important;

        flex-basis:
            40px !important;
    }


    .top-left h1 {
        font-size:
            15px !important;
    }


    .header-logout-btn {
        padding:
            7px 10px !important;

        font-size:
            10px !important;
    }


    .page-body {
        padding:
            8px !important;
    }


    .map,
    .map.small,
    .map.large,
    #storesMap,
    #storeFormMap,
    #dashboardTokoMap,
    .dashboard-toko-map {
        height:
            300px !important;

        min-height:
            300px !important;
    }

}