:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --border: #e2e6ec;
  --text: #1c2330;
  --muted: #647084;
  --accent: #2563eb;
  --accent-soft: #e8efff;
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #059669;
  --p1: #dc2626; --p2: #ea580c; --p3: #ca8a04; --p4: #64748b;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141b; --surface: #171d26; --surface-2: #1d2430; --border: #2a3342;
    --text: #e5e9f0; --muted: #94a0b4; --accent: #5b8cff; --accent-soft: #1f2b45;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
pre, .pre { white-space: pre-wrap; word-break: break-word; font-family: inherit; margin: 0; }
code { font-family: Consolas, monospace; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
[hidden] { display: none !important; }

/* Layout */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar { background: #111827; color: #cbd5e1; padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; }
.brand { color: #fff; font-weight: 700; font-size: 16px; padding: 4px 10px 16px; }
.sidebar a { color: #cbd5e1; padding: 8px 10px; border-radius: 6px; display: block; }
.sidebar a:hover { background: #1f2937; text-decoration: none; }
.sidebar a.active { background: var(--accent); color: #fff; }
.sidebar .sep { color: #64748b; font-size: 11px; text-transform: uppercase; padding: 14px 10px 4px; }
.sidebar .user { margin-top: auto; padding: 10px; border-top: 1px solid #1f2937; font-size: 12px; }
.main { padding: 24px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.topbar h1 { margin: 0; }

/* Components */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi .v { font-size: 26px; font-weight: 700; }
.kpi .l { color: var(--muted); font-size: 12px; }
.kpi.danger .v { color: var(--danger); }
.kpi.warn .v { color: var(--warn); }
.kpi.ok .v { color: var(--ok); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mt { margin-top: 16px; }

button, .btn {
  font: inherit; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 7px 14px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--danger); }
button.ms { background: #2f2f2f; color: #fff; border-color: #2f2f2f; width: 100%; justify-content: center; }
button:disabled { opacity: .6; cursor: default; }

input, select, textarea {
  font: inherit; width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters > * { flex: 1 1 150px; width: auto; }
.filters > input[name=q] { flex: 3 1 260px; }
.filters > button { flex: 0 0 auto; }
input[type=checkbox] { width: auto; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--accent-soft); }
.table-wrap { overflow-x: auto; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.badge.p1 { background: var(--p1); color: #fff; border-color: var(--p1); }
.badge.p2 { background: var(--p2); color: #fff; border-color: var(--p2); }
.badge.p3 { background: var(--p3); color: #fff; border-color: var(--p3); }
.badge.p4 { background: var(--p4); color: #fff; border-color: var(--p4); }
.badge.breach { background: #fee2e2; color: var(--danger); border-color: #fecaca; }
.badge.ok { background: #d1fae5; color: var(--ok); border-color: #a7f3d0; }
.badge.src { text-transform: uppercase; font-size: 10px; }

.bars .bar { display: grid; grid-template-columns: 120px 1fr 40px; gap: 8px; align-items: center; margin-bottom: 6px; }
.bars .track { background: var(--surface-2); border-radius: 4px; height: 10px; overflow: hidden; }
.bars .fill { background: var(--accent); height: 100%; width: 0; }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.spark .col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; min-width: 0; }
.spark .c { background: var(--accent); border-radius: 2px 2px 0 0; min-height: 1px; }
.spark .r { background: var(--ok); border-radius: 2px 2px 0 0; min-height: 1px; }
.spark-labels { display: flex; gap: 4px; font-size: 10px; color: var(--muted); }
.spark-labels span { flex: 1; text-align: center; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.legend .lc { background: var(--accent); } .legend .lr { background: var(--ok); }

.ticket-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 10px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.comment { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); }
.comment.internal { background: #fffbeb; border-color: #fde68a; }
@media (prefers-color-scheme: dark) { .comment.internal { background: #2a2413; border-color: #5c4a14; } }
.comment .meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-bottom: 2px solid transparent; color: var(--muted); }
.tabs a.active { border-color: var(--accent); color: var(--text); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--text); }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 380px; }
.login .logo { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.divider { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin: 14px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.qr { background: #fff; padding: 10px; border-radius: 8px; display: block; margin: 8px auto; width: 200px; height: 200px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-family: Consolas, monospace; background: var(--surface-2); padding: 12px; border-radius: 6px; }
.error { color: var(--danger); font-size: 13px; margin: 8px 0; }
.secret { font-family: Consolas, monospace; word-break: break-all; background: var(--surface-2); padding: 8px; border-radius: 6px; }

.toast { position: fixed; right: 20px; bottom: 20px; background: #111827; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 420px; z-index: 10; }
.toast.err { background: var(--danger); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; padding: 8px; }
  .sidebar .sep, .sidebar .user { display: none; }
  .brand { padding: 8px 10px; }
  .main { padding: 16px; }
  .g2, .g3, .detail { grid-template-columns: 1fr; }
}
.kpi { color: inherit; } a.kpi:hover { text-decoration: none; border-color: var(--accent); }

label.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--text); margin: 6px 0; }
fieldset.perm { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; margin: 12px 0 0; }
fieldset.perm legend { font-weight: 600; font-size: 13px; padding: 0 6px; }
fieldset.perm legend a { font-weight: 400; margin-left: 6px; }
tr.sel td { background: var(--accent-soft); }
tr.muted td { opacity: .6; }
.row > select, .row > input { width: auto; flex: 1 1 180px; }
/* caixas de seleção: tamanho natural, texto logo ao lado, alinhadas à esquerda */
.row > input[type=checkbox], label.check > input[type=checkbox] { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; }
label.check { justify-content: flex-start; width: fit-content; cursor: pointer; }

/* ---------- tela de login com a identidade visual W2N ---------- */
.login-wrap {
  background: #06122e url("login-bg.webp?v=20260929") center / cover no-repeat;
}
.login {
  background: rgba(6, 18, 46, .74);
  border: 1px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #e8eefc;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .45);
}
.login .logo, .login h2 { color: #ffffff; }
.login .muted, .login label, .login .small, .login summary { color: #b3c2e3; }
.login input { background: rgba(255, 255, 255, .96); color: #111827; border-color: transparent; }
.login input:focus { outline: 2px solid rgba(242, 107, 33, .5); border-color: #f26b21; }
.login button.primary { background: #f26b21; border-color: #f26b21; color: #fff; }
.login button.primary:hover { background: #e05a12; border-color: #e05a12; }
.login a { color: #9dbcff; }
.login .error { color: #ffb4a3; }
.login .divider { color: #b3c2e3; }
.login .divider::before, .login .divider::after { border-color: rgba(255, 255, 255, .2); }
.login .codes, .login .secret { background: rgba(255, 255, 255, .08); color: #e8eefc; }
.login > p.muted:first-child { margin-top: 0; font-size: 16px; }

/* ---------- login: adequação da arte (1672x941, 16:9) ao tamanho da tela ---------- */
.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;           /* altura real em celulares (barra do navegador) */
  background-color: #06122e;
  background-position: center;
}
/* telas largas: cartão na área livre abaixo do logotipo da arte */
@media (min-width: 1100px) and (min-aspect-ratio: 4/3) {
  .login-wrap { place-items: center; padding-top: 12vh; }
  .login { max-width: 400px; }
}
/* celulares e tablets em retrato: arte como faixa no topo, ancorada à esquerda (onde está o logotipo),
   com altura de até metade da tela e limitada pela largura para o logotipo (6%–45% da arte) nunca ser cortado */
@media (max-aspect-ratio: 4/3), (max-width: 820px) {
  .login-wrap {
    --faixa: min(50vh, 110vw);
    background-image:
      linear-gradient(to bottom, rgba(6, 18, 46, 0) calc(var(--faixa) * .55), #06122e var(--faixa)),
      url("login-bg.webp?v=20260929");
    background-size: 100% 100%, auto var(--faixa);
    background-position: top left, top left;
    align-content: start;
    padding-top: calc(var(--faixa) * .34);  /* cartão logo abaixo do logotipo (fim em ~31% da arte) */
  }
  .login { max-width: 440px; }
}
/* celulares estreitos: cartão ocupando a largura com margens de 16px */
@media (max-width: 480px) {
  .login-wrap { padding-left: 12px; padding-right: 12px; }
  .login { padding: 16px; }
}
/* celular deitado / telas baixas: sem centralizar na vertical, para nada ficar fora da tela */
@media (max-height: 520px) and (min-aspect-ratio: 4/3) {
  .login-wrap { align-content: start; justify-items: end; padding: 16px 24px; }  /* cartão à direita, logotipo livre à esquerda */
  .login { max-width: 360px; padding: 14px 16px; }
}

/* ---------- rodapé com direitos reservados ---------- */
.content { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.content > .main { flex: 1; }
.app-footer { padding: 12px 24px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; text-align: center; }
.login-wrap { grid-template-rows: 1fr auto; }
.login-footer { align-self: end; justify-self: stretch; text-align: center; padding: 16px 12px 4px; color: rgba(232, 238, 252, .75); font-size: 12px; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
@media (max-width: 900px) { .content { min-height: auto; } .app-footer { padding: 12px 16px; } }
@media (max-aspect-ratio: 4/3), (max-width: 820px) { .login { align-self: start; } }
@media (max-height: 520px) and (min-aspect-ratio: 4/3) { .login { align-self: start; } }

/* ---------- tempo de atendimento ---------- */
.nowrap { white-space: nowrap; }
.time-total { font-size: 22px; font-weight: 700; color: var(--accent); }
#time-card h3 { margin: 0; }
#time-card { min-width: 0; overflow: hidden; }
#time-card > .row { flex-wrap: wrap; gap: 4px 12px; }
.time-form { display: flex; flex-wrap: wrap; gap: 0 8px; align-items: end; }
.time-form .field { flex: 0 0 90px; min-width: 0; }
.time-form .field:nth-child(3) { flex-basis: 150px; }
.time-form .field.grow { flex: 1 1 200px; }
.detail > .grid { min-width: 0; }
fieldset.bare { border: 0; padding: 0; margin: 0; min-width: 0; }
#tf.is-disabled .time-form, #tf.is-disabled button { opacity: .5; }
.time-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.time-list li { border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; background: var(--surface-2); }
.time-list .row { gap: 8px; flex-wrap: nowrap; }
.time-hm { gap: 8px; }
button.small-btn { padding: 2px 8px; font-size: 12px; }
.time-list b { white-space: nowrap; }

/* ---------- marca no menu: logotipo w2n | ITSM ---------- */
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 20px; }
.brand img { height: 30px; width: auto; display: block; }
.brand-sep { width: 1px; height: 30px; background: rgba(255, 255, 255, .4); }
.brand-itsm { color: #fff; font-size: 19px; font-weight: 300; letter-spacing: .28em; line-height: 1; }
@media (max-width: 900px) { .brand { padding: 8px 10px; } .brand img, .brand-sep { height: 24px; } .brand-itsm { font-size: 16px; } }

/* ---------- conteúdo sempre dentro dos quadros ---------- */
.grid > *, .card { min-width: 0; }
code { overflow-wrap: anywhere; word-break: break-word; }
.kv dd { min-width: 0; overflow-wrap: anywhere; }
.card h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.card p { overflow-wrap: anywhere; }
.endpoints { display: flex; flex-direction: column; gap: 10px; }
.endpoint-row { display: flex; align-items: flex-start; gap: 8px; margin-top: 2px; }
.endpoint-row code { flex: 1; min-width: 0; padding: 6px 8px; font-size: 12px; line-height: 1.4; }
.endpoint-row button { flex: 0 0 auto; }
/* caixas de seleção com texto longo: o texto quebra ao lado da caixa, nunca abaixo dela */
label.check { flex-wrap: nowrap; max-width: 100%; align-items: flex-start; }
label.check > input[type=checkbox] { margin-top: 2px; }

/* ---------- política de senha ---------- */
.pw-row { display: flex; gap: 8px; }
.pw-row input { flex: 1; min-width: 0; }
.pw-row .gen-pw { flex: 0 0 auto; white-space: nowrap; }
.pw-rules { list-style: none; padding: 0; margin: 6px 0 0; font-size: 12px; color: var(--muted); display: grid; gap: 2px; }
.pw-rules li::before { content: "○ "; }
.pw-rules li.ok { color: var(--ok); }
.pw-rules li.ok::before { content: "✓ "; }

/* ---------- fluxo de aprovação de mudança ---------- */
.sidebar .count { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: #f26b21; color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.badge.appr-draft { background: var(--surface-2); }
.badge.appr-pending, .badge.dec-pending { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge.appr-approved, .badge.dec-approved { background: #d1fae5; color: var(--ok); border-color: #a7f3d0; }
.badge.appr-rejected, .badge.dec-rejected { background: #fee2e2; color: var(--danger); border-color: #fecaca; }
.badge.dec-withdrawn { opacity: .6; }
#approval-card h3 { margin: 0; }
.lock-hint { background: var(--surface-2); border-radius: 6px; padding: 6px 8px; }
.badge.dec-covered { opacity: .7; }

/* ---------- pesquisa de ativos (lupa) ---------- */
.ci-search { position: relative; margin-bottom: 6px; }
.ci-search input { padding-left: 32px; }
.ci-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: .6; pointer-events: none; }
.ci-selected { margin: 6px 0 0; color: var(--muted); }
.ci-selected b { color: var(--text); font-weight: 600; }
.ci-src { display: none !important; }
.ci-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 6px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: 12px; }
.link-btn:disabled { color: var(--muted); cursor: default; opacity: .6; }
.ci-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.ci-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border); cursor: pointer; margin: 0; font-weight: 400; }
.ci-row:last-child { border-bottom: 0; }
.ci-row:hover { background: var(--surface-2); }
.ci-row.on { background: var(--accent-soft); }
.ci-row input { width: auto; margin: 0; flex: none; }
.ci-name { font-weight: 600; }
.ci-owner { font-size: 12px; overflow-wrap: anywhere; }
.ci-empty { padding: 8px 10px; font-size: 13px; }
.ci-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; margin: 2px 0; border-radius: 999px; background: var(--accent-soft); color: var(--text); font-weight: 600; }
.ci-chip button { background: none; border: 0; padding: 0 2px; cursor: pointer; color: var(--muted); font-size: 14px; line-height: 1; }
.ci-sep { padding: 4px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.del-box { border: 1px solid var(--danger, #dc2626); border-radius: 8px; padding: 10px 12px; background: var(--surface-2); }
.is-problem .prb-req::after { content: " *"; }
/* Relatórios */
.row.wrap { flex-wrap: wrap; gap: 8px; }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.rep-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); text-decoration: none; }
.rep-card:hover { border-color: var(--accent); }
.rep-card.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.rep-periods { margin: 6px 0 10px; }
.chip-btn { padding: 4px 12px; border-radius: 999px; font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); cursor: pointer; }
.chip-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.rep-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.rep-kpi { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.rep-kpi b { font-size: 18px; }
.rep-table { font-size: 12.5px; }
.rep-table td, .rep-table th { white-space: nowrap; }
.rep-table td.num, .rep-table th.num { text-align: right; }
.rep-table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 2px solid var(--border); }
.badge.warn { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.user-edit { padding: 6px 4px 10px; }
.user-edit h3 { margin-top: 0; }
.nowrap { white-space: nowrap; }
/* Fila de e-mails */
.mq-counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.mq-count { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); text-decoration: none; }
.mq-count span { font-size: 12px; color: var(--muted); }
.mq-count b { font-size: 20px; font-variant-numeric: tabular-nums; }
.mq-count:hover { border-color: var(--accent); }
.mq-count.active { border-color: var(--accent); background: var(--accent-soft); }
.mq-count.s-failed b { color: var(--danger); }
.mq-count.s-queued b, .mq-count.s-sending b { color: #b45309; }
.mq-table td { vertical-align: top; }
.mq-error { color: var(--danger); overflow-wrap: anywhere; max-width: 60ch; }
.mq-text { white-space: pre-wrap; font-size: 13px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 8px 0 0; max-height: 320px; overflow: auto; }
.head-actions { display: flex; align-items: flex-start; gap: 8px; }
.del-box.card { border-color: var(--danger); }
.readonly-code { background: var(--surface-2); color: var(--text); font-family: Consolas, monospace; cursor: not-allowed; }
/* Cronograma do projeto */
.sched-head h3 { margin: 0; }
.sched-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 12px 0 6px; }
.sched-kpis > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.sched-kpis b { font-size: 17px; font-variant-numeric: tabular-nums; }
.sched-kpis .bar { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; margin-top: 4px; }
.sched-kpis .bar i { display: block; height: 100%; background: var(--accent); }
.sched-stage { border: 1px solid var(--border); border-radius: 10px; margin-top: 12px; overflow: hidden; }
.stage-head { padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); gap: 6px 10px; }
.stage-title { font-size: 15px; }
.sched-table { font-size: 13.5px; }
.sched-table td, .sched-table th { vertical-align: middle; }
.sched-table td.num, .sched-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.exec-input { width: 90px; text-align: right; padding: 4px 6px; }
.sched-form { gap: 8px; }
.sched-form input[name=description] { flex: 3 1 260px; }
.sched-form select { flex: 2 1 180px; }
.sched-form input[name=planned_hours] { flex: 0 1 140px; }
th.sortable a { color: inherit; text-decoration: none; white-space: nowrap; }
th.sortable a:hover { color: var(--accent); }
th.sortable.sorted a { color: var(--accent); }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Importação de projeto por planilha */
.imp-card h3 { margin: 0; }
.imp-errors { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--danger, #dc2626); border-radius: 10px; background: color-mix(in srgb, var(--danger, #dc2626) 8%, transparent); }
.imp-errors ul { margin: 8px 0 4px 18px; max-height: 320px; overflow: auto; }
.imp-errors li { margin: 2px 0; font-size: 13px; }
.imp-ok { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--ok, #16a34a); border-radius: 10px; background: color-mix(in srgb, var(--ok, #16a34a) 7%, transparent); }

.mfa-note { padding: 8px 10px; border-left: 3px solid #ED6B21; background: color-mix(in srgb, #ED6B21 9%, transparent); border-radius: 6px; }

/* Relatórios: linha de resumo do grupo (ex.: projeto) */
.rep-table tr.rep-group td { font-weight: 600; background: color-mix(in srgb, #375EA8 12%, transparent); border-top: 1px solid #375EA8; }
.sched-table input.real-start { width: 140px; padding: 4px 6px; }
.sched-kpis > div .small { line-height: 1.3; }
.sched-table input.plan-start { width: 140px; padding: 4px 6px; }
.sched-table input.plan-start.fixed { border-color: #ED6B21; box-shadow: inset 3px 0 0 #ED6B21; }
.fix-mark { margin-left: 4px; font-size: 12px; }
.rep-projects .rp-list { max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; margin-top: 6px; }
.rep-projects .rp-list label { padding: 3px 0; align-items: flex-start; }
.rep-projects input[type=search] { min-width: 320px; flex: 1; }

/* Tabelas com ordenação e filtro por coluna */
th.sortable-th { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable-th:hover { color: var(--primary, #2563eb); }
th.sortable-th::after { content: " ↕"; opacity: .35; font-size: 11px; }
th.sortable-th.sorted[data-dir="asc"]::after { content: " ▲"; opacity: 1; }
th.sortable-th.sorted[data-dir="desc"]::after { content: " ▼"; opacity: 1; }
tr.col-filters th { padding-top: 4px; padding-bottom: 6px; font-weight: normal; }
tr.col-filters input, tr.col-filters select { width: 100%; min-width: 70px; padding: 4px 6px; font-size: 12px; }
.table-tools-info { margin: 0 0 6px; }
