:root {
  --orange: #ff6b00;
  --orange-dark: #d94f00;
  --green: #13a349;
  --green-dark: #0f8a3f;
  --text: #30343a;
  --muted: #6f747b;
  --line: #dde1e5;
  --paper: #eeeeed;
  --panel: #ffffff;
  --nav: #e9eaec;
  --nav-hover: #f7f7f7;
  --soft-orange: #fff2e8;
  --soft-green: #eaf8ef;
  --soft-gray: #f4f5f6;
  --danger: #b91c1c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--paper);
  font-weight: 400;
}
button, input, select, textarea { font: inherit; }
button {
  border: 0;
  border-radius: 7px;
  padding: 10px 14px;
  background: var(--orange);
  color: #fff;
  font-weight: 500;
  cursor: pointer;
}
button:hover { background: var(--orange-dark); }
button.success { background: var(--green); }
button.success:hover { background: var(--green-dark); }
button.secondary { background: #747a82; }
button.ghost {
  background: #f0f1f2;
  color: var(--text);
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 11px;
  background: white;
  color: var(--text);
}
label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #555b62;
}
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 26px; font-weight: 500; }
h2 { font-size: 17px; margin-bottom: 14px; font-weight: 500; }
strong { font-weight: 500; }
.hidden { display: none !important; }
.muted { color: var(--muted); line-height: 1.45; }
.message { min-height: 22px; color: var(--orange-dark); font-weight: 500; }
.eyebrow {
  margin-bottom: 7px;
  color: var(--orange);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 500;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) minmax(340px, .9fr);
  background: linear-gradient(110deg, #f2f3f4 0 52%, var(--orange) 52% 100%);
}
.brand-panel {
  position: relative;
  padding: clamp(32px, 6vw, 76px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 34px;
}
.brand-logo { width: min(260px, 60vw); height: auto; }
.tagline-logo {
  position: absolute;
  left: clamp(24px, 6vw, 76px);
  bottom: clamp(28px, 5vw, 58px);
  width: min(160px, 34vw);
}
.brand-panel h1 {
  max-width: 720px;
  font-size: clamp(30px, 3.2vw, 44px);
  line-height: 1.05;
  color: #3d4045;
}
.login-card {
  align-self: center;
  justify-self: center;
  width: min(420px, calc(100vw - 36px));
  padding: 28px;
  background: var(--panel);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(60,64,68,.18);
}
.login-card label { margin-bottom: 14px; }
.login-card button { width: 100%; margin-top: 8px; background: var(--green); }
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 76px 1fr;
  transition: grid-template-columns .18s ease;
}
.app-shell:has(.sidebar:hover) { grid-template-columns: 230px 1fr; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--nav);
  color: var(--text);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  border-right: 1px solid #d8dadd;
  box-shadow: 8px 0 26px rgba(80,84,88,.08);
}
.side-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 8px;
  background: white;
  padding: 7px;
  margin: 0 0 10px 0;
}
.nav {
  height: 42px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  padding: 8px;
  overflow: hidden;
}
.nav:hover, .nav.active {
  background: var(--nav-hover);
  border-color: #d7d9dc;
  color: var(--orange-dark);
}
.nav-ico {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: white;
  color: var(--orange);
}
.nav-label {
  opacity: 0;
  white-space: nowrap;
  transition: opacity .12s ease;
}
.sidebar:hover .nav-label { opacity: 1; }
.nav.bottom { margin-top: auto; }
.content { min-width: 0; padding: 24px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.top-actions { display: flex; gap: 10px; }
.filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(155px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.card {
  --accent: #99a1aa;
  position: relative;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  padding: 12px 14px;
  min-height: 74px;
  box-shadow: 0 8px 22px rgba(86,90,94,.06);
}
.card::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -24px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: none;
}
.card strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 9px;
  font-size: 20px;
}
.card.good { --accent: var(--green); }
.card.warn { --accent: var(--orange); }
.card.neutral { --accent: #8d969f; }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 8px 22px rgba(86,90,94,.05);
  min-width: 0;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-head h2 { margin: 0; }
.icon-add {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  background: var(--green);
  font-size: 22px;
  line-height: 1;
}
.icon-add:hover { background: var(--green-dark); }
.inline-proposal {
  display: grid;
  grid-template-columns: 34px minmax(220px, 1.2fr) repeat(5, minmax(120px, 1fr)) 110px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  margin-bottom: 12px;
  background: var(--soft-gray);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.lead-hint {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 12px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}
.form-grid h2, .form-grid .full { grid-column: 1 / -1; }
.form-grid button[type="submit"] {
  grid-column: 1 / -1;
  background: var(--green);
}
.form-grid button[type="submit"]:hover { background: var(--green-dark); }
.bars { display: grid; gap: 9px; }
.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.bar-track {
  height: 12px;
  border-radius: 999px;
  background: #e8ebee;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: var(--w);
  background: linear-gradient(90deg, var(--orange), var(--green));
}
.donut-wrap {
  min-height: 210px;
  display: grid;
  place-items: center;
  gap: 10px;
}
.donut {
  --a: 40%;
  --b: 70%;
  width: 156px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0 var(--a), var(--orange) var(--a) var(--b), #a6adb5 var(--b) 100%);
  position: relative;
}
.donut::after {
  content: "";
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: white;
}
.donut-label {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 13px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
}
.legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
  background: var(--dot);
}
.insight-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px;
  margin-bottom: 16px;
  background: white;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 8px;
}
.insight-hero h2 { margin: 0; font-size: 24px; }
.insight-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 10px;
}
.insight-metric {
  padding: 10px 12px;
  background: var(--soft-gray);
  border-radius: 8px;
}
.insight-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.insight-metric strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}
.insight-list {
  display: grid;
  gap: 10px;
}
.commission-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.commission-box {
  padding: 12px;
  border-radius: 8px;
  border-left: 5px solid var(--green);
  background: var(--soft-green);
}
.commission-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.commission-box strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}
.month-filter {
  width: 180px;
}
.conditional-group {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-gray);
}
.insight-item {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--soft-gray);
  border-left: 4px solid var(--orange);
  line-height: 1.4;
}
.row-actions {
  display: flex;
  gap: 6px;
}
.mini-btn {
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--green);
  font-size: 12px;
}
.table-wrap { overflow: auto; max-height: 560px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  position: sticky;
  top: 0;
  background: #f7f8f9;
  color: #555b62;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 500;
}
.pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf1f4;
  font-weight: 400;
  white-space: nowrap;
}
.pill.fechado { background: #e7f8ed; color: #087a32; }
.pill.aguardando { background: #fff0e4; color: #a94300; }
.pill.perdido { background: #fee2e2; color: var(--danger); }
.import-panel { max-width: 760px; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(238, 238, 237, .78);
  backdrop-filter: blur(2px);
}
.modal {
  width: min(920px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(75,80,86,.18);
  padding: 18px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.modal-head h2 { margin: 0; }
@media (max-width: 1220px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  .grid.three { grid-template-columns: 1fr; }
  .inline-proposal { grid-template-columns: 34px 1fr 1fr; }
  .lead-hint { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; background: #f2f3f4; }
  .tagline-logo { position: static; }
  .app-shell, .app-shell:has(.sidebar:hover) { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; overflow: auto; }
  .side-logo { display: none; }
  .nav-label { opacity: 1; }
  .content { padding: 16px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .filters, .cards, .grid.two, .grid.three, .form-grid, .inline-proposal, .insight-metrics, .commission-summary, .conditional-group { grid-template-columns: 1fr; }
  .insight-hero { align-items: stretch; flex-direction: column; }
}
