/* ============================================
   Tek Pencere Sistemi (TPS) — Linear-Inspired Design System
   ============================================ */

/* View Transitions API Theme Switch Animation */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  z-index: 1;
}

::view-transition-new(root) {
  z-index: 9999;
}

[data-theme="dark"]::view-transition-old(root) {
  z-index: 9999;
}

[data-theme="dark"]::view-transition-new(root) {
  z-index: 1;
}
/* ── Loading spinner ─────────────────────────────────────────────────── */
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(94, 106, 210, 0.2);
  border-top-color: #5e6ad2;
  border-radius: 50%;
  animation: spinner-rotate 0.75s linear infinite;
  margin: 0 auto;
}

/* Blocking loader — full-viewport <dialog> (top layer). Mirrors .vc-overlay:
   the dim background sits on the element (UA box centering is neutralised) and
   ::backdrop is transparent, so it reliably covers + centers above modals. */
.app-loader {
  position: fixed;
  inset: 0;
  z-index: 10060;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  border: 0;
  padding: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}
.app-loader[open] { display: flex; }
.app-loader::backdrop { background: transparent; }
.app-loader__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 28px 36px;
  max-width: 80vw;
  background: var(--surface, #fff);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
.app-loader__msg {
  max-width: 220px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
}

@keyframes spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}


/* ── CSS Variables — Linear Light (inverse palette) ──────────────────── */
:root {
  /* Surface ladder — Linear inverse */
  --bg-primary: #f5f6f6;
  --bg-secondary: #ffffff;
  --bg-tertiary: #edeef0;
  --bg-card: #ffffff;
  --bg-hover: #e8e9ec;

  --bg: #f5f6f6;
  --surface: #ffffff;
  --surface-2: #f5f6f6;

  /* Ink */
  --text-primary: #0a0a0b;
  --text-secondary: #62666d;
  --text-muted: #8a8f98;

  /* Accent — Linear lavender-blue */
  --accent: #5e6ad2;
  --accent-hover: #828fff;
  --accent-glow: rgba(94, 106, 210, 0.12);

  /* Semantic */
  --green: #27a644;
  --green-bg: rgba(39, 166, 68, 0.1);
  --yellow: #e09400;
  --yellow-bg: rgba(224, 148, 0, 0.1);
  --red: #d94b4b;
  --red-bg: rgba(217, 75, 75, 0.1);
  --gray: #8a8f98;
  --gray-bg: rgba(138, 143, 152, 0.1);

  /* Borders — hairline style */
  --border: #d8dadf;
  --border-light: #edeef0;

  /* Shadows — minimal, Linear prefers hairlines */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.10);
  --shadow-glow: 0 0 0 2px rgba(94, 106, 210, 0.5);

  /* Border Radius — Linear scale */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* Font — Inter as Linear substitute */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Inter', sans-serif;
  --font-label: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  /* Theme-switchable tokens */
  --map-outline-shadow: rgba(0, 0, 0, 0.12);
  --overlay-bg: rgba(245, 246, 246, 0.85);
  --overlay-strong: rgba(245, 246, 246, 0.95);
  --hover-subtle: rgba(10, 10, 11, 0.04);
  --btn-success-hover: #1f8c38;
  --btn-danger-hover: #c13e3e;
}

/* ============================================
   DARK THEME — Linear canonical dark canvas
   ============================================ */
[data-theme="dark"] {
  /* Surface ladder — 4-step */
  --bg-primary: #010102;
  --bg-secondary: #0f1011;
  --bg-tertiary: #141516;
  --bg-card: #0f1011;
  --bg-hover: #18191a;

  --bg: #010102;
  --surface: #0f1011;
  --surface-2: #141516;

  /* Ink */
  --text-primary: #f7f8f8;
  --text-secondary: #d0d6e0;
  --text-muted: #8a8f98;

  /* Accent — same lavender */
  --accent: #5e6ad2;
  --accent-hover: #828fff;
  --accent-glow: rgba(94, 106, 210, 0.15);

  /* Borders — hairline */
  --border: #23252a;
  --border-light: #34343a;

  /* Shadows — near-invisible on dark, rely on hairlines */
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 0 2px rgba(94, 106, 210, 0.5);

  --map-outline-shadow: rgba(255, 255, 255, 0.15);
  --overlay-bg: rgba(1, 1, 2, 0.85);
  --overlay-strong: rgba(1, 1, 2, 0.95);
  --hover-subtle: rgba(247, 248, 248, 0.05);
}

/* Province colors — light theme overrides */
[data-theme="light"] .province--green {
  fill: #c8e6c9;
  stroke: #81c784;
}

[data-theme="light"] .province--yellow {
  fill: #ffe0b2;
  stroke: #ffb74d;
}

[data-theme="light"] .province--red {
  fill: #ffcdd2;
  stroke: #e57373;
}

@media (hover: hover) and (pointer: fine) {
  [data-theme="light"] .province--green:hover {
    fill: #a5d6a7;
    stroke: #66bb6a;
  }

  [data-theme="light"] .province--yellow:hover {
    fill: #ffcc80;
    stroke: #ffa726;
  }

  [data-theme="light"] .province--red:hover {
    fill: #ef9a9a;
    stroke: #ef5350;
  }

  [data-theme="light"] .province--inactive:hover {
    fill: #cdd0e0;
  }
}

/* ── Light-theme map visibility improvements ──────────────────────────
   Only applied when data-theme="light" — dark mode is unaffected.
   1. Map container gets a soft blue-gray background (sea effect).
   2. Inactive provinces get a clearly visible slate fill.
   3. SVG drop-shadow is stronger so the Turkey outline reads against bg.
   ───────────────────────────────────────────────────────────────────── */
[data-theme="light"] .map-container {
  border-radius: 16px;
}

[data-theme="light"] #turkey-svg-wrapper svg,
[data-theme="light"] #country-svg-wrapper svg,
[data-theme="light"] #ilce-svg-map svg {
  filter: drop-shadow(0 2px 12px rgba(30, 64, 130, 0.18)) drop-shadow(0 0 1px rgba(30, 64, 130, 0.12));
}

[data-theme="dark"] #turkey-svg-wrapper svg,
[data-theme="dark"] #country-svg-wrapper svg,
[data-theme="dark"] #ilce-svg-map svg {
  /* Heavy drop-shadow removed for performance and design preference */
  filter: none;
}


[data-theme="light"] .province-path {
  fill: #e6eaf2;
  stroke: #8d9bb0 !important;
  stroke-width: 0.8 !important;
}

/* --- Reporter's Assigned City Highlight --- */
@keyframes map-pop-anim {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 2px var(--accent));
  }

  50% {
    transform: scale(1.03);
    filter: drop-shadow(0 0 12px var(--accent));
  }

  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 2px var(--accent));
  }
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
}

/* --- Interactive Elements Reset --- */
button,
a,
select,
input,
.notification-badge {
  -webkit-tap-highlight-color: transparent;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Layout --- */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- Header --- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-bottom: 4px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
}

[data-theme="dark"] .header {
  background: var(--bg-primary);
}

/* Chrome bars (header + bottom nav) are UI, not content: kill the mobile
   double-tap-to-zoom, the text-selection magnifier, the long-press callout and
   the grey tap flash so taps feel native and nothing "zooms/scales". */
.header,
.bottom-nav {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.header__logo {
  font-size: 1.1rem;
  font-weight: 600;
  font-family: var(--font);
  text-transform: none;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.4px;
}

.header__logo-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* --- Action Buttons Container --- */
.header__action-buttons {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* --- Mobile Bottom Navigation --- */
.bottom-nav {
  display: none; /* Hidden on desktop */
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0px); /* iPhone notch support */
}

[data-theme="dark"] .bottom-nav {
  background: var(--bg-primary);
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  font-family: var(--font);
  cursor: pointer;
  transition: color 0.2s ease;
}

.bottom-nav__item .material-symbols-outlined {
  font-size: 24px;
  margin-bottom: 4px;
}

.bottom-nav__label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bottom-nav__item.active,
.bottom-nav__item:hover {
  color: var(--accent);
}

/* Manager layout: İstatistikler · Harita (center) · Yönetim */
.bottom-nav--manager #bn-dashboard { order: 1; }
.bottom-nav--manager #bn-map { order: 2; }
.bottom-nav--manager #bn-manager-panel { order: 3; }

/* ── In-app video recorder (VideoRecorder) ───────────────────────────────── */
.vr-dialog {
  padding: 0;
  border: none;
  background: #000;
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  margin: 0;
  overflow: hidden;
}
.vr-dialog::backdrop { background: #000; }
.vr-stage { position: relative; width: 100vw; height: 100dvh; background: #000; }
.vr-live, .vr-review {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  background: #000;
}
.vr-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
  z-index: 2;
}
.vr-timer {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,0.55); color: #fff;
  padding: 5px 12px; border-radius: 20px;
  font-weight: 700; font-size: 0.9rem; font-variant-numeric: tabular-nums;
}
.vr-timer::before {
  content: ''; width: 9px; height: 9px; border-radius: 50%;
  background: #ef4444; animation: vrPulse 1s ease-in-out infinite;
}
@keyframes vrPulse { 0%,100%{opacity:1} 50%{opacity:0.25} }
.vr-x {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(0,0,0,0.55); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.vr-controls {
  position: absolute; left: 0; right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 28px);
  display: flex; align-items: center; justify-content: center; gap: 16px;
  z-index: 2;
}
.vr-rec {
  width: 74px; height: 74px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 4px solid #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.vr-dot {
  width: 30px; height: 30px; border-radius: 50%;
  background: #ef4444; transition: all 0.15s ease;
}
.vr-rec--on .vr-dot { width: 26px; height: 26px; border-radius: 6px; } /* stop square */
.vr-review-actions { display: flex; align-items: center; gap: 12px; }
.vr-review-actions .vr-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 20px; border-radius: 24px; border: none; cursor: pointer;
  font-family: var(--font); font-weight: 700; font-size: 0.95rem;
}
.vr-retake { background: rgba(255,255,255,0.18); color: #fff; }
.vr-use { background: var(--accent); color: #fff; }

/* Instagram-style center "+" FAB — elevated accent circle for field staff. */
.bottom-nav__fab {
  flex: 0 0 auto;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0 10px;
  transform: translateY(-14px);
  border: 3px solid var(--bg-secondary);
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
[data-theme="dark"] .bottom-nav__fab {
  border-color: var(--bg-primary);
}
.bottom-nav__fab .material-symbols-outlined {
  font-size: 30px;
  color: #fff;
  margin: 0;
}
.bottom-nav__fab:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.bottom-nav__fab:active {
  transform: translateY(-14px) scale(0.94);
}

/* Şube picker (the "+" → choose branch list) */
.sube-pick-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 50vh;
  overflow-y: auto;
}
.sube-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.sube-pick:hover {
  background: var(--bg-tertiary, rgba(128, 128, 128, 0.08));
  border-color: var(--accent);
}
.sube-pick__name {
  flex: 1;
  font-weight: 600;
}
.sube-pick .material-symbols-outlined {
  font-size: 20px;
  color: var(--accent);
}
.sube-pick__chevron {
  color: var(--text-secondary) !important;
}

/* --- Responsive Media Queries --- */
@media (max-width: 768px) {
  .header__action-buttons {
    display: none !important; /* Hide header buttons on mobile */
  }
  
  .bottom-nav {
    display: flex; /* Show bottom nav on mobile */
  }

  /* Add padding to bottom of screen so UI doesn't hide behind nav */
  .main,
  #screen-manager,
  #screen-dashboard {
    padding-bottom: 70px;
  }
  
  /* Adjust map controls to stay above bottom nav */
  .map-controls {
    bottom: 80px !important;
  }
  .map-legend {
    bottom: 80px !important;
  }
  
}

/* "Haritaya Dön" header buttons are redundant on a phone in PORTRAIT — the
   bottom-nav Harita icon returns to the map. Hide them there; keep them in
   landscape (and on desktop, which has no bottom nav). */
@media (max-width: 768px) and (orientation: portrait) {
  #btn-back-to-map,
  #btn-back-to-map-dash,
  #btn-client-admin-back,
  #btn-personel-admin-back {
    display: none !important;
  }
}

/* Header nav buttons */
.header__nav .btn--secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-color: var(--border);
}

.header__nav .btn--secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
  color: var(--text-primary);
}

.header__nav .btn--secondary,
[data-theme="dark"] .header__nav .btn--secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: transparent;
  box-shadow: 0 0 0 2px rgba(94, 106, 210, 0.5), 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header__nav .btn--secondary:hover,
[data-theme="dark"] .header__nav .btn--secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.header__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 13px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.header__user:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

[data-theme="dark"] .header__user {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border);
}

[data-theme="dark"] .header__user:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.header__user-role {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header__user-role--manager {
  background: var(--accent-glow);
  color: var(--accent);
}

.header__user-role--reporter {
  background: var(--green-bg);
  color: var(--green);
}

.header__user-role--fixer {
  background: var(--yellow-bg);
  color: var(--yellow);
}

/* Personel — unified staff role (on-brand accent). */
.header__user-role--personel {
  background: var(--accent-bg, rgba(94, 106, 210, 0.12));
  color: var(--accent);
}

/* --- Notification Badge --- */
.notification-badge {
  position: relative;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.notification-badge:hover {
  background: var(--bg-hover);
}

.notification-badge__icon {
  font-size: 1.25rem;
}

.notification-badge__count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 99px;
  padding: 0 4px;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--bg-secondary);
}

.notification-badge__count.hidden {
  display: none;
}

/* --- Main Content --- */
.main {
  flex: 1;
  display: flex;
  position: relative;
}

/* --- Screen Sections --- */
.screen {
  display: none !important;
  width: 100%;
  flex: 1;
  animation: fadeIn var(--transition-normal);
}

.screen.active {
  display: flex !important;
  flex-direction: column;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Auth Screens --- */
.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--bg-primary);
}

.auth__card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.brand-text {
  font-family: var(--font);
  font-weight: 600;
  text-transform: none;
  color: var(--accent);
  letter-spacing: -0.03em;
}

.auth__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.auth__subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 32px;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Ensure inputs are visible by using bg-tertiary */
.app .form-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9375rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.app .form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
  background: var(--bg-secondary);
}

.app .form-input::placeholder,
.app .form-textarea::placeholder,
.app .form-select::placeholder {
  color: var(--text-muted);
  opacity: 0.4;
  font-style: italic;
  font-weight: 400;
}

/* Ensure select drops are visible in light theme */
.app .form-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239ca3b4' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.app .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-secondary);
}

/* Ensure textareas are visible in light theme */
.app .form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  resize: vertical;
  min-height: 100px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.app .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-secondary);
}

/* Custom Select (Category with Icons) */
.custom-select-wrapper {
  position: relative;
  width: 100%;
  outline: none;
}

.custom-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all var(--transition-fast);
  max-height: 250px;
  overflow-y: auto;
}

.custom-select-wrapper.open .custom-select-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: background var(--transition-fast);
}

.custom-select-option:hover {
  background: var(--bg-hover);
}

/* ── Dark theme: force correct backgrounds on form elements ────────── */
[data-theme="dark"] .app .form-input {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border);
}

[data-theme="dark"] .app .form-input::placeholder,
[data-theme="dark"] .app .form-textarea::placeholder,
[data-theme="dark"] .app .form-select::placeholder {
  color: var(--text-muted);
  opacity: 0.4;
}

[data-theme="dark"] .app .form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
  background: var(--surface);
}

[data-theme="dark"] .app .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

[data-theme="dark"] .app .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

[data-theme="dark"] .app .form-select {
  background-color: var(--surface);
  color: var(--text-primary);
  border-color: var(--border);
}

[data-theme="dark"] .app .form-select option {
  background: var(--surface);
  color: var(--text-primary);
}

[data-theme="dark"] .app .form-textarea {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border);
}

/* Rely on base placeholder */

/* ── Priority selector buttons ───────────────────────────────────────── */
.priority-selector {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.priority-opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 99px;
  border: 1.5px solid transparent;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font);
}

.priority-opt .material-symbols-outlined {
  font-size: 14px;
}

/* Kritik = red */
.priority-opt--kritik .material-symbols-outlined {
  color: #e53935;
}

.priority-opt--kritik:hover,
.priority-opt--kritik.selected {
  border-color: #e53935;
  background: rgba(229, 57, 53, 0.12);
  color: #e53935;
}

/* Orta = orange */
.priority-opt--orta .material-symbols-outlined {
  color: #f57c00;
}

.priority-opt--orta:hover,
.priority-opt--orta.selected {
  border-color: #f57c00;
  background: rgba(245, 124, 0, 0.12);
  color: #f57c00;
}

/* Düşük = green */
.priority-opt--dusuk .material-symbols-outlined {
  color: #43a047;
}

.priority-opt--dusuk:hover,
.priority-opt--dusuk.selected {
  border-color: #43a047;
  background: rgba(67, 160, 71, 0.12);
  color: #43a047;
}

/* ── Custom category dropdown ────────────────────────────────────────── */
.cat-dropdown {
  position: relative;
}

.cat-dropdown__trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: border-color 0.15s ease;
  user-select: none;
}

[data-theme="dark"] .cat-dropdown__trigger {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-primary);
}

.cat-dropdown__trigger:hover {
  border-color: var(--accent);
}

.cat-dropdown__icon {
  display: flex;
  align-items: center;
  line-height: 1;
}

.cat-dropdown__label {
  flex: 1;
  font-weight: 500;
}

.cat-dropdown__arrow {
  font-size: 18px;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.cat-dropdown__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 500;
  overflow: hidden;
}

[data-theme="dark"] .cat-dropdown__menu {
  background: var(--surface);
  border-color: var(--border);
}

.cat-dropdown__menu.hidden {
  display: none;
}

.cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-primary);
  transition: background 0.12s ease;
}

[data-theme="dark"] .cat-item {
  color: var(--text-primary);
}

.cat-item:hover {
  background: var(--bg-hover);
}

[data-theme="dark"] .cat-item:hover {
  background: var(--bg-hover);
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.form-error {
  font-size: 0.825rem;
  color: var(--red);
  margin-top: 4px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-weight: 500;
  letter-spacing: 0;
}

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

.btn--primary:active {
  background: #5e69d1;
}

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

.btn--secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.btn--success {
  background: var(--green);
  color: #fff;
}

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

.btn--danger {
  background: var(--red);
  color: #fff;
}

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

.btn--small {
  padding: 6px 12px;
  font-size: 0.8rem;
  height: 32px;
}

/* AI Button Style */
.btn-ai {
  position: relative;
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  background: linear-gradient(100deg, #5e6ad2 0%, #c850c0 50%, #5e6ad2 100%);
  background-size: 200% auto;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(200, 80, 192, 0.3);
  animation: gradientShift 3s linear infinite;
  transition: all 0.3s ease;
  cursor: pointer;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.btn-ai .material-symbols-outlined {
  font-size: 18px;
  color: #ffffff;
}

.btn-ai:hover {
  transform: translateY(-2px);
  animation: gradientShift 1.5s linear infinite;
  box-shadow: 0 4px 16px rgba(200, 80, 192, 0.5);
}

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





.btn--full {
  width: 100%;
}

.btn--icon {
  padding: 8px;
  border-radius: var(--radius-sm);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* --- Role Selector --- */
.role-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.role-option {
  flex: 1;
  padding: 16px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.role-option:hover {
  border-color: var(--border-light);
  background: var(--bg-hover);
}

.role-option.selected {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.role-option__icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.role-option__name {
  font-size: 0.9rem;
  font-weight: 600;
}

.role-option__desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* --- Pending Screen --- */
.pending {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 24px;
}

.pending__icon {
  font-size: 4rem;
  margin-bottom: 24px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.pending__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.pending__text {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* --- Map Screen --- */
.map-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  overflow: hidden;
  min-height: 0;
  /* prevents flex child from growing beyond allocation */
  /* GPU compositing layer — isolates Globe.gl canvas from surrounding
     DOM repaints (bug-panel open, overlays) to prevent flicker */
  will-change: transform;
  isolation: isolate;
}

/* Globe.gl polygon label tooltip — ensure it's visible */
.map-container .scene-tooltip {
  z-index: 1000 !important;
  pointer-events: none;
}

/* Globe.gl canvas must fill container without expanding it */
.map-container>div:first-child {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  /* Prevent reflow propagation from canvas to parent */
  contain: strict;
}

/* Search panel must never be clipped even if it ends up as first-child */
.map-container > .map-search-panel,
.map-container > .map-search-toggle {
  contain: none !important;
  position: absolute !important;
}

/* Globe.gl canvas glow — helps globe stand out from dark background */
[data-theme="dark"] .map-container>div:first-child canvas {
  filter: drop-shadow(0 0 40px rgba(94, 106, 210, 0.12)) drop-shadow(0 0 80px rgba(255, 255, 255, 0.04));
}

[data-theme="light"] .map-container>div:first-child canvas {
  filter: drop-shadow(0 2px 16px rgba(30, 64, 130, 0.12));
}

/* Turkey SVG wrapper (overlays globe when Turkey is selected) */
#turkey-svg-wrapper {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  overflow: hidden;
}

/* Universal country SVG map wrapper */
#country-svg-wrapper {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  overflow: hidden;
}

/* İlçe (District) SVG map — mirrors #country-svg-wrapper layout */
#ilce-svg-map {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  overflow: hidden;
}

/* SVG sizing — identical to #country-svg-wrapper svg */
#ilce-svg-map svg {
  width: 100%;
  max-width: 1100px;
  height: auto;
  max-height: 100%;
  outline: none;
  touch-action: none;
}

#ilce-svg-map svg path {
  touch-action: manipulation;
}

.ilce-map-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
}

.ilce-map-loading .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent, #5e6ad2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

#country-svg-wrapper svg {
  width: 100%;
  max-width: 1100px;
  height: auto;
  max-height: 100%;
  outline: none;
  touch-action: none;
}

/* Country SVG paths — touch and cursor (mirrors .map-container g for Turkey) */
#country-svg-wrapper svg path {
  touch-action: manipulation;
  cursor: pointer;
}

.country-map-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
}

.country-map-loading .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent, #5e6ad2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Globe UI Overlays (moved from inline JS in map.js) ──────────── */

/* Back to globe button */
.globe-back-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 25;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  justify-content: center;
  padding: 0;
  font-size: 0.82rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 4px;
  transition: opacity 0.3s, transform 0.3s, background 0.15s, box-shadow 0.2s;
  opacity: 0;
  transform: translateY(-8px);
}

.globe-back-btn.visible {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.globe-back-btn.visible:hover {
  background: color-mix(in srgb, var(--text-primary) 10%, var(--bg-secondary));
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px rgba(94, 106, 210, 0.5), 0 6px 20px rgba(0, 0, 0, 0.2);
}

.globe-back-btn,
[data-theme="dark"] .globe-back-btn {
  border-color: transparent;
  box-shadow: 0 0 0 2px rgba(94, 106, 210, 0.5), 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Quick-access country panel */
.globe-countries-panel {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.4s, transform 0.4s;
  pointer-events: none;
}

.globe-countries-panel.visible {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* Country flag button on globe panel */
.globe-country-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  position: relative;
}

.globe-country-btn,
[data-theme="dark"] .globe-country-btn {
  border-color: transparent;
  box-shadow: 0 0 0 2px rgba(94, 106, 210, 0.5), 0 2px 8px rgba(0, 0, 0, 0.15);
}

.globe-country-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 4px 16px rgba(94, 106, 210, 0.3);
  background: color-mix(in srgb, var(--text-primary) 8%, var(--bg-secondary));
}

.globe-country-btn:active {
  transform: scale(0.95);
}

.globe-country-btn .country-label {
  position: absolute;
  left: calc(100% + 8px);
  white-space: nowrap;
  font-size: 0.72rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 3px 8px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s, transform 0.15s;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.globe-country-btn:hover .country-label {
  opacity: 1;
  transform: translateX(0);
}

.city-tooltip {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  color: var(--text-primary) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 0.8rem !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
  padding: 6px 10px !important;
}

.city-tooltip::before {
  border-top-color: var(--border) !important;
}

/* Persistent city name labels on 2D map (like old SVG province names) */
.city-name-label {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text-primary) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7), 0 0 6px rgba(0, 0, 0, 0.5) !important;
  padding: 0 !important;
  white-space: nowrap !important;
}

[data-theme="light"] .city-name-label {
  color: #222 !important;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8) !important;
}


.city-popup {
  text-align: center;
  padding: 4px;
}

.city-popup strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.city-popup__count {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary, #a0a0a0);
}

.map-container svg {
  width: 100%;
  max-width: 1100px;
  height: auto;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

/* Province path base style */
.province-path {
  fill: var(--bg-tertiary);
  stroke: var(--border) !important;
  stroke-width: 0.6 !important;
  vector-effect: non-scaling-stroke;
  /* transition removed for map performance on mobile */
}

[data-theme="dark"] .province-path {
  fill: #242436;
  /* Opaque equivalent of rgba(55,55,75,0.6) over dark background */
  stroke: #54546D !important;
  /* Slightly whiter/lighter than before */
  stroke-width: 0.6 !important;
}

/* Hover effect — class toggled by JS (survives appendChild reordering) */
path.province-path--hover {
  filter: brightness(1.3);
  stroke-width: 1.8px !important;
  vector-effect: non-scaling-stroke;
}

[data-theme="dark"] path.province-path--hover {
  stroke: #fff !important;
}

[data-theme="light"] path.province-path--hover {
  stroke: var(--accent) !important;
}

/* Active/Selected province (unified style for tap and swipe) */
path.province-path--active {
  stroke: #fff !important;
  stroke-width: 2.5px !important;
  vector-effect: non-scaling-stroke;
  z-index: 999;
}

[data-theme="light"] path.province-path--active {
  stroke: var(--accent) !important;
}

[data-theme="dark"] path.province-path--active {
  stroke: #fff !important;
}

/* ── Critical Province Pulsing (Police Siren Effect) ── */
@keyframes police-siren {
  50% {
    fill: var(--red);
    filter: drop-shadow(0 0 8px rgba(217, 75, 75, 0.8));
  }
}

.province--critical {
  animation: police-siren 2s infinite ease-in-out;
  transform: translateZ(0); /* Hardware acceleration and stacking */
}

/* Touch-action: eliminate 300ms delay on tap, allow pinch zoom */
.map-container g {
  touch-action: manipulation;
  cursor: pointer;
}

/* Pinch-zoom on SVG — transform handled by JS */
.map-container svg {
  touch-action: none;
  /* JS handles all touch gestures */
  transform-origin: 0 0;
  transition: none;
  /* No CSS transitions — transform is set by JS directly */
}

/* Reset button for map */
.map-reset-btn {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.map-reset-btn,
[data-theme="dark"] .map-reset-btn {
  border-color: transparent;
  box-shadow: 0 0 0 2px rgba(94, 106, 210, 0.5), 0 2px 8px rgba(0, 0, 0, 0.15);
}

.map-reset-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Map Tooltip */
.map-tooltip {
  position: fixed;
  z-index: 500;
  padding: 6px 14px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

/* Rich tooltip for branch markers */
.map-tooltip--rich {
  white-space: normal;
  min-width: 180px;
  max-width: 280px;
  padding: 10px 14px;
  border-radius: var(--radius-md, 10px);
  background: var(--bg-secondary, #1e1e2e);
  border: 1px solid var(--border-light);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 400;
  font-size: 0.78rem;
  line-height: 1.4;
}
.map-tooltip--rich strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
  display: block;
}
.tt-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}
.tt-icon {
  flex-shrink: 0;
  font-size: 15px;
  width: 18px;
  text-align: center;
  color: var(--text-muted);
  vertical-align: middle;
}
.tt-bugs {
  color: #ef4444;
  font-weight: 600;
}
.tt-ok {
  color: #22c55e;
  font-weight: 600;
}

/* Globe country name tooltip (on hover) */
.globe-country-tooltip {
  padding: 6px 14px;
  background: var(--bg-primary, #1a1a2e);
  color: var(--text-primary, #e8e8ed);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border-light, #2e2e3a);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  letter-spacing: 0.3px;
}

/* Mobile city info bar — shown on tap instead of tooltip */
.map-city-bar {
  position: fixed;
  top: 50%;
  left: 0;
  right: 0;
  margin: -30px auto 0 auto;
  width: max-content;
  max-width: calc(100vw - 48px);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 10px 24px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: var(--shadow-xl);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: normal;
  text-align: center;
  z-index: 500;
  /* To give animation effect without transform */
  animation: none;
}

.map-city-bar.map-city-bar--animating {
  animation: slideUpFade 0.2s ease-out forwards;
}

@keyframes slideUpFade {
  0% {
    opacity: 0;
    top: 52%;
  }

  100% {
    opacity: 1;
    top: 50%;
  }
}

.map-city-bar.visible {
  opacity: 1;
}

.map-city-bar__status {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 6px;
  font-weight: 400;
}

/* ── City Dropdown Card (mobile first-tap info) ─────────────────── */
.city-dropdown-card {
  position: fixed;
  z-index: 510;
  width: max-content;
  min-width: 180px;
  max-width: calc(100vw - 32px);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 0;
  box-shadow: var(--shadow-xl);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
  transform-origin: top left;
  transition: opacity 0.2s ease, transform 0.2s ease;
  overflow: hidden;
}

.city-dropdown-card.visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
  cursor: pointer;
}

.city-dropdown-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-light);
}

.city-dropdown-card__header strong {
  font-size: 1.05rem;
  color: var(--text-primary);
}

.city-dropdown-card__tap {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
  opacity: 0.8;
  animation: tapPulse 1.5s ease-in-out infinite;
}

@keyframes tapPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.city-dropdown-card__stats {
  padding: 8px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.city-dropdown-card__row {
  display: flex;
  align-items: center;
  font-size: 0.88rem;
  color: var(--text-secondary);
  padding: 4px 0;
}

.city-dropdown-card__row--warn {
  color: #f59e0b;
}

.city-dropdown-card__row--ok {
  color: #22c55e;
}


/* SVG Map Base Styles */
#svg-turkiye-haritasi path:not([class*="province--"]) {
  fill: var(--bg-tertiary);
  stroke: var(--border);
  /* transition removed for map performance on mobile */
}

[data-theme="dark"] #svg-turkiye-haritasi path:not([class*="province--"]) {
  fill: #27273A;
  /* Slightly lighter inactive equivalent */
  stroke: #54546D;
}

/* Province color states */
.province--inactive {
  fill: var(--bg-tertiary);
  stroke: var(--border) !important;
}

[data-theme="dark"] .province--inactive {
  fill: #27273A;
  /* Slightly lighter inactive equivalent */
  stroke: #54546D !important;
}

/* Reporter's assigned city — pulsing border */


/* Activating state (when manager taps inactive city to activate) */
.province-path--activating {
  filter: brightness(1.5);
  stroke: var(--accent) !important;
  stroke-width: 2 !important;
  stroke-dasharray: 4 4;
  animation: selectedPulse 2s linear infinite;
}

@keyframes selectedPulse {

  0%,
  100% {
    stroke-opacity: 1;
    stroke-width: 2.5;
  }

  50% {
    stroke-opacity: 0.4;
    stroke-width: 1.5;
  }
}

/* Header city badge */
.header__user-city {
  font-size: 0.7rem;
  color: #42a5f5;
  background: rgba(66, 165, 245, 0.1);
  padding: 3px 10px;
  border-radius: 99px;
  margin-left: 8px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.header__user-city.hidden {
  display: none;
}

/* Bug status filters */
.bug-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.bug-filter {
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.bug-filter:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.bug-filter--active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Video compression progress overlay — a <dialog> (top layer) so it sits above
   the open form modal during upload. UA dialog box styles are neutralised. */
.vc-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  border: 0;
  padding: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
}
.vc-overlay[open] { display: flex; }
.vc-overlay::backdrop { background: transparent; }
.vc-overlay__box {
  width: min(360px, 88vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  text-align: center;
}
.vc-overlay__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 14px;
  color: var(--text-primary);
}
.vc-overlay__bar {
  height: 8px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
  margin-bottom: 8px;
}
.vc-overlay__fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.2s ease;
}
.vc-overlay__pct {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

/* Globe client-workspace selector */
.globe-clients-select {
  padding: 9px 14px;
  border-radius: 10px;
  border: 2px solid var(--accent); /* brand blue, like our buttons */
  background: var(--surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  width: 230px;
  max-width: 70vw;
  /* Centre the selected company name; long names truncate with an ellipsis. */
  text-align: center;
  text-align-last: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  cursor: pointer;
}
.globe-clients-select option { text-align: center; }
/* Real company options always render normal — never inherit the prompt accent
   when the select carries the --prompt class (that was the styling bleed). */
.globe-clients-select option {
  color: var(--text-primary);
  font-style: normal;
  font-weight: 600;
}
/* Placeholder option — distinguished by italic only (text stays black, no
   color change so switching client doesn't visibly recolor the value). */
.globe-clients-select option.globe-clients-select__ph {
  color: var(--text-primary);
  font-style: italic;
}
/* No client chosen yet: pulse + accent border + italic prompt to draw the eye.
   Text colour is intentionally left unchanged (black). */
.globe-clients-select--prompt {
  border-color: var(--accent);
  font-style: italic;
  animation: globeClientPulse 1.5s ease-in-out infinite;
}
@keyframes globeClientPulse {
  0%   { box-shadow: 0 0 0 0 rgba(94,106,210,0.45); }
  70%  { box-shadow: 0 0 0 9px rgba(94,106,210,0); }
  100% { box-shadow: 0 0 0 0 rgba(94,106,210,0); }
}

/* Panel view switch (Müşteri / Ekip) — full-width primary toggle, deliberately
   distinct from the small filter pills. */
.panel-mode-switch {
  display: flex;
  width: 100%;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.panel-mode-switch__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.panel-mode-switch__btn .material-symbols-outlined {
  font-size: 1.15rem;
}
.panel-mode-switch__btn:hover {
  color: var(--text-primary);
}
.panel-mode-switch__btn--active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px var(--accent-glow);
}
.panel-mode-switch__btn--active:hover {
  color: #fff;
}

/* Completion report — selectable existing-media thumbnails */
.completion-media-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* "Pick from work media" block in the completion modal (report → Önce, fix → Sonra) */
.completion-pick {
  margin: -8px 0 14px;
}
.completion-pick__label {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.completion-pick__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.completion-media-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition-fast);
}
.completion-media-thumb img,
.completion-media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.completion-media-thumb__play {
  /* Decorative play cue — tapping the thumb body opens the preview. */
  position: absolute;
  color: #fff;
  font-size: 28px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.7));
  pointer-events: none;
}
/* Corner checkbox — the ONLY select target (tapping the thumb previews instead). */
.completion-media-thumb__pick {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 2px solid rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.4);
  color: transparent;            /* check hidden until selected */
  cursor: pointer;
  z-index: 2;
}
.completion-media-thumb__pick .material-symbols-outlined {
  font-size: 16px;
  font-weight: 700;
}
.completion-media-thumb.selected {
  border-color: var(--accent);
}
.completion-media-thumb.selected .completion-media-thumb__pick {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;                   /* show the check */
}

/* ── Completion report (Önce / Sonra media + document cards) ─────────────── */
.completion-report {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--surface);
}
.completion-report__head {
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.completion-report__note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  white-space: pre-wrap;
}
.completion-report__sec { margin-bottom: 10px; }
.completion-report__sec:last-child { margin-bottom: 0; }
/* Önce / Sonra side by side with a vertical divider between them. */
.completion-report__ba { display: flex; align-items: stretch; gap: 12px; margin-bottom: 10px; }
.completion-report__ba > .completion-report__sec { flex: 1 1 0; min-width: 0; margin-bottom: 0; }
.completion-report__ba-divider { flex: 0 0 1px; align-self: stretch; min-height: 48px; background: var(--border); }
.completion-report__sec-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.completion-report__dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.completion-report__thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.completion-report__thumb {
  width: 64px; height: 64px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-color);
  position: relative;
}
.completion-report__thumb img,
.completion-report__thumb video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.completion-report__play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.3);
}

/* Document cards */
.doc-cards { display: flex; flex-direction: column; gap: 6px; }
.doc-card {
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--surface-2, var(--bg-tertiary, #f8fafc));
  overflow: hidden;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.doc-card:hover { background: var(--surface); border-color: var(--accent); }
/* Info area — opens the file */
.doc-card__open {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  background: transparent;
  border: none;
  text-align: left;
  color: var(--text-primary);
  font: inherit;
  cursor: pointer;
}
/* Trailing icon-button — downloads the file */
.doc-card__dl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.doc-card__dl-btn:hover { color: var(--accent); background: rgba(94,106,210,0.08); }
.doc-card__dl-btn .material-symbols-outlined { font-size: 1.25rem; }

/* ── DocFolders: editor (completion modal) ──────────────────────────────── */
.df {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2, var(--bg-tertiary, #f8fafc));
  padding: 8px;
}
.df__crumbs {
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px;
  font-size: 0.8rem; margin-bottom: 8px;
}
.df__crumb {
  background: none; border: none; cursor: pointer; padding: 2px 4px;
  color: var(--accent); font: inherit; font-weight: 600; border-radius: 4px;
}
.df__crumb:hover { background: rgba(94,106,210,0.1); }
.df__sep { color: var(--text-muted); }
.df__list { display: flex; flex-direction: column; gap: 4px; max-height: 40vh; overflow-y: auto; }
.df__empty { color: var(--text-muted); font-size: 0.82rem; text-align: center; padding: 14px 6px; }
.df__row { display: flex; align-items: center; gap: 4px; }
.df__main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text-primary); font: inherit;
  text-align: left; cursor: pointer;
}
.df__main--folder { font-weight: 600; }
.df__main--file { cursor: default; }            /* pending (not-yet-uploaded) doc row */
.df__main:hover { border-color: var(--accent); }
.df__ico { font-size: 1.3rem; flex-shrink: 0; }
.df__name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.df__count { font-size: 0.72rem; color: var(--text-muted); flex-shrink: 0; }
.df__del {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--border); color: var(--text-muted); cursor: pointer;
}
.df__del:hover { color: var(--danger, #ef4444); border-color: var(--danger, #ef4444); }
.df__del .material-symbols-outlined { font-size: 18px; }
.df__actions { display: flex; gap: 8px; margin-top: 10px; }
.df__btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-primary); font: inherit; font-size: 0.84rem;
  font-weight: 600; cursor: pointer;
}
.df__btn .material-symbols-outlined { font-size: 18px; }
.df__btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.df__btn--ok { background: var(--accent); color: #fff; border-color: var(--accent); }
.df__newfolder { display: flex; gap: 6px; margin-top: 8px; }
.df__newfolder-input {
  flex: 1; padding: 9px 10px; border: 1px solid var(--accent); border-radius: 8px;
  background: var(--surface); color: var(--text-primary); font: inherit;
}

/* ── DocFolders: read-only viewer (Tamamlandı report) ───────────────────── */
.doc-tree { display: flex; flex-direction: column; gap: 4px; }
.doc-tree__folder { border-left: 2px solid var(--border); padding-left: 8px; }
/* The "Belgeler" root folder sits flush (no nested indent/border). */
.doc-tree__root { border-left: 0; padding-left: 0; }
.doc-tree__folder > summary {
  cursor: pointer; padding: 5px 4px; font-weight: 600; font-size: 0.86rem;
  display: flex; align-items: center; gap: 6px; list-style: none;
}
.doc-tree__folder > summary::-webkit-details-marker { display: none; }
.doc-tree__folder > summary .material-symbols-outlined { font-size: 1.2rem; }
.doc-tree__count { font-size: 0.72rem; color: var(--text-muted); font-weight: 400; }
.doc-tree__children { padding: 2px 0 2px 10px; display: flex; flex-direction: column; gap: 4px; }
.doc-tree__file { display: flex; align-items: center; }
.doc-tree__open {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border: none; background: none; color: var(--text-primary);
  font: inherit; font-size: 0.84rem; text-align: left; cursor: pointer; border-radius: 6px;
}
.doc-tree__open:hover { background: rgba(94,106,210,0.08); }
.doc-tree__open .material-symbols-outlined { font-size: 1.3rem; flex-shrink: 0; }
.doc-tree__name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-tree__dl {
  flex-shrink: 0; width: 34px; height: 34px; border: none; background: none;
  color: var(--text-muted); cursor: pointer; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.doc-tree__dl:hover { color: var(--accent); }
.doc-card__icon { font-size: 1.6rem; flex-shrink: 0; }
.doc-card__info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.doc-card__name {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-card__meta { font-size: 0.72rem; color: var(--text-muted); }
.doc-card__dl { font-size: 1.2rem; color: var(--text-muted); flex-shrink: 0; }

/* Selected-document rows in the upload form (see + remove before submit) */
.doc-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin-top: 6px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface);
}
.doc-pick__icon { font-size: 1.3rem; flex-shrink: 0; }
.doc-pick__name {
  flex: 1; min-width: 0;
  font-size: 0.8rem; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.doc-pick__size { font-size: 0.72rem; color: var(--text-muted); flex-shrink: 0; }
.doc-pick__rm {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; flex-shrink: 0;
  border: none; border-radius: 50%;
  background: transparent; color: var(--text-muted);
  cursor: pointer;
}
.doc-pick__rm:hover { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.doc-pick__rm .material-symbols-outlined { font-size: 18px; }

/* Thread comment form */
.thread-comment-form {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.thread-comment-form .form-textarea {
  min-height: 48px;
  font-size: 0.82rem;
}



/* Profile modal */
.profile-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.profile-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.profile-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}



/* Thread message types */
.thread-message__type {
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

.thread-message__avatar--comment {
  background: var(--bg-hover) !important;
  color: var(--text-secondary) !important;
}

/* --- Theme Toggle Button --- */
#theme-toggle-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
}

#theme-toggle-btn:hover {
  transform: scale(1.05);
}

#theme-toggle-btn:active {
  transform: scale(0.95);
}

#theme-toggle-btn .material-symbols-outlined {
  font-size: 1.3rem;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] #theme-toggle-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.4);
}

/* --- Globe Country Tooltip --- */
.globe-country-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  display: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
  backdrop-filter: blur(8px);
  transition: opacity 0.15s ease;
}

[data-theme="dark"] .globe-country-tooltip {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
  .globe-country-tooltip.mobile-centered {
    left: 50% !important;
    top: 40% !important;
    transform: translateX(-50%);
  }
}

/* --- Bug Panel (Sidebar) --- */
.bug-panel {
  position: fixed;
  top: 0;
  right: -480px;
  width: 480px;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  transition: right var(--transition-slow);
  display: flex;
  flex-direction: column;
}

.bug-panel.open {
  right: 0;
}

.bug-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.bug-panel__title {
  font-size: 1.1rem;
  font-weight: 600;
}

.bug-panel__close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  /* WCAG 2.5.5: minimum 44×44px touch target */
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.bug-panel__close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.bug-panel__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bug-panel__controls {
  padding: 16px 24px 0 24px;
  flex-shrink: 0;
  /* Optional: Add a subtle border or shadow to separate from scrolling list */
  /* border-bottom: 1px solid var(--border); */
}

.bug-panel__scrollable-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.bug-panel__overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-bg);
  z-index: 199;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.bug-panel__overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* --- Bug Card --- */
.bug-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left-width: 4px !important;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.bug-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Client/manager toggle card: only the title row + thumbs/buttons are clickable,
   so don't show the pointer cursor over the whole card (incl. the report's empty
   zones). The interactive bits carry their own cursor:pointer. */
.bug-card--client { cursor: default; }
.bug-card--client:hover { transform: none; }

/* Role tags on Personel "İşlemlerim" cards (reported by me / taken by me). */
.role-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.role-tag--rep { background: var(--accent-bg, rgba(94, 106, 210, 0.12)); color: var(--accent); }
.role-tag--fix { background: var(--green-bg); color: var(--green); }

/* Notification list cards (bell → list). */
.notif-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2, var(--bg-tertiary, #f8fafc));
}
.notif-card--unread { border-color: var(--accent); background: var(--accent-bg, rgba(94, 106, 210, 0.08)); }
.notif-card__icon { font-size: 1.5rem; color: var(--accent); flex-shrink: 0; }
.notif-card__body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.notif-card__title { font-size: 0.86rem; font-weight: 600; color: var(--text-primary); }
.notif-card__sub { font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-card__time { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; }

/* Offline outbox indicator — pending submits waiting for connectivity. */
.offline-pending {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 80px;
  z-index: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--yellow-bg, #fef3c7);
  color: var(--yellow, #b45309);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.offline-pending.hidden { display: none; }
.offline-pending .material-symbols-outlined { font-size: 1.1rem; }

/* duplicate .bug-card__title removed — see below */

/* old bug card hover removed */

.bug-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  padding-right: 70px; /* space for absolute date */
}

.bug-card__date {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.bug-card__status {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 99px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.bug-card__status--open {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.bug-card__status--in-progress {
  background: rgba(66, 165, 245, 0.15);
  color: #42a5f5;
}

.bug-card__status--fix-pending {
  background: rgba(108, 92, 231, 0.15);
  color: var(--accent);
}

.bug-card__status--resolved {
  background: var(--green-bg);
  color: var(--green);
}

.bug-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.bug-card__description {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bug-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.bug-card__media-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* --- Manager Panel --- */
#screen-manager {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
.manager-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.manager-tab {
  padding: 14px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font);
}

.manager-tab:hover {
  color: var(--text-primary);
}

.manager-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.manager-tab__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 99px;
  padding: 0 5px;
  margin-left: 6px;
}

.manager-controls {
  padding: 16px 24px 0 24px;
  flex-shrink: 0;
}

.manager-content {
  padding: 24px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* --- User Card (Manager view) --- */
.user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.user-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.user-card__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-card__name {
  font-weight: 600;
  font-size: 0.95rem;
}

.user-card__details {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.user-card__actions {
  display: flex;
  gap: 8px;
}

/* --- Native Dialog Modal --- */
dialog.modal-dialog {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: calc(100% - 48px); /* Equivalent to padding 24px on overlay */
  max-width: 560px;
  max-height: 90vh;
  padding: 0;
  box-shadow: var(--shadow-lg);
  animation: modalIn var(--transition-normal);
  color: var(--text-primary);
  margin: auto;
  overflow-y: auto;
}

dialog.modal-dialog::backdrop {
  background: var(--overlay-strong);
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal__header {
  padding: 24px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal__title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal__close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

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

.modal__close:focus,
.modal__close:focus-visible,
.modal__close:active {
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

.modal__body {
  padding: 24px;
}

.modal__footer {
  padding: 0 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Modal body typography helpers — replaces inline styles in JS templates */
.modal-desc {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 8px;
}

.modal-hint {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 12px;
  line-height: 1.5;
}

/* --- Media Upload --- */
.media-upload {
  background: var(--bg-tertiary);
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.media-upload:hover,
.media-upload.drag-active {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.media-upload:has(.media-upload__preview:not(:empty)) {
  padding: 8px;
  border-style: solid;
}

.media-upload:has(.media-upload__preview:not(:empty)) .media-upload__icon,
.media-upload:has(.media-upload__preview:not(:empty)) .media-upload__text {
  display: none;
}

.media-upload__icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.media-upload__text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Media source action sheet (Kamera / Galeri / Google Drive) — a centered
   <dialog> in the top layer. Replaces the old record button. */
.media-sheet {
  border: 0;
  padding: 0;
  margin: auto;
  max-width: 92vw;
  width: 360px;
  background: transparent;
  overflow: visible;
}
.media-sheet::backdrop { background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(2px); }
.media-sheet__box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}
.media-sheet__title {
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 6px 0 12px;
}
.media-sheet__opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--surface-2, var(--bg-tertiary, #f3f4f6));
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}
.media-sheet__opt:hover { background: var(--accent); color: #fff; }
.media-sheet__opt:active { transform: scale(0.99); }
.media-sheet__opt .material-symbols-outlined { font-size: 1.4rem; }
.media-sheet__opt--drive .material-symbols-outlined { color: #1a73e8; }
.media-sheet__opt--drive:hover .material-symbols-outlined { color: #fff; }
.media-sheet__cancel {
  width: 100%;
  padding: 12px;
  margin-top: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.media-upload__preview {
  margin-top: 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.media-upload__preview:not(:empty) {
  margin-top: 0;
}

.media-upload__preview img,
.media-upload__preview video {
  display: block;
  max-width: 100%;
  max-height: 200px;
  margin: 0 auto;
  border-radius: var(--radius-sm);
}

/* --- Thread / Messages --- */
.thread {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 0;
}

.thread-message {
  display: flex;
  gap: 12px;
}

.thread-message__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.thread-message__avatar--reporter {
  background: linear-gradient(135deg, var(--green), #26a69a);
}

.thread-message__avatar--fixer {
  background: linear-gradient(135deg, var(--yellow), #ff9800);
}

.thread-message__body {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.thread-message__header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 6px;
  padding-right: 60px; /* space for the absolute time */
}

.thread-message__author {
  font-size: 0.85rem;
  font-weight: 600;
}

.thread-message__time {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.thread-message__text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.thread-message__media {
  margin-top: 8px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.thread-message__media img,
.thread-message__media video {
  max-width: 100%;
  max-height: 240px;
  border-radius: var(--radius-sm);
}

/* --- Status Badges --- */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot--green {
  background: var(--green);
}

.status-dot--yellow {
  background: var(--yellow);
}

.status-dot--red {
  background: var(--red);
}

.status-dot--gray {
  background: var(--gray);
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state__text {
  font-size: 0.85rem;
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 0.85rem;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  max-width: 360px;
}

.toast--success {
  border-left: 3px solid var(--green);
}

.toast--error {
  border-left: 3px solid var(--red);
}

.toast--info {
  border-left: 3px solid var(--accent);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* --- Utility --- */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}


/* ============================================
   Thread Message Type Styles
   ============================================ */

/* Type badge pill */
.thread-message__type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Base left border for all typed messages */
.thread-message--report,
.thread-message--take,
.thread-message--fix,
.thread-message--reject,
.thread-message--confirm,
.thread-message--comment {
  border-left: 3px solid transparent;
  padding-left: 10px;
}

/* 🐛 Report — Blue */
.thread-message--report {
  border-left-color: #3b82f6;
}

.thread-message--report .thread-message__type-badge {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

/* 🔧 Take — Orange */
.thread-message--take {
  border-left-color: #f97316;
}

.thread-message--take .thread-message__type-badge {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
}

/* ✅ Fix — Purple */
.thread-message--fix {
  border-left-color: #8b5cf6;
}

.thread-message--fix .thread-message__type-badge {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

/* ❌ Reject — Red */
.thread-message--reject {
  border-left-color: #ef4444;
}

.thread-message--reject .thread-message__type-badge {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* ✅ Confirm — Green */
.thread-message--confirm {
  border-left-color: #22c55e;
}

.thread-message--confirm .thread-message__type-badge {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

/* 💬 Comment — Gray */
.thread-message--comment {
  border-left-color: var(--border-light);
}

.thread-message--comment .thread-message__type-badge {
  background: rgba(74, 80, 104, 0.2);
  color: var(--text-secondary);
}

/* ============================================
   Compact Thread Comment Form
   ============================================ */
.thread-comment-form {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.thread-comment-form__inner {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  width: 145px;
  height: 40px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
  position: relative;
}

.thread-comment-form__inner:focus-within,
.thread-comment-form__inner:has(.thread-comment-form__input:not(:placeholder-shown)) {
  width: 100%;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-glow);
  cursor: text;
}

.thread-comment-form .voice-recorder,
.thread-comment-form .voice-preview {
  height: 40px;
  border-radius: var(--radius-full);
  padding: 0 16px;
  margin-top: 0;
}

.thread-comment-form__trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-weight: 500;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
  font-size: 0.85rem;
}

.thread-comment-form__inner:focus-within .thread-comment-form__trigger,
.thread-comment-form__inner:has(.thread-comment-form__input:not(:placeholder-shown)) .thread-comment-form__trigger {
  opacity: 0;
}

.thread-comment-form__content {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  transition-delay: 0s;
}

.thread-comment-form__inner:focus-within .thread-comment-form__content,
.thread-comment-form__inner:has(.thread-comment-form__input:not(:placeholder-shown)) .thread-comment-form__content {
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0.15s;
}

.thread-comment-form__input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  resize: none;
  line-height: 1.4;
  padding: 4px 0;
  min-height: 24px;
  max-height: 80px;
  overflow-y: auto;
}

.thread-comment-form__input:focus,
.thread-comment-form__input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

.thread-comment-form__input::placeholder {
  color: var(--text-muted);
  opacity: 0.4;
  font-style: italic;
  font-weight: 400;
}

.thread-comment-form__btn {
  flex-shrink: 0;
  background: transparent;
  color: var(--accent);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, color 0.2s;
  padding: 0;
}

.thread-comment-form__btn:hover {
  background: rgba(94, 106, 210, 0.1);
  color: var(--accent-hover);
  transform: scale(1.1);
}

.thread-comment-form__btn .material-symbols-outlined {
  font-size: 20px;
  margin-left: 2px;
}

/* ============================================================
   CATEGORY & PRIORITY — Bug cards & filters
   ============================================================ */

.bug-filters--cat {
  margin-top: -4px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

/* Category filter icon button */
.bug-filter-icon {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  line-height: 1;
}

.bug-filter-icon:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.bug-filter-icon--active {
  border-color: var(--accent);
  background: var(--accent-glow);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25);
}

/* Dropdown */
.cat-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 200;
  min-width: 170px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  animation: dropdownIn 0.12s ease;
}

@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cat-dropdown__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
  width: 100%;
}

.cat-dropdown__item:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.cat-dropdown__item--active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 600;
}

.bug-cat-badge,
.bug-pri-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  font-weight: 600;
  font-family: var(--font-label);
}

.bug-pri-badge {
  font-weight: 600;
}



/* ============================================================
   DASHBOARD
   ============================================================ */
#screen-dashboard {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

.dashboard {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  background: var(--bg);
}

.dash-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

/* Dashboard Segmented Control */
.dash-segment-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dash-segment-btn:hover {
  color: var(--text-primary);
}

.dash-segment-btn.active {
  background: var(--bg);
  color: var(--text-primary);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .dash-segment-btn.active {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Flatpickr Brand Customization */
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day.selected:focus,
.flatpickr-day.startRange:focus,
.flatpickr-day.endRange:focus,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover,
.flatpickr-day.selected.prevMonthDay,
.flatpickr-day.startRange.prevMonthDay,
.flatpickr-day.endRange.prevMonthDay,
.flatpickr-day.selected.nextMonthDay,
.flatpickr-day.startRange.nextMonthDay,
.flatpickr-day.endRange.nextMonthDay {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}

.flatpickr-day.inRange,
.flatpickr-day.prevMonthDay.inRange,
.flatpickr-day.nextMonthDay.inRange,
.flatpickr-day.today.inRange,
.flatpickr-day.prevMonthDay.today.inRange,
.flatpickr-day.nextMonthDay.today.inRange,
.flatpickr-day:hover,
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover,
.flatpickr-day:focus,
.flatpickr-day.prevMonthDay:focus,
.flatpickr-day.nextMonthDay:focus {
  background: rgba(94, 106, 210, 0.15) !important;
  border-color: transparent !important;
}

@media (max-width: 600px) {
  .flatpickr-calendar {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    margin-left: 0 !important;
    max-width: 95vw;
  }
}

/* KPI Row */
.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.dash-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 16px;
  text-align: center;
  transition: transform 0.15s;
}

.dash-kpi:hover {
  transform: translateY(-2px);
}

.dash-kpi__val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.dash-kpi__label {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.dash-kpi--blue .dash-kpi__val {
  color: #3b82f6;
}

.dash-kpi--red .dash-kpi__val {
  color: #ef4444;
}

.dash-kpi--purple .dash-kpi__val {
  color: #8b5cf6;
}

.dash-kpi--green .dash-kpi__val {
  color: #22c55e;
}

.dash-kpi--yellow .dash-kpi__val {
  color: #f59e0b;
}

/* Charts Row */
.dash-charts-row {
  display: grid;
  grid-template-columns: 220px 1fr 1fr;
  gap: 16px;
}

.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.dash-card--full {
  width: 100%;
}

.dash-card__title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

/* Donut */
.dash-donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.dash-donut-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dash-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.dash-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Bar charts */
.dash-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-bar-row {
  display: grid;
  grid-template-columns: 70px 1fr 28px;
  align-items: center;
  gap: 10px;
}

.dash-bar-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-bar-track {
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}

.dash-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.dash-bar-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
}

/* Table */
.dash-table-wrap {
  overflow-x: auto;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.dash-table th {
  padding: 8px 12px;
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.dash-table td {
  padding: 9px 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.dash-table tr:last-child td {
  border-bottom: none;
}

.dash-table tr:hover td {
  background: var(--surface-2);
}

/* ============================================
   RESPONSIVE — Tablet (≤768px)
   ============================================ */
@media (max-width: 768px) {

  /* --- Header --- */
  .header {
    padding: 0 12px;
    height: 56px;
  }

  .header__logo {
    font-size: 1rem;
    gap: 8px;
  }

  .header__logo-icon {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }

  .header__nav {
    gap: 8px;
  }

  .header__user {
    padding: 4px 8px;
    font-size: 0.8rem;
    gap: 6px;
  }

  .header__user-name {
    display: none;
  }

  .header__user-city {
    display: none;
  }

  .header__btn-text {
    display: none;
  }

  .header__nav .btn--small {
    padding: 6px 10px;
    min-height: 36px;
  }

  /* --- Bug Panel — now a bottom sheet (see Phase 4 P5 below) --- */

  .bug-panel__header {
    padding: 14px 16px;
  }

  .bug-panel__content {
    padding: 12px 16px;
  }

  /* --- Map --- */
  .map-container {
    padding: 8px;
  }

  .map-tooltip {
    display: none !important;
  }

  .map-city-bar {
    padding: 6px 16px;
    font-size: 0.8rem;
  }

  .map-reset-btn {
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    font-size: 0.7rem;
  }

  /* --- Auth Screens --- */
  .auth {
    padding: 16px;
  }

  .auth__card {
    padding: 24px 16px;
  }

  .auth__title {
    font-size: 1.25rem;
  }

  /* --- Forms --- */
  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px;
    /* Prevents iOS zoom on focus */
  }

  /* --- Role Selector --- */
  .role-selector {
    flex-direction: column;
    gap: 8px;
  }

  .role-option {
    padding: 12px;
  }

  /* --- Buttons — Touch-friendly --- */
  .btn {
    min-height: 44px;
    padding: 10px 20px;
  }

  .btn--small {
    min-height: 38px;
    padding: 8px 14px;
  }

  /* --- Manager Tabs — Scrollable --- */
  .manager-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 12px;
  }

  .manager-tabs::-webkit-scrollbar {
    display: none;
  }

  .manager-tab {
    padding: 12px 14px;
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .manager-content {
    padding: 16px;
  }

  /* --- User Card — Stack vertically --- */
  .user-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
  }

  .user-card__actions {
    width: 100%;
    justify-content: flex-end;
  }

  /* --- Modal --- */
  .modal-overlay {
    padding: 16px;
    align-items: flex-end;
  }

  .modal {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .modal__header {
    padding: 16px 16px 0;
  }

  .modal__body {
    padding: 16px;
  }

  .modal__footer {
    padding: 0 16px 16px;
    flex-wrap: wrap;
  }

  .modal__footer .btn {
    flex: 1;
    min-width: 0;
  }

  /* --- Toast — Centered --- */
  .toast-container {
    right: 12px;
    left: 12px;
    top: 68px;
  }

  .toast {
    max-width: 100%;
  }

  /* --- Bug Cards --- */
  .bug-card {
    padding: 12px;
  }

  .bug-card__meta {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* --- Dashboard --- */
  .dashboard {
    height: calc(100vh - 56px);
  }

  .dash-body {
    padding: 16px;
    gap: 16px;
  }

  .dash-kpi-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .dash-kpi {
    padding: 14px 10px;
  }

  .dash-kpi__val {
    font-size: 1.5rem;
  }

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

  .dash-card {
    padding: 16px;
  }

  .dash-table {
    font-size: 0.75rem;
  }

  .dash-table th,
  .dash-table td {
    padding: 6px 8px;
  }

  /* --- Bug Filters --- */
  .bug-filters {
    gap: 4px;
  }

  .bug-filter {
    padding: 5px 10px;
    font-size: 0.7rem;
  }

  /* --- Thread messages --- */
  .thread-message {
    gap: 8px;
  }

  .thread-message__avatar {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
  }

  .thread-message__body {
    padding: 10px 12px;
  }

  /* --- Priority selector --- */
  .priority-selector {
    gap: 4px;
  }

  /* --- Media upload --- */
  .media-upload {
    padding: 20px;
  }

  /* --- Empty state --- */
  .empty-state {
    padding: 32px 16px;
  }

  /* --- Profile password section --- */
  .profile-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* ============================================
   RESPONSIVE — Small phone (≤480px)
   ============================================ */
@media (max-width: 480px) {
  .header__logo-text {
    display: none;
  }

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

  .dash-kpi__val {
    font-size: 1.25rem;
  }

  .dash-bar-row {
    grid-template-columns: 55px 1fr 24px;
    gap: 6px;
  }

  .dash-bar-label {
    font-size: 0.7rem;
  }

  .modal-overlay {
    align-items: flex-end;
  }
  .modal {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%;
    margin: 0;
    max-height: 90vh;
    animation: bottomSheetIn var(--transition-normal) forwards;
  }
  @keyframes bottomSheetIn {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .auth__card {
    padding: 20px 14px;
  }

  .bug-panel__header {
    padding: 12px 14px;
  }

  .bug-panel__content {
    padding: 10px 14px;
  }
}

/* ═════════════════════════════════════════════════════════
   Landscape mobile — maximize map visibility
   ═════════════════════════════════════════════════════════ */
@media (orientation: landscape) and (max-height: 500px) {
  .header {
    padding: 4px 12px;
    min-height: 36px;
  }

  .header__logo-icon {
    font-size: 1rem;
  }

  .header__logo-text {
    scrollbar-width: none;
    padding: 0 12px;
  }

  .manager-tabs::-webkit-scrollbar {
    display: none;
  }

  .manager-tab {
    padding: 12px 14px;
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .manager-content {
    padding: 16px;
  }

  /* --- User Card — Stack vertically --- */
  .user-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
  }

  .user-card__actions {
    width: 100%;
    justify-content: flex-end;
  }

  /* --- Modal --- */
  .modal-overlay {
    padding: 16px;
    align-items: flex-end;
  }

  .modal {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .modal__header {
    padding: 16px 16px 0;
  }

  .modal__body {
    padding: 16px;
  }

  .modal__footer {
    padding: 0 16px 16px;
    flex-wrap: wrap;
  }

  .modal__footer .btn {
    flex: 1;
    min-width: 0;
  }

  /* --- Toast — Centered --- */
  .toast-container {
    right: 12px;
    left: 12px;
    top: 68px;
  }

  .toast {
    max-width: 100%;
  }

  /* --- Bug Cards --- */
  .bug-card {
    padding: 12px;
  }

  .bug-card__meta {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* --- Dashboard --- */
  .dashboard {
    height: calc(100vh - 56px);
  }

  .dash-body {
    padding: 16px;
    gap: 16px;
  }

  .dash-kpi-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .dash-kpi {
    padding: 14px 10px;
  }

  .dash-kpi__val {
    font-size: 1.5rem;
  }

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

  .dash-card {
    padding: 16px;
  }

  .dash-table {
    font-size: 0.75rem;
  }

  .dash-table th,
  .dash-table td {
    padding: 6px 8px;
  }

  /* --- Bug Filters --- */
  .bug-filters {
    gap: 4px;
  }

  .bug-filter {
    padding: 5px 10px;
    font-size: 0.7rem;
  }

  /* --- Thread messages --- */
  .thread-message {
    gap: 8px;
  }

  .thread-message__avatar {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
  }

  .thread-message__body {
    padding: 10px 12px;
  }

  /* --- Priority selector --- */
  .priority-selector {
    gap: 4px;
  }

  /* --- Media upload --- */
  .media-upload {
    padding: 20px;
  }

  /* --- Empty state --- */
  .empty-state {
    padding: 32px 16px;
  }

  /* --- Profile password section --- */
  .profile-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}



/* Avatar Hover Overlay (Plus Icon) */
#profile-avatar-preview,
#reg-avatar-preview,
#mgr-avatar-preview {
  position: relative;
}

#profile-avatar-preview::after,
#reg-avatar-preview::after,
#mgr-avatar-preview::after {
  content: "+";
  font-family: var(--font, sans-serif);
  font-size: 40px;
  font-weight: 300;
  color: white;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  border-radius: 50%;
  pointer-events: none;
  /* Let clicks pass through */
}

#profile-avatar-preview:hover::after,
#reg-avatar-preview:hover::after,
#mgr-avatar-preview:hover::after {
  opacity: 1;
}

/* ============================================================
   MEDIA VIEWER — Fullscreen lightbox (previously inline in bugs.js)
   ============================================================ */
/* #media-viewer is a <dialog> (top layer). UA box styles are neutralised and
   display is gated on [open]; our own .media-viewer__backdrop draws the dim. */
#media-viewer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#media-viewer[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

#media-viewer::backdrop { background: transparent; }

#media-viewer.active {
  opacity: 1;
  pointer-events: auto;
}

.media-viewer__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  cursor: pointer;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.media-viewer__counter {
  position: absolute;
  top: env(safe-area-inset-top, 20px);
  left: 50%;
  transform: translateX(-50%);
  margin-top: 20px;
  color: white;
  font-weight: bold;
  font-size: 16px;
  z-index: 10001;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  font-family: monospace;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 12px;
  border-radius: 12px;
}

.media-viewer__close {
  position: absolute;
  top: env(safe-area-inset-top, 20px);
  right: env(safe-area-inset-right, 20px);
  margin-top: 20px;
  margin-right: 20px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10001;
  backdrop-filter: blur(4px);
}

.media-viewer__close:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* Download (manager-only) — sits just left of the close button */
.media-viewer__download {
  position: absolute;
  top: env(safe-area-inset-top, 20px);
  right: env(safe-area-inset-right, 20px);
  margin-top: 20px;
  margin-right: 76px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10001;
  backdrop-filter: blur(4px);
}
.media-viewer__download:hover {
  background: rgba(255, 255, 255, 0.4);
}

.media-viewer__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10001;
  backdrop-filter: blur(4px);
  transition: background 0.2s;
}

.media-viewer__nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.media-viewer__prev {
  left: max(20px, env(safe-area-inset-left, 20px));
}

.media-viewer__next {
  right: max(20px, env(safe-area-inset-right, 20px));
}

.media-viewer__nav span {
  font-size: 32px;
}

.media-viewer__content {
  position: relative;
  z-index: 10001;
  max-width: 100vw;
  max-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  user-select: none;
}

.media-viewer__content img,
.media-viewer__content video {
  max-width: 95vw;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  object-fit: contain;
  pointer-events: auto;
}


@media (max-width: 768px) {
  .media-viewer__nav {
    width: 40px;
    height: 40px;
  }

  .media-viewer__nav span {
    font-size: 24px;
  }

  .media-viewer__prev {
    left: 10px;
  }

  .media-viewer__next {
    right: 10px;
  }
}

/* ── Phase 4: UI/UX Polish ─────────────────────────────────────────── */

/* --- P1: Skeleton Loaders --- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}

.skeleton * {
  visibility: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--bg-hover) 40%,
    var(--bg-hover) 60%,
    transparent 100%
  );
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Skeleton card placeholder */
.skeleton-card {
  height: 72px;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  position: relative;
  overflow: hidden;
}

.skeleton-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--bg-hover) 40%,
    var(--bg-hover) 60%,
    transparent 100%
  );
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-card:nth-child(2)::after { animation-delay: 0.15s; }
.skeleton-card:nth-child(3)::after { animation-delay: 0.3s; }
.skeleton-card:nth-child(4)::after { animation-delay: 0.45s; }

/* Skeleton line (text placeholder) */
.skeleton-line {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 4px;
  background: var(--bg-tertiary);
  position: relative;
  overflow: hidden;
}

.skeleton-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--bg-hover) 40%,
    var(--bg-hover) 60%,
    transparent 100%
  );
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-line--short { width: 60%; }
.skeleton-line--medium { width: 80%; }

/* --- P2: Staggered Card Fade-In --- */
@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bug-card,
.user-card,
.country-group {
  animation: cardFadeIn 0.3s ease-out both;
}

.bug-card:nth-child(1) { animation-delay: 0.02s; }
.bug-card:nth-child(2) { animation-delay: 0.05s; }
.bug-card:nth-child(3) { animation-delay: 0.08s; }
.bug-card:nth-child(4) { animation-delay: 0.11s; }
.bug-card:nth-child(5) { animation-delay: 0.14s; }
.bug-card:nth-child(6) { animation-delay: 0.17s; }
.bug-card:nth-child(7) { animation-delay: 0.20s; }
.bug-card:nth-child(8) { animation-delay: 0.23s; }
.bug-card:nth-child(n+9) { animation-delay: 0.25s; }

.user-card:nth-child(1) { animation-delay: 0.02s; }
.user-card:nth-child(2) { animation-delay: 0.06s; }
.user-card:nth-child(3) { animation-delay: 0.10s; }
.user-card:nth-child(4) { animation-delay: 0.14s; }
.user-card:nth-child(n+5) { animation-delay: 0.18s; }

.country-group:nth-child(1) { animation-delay: 0.02s; }
.country-group:nth-child(2) { animation-delay: 0.08s; }
.country-group:nth-child(3) { animation-delay: 0.14s; }
.country-group:nth-child(n+4) { animation-delay: 0.18s; }

/* --- P3: Tactile Button Effect --- */
.btn:active {
  transform: scale(0.97);
}

/* --- P4: Toast Progress Bar --- */
.toast {
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: var(--accent);
  animation: toastProgress 3.5s linear forwards;
  opacity: 0.6;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.toast--success::before { background: var(--green); }
.toast--error::before { background: var(--red); }
.toast--info::before { background: var(--accent); }

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* --- Voice Recording UI --- */
.voice-recorder {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 8px;
  width: 100%;
}

.voice-recorder__indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red, #ef4444);
  animation: voicePulse 1s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes voicePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.voice-recorder__timer {
  font-family: 'Inter', monospace;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 42px;
}

.voice-recorder__btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}

.voice-recorder__btn:hover {
  background: rgba(150, 150, 150, 0.15);
}

.voice-recorder__btn--stop {
  background: var(--red, #ef4444);
  color: white;
  width: 36px;
  height: 36px;
}

.voice-recorder__btn--stop:hover {
  background: #dc2626;
}

.voice-recorder__btn--cancel {
  color: var(--text-muted);
}

/* ── Ready state (mic toggled, not yet recording) ─────────────── */
.voice-recorder__indicator--ready {
  background: #22c55e;
  animation: none;
}

.voice-recorder__btn--start {
  background: #22c55e;
  color: white;
  width: 36px;
  height: 36px;
}

.voice-recorder__btn--start:hover {
  background: #16a34a;
}

/* ── Custom Audio Player ──────────────────────────────────────── */
.audio-player {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 4px;
  user-select: none;
}

.audio-player__play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--accent, #5e6ad2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}

.audio-player__play:hover {
  background: var(--accent-hover, #828fff);
  transform: scale(1.05);
}

.audio-player__play .material-symbols-outlined {
  font-size: 18px;
}

.audio-player__time {
  font-family: 'Inter', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.audio-player__track {
  flex: 1;
  height: 6px;
  background: var(--border, #d8dadf);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
  touch-action: none;
}

.audio-player__progress {
  height: 100%;
  background: var(--accent, #5e6ad2);
  border-radius: 3px;
  width: 0%;
  transition: width 0.05s linear;
  pointer-events: none;
}

.audio-player__thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 14px;
  height: 14px;
  background: var(--accent, #5e6ad2);
  border: 2px solid var(--surface, #fff);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  pointer-events: none;
  transition: left 0.05s linear;
}

.audio-player__track:hover .audio-player__thumb {
  transform: translate(-50%, -50%) scale(1.2);
}

/* Voice preview (after recording, before send) */
.voice-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 8px;
  width: 100%;
}

.voice-preview__player {
  flex: 1;
  height: 36px;
  border-radius: 8px;
}

.voice-preview__player audio {
  width: 100%;
  height: 36px;
}

.voice-preview__delete {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--red, #ef4444);
  display: flex;
  align-items: center;
  border-radius: 50%;
  transition: background 0.15s;
}

.voice-preview__delete:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Audio player in thread messages */
.thread-audio {
  background: var(--surface-alt, rgba(150,150,150,0.08));
  border-radius: 20px;
  margin-top: 8px;
  max-width: 320px;
  overflow: hidden;
}

.thread-audio__player {
  width: 100%;
}

/* Mic button in comment form */
.thread-comment-form__mic {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
}

.thread-comment-form__mic:hover {
  color: var(--accent);
  background: rgba(94, 106, 210, 0.1);
}


/* --- P5: Bottom Sheet Drag Handle (Mobile) --- */
@media (max-width: 768px) {
  .modal::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 2px;
    margin: 10px auto 4px;
    opacity: 0.4;
  }

  .modal {
    animation: bottomSheetIn 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  }

  @keyframes bottomSheetIn {
    from {
      opacity: 0;
      transform: translateY(40%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Bug panel slide-in from bottom on mobile */
  .bug-panel {
    top: auto;
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 85vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-left: none;
    border-top: 1px solid var(--border);
    transform: translateY(100%);
    transition: transform var(--transition-slow);
  }

  .bug-panel.open {
    transform: translateY(0);
  }

  .bug-panel::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 2px;
    margin: 8px auto 0;
    opacity: 0.4;
    flex-shrink: 0;
  }
}

/* --- P6: Focus-visible for Accessibility --- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Floating language + theme switcher (auth screens) --- */
.auth-controls {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 16px));
  right: max(16px, env(safe-area-inset-right, 16px));
  z-index: 300;
  display: none;
  gap: 8px;
  align-items: center;
}

.auth-controls.visible {
  display: flex;
}

.auth-controls__lang {
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}

.auth-controls__theme {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}

.auth-controls__lang:hover,
.auth-controls__theme:hover {
  border-color: var(--accent);
}

.btn:focus-visible {
  box-shadow: var(--shadow-glow);
}

/* --- P7: Smooth Scrollbar --- */
.bug-panel__scrollable-list,
.modal__body,
#manager-content {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.bug-panel__scrollable-list::-webkit-scrollbar,
.modal__body::-webkit-scrollbar,
#manager-content::-webkit-scrollbar {
  width: 6px;
}

.bug-panel__scrollable-list::-webkit-scrollbar-track,
.modal__body::-webkit-scrollbar-track,
#manager-content::-webkit-scrollbar-track {
  background: transparent;
}

.bug-panel__scrollable-list::-webkit-scrollbar-thumb,
.modal__body::-webkit-scrollbar-thumb,
#manager-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.bug-panel__scrollable-list::-webkit-scrollbar-thumb:hover,
.modal__body::-webkit-scrollbar-thumb:hover,
#manager-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}



/* İlçe tooltip */
.ilce-tooltip {
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
  padding: 6px 12px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
  white-space: nowrap;
}

.ilce-tooltip::before {
  border-top-color: var(--border-color) !important;
}

/* ── Şube Markers ────────────────────────────────────────────────────── */
.sube-marker-container {
  background: none !important;
  border: none !important;
}

.sube-marker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 42px;
  cursor: pointer;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
  transition: filter 0.15s ease, opacity 0.15s ease;
}

.sube-marker:hover {
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5)) brightness(1.2);
}

.sube-marker .material-symbols-outlined {
  font-size: 36px;
  color: var(--marker-color, hsl(130, 60%, 40%));
}

.sube-marker__badge {
  position: absolute;
  top: -2px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: hsl(0, 80%, 50%);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.sube-marker--placing .material-symbols-outlined {
  color: var(--accent);
  animation: sube-pulse 1.5s infinite;
}

@keyframes sube-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

/* Şube marker pulse ring — composited transform/opacity animation.
   Replaces the old per-marker SMIL <animate> (paint-heavy with many markers).
   Disabled (class omitted) when a district has > PULSE_MAX_MARKERS şube. */
.sube-pulse-ring--anim {
  transform-box: fill-box;
  transform-origin: center;
  animation: subePulseRing 2s ease-out infinite;
}
@keyframes subePulseRing {
  from { transform: scale(1); opacity: 0.6; }
  to   { transform: scale(2); opacity: 0; }
}



.sube-popup {
  padding: 14px 16px;
  min-width: 180px;
}

.sube-popup__name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}

.sube-popup__ilce {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.sube-popup__stats {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.sube-popup__btn {
  width: 100%;
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.sube-popup__btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* ── City Detail Controls ────────────────────────────────────────────── */
.city-detail-back-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  justify-content: center;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-color: transparent;
  box-shadow: 0 0 0 2px rgba(94, 106, 210, 0.5), 0 4px 16px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.city-detail-back-btn:hover {
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px rgba(94, 106, 210, 0.5), 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* ── Place Marker Button (crosshair) ──────────────────────────────── */
.ilce-place-btn {
  left: auto !important;
  right: 12px;
  transition: all 0.2s ease;
  animation: placeBtn-idle 2s ease-in-out infinite;
}
.ilce-place-btn:hover {
  animation: none;
}

@keyframes placeBtn-idle {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 2px rgba(94, 106, 210, 0.5), 0 4px 16px rgba(0, 0, 0, 0.15), 0 0 0 0 rgba(94, 106, 210, 0.7);
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    box-shadow: 0 0 0 2px rgba(94, 106, 210, 0.5), 0 4px 16px rgba(0, 0, 0, 0.15), 0 0 0 12px rgba(94, 106, 210, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 2px rgba(94, 106, 210, 0.5), 0 4px 16px rgba(0, 0, 0, 0.15), 0 0 0 0 rgba(94, 106, 210, 0);
  }
}

.ilce-place-btn--active {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
  animation: placeBtn-pulse 1s ease-in-out infinite;
}

@keyframes placeBtn-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(94, 106, 210, 0.5); transform: scale(1); }
  50% { box-shadow: 0 4px 28px rgba(94, 106, 210, 0.8); transform: scale(1.08); }
}

.city-detail-add-sube-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(94, 106, 210, 0.3);
  transition: all 0.2s ease;
}

.city-detail-add-sube-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(94, 106, 210, 0.4);
}



.placing-bar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  max-width: calc(100% - 32px);
}

.placing-bar .material-symbols-outlined {
  color: var(--accent);
  font-size: 20px;
}

.placing-bar__cancel {
  margin-left: 8px;
  padding: 4px 12px;
  background: var(--surface-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.placing-bar__cancel:hover {
  background: var(--border-color);
}

/* ── Şube Form Overlay ───────────────────────────────────────────────── */
.sube-form-overlay {
  position: absolute;
  inset: 0;
  z-index: 1002;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.sube-form {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  width: min(360px, calc(100% - 32px));
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.sube-form h3 {
  margin: 0 0 16px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.sube-form__field {
  margin-bottom: 14px;
}

.sube-form__field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sube-form__field input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.sube-form__field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(94, 106, 210, 0.15);
}

.sube-form__coords {
  margin-bottom: 16px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.sube-form__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.sube-form__actions .btn {
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}



/* ── Mobile responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .city-detail-back-btn {
    top: 8px;
    left: 8px;
    padding: 6px 10px;
    font-size: 12px;
  }

  .city-detail-add-sube-btn {
    top: 8px;
    right: 8px;
    padding: 6px 10px;
    font-size: 12px;
  }

  .placing-bar {
    font-size: 12px;
    padding: 8px 14px;
    bottom: 80px; /* Above bottom nav */
  }

  .sube-form {
    padding: 18px;
  }
}

/* ── Reduced Motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── İLÇE SVG MAP ──────────────────────────────────────────────────── */

#ilce-svg-map {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  background: var(--bg);
  border-radius: 16px;
  overflow: hidden;
}

.ilce-map-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 14px;
}

.ilce-map-inner {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

#ilce-svg {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
}

.ilce-path {
  transition: filter 0.15s ease;
}

/* Pin button that appears when clicking an ilçe */
.ilce-pin-btn {
  position: absolute;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent, #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  opacity: 0;
  transform: translate(-50%, -100%) translateY(-8px) scale(0.7);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
}

.ilce-pin-btn--visible {
  opacity: 1;
  transform: translate(-50%, -100%) translateY(-8px) scale(1);
  pointer-events: auto;
}

.ilce-pin-btn:hover {
  background: var(--accent-hover, #2563eb);
  transform: translate(-50%, -100%) translateY(-14px) scale(1.1) !important;
}

.ilce-pin-btn .material-symbols-outlined {
  font-size: 22px;
}

/* Şube marker on ilçe map — no CSS transform to avoid conflicting with SVG translate */
.sube-marker {
  transition: filter 0.15s ease;
}
.sube-marker:hover {
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5)) brightness(1.2);
}

/* ── City Indicator Dots (country map) ─────────────────────────────── */
.city-indicator {
  transition: filter 0.15s ease;
}
.city-indicator:hover {
  filter: drop-shadow(0 2px 6px rgba(94, 106, 210, 0.6)) brightness(1.15);
}

/* ── Map Search Navigator ───────────────────────────────────────────── */
#screen-map {
  position: relative;
}
.map-search-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 520;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md, 10px);
  border: 1px solid var(--border-light);
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-color: transparent;
  box-shadow: 0 0 0 2px rgba(94, 106, 210, 0.5), 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}
.map-search-toggle:hover {
  background: var(--bg-secondary);
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px rgba(94, 106, 210, 0.5), 0 6px 20px rgba(0,0,0,0.2);
}
.map-search-toggle.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.map-search-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 510;
  width: 280px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg, 14px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.map-search-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.map-search-panel__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--border-light);
}
.map-search-panel__title {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}
.map-search-panel__close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: background 0.15s;
}
.map-search-panel__close:hover {
  background: var(--bg-tertiary, rgba(128,128,128,0.1));
}

.map-search-panel__body {
  padding: 10px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.map-search-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.map-search-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.map-search-select {
  display: none; /* replaced by ms-dropdown */
}

/* ── Custom searchable dropdown ── */
.ms-dropdown {
  position: relative;
  width: 100%;
}
.ms-dropdown__trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm, 8px);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  user-select: none;
}
.ms-dropdown__trigger:hover {
  border-color: var(--accent);
}
.ms-dropdown--disabled .ms-dropdown__trigger {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.ms-dropdown__value {
  flex: 1;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ms-dropdown__value--selected {
  color: var(--text-primary);
}
.ms-dropdown__arrow {
  font-size: 18px !important;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.ms-dropdown__menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm, 8px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  z-index: 9999;
  overflow: hidden;
  max-height: 240px;
  flex-direction: column;
}
.ms-dropdown__menu.open {
  display: flex;
  flex-direction: column;
}
.ms-dropdown__search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.ms-dropdown__search {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.8rem;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
}
.ms-dropdown__list {
  overflow-y: auto;
  flex: 1;
  padding: 4px 0;
}
.ms-dd-group {
  padding: 4px 10px 2px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
  margin-top: 2px;
}
.ms-dd-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 0.82rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.12s;
}
.ms-dd-item:hover {
  background: rgba(94, 106, 210, 0.1);
}
.ms-dd-item.selected {
  background: rgba(94, 106, 210, 0.18);
  font-weight: 600;
  color: var(--accent);
}
.ms-dd-item--active .ms-dd-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green, #22c55e);
  flex-shrink: 0;
}
.ms-dd-empty {
  padding: 12px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Mobile */
@media (max-width: 768px) {
  .map-search-panel {
    width: calc(100vw - 24px);
    right: 12px;
  }
  .map-search-toggle {
    top: 12px;
    right: 8px;
  }
  .ilce-place-btn {
    right: 8px;
  }
}