/* Plataforma Portside — terracota e tons pastéis (herdado do DESIGN.md da Máquina de Conteúdo) */
:root {
  --bg: #f6f7f9; --surface: #fff; --text: #2b2f34; --muted: #666d75; --line: #dde3ea;
  --accent: #2a466b; --accent-h: #203858; --accent-bg: #dfe9f5;
  --idea: #f8efda; --idea-t: #846523; --prod: #eee9f5; --prod-t: #6d5686;
  --rev: #dfe9f5; --rev-t: #253d5d; --ready: #e8eee4; --ready-t: #426246; --pub: #e6eef3; --pub-t: #36586e;
  --danger: #1f406b; --radius: 14px;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text); background: var(--bg); font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; }
h1 { font-size: 29px; margin: 0 0 4px; } h2 { font-size: 17px; margin: 0 0 12px; } h3 { font-size: 15px; margin: 0 0 8px; }
a { color: var(--accent); }
.muted { color: var(--muted); } .small, small { font-size: 12px; } .grow { flex: 1; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; z-index: 99; background: #fff; padding: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: #fff; padding: 8px 14px; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.primary:hover:not(:disabled) { background: var(--accent-h); }
button.ghost { background: transparent; } button.ghost:hover { background: var(--accent-bg); }
button.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
button.danger.ghost { background: transparent; color: var(--danger); border-color: #ccdbef; }
button.icon { border: 0; background: transparent; font-size: 18px; padding: 4px 8px; }
button.small { padding: 4px 10px; font-size: 12px; }
button.full { width: 100%; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; }
input[type=color] { padding: 2px; height: 36px; } input[type=checkbox], input[type=radio] { width: auto; }
.field { display: grid; gap: 4px; margin-bottom: 12px; } .field > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { color: var(--danger); min-height: 1em; margin: 4px 0; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 12px; } legend { font-size: 12px; color: var(--muted); font-weight: 600; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-top: 6px; } .checks label, .picker > label { display: flex; gap: 6px; align-items: center; }
.checks.off { opacity: .4; pointer-events: none; }
.switch { appearance: none; width: 36px; height: 20px; border-radius: 20px; background: #c8cfd8; position: relative; cursor: pointer; vertical-align: middle; transition: .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .15s; }
.switch:checked { background: var(--accent); } .switch:checked::after { left: 18px; }
label.inline { display: flex; gap: 10px; align-items: center; }

/* acesso */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.auth-card { width: min(420px, 100%); } .auth-card h1 { font-size: 22px; margin-top: 16px; }
.brand { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; }

/* casca */
.layout { display: grid; grid-template-columns: 238px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; flex: 1; align-content: start; }
.side a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.side a:hover { background: var(--bg); } .side a.active { background: var(--accent-bg); color: var(--accent-h); font-weight: 600; }
.ni { width: 18px; text-align: center; color: var(--muted); } .active .ni { color: var(--accent); }
.me { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; border-top: 1px solid var(--line); padding-top: 14px; }
.me small { display: block; color: var(--muted); } .me button { grid-column: 1 / -1; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-bg); color: var(--accent-h); display: grid; place-items: center; font-weight: 700; }
.body { min-width: 0; }
.top { height: 64px; display: flex; gap: 12px; align-items: center; padding: 0 38px; border-bottom: 1px solid var(--line); background: var(--surface); }
.top select { width: auto; min-width: 220px; }
.menu-btn { display: none; }
.warn-pill { background: var(--idea); color: var(--idea-t); padding: 5px 12px; border-radius: 20px; text-decoration: none; font-size: 12px; font-weight: 600; }
main { padding: 30px 38px 60px; outline: none; }
.page-head { display: flex; gap: 16px; justify-content: space-between; align-items: flex-end; margin-bottom: 22px; flex-wrap: wrap; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); }
h2.section { margin-top: 26px; }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; background: var(--accent-bg); color: var(--accent-h); }
.c-lavanda { background: var(--prod); color: var(--prod-t); } .c-salvia { background: var(--ready); color: var(--ready-t); }
.c-manteiga { background: var(--idea); color: var(--idea-t); } .c-azul { background: var(--pub); color: var(--pub-t); }
.c-rosa { background: #f7e4ec; color: #8d3d5d; } .c-grafite { background: #e5e8eb; color: #45494f; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #e5e8eb; }
.tag.ok { background: var(--ready); color: var(--ready-t); } .tag.warn { background: var(--idea); color: var(--idea-t); }
table { width: 100%; border-collapse: collapse; } th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; } tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
code { background: var(--bg); padding: 2px 6px; border-radius: 6px; }
code.secret { font-size: 16px; letter-spacing: .08em; display: inline-block; padding: 8px 12px; user-select: all; }
.twofa ol { padding-left: 20px; line-height: 1.8; } .twofa li.plain { list-style: none; }
form.narrow { max-width: 420px; }

/* visão geral */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; }
.kpi { padding: 16px 20px; border-right: 1px solid var(--line); } .kpi:last-child { border: 0; }
.kpi span { display: block; font-size: 12px; color: var(--muted); } .kpi strong { font-size: 28px; font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.row { display: flex; gap: 10px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.row:last-child { border: 0; } .row:hover { background: var(--bg); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.s-idea { background: var(--idea-t); } .dot.s-production { background: var(--prod-t); } .dot.s-review { background: var(--rev-t); } .dot.s-ready { background: var(--ready-t); } .dot.s-published { background: var(--pub-t); }
.agent-mini { width: 26px; height: 26px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.tag.st-trabalhando { background: var(--ready); color: var(--ready-t); } .tag.st-revisao { background: var(--prod); color: var(--prod-t); }
.tag.st-bloqueado { background: #dae5f4; color: var(--danger); } .tag.st-ocioso { background: var(--idea); color: var(--idea-t); }

/* conteúdos */
.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { border-radius: var(--radius); padding: 12px; min-height: 300px; transition: box-shadow .1s; }
.col.over { box-shadow: inset 0 0 0 2px var(--accent); }
.col h2 { font-size: 13px; display: flex; justify-content: space-between; }
.count { background: rgba(255,255,255,.7); border-radius: 10px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.col.s-idea { background: var(--idea); } .col.s-production { background: var(--prod); } .col.s-review { background: var(--rev); } .col.s-ready { background: var(--ready); } .col.s-published { background: var(--pub); }
.card-item { background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 8px; cursor: pointer; border: 1px solid rgba(0,0,0,.04); }
.card-item:hover { border-color: var(--accent); }
.card-item strong { display: block; margin-bottom: 8px; line-height: 1.3; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11px; color: var(--muted); align-items: center; }

/* empresas */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.company { display: flex; gap: 14px; align-items: flex-start; margin: 0; } .company h2 { margin: 0; } .company p { margin: 4px 0; }
.badge { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; flex: none; }

/* escritório */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; }
.tabs a { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--text); white-space: nowrap; }
.tabs a small { display: block; color: var(--muted); font-size: 11px; }
.tabs a.active { border-color: var(--accent); background: var(--accent-bg); }
.office-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.stage { overflow: auto; padding: 4px; }
.editor { display: grid; grid-template-columns: 210px 1fr 230px; gap: 14px; align-items: start; }
.palette, .inspector { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; position: sticky; top: 10px; }
.pal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.pal { display: grid; gap: 2px; justify-items: center; padding: 8px 4px; font-size: 11px; }
.pal { border-radius: 8px !important; box-shadow: none !important; }
.pal .ic { font-size: 20px; } .pal.on { border-color: var(--accent); background: var(--accent-bg); }
.btn-col { display: grid; gap: 6px; }
.floor { position: relative; border: 1px solid #c4cdd9; border-top: 10px solid var(--accent); border-radius: 6px; background-color: #e9d9c4; user-select: none; touch-action: none; }
.floor.f-madeira { background-color: #e4cfb3; background-image: linear-gradient(rgba(25,46,74,.08) 1px, transparent 1px); }
.floor.f-carpete { background-color: #c9cbd6; background-image: radial-gradient(rgba(0,0,0,.05) 1px, transparent 1px); }
.floor.f-piso-claro { background-color: #e8ecf1; background-image: linear-gradient(90deg, rgba(0,0,0,.05) 1px, transparent 1px), linear-gradient(rgba(0,0,0,.05) 1px, transparent 1px); }
.floor.f-concreto { background-color: #cdcfd2; background-image: radial-gradient(rgba(0,0,0,.06) 1px, transparent 1.5px); }
.floor.f-grama { background-color: #b9d3a5; background-image: radial-gradient(rgba(40,90,30,.12) 1px, transparent 1.5px); }
.floor.editing { background-image: linear-gradient(90deg, rgba(42,70,107,.18) 1px, transparent 1px), linear-gradient(rgba(42,70,107,.18) 1px, transparent 1px); }
.floor.placing { cursor: copy; }
.item { position: absolute; display: grid; place-items: center; border-radius: 6px; background: #7e9fc9; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); overflow: hidden; }
.editing .item { cursor: grab; } .item.sel { outline: 3px solid var(--accent); outline-offset: 1px; z-index: 3; }
.item .ic { line-height: 1; filter: drop-shadow(0 1px 0 rgba(0,0,0,.15)); }
.item .lb { position: absolute; bottom: 1px; left: 2px; right: 2px; font-size: 10px; text-align: center; background: rgba(255,255,255,.85); border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-mesa { background: #345279; } .t-cadeira, .t-computador, .t-luminaria, .t-cafe, .t-impressora { background: transparent; box-shadow: none; }
.t-sofa { background: #8b7aa8; } .t-planta { background: transparent; box-shadow: none; } .t-estante { background: #25364c; }
.t-quadro { background: #fdfcf9; border: 2px solid #77818d; } .t-mesa-reuniao { background: #334a68; border-radius: 30px; }
.t-parede { background: #5a636f; border-radius: 0; box-shadow: none; } .t-porta { background: #7a9dca; }
.t-janela { background: #cfe5ef; border: 2px solid #8fb3c5; } .t-tapete { background: #759fd7; opacity: .55; box-shadow: none; border-radius: 10px; }
.t-arquivo { background: #9aa0a6; } .t-placa { background: var(--accent); color: #fff; }
.t-placa .lb { position: static; background: transparent; color: #fff; font-weight: 700; font-size: 11px; }
.pal.t-mesa, .pal.t-sofa, .pal.t-parede, .pal.t-tapete, .pal.t-estante, .pal.t-quadro, .pal.t-mesa-reuniao, .pal.t-porta, .pal.t-janela, .pal.t-arquivo, .pal.t-placa { background: #fff; border: 1px solid var(--line); color: var(--text); opacity: 1; }
.agent { position: absolute; padding: 0; border: 0; background: transparent; display: grid; place-items: center; z-index: 4; }
.agent .body { width: 78%; height: 78%; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 800; border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,.25); position: relative; }
.agent .body::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 30%; height: 30%; border-radius: 50%; border: 2px solid #fff; background: #bbb; }
.agent.st-trabalhando .body::after { background: #4f9a57; } .agent.st-revisao .body::after { background: #8b6db4; }
.agent.st-bloqueado .body::after { background: var(--danger); } .agent.st-ocioso .body::after { background: #e0b84a; }
.agent.st-trabalhando .body { animation: bob 1.6s ease-in-out infinite; }
.agent .name { position: absolute; top: 100%; font-size: 10px; background: rgba(43,47,52,.85); color: #fff; padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.agent .bubble { position: absolute; bottom: 100%; left: 50%; transform: translateX(-30%); margin-bottom: 4px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; font-size: 10px; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.agent.sel { outline: 3px solid var(--accent); border-radius: 50%; } .editing .agent { cursor: grab; }
@keyframes bob { 50% { transform: translateY(-2px); } }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; font-size: 12px; color: var(--muted); }
.st-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; background: #bbb; }
.st-dot.st-trabalhando { background: #4f9a57; } .st-dot.st-revisao { background: #8b6db4; } .st-dot.st-bloqueado { background: var(--danger); } .st-dot.st-ocioso { background: #e0b84a; }

/* diálogos e avisos */
dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 0; width: min(520px, calc(100vw - 24px)); }
dialog.wide { width: min(760px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(43,47,52,.35); }
dialog header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
dialog header h2 { margin: 0; } dialog > div, dialog > form { padding: 20px; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 120px); background: var(--text); color: #fff; padding: 10px 18px; border-radius: 10px; transition: transform .2s; z-index: 100; max-width: 90vw; }
#toast.show { transform: translate(-50%, 0); } #toast.error { background: var(--danger); }

@media (max-width: 1100px) { .editor { grid-template-columns: 1fr; } .palette, .inspector { position: static; } .pal-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); } .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .kpis { grid-template-columns: 1fr 1fr; } .kpi { border-bottom: 1px solid var(--line); } }
@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; left: -260px; width: 250px; transition: left .2s; box-shadow: 0 0 30px rgba(0,0,0,.15); }
  .side.open { left: 0; } .menu-btn { display: block; }
  .top { padding: 0 14px; } .top select { min-width: 0; flex: 1; } main { padding: 20px 14px 50px; }
  .two { grid-template-columns: 1fr; } .page-head .actions { width: 100%; } .page-head .actions button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.side li.sep { border-top: 1px solid var(--line); margin: 8px 0; }
.back-link { text-decoration: none; font-weight: 600; }
main:focus-visible { outline: none; }
