/* ==========================================================================
   Leonida Tropical Bay Night · Design System Tokens
   ========================================================================== */

:root {
  /* Core Surfaces */
  --bg-bay: #0B1018;
  --bg-abyss: #070B11;
  --surface-asphalt: #131A26;
  --surface-glass: rgba(19, 26, 38, 0.90);
  --surface-glass-heavy: rgba(11, 16, 24, 0.94);
  --surface-raised: #1B2433;
  --surface-hover: #222E42;
  --surface-active: #28364D;

  /* Borders */
  --border-tide: #273245;
  --border-strong: #37465F;
  --border-subtle: rgba(238, 242, 247, 0.08);

  /* Typography Ink */
  --ink-shell: #EEF2F7;
  --ink-haze: #8F9FB5;
  --ink-muted: #5F7089;
  --ink-inverse: #0B1018;

  /* Accents (Restrained & Functional) */
  --accent-flamingo: #FF5C8D;
  --accent-flamingo-hover: #FF759F;
  --accent-flamingo-soft: rgba(255, 92, 141, 0.14);
  --accent-flamingo-border: rgba(255, 92, 141, 0.38);

  --accent-lagoon: #2CE5D0;
  --accent-lagoon-soft: rgba(44, 229, 208, 0.14);
  --accent-lagoon-border: rgba(44, 229, 208, 0.36);

  --accent-estimate: #A78BFA;
  --accent-estimate-soft: rgba(167, 139, 250, 0.14);

  --accent-diff: #F5A65B;
  --accent-diff-soft: rgba(245, 166, 91, 0.15);
  --accent-diff-border: rgba(245, 166, 91, 0.40);

  --accent-success: #34D399;
  --accent-danger: #FB7185;

  /* Progress Gradient (used solely on 4px master progress bar) */
  --progress-gradient: linear-gradient(90deg, #FF5C8D 0%, #FFB36B 100%);

  /* Typography */
  --font-sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, monospace;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-sm: 0 2px 8px rgba(4, 8, 14, 0.35);
  --shadow-md: 0 8px 24px rgba(4, 8, 14, 0.50);
  --shadow-lg: 0 16px 40px rgba(4, 8, 14, 0.65);

  /* Dimensions */
  --topbar-h: 52px;
  --statusbar-h: 30px;
  --sidebar-w: 312px;
  --detail-w: 376px;
  --mobile-nav-h: 58px;

  /* Z-index Scale */
  --z-map: 1;
  --z-map-ui: 420;
  --z-compare: 430;
  --z-sidebar: 460;
  --z-detail: 480;
  --z-topbar: 520;
  --z-popover: 560;
  --z-context: 620;
  --z-modal: 700;
  --z-toast: 800;

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 140ms;
  --dur-med: 220ms;
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-bay);
  color: var(--ink-shell);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

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

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

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

a:hover {
  text-decoration: underline;
}

.mono,
.tabular {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

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

/* Custom Dark Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(143, 159, 181, 0.24);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(143, 159, 181, 0.42);
}

/* Shared SVG icon sizing */
.ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.ic svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Shared Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-tide);
  background: var(--surface-raised);
  color: var(--ink-shell);
  transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.btn-primary {
  background: var(--accent-flamingo);
  border-color: var(--accent-flamingo);
  color: #fff;
  font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-flamingo-hover);
  border-color: var(--accent-flamingo-hover);
}

.btn-lagoon {
  background: var(--accent-lagoon-soft);
  border-color: var(--accent-lagoon-border);
  color: var(--accent-lagoon);
}

.btn-lagoon:hover:not(:disabled) {
  background: rgba(44, 229, 208, 0.22);
}

.btn-diff {
  background: var(--accent-diff-soft);
  border-color: var(--accent-diff-border);
  color: var(--accent-diff);
}

.btn-diff:hover:not(:disabled) {
  background: rgba(245, 166, 91, 0.24);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-haze);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-raised);
  color: var(--ink-shell);
}

.btn-sm {
  height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
}

.btn-icon.btn-sm {
  width: 28px;
  height: 28px;
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid var(--border-tide);
  background: var(--surface-raised);
  color: var(--ink-haze);
  white-space: nowrap;
}

.badge-official {
  color: var(--accent-lagoon);
  background: var(--accent-lagoon-soft);
  border-color: var(--accent-lagoon-border);
}

.badge-verified {
  color: var(--ink-shell);
  background: rgba(238, 242, 247, 0.10);
  border-color: rgba(238, 242, 247, 0.28);
}

.badge-estimated {
  color: var(--accent-estimate);
  background: var(--accent-estimate-soft);
  border: 1px dashed rgba(167, 139, 250, 0.55);
}

.badge-diff {
  color: var(--accent-diff);
  background: var(--accent-diff-soft);
  border-color: var(--accent-diff-border);
}

.badge-flamingo {
  color: var(--accent-flamingo);
  background: var(--accent-flamingo-soft);
  border-color: var(--accent-flamingo-border);
}
