:root {
  --bg: #0f1115;
  --bg-alt: #161922;
  --text: #e7e9ee;
  --muted: #9aa1ad;
  --accent: #6ea8fe;
  --border: #262b36;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
}

.logo { font-weight: 700; }

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1.5rem;
}

.nav-links a:hover { color: var(--text); }

.hero { text-align: center; padding: 4rem 1.25rem; }

.highlight { color: var(--accent); }

.muted { color: var(--muted); }

h2 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.project-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

.project-card h3 { margin-top: 0; }

.project-card a { color: var(--accent); }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 480px;
  margin-top: 1.5rem;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.contact-form input,
.contact-form textarea {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  color: var(--text);
  font: inherit;
}

.contact-form button {
  align-self: flex-start;
  background: var(--accent);
  color: #0f1115;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2.5rem;
  width: 100%;
  max-width: 320px;
  text-align: center;
}

.login-icon {
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.login-card h1 {
  margin-top: 0;
  font-size: 1.25rem;
}

.login-card .contact-form {
  margin-top: 1rem;
  max-width: none;
}

.login-card button {
  width: 100%;
}

.dashboard {
  max-width: 1800px;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 0.6rem 1rem;
  font: inherit;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.checkbox-label {
  flex-direction: row !important;
  align-items: center;
  gap: 0.4rem !important;
}

.mensal-table {
  table-layout: fixed;
  width: 1710px;
}

.mensal-table tfoot td, .mensal-table tfoot th {
  font-weight: 700;
  background: var(--bg-alt);
  border-top: 2px solid var(--border);
}

.mensal-table th, .mensal-table td {
  text-align: right;
  width: 70px;
}

.mensal-table thead th:nth-child(1), .mensal-table tbody td:nth-child(1) {
  text-align: left;
  width: 230px;
  white-space: normal;
}

.mensal-table thead th:nth-child(2), .mensal-table tbody td:nth-child(2) {
  text-align: left;
  width: 180px;
  white-space: normal;
}

.mensal-table thead th:nth-child(3), .mensal-table tbody td:nth-child(3) {
  text-align: left;
  width: 130px;
  font-variant-numeric: tabular-nums;
}

.mensal-table thead th:nth-child(4), .mensal-table tbody td:nth-child(4) {
  text-align: left;
  width: 170px;
}

.mensal-table th:last-child, .mensal-table td:last-child {
  width: 160px;
  font-weight: 600;
}

.mensal-table .mensal-foot-label {
  text-align: left;
}

.mensal-table td.zero {
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.filters input,
.filters select {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  color: var(--text);
  font: inherit;
  min-width: 160px;
}

.filters button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* table-layout:fixed + largura explícita (não min-width) por coluna: o total
   passa da largura do container de propósito, pra .table-wrap rolar de verdade. */
#deals-table {
  table-layout: fixed;
  width: 1680px;
}
#deals-table th:nth-child(1), #deals-table td:nth-child(1) { width: 36px; }
#deals-table th:nth-child(2), #deals-table td:nth-child(2) { width: 330px; white-space: normal; }
#deals-table th:nth-child(3), #deals-table td:nth-child(3) {
  width: 130px;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  font-variant-numeric: tabular-nums;
}
#deals-table th:nth-child(4), #deals-table td:nth-child(4) { width: 220px; white-space: normal; }
#deals-table th:nth-child(5), #deals-table td:nth-child(5) { width: 150px; }
#deals-table th:nth-child(6), #deals-table td:nth-child(6) { width: 170px; }
#deals-table th:nth-child(7), #deals-table td:nth-child(7) { width: 150px; }
#deals-table th:nth-child(8), #deals-table td:nth-child(8) { width: 90px; }
#deals-table th:nth-child(9), #deals-table td:nth-child(9),
#deals-table th:nth-child(10), #deals-table td:nth-child(10),
#deals-table th:nth-child(11), #deals-table td:nth-child(11) { width: 130px; }

thead th {
  background: var(--bg-alt);
  position: sticky;
  top: 0;
}

.deal-row {
  cursor: pointer;
}

.deal-row:hover {
  background: var(--bg-alt);
}

.expand-toggle {
  color: var(--accent);
  width: 1.5rem;
}

.col-name {
  min-width: 260px;
  white-space: normal;
}

.col-amount {
  min-width: 140px;
  font-variant-numeric: tabular-nums;
}

.stage-pill {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  color: #0b0d11;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.detail-row td {
  background: var(--bg-alt);
  white-space: normal;
}

.detail-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-areas:
    "horas items"
    "parcelas parcelas";
  gap: 1.25rem;
  padding: 1rem 0.5rem;
}

.detail-horas { grid-area: horas; }
.detail-items { grid-area: items; }
.detail-parcelas { grid-area: parcelas; }

.detail-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.detail-panel h4 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
}

.detail-panel p {
  margin: 0.2rem 0;
  font-size: 0.85rem;
}

.mini-table {
  width: 100%;
  font-size: 0.8rem;
}

.mini-table th, .mini-table td {
  padding: 0.35rem 0.5rem;
  white-space: normal;
}

@media (max-width: 800px) {
  .detail-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "horas"
      "items"
      "parcelas";
  }
}
