:root {
  --bg: #ece7dd;
  --card: #fbf8f2;
  --text: #2b2a26;
  --muted: #6f6a60;
  --border: #e4dcce;
  --primary: #1e93db;
  --primary-dark: #15679f;
  --sidebar: #fbf8f2;
  --sidebar-hover: #f0ebe1;
  --green: #16a34a; --green-bg: #dcf3e4;
  --amber: #b9791a; --amber-bg: #f6ecd4;
  --blue: #2563eb;  --blue-bg: #dde6f4;
  --red: #dc2626;   --red-bg: #f7e3df;
  --purple:#7c3aed; --purple-bg:#ebe6f3;
  --gray: #5f5a52;  --gray-bg: #e7e0d3;
}
:root[data-theme="dark"] {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #334155;
  --sidebar: #1e293b;
  --sidebar-hover: #334155;
  --gray: #cbd5e1;
  --gray-bg: #334155;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
button { font-family: inherit; }

.app { display: flex; min-height: 100vh; }

/* Login */
.login-screen { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 300; }
.login-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 32px 28px; width: 100%; max-width: 380px; text-align: center; }
.login-logo { width: 180px; height: auto; margin: 0 auto 18px; display: block; }
.login-card h2 { font-size: 19px; margin-bottom: 4px; }
.login-sub { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.login-card input { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; margin-bottom: 10px; background: var(--card); color: var(--text); }
.login-card input:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
.login-erro { color: var(--red); font-size: 13px; min-height: 18px; margin-bottom: 8px; }
/* Somente leitura: esconde controles de edição */
body.leitura .row-actions { display: none; }
body.leitura #topbarActions { display: none; }

/* Sidebar */
.sidebar { width: 252px; background: var(--sidebar); color: var(--gray); display: flex; flex-direction: column; position: fixed; left: 0; top: 0; height: 100vh; z-index: 60; transform: translateX(-100%); transition: transform .25s ease; border-right: 1px solid var(--border); box-shadow: 8px 0 34px rgba(33,29,23,.16); }
.sidebar.open { transform: translateX(0); }
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(33,29,23,.38); z-index: 55; }
.logo { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding: 20px 20px 16px; }
.logo-img { width: 174px; height: auto; display: block; }
.logo-icon { width: 42px; height: 42px; display: grid; place-items: center; font-size: 28px; }
.logo-name { font-size: 18px; font-weight: 700; color: var(--text); }
.logo-sub { font-size: 12px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; flex: 1; overflow-y: auto; }
.nav-group { display: flex; flex-direction: column; gap: 4px; }
.nav-group-items { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.nav-group-title { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: none; cursor: pointer; text-align: left; font-family: inherit; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 12px 5px; border-radius: 8px; }
.nav-group-title:hover { color: var(--text); }
.nav-group-title .chev { font-size: 10px; opacity: .6; transition: transform .2s; }
.nav-group.collapsed .nav-group-items { display: none; }
.nav-group.collapsed .nav-group-title .chev { transform: rotate(-90deg); }
.nav-item { display: flex; align-items: center; gap: 12px; background: none; border: none; color: var(--gray); padding: 11px 14px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 500; text-align: left; transition: background .15s; }
.nav-item span { font-size: 17px; display: inline-flex; align-items: center; }
.nav-item span svg { width: 19px; height: 19px; display: block; }
.nav-item:hover { background: var(--sidebar-hover); color: var(--text); }
.nav-item.active { background: var(--primary); color: #fff; }
.sidebar-footer { padding: 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.btn-ghost { background: none; border: none; color: var(--muted); text-align: left; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.btn-ghost:hover { background: var(--sidebar-hover); color: var(--text); }

/* Main */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: var(--card); border-bottom: 1px solid var(--border); padding: 16px 28px; display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-size: 20px; font-weight: 700; flex: 1; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.menu-toggle { display: inline-flex; align-items: center; background: none; border: none; font-size: 22px; cursor: pointer; padding: 2px 4px; border-radius: 8px; }
.menu-toggle:hover { background: var(--sidebar-hover); }
.content { padding: 28px; max-width: 1200px; width: 100%; }

/* Buttons */
.btn { background: var(--primary); color: #fff; border: none; border-radius: 10px; padding: 10px 16px; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.btn:hover { background: var(--primary-dark); }
.btn.secondary { background: var(--card); color: var(--gray); border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--bg); }
.btn.danger { background: var(--red); }
.btn.sm { padding: 7px 12px; font-size: 13px; }

/* Stat cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; }
.stat .top { display: flex; justify-content: space-between; align-items: center; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .ico { font-size: 20px; opacity: .9; }
.stat .value { font-size: 28px; font-weight: 700; margin-top: 6px; }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Generic cards / sections */
.section { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 0; margin-bottom: 22px; overflow: hidden; }
.section-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.section-head h3 { font-size: 15px; font-weight: 700; }
.section-body { padding: 16px 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; padding: 10px 20px; border-bottom: 1px solid var(--border); }
tbody td { padding: 13px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--sidebar-hover); }
.cell-strong { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 12px; }

/* Badges */
.badge { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; display: inline-block; }
.badge.planejamento, .badge.gray { background: var(--gray-bg); color: var(--gray); }
.badge.andamento, .badge.blue { background: var(--blue-bg); color: var(--blue); }
.badge.concluida, .badge.green, .badge.pago, .badge.feita { background: var(--green-bg); color: var(--green); }
.badge.atrasada, .badge.red, .badge.alta, .badge.pendente { background: var(--red-bg); color: var(--red); }
.badge.amber, .badge.media, .badge.aberta { background: var(--amber-bg); color: var(--amber); }
.badge.purple { background: var(--purple-bg); color: var(--purple); }
/* Linha do tempo do trabalho */
.timeline { padding: 2px 0; }
.tl-item { display: flex; gap: 12px; padding-bottom: 14px; position: relative; }
.tl-item:not(:last-child)::before { content: ''; position: absolute; left: 15px; top: 32px; bottom: -2px; width: 2px; background: var(--border); }
.tl-dot { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border); display: grid; place-items: center; font-size: 15px; z-index: 1; }
.tl-body { flex: 1; padding-top: 3px; min-width: 0; }
.tl-top { display: flex; gap: 8px; align-items: center; }
.tl-data { font-size: 12px; color: var(--muted); font-weight: 600; }
.tl-grupo { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--primary); background: color-mix(in srgb, var(--primary) 11%, transparent); padding: 1px 7px; border-radius: 20px; }
.tl-titulo { font-weight: 600; font-size: 14px; margin-top: 1px; }
.tl-texto { font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 1px; }
/* Galeria de slides do carrossel */
.slides-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 10px; }
.slide-card { display: flex; flex-direction: column; gap: 6px; }
.slide-card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); display: block; }
/* Seletor inicial Projeto/Obra (cards clicáveis) */
.escolha-grid { display: grid; gap: 10px; }
.escolha-card { text-align: left; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; cursor: pointer; font-family: inherit; color: var(--text); transition: border-color .15s, transform .1s, box-shadow .15s; display: flex; flex-direction: column; gap: 3px; }
.escolha-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.escolha-card .ec-ico { font-size: 22px; }
.escolha-card .ec-t { font-weight: 700; font-size: 15px; }
.escolha-card .ec-d { font-size: 12px; color: var(--muted); line-height: 1.35; }
/* Selos de escopo do trabalho (Projeto / Obra / ambos) */
.badge.escopo-projeto { background: var(--blue-bg); color: var(--blue); }
.badge.escopo-obra { background: var(--amber-bg); color: var(--amber); }
.badge.escopo-ambos { background: var(--gray-bg); color: var(--gray); }
.cell-strong .badge { font-size: 10px; padding: 2px 7px; margin-left: 5px; vertical-align: middle; }

/* Progress */
.progress { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; min-width: 90px; }
.progress .fill { height: 100%; background: var(--primary); border-radius: 999px; }
.prog-row { display: flex; align-items: center; gap: 10px; }
.prog-row .lbl { font-size: 12px; color: var(--muted); font-weight: 600; min-width: 34px; }

/* Toolbar */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.search { flex: 1; min-width: 180px; position: relative; }
.search input { width: 100%; padding: 10px 12px 10px 36px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; background: var(--card); }
.search::before { content: "🔎"; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: 13px; }
.chip { border: 1px solid var(--border); background: var(--card); color: var(--gray); padding: 8px 13px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 500; }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Action buttons inline */
.row-actions { display: flex; gap: 6px; }
.icon-btn { background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; cursor: pointer; font-size: 13px; color: var(--gray); }
.icon-btn:hover { background: var(--bg); }
.icon-btn.del:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); }

/* Empty state */
.empty { text-align: center; padding: 54px 20px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 10px; }

/* Etapas checklist */
.etapas { display: grid; gap: 8px; }
.etapa { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.etapa input { width: 18px; height: 18px; cursor: pointer; }
.etapa.done { background: #f0fdf4; border-color: #bbf7d0; }
.etapa.done .nome { color: var(--green); text-decoration: line-through; }
.etapa-nome { flex: 1; display: flex; align-items: center; gap: 8px; background: none; border: none; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.etapa-nome:hover .nome { color: var(--primary); }
.etapa-tag { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--bg); padding: 1px 7px; border-radius: 20px; white-space: nowrap; }

/* List item (agenda) */
.event { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.event:last-child { border-bottom: none; }
.event .date-box { background: var(--blue-bg); color: var(--blue); border-radius: 10px; padding: 8px 12px; text-align: center; min-width: 58px; }
.event .date-box .d { font-size: 19px; font-weight: 700; line-height: 1; }
.event .date-box .m { font-size: 11px; text-transform: uppercase; }

/* Modal */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.55); display: none; align-items: flex-start; justify-content: center; padding: 30px 16px; z-index: 100; overflow-y: auto; }
.overlay.open { display: flex; }
.modal { background: var(--card); border-radius: 16px; width: 100%; max-width: 560px; margin: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.modal-body { padding: 20px 22px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 0 22px 20px; }

/* Forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--gray); }
.field input, .field select, .field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; font-size: 14px; font-family: inherit; background: var(--card); color: var(--text); }
.field textarea { resize: vertical; min-height: 64px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.help { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: #0f172a; color: #fff; padding: 12px 20px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.kan-col { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 10px; min-height: 140px; }
.kan-col.drop-active { outline: 2px dashed var(--primary); outline-offset: -2px; }
.kan-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 13px; padding: 4px 6px 10px; color: var(--gray); }
.kan-count { background: var(--gray-bg); color: var(--gray); border-radius: 999px; padding: 1px 9px; font-size: 12px; }
.kan-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; margin-bottom: 9px; cursor: grab; }
.kan-card:active { cursor: grabbing; }
.kan-card:hover { border-color: var(--primary); }
.kan-card h4 { font-size: 14px; margin-bottom: 7px; }
.kan-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.kan-empty { text-align: center; color: var(--muted); font-size: 12px; padding: 16px 0; }
@media (max-width: 720px) { .kanban { grid-template-columns: 1fr; } }

/* Calendário / Cronograma */
.cal-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cal-toolbar .mes { font-size: 18px; font-weight: 700; min-width: 190px; text-align: center; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head { text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; padding: 6px 0; }
.cal-cell { background: var(--card); border: 1px solid var(--border); border-radius: 10px; min-height: 100px; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.cal-cell.empty { background: transparent; border: none; }
.cal-cell.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.cal-day { font-size: 12px; font-weight: 700; color: var(--muted); }
.cal-cell.today .cal-day { color: var(--primary); }
.cal-ev { font-size: 11px; padding: 2px 6px; border-radius: 5px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.blue { background: var(--blue-bg); color: var(--blue); }
.cal-ev.red { background: var(--red-bg); color: var(--red); }
.cal-ev.amber { background: var(--amber-bg); color: var(--amber); }
.cal-ev.green { background: var(--green-bg); color: var(--green); }
.cal-ev.purple { background: var(--purple-bg); color: var(--purple); }
.cal-ev.gray { background: var(--gray-bg); color: var(--gray); }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin: 16px 0; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* Detail layout */
.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; }
.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; }

@media (max-width: 880px) {
  .grid-2, .detail-grid { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: block; }
  .content { padding: 18px; }
  .topbar { padding: 14px 18px; }
  table { font-size: 13px; }
  thead th, tbody td { padding: 10px 12px; }
}

/* ============================================================
   Direção visual: "Atelier editorial" (monografia de estúdio)
   Papel cartridge frio · tinta ardósia · pigmento petróleo ·
   siena queimada como acento pontual · tipografia editorial Fraunces
   Ref: docs/referencia-estilo-atelier.html (variação 3)
   ============================================================ */
:root {
  --bg: #EEEBE3;            /* papel — cartridge cinza-quente frio */
  --paper-deep: #E5E1D6;    /* painéis / sidebar / recessos */
  --card: #FAF8F2;          /* off-white levemente quente */
  --text: #1B2330;          /* tinta ardósia (não preto) */
  --muted: #5A6373;         /* tinta secundária */
  --sage: #6E7A63;          /* verde-prancheta — eyebrows/labels mono */
  --border: #D8D3C7;        /* fio fino quente */
  --sidebar: #E5E1D6;
  --sidebar-hover: #DCD7CA;
  --primary: #2B4A57;       /* pigmento petróleo — acento principal */
  --primary-dark: #1F3641;
  --spark: #BE6034;         /* siena queimada — só em destaques pontuais */
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --mono: "Spline Sans Mono", ui-monospace, "SFMono-Regular", monospace;
  --shadow-sm: 0 1px 2px rgba(27,35,48,.04), 0 6px 18px rgba(27,35,48,.05);
  --shadow-md: 0 16px 40px rgba(27,35,48,.10), 0 4px 12px rgba(27,35,48,.05);
}
body { font-family: "Spline Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; line-height: 1.55; }
::selection { background: var(--spark); color: var(--bg); }

/* Tipografia editorial — Fraunces leve, eixo óptico ativo */
.topbar h1, .login-card h2, .modal-head h2, .section-head h3,
.stat .value, .logo-name, .cal-toolbar .mes, .empty .big, .hub-welcome h2, .hub-card h3 {
  font-family: var(--serif); font-optical-sizing: auto; font-weight: 400; letter-spacing: -0.01em; line-height: 1.12;
}
.topbar h1 { font-size: 33px; }
.login-card h2 { font-size: 33px; }
.section-head h3 { font-size: 21px; }
.modal-head h2 { font-size: 24px; }
.stat .value { font-weight: 500; font-size: clamp(24px, 2.1vw, 32px); letter-spacing: -0.02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.logo-name { font-weight: 500; }
.hub-welcome h2 { font-size: 32px; letter-spacing: -0.015em; line-height: 1.12; }
.hub-card h3 { font-size: 20px; }

/* Eyebrows / labels em mono caixa-alta — assinatura editorial (só em rótulos curtos) */
.stat-strip-label, .stat .label, thead th {
  font-family: var(--mono); text-transform: uppercase; font-weight: 500;
}
.stat-strip-label { font-size: 11px; letter-spacing: .16em; color: var(--sage); margin: 4px 2px 12px; }
.stat .label { font-size: 10.5px; letter-spacing: .16em; color: var(--sage); }
thead th { font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.field label { font-weight: 500; color: var(--muted); }
.nav-item, .chip, .btn, .cell-strong, .badge { font-weight: 500; }

/* Cards: fio fino quente + sombra discreta (editorial, menos "flutuante") */
.stat, .section, .kan-card, .kan-col, .cal-cell, .login-card, .modal { box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.stat { border-radius: 14px; padding: 22px 24px; transition: box-shadow .2s, transform .2s; }
.stat:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.section { border-radius: 14px; }
.section-head { padding: 18px 22px; border-bottom: 1px solid var(--border); }
.section-body { padding: 18px 22px; }
.login-card { box-shadow: var(--shadow-md); border-radius: 16px; padding: 44px 36px; }
.modal { box-shadow: 0 30px 80px rgba(27,35,48,.28); border-radius: 16px; }

/* Topbar/sidebar */
.topbar { background: var(--bg); border-bottom: 1px solid var(--border); padding: 22px 32px; }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--border); }
.logo { padding: 24px 20px 18px; }
.content { padding: 32px; max-width: 1240px; margin: 0 auto; }
.stats-grid { gap: 18px; margin-bottom: 30px; }

/* Botões e foco — siena reservada ao foco */
.btn { box-shadow: var(--shadow-sm); transition: filter .15s, transform .06s; border-radius: 10px; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--spark); outline-offset: 2px; }
.nav-item.active { box-shadow: var(--shadow-sm); }
.stat .ico { opacity: 1; }

/* Home / Hub de módulos */
.hub-welcome { margin-bottom: 22px; }
.hub-welcome p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 30px; }
.hub-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 22px; text-align: left; cursor: pointer; font-family: inherit; color: var(--text); box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; display: flex; flex-direction: column; gap: 5px; }
.hub-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.hub-ico { font-size: 28px; width: 52px; height: 52px; display: grid; place-items: center; background: var(--paper-deep); border-radius: 12px; margin-bottom: 8px; color: var(--primary); }
.hub-ico svg { width: 27px; height: 27px; display: block; }
.hub-card:hover .hub-ico { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.hub-card p { color: var(--muted); font-size: 13px; line-height: 1.4; }
.hub-card .badge { margin-top: auto; align-self: flex-start; }
.stat .ico { color: var(--primary); display: inline-flex; }
.stat .ico svg { width: 19px; height: 19px; display: block; }
.sh-ico { color: var(--primary); display: inline-flex; vertical-align: -3px; margin-right: 8px; }
.sh-ico svg { width: 18px; height: 18px; display: block; }

@media (max-width: 720px) {
  .topbar { padding: 16px 18px; }
  .content { padding: 18px; }
  .stat { padding: 18px 18px; }
}
