/* Rivertec Diagnóstico Comercial — tokens from Elementor kit-16 */
:root {
  --rt-primary: #002F63;
  --rt-primary-dark: #001f42;
  --rt-secondary: #F39200;
  --rt-accent: #F39200;
  --rt-accent-hover: #D88201;
  --rt-text: #7A7A7A;
  --rt-ink: #121C22;
  --rt-surface: #F6F6F6;
  --rt-border: #BABABA;
  --rt-white: #FFFFFF;
  --rt-ok: #1b7a3d;
  --rt-warn: #c47a00;
  --rt-bad: #b42318;
  --rt-sidebar: 260px;
  --rt-font-ui: "Roboto", "Helvetica Neue", Arial, sans-serif;
  --rt-font-display: "Roboto Slab", Georgia, serif;
  --rt-font-body: "Open Sans", "Segoe UI", sans-serif;
  --rt-radius: 6px;
  --rt-shadow: 0 8px 24px rgba(18, 28, 34, 0.08);
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--rt-font-body);
  color: var(--rt-ink);
  background: var(--rt-surface);
}

body {
  display: flex;
  min-height: 100vh;
}

a { color: var(--rt-primary); }

img { max-width: 100%; height: auto; }

/* Layout */
.app-shell {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.sidebar {
  width: var(--rt-sidebar);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--rt-primary) 0%, var(--rt-primary-dark) 100%);
  color: var(--rt-white);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.sidebar-brand img {
  display: block;
  width: 100%;
  max-width: 210px;
  height: auto;
}

.sidebar-brand .product {
  margin-top: 0.75rem;
  font-family: var(--rt-font-ui);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: rgba(255,255,255,0.92);
}

.sidebar-brand .product span {
  display: block;
  font-weight: 400;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.65);
  margin-top: 0.2rem;
}

.nav {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0.75rem 1.5rem;
  gap: 0.25rem;
}

.nav button {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.82);
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-radius: var(--rt-radius);
  font-family: var(--rt-font-ui);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav button:hover { background: rgba(255,255,255,0.08); color: #fff; }

.nav button.active {
  background: var(--rt-secondary);
  color: #fff;
}

.sidebar-foot {
  margin-top: auto;
  padding: 1rem 1.1rem 1.25rem;
  font-size: 0.72rem;
  line-height: 1.4;
  color: rgba(255,255,255,0.55);
  border-top: 1px solid rgba(255,255,255,0.1);
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--rt-white);
  border-bottom: 1px solid #e6e6e6;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar h1 {
  margin: 0;
  font-family: var(--rt-font-ui);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--rt-primary);
}

.topbar .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--rt-font-ui);
  background: #fff4e5;
  color: var(--rt-accent-hover);
  border: 1px solid #ffd9a0;
}

.content {
  padding: 1.25rem 1.5rem 2.5rem;
}

.view { display: none; }
.view.active { display: block; }

.section {
  background: var(--rt-white);
  border: 1px solid #e8e6e3;
  border-radius: 10px;
  padding: 1.15rem 1.25rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--rt-shadow);
}

.section > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  cursor: pointer;
  user-select: none;
}

.section > header h2 {
  margin: 0;
  font-family: var(--rt-font-ui);
  font-size: 1.05rem;
  color: var(--rt-primary);
}

.section > header p {
  margin: 0.25rem 0 0;
  color: var(--rt-text);
  font-size: 0.85rem;
}

.section.collapsed .section-body { display: none; }

.chev {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #e0e0e0;
  display: grid;
  place-items: center;
  color: var(--rt-primary);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.section.collapsed .chev { transform: rotate(-90deg); }

.grid {
  display: grid;
  gap: 0.85rem;
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

@media (max-width: 1100px) {
  .grid-4, .grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  body { display: block; }
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav button { flex: 1 1 140px; }
  .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; }
}

.field label {
  display: block;
  font-family: var(--rt-font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--rt-primary);
  margin-bottom: 0.3rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #d5d5d5;
  border-radius: var(--rt-radius);
  padding: 0.55rem 0.7rem;
  font: inherit;
  color: var(--rt-ink);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--rt-secondary);
  box-shadow: 0 0 0 3px rgba(243, 146, 0, 0.18);
}

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

.field .hint {
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--rt-text);
  line-height: 1.35;
}

.readonly {
  background: #f3f5f8 !important;
  color: var(--rt-ink);
}

.btn {
  appearance: none;
  border: 0;
  border-radius: var(--rt-radius);
  padding: 0.55rem 1rem;
  font-family: var(--rt-font-ui);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--rt-secondary);
  color: #fff;
}
.btn-primary:hover { background: var(--rt-accent-hover); }
.btn-ghost {
  background: transparent;
  color: var(--rt-primary);
  border: 1px solid #cfd6e0;
}
.btn-ghost:hover { background: #f0f3f7; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}
@media (max-width: 900px) { .kpi-row { grid-template-columns: 1fr; } }

.kpi {
  background: var(--rt-white);
  border: 1px solid #e8e6e3;
  border-radius: 10px;
  padding: 1rem 1.1rem;
  box-shadow: var(--rt-shadow);
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--rt-secondary);
}
.kpi .label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rt-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kpi .value {
  margin-top: 0.35rem;
  font-family: var(--rt-font-ui);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--rt-primary);
}
.kpi .sub {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--rt-text);
}

.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--rt-font-ui);
}
.farol-5, .farol-excelente { background: #e8f7ee; color: var(--rt-ok); }
.farol-4, .farol-muito-boa { background: #eaf4ff; color: #1258a8; }
.farol-3, .farol-boa { background: #fff7e6; color: var(--rt-warn); }
.farol-2, .farol-limitada { background: #fff0e8; color: #c2410c; }
.farol-1, .farol-critica { background: #fdecea; color: var(--rt-bad); }

.leitura-box {
  margin-top: 0.75rem;
  padding: 0.85rem 0.95rem;
  border-radius: 8px;
  background: linear-gradient(135deg, #f7f9fc 0%, #fff 100%);
  border: 1px solid #e4e9f0;
}
.leitura-box strong {
  display: block;
  color: var(--rt-primary);
  font-family: var(--rt-font-ui);
  margin-bottom: 0.25rem;
  font-size: 0.88rem;
}
.leitura-box p {
  margin: 0.2rem 0;
  color: var(--rt-text);
  font-size: 0.85rem;
  line-height: 1.45;
}

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
table.data th,
table.data td {
  border-bottom: 1px solid #ececec;
  padding: 0.55rem 0.45rem;
  text-align: left;
  vertical-align: top;
}
table.data th {
  font-family: var(--rt-font-ui);
  font-size: 0.75rem;
  color: var(--rt-primary);
  background: #f8f9fb;
  white-space: nowrap;
}
table.data input,
table.data select {
  width: 100%;
  min-width: 90px;
  border: 1px solid #d5d5d5;
  border-radius: 4px;
  padding: 0.35rem 0.4rem;
  font: inherit;
}

.panel-score {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed #e5e5e5;
}

.alert-banner {
  padding: 0.9rem 1rem;
  border-radius: 8px;
  background: #002F63;
  color: #fff;
  margin-bottom: 1rem;
}
.alert-banner h3 {
  margin: 0 0 0.35rem;
  font-family: var(--rt-font-ui);
  font-size: 1rem;
  color: var(--rt-secondary);
}
.alert-banner p { margin: 0.2rem 0; font-size: 0.88rem; opacity: 0.92; }

.perguntas-bloco {
  border: 1px solid #ebebeb;
  border-radius: 8px;
  padding: 0.9rem;
  margin-bottom: 0.75rem;
  background: #fafafa;
}
.perguntas-bloco h3 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  color: var(--rt-primary);
  font-family: var(--rt-font-ui);
}
.perguntas-bloco .objetivo {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: var(--rt-text);
}

.ref-table {
  margin-bottom: 1.25rem;
}
.ref-table h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--rt-primary);
}

.muted { color: var(--rt-text); }
.mono { font-variant-numeric: tabular-nums; }

.dash-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
}
@media (max-width: 980px) { .dash-grid { grid-template-columns: 1fr; } }

.ident-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
@media (max-width: 900px) { .ident-strip { grid-template-columns: 1fr 1fr; } }

.ident-item {
  background: #fff;
  border: 1px solid #e8e6e3;
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
}
.ident-item .k {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rt-text);
  font-weight: 600;
}
.ident-item .v {
  margin-top: 0.2rem;
  font-family: var(--rt-font-ui);
  font-weight: 600;
  color: var(--rt-primary);
  font-size: 0.95rem;
}

.mobile-toggle {
  display: none;
  appearance: none;
  border: 1px solid rgba(255,255,255,0.25);
  background: transparent;
  color: #fff;
  border-radius: 6px;
  padding: 0.4rem 0.65rem;
  margin: 0.75rem 1rem 0;
  font-family: var(--rt-font-ui);
}
@media (max-width: 820px) {
  .mobile-toggle { display: inline-flex; }
  .sidebar .nav { display: none; }
  .sidebar.nav-open .nav { display: flex; }
}
