/* ============================================================
   Kipers · Dashboard de Performance — Padaria Viana (Agosto/2026)
   ============================================================ */

:root{
  --navy: #14213D;
  --navy-700: #1F2F55;
  --amber: #FCA311;
  --amber-dark: #B36B00;
  --red: #D62839;
  --green: #2A9D8F;
  --muted: #6B7280;
  --text: #1F2937;
  --line: #E3E6EB;
  --bg: #F6F7F9;
  --card: #FFFFFF;
  --pale-amber: #FFF4DE;
  --pale-red: #FDECEE;
  --pale-navy: #E8EBF2;
  --pale-slate: #C9D1E0;

  --header-h: 64px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20,33,61,.05), 0 1px 1px rgba(20,33,61,.04);
  --maxw: 1180px;
}

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

html{
  scroll-behavior: smooth;
}

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

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

a{ color: inherit; }

.wrap{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header / nav ---------- */

.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--navy);
  border-bottom: 3px solid var(--amber);
}

.site-header .wrap{
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand{
  display:flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand strong{
  color:#fff;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: .02em;
}

.brand span{
  color: var(--pale-slate);
  font-size: .68rem;
  font-weight: 500;
}

.brand .amber{ color: var(--amber); }

nav.site-nav{
  display:flex;
  gap: 4px;
}

nav.site-nav a{
  text-decoration:none;
  color: var(--pale-slate);
  font-size: .86rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 7px;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}

nav.site-nav a:hover, nav.site-nav a:focus-visible{
  color:#fff;
  background: rgba(255,255,255,.08);
}

.nav-toggle{
  display:none;
  background: none;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 7px;
  color:#fff;
  width: 38px;
  height: 34px;
  cursor: pointer;
}

/* ---------- Hero / page title ---------- */

.hero{
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-700) 100%);
  color: #fff;
  padding: 40px 0 34px;
}

.hero .eyebrow{
  color: var(--amber);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.hero h1{
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin: 0 0 10px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hero p{
  margin: 0;
  color: var(--pale-slate);
  font-size: .98rem;
  max-width: 62ch;
}

.hero .meta-row{
  display:flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 18px;
}

.meta-pill{
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: .8rem;
  color: #fff;
  font-weight: 600;
}

.meta-pill b{ color: var(--amber); font-weight: 700; }

/* ---------- Sections ---------- */

section{
  padding: 44px 0;
  scroll-margin-top: calc(var(--header-h) + 12px);
}

section + section{
  border-top: 1px solid var(--line);
}

.section-head{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.section-head h2{
  font-size: 1.3rem;
  margin: 0;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.section-head p{
  margin: 2px 0 0;
  color: var(--muted);
  font-size: .88rem;
}

.eyebrow-label{
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

/* ---------- KPI cards ---------- */

.kpi-grid{
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.kpi-card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.kpi-card::before{
  content:"";
  position:absolute;
  top:0; left:0; right:0;
  height: 3px;
  background: var(--navy);
}

.kpi-label{
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 4px 0 8px;
}

.kpi-value{
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.kpi-delta{
  display:flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: .74rem;
  font-weight: 700;
}

.kpi-delta.up{ color: var(--red); }
.kpi-delta.down{ color: var(--red); }
.kpi-delta.good{ color: var(--green); }
.kpi-delta.neutral{ color: var(--muted); }

.kpi-delta .tri{
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}
.kpi-delta.up .tri, .kpi-delta.good.up .tri{ border-bottom: 6px solid currentColor; }
.kpi-delta.down .tri{ border-top: 6px solid currentColor; }
.kpi-delta.neutral .tri{
  width:8px; height:2px; border:none; background: currentColor;
}

.kpi-sub{
  margin-top: 6px;
  font-size: .72rem;
  color: var(--muted);
}

/* ---------- Panels / cards ---------- */

.panel{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  box-shadow: var(--shadow);
}

.panel h3{
  margin: 0 0 3px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--navy);
}

.panel .panel-sub{
  margin: 0 0 14px;
  font-size: .8rem;
  color: var(--muted);
}

.two-col{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.chart-caption{
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 14px 0 2px;
}

.chart-caption:first-child{ margin-top: 0; }

/* legend */
.legend{
  display:flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  font-size: .74rem;
  color: var(--muted);
  font-weight: 600;
}
.legend .dot{
  display:inline-block;
  width: 9px; height: 9px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: -1px;
}

/* ---------- Insight cards ---------- */

.insight-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 22px;
}

.insight-card{
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 14px 16px;
  position: relative;
  padding-left: 20px;
}

.insight-card::before{
  content:"";
  position:absolute;
  left:0; top:10px; bottom:10px;
  width: 3.5px;
  border-radius: 3px;
}

.insight-card.tone-red{ background: var(--pale-red); }
.insight-card.tone-red::before{ background: var(--red); }
.insight-card.tone-amber{ background: var(--pale-amber); }
.insight-card.tone-amber::before{ background: var(--amber-dark); }
.insight-card.tone-green{ background: #E6F4F1; }
.insight-card.tone-green::before{ background: var(--green); }

.insight-card h4{
  margin: 0 0 6px;
  font-size: .9rem;
  font-weight: 800;
  color: var(--navy);
}

.insight-card p{
  margin: 0;
  font-size: .82rem;
  color: var(--text);
  line-height: 1.45;
}

.insight-card b{ color: var(--navy); }

/* ---------- Table ---------- */

.table-wrap{ overflow-x: auto; }

table.data-table{
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
}

table.data-table thead th{
  background: var(--navy);
  color: #fff;
  text-align: right;
  font-weight: 700;
  font-size: .76rem;
  padding: 10px 12px;
}

table.data-table thead th:first-child{ text-align: left; border-radius: 6px 0 0 0;}
table.data-table thead th:last-child{ border-radius: 0 6px 0 0;}

table.data-table tbody td{
  padding: 9px 12px;
  text-align: right;
  border-bottom: 1px solid var(--line);
}

table.data-table tbody td:first-child{
  text-align: left;
  font-weight: 700;
  color: var(--navy);
}

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

table.data-table td.highlight{
  background: var(--pale-amber);
  font-weight: 800;
}

table.data-table td.delta-bad{ color: var(--red); font-weight: 800; }
table.data-table td.delta-good{ color: var(--green); font-weight: 800; }
table.data-table td.delta-neutral{ color: var(--muted); font-weight: 700; }

.table-note{
  margin-top: 10px;
  font-size: .74rem;
  color: var(--muted);
}

/* ---------- Quality-of-data list ---------- */

.quality-list{
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: qitem;
  display:flex;
  flex-direction: column;
  gap: 14px;
}

.quality-list li{
  counter-increment: qitem;
  display:flex;
  gap: 12px;
  font-size: .84rem;
  line-height: 1.5;
}

.quality-list li::before{
  content: counter(qitem);
  flex: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--navy);
  font-weight: 800;
  font-size: .74rem;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-top: 1px;
}

.quality-list b{ color: var(--navy); }

/* ---------- Goals row (page 3) ---------- */

.goal-grid{
  display:grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.goal-card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px 11px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.goal-card::before{
  content:"";
  position:absolute; top:0; left:0; right:0; height:3px;
  background: var(--amber);
}

.goal-label{
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 4px 0 8px;
}

.goal-values{
  display:flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 800;
}

.goal-values .from{ color: var(--muted); font-size: .92rem; font-weight: 600;}
.goal-values .arrow{ color: var(--amber-dark); font-size: 1rem; }
.goal-values .to{ color: var(--navy); font-size: 1.15rem; }

.goal-sub{
  margin-top: 6px;
  font-size: .7rem;
  color: var(--muted);
}

/* ---------- Action plan table ---------- */

.action-table{
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

.action-table thead th{
  background: var(--navy);
  color:#fff;
  font-weight: 700;
  font-size: .76rem;
  text-align: left;
  padding: 10px 12px;
}
.action-table thead th:first-child{ width: 40px; text-align:center; border-radius: 6px 0 0 0;}
.action-table thead th:last-child{ width: 110px; text-align:center; border-radius: 0 6px 0 0;}

.action-table tbody tr:nth-child(odd){ background: #fff; }
.action-table tbody tr:nth-child(even){ background: var(--bg); }

.action-table tbody td{
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.action-table td.num{
  text-align:center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--navy);
  vertical-align: middle;
}

.action-table td.when{
  text-align:center;
  vertical-align: middle;
  background: var(--pale-amber);
  font-weight: 700;
  font-size: .78rem;
  color: var(--navy);
}

.action-table .action-title{
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 4px;
  font-size: .88rem;
}

.action-table .action-how{
  margin: 0 0 8px;
  color: var(--text);
  font-size: .82rem;
  line-height: 1.45;
}

.action-table .action-why{
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.4;
}

.action-table .action-why b{ color: var(--text); }

/* ---------- Timeline ---------- */

.timeline-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.timeline-card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.timeline-head{
  background: var(--navy);
  padding: 8px 12px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 8px;
}

.timeline-head .week{
  color: var(--amber);
  font-weight: 800;
  font-size: .72rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.timeline-head .title{
  color:#fff;
  font-weight: 700;
  font-size: .78rem;
  text-align: right;
}

.timeline-body{
  padding: 12px 14px;
  font-size: .8rem;
  color: var(--text);
  line-height: 1.5;
}

/* ---------- Footer ---------- */

footer.site-footer{
  background: var(--navy);
  color: var(--pale-slate);
  padding: 22px 0;
  font-size: .78rem;
}

footer.site-footer .wrap{
  display:flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

footer.site-footer .amber{ color: var(--amber); font-weight: 700; }

.footnote{
  margin-top: 14px;
  font-size: .72rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- Back to top ---------- */
.top-link{
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--navy);
  color: #fff;
  border: 2px solid var(--amber);
  width: 42px; height: 42px;
  border-radius: 50%;
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(20,33,61,.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 40;
}
.top-link.visible{ opacity: 1; pointer-events:auto; }
.top-link:hover{ transform: translateY(-2px); }

/* ============ Responsive ============ */

@media (max-width: 1020px){
  .kpi-grid{ grid-template-columns: repeat(3, 1fr); }
  .insight-grid{ grid-template-columns: repeat(2, 1fr); }
  .goal-grid{ grid-template-columns: repeat(3, 1fr); }
  .timeline-grid{ grid-template-columns: repeat(2, 1fr); }
  .two-col{ grid-template-columns: 1fr; }
}

@media (max-width: 720px){
  nav.site-nav{
    position: fixed;
    top: var(--header-h);
    left: 0; right:0;
    background: var(--navy);
    flex-direction: column;
    padding: 8px 16px 16px;
    border-bottom: 3px solid var(--amber);
    display: none;
  }
  nav.site-nav.open{ display:flex; }
  nav.site-nav a{ padding: 10px 8px; }
  .nav-toggle{ display:block; }

  .kpi-grid{ grid-template-columns: repeat(2, 1fr); }
  .insight-grid{ grid-template-columns: 1fr; }
  .goal-grid{ grid-template-columns: repeat(2, 1fr); }
  .timeline-grid{ grid-template-columns: 1fr; }

  .action-table thead{ display:none; }
  .action-table, .action-table tbody, .action-table tr, .action-table td{ display:block; width:100%; }
  .action-table tbody tr{ margin-bottom: 10px; border: 1px solid var(--line); border-radius: 8px; overflow:hidden;}
  .action-table td.num{
    text-align:left; background: var(--navy); color:#fff; font-size:.85rem; padding: 8px 12px;
  }
  .action-table td.num::before{ content: "Ação "; font-weight:600; font-size:.72rem; }
  .action-table td.when{ text-align:left; }
  .action-table td.when::before{ content:"Quando: "; font-weight:700; }
}

@media (max-width: 480px){
  .kpi-grid{ grid-template-columns: 1fr 1fr; }
  .goal-grid{ grid-template-columns: 1fr 1fr; }
  .wrap{ padding: 0 16px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ transition: none !important; }
}
