/* ── TerritoryPilot Shared Design Tokens & Base Styles ── */
:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface2: #1a1a28;
  --border: #2a2a3f;
  --accent: #6c63ff;
  --accent2: #a78bfa;
  --text: #e8e8f0;
  --muted: #7a7a9a;
  --green: #22c55e;
  --gold: #f59e0b;
  --red: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Shared Button Styles ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn:active { opacity: 0.8; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.75rem; }
.btn-green { background: var(--green); color: #fff; }
.btn-full { width: 100%; padding: 0.85rem; font-size: 0.95rem; border-radius: 10px; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  padding: 0.9rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(108,99,255,0.3);
  transition: opacity 0.15s, transform 0.15s;
}
.btn-primary:active { opacity: 0.85; transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Shared Utilities ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  z-index: 200;
  display: none;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

.badge-priority {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-high { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-med { background: rgba(245,158,11,0.15); color: var(--gold); }
.badge-low { background: rgba(122,122,154,0.15); color: var(--muted); }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}
.empty-state p { font-size: 0.9rem; margin-bottom: 1rem; }

/* ── Logo ── */
.logo {
  font-size: 1.35rem;
  font-weight: 800;
}
.logo span {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo .iq { -webkit-text-fill-color: var(--text); }

/* ── Error/Success Messages ── */
.error-msg {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--red);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  margin-bottom: 1rem;
  display: none;
}
.success-msg {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  color: var(--green);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  margin-bottom: 1rem;
  display: none;
}

/* ── Offline Banner ── */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--red);
  color: #fff;
  text-align: center;
  padding: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 1000;
  display: none;
}
.offline-banner.show { display: block; }
