/* Controle de horas — Lidere */
:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1c1f24;
  --muted: #6b7280;
  --border: #e3e5e8;
  --primary: #0a5fb4;
  --primary-fg: #ffffff;
  --positive: #0a7c3e;
  --negative: #b3261e;
  --warn: #b45309;
  --ok: #0a7c3e;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: #3b3a5e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
}
.topbar .brand a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.topbar .brand a:hover { text-decoration: none; }
.brand-logo { height: 28px; width: auto; display: block; }
.brand-sep { color: rgba(255, 255, 255, 0.4); font-weight: 300; }
.brand-title { font-size: 15px; letter-spacing: 0.01em; }

.topbar .nav { display: flex; align-items: center; gap: 16px; }
.nav-user { color: rgba(255, 255, 255, 0.85); font-size: 13px; }
.nav-role { color: rgba(255, 255, 255, 0.55); font-size: 12px; }
button.link-light {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
}
button.link-light:hover { background: rgba(255, 255, 255, 0.1); }

.subnav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.subnav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
}
.subnav-inner a {
  padding: 12px 16px;
  color: var(--text);
  font-size: 13px;
  border-bottom: 2px solid transparent;
  text-decoration: none;
}
.subnav-inner a:hover {
  color: var(--primary);
}
.subnav-inner a.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.container {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 24px;
}

.footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
}

h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }

.alert.error { background: #fde7e9; border: 1px solid #f5c2c7; color: var(--negative); padding: 10px; border-radius: 6px; }

/* Forms */
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text); }
.form-grid { display: grid; gap: 12px; max-width: 520px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }

button, .button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-block;
}
button.primary, .button.primary {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
}
button:hover, .button:hover { filter: brightness(0.97); }
button.link {
  background: none;
  border: none;
  color: var(--primary);
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
  font-size: 13px;
}
button.link.danger { color: var(--negative); }

form.inline { display: inline; margin: 0; }
form.form-inline { display: flex; gap: 6px; align-items: center; }

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}
.table th, .table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.table thead th { background: #f7f8fa; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.02em; color: var(--muted); }
.table.small th, .table.small td { padding: 6px 8px; font-size: 12px; }

/* Worklogs editable rows */
.table.editable td { vertical-align: middle; }
.inline-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-edit input[type="number"] { width: 80px; }
.inline-edit input[type="text"] { flex: 1; min-width: 180px; }
.checkbox { flex-direction: row; gap: 4px; align-items: center; font-size: 12px; }

.row-released td { background: #f0fdf4; }
.row-inactive td { background: #fafafa; opacity: 0.6; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.badge.ok { background: #dcfce7; color: var(--ok); }
.badge.warn { background: #fef3c7; color: var(--warn); }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.kpi { padding: 12px 16px; background: #f7f8fa; border-radius: 6px; }
.kpi-label { font-size: 11px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.kpi-value { font-size: 22px; font-weight: 600; }
.kpi-value.positive { color: var(--positive); }
.kpi-value.negative { color: var(--negative); }

/* Login */
.login { max-width: 360px; margin: 60px auto; }
.login form { display: grid; gap: 12px; }

/* Sections spacing on detail page */
.card + .card { margin-top: 0; }

/* ============ Print ============ */
@media print {
  @page {
    size: A4;
    margin: 12mm 10mm;
  }
  html, body {
    background: #fff;
    color: #000;
    font-size: 10pt;
    margin: 0;
    padding: 0;
  }
  .topbar, .subnav, .footer, .screen-only, .screen-only-inline { display: none !important; }
  .print-only { display: block !important; }
  .container { max-width: 100%; margin: 0; padding: 0; }
  main.container { margin-top: 0; }
  a { color: inherit; text-decoration: none; }

  /* Cabeçalho compacto sem espaço sobrando */
  .print-only h1 { font-size: 13pt; margin: 0 0 2px; line-height: 1.15; }
  .print-only p { font-size: 9pt; margin: 0; line-height: 1.25; }

  /* Permite quebra dentro de cards/sections — senão a página 1 fica vazia
     quando o conteúdo é maior que a página */
  .card { break-inside: auto; page-break-inside: auto; }
  .month-section { break-inside: auto; page-break-inside: auto; }

  /* Tabelas: quebra entre linhas, mas nunca dentro de uma linha;
     repete o cabeçalho da tabela em cada página nova */
  table { page-break-inside: auto; }
  thead { display: table-header-group; }
  tfoot { display: table-row-group; }
  tr, .total-row { break-inside: avoid; page-break-inside: avoid; }

  /* Modo PDF de um único mês */
  body.printing-single .hide-when-single { display: none !important; }
  body.printing-single details.month-section:not(.print-target) { display: none !important; }
  body.printing-single details.month-section.print-target {
    border: none;
    padding: 0;
    margin: 0;
  }
  /* No PDF de um mês só, o resumo do mês fica no header → esconde o summary
     (que duplicaria a informação) */
  body.printing-single details.month-section.print-target > summary { display: none !important; }

  body.printing-single .single-print-summary { display: block !important; margin: 6px 0 10px; }
  body.printing-single .single-print-summary .kv-table { border-collapse: collapse; }
  body.printing-single .single-print-summary .kv-table td {
    padding: 2px 16px 2px 0;
    font-size: 10pt;
  }
  body.printing-single .single-print-summary .kv-table td:first-child {
    color: #555;
    text-transform: uppercase;
    font-size: 8pt;
    letter-spacing: 0.04em;
  }
  body.printing-single .single-print-summary .kv-table td:last-child {
    font-weight: 600;
  }

  /* Modo PDF completo (todos os meses): esconde os resumos por mês embutidos */
  body:not(.printing-single) .single-print-summary { display: none !important; }
  body:not(.printing-single) details.month-section > summary { padding: 4px 0; }
  body:not(.printing-single) details.month-section > summary .month-toggle-icon { display: none; }
  body:not(.printing-single) details.month-section + details.month-section { margin-top: 6px; }

  .card {
    border: none;
    border-bottom: 1px solid #ccc;
    border-radius: 0;
    padding: 8px 0;
    margin-bottom: 8px;
    background: transparent;
    break-inside: avoid;
  }
  .kpis { display: flex; flex-wrap: wrap; gap: 8px; }
  .kpi {
    background: #f4f4f4;
    border: 1px solid #ddd;
    padding: 6px 10px;
    border-radius: 4px;
    flex: 0 0 auto;
  }
  .kpi-value { font-size: 14pt; }
  h1 { font-size: 16pt; margin: 0 0 4px; }
  h2 { font-size: 12pt; margin: 12px 0 6px; }

  /* Força os details abertos */
  details.month-section { padding: 0; break-inside: avoid; page-break-inside: avoid; }
  details.month-section[open] > summary,
  details.month-section > summary { cursor: default; }
  details.month-section > summary { padding: 6px 0; }
  .month-toggle-icon { display: none; }

  .table { font-size: 9pt; }
  .table th, .table td { padding: 4px 6px; }
  .month-stat-label { display: block; font-size: 8pt; }

  .monthly-summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .monthly-summary-card {
    background: #fafafa;
    break-inside: avoid;
  }
}

/* Charts grid */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 20px;
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}
.chart-card h3 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.chart-wrap {
  position: relative;
  height: 280px;
}
.chart-wrap canvas { display: block; }

/* Seção de aprovações pendentes */
.approvals-section {
  border-left: 4px solid var(--warn);
}

/* Modal genérico */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal.open { display: flex; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.modal-content {
  position: relative;
  background: #fff;
  border-radius: 8px;
  padding: 28px;
  width: 92%;
  max-width: 600px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  z-index: 1;
  max-height: 90vh;
  overflow: auto;
}
.modal-content h3 { font-size: 18px; }
.modal-content label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0;
  font-size: 13px;
}
.modal-content input,
.modal-content textarea,
.modal-content select {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  font-size: 14px;
}
.modal-content textarea { min-height: 70px; resize: vertical; }
.modal-content > form { display: flex; flex-direction: column; gap: 14px; }
.modal-content > form > .row { margin-top: 4px; }

/* Print/screen helpers */
.print-only { display: none; }
.screen-only { display: flex; }
.screen-only-inline { display: inline-block; }

/* Botão pequeno */
.button-sm {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
}

/* Botão de exportar mês: separa visualmente do header */
.export-month-btn {
  margin-left: 12px;
  align-self: center;
}


/* Details/summary expansível */
details.month-section { padding: 0; overflow: hidden; }
details.month-section > summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  user-select: none;
}
details.month-section > summary::-webkit-details-marker { display: none; }
details.month-section > summary::marker { display: none; content: ''; }
.month-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.month-toggle-icon {
  font-size: 14px;
  color: var(--muted);
  transition: transform 0.12s ease;
  display: inline-block;
}
details.month-section[open] .month-toggle-icon { transform: rotate(90deg); }
details.month-section > table { margin: 0; border-top: 1px solid var(--border); }
details.month-section > table thead th {
  padding-left: 20px;
  padding-right: 20px;
}
details.month-section > table tbody td,
details.month-section > table tfoot td {
  padding-left: 20px;
  padding-right: 20px;
}

/* Monthly summary grid (cliente dashboard) */
.monthly-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.monthly-summary-card {
  background: #f7f8fa;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
}
.monthly-summary-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: capitalize;
  margin-bottom: 6px;
  color: var(--text);
}
.monthly-summary-kv {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  font-size: 13px;
}
.monthly-summary-kv dt { color: var(--muted); }
.monthly-summary-kv dd { margin: 0; text-align: right; font-weight: 500; }
.monthly-summary-kv dd.positive { color: var(--positive); }
.monthly-summary-kv dd.negative { color: var(--negative); }

/* Month sections in worklogs */
.month-section {
  margin-bottom: 20px;
}
.month-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.month-title {
  margin: 0;
  font-size: 18px;
  text-transform: capitalize;
}
.month-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  align-items: center;
}
.month-stat {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}
.month-stat-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.month-stat .positive { color: var(--positive); font-weight: 600; }
.month-stat .negative { color: var(--negative); font-weight: 600; }
td.center { text-align: center; }

/* Toolbar dentro do mês (aplicar % em massa) */
.month-toolbar {
  border-top: 1px dashed var(--border);
  padding: 10px 0 14px;
  margin-bottom: 4px;
}
.apply-pct-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.apply-pct-form label { margin: 0; }
.apply-pct-form input[type="number"] {
  padding: 5px 8px;
  font-size: 13px;
}
td.text-right, th.text-right { text-align: right; }

.table tfoot tr.total-row td {
  background: #f7f8fa;
  border-top: 2px solid var(--border);
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: 13px;
}

.empty-state {
  padding: 40px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* ====== Painel trimestral (cliente) — cada linha é um card ====== */
.qp-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.qp-row {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 22px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

/* --- Row: Header --- */
.qp-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.qp-row-left { display: flex; flex-direction: column; gap: 4px; }
.qp-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--muted);
}
.qp-quarter-form { margin: 0; }
.qp-quarter-select {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 28px 4px 8px;
  margin: 0 0 0 -8px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
}
.qp-quarter-select:hover { background-color: #f1f5f9; border-color: var(--border); }
.qp-quarter-select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  background-color: #fff;
}
.qp-row-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.qp-back-link {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.qp-back-link:hover { text-decoration: underline; }
.qp-expires {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fef3c7;
  border: 1px solid #facc15;
  color: #92400e;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.qp-expires-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

/* --- Row: Alerta --- */
.qp-row-alert {
  background: #fef2f2;
  border-color: #fecaca;
  border-left: 4px solid #b91c1c;
  color: #7f1d1d;
  font-size: 13px;
  line-height: 1.5;
}

/* --- Row: cabeçalho interno (título + sub) --- */
.qp-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.qp-row-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}
.qp-row-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.qp-row-sub strong { color: var(--text); }

/* --- Mini cards (composição do saldo + meses) --- */
.qp-mini-cards {
  display: grid;
  grid-template-columns: 1fr 24px 1fr 24px 1fr 24px 1fr;
  gap: 10px;
  align-items: stretch;
}
.qp-mini-cards-3 {
  grid-template-columns: 1fr 24px 1fr 24px 1fr;
}
.qp-mini-cards-months {
  grid-template-columns: repeat(3, 1fr);
}
.qp-mini {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.qp-mini-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--muted);
}
.qp-mini-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.qp-mini-foot {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}

.qp-mini-carry { background: #fffbeb; border-color: #fde68a; }
.qp-mini-carry .qp-mini-value { color: #92400e; }
.qp-mini-carry.is-empty { opacity: 0.55; }

.qp-mini-result { border-width: 2px; }
.qp-mini-result.is-positive {
  background: #f0fdf4;
  border-color: #15803d;
}
.qp-mini-result.is-positive .qp-mini-value { color: #15803d; }
.qp-mini-result.is-negative {
  background: #fef2f2;
  border-color: #b91c1c;
}
.qp-mini-result.is-negative .qp-mini-value { color: #b91c1c; }

.qp-mini-op {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--muted);
}
.qp-mini-op-eq { color: var(--text); }

.qp-balance-breakdown {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qp-balance-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
}
.qp-balance-line.is-expiring {
  background: #fef3c7;
  color: #78350f;
}
.qp-balance-line.is-roll {
  background: #f0f9ff;
  color: #0c4a6e;
}
.qp-balance-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.qp-balance-line.is-expiring .qp-balance-dot { background: #d97706; }
.qp-balance-line.is-roll .qp-balance-dot { background: #0284c7; }

/* --- Row: Barra de consumo --- */
.qp-bar {
  position: relative;
  height: 18px;
  background: #eef0f3;
  border-radius: 999px;
}
.qp-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  background: linear-gradient(90deg, #4ade80 0%, #16a34a 100%);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.qp-bar-fill.over {
  background: linear-gradient(90deg, #f59e0b 0%, #b91c1c 100%);
}
.qp-bar-mark {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: #1f2937;
  transform: translateX(-1px);
  border-radius: 1px;
}
.qp-bar-mark::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1f2937;
  transform: translateX(-50%);
}
.qp-bar-scale {
  position: relative;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-top: 16px;
  min-height: 14px;
}
.qp-bar-scale-mid {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
  font-style: italic;
}

/* --- Mini cards: meses (variações de status + bar + scale + note) --- */
.qp-mini-month {
  background: #f8fafc;
  gap: 8px;
}
.qp-mini-month-over { background: #fef2f2; border-color: #fecaca; }
.qp-mini-month-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.qp-mini-month-name {
  font-size: 14px;
  font-weight: 600;
  text-transform: capitalize;
  color: var(--text);
  line-height: 1.15;
}
.qp-mini-month-year { font-size: 11px; color: var(--muted); margin-top: 2px; }
.qp-mini-month-value { font-size: 26px; }
.qp-mini-month-over .qp-mini-month-value { color: #b91c1c; }

.qp-chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.qp-chip-ok { background: #dcfce7; color: #166534; }
.qp-chip-warn { background: #fef3c7; color: #92400e; }
.qp-chip-danger { background: #fee2e2; color: #991b1b; }

.qp-mini-bar {
  position: relative;
  height: 8px;
  background: #eef0f3;
  border-radius: 999px;
  margin-top: 4px;
  overflow: hidden;
}
.qp-mini-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}
.qp-mini-bar-ok { background: #16a34a; }
.qp-mini-bar-over { background: #b91c1c; }
.qp-mini-bar-scale {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
}
.qp-mini-note {
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.qp-mini-month-over .qp-mini-note { color: #991b1b; border-top-color: #fecaca; }

/* --- Row: Regra contratual --- */
.qp-row-rule { padding: 12px 18px; }
.qp-row-rule details > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
  list-style: none;
}
.qp-row-rule details > summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.15s ease;
  color: var(--muted);
}
.qp-row-rule details[open] > summary::before { transform: rotate(90deg); }
.qp-row-rule details[open] > summary { margin-bottom: 10px; }
.qp-row-rule ul {
  margin: 0;
  padding-left: 22px;
  font-size: 13px;
}
.qp-row-rule li { margin: 4px 0; line-height: 1.5; }

.badge.danger { background: #fde7e9; color: var(--negative); }

/* --- Tarefa aprovada (worklog individual) --- */
.row-approved td { background: #f0fdf4; }
.row-approved td:first-child { box-shadow: inset 3px 0 0 #15803d; }
.approved-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #dcfce7;
  color: #166534;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  margin-left: 6px;
  white-space: nowrap;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Stat extra "Horas Extras Aprovadas" no header do mês */
.month-stat-approved {
  background: #dcfce7;
  color: #166534;
  padding: 4px 10px;
  border-radius: 6px;
}
.month-stat-approved .month-stat-label { color: #166534; }

/* Linha de subtotal "Horas Extras Aprovadas" antes do total do mês */
.subtotal-row td {
  font-size: 12px;
  background: #f0fdf4;
  color: #166534;
  border-top: 1px solid #bbf7d0;
  padding-top: 8px;
  padding-bottom: 8px;
}
.subtotal-row-approved td { font-style: italic; }

.checkbox-row {
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 10px !important;
  padding: 10px 12px;
  background: #f7f8fa;
  border-radius: 6px;
}
.checkbox-row input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; }
.checkbox-row span { display: flex; flex-direction: column; gap: 2px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) {
  .grid-2 { grid-template-columns: 1fr; }
}

button.button-danger, .button.button-danger {
  background: #fff;
  color: #b91c1c;
  border-color: #fecaca;
}
button.button-danger:hover, .button.button-danger:hover {
  background: #fef2f2;
  border-color: #f87171;
  color: #991b1b;
}
.approval-actions {
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
}

.admin-client-picker {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
}

.filter-bar form > label {
  flex: 0 0 auto;
}
.filter-bar input[type="date"], .filter-bar select {
  min-width: 140px;
}

.kpi-card { padding: 18px 22px; }
.kpi-card-hero {
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
  border-color: #bbf7d0;
}
.kpi-card-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.kpi-card-value {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #15803d;
  line-height: 1.05;
}
.kpi-card-foot {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.table-scroll {
  overflow-x: auto;
  margin-top: 6px;
}
.dev-day-table th, .dev-day-table td { font-size: 12px; }
.dev-day-table tfoot td {
  background: #f7f8fa;
  border-top: 2px solid var(--border);
}

.flash {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 14px;
}
.flash-ok { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-warn { background: #fef3c7; color: #92400e; border: 1px solid #facc15; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

.cleanup-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #78350f;
}
.admin-client-picker select {
  font-size: 14px;
  font-weight: 600;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.approval-actions button[disabled],
.approval-actions button.is-loading {
  opacity: 0.55;
  cursor: not-allowed;
}
button[disabled], .button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* --- Responsivo --- */
@media (max-width: 1100px) {
  .qp-mini-cards {
    grid-template-columns: 1fr 1fr;
    row-gap: 12px;
  }
  .qp-mini-cards-months { grid-template-columns: 1fr 1fr; }
  .qp-mini-op { display: none; }
}
@media (max-width: 720px) {
  .qp-row { padding: 14px 16px; }
  .qp-mini-cards { grid-template-columns: 1fr; }
  .qp-mini-cards-months { grid-template-columns: 1fr; }
  .qp-mini-value { font-size: 20px; }
  .qp-mini-month-value { font-size: 22px; }
}

