/* Components — buttons, cards, tables, badges, forms, wizard, toast, skeleton */

/* ---------- Cards / KPI ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-soft);
  transition: border-color var(--motion-normal) var(--ease-out),
    transform var(--motion-normal) var(--ease-out),
    box-shadow var(--motion-normal) var(--ease-out),
    background-color var(--motion-medium) var(--ease-in-out);
}

.card-compact {
  padding: var(--space-4);
}

.card.is-interactive:hover,
.kpi-card.is-interactive:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-soft);
  transition: border-color var(--motion-normal) var(--ease-out),
    transform var(--motion-normal) var(--ease-out),
    background-color var(--motion-medium) var(--ease-in-out);
  position: relative;
  overflow: hidden;
}

.kpi-card .kpi-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: var(--space-3);
  font-size: var(--font-xs);
  font-weight: 700;
}

.kpi-card .value {
  font-family: var(--font-mono);
  font-size: var(--font-kpi);
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.kpi-card .label {
  margin-top: var(--space-2);
  font-size: var(--font-xs);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

.kpi-card.is-warning .value {
  color: var(--warning);
}
.kpi-card.is-success .value {
  color: var(--success);
}
.kpi-card.is-highlight {
  animation: ti-kpi-flash var(--motion-slow) var(--ease-out);
}

.kpi-card--compact {
  padding: var(--space-2) var(--space-3);
  overflow: visible;
}

.kpi-card--compact .value {
  font-size: var(--font-xl);
}

.kpi-card--compact .label {
  margin-top: var(--space-1);
}

.kpi-card--compact[data-tooltip]::after {
  white-space: normal;
  width: 16rem;
  max-width: min(16rem, 70vw);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  line-height: var(--lh-normal);
  z-index: var(--z-tooltip);
}

@keyframes ti-kpi-flash {
  0% {
    box-shadow: 0 0 0 0 var(--primary-soft);
  }
  40% {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
  }
  100% {
    box-shadow: var(--shadow-soft);
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 9px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  background: var(--surface-elevated);
  color: var(--text-primary);
  line-height: 1.2;
  transition: background var(--motion-fast) var(--ease-out),
    border-color var(--motion-fast) var(--ease-out),
    color var(--motion-fast) var(--ease-out),
    transform var(--motion-fast) var(--ease-out),
    box-shadow var(--motion-fast) var(--ease-out);
}

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

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(31, 95, 214, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #fff;
}

.btn-accent,
.btn-warning {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover,
.btn-warning:hover {
  background: var(--accent-hover);
  color: #fff;
}

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

.btn-danger:hover {
  filter: brightness(1.08);
  color: #fff;
}

.btn-danger-outline {
  background: transparent;
  border-color: color-mix(in srgb, var(--danger) 50%, var(--border));
  color: var(--danger);
}

.btn-danger-outline:hover {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  border-color: var(--danger);
  color: var(--danger);
}

.btn.btn-icon {
  width: 2.1rem;
  height: 2.1rem;
  min-width: 2.1rem;
  padding: 0;
}

.btn.btn-icon.btn-sm {
  width: 1.9rem;
  height: 1.9rem;
  min-width: 1.9rem;
}

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

.btn-form {
  display: inline-flex;
  margin: 0;
}

.action-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--surface-hover);
}

.btn-copiloto .copiloto-robo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.btn-copiloto .copiloto-robo svg {
  overflow: visible;
  display: block;
}

.btn-copiloto.is-ativa {
  border-color: color-mix(in srgb, var(--success) 65%, var(--border));
  color: #4fd196;
  background: var(--success-soft);
}

.btn-copiloto.is-ativa:hover {
  border-color: var(--success);
  color: #6ee7b0;
  background: color-mix(in srgb, var(--success) 22%, transparent);
}

.btn-copiloto.is-ativa .copiloto-robo {
  animation: copiloto-robo-float 2.6s var(--ease-in-out) infinite;
}

.btn-copiloto.is-ativa .copiloto-robo-olho {
  fill: currentColor;
  transform-box: fill-box;
  transform-origin: center;
  animation: copiloto-olho 2.4s var(--ease-in-out) infinite;
}

.btn-copiloto.is-ativa .copiloto-robo-antena-ponta {
  fill: currentColor;
  transform-box: fill-box;
  transform-origin: center;
  animation: copiloto-antena 1.5s var(--ease-in-out) infinite;
}

.btn-copiloto.is-ativa .copiloto-robo-antena {
  transform-box: fill-box;
  transform-origin: bottom center;
  animation: copiloto-antena-haste 1.5s var(--ease-in-out) infinite;
}

@keyframes copiloto-robo-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1.5px);
  }
}

@keyframes copiloto-olho {
  0%,
  38%,
  44%,
  100% {
    transform: scaleY(1);
  }
  41% {
    transform: scaleY(0.12);
  }
}

@keyframes copiloto-antena {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.35);
    opacity: 1;
  }
}

@keyframes copiloto-antena-haste {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(-8deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-copiloto.is-ativa .copiloto-robo,
  .btn-copiloto.is-ativa .copiloto-robo-olho,
  .btn-copiloto.is-ativa .copiloto-robo-antena,
  .btn-copiloto.is-ativa .copiloto-robo-antena-ponta {
    animation: none;
  }
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: var(--font-xs);
}

.btn:disabled,
.btn.is-loading {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background var(--motion-normal) var(--ease-in-out),
    color var(--motion-normal) var(--ease-in-out);
}

.badge-neutral {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-color: var(--border-soft);
}
.badge-info {
  background: var(--info-soft);
  color: var(--info);
}
.badge-success {
  background: var(--success-soft);
  color: var(--success);
}
.badge-warning {
  background: var(--warning-soft);
  color: var(--warning);
}
.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.badge-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- Tables ---------- */
.table-wrap {
  overflow: auto;
  max-height: calc(100dvh - var(--topbar-height) - 16rem);
  max-width: 100%;
  min-width: 0;
  width: 100%;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--font-sm);
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  padding: 12px 14px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}

tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-secondary);
  vertical-align: middle;
  overflow-wrap: anywhere;
}

tbody tr {
  transition: background var(--motion-fast) var(--ease-out);
}

tbody tr:nth-child(even) {
  background: var(--table-stripe);
}

tbody tr:hover {
  background: var(--surface-hover);
}

tbody tr.is-selected {
  background: var(--row-selected);
  box-shadow: inset 3px 0 0 var(--primary);
}

tbody tr:last-child td {
  border-bottom: none;
}

td.num,
th.num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

td.actions,
th.actions {
  text-align: right;
  white-space: nowrap;
}

.table-dense table th,
.table-dense table td {
  padding: 8px 12px;
  font-size: var(--font-sm);
}

.date-group-header {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 10px 14px !important;
  background: var(--bg) !important;
  font-weight: 700;
}

.empty-state {
  padding: var(--space-8) var(--space-6);
  text-align: center;
  color: var(--text-muted);
}

.empty-panel {
  padding: var(--space-8);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text-muted);
}

.empty-panel .empty-icon {
  font-size: 1.5rem;
  margin-bottom: var(--space-3);
  opacity: 0.5;
}

/* ---------- Forms ---------- */
.form-field {
  margin-bottom: var(--space-4);
}

.form-field label {
  display: block;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

/* Forms — nunca branco nativo no dark */
.form-field input,
.form-field select,
.form-field textarea,
.filters-bar input,
.filters-bar select,
input[type="text"],
input[type="search"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary) !important;
  color-scheme: inherit;
  padding: 10px 12px;
  font-size: var(--font-md);
  font-family: inherit;
  transition: border-color var(--motion-fast) var(--ease-out),
    box-shadow var(--motion-fast) var(--ease-out);
}

.filters-bar > input:not([type="hidden"]),
.filters-bar > select {
  width: auto;
}

.filters-bar > label input,
.filters-bar > label select {
  width: 100%;
}

input[type="hidden"] {
  display: none !important;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
  outline: none;
}

.form-errors {
  color: var(--danger);
  font-size: var(--font-xs);
  margin-top: var(--space-1);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 var(--space-4);
}

/* ---------- Alerts / Toast ---------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  font-size: var(--font-sm);
  border: 1px solid transparent;
  animation: ti-toast-in var(--motion-medium) var(--ease-out);
}

.alert-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(34, 168, 107, 0.35);
}
.alert-warning {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: rgba(232, 163, 23, 0.35);
}
.alert-danger,
.alert-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(226, 75, 75, 0.35);
}
.alert-info {
  background: var(--info-soft);
  color: var(--info);
  border-color: rgba(61, 139, 253, 0.35);
}

.toast-stack {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 360px;
}

@keyframes ti-toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Pills / Tabs ---------- */
.pill-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: var(--font-xs);
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--surface);
  transition: background var(--motion-fast) var(--ease-out),
    border-color var(--motion-fast) var(--ease-out),
    color var(--motion-fast) var(--ease-out);
}

.pill:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.pill.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: var(--space-4);
  overflow-x: auto;
  max-width: 100%;
}

.tab {
  padding: 10px 14px;
  color: var(--text-muted);
  font-size: var(--font-sm);
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--motion-fast) var(--ease-out);
  white-space: nowrap;
  flex-shrink: 0;
}

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

.tab.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-panel {
  display: none;
}
.tab-panel.is-active {
  display: block;
}

/* A aba do mapa fica fora do fluxo, mas com tamanho real, para o Leaflet
   conseguir medir o container mesmo antes do analista abrir Rota/Mapa. */
#tab-mapa.tab-panel:not(.is-active) {
  display: block !important;
  position: absolute;
  left: -12000px;
  top: 0;
  width: min(72vw, 1100px);
  visibility: hidden;
  pointer-events: none;
}

/* ---------- Map layout ---------- */
.mapa-operacao,
.mapa-operacao.leaflet-container {
  position: relative;
  width: 100%;
  min-height: 560px;
  height: calc(100vh - 260px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
}
.mapa-operacao .leaflet-map-pane {
  z-index: 1;
}
.mapa-shell {
  position: relative;
  min-height: 560px;
  height: calc(100vh - 260px);
  overflow: hidden;
}
.mapa-loading,
.mapa-error {
  position: absolute;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: var(--font-sm);
}
.mapa-error[hidden],
.mapa-loading[hidden],
.mapa-basemap-aviso[hidden] {
  display: none;
}
.mapa-basemap-aviso {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 620;
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated, var(--bg-secondary));
  border: 1px solid var(--border-soft);
  color: var(--text-primary);
  font-size: var(--font-sm);
  box-shadow: var(--shadow-soft);
  pointer-events: none;
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--bg-elevated, var(--bg-secondary));
  color: var(--text-primary);
  box-shadow: var(--shadow-soft);
}
.leaflet-control-zoom a {
  background: var(--bg-elevated, var(--bg-secondary));
  color: var(--text-primary);
  border-color: var(--border-soft);
}
.leaflet-container .leaflet-control-attribution {
  background: var(--bg-elevated, var(--bg-secondary));
  color: var(--text-secondary);
  max-width: min(100%, 420px);
}

.split-map {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: var(--space-4);
  align-items: stretch;
}

@media (max-width: 1100px) {
  .split-map {
    grid-template-columns: 1fr;
  }
  .mapa-operacao,
  .mapa-shell {
    height: 480px;
    min-height: 480px;
  }
}

/* ---------- Progress / occupancy ---------- */
.progress {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-secondary);
  overflow: hidden;
  border: 1px solid var(--border-soft);
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #6aa0ff);
  transition: width var(--motion-slow) var(--ease-out);
}

.progress-fill.is-warn {
  background: linear-gradient(90deg, var(--warning), #f0c35a);
}
.progress-fill.is-danger {
  background: linear-gradient(90deg, var(--danger), #f08080);
}
.progress-fill.is-success {
  background: linear-gradient(90deg, var(--success), #4fd196);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: var(--font-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ---------- Wizard / SAP import ---------- */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--text-muted);
}

.wizard-step .step-index {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  font-size: 0.6875rem;
}

.wizard-step.is-active {
  color: var(--text-primary);
}
.wizard-step.is-active .step-index {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.wizard-step.is-done {
  color: var(--success);
}
.wizard-step.is-done .step-index {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}

.wizard-sep {
  width: 28px;
  height: 2px;
  margin: 0 var(--space-2);
  background: var(--border);
  border-radius: 2px;
}

.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  text-align: center;
  background: var(--bg-secondary);
  transition: border-color var(--motion-normal) var(--ease-out),
    background var(--motion-normal) var(--ease-out);
  cursor: pointer;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.file-chip {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  animation: ti-page-enter var(--motion-medium) var(--ease-out);
}

.file-chip .file-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(34, 168, 107, 0.12);
  color: var(--success);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: var(--font-xs);
  flex-shrink: 0;
}

.file-chip .file-name {
  font-weight: 600;
  color: var(--text-primary);
}

.column-checklist {
  display: grid;
  gap: 6px;
  font-size: var(--font-sm);
  color: var(--text-secondary);
}

.column-checklist .ok::before {
  content: "✓ ";
  color: var(--success);
  font-weight: 700;
}

.import-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr);
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

@media (max-width: 960px) {
  .import-grid {
    grid-template-columns: 1fr;
  }
}

.process-panel {
  display: none;
  padding: var(--space-5);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  margin-bottom: var(--space-4);
}

.process-panel.is-visible {
  display: block;
  animation: ti-page-enter var(--motion-medium) var(--ease-out);
}

.process-list {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.process-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-sm);
  color: var(--text-muted);
}

.process-item.is-active {
  color: var(--text-primary);
  font-weight: 600;
}
.process-item.is-done {
  color: var(--success);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: ti-spin 0.7s linear infinite;
}

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

/* ---------- Skeleton ---------- */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--skeleton-base) 0%,
    var(--skeleton-shine) 50%,
    var(--skeleton-base) 100%
  );
  background-size: 200% 100%;
  animation: ti-shimmer 1.2s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-line {
  height: 12px;
  margin-bottom: 8px;
}
.skeleton-card {
  height: 88px;
}

@keyframes ti-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* ---------- Point cards / accordion ---------- */
.point-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
}

.point-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--motion-normal) var(--ease-out),
    transform var(--motion-normal) var(--ease-out),
    box-shadow var(--motion-normal) var(--ease-out);
}

.point-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.point-card.is-selected {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary), var(--shadow-soft);
}

.point-card .point-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.point-card .point-address {
  margin: 0;
  font-size: var(--font-sm);
  color: var(--text-secondary);
  line-height: 1.4;
}

details.accordion {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--surface);
  margin-bottom: var(--space-2);
  overflow: hidden;
}

details.accordion summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 600;
  font-size: var(--font-sm);
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

details.accordion summary::-webkit-details-marker {
  display: none;
}

details.accordion[open] summary {
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-secondary);
}

details.accordion .accordion-body {
  padding: var(--space-4);
}

/* ---------- Tooltip (generic) ---------- */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  z-index: 20;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-fast) var(--ease-out),
    transform var(--motion-fast) var(--ease-out);
  z-index: var(--z-tooltip);
  box-shadow: var(--shadow-soft);
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.app-shell.is-collapsed .menu-item[data-tooltip]::after {
  bottom: auto;
  left: calc(100% + 10px);
  transform: translateY(-50%);
}

.app-shell.is-collapsed .menu-item[data-tooltip]:hover::after {
  transform: translateY(-50%);
}

/* ---------- Drawer / Modal ---------- */
.drawer-overlay,
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-medium) var(--ease-out);
  z-index: var(--z-drawer);
}

.drawer-overlay.is-open,
.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(480px, 100%);
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-elevated);
  z-index: calc(var(--z-drawer) + 1);
  overflow: auto;
  padding: var(--space-5);
  display: none;
}

.drawer-overlay.is-open + .drawer,
.drawer.is-open {
  display: block !important;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(440px, calc(100% - 32px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-elevated);
  transform: translate(-50%, -48%) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-medium) var(--ease-out),
    transform var(--motion-medium) var(--ease-out);
  z-index: calc(var(--z-modal) + 1);
}

.modal--wide {
  width: min(560px, calc(100% - 32px));
}

.modal-overlay.is-open + .modal,
.modal.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.timeline {
  margin: var(--space-4) 0 0;
  padding-left: var(--space-5);
}
.timeline li {
  margin-bottom: var(--space-3);
}
