:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #6b7482;
  --line: #e2e5ea;
  --brand: #123a5e;
  --brand-2: #1d5b8f;
  --accent: #e8f0f8;
  --ok-bg: #e7f5ec; --ok: #1d6b3a;
  --err-bg: #fdecec; --err: #a3262a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand-2); }
h1 { font-size: 1.6rem; margin: .2em 0 .4em; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 1.2em 0 .6em; }
h3 { font-size: 1rem; margin: 0 0 .5em; }
.card > h2:first-child { margin-top: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 40px; min-height: 70vh; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
code { background: var(--accent); padding: 1px 5px; border-radius: 4px; }

/* Topo */
.topbar { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 10; }
.topbar-in { display: flex; align-items: center; gap: 8px 16px; min-height: 58px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; margin-right: auto; flex: 1 1 auto; min-width: 0; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: #d6e2ee; text-decoration: none; padding: 7px 9px; border-radius: 8px; font-size: .88rem; }
.nav a:hover, .nav a.on { background: rgba(255,255,255,.13); color: #fff; }
.menu-btn { display: none; background: none; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; }
@media (max-width: 1060px) {
  .brand { font-size: .95rem; flex-basis: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .menu-btn { display: block; }
  .nav { display: none; width: 100%; flex-direction: column; padding-bottom: 10px; }
  body.nav-open .nav { display: flex; }
}
.foot { color: var(--muted); font-size: .8rem; padding-bottom: 24px; }

/* Blocos */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.narrow { max-width: 460px; margin: 24px auto; }
.login { margin-top: 8vh !important; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 32px; text-align: center; color: var(--muted); margin-bottom: 16px; }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.erro { background: var(--err-bg); color: var(--err); }
.alert pre.copy { background: #fff; color: var(--text); padding: 12px; border-radius: 8px; white-space: pre-wrap; margin: 10px 0; font-size: .9rem; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cols > .card { margin-bottom: 0; }
.cols + * { margin-top: 16px; }
@media (max-width: 820px) { .cols { grid-template-columns: 1fr; } }
.crumb { margin: 0 0 8px; font-size: .9rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin-bottom: 0; }
.search input { min-width: 260px; }

/* Botões */
.btn { display: inline-block; background: var(--brand-2); color: #fff; border: 1px solid var(--brand-2); border-radius: 9px; padding: 10px 18px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; }
.btn:hover { background: var(--brand); border-color: var(--brand); }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.btn.ghost { background: transparent; color: var(--brand-2); }
.btn.ghost:hover { background: var(--accent); }
.btn.danger { background: #fff; color: var(--err); border-color: #e6b3b5; }
.btn.danger:hover { background: var(--err-bg); }
.btn.full, .form > .btn.full { width: 100%; align-self: stretch; }
.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #eceef2; color: var(--muted); vertical-align: middle; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }

/* Formulários */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-weight: 500; font-size: .9rem; }
.form > .btn { align-self: flex-start; }
.form.inline { flex-direction: row; align-items: flex-end; flex-wrap: wrap; }
.form.inline label { flex: 1 1 200px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > label { flex: 1 1 200px; }
.row > label.short, label.short { flex: 0 0 110px; }
input, select, textarea { font: inherit; padding: 9px 11px; border: 1px solid #cfd4db; border-radius: 8px; background: #fff; color: var(--text); width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; }
input[type=file] { padding: 7px; }
input.short { width: 90px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc3e6; border-color: var(--brand-2); }
label.check { flex-direction: row !important; align-items: center; gap: 8px; font-weight: 500; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label { flex-direction: row; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; cursor: pointer; }
.filter { max-width: 280px; margin-bottom: 12px; }
.inline-form { display: inline; }
.capa-prev { display: flex; align-items: center; gap: 12px; }
.capa-prev img { width: 120px; height: 72px; object-fit: cover; border-radius: 8px; }

/* Tabelas */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
.table tr.off td { opacity: .55; }
.table td form { margin: 0; }
.matrix th.c, .matrix td.c { text-align: center; }
.matrix th.c span { display: inline-block; max-width: 96px; text-transform: none; letter-spacing: 0; font-size: .75rem; line-height: 1.25; }
.matrix input[type=checkbox] { width: 18px; height: 18px; }
.matrix tbody tr:hover { background: #fafbfc; }
.list { margin: 0 0 12px; padding-left: 18px; }

/* Lista de empreendimentos */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.emp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.emp-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16,24,40,.1); }
.emp-cover { aspect-ratio: 16/10; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: flex; align-items: center; justify-content: center; position: relative; }
.emp-cover img { width: 100%; height: 100%; object-fit: cover; }
.emp-cover span { color: rgba(255,255,255,.85); font-size: 3rem; font-weight: 700; }
.emp-cover .tag { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.6); color: #fff; font-style: normal; font-size: .75rem; padding: 2px 8px; border-radius: 99px; }
.emp-body { padding: 12px 14px 14px; display: flex; flex-direction: column; }

/* Página do empreendimento */
.emp-hero { display: flex; gap: 20px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.emp-hero img { width: 260px; max-width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--radius); }
.emp-hero h1 { margin-bottom: 0; }
.prose { white-space: normal; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 8px; position: sticky; top: 58px; background: var(--bg); padding: 8px 0; z-index: 5; }
.chips a { background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; text-decoration: none; font-size: .88rem; color: var(--text); }
.chips a:hover { border-color: var(--brand-2); color: var(--brand-2); }
.cat { scroll-margin-top: 120px; margin-bottom: 8px; }
.cat > h2 { border-bottom: 2px solid var(--line); padding-bottom: 6px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.gallery figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.gallery figcaption { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; font-size: .8rem; }
.gallery figcaption span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video { position: relative; aspect-ratio: 16/9; background: #000; border-radius: 10px; overflow: hidden; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.file-row { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.ficon { flex: 0 0 46px; height: 46px; border-radius: 8px; background: var(--accent); color: var(--brand); font-weight: 700; font-size: .75rem; display: flex; align-items: center; justify-content: center; }
.fmeta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fmeta strong { overflow-wrap: anywhere; }
.factions { display: flex; gap: 6px; }
@media (max-width: 560px) {
  .file-row { flex-wrap: wrap; }
  .factions { width: 100%; }
  .factions .btn { flex: 1; text-align: center; }
  .search input { min-width: 0; }
  .search { width: 100%; }
}

/* Admin: materiais */
details.mat { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
details.mat > summary { padding: 10px 12px; cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
details.mat[open] > summary { border-bottom: 1px solid var(--line); }
details.mat .form { padding: 12px; }
details.mat .del { padding: 0 12px 12px; }
details.card > summary { cursor: pointer; }
details.card[open] > summary { margin-bottom: 14px; }
.danger-zone summary, .danger-zone h2 { color: var(--err); }

/* ---------- Intranet ---------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: -8px 0 20px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.tabs a { text-decoration: none; color: var(--muted); font-size: .88rem; padding: 6px 11px; border-radius: 8px; }
.tabs a:hover { background: #e9ecf0; color: var(--text); }
.tabs a.on { background: var(--brand); color: #fff; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 12px; }
.card-head h2 { margin: 0; }
.card-head > a { font-size: .88rem; }
h2 + .grid, .card-head + .grid { margin-top: 4px; }
.pill.pin { background: #fff3d6; color: #8a5a00; }
.pill.warn { background: #fdecec; color: var(--err); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
fieldset.vis { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 12px; margin: 0; }
fieldset.vis legend { font-weight: 600; font-size: .85rem; padding: 0 6px; }
.vis-groups { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }

/* Atalhos */
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.quick-link { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-decoration: none; color: var(--text); font-weight: 500; font-size: .9rem; box-shadow: var(--shadow); }
.quick-link:hover { border-color: var(--brand-2); }
.ql-ico { flex: 0 0 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 700; }

/* Painel */
.dash { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; margin-bottom: 8px; }
.dash > .card { margin-bottom: 0; }
@media (max-width: 820px) { .dash { grid-template-columns: 1fr; } }
.dash + .card-head { margin-top: 24px; }
.aviso-item { display: block; text-decoration: none; color: var(--text); padding: 10px 0; border-top: 1px solid var(--line); }
.aviso-item:first-of-type { border-top: 0; padding-top: 0; }
.aviso-item:hover strong { color: var(--brand-2); }
.ai-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.aviso-card { display: block; text-decoration: none; color: var(--text); }
.aviso-card h2 { margin: 6px 0 4px; }
.aviso-card p { margin: 0; }
.aviso-card:hover { border-color: var(--brand-2); }
.aviso h1 { margin-top: 0; }
.aviso .prose { margin-bottom: 16px; }
.aviso-img { max-width: 100%; border-radius: 10px; }
.ev-item { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.ev-item:first-of-type { border-top: 0; padding-top: 0; }
.ev-item > div:last-child { display: flex; flex-direction: column; }
.ev-date { flex: 0 0 48px; height: 50px; border-radius: 10px; background: var(--accent); color: var(--brand); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.ev-date span { font-size: 1.2rem; font-weight: 700; }
.ev-date small { font-size: .7rem; text-transform: uppercase; }

/* Agenda */
.month-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.month-nav strong { min-width: 150px; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-h { text-align: center; font-size: .75rem; color: var(--muted); font-weight: 600; padding: 4px 0; }
.cal-d { height: 54px; border-radius: 8px; background: #f7f8fa; display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: var(--text); font-size: .9rem; position: relative; }
.cal-d.blank { background: none; }
.cal-d.has { background: var(--accent); color: var(--brand); font-weight: 600; cursor: pointer; }
.cal-d.today { outline: 2px solid var(--brand-2); }
.cal-d i { font-style: normal; font-size: .65rem; background: var(--brand-2); color: #fff; border-radius: 99px; padding: 0 6px; margin-top: 2px; }
.dia { scroll-margin-top: 80px; }
.dia h3 { margin: 20px 0 8px; font-size: .95rem; color: var(--muted); }
.dia h3.today { color: var(--brand-2); }
.ev-row { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand-2); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.ev-row > div:nth-child(2) { flex: 1; }
.ev-time { flex: 0 0 90px; font-weight: 600; font-size: .9rem; color: var(--brand); }

/* Equipe */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 8px; }
.person { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.avatar { flex: 0 0 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 700; font-size: 1.3rem; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.pinfo { display: flex; flex-direction: column; min-width: 0; }
.pactions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* Admin painel */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; box-shadow: var(--shadow); }
.stat strong { font-size: 1.6rem; color: var(--brand); }
.stat span { font-size: .85rem; color: var(--muted); }
.actions-list { display: flex; flex-wrap: wrap; gap: 8px; }
