:root{
  --bg:#0b0f14;
  --panel:#0f1720;
  --card:#111c27;
  --text:#e7eef7;
  --muted:#a8b3c2;
  --accent:#4da3ff;
  --ok:#27c07d;
  --warn:#ffb020;
  --danger:#ff5d5d;
  --border: rgba(231,238,247,.12);
  --shadow: 0 14px 34px rgba(0,0,0,.38);
  --radius:16px;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
}

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

a:hover {
  text-decoration: underline;
}

.app {
  display: grid;
  grid-template-columns: 320px 1fr 420px;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 14px 12px;
  overflow-y: auto;
  height: 100vh;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(77,163,255,.12), rgba(77,163,255,0));
  margin-bottom: 12px;
}

.logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(77,163,255,.18);
  border: 1px solid rgba(77,163,255,.28);
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: .04em;
  font-size: 18px;
}

.brand h1 {
  font-size: 14px;
  margin: 0;
}

.brand p {
  margin: 2px 0 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.sectionTitle {
  margin: 14px 6px 8px;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  margin-bottom: 8px;
}

.tabBtn {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--text);
  padding: 9px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.tabBtn:hover {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.2);
}

.tabBtn.active {
  border-color: rgba(77,163,255,.35);
  background: rgba(77,163,255,.14);
}

.search {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,.03);
  margin-top: 12px;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

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

.dayList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  max-height: 400px;
  overflow-y: auto;
}

.dayItem {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.02);
  border-radius: 14px;
  padding: 10px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dayItem:hover {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.15);
}

.dayItem.active {
  border-color: rgba(77,163,255,.35);
  background: rgba(77,163,255,.12);
}

.dayItem .label {
  font-weight: 800;
  font-size: 13px;
  line-height: 1.25;
}

.dayItem .meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
  margin-top: 8px;
}

.progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(39,192,125,.95), rgba(77,163,255,.95));
  transition: width 0.3s ease;
}

/* ===== Main Content ===== */
.main {
  overflow-y: auto;
  padding: 16px 18px 110px;
  height: 100vh;
}

.topbar {
  position: sticky;
  top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(15,23,32,.66);
  backdrop-filter: blur(8px);
  z-index: 10;
  box-shadow: var(--shadow);
}

.topbar .title {
  font-weight: 900;
  font-size: 18px;
}

.topbar .meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

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

.btn {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.btn:hover {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.2);
}

.btn.primary {
  border-color: rgba(77,163,255,.35);
  background: rgba(77,163,255,.16);
}

.btn.primary:hover {
  background: rgba(77,163,255,.25);
  border-color: rgba(77,163,255,.5);
}

.shell {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

.card {
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px;
}

.card h2 {
  margin: 0 0 6px 0;
  font-size: 16px;
  font-weight: 700;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
  font-size: 14px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  margin-bottom: 8px;
}

.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 6px 2px;
  font-weight: 500;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 10px;
  background: rgba(255,255,255,.03);
  color: var(--text);
  outline: 0;
  font-size: 13px;
  transition: all 0.2s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,.05);
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.pillRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--muted);
  font-size: 12px;
}

.pill input[type="checkbox"] {
  margin: 0;
}

/* ===== Roteiro ===== */
.dayHeader {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.dayTitle {
  font-weight: 900;
  font-size: 16px;
}

.small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.block {
  margin-top: 10px;
  padding: 10px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.02);
}

.blockTitle {
  font-weight: 800;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--accent);
}

.item {
  padding: 10px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.02);
  margin-top: 8px;
}

.item:first-child {
  margin-top: 0;
}

.itemTop {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.itemTitle {
  font-weight: 800;
  font-size: 14px;
}

.itemMeta {
  font-size: 12px;
  color: var(--muted);
}

.itemNotes {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.itemBtns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.checkRow {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.checkRow.done {
  opacity: .65;
}

.checkRow.done .itemTitle {
  text-decoration: line-through;
}

.checkRow input {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.hr {
  border-top: 1px solid var(--border);
  margin: 14px 0;
}

/* ===== Right Panel ===== */
.right {
  background: var(--panel);
  border-left: 1px solid var(--border);
  padding: 14px 12px;
  overflow-y: auto;
  height: 100vh;
  position: sticky;
  top: 0;
}

.panelHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 10px;
  background: rgba(255,255,255,.03);
}

.panelHeader .t {
  font-weight: 900;
  font-size: 14px;
}

.panelHeader .s {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.quickGrid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quick {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.02);
  border-radius: 14px;
  padding: 10px 10px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
  text-align: left;
}

.quick:hover {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.15);
}

.log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  max-height: 500px;
  overflow-y: auto;
}

.msg {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.02);
  border-radius: 14px;
  padding: 10px 10px;
}

.msg .who {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.msg .txt {
  margin-top: 6px;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ===== Modal ===== */
.modalBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 999;
  backdrop-filter: blur(4px);
}

.modalBackdrop.show {
  display: flex;
}

.modal {
  width: min(760px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(15,23,32,.98);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.modalHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(15,23,32,.98);
  backdrop-filter: blur(8px);
}

.modalHead .h {
  font-weight: 900;
  font-size: 16px;
}

.modalBody {
  padding: 14px 14px;
}

/* ===== Pricing ===== */
.pricingGrid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin: 12px 0;
}

.priceCard {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 12px;
  background: rgba(255,255,255,.02);
}

.priceCard h3 {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.price {
  font-weight: 900;
  font-size: 22px;
  margin: 8px 0;
  color: var(--accent);
}

.ul {
  margin: 12px 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.ul li {
  margin-bottom: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--muted);
  font-weight: normal;
}

.badge.pro {
  border-color: rgba(77,163,255,.35);
  background: rgba(77,163,255,.14);
  color: var(--text);
}

.kpiRow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.kpi {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 10px;
  background: rgba(255,255,255,.02);
  font-size: 12px;
  color: var(--muted);
  flex: 1;
}

.notice {
  border-left: 3px solid rgba(77,163,255,.7);
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(77,163,255,.08);
  color: var(--text);
  font-size: 13px;
}

/* ===== Utilitários ===== */
code {
  background: rgba(0,0,0,.3);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 12px;
  color: var(--accent);
}

pre {
  background: rgba(0,0,0,.3);
  padding: 12px;
  border-radius: 12px;
  overflow-x: auto;
  font-family: monospace;
  font-size: 12px;
  color: var(--text);
  border: 1px solid var(--border);
}

/* ===== Responsividade ===== */
@media (max-width: 1200px) {
  .app {
    grid-template-columns: 320px 1fr;
  }
  .right {
    display: none;
  }
}

@media (max-width: 768px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .main {
    padding: 12px;
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .pricingGrid {
    grid-template-columns: 1fr;
  }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0,0,0,.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.2);
}

/* ===== Animações ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeIn 0.3s ease;
}

/* ===== Status ===== */
#genStatus, #adjStatus {
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255,255,255,.02);
}

/* ===== Trip List ===== */
#tripList {
  margin-top: 10px;
}

#tripList .dayItem {
  margin-bottom: 8px;
}

#tripList .dayItem:last-child {
  margin-bottom: 0;
}