/* ============================================
   Absensi App — Emblem-Based Design System
   Palette: Orange #F46B4A, Olive #7A853F, Maroon #8B2332
   ============================================ */

:root {
  /* Colors — Emblem-based warm palette */
  --bg: #FAFAF7;
  --bg-secondary: #F3F1ED;
  --bg-tertiary: #F8F6F2;
  --surface: #FFFFFF;
  --text: #2D2A26;
  --text-secondary: #86827E;
  --text-tertiary: #B5B0A8;

  /* Primary accent — Orange (emblem top) */
  --accent: #F46B4A;
  --accent-hover: #E0593A;
  --accent-light: rgba(244, 107, 74, 0.10);

  /* Emblem colors */
  --orange: #F46B4A;
  --orange-light: rgba(244, 107, 74, 0.12);
  --orange-hover: #E0593A;

  --green: #7A853F;
  --green-light: rgba(122, 133, 63, 0.12);
  --green-hover: #6B7536;

  --green-soft: #9CA558;
  --green-soft-light: rgba(156, 165, 88, 0.12);

  --red: #8B2332;
  --red-light: rgba(139, 35, 50, 0.12);
  --red-hover: #7A1E2C;

  --blue: #5B8FB9;
  --blue-light: rgba(91, 143, 185, 0.12);

  /* Borders & shadows */
  --border: rgba(45, 42, 38, 0.08);
  --border-strong: rgba(45, 42, 38, 0.14);
  --shadow-sm: 0 1px 3px rgba(45, 42, 38, 0.04);
  --shadow: 0 2px 12px rgba(45, 42, 38, 0.06);
  --shadow-lg: 0 8px 30px rgba(45, 42, 38, 0.08);
  --shadow-xl: 0 16px 56px rgba(45, 42, 38, 0.12);

  /* Radii */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* Transitions */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur: 0.25s;
}

/* ===== Reset ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Inter", "Segoe UI", Roboto, sans-serif;
  background: var(--bg-secondary);
  color: var(--text);
  line-height: 1.5;
  letter-spacing: -0.003em;
  min-height: 100vh;
}

/* ===== App Container ===== */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
  body { padding: 24px 0; }
  .app-container {
    min-height: calc(100vh - 48px);
    border-radius: var(--radius-xl);
    overflow: hidden;
  }
}

/* ===== Nav Bar — Frosted Glass ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-5);
  height: 56px;
  background: rgba(250, 250, 247, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.navbar__left { display: flex; align-items: center; gap: var(--sp-3); }
.navbar__title { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.02em; }

.navbar__back {
  display: flex; align-items: center; gap: 2px;
  color: var(--accent); font-size: 1rem; font-weight: 400;
  cursor: pointer; background: none; border: none; padding: var(--sp-1) var(--sp-2);
  transition: opacity var(--dur) var(--ease);
}
.navbar__back:hover { opacity: 0.7; }

.navbar__right { display: flex; align-items: center; gap: var(--sp-3); }

.navbar__icon-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full); border: none;
  background: var(--bg-secondary); cursor: pointer;
  color: var(--text-secondary);
  transition: background var(--dur) var(--ease);
}
.navbar__icon-btn:hover { background: var(--border); }
.navbar__icon-btn svg { width: 18px; height: 18px; }

/* ===== User Header ===== */
.user-header {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
}

.user-header__avatar {
  width: 44px; height: 44px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--orange), var(--red));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 1rem; flex-shrink: 0;
}

.user-header__info { flex: 1; min-width: 0; }
.user-header__greeting { font-size: 0.8125rem; color: var(--text-secondary); }
.user-header__name { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; margin-top: 2px; }

/* ===== Page Content ===== */
.page-content { padding: 0 var(--sp-5) var(--sp-12); }

/* ===== Page Tabs (Data / Lokasi / Upload) ===== */
.page-tabs {
  display: flex;
  position: sticky;
  top: 56px;
  z-index: 90;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--sp-5);
  gap: 0;
}
.page-tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  padding: var(--sp-3) var(--sp-2);
  border: none; border-bottom: 2px solid transparent;
  background: transparent; cursor: pointer;
  font-size: 0.6875rem; font-weight: 600; color: var(--text-secondary);
  transition: color .15s, border-color .15s;
}
.page-tab svg { width: 16px; height: 16px; }
.page-tab--active { color: var(--orange); border-bottom-color: var(--orange); }

/* ===== Tab Panels ===== */
.tab-panel { display: none; }
.tab-panel--active { display: block; }

/* ===== Section ===== */
.section { margin-bottom: var(--sp-6); }

.section__label {
  font-size: 0.8125rem; font-weight: 600;
  color: var(--text-secondary); letter-spacing: 0;
  margin-bottom: var(--sp-3); padding: 0 var(--sp-1);
}

/* ===== Card ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card--bordered { border: 1px solid var(--border); }
.card--shadow { box-shadow: var(--shadow); }

/* ===== List (iOS Settings style) ===== */
.list-group {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.list-item {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5); cursor: pointer;
  transition: background var(--dur) var(--ease);
  text-decoration: none; color: inherit;
}
.list-item:not(:last-child) { border-bottom: 1px solid var(--border); }
.list-item:hover { background: var(--bg-tertiary); }
.list-item:active { background: var(--bg-secondary); }

.list-item__icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.list-item__icon svg { width: 18px; height: 18px; }
.list-item__body { flex: 1; min-width: 0; }
.list-item__title { font-size: 0.9375rem; font-weight: 500; line-height: 1.4; }
.list-item__subtitle { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 2px; }
.list-item__accessory { display: flex; align-items: center; gap: var(--sp-2); color: var(--text-tertiary); }
.list-item__accessory svg { width: 16px; height: 16px; }

/* ===== Badge ===== */
.badge {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  padding: 3px var(--sp-2); border-radius: var(--radius-full);
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0; line-height: 1;
}
.badge svg { width: 12px; height: 12px; }
.badge--green { background: var(--green-light); color: var(--green); }
.badge--orange { background: var(--orange-light); color: var(--orange); }
.badge--red { background: var(--red-light); color: var(--red); }
.badge--blue { background: var(--blue-light); color: var(--blue); }
.badge--gray { background: var(--bg-secondary); color: var(--text-secondary); }

/* ===== Button ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: 50px; padding: 0 var(--sp-6); border-radius: var(--radius);
  font-size: 1rem; font-weight: 500; letter-spacing: -0.01em;
  border: none; cursor: pointer; transition: all var(--dur) var(--ease);
  text-decoration: none; width: 100%;
}
.btn svg { width: 20px; height: 20px; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--primary:active { transform: scale(0.98); }
.btn--secondary { background: var(--bg-tertiary); color: var(--accent); border: 1px solid var(--border); }
.btn--secondary:hover { background: var(--bg-secondary); }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent-light); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== Input ===== */
.input-group { margin-bottom: var(--sp-4); }
.input-label {
  display: block; font-size: 0.8125rem; font-weight: 500;
  color: var(--text-secondary); margin-bottom: var(--sp-2); padding-left: var(--sp-1);
}
.input {
  width: 100%; height: 50px; padding: 0 var(--sp-4);
  border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: var(--bg-tertiary); font-size: 1rem; font-family: inherit;
  color: var(--text); transition: all var(--dur) var(--ease); outline: none;
}
.input::placeholder { color: var(--text-tertiary); }
.input:focus { border-color: var(--accent); background: var(--bg); box-shadow: 0 0 0 3px var(--accent-light); }
.input--icon { padding-left: 44px; }
.input-wrap { position: relative; }
.input-wrap__icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); pointer-events: none; }
.input-wrap__icon svg { width: 18px; height: 18px; }

/* ===== Login Page ===== */
.login-page {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; padding: var(--sp-8) var(--sp-5); background: var(--bg);
}

.login-logo {
  width: 88px; height: 88px; border-radius: var(--radius-lg);
  background: #000; display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--sp-6); box-shadow: 0 8px 24px rgba(45, 42, 38, 0.2);
  overflow: hidden;
}
.login-logo img { width: 100%; height: 100%; object-fit: cover; }

.login-title { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; text-align: center; margin-bottom: var(--sp-2); }
.login-subtitle { font-size: 0.9375rem; color: var(--text-secondary); text-align: center; margin-bottom: var(--sp-8); max-width: 280px; }
.login-form { width: 100%; max-width: 360px; }
.login-footer { margin-top: var(--sp-8); text-align: center; font-size: 0.8125rem; color: var(--text-tertiary); }
.login-footer a { color: var(--accent); text-decoration: none; font-weight: 500; }

/* ===== Map ===== */
.map-container { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); position: relative; }
#map { width: 100%; height: 260px; z-index: 1; }

.map-overlay {
  position: absolute; bottom: var(--sp-3); left: var(--sp-3); right: var(--sp-3);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius); padding: var(--sp-3) var(--sp-4);
  display: flex; align-items: center; gap: var(--sp-3); z-index: 10;
}
.map-overlay__pin {
  width: 32px; height: 32px; border-radius: var(--radius-full);
  background: var(--orange-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.map-overlay__pin svg { width: 18px; height: 18px; color: var(--orange); }
.map-overlay__text { flex: 1; min-width: 0; }
.map-overlay__label { font-size: 0.6875rem; color: var(--text-secondary); font-weight: 500; }
.map-overlay__address { font-size: 0.8125rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Type Tabs (Masuk/Istirahat/Selesai/Pulang) ===== */
.type-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-1);
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: var(--sp-4);
}

.type-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: var(--sp-2) var(--sp-1);
  border: none; border-radius: var(--radius-sm);
  background: transparent; cursor: pointer;
  font-size: 0.6875rem; font-weight: 600; color: var(--text-secondary);
  transition: all var(--dur) var(--ease);
  position: relative;
}

.type-tab svg { width: 18px; height: 18px; }

.type-tab:hover { background: rgba(255,255,255,0.5); }

.type-tab--active { background: var(--surface); box-shadow: var(--shadow-sm); color: var(--text); }
.type-tab--active.type-tab--orange { color: var(--orange); }
.type-tab--active.type-tab--green { color: var(--green); }
.type-tab--active.type-tab--green-soft { color: var(--green-soft); }
.type-tab--active.type-tab--red { color: var(--red); }

.type-tab--done::after {
  content: ''; position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; border-radius: var(--radius-full);
  background: var(--green);
  border: 2px solid var(--surface);
}

/* ===== Upload Area ===== */
.upload-area {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--sp-8) var(--sp-5);
  text-align: center; cursor: pointer;
  transition: all var(--dur) var(--ease);
  background: var(--bg-tertiary); position: relative;
}
.upload-area:hover { border-color: var(--accent); background: var(--accent-light); }
.upload-area.drag-over { border-color: var(--accent); background: var(--accent-light); transform: scale(1.01); }

.upload-area__icon {
  width: 48px; height: 48px; border-radius: var(--radius-full);
  background: var(--accent-light); display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--sp-4);
}
.upload-area__icon svg { width: 24px; height: 24px; color: var(--accent); }
.upload-area__title { font-size: 0.9375rem; font-weight: 600; margin-bottom: var(--sp-1); }
.upload-area__subtitle { font-size: 0.8125rem; color: var(--text-secondary); }
.upload-area__actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-5); }
.upload-area__actions .btn { flex: 1; }

/* ===== Upload Preview ===== */
.upload-preview { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); position: relative; }
.upload-preview__img { width: 100%; display: block; max-height: 300px; object-fit: cover; }
.upload-preview__overlay { position: absolute; top: var(--sp-3); right: var(--sp-3); display: flex; gap: var(--sp-2); }
.upload-preview__btn {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(8px);
  border: none; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text); transition: background var(--dur) var(--ease);
}
.upload-preview__btn:hover { background: #fff; }
.upload-preview__btn svg { width: 18px; height: 18px; }
.upload-preview__info { padding: var(--sp-3) var(--sp-4); display: flex; align-items: center; gap: var(--sp-2); background: var(--surface); }
.upload-preview__info svg { width: 16px; height: 16px; color: var(--green); }
.upload-preview__filename { font-size: 0.8125rem; font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-preview__filesize { font-size: 0.75rem; color: var(--text-secondary); }

/* ===== Gallery ===== */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}

.gallery-item {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all var(--dur) var(--ease);
}

.gallery-item:active { transform: scale(0.98); }

.gallery-item__photo {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg-secondary);
}

.gallery-item__img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

.gallery-item__badge {
  position: absolute; top: var(--sp-2); left: var(--sp-2);
  padding: 3px var(--sp-2); border-radius: var(--radius-full);
  font-size: 0.625rem; font-weight: 600; color: #fff;
  backdrop-filter: blur(8px);
}

.gallery-item__badge--orange { background: rgba(244, 107, 74, 0.9); }
.gallery-item__badge--green { background: rgba(122, 133, 63, 0.9); }
.gallery-item__badge--green-soft { background: rgba(156, 165, 88, 0.9); }
.gallery-item__badge--red { background: rgba(139, 35, 50, 0.9); }

.gallery-item__info {
  padding: var(--sp-2) var(--sp-3);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
}

.gallery-item__type { font-size: 0.75rem; font-weight: 600; }
.gallery-item__time { font-size: 0.6875rem; color: var(--text-secondary); }

/* Empty gallery slot */
.gallery-item--empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  aspect-ratio: 4/3;
  border: 2px dashed var(--border);
  background: var(--bg-tertiary);
  gap: var(--sp-1);
}

.gallery-item--empty svg { width: 24px; height: 24px; color: var(--text-tertiary); }
.gallery-item--empty span { font-size: 0.6875rem; color: var(--text-tertiary); font-weight: 500; }
.gallery-item--empty .gallery-item__empty-label { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }

.gallery-item__label {
  display: block; padding: var(--sp-2) var(--sp-3);
  font-size: 0.75rem; font-weight: 600; text-align: center;
  background: var(--surface); color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

/* ===== Utility ===== */
.mt-4 { margin-top: var(--sp-4); }
.text-muted { color: var(--text-secondary); font-size: 0.875rem; }

/* ===== Status Info ===== */
.status-info { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); }
.status-info__icon { width: 40px; height: 40px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.status-info__icon svg { width: 20px; height: 20px; }
.status-info__icon--green { background: var(--green-light); color: var(--green); }
.status-info__icon--orange { background: var(--orange-light); color: var(--orange); }
.status-info__icon--red { background: var(--red-light); color: var(--red); }
.status-info__icon--blue { background: var(--blue-light); color: var(--blue); }
.status-info__body { flex: 1; }
.status-info__label { font-size: 0.75rem; color: var(--text-secondary); }
.status-info__value { font-size: 0.9375rem; font-weight: 600; margin-top: 1px; }

/* ===== Detail Row ===== */
.detail-row { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-3) var(--sp-5); }
.detail-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.detail-row__label { font-size: 0.875rem; color: var(--text-secondary); }
.detail-row__value { font-size: 0.875rem; font-weight: 500; }

/* ===== Month Selector ===== */
.month-selector { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-4); }
.month-selector__btn {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  border: 1px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--accent); transition: all var(--dur) var(--ease);
}
.month-selector__btn:hover { background: var(--bg-secondary); }
.month-selector__btn:disabled { opacity: 0.3; cursor: not-allowed; }
.month-selector__btn svg { width: 18px; height: 18px; }
.month-selector__label { font-size: 1rem; font-weight: 600; letter-spacing: -0.02em; }

/* ===== Search Bar ===== */
.search-bar {
  display: flex; align-items: center; gap: var(--sp-2);
  background: var(--bg-tertiary); border-radius: var(--radius);
  padding: 0 var(--sp-4); height: 40px; margin-bottom: var(--sp-4);
  border: 1px solid transparent; transition: border var(--dur) var(--ease);
}
.search-bar:focus-within { border-color: var(--accent); }
.search-bar svg { width: 18px; height: 18px; color: var(--text-tertiary); flex-shrink: 0; }
.search-bar input { flex: 1; border: none; background: none; outline: none; font-size: 0.9375rem; font-family: inherit; color: var(--text); }
.search-bar input::placeholder { color: var(--text-tertiary); }

/* ===== Filter Chips ===== */
.filter-chips {
  display: flex; gap: var(--sp-2); margin-bottom: var(--sp-4);
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  padding: 6px var(--sp-3); border-radius: var(--radius-full);
  font-size: 0.8125rem; font-weight: 500;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-secondary); cursor: pointer; white-space: nowrap;
  transition: all var(--dur) var(--ease);
}
.chip:hover { border-color: var(--border-strong); }
.chip--active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: var(--sp-12) var(--sp-5); }
.empty-state__icon { width: 56px; height: 56px; border-radius: var(--radius-full); background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; margin: 0 auto var(--sp-4); }
.empty-state__icon svg { width: 28px; height: 28px; color: var(--text-tertiary); }
.empty-state__title { font-size: 1rem; font-weight: 600; margin-bottom: var(--sp-1); }
.empty-state__subtitle { font-size: 0.875rem; color: var(--text-secondary); }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text); color: #fff;
  padding: var(--sp-3) var(--sp-5); border-radius: var(--radius-full);
  font-size: 0.875rem; font-weight: 500; z-index: 9999;
  transition: transform 0.3s var(--ease-spring);
  display: flex; align-items: center; gap: var(--sp-2); max-width: 90%;
  box-shadow: var(--shadow-xl);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast svg { width: 18px; height: 18px; }

/* ===== Modal / Bottom Sheet ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 200;
  opacity: 0; visibility: hidden; transition: opacity var(--dur) var(--ease);
}
.modal-overlay.show { opacity: 1; visibility: visible; }

.bottom-sheet {
  position: fixed; bottom: 0; left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%; max-width: 480px; background: var(--bg);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 201; transition: transform 0.3s var(--ease);
  padding: var(--sp-2) var(--sp-5) var(--sp-6);
  box-shadow: var(--shadow-xl);
}
.bottom-sheet.show { transform: translateX(-50%) translateY(0); }
.bottom-sheet__handle { width: 36px; height: 5px; border-radius: var(--radius-full); background: var(--border-strong); margin: 0 auto var(--sp-4); }
.bottom-sheet__title { font-size: 1.125rem; font-weight: 600; margin-bottom: var(--sp-2); }
.bottom-sheet__subtitle { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: var(--sp-5); }

/* ===== Stat Summary ===== */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); margin-bottom: var(--sp-5); }
.stat-card { background: var(--surface); border-radius: var(--radius); padding: var(--sp-3) var(--sp-2); text-align: center; border: 1px solid var(--border); }
.stat-card__value { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; }
.stat-card__label { font-size: 0.6875rem; color: var(--text-secondary); font-weight: 500; margin-top: 2px; }
.stat-card--green .stat-card__value { color: var(--green); }
.stat-card--orange .stat-card__value { color: var(--orange); }
.stat-card--red .stat-card__value { color: var(--red); }

/* ===== Leaflet Custom Marker ===== */
.custom-pin {
  width: 32px; height: 32px;
  background: var(--orange);
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.custom-pin::after {
  content: ''; width: 10px; height: 10px; background: #fff;
  border-radius: 50%; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

.leaflet-popup-content-wrapper { border-radius: var(--radius) !important; box-shadow: var(--shadow-lg) !important; }
.leaflet-popup-content { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif !important; font-size: 0.875rem !important; margin: 12px 16px !important; }

/* ===== Utility ===== */
.text-center { text-align: center; }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.hidden { display: none !important; }

/* ===== Animations ===== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeInUp 0.4s var(--ease) both; }
.fade-in-delay-1 { animation-delay: 0.05s; }
.fade-in-delay-2 { animation-delay: 0.1s; }
.fade-in-delay-3 { animation-delay: 0.15s; }

/* ===== Focus Visible ===== */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus-visible, a:focus-visible { outline-offset: 2px; border-radius: var(--radius-sm); }

/* ===== Spinner ===== */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--accent-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
