/* =========================================================
   meu destino — Dark Travel Dashboard UI
   ========================================================= */

:root {
  --bg-deep: #070a14;
  --bg-sidebar: #0a0d19;
  --bg-center: #081122;
  --bg-panel: #0b0f1d;
  --bg-card: #12182b;
  --bg-card-hover: #182038;
  --bg-elevated: rgba(16, 22, 39, 0.88);
  --bg-input: #141a2d;

  --border-subtle: rgba(255, 255, 255, 0.068);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-purple: rgba(139, 92, 246, 0.55);

  --text-primary: #f1f5f9;
  --text-secondary: #9aa5be;
  --text-muted: #6c7794;

  --accent-purple: #7c3aed;
  --accent-violet: #8b5cf6;
  --accent-indigo: #6366f1;
  --accent-pink: #f43f5e;
  --accent-gold: #f59e0b;

  /* Map status palette matching reference */
  --status-visited: #5e8936;
  --status-visited-hi: #73a843;
  --status-visited-dot: #74c345;

  --status-want: #465da8;
  --status-want-hi: #5975cf;
  --status-want-dot: #5b7cfa;

  --status-planning: #c4912c;
  --status-planning-hi: #dda638;
  --status-planning-dot: #f5b935;

  --status-recommended: #5d4ea8;
  --status-recommended-hi: #7865d6;
  --status-recommended-dot: #9b6dff;

  --status-undefined: #333845;
  --status-undefined-hi: #424858;
  --status-undefined-dot: #52596b;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --shadow-glass: 0 12px 32px rgba(0, 0, 0, 0.45);
  --transition-fast: 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button,
input {
  font-family: inherit;
  color: inherit;
}

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

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

/* Custom sleek dark scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.36);
}

/* =========================================================
   APP SHELL (3-Column Desktop Layout)
   ========================================================= */
.app-shell {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr) 416px;
  height: 100vh;
  width: 100vw;
  background: var(--bg-deep);
  overflow: hidden;
}

/* =========================================================
   LEFT SIDEBAR
   ========================================================= */
.sidebar {
  background: linear-gradient(180deg, #0b0f1c 0%, #090c17 100%);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 13px 11px 11px;
  overflow-y: auto;
  gap: 8px;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 2px 6px;
}

.brand-icon {
  width: 28px;
  height: 33px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(192, 38, 211, 0.35));
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 0.96;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #f8fafc;
}

/* Profile Card */
.profile-card {
  padding: 4px 6px 2px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(139, 92, 246, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.profile-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.profile-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.2;
}

.profile-role {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #6d28d9, #4f46e5);
  color: #f5f3ff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.xp-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.xp-track {
  width: 100%;
  height: 4px;
  border-radius: var(--radius-pill);
  background: #1b2238;
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #7c3aed 0%, #6366f1 55%, #38bdf8 100%);
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.6);
}

.xp-label {
  align-self: flex-end;
  font-size: 10px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Sidebar Sections */
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}

.section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.text-btn {
  font-size: 10.5px;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.text-btn:hover {
  color: #c4b5fd;
}

.space-list,
.main-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.space-item,
.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 5.5px 9px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: left;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.space-item:hover,
.nav-link:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-primary);
}

.space-item.active {
  background: linear-gradient(90deg, rgba(109, 40, 217, 0.42), rgba(79, 70, 229, 0.22));
  color: #f8fafc;
  border: 1px solid rgba(139, 92, 246, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.04);
}

.nav-icon {
  width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #8f9bb8;
}

.space-item.active .nav-icon,
.nav-link.active .nav-icon {
  color: #e2e8f0;
}

.icon-heart {
  color: #f43f5e;
}

.flag-svg {
  width: 16px;
  height: 11px;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.sidebar-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 2px 6px;
}

/* Próxima Viagem Mini Widget */
.next-trip-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px 10px 12px;
  border-radius: 13px;
  background: linear-gradient(135deg, #13182b 0%, #0f1424 100%);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
  flex-shrink: 0;
}

.next-trip-card:hover {
  border-color: var(--border-purple);
  transform: translateY(-1px);
}

.next-trip-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.next-trip-label {
  font-size: 10px;
  color: var(--text-muted);
}

.next-trip-dest {
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
}

.next-trip-dates {
  font-size: 9.5px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.next-trip-plane {
  margin-top: 4px;
  width: 15px;
  height: 15px;
  color: #8b5cf6;
  transform: rotate(35deg);
}

.next-trip-thumb {
  width: 58px;
  height: 58px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* =========================================================
   CENTER WORKSPACE
   ========================================================= */
.center-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  background:
    radial-gradient(ellipse 80% 55% at 50% 38%, #102140 0%, #091326 55%, #070c18 100%);
  position: relative;
  overflow: hidden;
}

/* Top Bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px 10px;
  z-index: 20;
  flex-shrink: 0;
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 470px;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 42px 0 18px;
  border-radius: var(--radius-pill);
  background: rgba(20, 27, 46, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 12.5px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

.search-input:focus {
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

.search-icon-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.search-icon-btn svg {
  width: 16px;
  height: 16px;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #12192d;
  border: 1px solid var(--border-medium);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  padding: 6px;
  z-index: 40;
}

.search-result-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  text-align: left;
  transition: background var(--transition-fast);
}

.search-result-item:hover {
  background: rgba(139, 92, 246, 0.16);
}

.search-result-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-circle-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(20, 27, 46, 0.88);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.icon-circle-btn:hover {
  background: #1d2642;
  border-color: var(--border-medium);
}

.icon-circle-btn svg {
  width: 16px;
  height: 16px;
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: #ef4444;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #091326;
}

.user-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 4px 2px 2px;
  border-radius: var(--radius-pill);
}

.user-menu-btn img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
}

.chevron-tiny {
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
}

/* =========================================================
   WORLD MAP VIEWPORT
   ========================================================= */
.map-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 20px;
}

/* Filter Pills Row */
.map-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 15;
  margin-bottom: 4px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6.5px 13px;
  border-radius: var(--radius-pill);
  background: rgba(16, 23, 41, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  font-size: 11.5px;
  font-weight: 500;
  color: #cbd5e1;
  transition: all var(--transition-fast);
}

.filter-pill:hover {
  background: rgba(26, 36, 63, 0.92);
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.filter-pill.active {
  background: linear-gradient(90deg, rgba(109, 40, 217, 0.42), rgba(79, 70, 229, 0.3));
  border-color: rgba(139, 92, 246, 0.65);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.28);
}

.pill-icon {
  width: 13px;
  height: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pill-icon-purple {
  color: #c4b5fd;
}

.pill-icon-blue {
  color: #60a5fa;
}

.pill-icon-violet {
  color: #a78bfa;
}

.pill-ring {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.8px solid var(--status-planning-dot);
}

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

.dot-green {
  background: var(--status-visited-dot);
  box-shadow: 0 0 8px rgba(116, 195, 69, 0.55);
}
.dot-blue {
  background: var(--status-want-dot);
  box-shadow: 0 0 8px rgba(91, 124, 250, 0.55);
}
.dot-amber {
  background: var(--status-planning-dot);
  box-shadow: 0 0 8px rgba(245, 185, 53, 0.55);
}
.dot-purple {
  background: var(--status-recommended-dot);
  box-shadow: 0 0 8px rgba(155, 109, 255, 0.55);
}
.dot-gray {
  background: var(--status-undefined-dot);
}

/* Map Canvas */
.map-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  overflow: hidden;
  margin-top: -4px;
}

.map-canvas-wrap:active {
  cursor: grabbing;
}

.world-map-svg {
  width: 100%;
  height: 100%;
  max-height: 100%;
  overflow: visible;
}

.country-path {
  stroke: rgba(7, 11, 22, 0.82);
  stroke-width: 0.7;
  vector-effect: non-scaling-stroke;
  transition: fill 180ms ease, opacity 200ms ease, filter 180ms ease, stroke 180ms ease;
  cursor: pointer;
}

.country-path.status-visited {
  fill: var(--status-visited);
}
.country-path.status-visited:hover {
  fill: var(--status-visited-hi);
}

.country-path.status-want {
  fill: var(--status-want);
}
.country-path.status-want:hover {
  fill: var(--status-want-hi);
}

.country-path.status-planning {
  fill: var(--status-planning);
}
.country-path.status-planning:hover {
  fill: var(--status-planning-hi);
}

.country-path.status-recommended {
  fill: var(--status-recommended);
}
.country-path.status-recommended:hover {
  fill: var(--status-recommended-hi);
}

.country-path.status-undefined {
  fill: var(--status-undefined);
}
.country-path.status-undefined:hover {
  fill: var(--status-undefined-hi);
}

.country-path.dimmed {
  opacity: 0.2;
}

.country-path.selected-country {
  stroke: #e9d5ff;
  stroke-width: 1.5;
  filter: brightness(1.22);
}

/* Glowing 3D Pins */
.map-pin {
  cursor: pointer;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.map-pin:hover .pin-shape {
  transform: scale(1.14) translateY(-2px);
}

.pin-shape {
  transform-origin: 0px 0px;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.pin-pulse {
  transform-origin: center;
  animation: pinPulse 2.4s ease-out infinite;
}

@keyframes pinPulse {
  0% {
    r: 6;
    opacity: 0.75;
  }
  100% {
    r: 20;
    opacity: 0;
  }
}

/* Map Tooltip */
.map-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 10px;
  background: rgba(12, 17, 32, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  transform: translate(-50%, calc(-100% - 12px));
  white-space: nowrap;
}

.map-tooltip[hidden] {
  display: none;
}

.tooltip-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.tooltip-content {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.tooltip-content strong {
  font-size: 12px;
  font-weight: 600;
  color: #f8fafc;
}

.tooltip-content span {
  font-size: 10.5px;
  color: var(--text-secondary);
}

/* Floating Legend Card (Bottom-Left) */
.map-legend {
  position: absolute;
  left: 20px;
  bottom: 14px;
  z-index: 16;
  width: 142px;
  padding: 11px 12px;
  border-radius: 13px;
  background: rgba(13, 19, 34, 0.84);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-glass);
}

.legend-title {
  font-size: 11.5px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.legend-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.legend-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 3px;
  border-radius: 6px;
  font-size: 10.5px;
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.legend-btn:hover,
.legend-btn.active {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

/* Floating Stats Bar (Bottom-Center) */
.stats-bar {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-44%);
  z-index: 16;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  border-radius: 14px;
  background: rgba(13, 19, 35, 0.86);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-glass);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 9px;
}

.stat-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-green {
  color: #74c345;
}
.stat-purple {
  color: #a855f7;
  transform: rotate(35deg);
}
.stat-amber {
  color: #f5b935;
}
.stat-pink {
  color: #f43f5e;
}

.stat-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.stat-text strong {
  font-size: 16.5px;
  font-weight: 700;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
}

.stat-text span {
  font-size: 9.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.stat-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.07);
}

/* Floating Map Controls (Bottom-Right) */
.map-controls {
  position: absolute;
  right: 20px;
  bottom: 14px;
  z-index: 16;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 34px;
  padding: 4px 0;
  border-radius: 12px;
  background: rgba(16, 22, 40, 0.88);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-glass);
}

.map-ctrl-btn {
  width: 30px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 500;
  color: #cbd5e1;
  border-radius: 8px;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.map-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.map-ctrl-btn svg {
  width: 15px;
  height: 15px;
}

.map-ctrl-sep {
  width: 18px;
  height: 1px;
  background: rgba(255, 255, 255, 0.09);
  margin: 3px 0;
}

/* =========================================================
   BOTTOM SECTION: CONTINUAR PLANEJANDO
   ========================================================= */
.planning-section {
  flex-shrink: 0;
  padding: 12px 20px 14px;
  border-top: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(8, 12, 24, 0.72) 0%, #070b16 100%);
  z-index: 15;
}

.planning-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.planning-header h2 {
  font-size: 14px;
  font-weight: 600;
  color: #f8fafc;
}

.view-all-link {
  font-size: 11px;
  font-weight: 500;
  color: #7c83f7;
  transition: color var(--transition-fast);
}

.view-all-link:hover {
  color: #a5b4fc;
}

.trips-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.trip-card {
  border-radius: 13px;
  overflow: hidden;
  background: #111728;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.trip-card:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.trip-cover-wrap {
  height: 78px;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.trip-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 350ms ease;
}

.trip-card:hover .trip-cover {
  transform: scale(1.06);
}

.trip-body {
  padding: 9px 11px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trip-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trip-date {
  font-size: 9.5px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.trip-progress-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 3px;
}

.trip-progress-track {
  flex: 1;
  height: 4px;
  border-radius: var(--radius-pill);
  background: #1d253d;
  overflow: hidden;
}

.trip-progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #8b5cf6, #6366f1);
}

.trip-percent {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.trip-avatars {
  display: flex;
  align-items: center;
  margin-top: 4px;
}

.trip-avatars img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #111728;
  margin-left: -5px;
}

.trip-avatars img:first-child {
  margin-left: 0;
}

.avatar-extra {
  margin-left: 5px;
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Novo roteiro dashed card */
.new-trip-card {
  border-radius: 13px;
  border: 1.5px dashed rgba(255, 255, 255, 0.14);
  background: rgba(15, 20, 36, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 158px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.new-trip-card:hover {
  border-color: rgba(139, 92, 246, 0.6);
  background: rgba(124, 58, 237, 0.1);
  color: #f8fafc;
}

.new-trip-plus {
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  color: #94a3b8;
}

.new-trip-card:hover .new-trip-plus {
  color: #c4b5fd;
}

.new-trip-label {
  font-size: 11.5px;
  font-weight: 500;
}

/* =========================================================
   RIGHT DETAIL PANEL
   ========================================================= */
.detail-panel {
  background: var(--bg-panel);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.detail-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Hero Banner */
.detail-hero {
  position: relative;
  height: 156px;
  flex-shrink: 0;
  overflow: hidden;
}

.detail-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

.detail-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 15, 29, 0.35) 0%, rgba(11, 15, 29, 0.05) 38%, rgba(11, 15, 29, 0.92) 94%, var(--bg-panel) 100%);
}

.hero-circle-btn {
  position: absolute;
  top: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(13, 18, 34, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f8fafc;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.hero-circle-btn:hover {
  transform: scale(1.06);
  background: rgba(13, 18, 34, 0.85);
}

.hero-circle-btn svg {
  width: 16px;
  height: 16px;
}

.hero-back {
  left: 14px;
}

.hero-fav {
  right: 14px;
  color: #cbd5e1;
}

.hero-fav.active {
  color: #f43f5e;
}

/* Header & Actions */
.detail-header {
  padding: 2px 16px 12px;
  margin-top: -10px;
  position: relative;
  z-index: 2;
}

.detail-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.detail-flag {
  width: 20px;
  height: 14px;
  border-radius: 2.5px;
  overflow: hidden;
  display: inline-flex;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.detail-subtitle {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
}

.status-dropdown-wrap {
  position: relative;
}

.status-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid rgba(116, 195, 69, 0.35);
  background: rgba(94, 137, 54, 0.18);
  color: #dcfce7;
  transition: all var(--transition-fast);
}

.status-select-btn.status-want {
  border-color: rgba(91, 124, 250, 0.42);
  background: rgba(70, 93, 168, 0.24);
  color: #dbeafe;
}

.status-select-btn.status-planning {
  border-color: rgba(245, 185, 53, 0.42);
  background: rgba(196, 145, 44, 0.22);
  color: #fef3c7;
}

.status-select-btn.status-recommended {
  border-color: rgba(155, 109, 255, 0.45);
  background: rgba(93, 78, 168, 0.28);
  color: #ede9fe;
}

.status-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 164px;
  background: #141b30;
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 5px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.6);
  z-index: 30;
}

.status-menu[hidden] {
  display: none;
}

.status-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: #e2e8f0;
  text-align: left;
  transition: background var(--transition-fast);
}

.status-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.primary-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 10px;
  background: linear-gradient(90deg, #7c3aed 0%, #6366f1 100%);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.38);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}

.primary-cta-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.5);
}

/* Category Tabs */
.detail-tabs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 10px;
  gap: 2px;
}

.detail-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 2px 9px;
  color: var(--text-muted);
  font-size: 9.8px;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.detail-tab svg {
  width: 15px;
  height: 15px;
}

.detail-tab:hover {
  color: #cbd5e1;
}

.detail-tab.active {
  color: #e9d5ff;
}

.detail-tab.active svg {
  color: #a855f7;
}

.detail-tab.active::after {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: -1px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #a855f7, #6366f1);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.8);
}

/* Detail Body Sections */
.detail-body {
  padding: 13px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.detail-sec-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #f8fafc;
}

.detail-sec-sub {
  font-size: 10.8px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* 4-Column Mini Cards Grid (Essência & Dicas rápidas) */
.mini-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 3px;
}

.mini-card {
  background: linear-gradient(180deg, #141a2e 0%, #101526 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 7px 6px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
  cursor: pointer;
}

.mini-card:hover {
  border-color: rgba(139, 92, 246, 0.45);
  transform: translateY(-2px);
}

.mini-card-top {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mini-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 8.3px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  flex-shrink: 0;
}

.mini-title {
  font-size: 10.3px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.2;
}

.mini-desc {
  font-size: 8.8px;
  color: var(--text-muted);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mini-thumb {
  width: 100%;
  height: 54px;
  border-radius: 7px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #1b2238;
}

/* Reviews Section */
.reviews-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reviews-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.rating-score-block {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.rating-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.rating-number {
  font-size: 21px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}

.stars-row {
  color: #f5b935;
  font-size: 12px;
  letter-spacing: 1px;
}

.stars-sm {
  font-size: 10px;
}

.rating-count {
  font-size: 10px;
  color: var(--text-muted);
}

.review-photos {
  display: flex;
  align-items: center;
  gap: 5px;
}

.review-photos img,
.review-photo-more {
  width: 44px;
  height: 36px;
  border-radius: 7px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.review-photo-more {
  background: #182038;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 600;
  color: #cbd5e1;
}

.review-card {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 11px;
  background: #12182b;
  border: 1px solid var(--border-subtle);
}

.review-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.review-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.review-quote {
  font-size: 10.2px;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.review-author {
  font-size: 9.8px;
  color: var(--text-muted);
}

/* Panel Bottom Nav */
.panel-bottom-nav {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 6px 9px;
  background: #0a0e1a;
  border-top: 1px solid var(--border-subtle);
}

.panel-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.panel-nav-item svg {
  width: 16px;
  height: 16px;
}

.panel-nav-item:hover {
  color: #cbd5e1;
}

.panel-nav-item.active {
  color: #a855f7;
}

.panel-nav-item.active span {
  color: #f8fafc;
}

/* =========================================================
   MODAL & TOAST
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 15, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 390px;
  background: #11172a;
  border: 1px solid var(--border-medium);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-head h3 {
  font-size: 15px;
  font-weight: 700;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 20px;
  color: var(--text-secondary);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.field-label input {
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  background: #0b1020;
  border: 1px solid var(--border-medium);
  font-size: 12.5px;
  outline: none;
}

.field-label input:focus {
  border-color: var(--accent-violet);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.btn-secondary {
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: #cbd5e1;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: rgba(18, 25, 45, 0.96);
  border: 1px solid rgba(139, 92, 246, 0.55);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
  z-index: 120;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =========================================================
   RESPONSIVE ADAPTATION
   ========================================================= */
@media (max-width: 1240px) {
  .app-shell {
    grid-template-columns: 196px minmax(0, 1fr) 370px;
  }

  .stats-bar {
    gap: 11px;
    padding: 8px 14px;
  }

  .stat-text strong {
    font-size: 14.5px;
  }
}

@media (max-width: 1040px) {
  html,
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 205px minmax(0, 1fr);
    grid-template-rows: auto auto;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .center-stage {
    height: auto;
    min-height: 100vh;
  }

  .map-viewport {
    min-height: 460px;
  }

  .detail-panel {
    grid-column: 1 / -1;
    height: auto;
    border-left: none;
    border-top: 1px solid var(--border-subtle);
  }
}

@media (max-width: 720px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }

  .trips-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-bar {
    position: static;
    transform: none;
    margin: 10px 0;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .map-legend {
    display: none;
  }
}
