﻿:root {
  --bg: #f7f7f5;
  --panel: #ffffff;
  --ink: #171717;
  --muted: #686868;
  --line: #e6e2dc;
  --brand: #111111;
  --brand-soft: #f2efeb;
  --garage-red: #d71920;
  --accent: #b78b57;
  --danger: #c81e1e;
  --success: #17663a;
  --shadow: 0 10px 28px rgba(24, 24, 24, 0.06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 230px;
  background: #111111;
  color: white;
  padding: 26px 16px;
  border-right: 1px solid #242424;
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 30px;
  padding: 0 8px 20px;
  border-bottom: 1px solid #2b2b2b;
}
.brand strong {
  font-size: 25px;
  line-height: 1;
  letter-spacing: 0;
}
.brand strong::after {
  content: ".";
  color: var(--garage-red);
  margin-left: 1px;
}
.brand span {
  color: #d7d0c8;
  font-size: 13px;
  text-transform: uppercase;
}
nav { display: grid; gap: 6px; }
nav a {
  color: #f5f0eb;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 6px;
  font-size: 14px;
  transition: background .15s ease, color .15s ease;
}
nav a:hover {
  background: #242424;
  color: #ffffff;
}

.main {
  margin-left: 230px;
  padding: 28px 32px;
}
.topbar {
  min-height: 60px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.muted, small { color: var(--muted); display: block; }
.page-title h1 { margin: 0 0 6px; font-size: 30px; font-weight: 700; }
.page-title p { margin: 0 0 18px; color: var(--muted); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.stat span { color: var(--muted); }
.stat strong { display: block; font-size: 30px; margin-top: 8px; }
.stat.alert strong { color: var(--danger); }
.content-grid { display: grid; grid-template-columns: 360px 1fr; gap: 16px; }
.panel { margin-bottom: 16px; overflow-x: auto; }
.panel h2 { margin: 0 0 14px; font-size: 18px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
th { background: #fbfaf8; color: #4f4942; font-size: 12px; text-transform: none; }

input, select, textarea, button {
  font: inherit;
  border: 1px solid #d8d2ca;
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 70px; resize: vertical; }
button {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
  cursor: pointer;
  font-weight: 600;
}
button:hover { filter: brightness(.95); }
.secondary-button {
  background: #ffffff;
  color: var(--brand);
  border-color: var(--brand);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}
label { display: grid; gap: 6px; color: #344054; }
.check { display: flex; align-items: center; gap: 8px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.action-stack { display: grid; gap: 8px; align-items: start; }
.stack-form { display: grid; gap: 8px; min-width: 220px; }
.pending-table {
  table-layout: fixed;
  min-width: 1040px;
}
.pending-table th,
.pending-table td,
.punches-table th,
.punches-table td {
  padding: 8px;
}
.punches-table {
  table-layout: fixed;
  min-width: 1040px;
}
.col-status { width: 150px; }
.col-unit { width: 80px; }
.col-dept { width: 120px; }
.col-person { width: 390px; }
.col-day { width: 88px; }
.col-type { width: 150px; }
.col-action { width: 230px; }
.col-suggestion { width: 150px; }
.col-justification { width: 150px; }

.compact-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 220px;
}

.compact-stats span {
  background: #f3f7f7;
  border: 1px solid #d6e3e1;
  border-radius: 999px;
  color: #1f4f46;
  font-size: 12px;
  line-height: 1.2;
  padding: 3px 8px;
  white-space: nowrap;
}
.catalog-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.catalog-summary span {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #344054;
  font-size: 13px;
  padding: 5px 10px;
}
.employee-name {
  display: block;
  font-weight: 600;
  line-height: 1.2;
}
.punch-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(58px, 1fr));
  gap: 6px;
  align-items: stretch;
}
.punch-under-name {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.punch-slot {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px;
  background: #fbfcfd;
}
.punch-slot span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
}
.punch-slot strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.punch-filled {
  background: #edf8f1;
  border-color: #bfe4ca;
}
.punch-filled strong {
  color: #17663a;
}
.punch-missing {
  background: #fff0f0;
  border-color: #ffc8c8;
}
.punch-missing span,
.punch-missing strong {
  color: var(--danger);
}
.punch-justified {
  background: #eef2ff;
  border-color: #c7d2fe;
}
.punch-justified span,
.punch-justified strong {
  color: #3440a0;
}
.punch-auto {
  background: #eef6ff;
  border-color: #bfd7f1;
}
.punch-auto span,
.punch-auto strong {
  color: #245b89;
}
.bank-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 7px;
}
.bank-strip span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
}
.bank-strip strong {
  color: var(--ink);
}
.bank-strip .bank-negative {
  background: #fff0f0;
  border-color: #ffc8c8;
  color: var(--danger);
}
.bank-strip .bank-negative strong {
  color: var(--danger);
}
.bank-strip .bank-positive {
  background: #edf8f1;
  border-color: #bfe4ca;
  color: #17663a;
}
.bank-strip .bank-positive strong {
  color: #17663a;
}
.compact-action-form {
  min-width: 0;
  gap: 6px;
}
.compact-action-form select,
.compact-action-form textarea,
.compact-action-form button {
  width: 100%;
  padding: 7px 8px;
  font-size: 13px;
}
.compact-action-form textarea {
  min-height: 46px;
}
.compact-button-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.danger-button {
  background: var(--danger);
  border-color: var(--danger);
}
.truncate-text {
  max-height: 58px;
  overflow: hidden;
  overflow-wrap: anywhere;
  line-height: 1.2;
}
.filters { display: flex; gap: 10px; margin-bottom: 14px; }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}
.filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  text-decoration: none;
  border: 1px solid var(--brand);
  border-radius: 6px;
  padding: 9px 10px;
}
.muted-inline {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}
.assignment-form { display: grid; gap: 14px; }
.department-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px 14px;
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.department-picker .check {
  justify-content: flex-start;
  min-height: 32px;
}
.department-picker input { width: 16px; height: 16px; padding: 0; }
.user-list {
  display: grid;
  gap: 14px;
}
.user-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  display: grid;
  gap: 12px;
}
.user-edit-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(220px, 1.4fr) 130px minmax(150px, 1fr) 90px 120px;
  gap: 10px;
  align-items: end;
}
.user-active {
  min-height: 38px;
  justify-content: flex-start;
}
.user-card-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.department-filter-bar {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.user-departments-form {
  gap: 8px;
}
.compact-department-picker {
  max-height: 190px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.admin-access-note {
  display: flex;
  gap: 10px;
  align-items: center;
}
.behavior-list {
  display: grid;
  gap: 14px;
}
.behavior-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.behavior-form {
  display: grid;
  grid-template-columns: minmax(160px, .8fr) minmax(220px, 1fr) minmax(260px, 1.2fr);
  gap: 10px;
  align-items: end;
}
.behavior-form .doc-textarea {
  min-height: 110px;
}
.delete-user-form {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.delete-user-form button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 10px;
  background: #fff1f1;
  color: var(--garage-red);
  font-size: 12px;
  font-weight: 700;
}
.confidence-alta { background: #edf5f2; color: #17663a; }
.confidence-media { background: #fff7e6; color: #946200; }
.confidence-baixa { background: #fff0f0; color: var(--danger); }
.confidence-rhid { background: #eef2ff; color: #3440a0; }

.messages { margin-bottom: 14px; }
.message {
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 8px;
  background: #edf5f2;
  border: 1px solid #cfe3dc;
}
.message.error { background: #fff0f0; border-color: #ffd0d0; color: var(--danger); }
.status-error { color: var(--danger); max-width: 320px; }
.status-ok { color: var(--brand); max-width: 320px; }
.table-scroll {
  overflow-x: auto;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(17, 17, 17, .94), rgba(17, 17, 17, .78)), #111111;
}
.login-box {
  width: min(390px, calc(100vw - 32px));
  background: white;
  border-radius: 8px;
  padding: 28px;
  display: grid;
  gap: 14px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .28);
}
.login-brand strong { color: var(--brand); }
.login-brand strong::after { content: "."; color: var(--garage-red); }
.login-brand span { color: var(--muted); }
.login-title { margin: 0; font-size: 22px; }

@media (max-width: 900px) {
  .sidebar { position: static; width: auto; }
  .main { margin-left: 0; padding: 16px; }
  .stats-grid, .content-grid, .form-grid { grid-template-columns: 1fr; }
  .user-edit-grid { grid-template-columns: 1fr; }
  .department-filter-bar { grid-template-columns: 1fr; }
  .behavior-form { grid-template-columns: 1fr; }
  .inline-form, .filters { flex-wrap: wrap; }
}

.section-label {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.justification-button-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  min-width: 190px;
  max-height: 160px;
  overflow: auto;
}
.justification-choice {
  width: 100%;
  padding: 7px 8px;
  color: #0f4f45;
  font-size: 12px;
  line-height: 1.2;
  text-align: left;
  white-space: normal;
}
.dp-review-box {
  min-width: 250px;
}
.dp-review-box > strong {
  display: block;
  margin-top: 4px;
  line-height: 1.2;
}
.dp-review-box p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}
.manager-proposal-strip {
  margin-top: 8px;
}
.punch-proposed {
  background: #f7fbf8;
  border-color: #beded2;
}
.dp-approval-form {
  margin-top: 8px;
}
.two-actions {
  grid-template-columns: repeat(2, 1fr);
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.38);
}
.modal-backdrop[hidden] {
  display: none;
}
.modal-card {
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.modal-header h2 {
  margin: 0;
  font-size: 18px;
}
.modal-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.icon-close {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 6px;
  background: #f8fafc;
  border-color: var(--line);
  color: var(--ink);
}
.modal-form {
  display: grid;
  gap: 10px;
  padding: 12px 16px 14px;
  overflow-y: auto;
  min-height: 0;
}
.selected-justification {
  border: 1px solid #bfded7;
  border-radius: 6px;
  background: #f1faf7;
  color: #0f4f45;
  font-weight: 700;
  padding: 9px 10px;
}
.modal-punch-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.modal-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.modal-form input,
.modal-form select,
.modal-form textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--ink);
  font-size: 14px;
}
.modal-form textarea {
  min-height: 58px;
  resize: vertical;
}
.modal-required-note {
  color: var(--danger);
  font-weight: 600;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  position: sticky;
  bottom: -14px;
  z-index: 2;
  margin: 0 -16px -14px;
  padding: 10px 16px 12px;
  background: #fff;
  border-top: 1px solid var(--line);
}
/* Tabela de pendencias: compacta no desktop sem rolagem horizontal. */
.pending-results-panel {
  overflow-x: hidden;
}
@media (max-width: 1450px) and (min-width: 761px) {
  .pending-table {
    min-width: 0;
    table-layout: fixed;
    font-size: 13px;
  }
  .pending-table th,
  .pending-table td {
    padding: 7px 6px;
    overflow-wrap: anywhere;
  }
  .pending-table .col-status { width: 122px; }
  .pending-table .col-unit { width: 74px; }
  .pending-table .col-dept { width: 106px; }
  .pending-table .col-person { width: 34%; }
  .pending-table .col-day { width: 78px; }
  .pending-table .col-type { width: 132px; }
  .pending-table .col-action { width: 200px; }
  .pending-table .dp-review-box,
  .pending-table .justification-select-box,
  .pending-table .manager-readonly-box,
  .pending-table .manager-action-status {
    min-width: 0;
    width: 100%;
  }
  .pending-table .punch-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }
  .pending-table .punch-slot {
    min-width: 0;
    padding: 4px;
  }
}

@media (max-width: 760px) {
  .modal-punch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

.rhid-followup {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  border: 1px solid #d6e3e1;
  border-radius: 6px;
  background: #f8fafc;
  padding: 7px 8px;
  font-size: 12px;
  line-height: 1.25;
}
.rhid-followup strong {
  color: #1f4f46;
}
.rhid-followup span {
  color: var(--muted);
}
.rhid-aguardando_rhid {
  background: #fff8e6;
  border-color: #f6d98b;
}
.rhid-aguardando_rhid strong {
  color: #8a5a00;
}
.rhid-resolvido_rhid {
  background: #edf8f1;
  border-color: #bfe4ca;
}
.rhid-resolvido_rhid strong {
  color: #17663a;
}
.rhid-divergente_rhid {
  background: #fff0f0;
  border-color: #ffc8c8;
}
.rhid-divergente_rhid strong {
  color: var(--danger);
}

.punch-suggestion {
  margin-top: 6px;
  border: 1px solid #f3d48b;
  border-radius: 6px;
  background: #fff8e6;
  color: #7a4d00;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  padding: 6px 7px;
}

.modal-original-punches {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  padding: 10px;
}
.modal-original-punches > span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.modal-original-punches button {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 7px 8px;
  text-align: left;
}
.modal-original-punches button small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
}
.modal-original-punches button strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.modal-original-punches button.is-missing {
  background: #fff0f0;
  border-color: #ffc8c8;
}
.modal-original-punches button.is-missing small,
.modal-original-punches button.is-missing strong {
  color: var(--danger);
}
.modal-form input.missing-time {
  background: #fff8e6;
  border-color: #f3d48b;
}

.missing-time-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.modal-form select.missing-time {
  background: #fff8e6;
  border-color: #f3d48b;
}
@media (max-width: 760px) {
  .missing-time-grid {
    grid-template-columns: 1fr;
  }
}


.informed-time-note {
  margin-top: 8px;
  border: 1px solid #f3d48b;
  border-radius: 6px;
  background: #fff8e6;
  color: #7a4d00;
  font-size: 12px;
  line-height: 1.25;
  padding: 7px 8px;
}
.informed-time-note strong {
  color: #7a4d00;
}
.informed-time-note span {
  color: var(--muted);
}

.dp-comparison {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
  padding: 8px;
}
.dp-comparison .section-label {
  margin-top: 0;
}
.dp-comparison .manager-proposal-strip {
  margin-top: 0;
}

.proposal-preview {
  display: grid;
  gap: 6px;
  border: 1px solid #bfded7;
  border-radius: 7px;
  background: #f7fbf8;
  padding: 10px;
}
.proposal-preview > span,
.missing-empty-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.missing-empty-note {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  padding: 8px;
}

.report-check {
  align-self: end;
  min-height: 38px;
}
.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.dp-report-list {
  display: grid;
  gap: 10px;
}
.dp-report-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 10px;
  page-break-inside: avoid;
}
.dp-report-card-header {
  display: grid;
  grid-template-columns: minmax(190px, 1.4fr) 120px 145px;
  gap: 10px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.dp-report-person strong,
.dp-report-date strong {
  display: block;
}
.dp-report-person small,
.dp-report-status small,
.dp-report-details small {
  display: block;
  color: var(--muted);
  line-height: 1.25;
}
.dp-report-punches {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}
.dp-report-punch-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}
.dp-report-row-label {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.dp-report-punch-row .mini-punches-four {
  grid-template-columns: repeat(4, minmax(92px, 1fr));
}
.dp-report-details {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1.2fr);
  gap: 12px;
  margin-top: 9px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.dp-report-details strong {
  display: block;
}
.dp-report-details p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}
@media (max-width: 980px) {
  .dp-report-card-header,
  .dp-report-details {
    grid-template-columns: 1fr;
  }
  .dp-report-punch-row {
    grid-template-columns: 1fr;
  }
  .dp-report-row-label {
    justify-content: flex-start;
    padding: 6px 8px;
  }
  .dp-report-punch-row .mini-punches-four {
    grid-template-columns: repeat(2, minmax(90px, 1fr));
  }
}

.print-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.print-header h2 {
  margin: 0;
}




.report-table-compare th:nth-child(1) { width: 16%; }
.report-table-compare th:nth-child(2) { width: 8%; }
.report-table-compare th:nth-child(3) { width: 10%; }
.report-table-compare th:nth-child(4) { width: 48%; }
.report-table-compare th:nth-child(5) { width: 18%; }



.report-justification-line {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding-top: 7px;
}
.report-justification-line strong {
  color: var(--ink);
}
.report-justification-line span {
  color: var(--muted);
  font-size: 11px;
}

.report-punch-line {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}
.report-row-label {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
  padding: 7px 8px;
}
.report-punch-line .mini-punches-four {
  grid-template-columns: repeat(4, minmax(68px, 1fr));
}

.report-compare-stack {
  display: grid;
  gap: 8px;
}
.report-compare-stack > div + div {
  border-top: 1px solid var(--line);
  padding-top: 7px;
}
.mini-punches-four {
  grid-template-columns: repeat(4, minmax(68px, 1fr));
}

.report-table-wide {
  min-width: 1180px;
  table-layout: auto;
}
.report-table-wide th:nth-child(1) { width: 18%; }
.report-table-wide th:nth-child(2) { width: 8%; }
.report-table-wide th:nth-child(3) { width: 10%; }
.report-table-wide th:nth-child(4) { width: 15%; }
.report-table-wide th:nth-child(5) { width: 17%; }
.report-table-wide th:nth-child(6) { width: 12%; }
.report-table-wide th:nth-child(7) { width: 20%; }
.report-label {
  display: block;
  margin: 0 0 4px;
}

.report-table {
  min-width: 1180px;
  font-size: 12px;
}
.report-table th,
.report-table td {
  padding: 7px;
}
.mini-punches {
  display: grid;
  grid-template-columns: repeat(2, minmax(70px, 1fr));
  gap: 4px;
}
.mini-punches span {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fbfcfd;
  color: var(--muted);
  padding: 4px 5px;
  line-height: 1.15;
}
.mini-punches strong {
  display: block;
  color: var(--ink);
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.proposal-mini span {
  background: #f7fbf8;
  border-color: #beded2;
}
@media print {
  body {
    background: #fff;
    color: #000;
  }
  .sidebar,
  .topbar,
  .messages,
  .no-print {
    display: none !important;
  }
  .main {
    margin: 0;
    padding: 0;
  }
  .panel,
  .report-panel {
    border: 0;
    padding: 0;
    margin: 0;
    overflow: visible;
  }
  .report-table {
    min-width: 0;
    font-size: 10px;
  }

  th,
  td {
    padding: 4px;
  }
  .mini-punches {
    grid-template-columns: repeat(2, 1fr);
  }
  .mini-punches-four {
    grid-template-columns: repeat(4, 1fr);
  }
  .pill,
  .mini-punches span {
    border-color: #999;
    background: #fff;
  }
}
.mode-form {
  display: grid;
  gap: 6px;
  min-width: 210px;
}
.mode-form select {
  width: 100%;
}
.mode-hint {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.mode-hint.warning {
  color: #8a5a00;
}
.mode-hint.danger {
  color: #a32018;
}
.justification-select-box {
  display: grid;
  gap: 5px;
  min-width: 220px;
}
.justification-select-box select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}
.justification-select-box small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}
.attachment-section {
  display: grid;
  gap: 6px;
  border: 1px solid #f0d39c;
  border-radius: 7px;
  background: #fffaf0;
  padding: 10px;
}
.attachment-link {
  display: inline-block;
  margin-top: 6px;
  color: #0f4f45;
  font-size: 12px;
  font-weight: 700;
}
button:disabled,
button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

.manager-inline-review {
  display: grid;
  gap: 6px;
  margin-top: 9px;
  border-top: 1px solid var(--line);
  padding-top: 9px;
}
.manager-inline-review > strong {
  color: #0f4f45;
  line-height: 1.2;
}
.manager-inline-review p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}
.manager-inline-review .section-label {
  margin-top: 0;
}
.manager-inline-review .manager-proposal-strip {
  margin-top: 0;
}
.manager-action-status {
  display: grid;
  gap: 4px;
  min-width: 150px;
  border: 1px solid #d6e3e1;
  border-radius: 7px;
  background: #f8fafc;
  padding: 8px;
}
.manager-action-status strong {
  color: #0f4f45;
  line-height: 1.15;
}
.manager-action-status small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.manager-readonly-box {
  display: grid;
  gap: 5px;
  min-width: 220px;
  border: 1px solid #d6e3e1;
  border-radius: 7px;
  background: #f8fafc;
  padding: 8px;
}
.manager-readonly-box > strong {
  color: #0f4f45;
  line-height: 1.2;
}
.manager-readonly-box p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}
.approval-status-note {
  display: inline-block;
  width: fit-content;
  border-radius: 999px;
  background: #e9f8f1;
  color: #0f5f45;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
}


@media (max-width: 820px) {
  body {
    background: #f4f6f8;
  }
  .sidebar {
    position: static;
    width: 100%;
    padding: 14px 14px 10px;
  }
  .brand {
    margin-bottom: 10px;
  }
  .brand strong {
    font-size: 22px;
  }
  nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  nav a {
    flex: 0 0 auto;
    padding: 9px 10px;
    white-space: nowrap;
  }
  .main {
    margin-left: 0;
    padding: 12px;
  }
  .topbar {
    min-height: 52px;
    height: auto;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
  }
  .page-title h1 {
    font-size: 24px;
  }
  .panel {
    padding: 12px;
    overflow-x: visible;
  }
  .stats-grid,
  .content-grid,
  .form-grid,
  .filter-grid,
  .filters {
    grid-template-columns: 1fr !important;
  }
  .filters,
  .filter-actions,
  .report-actions,
  .inline-form {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .filters select,
  .filters button,
  .filter-grid select,
  .filter-grid input,
  .filter-grid button,
  .filter-grid .button-link,
  .form-grid input,
  .form-grid select,
  .form-grid button {
    width: 100%;
  }
  .button-link,
  button {
    text-align: center;
    justify-content: center;
  }
  .pending-table,
  .punches-table {
    min-width: 0;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0 10px;
  }
  .pending-table colgroup,
  .punches-table colgroup,
  .pending-table thead,
  .punches-table thead {
    display: none;
  }
  .pending-table tbody,
  .punches-table tbody,
  .pending-table tr,
  .punches-table tr,
  .pending-table td,
  .punches-table td {
    display: block;
    width: 100%;
  }
  .pending-table tr,
  .punches-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 10px;
  }
  .pending-table td,
  .punches-table td {
    border-bottom: 0;
    padding: 6px 0;
  }
  .pending-table td::before,
  .punches-table td::before {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
  }
  .pending-table td:nth-child(1)::before { content: "Status"; }
  .pending-table td:nth-child(2)::before { content: "Unidade"; }
  .pending-table td:nth-child(3)::before { content: "Departamento"; }
  .pending-table td:nth-child(4)::before { content: "Funcionario"; }
  .pending-table td:nth-child(5)::before { content: "Dia"; }
  .pending-table td:nth-child(6)::before { content: "Tipo"; }
  .pending-table td:nth-child(7)::before { content: "Acao"; }
  .punches-table td:nth-child(1)::before { content: "Unidade"; }
  .punches-table td:nth-child(2)::before { content: "Departamento"; }
  .punches-table td:nth-child(3)::before { content: "Funcionario"; }
  .punches-table td:nth-child(4)::before { content: "Dia"; }
  .punches-table td:nth-child(5)::before { content: "Justificativas"; }
  .punches-table td:nth-child(6)::before { content: "Acao"; }
  .punch-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .punch-slot {
    min-height: 48px;
  }
  .bank-strip span {
    font-size: 11px;
  }
  .justification-select-box,
  .stack-form,
  .manager-readonly-box,
  .manager-action-status,
  .dp-review-box {
    min-width: 0;
    width: 100%;
  }
  .compact-button-row,
  .two-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .modal-backdrop {
    align-items: stretch;
    padding: 8px;
  }
  .modal-card {
    width: 100%;
    max-height: calc(100vh - 16px);
  }
  .modal-original-punches,
  .proposal-preview .punch-strip,
  .manager-proposal-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .missing-time-grid {
    grid-template-columns: 1fr;
  }
  .modal-actions {
    grid-template-columns: 1fr;
  }
  .report-table {
    min-width: 760px;
  }
  .department-picker {
    grid-template-columns: 1fr !important;
  }
  .user-edit-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 420px) {
  .main {
    padding: 8px;
  }
  .panel {
    padding: 10px;
  }
  .punch-strip,
  .manager-proposal-strip,
  .modal-original-punches,
  .proposal-preview .punch-strip {
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }
  .employee-name {
    font-size: 13px;
  }
  .pill {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

.dp-notification {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid #f0d39c;
  border-left: 5px solid #b88a2e;
  border-radius: 8px;
  background: #fff8e6;
  color: #583a00;
  padding: 12px 14px;
  margin-bottom: 16px;
  box-shadow: 0 8px 20px rgba(16, 24, 32, 0.08);
}
.dp-notification strong {
  display: block;
  color: #583a00;
  margin-bottom: 3px;
}
.dp-notification span {
  display: block;
  color: #7a4d00;
  line-height: 1.25;
}
.dp-notification-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.dp-notification-actions .button-link,
.dp-notification-actions button {
  white-space: nowrap;
}
@media (max-width: 820px) {
  .dp-notification {
    align-items: stretch;
    flex-direction: column;
  }
  .dp-notification-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}


/* Analise de Frequencia */
.frequency-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.frequency-period {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 7px 12px;
  font-size: 13px;
  box-shadow: var(--shadow);
}
.frequency-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.frequency-filters {
  position: sticky;
  top: 20px;
  background: #c7ad93;
  border-color: #c7ad93;
  color: #fff;
  border-radius: 28px;
  padding: 18px;
  overflow: visible;
}
.frequency-brand {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 108px;
  margin-bottom: 10px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 999px;
  text-align: center;
}
.frequency-brand strong {
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 3px;
}
.frequency-brand strong::after {
  content: ".";
  color: var(--garage-red);
}
.frequency-brand span {
  font-size: 11px;
  text-transform: uppercase;
  opacity: .85;
}
.frequency-filter-form {
  display: grid;
  gap: 10px;
}
.frequency-filter-form label {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.frequency-filter-form select,
.frequency-filter-form button,
.frequency-filter-form .button-link {
  width: 100%;
  min-height: 38px;
}
.frequency-filter-form .button-link {
  background: rgba(255,255,255,.88);
}
.frequency-content {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.frequency-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 14px;
}
.frequency-kpi {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
  border-bottom: 3px solid #c7ad93;
}
.frequency-kpi span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}
.frequency-kpi strong {
  font-size: 28px;
  line-height: 1;
}
.frequency-kpi.alert {
  border-bottom-color: var(--garage-red);
}
.frequency-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 16px;
}
.frequency-chart-panel {
  min-height: 280px;
}
.frequency-bars {
  display: grid;
  gap: 12px;
}
.frequency-bar-row {
  display: grid;
  grid-template-columns: minmax(92px, 150px) minmax(120px, 1fr) minmax(48px, auto);
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.frequency-bar-row > span {
  overflow-wrap: anywhere;
}
.frequency-bar,
.frequency-stacked-bar {
  display: flex;
  align-items: stretch;
  min-height: 16px;
  border-radius: 999px;
  background: #f1eee9;
  overflow: hidden;
}
.frequency-bar i,
.frequency-stacked-bar i {
  display: block;
  min-width: 2px;
}
.frequency-bar i {
  background: #c7ad93;
}
.frequency-stacked-bar .bar-falta {
  background: #c7ad93;
}
.frequency-stacked-bar .bar-atestado {
  background: var(--garage-red);
  opacity: .75;
}
.frequency-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}
.frequency-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.frequency-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}
.frequency-legend .bar-falta {
  background: #c7ad93;
}
.frequency-legend .bar-atestado {
  background: var(--garage-red);
}
.frequency-donut-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}
.frequency-donut {
  width: 148px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: conic-gradient(#c7ad93 0 48%, var(--garage-red) 48% 68%, #eee8e0 68% 100%);
  position: relative;
}
.frequency-donut::after {
  content: "";
  position: absolute;
  inset: 34px;
  border-radius: inherit;
  background: #fff;
}
.frequency-just-list {
  display: grid;
  gap: 8px;
  font-size: 13px;
}
.frequency-just-list span {
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
.frequency-table th,
.frequency-table td {
  padding: 10px;
}
@media (max-width: 980px) {
  .frequency-layout,
  .frequency-grid,
  .frequency-kpis {
    grid-template-columns: 1fr;
  }
  .frequency-filters {
    position: static;
    border-radius: 10px;
  }
  .frequency-brand {
    display: none;
  }
  .frequency-filter-form {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    align-items: end;
  }
  .frequency-donut-row {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .frequency-bar-row {
    grid-template-columns: 1fr;
  }
  .frequency-table {
    min-width: 720px;
  }
}
/* Ajuste visual v2 - Analise de Frequencia mais limpa */
.frequency-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.frequency-filters {
  position: static;
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
  border-radius: 8px;
  padding: 14px 16px;
  overflow: visible;
}
.frequency-brand {
  display: none;
}
.frequency-filter-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
}
.frequency-filter-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
}
.frequency-filter-form select,
.frequency-filter-form button,
.frequency-filter-form .button-link {
  width: 100%;
  min-height: 38px;
}
.frequency-filter-form button {
  background: var(--brand);
  border-color: var(--brand);
}
.frequency-filter-form .button-link {
  background: #fff;
}
.frequency-kpis {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}
.frequency-kpi {
  min-height: 86px;
  padding: 15px 16px;
  border-radius: 8px;
  border-bottom-width: 2px;
}
.frequency-kpi strong {
  font-size: 26px;
}
.frequency-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}
.frequency-chart-panel {
  min-height: 220px;
}
.frequency-bars {
  gap: 10px;
}
.frequency-bar-row {
  grid-template-columns: minmax(110px, 160px) minmax(160px, 1fr) minmax(52px, auto);
}
.frequency-bar,
.frequency-stacked-bar {
  min-height: 14px;
}
.frequency-donut-row {
  grid-template-columns: 130px minmax(0, 1fr);
}
.frequency-donut {
  width: 126px;
}
.frequency-donut::after {
  inset: 30px;
}
@media (max-width: 1100px) {
  .frequency-filter-form {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
  .frequency-kpis,
  .frequency-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 760px) {
  .frequency-filter-form,
  .frequency-kpis,
  .frequency-grid,
  .frequency-donut-row {
    grid-template-columns: 1fr;
  }
}

/* Layout inspirado na pagina Garage Conferencia */
body {
  background: #f4f0ea;
  color: #161616;
}
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 82px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  padding: 0 42px;
  background: #ffffff;
  border-bottom: 1px solid #ded8cf;
}
.sidebar {
  display: none;
}
.brand-horizontal {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  color: #111;
  text-decoration: none;
  min-width: 255px;
}
.brand-horizontal strong {
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 9px;
  text-transform: uppercase;
  line-height: 1;
}
.brand-horizontal strong::after {
  content: ".";
  color: var(--garage-red);
  margin-left: 0;
}
.brand-horizontal span {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: #6d5f51;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand-horizontal span::before {
  content: "";
  width: 1px;
  height: 18px;
  background: #d4ccc2;
}
.main-nav {
  display: flex;
  justify-content: flex-end;
  gap: 22px;
  overflow-x: auto;
  white-space: nowrap;
}
.main-nav a {
  color: #111;
  text-decoration: none;
  padding: 9px 0;
  border-radius: 0;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover {
  background: transparent;
  color: #111;
  border-bottom-color: var(--garage-red);
}
.user-menu {
  display: flex;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
}
.user-menu span {
  background: #f3eee8;
  color: #2c241f;
  padding: 11px 14px;
  border-radius: 3px;
  font-size: 13px;
  text-transform: uppercase;
}
.user-menu a {
  color: #111;
  text-decoration: none;
  font-weight: 700;
}
.manager-scope {
  max-width: 330px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid #ded8cf;
  background: #fffdfa !important;
  color: #6d5f51 !important;
  font-size: 11px !important;
  text-transform: uppercase;
}
.main {
  width: min(1224px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 36px 0 48px;
}
.topbar {
  min-height: auto;
  padding: 0;
  margin: 0 0 18px;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.topbar > div {
  display: none;
}
.topbar .pill {
  margin-left: auto;
}
.page-title {
  margin-bottom: 18px;
}
.page-title h1 {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 8px;
}
.page-title p {
  color: #6f665d;
}
.panel,
.stat,
.frequency-kpi,
.user-card,
.login-box {
  border-color: #ded8cf;
  box-shadow: 0 18px 50px rgba(32, 24, 18, .07);
}
.panel,
.stat,
.frequency-kpi {
  background: #ffffff;
}
.stat,
.frequency-kpi {
  border-radius: 7px;
}
.stat strong,
.frequency-kpi strong {
  color: #111;
}
button,
.button-link {
  border-radius: 4px;
}
button,
.btn-primary {
  background: #171717;
  border-color: #171717;
}
.secondary-button,
.button-link.secondary-button {
  background: #fff;
  color: #171717;
  border-color: #cfc6bc;
}
input,
select,
textarea {
  border-color: #d6cec5;
  border-radius: 4px;
}
th {
  background: #faf8f5;
  color: #5f574f;
}
.pill {
  background: #f3eee8;
  color: #2c241f;
  border-radius: 999px;
}
.frequency-title {
  align-items: center;
}
.frequency-period {
  background: #fff;
  border-color: #ded8cf;
  box-shadow: none;
}
.frequency-filters {
  background: #fff;
  border: 1px solid #ded8cf;
  border-radius: 7px;
  box-shadow: 0 18px 50px rgba(32, 24, 18, .06);
}
.frequency-filter-form {
  grid-template-columns: repeat(4, minmax(160px, 1fr)) auto auto;
}
.frequency-kpis {
  gap: 12px;
}
.frequency-kpi {
  border-bottom: 3px solid #c8ad94;
}
.frequency-kpi.alert {
  border-bottom-color: var(--garage-red);
}
.frequency-bar,
.frequency-stacked-bar {
  background: #eee9e3;
}
.frequency-bar i,
.frequency-stacked-bar .bar-falta {
  background: #c8ad94;
}
.frequency-stacked-bar .bar-atestado {
  background: var(--garage-red);
}
.frequency-donut {
  background: conic-gradient(#c8ad94 0 48%, var(--garage-red) 48% 68%, #eee9e3 68% 100%);
}
.login-page {
  background: #f4f0ea;
}
@media (max-width: 1160px) {
  .app-header {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px 24px;
  }
  .brand-horizontal {
    min-width: 0;
  }
  .main-nav {
    justify-content: flex-start;
  }
  .user-menu {
    justify-content: space-between;
  }
  .main {
    width: min(100% - 28px, 1224px);
    padding-top: 24px;
  }
  .frequency-filter-form {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}
@media (max-width: 680px) {
  .app-header {
    padding: 16px;
  }
  .brand-horizontal {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .brand-horizontal strong {
    font-size: 24px;
    letter-spacing: 6px;
  }
  .brand-horizontal span::before {
    display: none;
  }
  .main-nav {
    gap: 14px;
  }
  .user-menu {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .frequency-filter-form,
  .frequency-kpis,
  .frequency-grid {
    grid-template-columns: 1fr;
  }
}

/* Compatibilidade: menu antigo tambem vira topo horizontal */
.sidebar {
  display: grid !important;
  position: sticky !important;
  top: 0;
  z-index: 45;
  inset: auto !important;
  width: 100% !important;
  min-height: 82px;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 0 42px !important;
  background: #ffffff !important;
  color: #111111 !important;
  border-right: 0 !important;
  border-bottom: 1px solid #ded8cf;
}
.sidebar .brand {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  min-width: 255px;
}
.sidebar .brand strong {
  color: #111;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 9px;
  text-transform: uppercase;
  line-height: 1;
}
.sidebar .brand span {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: #6d5f51;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  white-space: nowrap;
}
.sidebar .brand span::before {
  content: "";
  width: 1px;
  height: 18px;
  background: #d4ccc2;
}
.sidebar nav {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  overflow-x: auto;
  white-space: nowrap;
}
.sidebar nav a {
  color: #111 !important;
  text-decoration: none;
  padding: 9px 0;
  border-radius: 0;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 2px solid transparent;
}
.sidebar nav a:hover {
  background: transparent !important;
  color: #111 !important;
  border-bottom-color: var(--garage-red);
}
.sidebar + .main,
.main {
  margin-left: auto !important;
}
@media (max-width: 1160px) {
  .sidebar {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px 24px !important;
  }
  .sidebar .brand {
    min-width: 0;
  }
  .sidebar nav {
    justify-content: flex-start;
  }
}
@media (max-width: 680px) {
  .sidebar {
    padding: 16px !important;
  }
  .sidebar .brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .sidebar .brand strong {
    font-size: 24px;
    letter-spacing: 6px;
  }
  .sidebar .brand span::before {
    display: none;
  }
}

.manager-department-context {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 8px 11px;
  border: 1px solid #ddd3c8;
  border-radius: 3px;
  background: #fffdfa;
  color: #66594d;
  font-size: 12px;
}
.manager-department-context strong {
  color: #221d18;
}
.topbar .manager-department-context + .pill {
  margin-left: 10px;
}
@media (max-width: 680px) {
  .manager-department-context {
    width: 100%;
    margin: 0 0 10px;
  }
}


/* Sem rolagem horizontal: tabelas, filtros e menus se adaptam a qualquer largura. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}
.panel,
.table-scroll {
  overflow-x: visible;
}
table {
  max-width: 100%;
  table-layout: fixed;
}
th,
td {
  overflow-wrap: anywhere;
  word-break: normal;
}
.pending-table,
.punches-table,
.report-table,
.report-table-wide,
.frequency-table {
  min-width: 0 !important;
  max-width: 100%;
  table-layout: fixed;
}
.form-grid,
.frequency-filter-form,
.inline-form,
.compact-button-row,
.main-nav,
.sidebar nav {
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
}
.stack-form,
.mode-form,
.justification-select-box,
.dp-review-box,
.manager-readonly-box,
.manager-action-status {
  min-width: 0;
  max-width: 100%;
}
input,
select,
textarea,
button {
  max-width: 100%;
}
.main-nav,
.sidebar nav {
  overflow-x: visible;
  white-space: normal;
}
@media (max-width: 760px) {
  .report-table,
  .frequency-table {
    min-width: 0 !important;
  }
}
