/* ============================================================================
   style.css — Estilos globais do Dashboard Executivo Liv Up
   Marca: vermelho #C8102E · fundo claro · textos escuros · visual executivo
   ============================================================================ */

:root {
  --livup-red: #C8102E;
  --livup-red-dark: #8B0E22;
  --livup-red-soft: #f7e6e9;
  --ink: #1f2733;
  --ink-soft: #5b6675;
  --muted: #97a1b0;
  --line: #e7ebf0;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --green: #1a9e6b;
  --amber: #e6a100;
  --blue: #2f6fd6;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.brand-kicker {
  display: block;
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--muted);
}

/* ============================================================================
   LOGIN
   ============================================================================ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #fdfdfd 0%, #f3f4f6 60%, #f7e6e9 100%);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 40px 34px;
  border: 1px solid var(--line);
}

.login-brand { text-align: center; margin-bottom: 26px; }
.brand-title {
  font-size: 26px;
  margin: 4px 0 2px;
  color: var(--livup-red);
  font-weight: 800;
}
.brand-title span { color: var(--ink); }
.brand-sub { color: var(--ink-soft); font-size: 13px; margin: 0; }

.login-form { display: flex; flex-direction: column; }
.login-form label {
  font-size: 12px; font-weight: 600; color: var(--ink-soft);
  margin: 12px 0 6px;
}
.login-form input {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.login-form input:focus { border-color: var(--livup-red); }

.btn-primary {
  margin-top: 22px;
  background: var(--livup-red);
  color: #fff;
  border: none;
  padding: 13px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover { background: var(--livup-red-dark); }
.btn-primary:disabled { opacity: .6; cursor: default; }

.login-error {
  display: none;
  background: var(--livup-red-soft);
  color: var(--livup-red-dark);
  border: 1px solid #f0c9cf;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 14px;
}
.login-footer {
  text-align: center; color: var(--muted); font-size: 11px; margin: 22px 0 0;
}

/* ============================================================================
   HEADER DO DASHBOARD
   ============================================================================ */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.dash-title { font-size: 26px; font-weight: 400; margin: 2px 0 0; color: var(--ink); }
.dash-title .title-strong { color: var(--livup-red); font-weight: 800; }

.dash-header-right { display: flex; align-items: center; gap: 18px; }
.active-period { text-align: right; }
.period-label { display: block; font-size: 10px; letter-spacing: 1.5px; color: var(--muted); font-weight: 700; }
.active-period strong { font-size: 15px; color: var(--ink); }

.kv-badge {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid #cdeede;
  background: #eafaf2;
  color: var(--green);
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  padding: 8px 14px; border-radius: 999px;
}
.kv-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }

.btn-ghost {
  background: transparent; border: 1px solid var(--line);
  color: var(--ink-soft); padding: 8px 14px; border-radius: 8px;
  font-size: 13px; cursor: pointer;
}
.btn-ghost:hover { border-color: var(--livup-red); color: var(--livup-red); }

/* ============================================================================
   MAIN / TOOLBAR
   ============================================================================ */
.dash-main { padding: 24px 32px 60px; max-width: 1440px; margin: 0 auto; }

.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; flex-wrap: wrap; gap: 12px;
}
.tabs { display: flex; gap: 8px; }
.tab {
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  padding: 9px 18px; border-radius: 9px; font-size: 14px; cursor: pointer; font-weight: 500;
}
.tab.active { background: var(--livup-red); color: #fff; border-color: var(--livup-red); }

.period-filter { display: flex; align-items: center; gap: 10px; }
.period-filter label { font-size: 12px; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.period-filter select {
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px;
  font-size: 14px; background: #fff; cursor: pointer; color: var(--ink);
}

.status-banner {
  padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 14px;
  background: var(--livup-red-soft); color: var(--livup-red-dark); border: 1px solid #f0c9cf;
}
.status-banner.info { background: #eef4fd; color: var(--blue); border-color: #cfe0f7; }

/* ============================================================================
   KPI CARDS
   ============================================================================ */
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 22px;
}
.kpi-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px;
}
.kpi-label { font-size: 11px; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.kpi-value { font-size: 30px; font-weight: 800; color: var(--ink); }
.kpi-value.kpi-green { color: var(--green); }
.kpi-desc { font-size: 12px; color: var(--muted); }
.kpi-delta { font-size: 12px; font-weight: 700; margin-top: 2px; }
.kpi-delta.up { color: var(--green); }
.kpi-delta.down { color: var(--livup-red); }

/* ============================================================================
   PANELS / TWO-COL
   ============================================================================ */
.two-col { display: grid; grid-template-columns: 380px 1fr; gap: 18px; margin-bottom: 22px; }
.two-col .panel:only-child { grid-column: 1 / -1; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow);
}
.panel-title { font-size: 17px; font-weight: 700; margin: 0 0 18px; color: var(--ink); }

/* Share list */
.share-list { display: flex; flex-direction: column; gap: 20px; }
.share-item .share-top { display: flex; justify-content: space-between; align-items: baseline; }
.share-item .share-name { font-weight: 700; font-size: 15px; color: var(--ink); }
.share-item .share-pct { font-weight: 700; font-size: 14px; color: var(--ink); }
.share-bar { height: 7px; border-radius: 999px; background: #eef1f5; margin: 8px 0 6px; overflow: hidden; }
.share-bar span { display: block; height: 100%; border-radius: 999px; background: var(--livup-red); }
.share-meta { display: flex; justify-content: space-between; font-size: 12px; }
.share-meta .m-margin { color: var(--muted); }
.share-meta .m-ebitda { color: var(--green); font-weight: 700; }

/* Table */
.table-wrap { overflow-x: auto; }
.pnl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pnl-table th, .pnl-table td { padding: 11px 10px; text-align: right; white-space: nowrap; }
.pnl-table th:first-child, .pnl-table td:first-child { text-align: left; }
.pnl-table thead th {
  font-size: 11px; letter-spacing: .5px; color: var(--muted); font-weight: 700;
  border-bottom: 2px solid var(--line); text-transform: uppercase;
}
.pnl-table tbody td { border-bottom: 1px solid var(--line); color: var(--ink); }
.pnl-table tbody tr.row-strong td { font-weight: 800; background: #fafbfc; }
.pnl-table tbody tr.row-negative td { color: var(--livup-red); }
.pnl-table .col-total { font-weight: 800; }

/* Charts */
.chart-box { position: relative; height: 320px; }

/* ============================================================================
   RESPONSIVO
   ============================================================================ */
@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .dash-header { flex-direction: column; gap: 14px; align-items: flex-start; }
  .dash-main { padding: 18px 16px 40px; }
}


/* ============================================================================
   SELETOR DE UNIDADE (header) + CARD "SEM DADOS"
   ============================================================================ */
.dash-header-left { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }

.unit-picker { display: flex; align-items: center; gap: 8px; }
.unit-picker label {
  font-size: 10px; letter-spacing: 1.5px; color: var(--muted); font-weight: 700;
}
.unit-picker select {
  border: 1px solid var(--line); border-radius: 9px; padding: 7px 12px;
  font-size: 14px; font-weight: 600; background: #fff; cursor: pointer;
  color: var(--livup-red);
}
.unit-picker select:hover { border-color: var(--livup-red); }

.no-data-card {
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 32px;
  text-align: center;
  max-width: 620px;
  margin: 40px auto;
}
.no-data-icon { font-size: 46px; margin-bottom: 8px; }
.no-data-card h2 { font-size: 20px; color: var(--ink); margin-bottom: 10px; font-weight: 700; }
.no-data-card p { font-size: 14px; color: var(--ink-soft); margin-bottom: 18px; }
.no-data-cmd {
  text-align: left; background: #1f2733; color: #e7ebf0;
  border-radius: 10px; padding: 16px 18px; font-size: 13px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  overflow-x: auto; white-space: pre; line-height: 1.5;
}
