:root{
  --green: #0f5d1e;
  --green-dark: #163020;
  --green-light: #7acb44;
  --bg: #edf1e8;
  --panel-bg: #fdfefd;
  --muted: #58705d;
  --accent: #e7f1df;
  --text-main: #1f3325;
  --surface-alt: #f3f8ef;
  --border-soft: #d8e2d4;
  --focus-ring: rgba(122,203,68,0.26);
}
*{box-sizing:border-box}
html,body{height:100%;margin:0;font-family:Poppins,Inter,system-ui,Arial,sans-serif;background:var(--bg);color:var(--text-main)}

.topbar{background:var(--green);color:#fff;padding:14px 0}
.topbar-inner{max-width:1180px;margin:0 auto;display:flex;align-items:center;gap:20px;padding:0 18px}
.brand{display:flex;align-items:center;gap:10px}
.logo{font-weight:700;font-size:20px}
.brand .logo a{display:inline-flex;align-items:center;gap:10px}

/* Logo image in the topbar */
.brand-logo{
  width:220px;
  height:52px;
  display:block;
  object-fit:cover;
  object-position:center;
  image-rendering:auto;
}

.brand-end{margin-left:auto;display:flex;align-items:center}
.brand-end-link{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 10px;
  border-radius:8px;
  border:1px solid rgba(233,241,255,0.32);
  background:rgba(255,255,255,0.08);
  color:#fff;
  text-decoration:none;
  font-weight:600;
  font-size:12px;
  letter-spacing:.2px;
  line-height:1;
  transition:background .14s ease, border-color .14s ease, transform .12s ease;
}
.brand-end-link svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:1.8}
.brand-end-link:hover,
.brand-end-link:visited,
.brand-end-link:active{color:#fff;text-decoration:none}
.brand-end-link:hover{background:rgba(255,255,255,0.16);border-color:rgba(233,241,255,0.55);transform:translateY(-1px)}
.brand-end-link:focus-visible{outline:none;box-shadow:0 0 0 4px var(--focus-ring)}

@media (max-width:480px){
  .brand-logo{width:150px;height:36px}
  .brand-end-link{font-size:11px;padding:6px 8px}
  .brand-end-link .logout-label{display:none}
}
.subtitle{opacity:.95;font-size:14px}
.main-nav ul{list-style:none;margin:0;padding:0;display:flex;gap:18px}
.main-nav a{color:#e9f1ff;text-decoration:none;font-weight:600}
.user-area{display:flex;align-items:center;gap:12px}
.user-area .icons{display:flex;gap:8px}
.icon{background:transparent;border:1px solid rgba(255,255,255,0.15);color:#fff;padding:6px 8px;border-radius:6px}
.welcome{background:rgba(255,255,255,0.06);padding:8px 12px;border-radius:18px;font-size:13px}

main{max-width:1180px;margin:18px auto;padding:0 18px;display:flex;gap:16px}
.left-tab{background:linear-gradient(120deg, var(--accent), transparent 60%);padding:14px 22px;border-radius:6px;color:var(--green-dark);font-weight:700;align-self:flex-start}

.page-wrap{flex:1}
.panel{background:var(--panel-bg);padding:24px;border-radius:12px;box-shadow:0 0 0 6px rgba(22,48,32,0.03) inset}
.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:18px}
.card{background:#fff;border:1px solid var(--border-soft);padding:28px;border-radius:12px;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:110px;position:relative;overflow:hidden}
.card-icon{width:46px;height:46px;display:block;margin-bottom:14px}
.card-title{font-weight:700;text-align:center;letter-spacing:0.6px}

.notice{margin-top:18px;background:var(--accent);padding:18px;border-radius:10px;color:var(--green-dark);text-align:center}
.help-fab{position:fixed;right:34px;bottom:34px;background:var(--green);color:#fff;border:0;width:64px;height:64px;border-radius:50%;font-size:22px;box-shadow:0 10px 30px rgba(22,48,32,0.22)}

/* Make card links fill the card and inherit styles (removes default blue/underline) */
.card-link{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  width:100%;
  height:100%;
  color:inherit;
  text-decoration:none;
  padding:0; /* inner spacing handled by .card */
  transition:box-shadow .18s ease, transform .12s ease, border-color .12s ease;
  outline: none;
}

/* ensure titles inside links look like the rest of UI */
.card-link .card-title{
  color:var(--green-dark);
  text-decoration:none;
  text-transform:uppercase;
  letter-spacing:0.8px;
}

/* Hover / active visual feedback */
.card-link:hover,
.card-link:focus{
  box-shadow:0 10px 30px rgba(122,203,68,0.18);
  transform:translateY(-6px);
  border-radius:12px;
}

/* Accessible focus ring */
.card-link:focus-visible{
  box-shadow:0 0 0 5px var(--focus-ring);
}

/* Keep inline SVG color consistent (if you want to tint icons on hover) */
.card-link svg path,
.card-link svg rect{
  transition:stroke .12s ease, fill .12s ease;
}
.card-link:hover svg path,
.card-link:hover svg rect{
  stroke:var(--green-light);
  fill: none;
}

/* Keep visited links same visual */
.card-link:visited{ color:inherit; text-decoration:none; }

/* Topbar adjustments */
.topbar,
.topbar-inner{
  overflow: visible; /* allow dropdown to overflow topbar */
}

/* Waffle menu (topbar) */
.waffle{
  position:relative;
  z-index:60; /* keep menu above other elements */
}
.waffle-btn{
  background:transparent;border:0;padding:8px;border-radius:8px;cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;
  transition:background .12s ease, transform .12s ease;
}
.waffle-btn:hover{background:rgba(255,255,255,0.06);transform:translateY(-1px)}
.waffle-menu{
  position:absolute;
  top:calc(100% + 8px);
  left:0;                 /* align from the waffle button's left edge */
  right:auto;
  min-width:260px;       /* wider so labels fit in one column */
  max-width:320px;
  max-height:48vh;       /* allow scrolling if viewport is small */
  overflow:auto;
  background:var(--panel-bg);
  border-radius:10px;
  box-shadow:0 10px 30px rgba(22,48,32,0.16);
  padding:8px 6px;
  border:1px solid rgba(122,203,68,0.28);
  display:block;
  opacity:0;visibility:hidden;
  transform:translateY(6px);
  transition:opacity .16s ease, transform .16s ease, visibility .16s;
  z-index:70;
  list-style:none;margin:0;
}

/* Show on hover/focus of container for mouse users; focus within supports keyboard */
.waffle:hover .waffle-menu,
.waffle:focus-within .waffle-menu{
  opacity:1;visibility:visible;transform:translateY(0);
}

/* Ensure full-width items and readable text */
.waffle-menu li{margin:6px 0}
.waffle-menu a{
  display:block;
  width:100%;
  padding:10px 14px;
  border-radius:8px;
  color:var(--green-dark);
  text-decoration:none;
  font-weight:600;
  white-space:normal; /* allow wrapping if needed */
  box-sizing:border-box;
}

/* Menu items */
.waffle-menu li{margin:4px 0}
.waffle-menu a{
  display:block;padding:10px 12px;border-radius:8px;color:var(--green-dark);text-decoration:none;font-weight:600;
  transition:background .12s ease,color .12s ease;
}
.waffle-menu a:hover,
.waffle-menu a:focus{
  background:var(--accent);color:var(--green-dark);
  outline:none;
}

/* Ensure the brand link looks identical to the plain logo text */
.topbar .brand .logo,
.topbar .brand .logo a{
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  font-size: 20px;
  display: inline-flex;
  align-items:center;
  line-height: 1;
}

/* Remove default link styling in all states */
.topbar .brand .logo a,
.topbar .brand .logo a:visited,
.topbar .brand .logo a:active,
.topbar .brand .logo a:hover{
  color: inherit;
  text-decoration: none;
}

/* Accessible focus ring only for keyboard users */
.topbar .brand .logo a:focus{
  outline: none;
}
.topbar .brand .logo a:focus-visible{
  box-shadow: 0 0 0 4px var(--focus-ring);
  border-radius: 6px;
}

/* small spacing adjustment if link pushes layout */
.topbar .brand{ display:flex; align-items:center; gap:8px; }

/* Ensure waffle does not break small-screen behavior (nav already hidden at small sizes) */
@media (max-width:800px){
  .waffle{display:none}
  .grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:480px){
  .grid{grid-template-columns:1fr}
  .card{padding:22px}
  .topbar-inner{padding:0 12px}
}

/* Added: panel / table / search / add-button styles (moved from colaboradores/veiculos) */
.panel-heading{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:12px}
.panel-heading .left-area{display:flex;align-items:center;gap:12px}
.add-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;height:36px;border-radius:8px;border:0;
  background:var(--green);color:#fff;font-weight:700;font-size:18px;
  cursor:pointer;box-shadow:0 6px 14px rgba(22,48,32,0.2);
}
.add-btn:hover{transform:translateY(-2px);opacity:0.95}
.add-btn:focus{outline:none;box-shadow:0 0 0 4px var(--focus-ring)}
.add-btn{text-decoration:none}
.panel-heading .right-area{display:flex;flex-direction:column;align-items:flex-end;gap:8px}
.search-row{display:flex;align-items:center;gap:8px;margin-top:6px}
.search-row svg{width:18px;height:18px;stroke:var(--green-dark);stroke-width:1.6;fill:none}
.search-row input{
  padding:8px 10px;border-radius:8px;border:1px solid var(--border-soft);background:var(--surface-alt);
  width:260px;font-size:13px;color:var(--text-main);
}
.table-container{max-width:1100px;margin:10px auto 0;overflow:auto;}
table.collab{width:100%;border-collapse:collapse;font-size:13px}
table.collab thead th{background:var(--surface-alt);color:var(--green-dark);text-align:left;padding:10px;border-bottom:1px solid var(--border-soft)}
table.collab tbody td{padding:10px;border-bottom:1px solid var(--border-soft);color:var(--text-main);vertical-align:middle}
table.collab tbody tr:hover{background:#f6faf2}
.small-muted{font-size:12px;color:var(--muted)}
.back-link{color:var(--green-dark);text-decoration:none;font-weight:600}
@media (max-width:900px){ table.collab thead th:nth-child(4), table.collab td:nth-child(4){display:none} }

/* Center all table content */
table.collab thead th,
table.collab tbody td{
  text-align: center;
  vertical-align: middle;
}

/* NOTE: removed broad nth-child width rules that applied to every .collab table
   Those generic rules caused unexpected large columns across pages. Use
   specific column classes on table headers/cells when you need fixed widths.

   Helpers below can be applied per-table via classes (recommended):
   - add `class="col-id"` or `class="col-actions"` to <th>/<td>
   - use `class="table-desc"` on a <th>/<td> that should allow wrapping
*/

/* Helper: description column helper (use on specific tables only) */
.table-desc{
  min-width:420px;
  text-align:left;
  white-space:normal;
  padding-left:18px;
  padding-right:18px;
}

/* Utility classes for common column sizing (apply to <th> and <td> where needed) */
table.collab th.col-id, table.collab td.col-id{ width:56px; white-space:nowrap; }
table.collab th.col-actions, table.collab td.col-actions{ width:92px; white-space:nowrap; }
table.collab th.col-small, table.collab td.col-small{ width:110px; white-space:nowrap; }
table.collab th.col-medium, table.collab td.col-medium{ width:160px; }

/* Image styling inside table */
table.collab img{
  display:block;
  margin:0 auto;
  width:64px;
  height:64px;
  object-fit:cover;
  border-radius:6px;
}

/* Filter row (buttons above table) */
.filter-row{display:flex;gap:10px;align-items:center;margin:8px 0 16px}
.filter-btn{padding:8px 12px;border-radius:8px;border:1px solid rgba(15,93,30,0.2);background:#fff;color:var(--green-dark);font-weight:600;cursor:pointer;text-decoration:none}
.filter-btn.primary{background:var(--green-dark);color:#fff;border-color:var(--green-dark)}

/* Status badges */
.status-badge{display:inline-block;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:700;color:#fff}
.status-open{background:#F59E0B} /* amber */
.status-resolved{background:#10B981} /* green */
.status-cancelled{background:#EF4444} /* red */

/* Prefer using the .table-desc helper instead of targeting nth-child(3).
   This avoids coupling visual rules to a table column order which varies
   between pages. Example usage in HTML:
     <th class="table-desc">Descrição</th>
     <td class="table-desc">Long description text...</td>
*/

/* Center actions column content */
table.collab thead th:last-child,
table.collab tbody td.actions {
  text-align: center;
  vertical-align: middle;
  width: 92px;
}
.actions{
  display:table-cell;
  white-space:nowrap;
}
.action-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  padding:0;
  border-radius:6px;
  background:transparent;
  border:0;
  cursor:pointer;
  vertical-align:middle;
  margin:0 4px;
}
.action-btn svg{width:16px;height:16px;display:block}

/* Helpers para ajustar largura das colunas na tabela de Relatórios
   - Aplique a classe reports-cols na tabela (ex: <table class="collab reports-cols">)
   - Use classes de coluna nos <th> e <td> (ex: col-date-final) para controle preciso
   - Valores definidos aqui priorizam legibilidade e ocupação horizontal reduzida
*/
.reports-cols th.col-id, .reports-cols td.col-id{
  width:48px;
  text-align:center;
  white-space:nowrap;
}
.reports-cols th.col-date-initial, .reports-cols td.col-date-initial{
  width:72px;
  min-width:72px;
  text-align:center;
  white-space:nowrap;
  padding:6px 6px;
}
.reports-cols th.col-date-final, .reports-cols td.col-date-final{
  width:44px;
  min-width:44px;
  text-align:center;
  white-space:nowrap;
  padding:6px 6px;
}
.reports-cols th.col-name, .reports-cols td.col-name{
  min-width:160px;
  max-width:260px;
  text-align:center;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  padding:6px 8px;
}
.reports-cols th.col-checklist, .reports-cols td.col-checklist{
  width:96px;
  text-align:center;
}
.reports-cols th.col-horimetro, .reports-cols td.col-horimetro{
  width:110px;
  text-align:center;
  white-space:nowrap;
}
.reports-cols th.col-destino, .reports-cols td.col-destino{
  min-width:140px;
  text-align:left;
  padding-left:12px;
}
.reports-cols th.col-actions, .reports-cols td.col-actions{
  width:120px;
  text-align:center;
}
.reports-cols td{padding:8px 6px}

/* visual helper para o link 'checklist' na tabela de relatórios */
.reports-checklist-link{display:inline-block;padding:6px 10px;border-radius:10px;border:1px solid rgba(15,93,30,0.24);background:#fff;color:var(--green-dark);font-weight:700;text-decoration:none}

/* Tintar ícones principais para verde (sobrescreve cores inline dos SVGs) */
/* Aplica ao ícone "waffle" no topo e aos ícones dos cards */
.waffle-btn svg rect,
.waffle-btn svg path,
.waffle-btn svg circle{
  fill: #eaf5df !important;
  stroke: #eaf5df !important;
}

/* waffle hover: use lighter green on hover */
.waffle-btn:hover svg rect,
.waffle-btn:hover svg path,
.waffle-btn:hover svg circle{
  fill: var(--green-light) !important;
  stroke: var(--green-light) !important;
}

.card-icon,
.card-link svg,
.card-link svg path,
.card-link svg rect,
.card-link svg circle{
  stroke: var(--green-dark) !important;
  fill: none !important;
}

/* Caso existam ícones que dependam de currentColor */
.card-link svg{ color: var(--green-dark) }

/* Pequeno ajuste: manter o hover com o mesmo tom verde, sem mudança abrupta */
.card-link:hover svg path,
.card-link:hover svg rect,
.card-link:hover svg circle{
  stroke: var(--green-light) !important;
}

.collab-form{margin-top:14px}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(220px,1fr));gap:14px}
.form-grid label{display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--green-dark);font-weight:600}
.form-grid input,
.form-grid select,
.form-grid textarea{
  padding:10px 12px;
  border-radius:8px;
  border:1px solid var(--border-soft);
  background:#fff;
  color:var(--text-main);
  font:inherit;
}
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus{
  outline:none;
  box-shadow:0 0 0 4px var(--focus-ring);
  border-color:var(--green-light);
}
.form-actions{margin-top:18px;display:flex;gap:10px;align-items:center}

.pagination-info{margin-left:auto}

.pagination{
  margin-top:14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.pagination-pages{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.pagination-page{
  min-width:38px;
  text-align:center;
}

.filter-btn.disabled{
  pointer-events:none;
  opacity:.55;
}

@media (max-width:760px){
  .form-grid{grid-template-columns:1fr}
  .pagination{justify-content:center}
  .pagination-info{width:100%;text-align:center;margin-left:0}
}

