/* Gestão Social – estilos */
:root {
  --bg: #f4f6f5; --surface: #ffffff; --surface-2: #f8faf9; --border: #e2e8e5; --text: #1c2a25; --muted: #66756f;
  --primary: #0f7b5f; --primary-600: #0b664e; --primary-50: #e6f4ef; --accent: #f2a541;
  --danger: #c93b3b; --danger-50: #fdecec; --warn: #b9770e; --warn-50: #fff5e0; --info: #2563eb; --info-50: #e8effd; --ok: #15803d; --ok-50: #e7f6ec;
  --sidebar: #0d2a22; --sidebar-text: #c9ddd5; --sidebar-active: #174a3b;
  --c-red: #dc4a4a; --c-orange: #e58a2f; --c-green: #1f9d6b; --c-blue: #3b7ddd; --c-purple: #8b5cd6; --c-teal: #1a9aa8; --c-gray: #8a958f;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1513; --surface: #161e1b; --surface-2: #1b2521; --border: #2a3632; --text: #e3ece8; --muted: #93a39c;
    --primary: #2fb38a; --primary-600: #27a07b; --primary-50: #173a2f; --danger-50: #3a1d1d; --warn-50: #3a2d14; --info-50: #18264a; --ok-50: #16331f;
    --sidebar: #0a110e; --sidebar-active: #173a2f; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1513; --surface: #161e1b; --surface-2: #1b2521; --border: #2a3632; --text: #e3ece8; --muted: #93a39c;
  --primary: #2fb38a; --primary-600: #27a07b; --primary-50: #173a2f; --danger-50: #3a1d1d; --warn-50: #3a2d14; --info-50: #18264a; --ok-50: #16331f;
  --sidebar: #0a110e; --sidebar-active: #173a2f; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.45; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.hidden { display: none !important; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* ---------- layout */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-text); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 14px 10px 30px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px; color: #fff; font-weight: 700; font-size: 16px; }
.brand-logo { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #2fb38a, #f2a541); display: grid; place-items: center; font-size: 18px; }
.brand small { display: block; font-weight: 400; font-size: 11px; color: var(--sidebar-text); opacity: .8; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-group { margin-top: 14px; }
.nav-group > span { display: block; text-transform: uppercase; font-size: 10.5px; letter-spacing: .08em; opacity: .6; padding: 4px 12px; }
.nav a { display: flex; align-items: center; gap: 10px; color: var(--sidebar-text); padding: 7px 12px; border-radius: 8px; font-size: 13.5px; }
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav a.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.nav svg { width: 17px; height: 17px; flex: none; opacity: .9; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar .search { flex: 1; max-width: 520px; position: relative; }
.topbar .search input { width: 100%; padding-left: 34px; }
.topbar .search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.icon-btn { position: relative; background: none; border: 1px solid transparent; border-radius: 8px; padding: 6px; cursor: pointer; color: var(--text); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); }
.icon-btn svg { width: 19px; height: 19px; }
.badge-count { position: absolute; top: -3px; right: -3px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; border-radius: 9px; padding: 1px 5px; min-width: 16px; text-align: center; }
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.user-chip:hover { background: var(--surface-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.content { padding: 22px 24px 60px; max-width: 1500px; width: 100%; }
.menu-toggle { display: none; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 3px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- elementos */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 16px 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; }
.card-body { padding: 14px 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none !important; line-height: 1.3; }
.btn:hover { background: var(--surface-2); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-600); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-50); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; margin: 0; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }
.btn-group .btn.active { background: var(--primary-50); color: var(--primary); border-color: var(--primary); z-index: 1; }

input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus, [contenteditable]:focus { outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); border-color: var(--primary); }
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
label { display: block; font-weight: 500; font-size: 12.5px; color: var(--muted); }
label > input, label > select, label > textarea, label > .tags-input, label > .input-group { margin-top: 4px; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid .col2 { grid-column: span 2; }
.field-error { color: var(--danger); font-size: 12px; margin-top: 3px; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.input-group { display: flex; gap: 6px; }
.req::after { content: ' *'; color: var(--danger); }

.tags-input { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; border: 1px solid var(--border); border-radius: 8px; padding: 4px 6px; background: var(--surface); min-height: 36px; cursor: text; }
.tags-input input { border: 0; padding: 3px; flex: 1; min-width: 120px; outline: none !important; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--primary-50); color: var(--primary); border-radius: 20px; padding: 2px 9px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.chip button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; font-size: 14px; line-height: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip.gray { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

.pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.pill.red { background: var(--danger-50); color: var(--danger); border-color: transparent; }
.pill.orange { background: var(--warn-50); color: var(--warn); border-color: transparent; }
.pill.green { background: var(--ok-50); color: var(--ok); border-color: transparent; }
.pill.blue { background: var(--info-50); color: var(--info); border-color: transparent; }
.pill.purple { background: color-mix(in srgb, var(--c-purple) 15%, transparent); color: var(--c-purple); border-color: transparent; }
.pill.teal { background: color-mix(in srgb, var(--c-teal) 15%, transparent); color: var(--c-teal); border-color: transparent; }

.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; border: 1px solid transparent; }
.alert.erro { background: var(--danger-50); color: var(--danger); }
.alert.aviso { background: var(--warn-50); color: var(--warn); }
.alert.info { background: var(--info-50); color: var(--info); }
.alert.ok { background: var(--ok-50); color: var(--ok); }

/* ---------- tabelas */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sorted { color: var(--primary); }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover td { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }
.table tfoot td, .table tfoot th { font-weight: 700; background: var(--surface-2); }
.table.compact td, .table.compact th { padding: 6px 10px; }
.table .row-actions { white-space: nowrap; text-align: right; }
.cell-title { font-weight: 600; max-width: 420px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty svg { width: 38px; height: 38px; opacity: .5; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; gap: 8px; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); align-items: center; }
.filters input[type=search] { max-width: 280px; }
.filters select { width: auto; max-width: 200px; }

/* ---------- kanban */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.kcol { flex: 0 0 280px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 210px); }
.kcol-head { padding: 10px 12px; font-weight: 600; display: flex; justify-content: space-between; gap: 6px; border-bottom: 1px solid var(--border); }
.kcol-head small { color: var(--muted); font-weight: 500; }
.kcol-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 60px; }
.kcol.drop { outline: 2px dashed var(--primary); }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; cursor: grab; box-shadow: var(--shadow); }
.kcard:hover { border-color: var(--primary); }
.kcard.dragging { opacity: .5; }
.kcard .kt { font-weight: 600; margin-bottom: 4px; }
.kcard .km { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }

/* ---------- modal / drawer */
.overlay { position: fixed; inset: 0; background: rgba(10, 20, 16, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 760px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 1100px; } .modal.narrow { max-width: 460px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 16px 18px; max-height: 72vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.drawer-overlay { position: fixed; inset: 0; background: rgba(10, 20, 16, .35); z-index: 90; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100%); background: var(--surface); z-index: 91; display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,.18); animation: slidein .18s ease-out; }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.drawer-head h2 { margin: 0; font-size: 18px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 0 18px 30px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; position: sticky; top: 0; background: var(--surface); z-index: 2; }
.page .tabs { background: transparent; position: static; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 13px; font: inherit; color: var(--muted); cursor: pointer; white-space: nowrap; font-weight: 500; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs button .n { background: var(--surface-2); border-radius: 10px; padding: 0 6px; font-size: 11px; margin-left: 4px; }

dl.props { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin: 0; }
dl.props > div.col2 { grid-column: span 2; }
dl.props dt { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
dl.props dd { margin: 0; white-space: pre-wrap; word-break: break-word; }

.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text); color: var(--surface); padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); max-width: 380px; animation: slidein .2s; }
.toast.erro { background: var(--danger); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }

.dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.15); min-width: 220px; z-index: 50; padding: 6px; }
.dropdown a, .dropdown button { display: flex; width: 100%; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 6px; color: var(--text); background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); text-decoration: none; }
.notif-list { width: 380px; max-height: 420px; overflow-y: auto; }
.notif { display: flex; gap: 8px; padding: 8px 10px; border-radius: 6px; font-size: 13px; }
.notif .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.dot.erro { background: var(--danger); } .dot.aviso { background: var(--accent); } .dot.info { background: var(--info); }

/* ---------- painel */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 14px 16px; }
.kpi .k-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi .k-value { font-size: 23px; font-weight: 700; margin-top: 4px; letter-spacing: -.01em; }
.kpi .k-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
a.kpi:hover { text-decoration: none; border-color: var(--primary); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-box { flex: none; width: 44px; text-align: center; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); padding: 3px 0; line-height: 1.1; }
.date-box b { display: block; font-size: 16px; } .date-box span { font-size: 10px; text-transform: uppercase; color: var(--muted); }

.progress { height: 8px; background: var(--surface-2); border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.progress > div { height: 100%; background: var(--primary); border-radius: 6px; }
.progress.warn > div { background: var(--accent); } .progress.danger > div { background: var(--danger); }
.prog-row { display: grid; grid-template-columns: 150px 1fr 50px; gap: 10px; align-items: center; margin: 8px 0; font-size: 13px; }

/* gráficos */
.chart { width: 100%; }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .bar { fill: var(--primary); }
.chart .bar.b2 { fill: var(--accent); }
.chart .grid-line { stroke: var(--border); }
.hbars .hb { display: grid; grid-template-columns: minmax(90px, 200px) 1fr auto; gap: 10px; align-items: center; margin: 6px 0; font-size: 13px; }
.hbars .hb .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbars .hb .track { height: 14px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.hbars .hb .fill { height: 100%; background: var(--primary); border-radius: 4px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* editais */
.edital-card { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.edital-card:hover { background: var(--surface-2); }
.edital-card:last-child { border-bottom: 0; }
.score { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 16px;
  background: conic-gradient(var(--sc) calc(var(--v) * 1%), var(--surface-2) 0); position: relative; }
.score::before { content: ''; position: absolute; inset: 5px; background: var(--surface); border-radius: 50%; }
.score span { position: relative; }
.score small { position: relative; display: block; font-size: 8px; font-weight: 600; color: var(--muted); text-align: center; margin-top: -2px; }
.edital-card h3 { margin: 0 0 3px; font-size: 15px; }
.edital-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 12.5px; margin: 4px 0 6px; }
.edital-side { text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.star { background: none; border: 0; cursor: pointer; font-size: 20px; color: var(--border); line-height: 1; padding: 0; }
.star.on { color: var(--accent); }
.motivos { font-size: 12px; color: var(--muted); }
.side-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.side-layout .filters-panel { position: sticky; top: 70px; }
.filters-panel .card-body > label { margin-bottom: 10px; }

/* agenda */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.cal .dow { padding: 6px 8px; font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 600; background: var(--surface-2); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cal .day { min-height: 110px; padding: 4px 5px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 12px; overflow: hidden; }
.cal .day.out { background: var(--surface-2); color: var(--muted); }
.cal .day.today .dn { background: var(--primary); color: #fff; border-radius: 50%; }
.cal .dn { display: inline-grid; place-items: center; width: 22px; height: 22px; font-weight: 600; margin-bottom: 2px; }
.ev { display: block; padding: 1px 5px; border-radius: 4px; margin: 1px 0; font-size: 11px; color: #fff !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none !important; }
.ev.red { background: var(--c-red); } .ev.orange { background: var(--c-orange); } .ev.green { background: var(--c-green); } .ev.blue { background: var(--c-blue); }
.ev.purple { background: var(--c-purple); } .ev.teal { background: var(--c-teal); } .ev.gray { background: var(--c-gray); }

/* gantt */
.gantt { overflow-x: auto; }
.gantt-row { display: grid; grid-template-columns: 240px 1fr; align-items: center; border-bottom: 1px solid var(--border); min-height: 34px; }
.gantt-row .gl { padding: 6px 10px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.gantt-track { position: relative; height: 34px; }
.gantt-bar { position: absolute; top: 8px; height: 18px; border-radius: 5px; background: color-mix(in srgb, var(--primary) 30%, transparent); overflow: hidden; cursor: pointer; }
.gantt-bar > div { height: 100%; background: var(--primary); }
.gantt-bar.late { background: color-mix(in srgb, var(--danger) 30%, transparent); }
.gantt-bar.late > div { background: var(--danger); }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 1; }
.gantt-months { display: grid; grid-template-columns: 240px 1fr; font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--border); }
.gantt-months .gm { position: relative; height: 24px; }
.gantt-months .gm span { position: absolute; top: 5px; border-left: 1px solid var(--border); padding-left: 4px; height: 19px; }

/* projeto */
.proj-head { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 18px; }
.proj-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--border); }
.proj-stats > div { padding: 12px 18px; border-right: 1px solid var(--border); }
.proj-stats > div:last-child { border-right: 0; }

/* documento */
.doc-layout { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.doc-toolbar { position: sticky; top: 56px; z-index: 5; display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; box-shadow: var(--shadow); }
.doc-toolbar button, .doc-toolbar select { background: none; border: 1px solid transparent; border-radius: 6px; padding: 5px 8px; cursor: pointer; font: inherit; color: var(--text); min-width: 32px; width: auto; }
.doc-toolbar button:hover { background: var(--surface-2); border-color: var(--border); }
.doc-toolbar .sep { width: 1px; background: var(--border); margin: 3px 4px; }
.doc-page-wrap { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 28px 16px; overflow-x: auto; }
.doc-page { background: #fff; color: #1a1a1a; width: 100%; max-width: 820px; min-height: 1060px; margin: 0 auto; padding: 64px 72px; box-shadow: 0 4px 24px rgba(0,0,0,.12);
  font-family: Arial, Helvetica, sans-serif; font-size: 11.5pt; line-height: 1.55; }
.doc-page:focus { outline: none; }
.doc-page h1 { font-size: 17pt; } .doc-page h2 { font-size: 13pt; margin-top: 1.2em; } .doc-page h3 { font-size: 12pt; }
.doc-page table, .doc-table { border-collapse: collapse; width: 100%; margin: 8px 0 14px; }
.doc-page td, .doc-page th, .doc-table td, .doc-table th { border: 1px solid #666; padding: 5px 7px; font-size: 10pt; text-align: left; vertical-align: top; }
.doc-page th, .doc-table th { background: #eef2f0; }
.doc-page mark { background: #fff3a8; }
.doc-page .var { background: #e1f3ec; color: #0b664e; border-radius: 3px; padding: 0 2px; }
.var-list { max-height: 340px; overflow-y: auto; }
.var-list button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 4px 6px; border-radius: 5px; cursor: pointer; font: inherit; font-size: 12.5px; color: var(--text); }
.var-list button:hover { background: var(--primary-50); }
.var-list code { font-size: 11px; color: var(--muted); background: none; padding: 0; }
.var-list h4 { font-size: 11px; text-transform: uppercase; color: var(--muted); margin: 10px 6px 4px; }
.dirty-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 6px; }

/* timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; border-left: 2px solid var(--border); margin-left: 6px; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 2px solid var(--surface); }
.timeline .tm { font-size: 12px; color: var(--muted); }

/* login / instalação */
.login, .install { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, var(--primary-50), var(--bg) 60%); }
.login-card, .install-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.08); }
.install-card { max-width: 680px; }
.login-card h1, .install-card h1 { display: flex; gap: 10px; align-items: center; }
.install-card h1 small { font-weight: 400; color: var(--muted); font-size: 14px; }
.login-card form > * + * { margin-top: 12px; }
ul.req { list-style: none; padding: 0; columns: 2; font-size: 13px; }
ul.req li.ok { color: var(--ok); } ul.req li.erro { color: var(--danger); font-weight: 600; }

.spinner { width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- responsivo */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-layout, .side-layout { grid-template-columns: 1fr; }
  .side-layout .filters-panel { position: static; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; z-index: 95; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 10px 0 40px rgba(0,0,0,.3); }
  .menu-toggle { display: inline-grid; }
  .content { padding: 16px 16px 60px; }
  .topbar { padding: 8px 16px; }
  .g2, .g3, .g4, .form-grid, dl.props { grid-template-columns: 1fr; }
  .span2, .form-grid .col2, dl.props > div.col2 { grid-column: auto; }
  .proj-stats { grid-template-columns: repeat(2, 1fr); }
  .doc-page { padding: 32px 24px; min-height: 600px; }
  .edital-card { grid-template-columns: 56px 1fr; }
  .edital-side { grid-column: span 2; flex-direction: row; justify-content: space-between; align-items: center; }
  .notif-list { width: 300px; }
  .user-chip .uname { display: none; }
  .cal .day { min-height: 70px; }
  .gantt-row, .gantt-months { grid-template-columns: 130px 1fr; }
}

/* ---------- impressão */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .no-print, .doc-toolbar, .tabs, .actions, .toasts { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; }
  .doc-layout { display: block; }
  .doc-layout > aside { display: none; }
  .doc-page-wrap { padding: 0; border: 0; background: #fff; }
  .doc-page { box-shadow: none; padding: 0; max-width: none; min-height: 0; }
  .doc-page .var, .doc-page mark { background: none; color: inherit; }
}
