/* FILE: public/assets/css/app.css
   Fundacao visual do FLOW AHB: reset minimo + tokens de design. Modulos
   futuros (Meu Dia, Planner, Kanban...) adicionam suas proprias regras em
   novos arquivos dentro de public/assets/css/, importados aqui. */

:root {
  --ahb-bg: #f5f6f8;
  --ahb-surface: #ffffff;
  --ahb-border: #e2e5ea;
  --ahb-text: #1c2128;
  --ahb-text-muted: #5b6472;
  --ahb-primary: #00558c;         /* azul institucional Adventist Health */
  --ahb-primary-hover: #01426e;
  --ahb-accent: #0de3ff;          /* ciano da marca (destaques) */
  --ahb-primary-soft: rgba(0, 85, 140, 0.10);
  --ahb-primary-ring: rgba(0, 85, 140, 0.18);
  --ahb-danger: #b3261e;
  --ahb-danger-bg: #fdecea;
  --ahb-warn: #b26a00;            /* ambar - "falta detalhe" */
  --ahb-warn-bg: #fff4e0;
  --ahb-success: #1f8f4e;
  --ahb-radius: 10px;
  --ahb-shadow: 0 1px 2px rgba(16, 24, 32, 0.06), 0 8px 24px rgba(16, 24, 32, 0.06);
  --ahb-font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--ahb-font);
  background: var(--ahb-bg);
  color: var(--ahb-text);
  -webkit-font-smoothing: antialiased;
}

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

.ahb-center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ahb-card {
  background: var(--ahb-surface);
  border: 1px solid var(--ahb-border);
  border-radius: var(--ahb-radius);
  box-shadow: var(--ahb-shadow);
  padding: 32px;
  width: 100%;
  max-width: 380px;
}

.ahb-brand {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--ahb-text);
}

.ahb-subtitle {
  font-size: 13px;
  color: var(--ahb-text-muted);
  margin: 0 0 24px;
}

.ahb-field { margin-bottom: 16px; }

.ahb-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ahb-text);
}

.ahb-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--ahb-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ahb-text);
}

.ahb-input:focus {
  outline: none;
  border-color: var(--ahb-primary);
  box-shadow: 0 0 0 3px var(--ahb-primary-ring);
}

.ahb-button {
  width: 100%;
  padding: 11px 12px;
  border: none;
  border-radius: 8px;
  background: var(--ahb-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.ahb-button:hover { background: var(--ahb-primary-hover); }

.ahb-alert-error {
  background: var(--ahb-danger-bg);
  color: var(--ahb-danger);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}

.ahb-alert-success {
  background: #e8f6ee;
  color: var(--ahb-success);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}

.ahb-footer-note {
  margin-top: 20px;
  font-size: 12px;
  color: var(--ahb-text-muted);
  text-align: center;
}

/* ============================================================
   Layout da area autenticada (Modulos 3-7). Adicionado sobre a
   fundacao visual do Modulo 2 - mesmos tokens de :root.
   ============================================================ */

.ahb-app {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.ahb-sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--ahb-surface);
  border-right: 1px solid var(--ahb-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.ahb-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 16px;
}
.ahb-brand-mark { height: 30px; width: auto; display: block; flex-shrink: 0; }
.ahb-brand-text { font-size: 18px; font-weight: 800; letter-spacing: 0.3px; color: var(--ahb-text); }
.ahb-brand-text span { color: var(--ahb-primary); }

.ahb-nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px;
}

.ahb-nav-group {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ahb-text-muted);
  margin: 16px 8px 6px;
}

.ahb-nav-link {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ahb-text);
  margin-bottom: 2px;
}
.ahb-nav-link:hover { background: var(--ahb-bg); }
.ahb-nav-link.is-active {
  background: var(--ahb-primary-soft);
  color: var(--ahb-primary);
  font-weight: 600;
}

.ahb-sidebar-user {
  border-top: 1px solid var(--ahb-border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ahb-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--ahb-primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ahb-sidebar-user-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ahb-sidebar-user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ahb-sidebar-user-email { font-size: 11px; color: var(--ahb-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ahb-logout-form { margin: 0; }
.ahb-logout-btn {
  background: none; border: 1px solid var(--ahb-border);
  color: var(--ahb-text-muted); border-radius: 7px;
  padding: 5px 10px; font-size: 12px; cursor: pointer;
}
.ahb-logout-btn:hover { border-color: var(--ahb-danger); color: var(--ahb-danger); }

/* --- Main --- */
.ahb-main {
  flex: 1;
  padding: 28px 32px;
  max-width: 1180px;
  width: 100%;
}

.ahb-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.ahb-page-title { font-size: 22px; font-weight: 700; margin: 0; }
.ahb-page-subtitle { font-size: 13px; color: var(--ahb-text-muted); margin: 4px 0 0; }

/* --- Flash --- */
.ahb-flash {
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 13px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.ahb-flash-success { background: #e9f5ef; color: #17473b; border-color: #c7e6da; }
.ahb-flash-error { background: var(--ahb-danger-bg); color: var(--ahb-danger); border-color: #f3c9c6; }

/* --- Botoes --- */
.ahb-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 15px;
  border-radius: 8px;
  border: 1px solid var(--ahb-primary);
  background: var(--ahb-primary);
  color: #fff;
  font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  font-family: inherit;
}
.ahb-btn:hover { background: var(--ahb-primary-hover); border-color: var(--ahb-primary-hover); color: #fff; }
.ahb-btn-secondary {
  background: var(--ahb-surface); color: var(--ahb-text); border-color: var(--ahb-border);
}
.ahb-btn-secondary:hover { background: var(--ahb-bg); color: var(--ahb-text); }
.ahb-btn-danger { background: var(--ahb-surface); color: var(--ahb-danger); border-color: #f0cbc8; }
.ahb-btn-danger:hover { background: var(--ahb-danger-bg); color: var(--ahb-danger); }
.ahb-btn-sm { padding: 5px 10px; font-size: 12px; }

/* --- Cards / surfaces --- */
.ahb-panel {
  background: var(--ahb-surface);
  border: 1px solid var(--ahb-border);
  border-radius: var(--ahb-radius);
  box-shadow: var(--ahb-shadow);
}
.ahb-panel-pad { padding: 20px 22px; }

/* --- Tabelas --- */
.ahb-table-wrap { overflow-x: auto; }
.ahb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ahb-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ahb-text-muted);
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ahb-border);
  background: var(--ahb-bg);
  white-space: nowrap;
}
.ahb-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--ahb-border);
  vertical-align: middle;
}
.ahb-table tr:last-child td { border-bottom: none; }
.ahb-table tbody tr:hover { background: var(--ahb-bg); }
.ahb-table-actions { display: flex; gap: 6px; justify-content: flex-end; }
.ahb-muted { color: var(--ahb-text-muted); }
.ahb-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ahb-text-muted);
  font-size: 14px;
}

/* --- Badges --- */
.ahb-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.ahb-badge-green { background: #e2f2ea; color: #1f5c4d; }
.ahb-badge-gray  { background: #eceef1; color: #5b6472; }
.ahb-badge-amber { background: #fdf0d9; color: #92600a; }
.ahb-badge-red   { background: var(--ahb-danger-bg); color: var(--ahb-danger); }
.ahb-badge-blue  { background: #e4edf7; color: #2a5486; }

/* --- Formularios --- */
.ahb-form { max-width: 720px; }
.ahb-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ahb-form-grid .ahb-col-full { grid-column: 1 / -1; }
.ahb-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--ahb-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ahb-text);
  resize: vertical;
  min-height: 80px;
}
.ahb-textarea:focus, .ahb-select:focus {
  outline: none; border-color: var(--ahb-primary);
  box-shadow: 0 0 0 3px var(--ahb-primary-ring);
}
.ahb-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--ahb-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ahb-text);
  background: var(--ahb-surface);
}
.ahb-hint { font-size: 12px; color: var(--ahb-text-muted); margin-top: 4px; }
.ahb-form-actions {
  display: flex; gap: 10px; margin-top: 22px;
  padding-top: 18px; border-top: 1px solid var(--ahb-border);
}
.ahb-checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.ahb-check { display: flex; align-items: center; gap: 7px; font-size: 13px; }

/* --- Stat tiles (Meu Dia / painel) --- */
.ahb-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.ahb-stat {
  background: var(--ahb-surface);
  border: 1px solid var(--ahb-border);
  border-radius: var(--ahb-radius);
  padding: 16px 18px;
}
.ahb-stat-value { font-size: 26px; font-weight: 700; line-height: 1; }
.ahb-stat-label { font-size: 12px; color: var(--ahb-text-muted); margin-top: 6px; }

/* --- Kanban --- */
.ahb-kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
.ahb-kanban-col {
  background: var(--ahb-bg);
  border: 1px solid var(--ahb-border);
  border-radius: var(--ahb-radius);
  padding: 12px;
}
.ahb-kanban-col-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--ahb-text-muted); margin-bottom: 10px; padding: 0 4px;
}
.ahb-task-card {
  background: var(--ahb-surface);
  border: 1px solid var(--ahb-border);
  border-radius: 8px;
  padding: 11px 12px;
  margin-bottom: 9px;
  box-shadow: 0 1px 2px rgba(16,24,32,0.04);
}
.ahb-task-card:last-child { margin-bottom: 0; }
.ahb-task-title { font-size: 13px; font-weight: 600; margin: 0 0 6px; }
.ahb-task-title.done { text-decoration: line-through; color: var(--ahb-text-muted); }
.ahb-task-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.ahb-task-attr { font-size: 11px; color: var(--ahb-text-muted); margin: 0 0 8px; }
.ahb-task-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.ahb-inline-form { display: inline; margin: 0; }

/* --- PEC read view --- */
.ahb-pec-mission {
  font-size: 15px; line-height: 1.55; color: var(--ahb-text);
  background: var(--ahb-primary-soft);
  border-left: 3px solid var(--ahb-primary);
  padding: 14px 16px; border-radius: 0 8px 8px 0; margin: 0 0 20px;
}
.ahb-attr-item {
  padding: 14px 0; border-bottom: 1px solid var(--ahb-border);
}
.ahb-attr-item:last-child { border-bottom: none; }
.ahb-attr-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ahb-attr-title { font-weight: 600; font-size: 14px; }
.ahb-attr-desc { font-size: 13px; color: var(--ahb-text-muted); margin: 5px 0 0; }

/* --- Repeater de atribuicoes (form PEC) --- */
.ahb-attr-row {
  display: grid; grid-template-columns: 1fr 1.4fr 90px auto; gap: 10px;
  align-items: start; margin-bottom: 10px;
}
.ahb-attr-row .ahb-remove {
  background: none; border: 1px solid var(--ahb-border); color: var(--ahb-text-muted);
  border-radius: 7px; cursor: pointer; padding: 9px 11px; font-size: 13px; height: 40px;
}
.ahb-attr-row .ahb-remove:hover { border-color: var(--ahb-danger); color: var(--ahb-danger); }

.ahb-link { color: var(--ahb-primary); font-weight: 600; font-size: 13px; }

@media (max-width: 900px) {
  .ahb-stats, .ahb-kanban { grid-template-columns: repeat(2, 1fr); }
  .ahb-form-grid { grid-template-columns: 1fr; }
  .ahb-sidebar { width: 200px; }
}

/* ============================================================
   PEC como "Descricao de Cargos" (Modulo 6, expansao) - layout
   de documento: seccoes, tabela chave-valor, grade de competencias.
   ============================================================ */
.ahb-doc-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding-bottom: 14px; margin-bottom: 8px; border-bottom: 2px solid var(--ahb-primary);
}
.ahb-doc-title { font-size: 18px; font-weight: 700; margin: 0; }
.ahb-doc-sub { font-size: 13px; color: var(--ahb-text-muted); margin: 4px 0 0; }
.ahb-doc-section {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--ahb-primary); margin: 22px 0 10px;
}
.ahb-doc-grouplabel {
  font-size: 12px; font-weight: 700; color: var(--ahb-text);
  background: var(--ahb-bg); padding: 6px 10px; border-radius: 6px; margin: 12px 0 6px;
}
.ahb-doc-list { margin: 0 0 4px; padding-left: 20px; }
.ahb-doc-list li { font-size: 13px; margin-bottom: 5px; line-height: 1.45; }

.ahb-kv { width: 100%; border-collapse: collapse; font-size: 13px; }
.ahb-kv th {
  text-align: left; width: 220px; vertical-align: top;
  color: var(--ahb-text-muted); font-weight: 600; padding: 8px 12px 8px 0;
}
.ahb-kv td { padding: 8px 0; vertical-align: top; }
.ahb-kv tr { border-bottom: 1px solid var(--ahb-border); }
.ahb-kv tr:last-child { border-bottom: none; }

.ahb-comp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 18px; }
.ahb-comp-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 13px; padding: 7px 0; border-bottom: 1px solid var(--ahb-border);
}

/* Repeaters do formulario de PEC completo */
.ahb-rep-row {
  display: grid; gap: 8px; align-items: start; margin-bottom: 8px;
}
.ahb-rep-row .ahb-remove {
  background: none; border: 1px solid var(--ahb-border); color: var(--ahb-text-muted);
  border-radius: 7px; cursor: pointer; padding: 9px 11px; font-size: 13px; height: 40px;
}
.ahb-rep-row .ahb-remove:hover { border-color: var(--ahb-danger); color: var(--ahb-danger); }
.ahb-rep-attr { grid-template-columns: 130px 1fr 1.2fr auto; }
.ahb-rep-comp { grid-template-columns: 1fr 110px auto; }
.ahb-rep-auth { grid-template-columns: 1.4fr 130px 1fr auto; }
.ahb-rep-kpi  { grid-template-columns: repeat(6, 1fr) 1.4fr auto; gap: 6px; }
.ahb-rep-com  { grid-template-columns: 160px 1fr auto; }
.ahb-rep-int  { grid-template-columns: 130px 1fr auto; }
.ahb-fieldset {
  border: 1px solid var(--ahb-border); border-radius: var(--ahb-radius);
  padding: 16px 18px; margin-bottom: 18px;
}
.ahb-fieldset > legend {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--ahb-primary); padding: 0 8px;
}
@media (max-width: 900px) {
  .ahb-comp-grid { grid-template-columns: 1fr; }
  .ahb-kv th { width: 140px; }
}

/* ============================================================
   Ciclo semanal, progresso e relatorios (Modulo 9/10)
   ============================================================ */
.ahb-progress {
  height: 6px; background: var(--ahb-border); border-radius: 999px;
  overflow: hidden; margin: 6px 0;
}
.ahb-progress-bar { height: 100%; background: var(--ahb-primary); border-radius: 999px; }

.ahb-check-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--ahb-border); font-size: 14px;
}
.ahb-check-row:last-of-type { border-bottom: none; }
.ahb-check-toggle {
  background: none; border: none; cursor: pointer; font-size: 18px;
  color: var(--ahb-primary); padding: 0; line-height: 1;
}
.ahb-check-done { text-decoration: line-through; color: var(--ahb-text-muted); }

.ahb-report-periods { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.ahb-chip {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--ahb-border); background: var(--ahb-surface);
  font-size: 13px; font-weight: 600; color: var(--ahb-text);
}
.ahb-chip:hover { background: var(--ahb-bg); }
.ahb-chip.is-active { background: var(--ahb-primary); color: #fff; border-color: var(--ahb-primary); }

.ahb-bars {
  display: flex; align-items: flex-end; gap: 12px; height: 160px;
  padding: 16px 4px 0; overflow-x: auto;
}
.ahb-bar-col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 54px; }
.ahb-bar {
  width: 34px; background: var(--ahb-border); border-radius: 6px 6px 0 0;
  display: flex; align-items: flex-end; overflow: hidden; margin-top: auto;
}
.ahb-bar-fill { width: 100%; background: var(--ahb-primary); }
.ahb-bar-label { font-size: 10px; color: var(--ahb-text-muted); white-space: nowrap; }
.ahb-bar-num { font-size: 11px; font-weight: 600; }

.ahb-attr-progress { padding: 10px 0; border-bottom: 1px solid var(--ahb-border); }
.ahb-attr-progress:last-child { border-bottom: none; }
.ahb-attr-progress-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 2px; }
.ahb-attr-progress-head .ahb-muted { font-size: 12px; white-space: nowrap; }

/* ============================================================
   Capa de entrada (login) - identidade Adventist Health
   ============================================================ */
.ahb-login { margin: 0; }
.ahb-login-split { display: flex; min-height: 100vh; }

.ahb-login-brandpanel {
  flex: 1.1;
  background: linear-gradient(150deg, #00558c 0%, #013f6b 55%, #012c4d 100%);
  color: #fff;
  padding: 48px 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.ahb-login-brandpanel::after {
  content: ""; position: absolute; right: -120px; bottom: -120px;
  width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(13,227,255,0.30), transparent 70%);
}
.ahb-login-brandpanel-inner { position: relative; z-index: 1; margin-top: 8vh; max-width: 460px; }
.ahb-login-wordmark { font-size: 26px; font-weight: 800; letter-spacing: 0.5px; margin-bottom: 40px; }
.ahb-login-wordmark span { color: var(--ahb-accent); }
.ahb-login-headline { font-size: 34px; line-height: 1.15; font-weight: 800; margin: 0 0 16px; }
.ahb-login-tagline { font-size: 15px; line-height: 1.6; color: rgba(255,255,255,0.82); margin: 0; }
.ahb-login-brandpanel-foot { position: relative; z-index: 1; font-size: 12px; color: rgba(255,255,255,0.65); }

.ahb-login-formpanel {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 32px; background: var(--ahb-bg);
}
.ahb-login-card {
  background: var(--ahb-surface); border: 1px solid var(--ahb-border);
  border-radius: 14px; box-shadow: var(--ahb-shadow);
  padding: 36px 34px; width: 100%; max-width: 400px;
  border-top: 4px solid var(--ahb-accent);
}
.ahb-login-logo { height: 42px; width: auto; display: block; margin-bottom: 22px; }
.ahb-login-welcome { font-size: 20px; font-weight: 700; margin: 0 0 4px; color: var(--ahb-text); }
.ahb-login-sub { font-size: 14px; color: var(--ahb-text-muted); margin: 0 0 22px; }

@media (max-width: 860px) {
  .ahb-login-split { flex-direction: column; }
  .ahb-login-brandpanel { padding: 32px 28px; flex: none; }
  .ahb-login-brandpanel-inner { margin-top: 0; }
  .ahb-login-headline { font-size: 26px; }
  .ahb-login-brandpanel-foot { display: none; }
}

/* ============================================================
   Minhas Tarefas - Kanban rico (upgrade Fase 2-5/11)
   ============================================================ */
.ahb-tasks-toolbar { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:16px; }
.ahb-week-nav { display:flex; align-items:center; gap:8px; margin-top:6px; }
.ahb-week-arrow { display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; border:1px solid var(--ahb-border); border-radius:7px; color:var(--ahb-text); font-size:16px; }
.ahb-week-arrow:hover { background:var(--ahb-bg); }
.ahb-week-label { font-size:13px; color:var(--ahb-text-muted); }
.ahb-tasks-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.ahb-search { width:220px; padding:8px 12px; }
.ahb-viewswitch { display:inline-flex; border:1px solid var(--ahb-border); border-radius:8px; overflow:hidden; }
.ahb-viewswitch a { padding:8px 14px; font-size:13px; font-weight:600; color:var(--ahb-text-muted); border-right:1px solid var(--ahb-border); }
.ahb-viewswitch a:last-child { border-right:none; }
.ahb-viewswitch a.is-active { background:var(--ahb-primary); color:#fff; }

.ahb-count-row { display:grid; grid-template-columns:repeat(5,1fr); gap:12px; margin-bottom:16px; }
.ahb-count-chip { background:var(--ahb-surface); border:1px solid var(--ahb-border); border-radius:var(--ahb-radius); padding:12px 14px; border-left:3px solid var(--ahb-border); }
.ahb-count-num { font-size:22px; font-weight:800; display:block; line-height:1; }
.ahb-count-label { font-size:11px; text-transform:uppercase; letter-spacing:0.5px; color:var(--ahb-text-muted); font-weight:700; }
.ahb-count-todo { border-left-color:#9aa4b2; }
.ahb-count-doing { border-left-color:var(--ahb-primary); }
.ahb-count-waiting { border-left-color:#c98a12; }
.ahb-count-blocked { border-left-color:var(--ahb-danger); }
.ahb-count-done { border-left-color:#1f9d5b; }

.ahb-fechamento { display:flex; align-items:center; justify-content:space-between; gap:14px; background:var(--ahb-surface); border:1px solid var(--ahb-border); border-radius:var(--ahb-radius); padding:12px 16px; margin-bottom:18px; }
.ahb-fechamento.is-highlight { border-color:var(--ahb-accent); background:linear-gradient(90deg, rgba(13,227,255,0.08), transparent); border-left:4px solid var(--ahb-accent); }

/* Kanban 5 colunas */
.ahb-kanban5 { display:grid; grid-template-columns:repeat(5,minmax(220px,1fr)); gap:14px; align-items:start; }
.ahb-kcol { background:var(--ahb-bg); border:1px solid var(--ahb-border); border-radius:var(--ahb-radius); padding:10px; min-height:120px; }
.ahb-kcol-head { display:flex; align-items:center; justify-content:space-between; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:0.5px; color:var(--ahb-text-muted); padding:2px 4px 10px; }
.ahb-kcol-count { background:var(--ahb-surface); border:1px solid var(--ahb-border); border-radius:999px; padding:1px 8px; font-size:11px; color:var(--ahb-text); }
.ahb-kcol-body { min-height:24px; }

.ahb-tcard { background:var(--ahb-surface); border:1px solid var(--ahb-border); border-radius:9px; padding:11px 12px; margin-bottom:9px; box-shadow:0 1px 2px rgba(16,24,32,0.04); cursor:pointer; transition:box-shadow .12s, transform .12s; }
.ahb-tcard:hover { box-shadow:0 3px 10px rgba(16,24,32,0.10); }
.ahb-tcard:focus { outline:none; box-shadow:0 0 0 3px var(--ahb-primary-ring); }
.ahb-tcard-ghost { opacity:.4; }
.ahb-tcard-context { font-size:11px; color:var(--ahb-text-muted); font-weight:600; margin:0 0 4px; text-transform:uppercase; letter-spacing:0.3px; }
.ahb-tcard-title { font-size:13.5px; font-weight:600; margin:0 0 8px; line-height:1.3; color:var(--ahb-text); }
.ahb-tcard-meta { display:flex; align-items:center; gap:8px; margin-bottom:8px; flex-wrap:wrap; }
.ahb-tcard-date { font-size:11px; color:var(--ahb-text-muted); }
.ahb-prio { font-size:11px; font-weight:700; padding:2px 8px; border-radius:999px; display:inline-flex; align-items:center; gap:4px; }
.ahb-prio::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
.ahb-prio-low { background:#eceef1; color:#5b6472; }
.ahb-prio-normal { background:#e4edf7; color:#2a5486; }
.ahb-prio-high { background:#fdf0d9; color:#92600a; }
.ahb-prio-urgent { background:var(--ahb-danger-bg); color:var(--ahb-danger); }
.ahb-tcard-flags { display:flex; flex-wrap:wrap; gap:6px; margin:2px 0 8px; }
.ahb-flag { font-size:11px; font-weight:600; padding:2px 8px; border-radius:6px; }
.ahb-flag-support { background:#fdf0d9; color:#92600a; }
.ahb-flag-blocked { background:var(--ahb-danger-bg); color:var(--ahb-danger); }
.ahb-tcard-foot { display:flex; flex-wrap:wrap; gap:10px; font-size:11px; color:var(--ahb-text-muted); }
.ahb-tcard-parts { font-weight:600; }

.ahb-quickadd { padding:4px; }
.ahb-quickadd-btn { width:100%; text-align:left; background:none; border:none; color:var(--ahb-text-muted); font-size:12.5px; font-weight:600; padding:8px 6px; border-radius:7px; cursor:pointer; }
.ahb-quickadd-btn:hover { background:var(--ahb-surface); color:var(--ahb-primary); }
.ahb-quickadd-input { width:100%; padding:8px 10px; font-size:13px; }

.ahb-list-row { cursor:pointer; }

/* Toast */
.ahb-toast { position:fixed; bottom:22px; left:50%; transform:translateX(-50%); background:var(--ahb-text); color:#fff; padding:11px 18px; border-radius:9px; font-size:13px; font-weight:600; box-shadow:0 8px 24px rgba(16,24,32,0.24); z-index:1000; }
.ahb-toast-error { background:var(--ahb-danger); }

/* Accordions da nova tarefa */
.ahb-form-legend { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:0.5px; color:var(--ahb-primary); margin:0 0 14px; }
.ahb-acc { background:var(--ahb-surface); border:1px solid var(--ahb-border); border-radius:var(--ahb-radius); margin-top:12px; overflow:hidden; }
.ahb-acc > summary { cursor:pointer; padding:14px 18px; font-weight:600; font-size:14px; list-style:none; display:flex; align-items:center; justify-content:space-between; }
.ahb-acc > summary::-webkit-details-marker { display:none; }
.ahb-acc > summary::after { content:"⌄"; color:var(--ahb-text-muted); font-size:16px; }
.ahb-acc[open] > summary { border-bottom:1px solid var(--ahb-border); }
.ahb-acc-body { padding:18px; }

@media (max-width: 1100px) {
  .ahb-kanban5 { display:flex; overflow-x:auto; }
  .ahb-kcol { min-width:240px; flex:0 0 auto; }
  .ahb-count-row { grid-template-columns:repeat(5,minmax(90px,1fr)); overflow-x:auto; }
}
@media (max-width: 720px) {
  .ahb-search { width:100%; }
  .ahb-count-row { grid-template-columns:repeat(2,1fr); }
}

/* ============================================================
   Drawer da tarefa + Linha de Contribuicao (Fases 6-10)
   ============================================================ */
.ahb-noscroll { overflow: hidden; }
.ahb-drawer-overlay { position: fixed; inset: 0; background: rgba(16,24,32,0.32); z-index: 900; }
.ahb-drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 560px; max-width: 94vw; background: var(--ahb-surface); box-shadow: -8px 0 32px rgba(16,24,32,0.18); z-index: 901; overflow-y: auto; }
.ahb-drawer-loading, .ahb-drawer-empty { padding: 40px; color: var(--ahb-text-muted); }

.ahb-dw { padding: 20px 22px 40px; }
.ahb-dw-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ahb-dw-ctx { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ahb-text-muted); font-weight: 700; }
.ahb-dw-title { font-size: 19px; font-weight: 700; margin: 4px 0 0; line-height: 1.25; }
.ahb-dw-headactions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ahb-dw-close { background: none; border: none; font-size: 18px; color: var(--ahb-text-muted); cursor: pointer; padding: 4px 8px; }
.ahb-dw-close:hover { color: var(--ahb-text); }

.ahb-los { background: var(--ahb-primary-soft); border-radius: 10px; padding: 12px 14px; margin: 16px 0; }
.ahb-los-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; color: var(--ahb-primary); margin-bottom: 8px; }
.ahb-los-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ahb-los-node { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--ahb-surface); border: 1px solid var(--ahb-border); }
.ahb-los-atividade { background: var(--ahb-primary); color: #fff; border-color: var(--ahb-primary); }
.ahb-los-estrategia { background: #012c4d; color: #fff; border-color: #012c4d; }
.ahb-los-arrow { color: var(--ahb-text-muted); font-size: 12px; }
.ahb-los-person { font-size: 12px; color: var(--ahb-text-muted); margin-top: 8px; }
.ahb-los-empty { font-size: 13px; color: var(--ahb-text-muted); margin: 0; }

.ahb-dw-metagrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin: 4px 0 16px; }
.ahb-dw-metagrid > div:first-child { grid-column: 1 / -1; }
.ahb-dw-metalabel { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ahb-text-muted); font-weight: 700; margin-bottom: 4px; }
.ahb-dw-parts { display: flex; gap: 4px; }
.ahb-avatar-xs { width: 24px; height: 24px; border-radius: 50%; background: var(--ahb-primary); color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

.ahb-dw-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--ahb-border); overflow-x: auto; margin-bottom: 14px; }
.ahb-dw-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 9px 12px; font-size: 13px; font-weight: 600; color: var(--ahb-text-muted); cursor: pointer; white-space: nowrap; }
.ahb-dw-tab.is-active { color: var(--ahb-primary); border-bottom-color: var(--ahb-primary); }
.ahb-dw-panel { display: none; }
.ahb-dw-panel.is-active { display: block; }
.ahb-dw-desc { font-size: 14px; line-height: 1.55; margin: 0 0 14px; }

.ahb-dw-check { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--ahb-border); font-size: 14px; }
.ahb-dw-checkgroup { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ahb-text-muted); margin: 14px 0 4px; }
.ahb-dw-addrow { display: flex; gap: 8px; margin-top: 12px; }
.ahb-dw-addrow .ahb-input, .ahb-dw-addrow .ahb-select { flex: 1; }
.ahb-dw-file, .ahb-dw-support, .ahb-dw-event { padding: 9px 0; border-bottom: 1px solid var(--ahb-border); font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ahb-dw-support { flex-direction: column; align-items: stretch; }
.ahb-dw-event { align-items: baseline; gap: 12px; }
.ahb-dw-upload { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.ahb-dw-comment { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--ahb-border); }
.ahb-dw-comment-body { font-size: 14px; margin-top: 2px; }

@media (max-width: 640px) {
  .ahb-drawer { width: 100vw; max-width: 100vw; }
  .ahb-dw-metagrid { grid-template-columns: 1fr; }
}

/* ============================================================
   Minha Semana - visao por dia (Fase 12)
   ============================================================ */
.ahb-weekgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: start; }
.ahb-weekday { background: var(--ahb-bg); border: 1px solid var(--ahb-border); border-radius: var(--ahb-radius); min-height: 160px; }
.ahb-weekday.is-today { border-color: var(--ahb-primary); box-shadow: 0 0 0 2px var(--ahb-primary-ring); }
.ahb-weekday-head { font-size: 12px; font-weight: 700; color: var(--ahb-text-muted); padding: 10px 12px; border-bottom: 1px solid var(--ahb-border); text-transform: uppercase; letter-spacing: 0.4px; }
.ahb-weekday.is-today .ahb-weekday-head { color: var(--ahb-primary); }
.ahb-weekday-body { padding: 8px; }
.ahb-daychip { background: var(--ahb-surface); border: 1px solid var(--ahb-border); border-left: 3px solid var(--ahb-primary); border-radius: 7px; padding: 8px 10px; margin-bottom: 8px; cursor: pointer; }
.ahb-daychip:hover { box-shadow: 0 2px 8px rgba(16,24,32,0.10); }
.ahb-daychip:focus { outline: none; box-shadow: 0 0 0 3px var(--ahb-primary-ring); }
.ahb-daychip.is-delivery { border-left-color: #1f9d5b; background: #f0f9f4; }
.ahb-daychip.is-done { opacity: 0.6; }
.ahb-daychip.is-done .ahb-daychip-title { text-decoration: line-through; }
.ahb-daychip-title { font-size: 12.5px; font-weight: 600; line-height: 1.25; margin-bottom: 5px; }
.ahb-daychip-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
@media (max-width: 900px) { .ahb-weekgrid { display: flex; overflow-x: auto; } .ahb-weekday { min-width: 200px; flex: 0 0 auto; } }

/* ============================================================
   Colaboração + Meu Dia significativo + Painel do líder (Fase 13)
   ============================================================ */
.ahb-nav-link { display: flex; align-items: center; justify-content: space-between; }
.ahb-nav-badge { background: var(--ahb-danger); color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 7px; min-width: 18px; text-align: center; }

/* Caixa de Entrada */
.ahb-inbox-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--ahb-border); color: var(--ahb-text); }
.ahb-inbox-item:last-child { border-bottom: none; }
.ahb-inbox-item:hover { background: var(--ahb-bg); }
.ahb-inbox-item.is-unread { background: var(--ahb-primary-soft); }
.ahb-inbox-item.is-unread:hover { background: rgba(0,85,140,0.14); }
.ahb-inbox-type { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; padding: 3px 8px; border-radius: 6px; background: var(--ahb-bg); color: var(--ahb-text-muted); white-space: nowrap; flex-shrink: 0; }
.ahb-inbox-support, .ahb-inbox-support_reply { background: #fdf0d9; color: #92600a; }
.ahb-inbox-delegation { background: #e4edf7; color: #2a5486; }
.ahb-inbox-main { flex: 1; min-width: 0; }
.ahb-inbox-title { font-size: 14px; font-weight: 600; }
.ahb-inbox-body { font-size: 13px; color: var(--ahb-text-muted); margin-top: 2px; }

/* Meu Dia - prioridades */
.ahb-priority { display: flex; gap: 14px; align-items: flex-start; background: var(--ahb-surface); border: 1px solid var(--ahb-border); border-left: 4px solid var(--ahb-primary); border-radius: var(--ahb-radius); padding: 16px 18px; margin-bottom: 10px; cursor: pointer; }
.ahb-priority:hover { box-shadow: var(--ahb-shadow); }
.ahb-priority:focus { outline: none; box-shadow: 0 0 0 3px var(--ahb-primary-ring); }
.ahb-priority-num { width: 28px; height: 28px; border-radius: 50%; background: var(--ahb-primary); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ahb-priority-main { flex: 1; min-width: 0; }
.ahb-priority-title { font-size: 15px; font-weight: 700; }
.ahb-priority-los { font-size: 12px; color: var(--ahb-primary); margin-top: 3px; }
.ahb-priority-next { font-size: 13px; color: var(--ahb-text-muted); margin-top: 4px; }
.ahb-priority-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }

/* Painel do líder */
.ahb-teamgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ahb-teamcard { background: var(--ahb-surface); border: 1px solid var(--ahb-border); border-radius: var(--ahb-radius); padding: 16px 18px; border-top: 3px solid var(--ahb-border); text-decoration: none; color: inherit; display: block; }
a.ahb-teamcard:hover { box-shadow: var(--ahb-shadow); }
.ahb-teamcard-num { font-size: 26px; font-weight: 800; line-height: 1; }
.ahb-teamcard-label { font-size: 12px; color: var(--ahb-text-muted); margin-top: 6px; font-weight: 600; }
.ahb-teamcard-attn { border-top-color: var(--ahb-primary); }
.ahb-teamcard-warn { border-top-color: #c98a12; }
.ahb-teamcard-danger { border-top-color: var(--ahb-danger); }
.ahb-teamcard-ok { border-top-color: #1f9d5b; }

@media (max-width: 900px) { .ahb-teamgrid { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================
   Organograma / Times
   ============================================================ */
.ahb-orgnode { border-left: 2px solid var(--ahb-border); padding-left: 12px; margin-bottom: 10px; }
.ahb-orgnode-head { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.ahb-orgnode-name { font-weight: 700; font-size: 14px; }
.ahb-orgnode-people { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 8px; }
.ahb-orgperson { display: inline-flex; align-items: center; gap: 6px; background: var(--ahb-bg); border: 1px solid var(--ahb-border); border-radius: 999px; padding: 3px 10px 3px 3px; font-size: 12px; }

/* ============================================================
   Captura rapida (bulk) + marcador "falta detalhe" (!)
   ============================================================ */
.ahb-capture { background: var(--ahb-surface); border: 1px solid var(--ahb-border); border-radius: var(--ahb-radius); box-shadow: var(--ahb-shadow); margin-bottom: 14px; overflow: hidden; }
.ahb-capture-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; cursor: pointer; font-weight: 700; list-style: none; }
.ahb-capture-summary::-webkit-details-marker { display: none; }
.ahb-capture-summary::before { content: "▸"; color: var(--ahb-text-muted); margin-right: 4px; transition: transform .15s; }
.ahb-capture[open] .ahb-capture-summary::before { transform: rotate(90deg); }
.ahb-capture-summary:hover { background: var(--ahb-bg); }
.ahb-capture-form { padding: 0 16px 16px; }
.ahb-capture-text { width: 100%; font-family: var(--ahb-font); resize: vertical; }
.ahb-capture-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 10px; }
.ahb-capture-field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.ahb-capture-field select { min-width: 180px; }
.ahb-capture-hint { font-size: 12px; color: var(--ahb-text-muted); margin: 10px 0 0; }

.ahb-needdetail {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--ahb-warn-bg); color: var(--ahb-warn);
  font-weight: 800; font-size: 12px; line-height: 1; vertical-align: middle;
}

/* ============================================================
   Foco visivel por teclado (acessibilidade)
   ============================================================ */
a:focus-visible, button:focus-visible, summary:focus-visible,
.ahb-btn:focus-visible, .ahb-nav-link:focus-visible, .ahb-chip:focus-visible,
.ahb-viewswitch a:focus-visible, .ahb-dw-tab:focus-visible, .ahb-tcard:focus-visible {
  outline: 2px solid var(--ahb-primary);
  outline-offset: 2px;
}

/* ============================================================
   Impressao / PDF dos relatorios (window.print -> Salvar como PDF)
   ============================================================ */
.ahb-print-brand { display: none; }
@media print {
  .ahb-sidebar, .ahb-noprint, .ahb-week-arrow,
  .ahb-viewswitch, .ahb-report-periods a:not(.is-active) { display: none !important; }
  body.ahb-app { display: block !important; background: #fff !important; }
  .ahb-main { margin: 0 !important; padding: 0 !important; max-width: 100% !important; }
  .ahb-panel, .ahb-stat, .ahb-table-wrap { box-shadow: none !important; border: 1px solid #d0d4da !important; break-inside: avoid; }
  .ahb-stats, .ahb-count-row { break-inside: avoid; }
  .ahb-print-brand { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--ahb-primary); padding-bottom: 8px; margin-bottom: 14px; }
  .ahb-print-brand strong { color: var(--ahb-primary); font-size: 18px; }
  @page { margin: 1.4cm; }
}

/* ============================================================
   Barra de filtros (listas de gestao)
   ============================================================ */
.ahb-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.ahb-filterbar .ahb-input { height: 38px; }
.ahb-filterbar select.ahb-input { min-width: 190px; }
.ahb-filterbar input[type="search"] { min-width: 220px; flex: 1 1 220px; max-width: 340px; }

/* ============================================================
   Organograma - drag de pessoas + mover unidade
   ============================================================ */
.ahb-orgnode-tools { display: inline-flex; align-items: center; gap: 12px; margin-left: auto; }
.ahb-input-sm { height: 30px; padding: 2px 8px; font-size: 12px; }
.ahb-drag-handle { cursor: grab; color: var(--ahb-text-muted); font-size: 14px; user-select: none; }
.ahb-orgnode-people { min-height: 40px; border: 1px dashed transparent; border-radius: 8px; padding: 4px; transition: border-color .12s, background .12s; }
.ahb-orgnode:hover > .ahb-orgnode-people { border-color: var(--ahb-border); }
.ahb-orgperson { cursor: grab; }
.ahb-orgperson:active { cursor: grabbing; }
.ahb-drop-ghost { opacity: .45; outline: 2px dashed var(--ahb-primary); }
.ahb-orgnode-people.sortable-drag, .ahb-orgnode-people:has(.ahb-drop-ghost) { background: var(--ahb-primary-soft); border-color: var(--ahb-primary); }
