/* ============================================================================
   VILALARA GRAND HOTEL ALGARVE — SALES OTB DASHBOARD 2026
   Identidade: luxo discreto · Algarve · areia, champagne, branco quente,
   azul profundo, verde suave, dourado discreto. Editorial, não corporate.
   ============================================================================ */

:root {
  --bg: #f7f3ec;            /* areia clara */
  --surface: #fdfbf6;       /* branco quente */
  --surface-2: #f6f1e7;
  --ink: #1f3044;           /* azul profundo */
  --ink-soft: #3c5068;
  --text: #46535f;
  --muted: #8a93a0;
  --gold: #b08d57;          /* dourado discreto / champagne */
  --gold-soft: #e9ddc8;
  --sage: #7e9a84;          /* verde suave */
  --line: #e9e1d1;
  --danger: #b3563e;
  --shadow: 0 1px 2px rgba(31, 48, 68, .04), 0 10px 30px rgba(31, 48, 68, .07);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 460px at 88% -8%, rgba(176, 141, 87, .09), transparent 60%),
    radial-gradient(900px 400px at -10% 8%, rgba(126, 154, 132, .06), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1340px; margin: 0 auto; padding: 0 28px; }

/* ----------------------------------------------------------------------------
   Header — editorial, com espaço para o logótipo
---------------------------------------------------------------------------- */
.site-header {
  background:
    linear-gradient(160deg, rgba(176, 141, 87, .14), transparent 45%),
    linear-gradient(135deg, var(--ink) 0%, #27405c 60%, #2e4a66 100%);
  color: #f4efe6;
  padding: 44px 0 36px;
  border-bottom: 3px solid var(--gold);
}

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 26px; }

.brand-logo {
  height: 104px; width: auto; display: block; flex-shrink: 0;
  /* O SVG já vem em tom creme para o fundo escuro — sem filtros. */
}
.brand-monogram {
  width: 64px; height: 64px; border: 1px solid rgba(233, 221, 200, .55);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', Georgia, serif; font-size: 30px; color: var(--gold-soft);
}

h1.brand-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 600; letter-spacing: .01em; line-height: 1.12;
  margin: 0; color: #fdfaf4;
}
.brand-subtitle { margin: 8px 0 0; font-size: 14px; color: #c5cfdc; font-weight: 300; }

.header-meta { text-align: right; font-size: 12.5px; color: #aeb9c8; line-height: 1.8; }
.header-meta strong { color: var(--gold-soft); font-weight: 500; }

/* ----------------------------------------------------------------------------
   Estados
---------------------------------------------------------------------------- */
.state-panel {
  margin: 70px auto; max-width: 620px; text-align: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 56px 48px;
}
.state-panel h2 { font-family: 'Cormorant Garamond', serif; font-weight: 600; color: var(--ink); margin: 0 0 10px; font-size: 26px; }
.state-panel .state-msg { color: var(--muted); }
.spinner {
  width: 34px; height: 34px; margin: 0 auto 18px; border-radius: 50%;
  border: 3px solid var(--gold-soft); border-top-color: var(--gold);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.banner {
  background: #fdf6ec; border: 1px solid var(--gold-soft); color: #7a5c33;
  border-radius: 10px; padding: 12px 18px; margin: 14px 0; font-size: 13.5px;
}

/* ----------------------------------------------------------------------------
   Filtros
---------------------------------------------------------------------------- */
.filters {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 22px; margin: 26px 0 8px;
}
.filter-group { display: flex; flex-direction: column; gap: 5px; min-width: 130px; flex: 1 1 130px; max-width: 210px; }
.filter-group label {
  font-size: 10.5px; letter-spacing: .15em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.filter-group select, .filter-group input {
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2);
  padding: 8px 10px; font: 400 13px 'Inter', sans-serif; color: var(--ink); width: 100%;
}
.filter-group select:focus, .filter-group input:focus { outline: 2px solid var(--gold-soft); border-color: var(--gold); }

.btn {
  appearance: none; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink);
  font: 500 13px 'Inter', sans-serif; padding: 9px 16px; cursor: pointer;
  transition: all .18s ease; box-shadow: 0 1px 2px rgba(31, 48, 68, .05);
}
.btn:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-1px); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fdfaf4; }
.btn-primary:hover { background: var(--ink-soft); color: #fff; }

/* ----------------------------------------------------------------------------
   Secções
---------------------------------------------------------------------------- */
section.dash-section { margin: 38px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.section-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 25px; font-weight: 600; color: var(--ink); margin: 0;
}
.section-title::after {
  content: ''; display: block; width: 46px; height: 2px;
  background: var(--gold); margin-top: 6px; border-radius: 2px;
}
.section-sub { color: var(--muted); font-size: 13px; margin: 4px 0 0; max-width: 760px; }
.section-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.section-controls select, .section-controls input[type="number"] {
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
  padding: 7px 10px; font: 500 12.5px 'Inter', sans-serif; color: var(--ink);
}
.section-controls .check { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.section-controls .check input { accent-color: var(--gold); }

/* ----------------------------------------------------------------------------
   KPI cards
---------------------------------------------------------------------------- */
.kpi-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 22px; }
.kpi-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 22px 18px; position: relative; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(31,48,68,.05), 0 16px 38px rgba(31,48,68,.1); }
.kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  opacity: 0; transition: opacity .18s ease;
}
.kpi-card:hover::before { opacity: 1; }
.kpi-label { font-size: 10.5px; letter-spacing: .17em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.kpi-value {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 34px; font-weight: 600; color: var(--ink); line-height: 1.1;
  overflow-wrap: anywhere;
}
.kpi-value-sm { font-size: 20px; line-height: 1.25; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.kpi-delta { display: inline-block; margin-top: 10px; font-size: 11.5px; font-weight: 600; border-radius: 99px; padding: 3px 10px; }
.kpi-delta.up { background: rgba(126, 154, 132, .18); color: #4e7257; }
.kpi-delta.down { background: rgba(179, 86, 62, .12); color: var(--danger); }

/* ----------------------------------------------------------------------------
   Cards e gráficos
---------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.chart-wrap { position: relative; height: 360px; }
.chart-wrap.tall { height: 540px; }
.chart-wrap.small { height: 300px; }
.grid-2 { display: grid; grid-template-columns: 7fr 5fr; gap: 16px; align-items: stretch; }
.mt { margin-top: 16px; }

/* ----------------------------------------------------------------------------
   Booking Pace — signature view (destaque premium)
---------------------------------------------------------------------------- */
.pace-card {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(176,141,87,.10), transparent 55%),
    linear-gradient(180deg, #fffdf9 0%, #fbf6ec 100%);
  border: 1px solid var(--gold-soft);
  box-shadow: 0 1px 2px rgba(31,48,68,.05), 0 18px 44px rgba(31,48,68,.10);
}
.pace-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft) 60%, transparent);
}
.pace-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 26px; flex-wrap: wrap; margin-bottom: 12px; }
.pace-head > div:first-child { flex: 1 1 340px; }
.pace-eyebrow {
  font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin: 0 0 6px;
}
.pace-stats { display: flex; gap: 14px; flex-wrap: wrap; align-items: stretch; }
.pace-stat {
  display: flex; flex-direction: column; justify-content: center;
  min-width: 120px; padding: 10px 16px;
  border-left: 2px solid var(--gold-soft);
}
.pace-stat .pv { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 25px; font-weight: 600; color: var(--ink); line-height: 1.05; }
.pace-stat .pl { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.pace-stat.up .pv { color: #4e7257; }
.pace-stat.down .pv { color: var(--danger); }

/* ----------------------------------------------------------------------------
   Tabelas
---------------------------------------------------------------------------- */
.table-scroll { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; }
.data-table thead th {
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--line);
  white-space: nowrap; user-select: none;
}
.data-table thead th[data-sort] { cursor: pointer; }
.data-table thead th[data-sort]:hover { color: var(--gold); }
.data-table thead th.sorted::after { content: ' ▼'; font-size: 9px; color: var(--gold); }
.data-table thead th.sorted.asc::after { content: ' ▲'; }
.data-table tbody tr { border-bottom: 1px solid var(--line); transition: background .12s ease; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tr[data-account] { cursor: pointer; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .acc-name { font-weight: 600; color: var(--ink); }
.data-table .total-row td { font-weight: 600; color: var(--ink); background: var(--gold-soft); border-bottom: none; }
.cons-accounts { font-size: 11.5px; color: var(--muted); max-width: 360px; }
.muted { color: var(--muted); }
.table-note { font-size: 12.5px; color: var(--muted); margin-top: 10px; }

.badge {
  display: inline-block; font-size: 10px; font-weight: 600; letter-spacing: .06em;
  background: var(--gold-soft); color: #7a5c33; border-radius: 99px;
  padding: 2px 8px; margin-left: 6px; vertical-align: middle; text-transform: uppercase;
}
.badge-lg { font-size: 11.5px; padding: 4px 12px; margin: 0 6px 0 0; }
.badge-gold { background: var(--gold); color: #fff; }

input.search-box {
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
  padding: 8px 12px; font: 400 13px 'Inter', sans-serif; min-width: 230px;
}

/* ----------------------------------------------------------------------------
   Account detail + Consortias
---------------------------------------------------------------------------- */
.account-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin: 16px 0 20px; }
.consortia-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
.acc-stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.acc-stat .v { font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 600; color: var(--ink); }
.acc-stat .l { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
#account-detail-name { color: var(--gold); }
#acc-variants { font-size: 12px; color: var(--muted); margin: 6px 0 14px; }
#acc-variants code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }

/* ----------------------------------------------------------------------------
   Heatmap
---------------------------------------------------------------------------- */
.heatmap-table { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 12px; }
.heatmap-table thead th { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; text-align: center; }
.heatmap-table tbody th { text-align: left; font-weight: 600; color: var(--ink); padding: 6px 10px; white-space: nowrap; }
.heatmap-table td {
  text-align: center; padding: 9px 6px; border-radius: 7px;
  font-variant-numeric: tabular-nums; color: var(--ink); min-width: 58px;
  background: var(--surface-2); cursor: default;
}
.heatmap-table td.hm-light { color: #f3ede1; }
.heatmap-table td.hm-total, .heatmap-table .hm-total-row td { background: var(--gold-soft); font-weight: 600; color: var(--ink); }
.heatmap-table .hm-total-row th { border-top: 2px solid var(--line); }

/* ----------------------------------------------------------------------------
   Data quality
---------------------------------------------------------------------------- */
.quality-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 18px; }
.q-stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; }
.q-value { font-family: 'Cormorant Garamond', serif; font-size: 24px; font-weight: 600; color: var(--ink); }
.q-label { font-size: 11px; color: var(--muted); }
#quality-body h4 { margin: 18px 0 6px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.tag { display: inline-block; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; margin: 2px 2px; font-size: 11.5px; }
ul.alerts { margin: 6px 0 0; padding-left: 18px; }
ul.alerts li { margin: 4px 0; color: #7a5c33; }

/* ----------------------------------------------------------------------------
   Footer
---------------------------------------------------------------------------- */
.site-footer { margin-top: 64px; padding: 26px 0 38px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; text-align: center; }

/* ----------------------------------------------------------------------------
   Responsivo
---------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .account-stats { grid-template-columns: repeat(3, 1fr); }
  .consortia-summary { grid-template-columns: repeat(2, 1fr); }
  .header-meta { text-align: left; }
}
@media (max-width: 620px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .account-stats { grid-template-columns: repeat(2, 1fr); }
  .container { padding: 0 16px; }
}

/* ----------------------------------------------------------------------------
   Impressão
---------------------------------------------------------------------------- */
@media print {
  body { background: #fff; }
  .filters, .section-controls, .site-footer, .search-box, .btn { display: none !important; }
  .card, .kpi-card { box-shadow: none; break-inside: avoid; }
  section.dash-section { margin: 18px 0; }
  .chart-wrap { height: 300px; }
}
