/* Organizaê — sistema visual
   Carregado por último. Usa os tokens das paletas (--p, --bg, --surface, --ink, --muted,
   --line, --accent-container, --on-accent, --primary-button, --on-primary) e acrescenta:
   superfícies em camadas, escala de texto, raios, sombras e cores por etapa.
   Espaçamento em base 8 (4 só para ajustes finos). */

:root{
  --font:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --r-sm:8px;--r-md:12px;--r-lg:16px;--r-xl:24px;--r-full:999px;
  --surface-2:color-mix(in srgb,var(--ink) 4%,var(--surface));
  --surface-3:color-mix(in srgb,var(--ink) 7%,var(--surface));
  --line-soft:color-mix(in srgb,var(--line) 60%,transparent);
  --shadow-1:0 1px 2px rgba(16,24,40,.05),0 1px 3px rgba(16,24,40,.06);
  --shadow-2:0 4px 8px -2px rgba(16,24,40,.08),0 2px 4px -2px rgba(16,24,40,.05);
  --shadow-3:0 12px 24px -4px rgba(16,24,40,.12),0 4px 8px -4px rgba(16,24,40,.06);
  --focus:0 0 0 3px color-mix(in srgb,var(--p) 35%,transparent);
  /* Etapas: cor da etiqueta (fundo / texto / ponto) */
  --st-backlog-bg:#EEF1F4;--st-backlog-fg:#475467;--st-backlog-dot:#98A2B3;
  --st-priorizado-bg:#EFEBFF;--st-priorizado-fg:#5236C9;--st-priorizado-dot:#7A5AF8;
  --st-andamento-bg:#E4EEFF;--st-andamento-fg:#1C58B8;--st-andamento-dot:#2E7CF6;
  --st-aguardando-bg:#FFF1D6;--st-aguardando-fg:#855500;--st-aguardando-dot:#F0A01F;
  --st-concluido-bg:#E3F5EA;--st-concluido-fg:#17724A;--st-concluido-dot:#2DB36F;
  --st-change-bg:#FFE8E1;--st-change-fg:#A8331A;--st-change-dot:#F0643F;
}
html[data-theme="dark"]{
  --surface-2:color-mix(in srgb,#fff 4%,var(--surface));
  --surface-3:color-mix(in srgb,#fff 8%,var(--surface));
  --shadow-1:none;--shadow-2:0 4px 12px rgba(0,0,0,.28);--shadow-3:0 16px 32px rgba(0,0,0,.4);
  --st-backlog-bg:color-mix(in srgb,#98A2B3 18%,var(--surface));--st-backlog-fg:#CBD2DC;
  --st-priorizado-bg:color-mix(in srgb,#7A5AF8 24%,var(--surface));--st-priorizado-fg:#CFC3FF;
  --st-andamento-bg:color-mix(in srgb,#2E7CF6 24%,var(--surface));--st-andamento-fg:#B0CDFF;
  --st-aguardando-bg:color-mix(in srgb,#F0A01F 22%,var(--surface));--st-aguardando-fg:#F8D48F;
  --st-concluido-bg:color-mix(in srgb,#2DB36F 22%,var(--surface));--st-concluido-fg:#A3E2BD;
  --st-change-bg:color-mix(in srgb,#F0643F 22%,var(--surface));--st-change-fg:#FFB9A6;
}

/* ---------- Base e texto ---------- */
html body{font-family:var(--font);font-size:15px;line-height:1.5;letter-spacing:-.006em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-feature-settings:"cv11","ss01";background:var(--bg)}
html body button,html body input,html body select,html body textarea{font-family:inherit;letter-spacing:inherit}
html body h1{font-size:28px;line-height:36px;font-weight:700;letter-spacing:-.022em}
html body h2{font-size:18px;line-height:28px;font-weight:650;letter-spacing:-.014em}
html body h3{font-size:16px;line-height:24px;font-weight:650;letter-spacing:-.01em}
html body .muted{color:var(--muted)}
html body strong,html body .stat strong{font-variant-numeric:tabular-nums}

/* ---------- Superfícies ---------- */
html body .card,html body .stat,html body .decision-card,html body .support-card{border:1px solid var(--line-soft);border-radius:var(--r-lg);background:var(--surface);box-shadow:var(--shadow-1)}
html[data-theme="dark"] body .card,html[data-theme="dark"] body .stat{border-color:var(--line-soft)!important}
html body section.card{padding:24px}

/* ---------- Botões (Material 3: pílula, 40px) ---------- */
html body button.primary,html body .primary{min-height:40px;padding:0 20px;border:0;border-radius:var(--r-full);background:var(--primary-button);color:var(--on-primary);font-size:14px;font-weight:600;letter-spacing:0;box-shadow:var(--shadow-1);transition:filter .15s,box-shadow .15s,transform .05s}
html body .primary:hover{filter:brightness(1.06);box-shadow:var(--shadow-2)}
html body .primary:active{transform:translateY(1px)}
html body button.outline,html body .outline{min-height:40px;padding:0 16px;border:1px solid var(--line);border-radius:var(--r-full);background:var(--surface);color:var(--ink);font-size:14px;font-weight:550;box-shadow:none;transition:background .15s,border-color .15s}
html[data-theme="dark"] body .outline{background:transparent!important;border-color:var(--line)!important;color:var(--ink)!important}
html body .outline:hover{background:var(--surface-2);border-color:color-mix(in srgb,var(--ink) 24%,var(--line))}
html body button:focus-visible,html body a:focus-visible,html body select:focus-visible,html body input:focus-visible,html body textarea:focus-visible{outline:none!important;box-shadow:var(--focus)!important}
/* Ação principal do item: botão tonal, mais leve que o primário */
html body .approval-first,html body .di-side>button,html body .kanban-actions button{background:var(--accent-container)!important;border-color:transparent!important;color:var(--on-accent)!important;font-weight:600}
html body .approval-first:hover,html body .di-side>button:hover,html body .kanban-actions button:hover{filter:brightness(.97)}

/* ---------- Campos ---------- */
html body input:not([type=checkbox]):not([type=radio]):not([type=file]),html body select,html body textarea{min-height:40px;border:1px solid var(--line);border-radius:var(--r-md);background-color:var(--surface);color:var(--ink);font-size:14px;transition:border-color .15s,box-shadow .15s}
html body input:hover,html body select:hover,html body textarea:hover{border-color:color-mix(in srgb,var(--ink) 30%,var(--line))}
html body input:focus,html body select:focus,html body textarea:focus{border-color:var(--p)!important}
html body label>span,html body .staff-filter>span,html body .staff-search>span{color:var(--muted);font-size:12px;font-weight:550;letter-spacing:.01em}

/* ---------- Menu lateral ---------- */
html body aside{background:var(--surface);border-color:var(--line-soft)}
html body aside .nav{min-height:40px;border-radius:var(--r-full);font-size:14px;font-weight:500;color:var(--ink);transition:background .15s}
html body aside .nav:hover{background:var(--surface-2)}
html body aside .nav.active{background:var(--accent-container);color:var(--on-accent);font-weight:650}
html body aside .navlabel{font-size:11px;font-weight:650;letter-spacing:.08em;color:var(--muted)}
html[data-theme="dark"] body .brand-logo{padding:4px 8px;border-radius:var(--r-sm)}

/* ---------- Topo da página ---------- */
html body header.top{border-color:var(--line-soft)}
html body #breadcrumb{font-size:13px;color:var(--muted)}
html body #view .welcome .eyebrow{display:none}
html body #view .welcome h1{margin:0 0 4px}
html body #view .welcome p{color:var(--muted);font-size:15px}

/* ---------- Números do Início ---------- */
html body #view .stats{gap:16px}
html body #view .stat{position:relative;padding:20px 24px;text-align:left;transition:box-shadow .15s,border-color .15s}
html body #view .stat>span:first-child{color:var(--muted);font-size:13px;font-weight:550}
html body #view .stat strong{display:block;margin:4px 0;font-size:32px;line-height:40px;font-weight:700;letter-spacing:-.02em;color:var(--ink)}
html body #view .stat small{color:var(--muted);font-size:13px}
html body #view .stat-link{cursor:pointer}
html body #view .stat-link:hover{border-color:color-mix(in srgb,var(--p) 40%,var(--line));box-shadow:var(--shadow-2)}
html body #view .stat-link strong{color:var(--st-aguardando-fg)}
html body #view .stat-more{color:var(--p);font-weight:600;font-size:13px}

/* ---------- Etiqueta de etapa (lista, Kanban) ---------- */
html body .demand-stage{display:inline-flex;align-items:center;gap:6px;min-height:24px;padding:0 10px 0 8px;border:0;border-radius:var(--r-full);background:var(--st-backlog-bg)!important;color:var(--st-backlog-fg)!important;font-size:12px;font-weight:600;line-height:16px;white-space:nowrap}
html body .demand-stage::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--st-backlog-dot)}
html body .demand-stage[data-stage="priorizado"]{background:var(--st-priorizado-bg)!important;color:var(--st-priorizado-fg)!important}
html body .demand-stage[data-stage="priorizado"]::before{background:var(--st-priorizado-dot)}
html body .demand-stage[data-stage="andamento"]{background:var(--st-andamento-bg)!important;color:var(--st-andamento-fg)!important}
html body .demand-stage[data-stage="andamento"]::before{background:var(--st-andamento-dot)}
html body .demand-stage[data-stage="aguardando"]{background:var(--st-aguardando-bg)!important;color:var(--st-aguardando-fg)!important}
html body .demand-stage[data-stage="aguardando"]::before{background:var(--st-aguardando-dot)}
html body .demand-stage[data-stage="concluido"]{background:var(--st-concluido-bg)!important;color:var(--st-concluido-fg)!important}
html body .demand-stage[data-stage="concluido"]::before{background:var(--st-concluido-dot)}
html body .demand-stage.is-change{background:var(--st-change-bg)!important;color:var(--st-change-fg)!important}
html body .demand-stage.is-change::before{background:var(--st-change-dot)}

/* Prazos */
html body .due-chip{border-radius:var(--r-full);padding:0 10px}
html body .due-chip.is-late{background:var(--st-change-bg)!important;color:var(--st-change-fg)!important}
html body .due-chip.is-today{background:var(--st-aguardando-bg)!important;color:var(--st-aguardando-fg)!important}
html body .due-chip.is-soon{background:var(--st-andamento-bg)!important;color:var(--st-andamento-fg)!important}
html body .di-mood,html body .staff-mood{background:var(--surface-3)!important;color:var(--ink)!important;border-radius:var(--r-full);font-weight:500}

/* ---------- Lista ---------- */
html body .demand-item{border-bottom-color:var(--line-soft);border-radius:0;transition:background .12s}
html body .demand-item:hover{background:var(--surface-2)}
html body .di-code,html body .kanban-card .demand-code{font-variant-numeric:tabular-nums;font-weight:600;color:var(--muted)}
html body .di-title{color:var(--ink)}

/* ---------- Kanban ---------- */
html body .kanban-column{border:0!important;border-radius:var(--r-lg);background:var(--surface-2)!important;box-shadow:none}
html body .kanban-column header{display:flex;align-items:center;gap:8px}
html body .kanban-column header h2{display:flex;align-items:center;gap:8px;font-size:14px;line-height:20px;font-weight:650}
html body .kanban-column header h2::before{content:"";flex:none;width:8px;height:8px;border-radius:50%;background:var(--st-backlog-dot)}
html body .kanban-column[data-stage="priorizado"] header h2::before{background:var(--st-priorizado-dot)}
html body .kanban-column[data-stage="andamento"] header h2::before{background:var(--st-andamento-dot)}
html body .kanban-column[data-stage="aguardando"] header h2::before{background:var(--st-aguardando-dot)}
html body .kanban-column[data-stage="concluido"] header h2::before{background:var(--st-concluido-dot)}
html body .kanban-column header>span{min-width:24px;height:24px;padding:0 8px;border-radius:var(--r-full);background:var(--surface)!important;color:var(--muted)!important;font-size:12px;font-weight:600;line-height:24px;text-align:center}
html body .kanban-column .column-help{font-size:12px;color:var(--muted)}
html body .kanban-card{border:1px solid var(--line-soft)!important;border-radius:var(--r-md);background:var(--surface)!important;box-shadow:var(--shadow-1);transition:box-shadow .15s,transform .15s,border-color .15s}
html body .kanban-card:hover{box-shadow:var(--shadow-2);border-color:var(--line)!important}
html body .kanban-card:active{cursor:grabbing}
html body .kanban-column.drop-target{outline:2px dashed color-mix(in srgb,var(--p) 50%,transparent);outline-offset:-4px}

/* ---------- Visualização Lista/Kanban (controle segmentado) ---------- */
html body .staff-views{display:inline-flex;padding:4px;gap:4px;border:0;border-radius:var(--r-full);background:var(--surface-3)}
html body .staff-views button{min-height:32px;padding:0 16px;border:0!important;border-radius:var(--r-full);background:transparent!important;color:var(--muted)!important;font-size:13px;font-weight:600;box-shadow:none}
html body .staff-views button[aria-pressed="true"],html body .staff-views button.selected,html body .staff-views button.active{background:var(--surface)!important;color:var(--ink)!important;box-shadow:var(--shadow-1)}

/* ---------- Modal ---------- */
html body dialog{border:1px solid var(--line-soft);border-radius:var(--r-xl);box-shadow:var(--shadow-3)}
html body dialog::backdrop{background:rgba(16,24,40,.45);backdrop-filter:blur(2px)}

/* ---------- Avisos ---------- */
html body .toast{border-radius:var(--r-md);box-shadow:var(--shadow-3);font-weight:550}

/* ---------- Celular ---------- */
@media (max-width:760px){
  html body h1,html body #view .welcome h1{font-size:24px;line-height:32px}
  html body section.card{padding:16px}
  html body #view .stats{gap:8px}
  html body #view .stat{padding:12px}
  html body #view .stat strong{margin:0;font-size:24px;line-height:32px}
  html body #view .stat>span:first-child{font-size:12px}
  html body aside{box-shadow:none}
  html body aside nav#nav{background:var(--surface);box-shadow:0 -1px 0 var(--line-soft)}
  html body aside nav#nav .nav:hover{background:none}
  html body aside nav#nav .nav.active{background:none!important;color:var(--ink)}
  html body #view .welcome>.primary,html body #view .welcome>div>.primary{box-shadow:var(--shadow-3)}
}

/* Botão tonal também no modo escuro (vence a regra antiga de contorno) */
html[data-theme="dark"] body .approval-first,html[data-theme="dark"] body .di-side>button,html[data-theme="dark"] body .kanban-actions button{background:var(--accent-container)!important;border-color:transparent!important;color:var(--on-accent)!important}
