/* ============================================================
   CRONOGRAMA DE PROJETOS — tema "Azul & Âmbar"
   Futurista · introspectivo · arquitetônico · suave aos olhos
   ============================================================ */
:root {
  --font: "Segoe UI", Inter, system-ui, Arial, sans-serif;
  --mono: "Cascadia Code", "Consolas", ui-monospace, monospace;

  /* Paleta cálida "papel & madeira" — marfim + bronze/dourado */
  --navy:   #7a5a39;   /* madeira (acentos escuros, faixas, barra) */
  --wood-d: #5e4226;   /* madeira escura */
  --bg-0:   #e9e0cd;   /* fundo (marfim) */
  --bg-1:   #f1ead9;   /* painéis */
  --bg-2:   #f7f1e4;   /* cartões / cabeçalhos (papel) */
  --bg-3:   #e6dabf;   /* hover */

  --line:   #d8c9a9;   /* linhas finas (creme) */
  --line-soft: #e3d8c1;

  /* cronogramas (grade) — marfim/prateado quente */
  --grid-bg:   #efe8d8; /* fundo da grade (papel) */
  --grid-head: #e3d7bd; /* cabeçalhos e rótulos da grade */
  --grid-line: #c7b48a; /* linhas da grade (ouro-bronze) */
  --grid-ink:  #3f3322; /* texto sobre a grade */
  --grid-muted:#8a7c61; /* texto secundário na grade */

  --ink:    #3f3322;   /* texto principal (marrom escuro) */
  --muted:  #8a7c61;   /* texto secundário (taupe quente) */

  /* Bronze/ouro = destaque (mantém os nomes das variáveis). */
  --blue:   #a9884f;
  --blue-2: #c2a368;
  --orange: #bd9a5b;   /* dourado (destaques) */
  --orange-2:#9a7d49;

  --glow-blue:   0 0 0 1px rgba(169,136,79,.30), 0 8px 30px rgba(94,66,38,.18);
  --glow-orange: 0 0 0 1px rgba(189,154,91,.30), 0 8px 24px rgba(150,120,70,.18);
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  font-size: 14px;
  background-color: var(--bg-0);
  /* brilhos suaves azul/prata; as ondas topográficas vêm do #topo */
  background-image:
    radial-gradient(1000px 600px at 85% -10%, rgba(189,154,91,.10), transparent 60%),
    radial-gradient(1100px 700px at -5% 110%, rgba(122,90,57,.10), transparent 55%);
  background-size: 100% 100%, 100% 100%;
  background-attachment: fixed;
  min-height: 100vh;
}

/* ---------- fundo topográfico (gerado por topo.js) ---------- */
#topo {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .7;
}
#topo svg { width: 100%; height: 100%; display: block; }
/* leve escurecimento nas bordas (vinheta) sem mask custosa */
#topo::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 120% at 50% 40%, transparent 55%, var(--bg-0) 100%);
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error-msg { color: #ff9a9a; min-height: 1.2em; margin: 6px 0 0; }

/* ---------- linha de acento superior (azul→âmbar) ---------- */
body::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50;
  background: linear-gradient(90deg, var(--blue), var(--blue-2), var(--orange));
}

/* ---------- LOGIN ---------- */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-box {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  padding: 34px; border-radius: 16px; width: 360px;
  border: 1px solid var(--line);
  box-shadow: var(--glow-blue);
  display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden;
}
.login-box::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, transparent 60%, rgba(255,138,61,.08));
}
.login-box h1 {
  margin: 0; font-size: 22px; letter-spacing: .5px; font-weight: 700;
  background: linear-gradient(90deg, var(--blue-2), var(--orange));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-box .subtitle { margin: 0 0 8px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; font-size: 11px; }
.login-box label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; color: var(--muted); font-size: 12px; }
.login-box input {
  padding: 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px;
  background: var(--bg-0); color: var(--ink);
}
.login-box input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.25); }
.login-box button {
  margin-top: 8px; padding: 12px; border: none; border-radius: 9px;
  background: linear-gradient(90deg, var(--blue), var(--blue-2));
  color: #04121f; font-weight: 800; cursor: pointer; font-size: 15px; letter-spacing: .3px;
}
.login-box button:hover { filter: brightness(1.08); box-shadow: 0 6px 20px rgba(56,189,248,.3); }
.login-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 10px 0 2px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.14); }
.btn-google {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 11px 14px; border-radius: 9px; border: 1px solid #dadce0;
  background: #fff !important; color: #3c4043 !important; font-weight: 700; font-size: 14px;
  cursor: pointer; letter-spacing: 0; box-shadow: none !important;
}
.btn-google:hover { filter: none; background: #f7f8f8 !important; }
.v-login { text-align: center; padding: 40px 16px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.v-login .btn-google { width: auto; }

/* ---------- TOPBAR ---------- */
.topbar {
  display: flex; align-items: flex-end; gap: 16px; padding: 14px 24px 0; flex-wrap: wrap;
  background: linear-gradient(180deg, #f4eee0, #ece2cd);
  border-bottom: 3px solid var(--navy);
  box-shadow: 0 2px 10px rgba(94,66,38,.12);
}
.brand { font-weight: 800; font-size: 16px; letter-spacing: .4px; color: var(--ink); align-self: center; margin-bottom: 12px; }
.tabs { display: flex; gap: 4px; flex: 1; align-items: flex-end; }
.tab {
  background: linear-gradient(180deg, #efe6d2, #ddceac); border: 1px solid var(--line); border-bottom: none;
  color: var(--wood-d); padding: 9px 16px 11px; border-radius: 12px 12px 0 0; cursor: pointer;
  font-size: 14px; font-weight: 700; letter-spacing: .2px; position: relative; top: 1px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}
.tab:hover { background: linear-gradient(180deg, #f3ecdb, #e4d7b9); color: var(--wood-d); }
.tab.active {
  color: #fff7e9; background: linear-gradient(180deg, #b58a55, #8a6435);
  border-color: var(--wood-d); top: 2px;
  box-shadow: 0 -2px 8px rgba(94,66,38,.22), inset 0 1px 0 rgba(255,255,255,.25);
}
.user-area { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); align-self: center; margin-bottom: 10px; }

/* ---------- BOTÕES ---------- */
.btn-primary {
  background: linear-gradient(90deg, var(--blue), var(--blue-2)); color: #04121f; border: none;
  padding: 11px 20px; border-radius: 9px; font-weight: 800; cursor: pointer; font-size: 14px; letter-spacing: .3px;
}
.btn-primary:hover { filter: brightness(1.07); box-shadow: var(--glow-blue); }
.btn-secondary {
  background: var(--bg-2); color: var(--ink); border: 1px solid var(--line);
  padding: 9px 14px; border-radius: 9px; cursor: pointer; font-weight: 600;
}
.btn-secondary:hover { background: var(--bg-3); border-color: var(--blue); }
.btn-danger {
  background: rgba(255,90,90,.12); color: #ff9a9a; border: 1px solid rgba(255,90,90,.3);
  padding: 6px 11px; border-radius: 7px; cursor: pointer; font-weight: 600;
}
.btn-danger:hover { background: rgba(255,90,90,.2); }

/* ---------- LAYOUT ---------- */
main { padding: 22px; max-width: 1500px; margin: 0 auto; }
.tab-panel h2 { margin-top: 4px; letter-spacing: .4px; font-weight: 700; }
.tab-panel h2, .tab-panel h3 { color: var(--ink); }
.card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px; box-shadow: 0 6px 24px rgba(6,11,22,.35);
}
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
#week-label { color: var(--ink); letter-spacing: .3px; font-size: 15px; }

/* ---------- CRONOGRAMA (grade) ---------- */
.schedule-wrap {
  overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--grid-bg); box-shadow: 0 6px 22px rgba(6,11,22,.35);
}
table.schedule { border-collapse: collapse; width: 100%; min-width: 940px; }
table.schedule th, table.schedule td {
  border: 1px solid var(--grid-line); padding: 2px 9px; font-size: 12px; text-align: center; vertical-align: middle;
}
table.schedule thead th {
  background: var(--grid-head); position: sticky; top: 0; z-index: 2; color: var(--grid-ink);
  border-bottom: 2px solid var(--navy);
}
.col-member { text-align: left; font-weight: 700; background: var(--grid-head); white-space: nowrap; min-width: 110px; color: var(--grid-ink); }
.col-shift { background: var(--grid-bg); color: var(--grid-muted); font-weight: 600; width: 72px; font-family: var(--mono); font-size: 11px; }
.sector-row td {
  background: linear-gradient(90deg, #8a6435 0%, #a9884f 45%, #c2a368 100%);
  color: #fff7e9; text-align: left; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; font-size: 11px;
  border-left: 3px solid var(--orange);
}
.sector-row .sec-name { position: sticky; left: 10px; display: inline-block; }
.weekend { background: #ddd1b6 !important; color: #8a7c61; }
.day-head .date { display: block; color: var(--grid-muted); font-weight: 600; font-family: var(--mono); }
.day-head .dow { display: block; text-transform: capitalize; color: var(--grid-ink); }
/* HOJE: realça a COLUNA inteira (linhas verticais contínuas) */
.today-col { box-shadow: inset 3px 0 0 var(--navy), inset -3px 0 0 var(--navy), inset 0 4px 0 var(--navy); }
.cell-journey { cursor: pointer; font-weight: 700; min-width: 116px; transition: transform .05s; }
.cell-journey:hover { outline: 2px solid var(--orange); outline-offset: -2px; }

/* ---------- LEGENDA ---------- */
.legend-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.legend-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  font-size: 12px; border: 1px solid var(--line); background: var(--bg-1); color: var(--muted);
}
.legend-swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(255,255,255,.2); }

/* ---------- FORMULÁRIOS ---------- */
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
input, select {
  padding: 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px;
  font-family: var(--font); background: var(--bg-0); color: var(--ink);
}
input:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.22); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }

/* ---------- PLANO DE ETAPAS ---------- */
.stage-plan { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.stage-row {
  display: grid; grid-template-columns: 1fr 90px 2fr auto; gap: 10px; align-items: center;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px;
}
.stage-row .swatch { width: 16px; height: 16px; border-radius: 4px; display: inline-block; margin-right: 6px; vertical-align: middle; }
.stage-row input[type=number] { width: 80px; }

/* ---------- PRÉ-VISUALIZAÇÃO ---------- */
.preview-box { margin-top: 16px; background: var(--bg-0); border: 1px dashed var(--line); border-radius: 9px; padding: 14px; }
.preview { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.preview-cell {
  font-size: 11px; padding: 4px 7px; border-radius: 6px; border: 1px solid rgba(255,255,255,.15);
  min-width: 66px; text-align: center; font-weight: 700;
}
.preview-cell small { font-weight: 500; opacity: .85; }

/* ---------- PROJETOS ---------- */
.projects-list { display: flex; flex-direction: column; gap: 10px; }
.project-item {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 10px;
  padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.project-item:hover { border-left-color: var(--orange); }
.project-item .meta { color: var(--muted); font-size: 13px; }
.badge { padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; background: rgba(56,189,248,.15); color: var(--blue-2); }

/* ---------- TABELAS DE CONFIG ---------- */
.conf-table { width: 100%; border-collapse: collapse; }
.conf-table th, .conf-table td { border-bottom: 1px solid var(--line-soft); padding: 9px; text-align: left; color: var(--ink); }
.conf-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }

/* ---------- BADGE MODO LOCAL ---------- */
.local-badge {
  position: fixed; bottom: 14px; right: 14px; z-index: 60;
  background: linear-gradient(90deg, var(--orange), var(--orange-2)); color: #04121f;
  font-weight: 800; font-size: 11px; letter-spacing: .5px; padding: 7px 12px; border-radius: 999px;
  box-shadow: var(--glow-orange); text-transform: uppercase;
}

/* ---------- viewer (visitante) ---------- */
.v-head { display: flex; align-items: baseline; gap: 12px; margin: 4px 0 12px; }
.v-head h2 { margin: 0; }
.tabs a.tab { text-decoration: none; display: inline-flex; align-items: center; }

/* ---------- compartilhar ---------- */
.share-row { margin: 12px 0; }
.share-row b { display: block; margin-bottom: 4px; font-size: 13px; }
.share-link { display: flex; gap: 6px; }
.share-link input { flex: 1; padding: 7px 9px; font-size: 12px; font-family: monospace; border: 1px solid var(--grid-line); border-radius: 6px; background: var(--bg-2); color: var(--ink); }

/* ---------- toolbar extras ---------- */
.spacer { flex: 1; }
.btn-secondary.active-toggle { background: linear-gradient(90deg, var(--orange), var(--orange-2)); color: #04121f; border-color: transparent; }
.small { font-size: 12px; }

/* ---------- células com nome do projeto + etapa ---------- */
.cell-journey { padding: 2px 7px; line-height: 1.05; position: relative; }
.cell-journey .cj-proj { display: block; font-weight: 800; font-size: 11px; letter-spacing: .2px; }
.cell-journey .cj-stage { display: block; font-weight: 600; font-size: 10px; opacity: .9; }
.cell-journey.is-done { opacity: .55; background-image: repeating-linear-gradient(45deg, rgba(0,0,0,.12) 0 5px, transparent 5px 10px); }
.done-tick { position: absolute; top: 2px; right: 4px; font-weight: 900; font-size: 11px; }

/* ---------- VISTA MACRO ---------- */
table.macro th.macro-month { background: var(--grid-head); color: var(--navy); text-transform: uppercase; letter-spacing: 1px; font-size: 11px; border-bottom: 2px solid var(--navy); font-weight: 800; }
table.macro th.macro-day { font-family: var(--mono); font-size: 10px; color: var(--grid-muted); padding: 3px; min-width: 18px; }
.macro-cell { padding: 2px !important; }
.macro-cell .mb { display: inline-block; width: 9px; height: 11px; border-radius: 2px; margin: 0 1px; vertical-align: middle; }
.macro-cell .mb.empty { background: transparent; box-shadow: inset 0 0 0 1px var(--line-soft); }
.macro-cell .mb-done { outline: 1px solid rgba(255,255,255,.6); }

/* ---------- PAVIMENTOS / CHIPS ---------- */
.pav-input { display: flex; gap: 10px; margin-bottom: 10px; }
.pav-input input { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13px; }
.chip button { background: rgba(255,90,90,.18); color: #ff9a9a; border: none; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; font-weight: 800; }

/* ---------- FLUXO DE TRABALHO ---------- */
.quick-flows { margin: 8px 0 12px; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-secondary.mini { padding: 5px 10px; font-size: 12px; }
.flow-head, .step-row { display: grid; grid-template-columns: 28px 22px 1.6fr 1.2fr 90px 1fr 36px; gap: 8px; align-items: center; }
.flow-head { padding: 0 10px 4px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; }
.workflow { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.step-row { background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.step-row.dragging { opacity: .5; border-color: var(--orange); }
.step-row .drag { cursor: grab; color: var(--muted); font-size: 18px; text-align: center; user-select: none; }
.step-row .swatch { width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(255,255,255,.2); }
.step-row .btn-danger { padding: 5px 9px; }

/* ---------- ACOMPANHAMENTO ---------- */
.track-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px){ .track-grid { grid-template-columns: 1fr; } }
.bar-row { margin-bottom: 10px; }
.bar-label { font-size: 13px; margin-bottom: 3px; }
.bar-track { position: relative; background: var(--bg-0); border: 1px solid var(--line); border-radius: 8px; height: 22px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 8px 0 0 8px; transition: width .4s ease; }
.bar-pct { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 700; color: var(--ink); }
.person-line { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.person-line:hover { background: var(--bg-3); border-radius: 8px; }
.pl-dot { width: 12px; height: 12px; border-radius: 50%; }
.pl-pct { margin-left: auto; font-weight: 800; color: var(--blue-2); }
.sec-title { color: var(--blue-2); margin: 14px 0 6px; letter-spacing: 1px; text-transform: uppercase; font-size: 12px; }
.row-actions { display: flex; gap: 8px; }
.project-item.col { flex-direction: column; align-items: stretch; }
.project-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pav-assign { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.pa-title { color: var(--blue-2); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.pav-assign-row { display: flex; align-items: center; gap: 12px; padding: 5px 0; flex-wrap: wrap; }
.pav-name { min-width: 120px; font-weight: 700; }
.member-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.mtoggle { background: var(--bg-0); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 12px; cursor: pointer; font-weight: 600; }
.mtoggle:hover { border-color: var(--blue); color: var(--ink); }
.mtoggle.on { font-weight: 800; }
.legend-group { font-weight: 800; color: var(--blue-2); margin: 0 4px 0 8px; align-self: center; font-size: 12px; }
.ok { color: #6fe6a6; font-weight: 700; }

/* ---------- MODAL ---------- */
.modal { position: fixed; inset: 0; background: rgba(6,11,22,.66); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-box { background: linear-gradient(180deg, var(--bg-2), var(--bg-1)); border: 1px solid var(--line); border-radius: 16px; padding: 22px; width: min(560px, 96vw); max-height: 86vh; overflow: auto; box-shadow: var(--glow-blue); }
.modal-box h3 { margin: 6px 0 2px; }
.modal-tag { display: inline-block; padding: 4px 12px; border-radius: 999px; font-weight: 800; font-size: 12px; margin-bottom: 8px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* ---------- form grid 3 + cor ---------- */
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 16px; }
@media (max-width: 720px){ .grid3 { grid-template-columns: 1fr; } }
input[type=color] { padding: 4px; height: 42px; cursor: pointer; }
.inline-label { display: flex; align-items: center; gap: 8px; flex-direction: row; font-weight: 600; color: var(--muted); }
.inline-label select { min-width: 220px; }

/* ---------- progresso na célula ---------- */
.cell-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0,0,0,.18); }
.cell-prog i { display: block; height: 100%; background: rgba(16,32,58,.75); }

/* ---------- BLOCOS (pavimentos com fluxo) ---------- */
.bloco { background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; border-left: 3px solid var(--blue); }
.bloco-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.bloco-head .bl-name { flex: 1; font-weight: 700; }
.bl-resp { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.resp-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.rtoggle, .mtoggle { background: var(--bg-0); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 12px; cursor: pointer; font-weight: 600; }
.rtoggle:hover, .mtoggle:hover { border-color: var(--blue); color: var(--ink); }
.rtoggle.on, .mtoggle.on { font-weight: 800; }
.bl-quick { margin: 6px 0 10px; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.flow-head, .step-row { display: grid; grid-template-columns: 28px 1.7fr 1.3fr 90px 36px; gap: 8px; align-items: center; }
.flow-head { padding: 0 10px 4px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; }

/* ---------- GANTT (macro por projeto) ---------- */
.gantt-label { min-width: 220px; }
table.macro th.macro-month { background: var(--grid-head); color: var(--navy); text-transform: uppercase; letter-spacing: 1px; font-size: 11px; border-bottom: 2px solid var(--navy); font-weight: 800; }
table.macro th.macro-day { font-family: var(--mono); font-size: 10px; color: var(--grid-muted); padding: 3px; min-width: 16px; }
.gantt-proj td { background: linear-gradient(90deg, var(--navy), #0e1d44); color: #eef0f3; font-weight: 800; letter-spacing: .5px; }
.gantt-label { color: var(--grid-ink); }
table.macro td.gantt-cell { background: var(--grid-bg); }
.gantt-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: middle; }
.gantt-cell { padding: 0 !important; height: 22px; }
.gbar { display: block; height: 16px; margin: 3px 0; opacity: .65; }
.gbar.gbar-active { opacity: 1; }
.gbar.bar-start { border-radius: 8px 0 0 8px; margin-left: 2px; }
.gbar.bar-end { border-radius: 0 8px 8px 0; margin-right: 2px; }

/* ---------- FLUXOGRAMA ---------- */
.flowchart { display: flex; flex-direction: column; gap: 18px; }
.flow-proj-title { font-size: 18px; font-weight: 800; display: flex; align-items: center; }
.flow-lane { background: linear-gradient(180deg, var(--bg-2), var(--bg-1)); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.flow-lane-title { color: var(--blue-2); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; font-size: 12px; margin-bottom: 10px; }
.flow-chain { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.flow-node { background: var(--bg-0); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 150px; box-shadow: 0 4px 14px rgba(6,11,22,.3); }
.fn-stage { font-weight: 700; font-size: 13px; }
.fn-meta { color: var(--muted); font-size: 11px; margin-top: 3px; }
.flow-arrow { color: var(--blue-2); font-size: 22px; font-weight: 800; }

/* ---------- dias sem expediente ---------- */
.do-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 10px; }
@media (max-width: 720px){ .do-cols { grid-template-columns: 1fr; } }
.do-item { padding: 4px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.btn-danger.mini { padding: 2px 8px; }

/* ---------- comparativa real x esperado ---------- */
.bar-marker { position: absolute; top: -2px; bottom: -2px; width: 3px; background: var(--orange); box-shadow: 0 0 0 1px rgba(0,0,0,.3); }
.prog-edit { display: block; margin: 14px 0; }
.prog-edit input[type=range] { width: 100%; margin-top: 8px; }
.prog-mini { width: 110px; vertical-align: middle; }

/* ============================================================
   v4 — dias sem expediente, finalização, fluxograma, gargalos
   + pequenos refinamentos contemporâneos
   ============================================================ */

/* feriados e dias não trabalhados — hachura vermelha + título */
.noworkday {
  background-color: rgba(220,70,70,.10) !important;
  background-image: repeating-linear-gradient(45deg, rgba(229,72,72,.55) 0 2px, transparent 2px 8px) !important;
  cursor: help;
}
th.noworkday { border-bottom: 2px solid #e54848; }
.noday-label { display: block; font-size: 9px; color: #ff9a9a; font-weight: 700; line-height: 1.05; margin-top: 2px; max-width: 90px; margin-inline: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* destaque do dia de HOJE (também nas células do corpo) */
.today-cell { box-shadow: inset 3px 0 0 var(--navy), inset -3px 0 0 var(--navy); background-color: rgba(122,90,57,.06); }
.cell-journey.today-cell { box-shadow: inset 3px 0 0 var(--navy), inset -3px 0 0 var(--navy); }
table.schedule tbody tr:last-child .today-cell { box-shadow: inset 3px 0 0 var(--navy), inset -3px 0 0 var(--navy), inset 0 -4px 0 var(--navy); }

/* célula de BUFFER (folga visual) */
.buffer-cell { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.18) 0 5px, transparent 5px 10px); }
.gbar-buffer { opacity: .9; box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); }

/* botões de macro (4/6 semanas) */
.macro-span { font-size: 12px; padding: 7px 12px; }

/* macro 4 semanas — maior e mais detalhado */
table.macro-4w th.macro-day { min-width: 30px; font-size: 12px; padding: 5px; }
table.macro-4w .gbar { height: 24px; font-size: 13px; }
table.macro-4w .gantt-cell { height: 30px; }
table.macro-4w .gantt-label { font-size: 13px; }

/* finalização no Gantt */
.gbar { display: flex; align-items: center; justify-content: center; font-size: 10px; color: rgba(16,32,58,.85); }
.gbar-finish { box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); font-weight: 900; }

/* ---------- FLUXOGRAMA vertical com decisões ---------- */
.flow-vert { display: flex; flex-direction: column; align-items: center; gap: 0; }
.fnode { background: var(--bg-0); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; text-align: center; min-width: 230px; box-shadow: 0 4px 16px rgba(6,11,22,.3); transition: transform .12s, box-shadow .12s; }
.fnode:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(6,11,22,.45); }
.fnode b { display: block; font-size: 13px; }
.fnode span { color: var(--muted); font-size: 11px; }
.fnode.proc { text-align: left; }
.fnode.start, .fnode.end { background: linear-gradient(90deg, var(--blue), var(--blue-2)); color: #04121f; font-weight: 800; border: none; }
.fnode.end { background: linear-gradient(90deg, var(--orange), var(--orange-2)); }
.fnode.decision { background: var(--bg-2); border: 1px dashed var(--blue-2); border-radius: 14px; font-weight: 700; color: var(--blue-2); }
.fnode.decision .branches { display: flex; gap: 14px; justify-content: center; margin-top: 6px; }
.fnode.decision .branches i { font-style: normal; font-size: 11px; padding: 2px 10px; border-radius: 999px; }
.fnode.decision .branches .yes { background: rgba(95,209,193,.2); color: #7fe0cf; }
.fnode.decision .branches .no { background: rgba(230,126,168,.18); color: #f0a8c4; }
.fconn { width: 2px; height: 22px; background: linear-gradient(var(--blue-2), var(--line)); position: relative; }
.fconn::after { content: "▼"; position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); color: var(--blue-2); font-size: 10px; }

/* fluxograma macro (pavimentos em paralelo) */
.macroflow { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.fnode.big { min-width: 280px; font-size: 15px; padding: 14px 22px; }
.mf-branches { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; width: 100%; }
.mf-lane { background: linear-gradient(180deg, var(--bg-2), var(--bg-1)); border: 1px solid var(--line); border-radius: 14px; padding: 14px; flex: 1; min-width: 280px; }
.mf-lane-title { color: var(--blue-2); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; font-size: 12px; margin-bottom: 10px; }

/* ---------- GARGALOS / acompanhamento detalhado ---------- */
.garg-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.garg-name { flex: 1; font-size: 13px; }
.garg-delta { font-weight: 800; color: #f0a8c4; background: rgba(230,126,168,.14); padding: 2px 10px; border-radius: 999px; font-size: 12px; }

/* ---------- refinamentos contemporâneos ---------- */
.card { backdrop-filter: blur(4px); }
.tab { transition: background .15s, color .15s; }
.btn-primary, .btn-secondary, .btn-danger { transition: filter .12s, background .15s, box-shadow .15s, transform .08s; }
.btn-primary:active, .btn-secondary:active { transform: translateY(1px); }
.project-item { transition: border-color .15s, transform .1s; }
.project-item:hover { transform: translateY(-1px); }
.cell-journey { transition: outline-color .1s; }
.badge { letter-spacing: .3px; }
h2 { font-weight: 700; }
h3 { font-weight: 700; }

/* ============================================================
   v5 — logo, comparativo de buffer, fins de semana claros no
   macro, e refinamentos de UX (mais contemporâneo)
   ============================================================ */

/* ---------- LOGO ---------- */
.brand { display: flex; align-items: center; gap: 11px; }
.logo-mark { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 2px 6px rgba(95,168,230,.25)); }
.logo-mark.logo-lg { width: 58px; height: 58px; margin: 0 auto 6px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 14px; letter-spacing: 1.5px; color: var(--ink); }
.brand-text small { font-size: 9px; letter-spacing: 4px; color: var(--muted); }
.login-box { text-align: center; }
.login-box label { text-align: left; }

/* ---------- fins de semana MUITO mais claros no macro ---------- */
.macro td.weekend, .macro th.weekend { background-color: #c2b288 !important; color: #4a3f29; background-image: none !important; }

/* ---------- comparativo de buffer ---------- */
.buffer-cmp th, .buffer-cmp td { text-align: center; }
.buffer-cmp th:first-child, .buffer-cmp td:first-child { text-align: left; }
.buffer-cmp tr.sub th { font-size: 10px; color: var(--muted); text-transform: none; letter-spacing: 0; padding-top: 0; }
.buffer-cmp .buf-end { font-weight: 800; color: var(--blue-2); }
.buffer-cmp .pav-cell { padding-left: 22px; font-weight: 600; }
.buffer-cmp .gantt-proj td { text-align: left; }
.extra-badge { background: rgba(255,138,61,.16); color: var(--orange); border: 1px solid rgba(205,214,230,.25); padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }

/* ---------- REFRESH UX ---------- */
.topbar { position: sticky; top: 0; z-index: 40; padding: 12px 24px; }
main { padding-top: 24px; }
.tab { letter-spacing: .2px; }
.card { border-radius: 16px; padding: 22px; box-shadow: 0 10px 30px rgba(6,11,22,.28); }
.tab-panel h2 { position: relative; padding-bottom: 8px; margin-bottom: 16px; font-size: 21px; }
.tab-panel h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 46px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--blue), var(--orange)); }
.tab-panel h3 { font-size: 15px; letter-spacing: .2px; }
.btn-primary, .btn-secondary { border-radius: 10px; }
.conf-table th { font-size: 11px; }
.conf-table tr:hover td { background: rgba(95,168,230,.05); }
.toolbar { background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
table.schedule thead th { backdrop-filter: blur(6px); }
.legend-chip { transition: border-color .15s, transform .1s; }
.legend-chip:hover { border-color: var(--blue); transform: translateY(-1px); }
.cell-journey { border-radius: 2px; }
.modal-box { border-radius: 18px; }
input:focus, select:focus, .login-box input:focus { box-shadow: 0 0 0 3px rgba(95,168,230,.22); }

/* resumo por pavimento (início / fim / duração) no formulário */
.bl-summary { margin-top: 10px; padding: 9px 12px; border-radius: 9px; font-size: 13px; color: var(--ink);
  background: rgba(116,143,171,.12); border: 1px solid var(--line); }
.bl-summary b { color: var(--blue-2); }

/* ---------- v6: seletor de data + início por pavimento ---------- */
.goto-label { display: flex; flex-direction: row; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 600; margin: 0; }
.goto-label input { padding: 7px 9px; }
.bl-start-label { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); font-weight: 600; margin: 0; white-space: nowrap; }
.bl-start-label input { padding: 6px 8px; }

/* ---------- v7: colisões + impressão ---------- */
.cell-journey.has-collision { outline: 2px solid #e0a82e; outline-offset: -2px; }
.cell-journey.has-collision::before {
  content: "⚠"; position: absolute; top: 1px; left: 2px; font-size: 10px; line-height: 1;
  background: #e0a82e; color: #3a2600; border-radius: 3px; padding: 1px 2px; font-weight: 800;
}
.conflict-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.conflict-row .cf-date { font-family: var(--mono); color: var(--blue-2); min-width: 70px; }
.btn-secondary.has-conf { background: #e0a82e; color: #3a2600; border-color: transparent; font-weight: 800; }

@media print {
  body { background: #fff !important; color: #000 !important; }
  body::before, #topo, .local-badge, .topbar, .legend-bar, .toolbar, #cancel-edit { display: none !important; }
  main { padding: 0 !important; max-width: none !important; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .tab-panel.hidden { display: none !important; }
  .schedule-wrap { box-shadow: none !important; border: 1px solid #333 !important; background: #fff !important; overflow: visible !important; }
  table.schedule th, table.schedule td { border: 1px solid #444 !important; }
  table.schedule thead th, .col-member { background: #eef0f3 !important; color: #000 !important; border-bottom: 2px solid #111 !important; }
  .col-shift { background: #f6f7f9 !important; color: #000 !important; }
  .day-head .dow, .day-head .date { color: #000 !important; }
  .weekend { background: #d7d7d7 !important; color: #000 !important; }
  .sector-row td, .gantt-proj td { background: #c9d3e6 !important; color: #000 !important; border-left-color: #111 !important; }
  table.macro td.gantt-cell { background: #fff !important; }
  .tab-panel h2 { color: #000 !important; }
}

/* ---------- v8: arrastar lateral + colunas fixas (Membro/Turno) ---------- */
.schedule-wrap { cursor: grab; }
.schedule-wrap.grabbing { cursor: grabbing; user-select: none; }
table.schedule .col-member { position: sticky; left: 0; z-index: 4; width: 122px; box-shadow: 2px 0 0 var(--grid-line); }
table.schedule .col-shift  { position: sticky; left: 122px; z-index: 4; box-shadow: 2px 0 0 var(--grid-line); }
table.schedule thead th.col-member, table.schedule thead th.col-shift { z-index: 6; }

/* ---------- prioridades ---------- */
.priorities-list { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.prio-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1)); border: 1px solid var(--line);
  border-left: 4px solid var(--blue); cursor: grab;
}
.prio-item.dragging { opacity: .5; border-color: var(--orange); }
.prio-rank { font-weight: 800; color: var(--blue-2); min-width: 26px; font-size: 18px; text-align: center; }
.prio-grip { color: var(--muted); font-size: 18px; cursor: grab; }
.prio-main { flex: 1; }
.prio-main strong { font-size: 15px; }
.prio-resp { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------- v9: KPIs + gráficos (donut, linha, setor) ---------- */
.kpi-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.kpi { flex: 1; min-width: 130px; background: linear-gradient(180deg, var(--bg-2), var(--bg-1)); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.kpi-val { font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.kpi-lbl { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; margin-top: 2px; }
.kpi.warn .kpi-val { color: #bd6a36; }
.donut { width: 156px; height: 156px; display: block; margin: 4px auto 0; }
.donut-num { font-size: 22px; font-weight: 800; fill: var(--ink); }
.donut-lbl { font-size: 9px; fill: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.donut-legend { display: flex; justify-content: center; gap: 18px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.donut-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.linechart { width: 100%; height: auto; }
.lc-grid { stroke: var(--line); stroke-width: 1; }
.lc-ax { fill: var(--muted); font-size: 9px; font-family: var(--mono); }
.lc-area { fill: rgba(169,136,79,.14); stroke: none; }
.lc-plan { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 4 3; }
.lc-done { fill: none; stroke: var(--blue); stroke-width: 2.5; }
.lc-leg text { fill: var(--muted); font-size: 10px; }
.bar-track.stacked { background: rgba(122,90,57,.16); }
.evo-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.evo-arrow { background: var(--bg-2); border: 1px solid var(--line); color: var(--ink); width: 30px; height: 28px; border-radius: 8px; cursor: pointer; font-weight: 800; }
.evo-arrow:hover { background: var(--bg-3); border-color: var(--blue); }
#evo-title { flex: 1; text-align: center; font-size: 15px; font-weight: 700; }
.lc-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.lc-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }

/* ---------- scrollbar discreta ---------- */
::-webkit-scrollbar { height: 10px; width: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue); }
::-webkit-scrollbar-track { background: transparent; }
