/* Lusso — shadcn-inspired dark theme */
:root {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 10% 5.9%;
  --card-foreground: 0 0% 98%;
  --popover: 240 10% 5.9%;
  --popover-foreground: 0 0% 98%;
  --primary: 0 0% 98%;
  --primary-foreground: 240 5.9% 10%;
  --secondary: 240 3.7% 15.9%;
  --secondary-foreground: 0 0% 98%;
  --muted: 240 3.7% 15.9%;
  --muted-foreground: 240 5% 64.9%;
  --accent: 240 3.7% 15.9%;
  --accent-foreground: 0 0% 98%;
  --destructive: 0 62.8% 50.6%;
  --destructive-foreground: 0 0% 98%;
  --success: 142 71% 45%;
  --warning: 38 92% 50%;
  --border: 240 3.7% 15.9%;
  --input: 240 3.7% 15.9%;
  --ring: 240 4.9% 83.9%;
  --radius: 0.5rem;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* === Layout helpers === */
.center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at top, hsl(240 10% 7%) 0%, hsl(var(--background)) 60%);
}
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* === Card === */
.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.card-header { margin-bottom: 20px; }
.card-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 4px; }
.card-description { color: hsl(var(--muted-foreground)); font-size: 13px; margin: 0; }

/* === Form === */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
label { font-size: 13px; font-weight: 500; }
.input {
  background: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  color: hsl(var(--foreground));
  border-radius: calc(var(--radius) - 2px);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  font-family: inherit;
}
.input:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

/* === Button === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: calc(var(--radius) - 2px);
  font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer; transition: all 0.15s;
  font-family: inherit;
  user-select: none;
  white-space: nowrap;
}
.btn-primary {
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
}
.btn-primary:hover { opacity: 0.9; }
.btn-secondary {
  background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground));
  border-color: hsl(var(--border));
}
.btn-secondary:hover { background: hsl(240 3.7% 20%); }
.btn-ghost { background: transparent; color: hsl(var(--foreground)); }
.btn-ghost:hover { background: hsl(var(--accent)); }
.btn-destructive { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-lg { padding: 12px 22px; font-size: 15px; }

/* === Brand === */
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 700; letter-spacing: -0.04em;
}
.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, #fff, #888);
  box-shadow: 0 0 12px rgba(255,255,255,0.4);
}

/* === Alerts === */
.alert {
  border-radius: calc(var(--radius) - 2px);
  padding: 12px 14px;
  font-size: 13px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--secondary));
}
.alert-error {
  border-color: hsl(var(--destructive) / 0.5);
  background: hsl(var(--destructive) / 0.1);
  color: hsl(0 90% 80%);
}
.alert-success {
  border-color: hsl(var(--success) / 0.5);
  background: hsl(var(--success) / 0.1);
  color: hsl(142 70% 75%);
}

/* === Badge === */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px; font-weight: 500;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--secondary));
}
.badge-success { background: hsl(var(--success) / 0.15); color: hsl(142 70% 70%); border-color: hsl(var(--success) / 0.4); }
.badge-warn { background: hsl(var(--warning) / 0.15); color: hsl(38 92% 70%); border-color: hsl(var(--warning) / 0.4); }
.badge-muted { color: hsl(var(--muted-foreground)); }
.badge-live { background: hsl(var(--success) / 0.15); color: hsl(142 70% 70%); border-color: hsl(var(--success) / 0.4); }
.badge-live::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: hsl(var(--success));
  box-shadow: 0 0 0 0 hsl(var(--success) / 0.7);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 hsl(var(--success) / 0.7); }
  70% { box-shadow: 0 0 0 8px hsl(var(--success) / 0); }
  100% { box-shadow: 0 0 0 0 hsl(var(--success) / 0); }
}

/* === PWA gate (mobile install wizard) === */
.gate-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: hsl(var(--background));
  display: flex; flex-direction: column;
  padding: 28px 24px; padding-top: max(28px, env(safe-area-inset-top));
  padding-bottom: max(28px, env(safe-area-inset-bottom));
  overflow-y: auto;
}
.gate-hero {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; text-align: center;
  padding: 24px 0;
}
.gate-logo {
  width: 96px; height: 96px;
  border-radius: 24px;
  background: linear-gradient(135deg, hsl(240 5% 18%), hsl(240 5% 8%));
  border: 1px solid hsl(var(--border));
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; font-weight: 800; letter-spacing: -0.04em;
  color: hsl(var(--foreground));
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
}
.gate-title { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; margin: 0; }
.gate-sub { color: hsl(var(--muted-foreground)); margin: 0; max-width: 320px; }
.gate-steps { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; width: 100%; max-width: 360px; }
.gate-step {
  display: flex; align-items: center; gap: 12px;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius); padding: 12px 14px;
  text-align: left;
}
.gate-step-num {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.gate-step-text { font-size: 13px; }
.gate-step-text strong { font-weight: 600; }
.gate-cta { width: 100%; max-width: 360px; margin: 0 auto; }

/* === Onboarding === */
.onboard-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: hsl(var(--background));
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.onboard-card {
  max-width: 420px; width: 100%;
  text-align: center;
}
.onboard-icon {
  width: 80px; height: 80px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  display: flex; align-items: center; justify-content: center;
}
.onboard-dots { display: flex; justify-content: center; gap: 6px; margin-top: 18px; }
.onboard-dot { width: 6px; height: 6px; border-radius: 50%; background: hsl(var(--muted)); position: relative; }
.onboard-dot.active { background: hsl(var(--primary)); width: 22px; border-radius: 3px; }
.onboard-dot > span { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); }

/* === Tracking toggle button === */
.tracking-toggle-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px;
  border-radius: calc(var(--radius) - 2px);
  font-size: 13px; font-weight: 600;
  border: 1.5px solid hsl(var(--success) / 0.5);
  background: hsl(var(--success) / 0.12);
  color: hsl(142 70% 70%);
  cursor: pointer; transition: all 0.18s;
  flex-shrink: 0;
}
.tracking-toggle-btn:hover { background: hsl(var(--success) / 0.2); }
.tracking-toggle-btn[aria-pressed="false"] {
  border-color: hsl(var(--destructive) / 0.5);
  background: hsl(var(--destructive) / 0.1);
  color: hsl(0 90% 75%);
}
.tracking-toggle-btn[aria-pressed="false"]:hover { background: hsl(var(--destructive) / 0.2); }
.tracking-toggle-icon { font-size: 15px; line-height: 1; }

/* === App view === */
.app-shell {
  min-height: 100vh; display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--card) / 0.6);
  backdrop-filter: blur(12px);
}
.app-content { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.tile {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 16px;
}
.tile-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: hsl(var(--muted-foreground)); margin: 0 0 6px; }
.tile-value { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0; font-variant-numeric: tabular-nums; }
.tile-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* === Admin shell — 3 columns === */
.admin-shell {
  min-height: 100vh; height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr 340px;
  grid-template-rows: 100vh;
  overflow: hidden;
}

/* Left sidebar */
.admin-sidebar {
  background: hsl(var(--card));
  border-right: 1px solid hsl(var(--border));
  display: flex; flex-direction: column;
  height: 100vh; overflow: hidden;
  grid-column: 1;
}
.admin-sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid hsl(var(--border));
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.admin-users { flex: 1; overflow-y: auto; padding: 6px; }
.admin-user-item {
  padding: 10px 12px;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2px;
  transition: background 0.12s;
  border: 1px solid transparent;
  gap: 8px;
}
.admin-user-item:hover { background: hsl(var(--accent)); }
.admin-user-item.active { background: hsl(var(--accent)); border-color: hsl(var(--border)); }
.admin-user-name { font-weight: 500; font-size: 13px; }
.admin-user-meta { font-size: 11px; color: hsl(var(--muted-foreground)); margin-top: 1px; }

/* Center: map */
.admin-main {
  grid-column: 2;
  display: flex; flex-direction: column;
  height: 100vh; overflow: hidden;
  min-width: 0;
}
.admin-topbar {
  padding: 12px 16px;
  border-bottom: 1px solid hsl(var(--border));
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  flex-shrink: 0;
}
.admin-map-wrap { flex: 1; position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: hsl(240 8% 6%); }
.map-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: hsl(var(--muted-foreground));
  text-align: center; padding: 40px; font-size: 13px;
}
.admin-stats { display: flex; gap: 12px; font-size: 12px; color: hsl(var(--muted-foreground)); flex-wrap: wrap; }
.admin-stats strong { color: hsl(var(--foreground)); font-weight: 600; }

/* Right panel */
.admin-right-panel {
  grid-column: 3;
  background: hsl(var(--card));
  border-left: 1px solid hsl(var(--border));
  display: flex; flex-direction: column;
  height: 100vh; overflow: hidden;
}
.admin-right-header {
  padding: 14px 16px;
  border-bottom: 1px solid hsl(var(--border));
  flex-shrink: 0;
}
.admin-right-username {
  font-size: 16px; font-weight: 600; letter-spacing: -0.02em;
  margin-top: 2px;
}

/* Tabs inside right panel */
.admin-panel-tabs {
  display: flex;
  border-bottom: 1px solid hsl(var(--border));
  flex-shrink: 0;
  background: hsl(var(--card));
}
.admin-tab {
  flex: 1; padding: 11px 12px;
  background: transparent; border: 0;
  color: hsl(var(--muted-foreground));
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit;
}
.admin-tab:hover { color: hsl(var(--foreground)); }
.admin-tab.active {
  color: hsl(var(--foreground));
  border-bottom-color: hsl(var(--foreground));
}
.admin-tab-content {
  display: flex; flex-direction: column;
  flex: 1; overflow: hidden; min-height: 0;
}
.admin-tasks-count-badge {
  background: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  font-size: 10px; font-weight: 600;
  padding: 1px 6px; border-radius: 9999px;
  line-height: 1.4;
}

/* Right panel empty state */
.right-panel-empty {
  padding: 32px 16px; text-align: center;
  color: hsl(var(--muted-foreground)); font-size: 13px;
}

@media (max-width: 1100px) {
  .admin-shell { grid-template-columns: 260px 1fr 300px; }
}
@media (max-width: 860px) {
  .admin-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 40vh 50vh;
    height: auto; min-height: 100vh;
  }
  .admin-sidebar { height: auto; max-height: 200px; grid-column: 1; border-right: 0; border-bottom: 1px solid hsl(var(--border)); }
  .admin-main { height: 40vh; grid-column: 1; }
  .admin-right-panel { height: 50vh; grid-column: 1; border-left: 0; border-top: 1px solid hsl(var(--border)); }
}

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

.muted { color: hsl(var(--muted-foreground)); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }

/* === Update banner === */
.update-banner {
  position: fixed;
  left: 16px; right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 10001;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.55), 0 0 0 1px hsl(var(--ring) / 0.08);
  max-width: 460px; margin: 0 auto;
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.update-banner.update-banner-in { opacity: 1; transform: translateY(0); }
.update-banner.update-banner-out { opacity: 0; transform: translateY(16px); }
.update-banner-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 8px;
  background: hsl(var(--secondary));
  display: flex; align-items: center; justify-content: center;
  color: hsl(var(--foreground));
}
.update-banner-body { flex: 1; min-width: 0; }
.update-banner-title { font-weight: 600; font-size: 13px; }
.update-banner-text { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 2px; }
.update-banner-cta { padding: 8px 14px; font-size: 13px; }
.update-banner-close {
  background: transparent; border: 0; color: hsl(var(--muted-foreground));
  cursor: pointer; padding: 4px 6px; font-size: 18px; line-height: 1;
  border-radius: 6px;
}
.update-banner-close:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }
@media (max-width: 480px) {
  .update-banner { padding: 10px 12px; gap: 10px; }
  .update-banner-icon { width: 30px; height: 30px; }
}

/* === Toast === */
.toast-container {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  z-index: 10000;
  display: flex; flex-direction: column; gap: 10px;
  max-width: 380px; width: calc(100% - 32px);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex; gap: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  opacity: 0; transform: translateX(20px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.toast.toast-in { opacity: 1; transform: translateX(0); }
.toast.toast-leaving { opacity: 0; transform: translateX(20px); }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.toast-text { font-size: 13px; color: hsl(var(--muted-foreground)); word-wrap: break-word; }
.toast-close {
  background: transparent; border: 0; color: hsl(var(--muted-foreground));
  cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; align-self: flex-start;
}
.toast-close:hover { color: hsl(var(--foreground)); }
.toast-success { border-color: hsl(var(--success) / 0.5); }
.toast-success .toast-title { color: hsl(142 70% 75%); }
.toast-warning { border-color: hsl(var(--warning) / 0.5); }
.toast-warning .toast-title { color: hsl(38 92% 70%); }
.toast-error { border-color: hsl(var(--destructive) / 0.5); }
.toast-error .toast-title { color: hsl(0 90% 80%); }
.toast-info .toast-title { color: hsl(210 90% 75%); }

/* === Tasks (worker) === */
.tasks-card { padding: 0; overflow: hidden; }
.tasks-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid hsl(var(--border));
}
.tasks-header h3 { margin: 0; font-size: 15px; font-weight: 600; }
.tasks-empty {
  padding: 28px 16px; text-align: center; color: hsl(var(--muted-foreground)); font-size: 13px;
}
.tasks-list { display: flex; flex-direction: column; }
.task-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid hsl(var(--border));
  transition: background 0.12s;
}
.task-item:last-child { border-bottom: 0; }
.task-item:hover { background: hsl(var(--accent) / 0.5); }
.task-check {
  width: 22px; height: 22px; flex-shrink: 0;
  border: 1.5px solid hsl(var(--muted-foreground));
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  background: transparent;
  transition: all 0.15s;
  margin-top: 1px;
}
.task-check:hover { border-color: hsl(var(--foreground)); }
.task-check[data-status="done"] {
  background: hsl(var(--success));
  border-color: hsl(var(--success));
  color: hsl(0 0% 100%);
}
.task-check[data-status="done"]::after { content: '✓'; font-weight: 700; font-size: 13px; }
.task-info { flex: 1; min-width: 0; }
.task-title { font-size: 14px; font-weight: 500; line-height: 1.4; word-wrap: break-word; }
.task-item[data-status="done"] .task-title {
  color: hsl(var(--muted-foreground)); text-decoration: line-through;
}
.task-meta {
  font-size: 11px; color: hsl(var(--muted-foreground)); margin-top: 4px;
  display: flex; gap: 10px; flex-wrap: wrap;
}

/* === Tasks (admin panel side) === */
.admin-tasks {
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  display: flex; flex-direction: column;
  max-height: 50vh;
  overflow: hidden;
}
.admin-tasks-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid hsl(var(--border));
}
.admin-tasks-header h3 { margin: 0; font-size: 14px; font-weight: 600; }
.admin-tasks-form { padding: 10px 12px; border-bottom: 1px solid hsl(var(--border)); display: flex; gap: 8px; }
.admin-tasks-form .input { flex: 1; padding: 8px 10px; font-size: 13px; }
.admin-tasks-form .btn { padding: 8px 14px; font-size: 13px; }
.admin-tasks-list { overflow-y: auto; flex: 1; }
.admin-task-row {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid hsl(var(--border));
  font-size: 13px;
}
.admin-task-row:last-child { border-bottom: 0; }
.admin-task-row .task-check { width: 18px; height: 18px; cursor: default; }
.admin-task-row .task-check[data-status="done"]::after { font-size: 11px; }
.admin-task-edit {
  flex: 1; min-width: 0;
  background: transparent; border: 0; color: hsl(var(--foreground));
  font: inherit; padding: 4px 6px; border-radius: 4px;
  outline: none;
}
.admin-task-edit:focus { background: hsl(var(--accent)); }
.admin-task-row[data-status="done"] .admin-task-edit { color: hsl(var(--muted-foreground)); text-decoration: line-through; }
.admin-task-actions { display: flex; gap: 4px; opacity: 0.5; transition: opacity 0.15s; }
.admin-task-row:hover .admin-task-actions { opacity: 1; }
.icon-btn {
  background: transparent; border: 0; color: hsl(var(--muted-foreground));
  cursor: pointer; padding: 4px 6px; border-radius: 4px; font-size: 13px;
}
.icon-btn:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }
.icon-btn.danger:hover { color: hsl(0 90% 75%); }

/* === Chat === */
.chat-container { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.chat-messages { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.chat-bubble { max-width: 72%; padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.45; word-wrap: break-word; }
.chat-bubble.mine { align-self: flex-end; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-radius: 12px 12px 2px 12px; }
.chat-bubble.theirs { align-self: flex-start; background: hsl(var(--secondary)); border: 1px solid hsl(var(--border)); border-radius: 12px 12px 12px 2px; }
.chat-bubble-meta { font-size: 10px; opacity: 0.5; margin-top: 3px; }
.chat-bubble.mine .chat-bubble-meta { text-align: right; }
.chat-bubble.theirs .chat-bubble-meta { text-align: left; }
.chat-unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--destructive)); vertical-align: middle; }
.chat-input-row { display: flex; flex-direction: row; gap: 8px; padding: 10px 12px; border-top: 1px solid hsl(var(--border)); }
.chat-input {
  flex: 1; resize: none; height: 36px; max-height: 100px;
  font-size: 13px; line-height: 1.4; padding: 8px 10px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  color: hsl(var(--foreground));
  border-radius: calc(var(--radius) - 2px);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
  overflow-y: auto;
}
.chat-input:focus { border-color: hsl(var(--ring)); box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2); }
.chat-send-btn { padding: 8px 14px; font-size: 13px; }
.chat-empty { padding: 28px; text-align: center; color: hsl(var(--muted-foreground)); font-size: 13px; }
.chat-date-divider {
  display: flex; align-items: center; gap: 8px;
  text-align: center; font-size: 11px; color: hsl(var(--muted-foreground));
  padding: 8px 0;
}
.chat-date-divider::before, .chat-date-divider::after {
  content: ''; flex: 1; height: 1px; background: hsl(var(--border));
}
.chat-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9999px; font-size: 10px; font-weight: 600;
  background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground));
  vertical-align: middle; margin-left: 4px;
}

/* === Admin bottom panel tabs === */
.admin-bottom-panel {
  background: hsl(var(--card));
  display: flex; flex-direction: column;
  max-height: 50vh;
  overflow: hidden;
}
.admin-panel-tabs {
  display: flex; flex-direction: row;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  flex-shrink: 0;
}
.admin-tab {
  flex: 1; padding: 10px; border: 0;
  background: transparent; color: hsl(var(--muted-foreground));
  cursor: pointer; font-size: 13px; font-weight: 500;
  border-bottom: 2px solid transparent;
  font-family: inherit; transition: color 0.15s, border-color 0.15s;
}
.admin-tab:hover { color: hsl(var(--foreground)); }
.admin-tab.active { color: hsl(var(--foreground)); border-bottom-color: hsl(var(--foreground)); }
.admin-tab-content { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.admin-tasks-count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9999px; font-size: 10px; font-weight: 500;
  background: hsl(var(--secondary)); color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border)); vertical-align: middle; margin-left: 4px;
}

/* leaflet overrides */
.leaflet-container { background: hsl(240 8% 6%) !important; }
.leaflet-control-attribution { background: rgba(0,0,0,0.6) !important; color: #aaa !important; }
.leaflet-control-attribution a { color: #ddd !important; }
.leaflet-control-zoom a {
  background: hsl(var(--card)) !important;
  color: hsl(var(--foreground)) !important;
  border-color: hsl(var(--border)) !important;
}
.user-marker {
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 3px solid hsl(var(--primary));
  box-shadow: 0 0 0 4px hsl(var(--primary) / 0.25);
}
