/* ==========================================================================
   Linearthp — design system (mobile first)
   Grafite · azul elétrico · branco. Tema escuro (padrão) e claro.
   ========================================================================== */

:root {
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .45);
  --ok: #22C55E;
  --warn: #F59E0B;
  --danger: #F43F5E;
  --accent: #2F6BFF;
  --accent-2: #22C7E8;
  --accent-soft: rgba(47, 107, 255, .14);
  --bg: #0B0D12;
  --surface: #141821;
  --surface-2: #1B2130;
  --line: #262D3D;
  --text: #E8ECF4;
  --muted: #8B94A7;
  --input: #0F131B;
  --glow: 0 0 0 1px rgba(47, 107, 255, .35), 0 0 28px -6px rgba(47, 107, 255, .55);
  color-scheme: dark;
}

[data-theme='light'] {
  --bg: #F3F5F9;
  --surface: #FFFFFF;
  --surface-2: #F0F3F8;
  --line: #DCE2EC;
  --text: #121620;
  --muted: #5E6A7D;
  --input: #FFFFFF;
  --accent-soft: rgba(47, 107, 255, .10);
  --shadow: 0 10px 30px -14px rgba(15, 23, 42, .25);
  --glow: 0 0 0 1px rgba(47, 107, 255, .3), 0 0 24px -8px rgba(47, 107, 255, .35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(900px 500px at 90% -10%, rgba(47, 107, 255, .10), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(34, 199, 232, .07), transparent 60%);
  background-attachment: fixed;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
a { color: var(--accent-2); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ico { width: 18px; height: 18px; flex: none; }

/* ---------- boot ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; gap: 22px; text-align: center; }
.boot-logo { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.boot-logo span { color: var(--accent-2); }
.boot-bar { width: 160px; height: 3px; background: var(--line); border-radius: 9px; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); animation: slide 1.1s var(--ease) infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- layout ---------- */
.app-root { min-height: 100vh; }
.shell { display: block; min-height: 100vh; }
.sidebar {
  display: none;
  position: fixed; inset: 0 auto 0 0; width: 236px; padding: 22px 14px;
  background: var(--surface); border-right: 1px solid var(--line);
  flex-direction: column; gap: 6px; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: var(--glow);
}
.brand-mark svg { width: 20px; height: 20px; color: #fff; }
.brand small { display: block; font-size: 10.5px; font-weight: 500; color: var(--muted); letter-spacing: .02em; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--radius-sm);
  color: var(--muted); text-decoration: none; font-weight: 500; transition: background .2s var(--ease), color .2s;
  background: none; border: 0; text-align: left; width: 100%;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.on { background: var(--accent-soft); color: var(--text); box-shadow: inset 2px 0 0 var(--accent-2); }
.nav-link.on .ico { color: var(--accent-2); }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.main { min-width: 0; padding: 18px 14px 110px; max-width: 1280px; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.topbar .brand-mobile { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; }
.topbar .brand-mobile .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
.topbar .brand-mobile .brand-mark svg { width: 17px; height: 17px; }
.page-title { display: flex; flex-direction: column; gap: 2px; }
.page-title h1 { font-size: 24px; }
.page-title p { color: var(--muted); font-size: 13.5px; }
.tabbar {
  position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 6px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); z-index: 30;
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 7px 2px; border: 0; background: none; color: var(--muted); border-radius: 12px;
  font-size: 11px; font-weight: 500; transition: color .2s, background .2s;
}
.tab .ico { width: 20px; height: 20px; }
.tab.on { color: var(--text); background: var(--accent-soft); }
.tab.on .ico { color: var(--accent-2); }
.tab-fab { color: #fff !important; background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important; box-shadow: var(--glow); }
.tab-fab .ico { color: #fff !important; }

@media (min-width: 900px) {
  .sidebar { display: flex; }
  .shell { padding-left: 236px; }
  .tabbar { display: none; }
  .main { padding: 28px 32px 48px; }
  .topbar .brand-mobile { display: none; }
  .topbar-actions-mobile { display: none; }
}

/* ---------- componentes base ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 16px; }
.grid { display: grid; gap: 14px; }
.g-kpi { grid-template-columns: repeat(2, 1fr); }
.g-2 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .g-kpi { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) {
  .g-kpi { grid-template-columns: repeat(5, 1fr); }
  .g-2 { grid-template-columns: 1.1fr .9fr; }
  .g-2-eq { grid-template-columns: 1fr 1fr; }
}
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack { display: grid; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface-2); font-weight: 600; font-size: 14px; text-decoration: none;
  transition: transform .15s var(--ease), background .2s, box-shadow .2s, border-color .2s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.99); }
.btn .ico { width: 17px; height: 17px; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #1E4FE0); border-color: transparent; color: #fff; box-shadow: var(--glow); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn-danger-text { color: var(--danger) !important; }
.btn-whats { background: #25D366; border-color: transparent; color: #04210F; }
.btn-sm { min-height: 34px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 16px; flex: none;
}
.icon-btn .ico { width: 17px; height: 17px; }
.icon-btn:hover:not(:disabled) { border-color: var(--accent-2); color: var(--accent-2); }
.icon-btn.danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }

.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .label { font-size: 12.5px; color: var(--muted); font-weight: 600; letter-spacing: .01em; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--input); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.textarea { min-height: 72px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[aria-invalid='true'] { border-color: var(--danger); }
.input-num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.err-text { color: var(--danger); font-size: 12.5px; min-height: 0; }
.hint { color: var(--muted); font-size: 12.5px; }

.seg { display: inline-flex; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; gap: 4px; flex-wrap: wrap; }
.seg button {
  min-height: 34px; padding: 0 12px; border: 0; background: none; border-radius: 9px;
  color: var(--muted); font-weight: 600; font-size: 13.5px; transition: all .2s var(--ease);
}
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 0 var(--line), 0 4px 14px -6px rgba(0,0,0,.35); }
.seg button.on { color: var(--accent-2); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 600; font-size: 14px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { width: 42px; height: 24px; border-radius: 99px; background: var(--line); position: relative; transition: background .25s; flex: none; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.switch input:checked + i { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
  white-space: nowrap;
}
.chip-on { background: var(--accent-soft); color: var(--accent-2); border-color: transparent; }
.chip-ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); border-color: transparent; }
.chip-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); border-color: transparent; }
.chip-err { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); border-color: transparent; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { cursor: pointer; }
.chip-btn:hover { border-color: var(--accent-2); }

.empty { text-align: center; padding: 34px 16px; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.empty .ico { width: 36px; height: 36px; opacity: .6; }

.kpi { display: grid; gap: 6px; }
.kpi .k-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi .k-value { font-size: 24px; font-weight: 800; font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .k-sub { font-size: 12px; color: var(--muted); }
.kpi.glow { position: relative; overflow: hidden; }
.kpi.glow::after { content: ''; position: absolute; inset: auto -30% -60% auto; width: 140px; height: 140px; background: radial-gradient(circle, var(--accent-soft), transparent 70%); pointer-events: none; }

/* anel e barra de aproveitamento */
.ring {
  --p: 0; --c: var(--accent-2);
  width: 92px; height: 92px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0);
  position: relative;
  transition: background .6s var(--ease);
}
.ring::before { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; font-weight: 800; font-family: var(--mono); font-size: 16px; font-variant-numeric: tabular-nums; }
.ring-lg { width: 128px; height: 128px; }
.ring-lg span { font-size: 22px; }
.ring-lg::before { inset: 11px; }
.bar { --p: 0%; --c: var(--accent-2); height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--p); background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 60%, #fff)); border-radius: 99px; transition: width .7s var(--ease); }

/* tabela */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.best td { background: var(--accent-soft); }
.tbl tr.best td:first-child { border-radius: 10px 0 0 10px; }
.tbl tr.best td:last-child { border-radius: 0 10px 10px 0; }
.tbl .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* lista de projetos */
.list { display: grid; gap: 10px; }
.item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid transparent;
  transition: border-color .2s, transform .2s var(--ease);
}
.item:hover { border-color: var(--line); transform: translateY(-1px); }
.item-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.item-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.item-actions .icon-btn { width: 34px; height: 34px; }

/* material cards */
.mat-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .mat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .mat-grid { grid-template-columns: repeat(3, 1fr); } }
.mat { display: grid; gap: 10px; padding: 16px; }
.mat-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.mat-name { font-weight: 700; font-size: 15.5px; }
.mat-price { font-family: var(--mono); font-weight: 700; font-size: 18px; }
.mat-dims { display: flex; flex-wrap: wrap; gap: 6px; }
.mat-dims span { font-family: var(--mono); font-size: 12px; padding: 3px 8px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.mat-actions { display: flex; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.mat-actions .btn { flex: 1; }

/* modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: end center; padding: 0;
  background: rgba(5, 7, 12, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .2s var(--ease);
}
.modal-backdrop.in { opacity: 1; }
.modal {
  width: 100%; max-height: 92vh; display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: 20px 20px 0 0; box-shadow: var(--shadow);
  transform: translateY(24px); transition: transform .28s var(--ease);
}
.modal-backdrop.in .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 16px 18px; overflow: auto; display: grid; gap: 14px; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@media (min-width: 720px) {
  .modal-backdrop { place-items: center; padding: 20px; }
  .modal { width: min(560px, 100%); border-radius: 20px; }
  .modal-lg { width: min(860px, 100%); }
}
.copy-row { display: flex; gap: 8px; }
.copy-row .input { flex: 1; font-family: var(--mono); font-size: 13px; }
.share-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* toasts */
.toasts { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 90; width: min(420px, calc(100% - 24px)); pointer-events: none; }
.toast {
  padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); font-weight: 600; font-size: 14px; opacity: 0; transform: translateY(-8px);
  transition: all .25s var(--ease); text-align: center;
}
.toast.in { opacity: 1; transform: none; }
.toast-ok { border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); }
.toast-err { border-color: color-mix(in srgb, var(--danger) 60%, var(--line)); color: var(--danger); }

/* ---------- calculadora ---------- */
.calc-grid { display: grid; gap: 14px; }
@media (min-width: 1000px) { .calc-grid { grid-template-columns: 430px 1fr; align-items: start; } .calc-side { position: sticky; top: 20px; } }
.pieces { display: grid; gap: 8px; }
.piece-row {
  display: grid; grid-template-columns: 1fr 84px 84px 74px auto; gap: 6px; align-items: end;
  padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
  animation: rise .3s var(--ease);
}
.piece-row .field > span { font-size: 11px; }
.piece-row .input { min-height: 40px; padding: 8px 9px; font-size: 14px; }
.piece-row .icon-btn { width: 40px; height: 40px; }
.piece-row .lbl { grid-column: 1 / -1; }
@media (max-width: 420px) {
  .piece-row { grid-template-columns: 1fr 1fr; }
  .piece-row .lbl, .piece-row .rm { grid-column: 1 / -1; }
  .piece-row .rm .icon-btn { width: 100%; }
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dims-pick { display: grid; gap: 8px; }
.dim-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--input); cursor: pointer; transition: border-color .2s, background .2s; }
.dim-opt:has(input:checked) { border-color: var(--accent-2); background: var(--accent-soft); }
.dim-opt input { accent-color: var(--accent); width: 18px; height: 18px; }
.dim-opt .mono { font-size: 14px; font-weight: 700; }
.dim-opt .best-tag { font-size: 11px; font-weight: 700; color: var(--ok); }

.hero-result { display: grid; gap: 14px; align-items: center; }
@media (min-width: 640px) { .hero-result { grid-template-columns: auto 1fr; } }
.big-num { font-family: var(--mono); font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.pill-rec { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--accent-2); background: var(--accent-soft); padding: 4px 10px; border-radius: 99px; }
.status-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent-2); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.calc-empty { min-height: 340px; display: grid; place-content: center; text-align: center; gap: 12px; color: var(--muted); }
.calc-empty .ico { width: 44px; height: 44px; margin: 0 auto; color: var(--accent-2); opacity: .8; }
.grid-bg { background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 28px 28px; background-position: center; opacity: .6; border-radius: 14px; }

.draft-note { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.draft-note::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

/* ---------- gabarito ---------- */
.gab { display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.gab-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.gab-nav, .gab-tools { display: flex; align-items: center; gap: 6px; }
.gab-count { font-size: 13px; font-weight: 700; min-width: 110px; text-align: center; }
.gab-zoom { font-family: var(--mono); font-size: 12px; min-width: 46px; text-align: center; color: var(--muted); }
.gab-stage {
  position: relative; width: 100%; height: clamp(260px, 52vh, 620px); border-radius: 12px; overflow: hidden;
  background: #0E1219; touch-action: none; cursor: grab; user-select: none; outline: none;
  background-image: radial-gradient(circle, rgba(127,221,240,.10) 1px, transparent 1px); background-size: 18px 18px;
}
.gab-stage:active { cursor: grabbing; }
.gab-stage:focus-visible { box-shadow: var(--glow); }
.gab-svg { display: block; width: 100%; height: 100%; }
.gab-svg .peca rect { transition: opacity .2s; }
.gab-svg .peca:hover rect { opacity: .82; }
.gab-dots { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; border: 0; background: var(--line); padding: 0; transition: all .25s var(--ease); }
.dot.on { width: 24px; border-radius: 99px; background: var(--accent-2); }
.gab-foot { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12.5px; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg b { color: var(--text); font-family: var(--mono); }
.lg-meta { margin-left: auto; }
.sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; flex: none; }
.gab.is-full { position: fixed; inset: 0; z-index: 80; border-radius: 0; padding: 12px; background: var(--bg); }
.gab.is-full .gab-stage { height: calc(100vh - 150px); }

.export-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- dashboard ---------- */
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick a, .quick button {
  display: grid; justify-items: start; gap: 10px; padding: 14px; border-radius: 14px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); text-align: left; font-weight: 700; font-size: 14px;
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.quick a:hover, .quick button:hover { transform: translateY(-2px); border-color: var(--accent-2); box-shadow: var(--glow); }
.quick .q-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); }
.quick .q-ico .ico { width: 20px; height: 20px; }
.quick small { font-weight: 500; color: var(--muted); font-size: 12px; }
.quick .q-primary { background: linear-gradient(135deg, var(--accent), #1E4FE0); color: #fff; border-color: transparent; }
.quick .q-primary .q-ico { background: rgba(255,255,255,.18); color: #fff; }
.quick .q-primary small { color: rgba(255,255,255,.8); }
@media (max-width: 640px) { .quick { grid-template-columns: 1fr; } .quick a, .quick button { grid-template-columns: auto 1fr; align-items: center; } }

.overview { display: grid; gap: 14px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 640px) { .overview { grid-template-columns: auto 1fr; } }
.ov-list { display: grid; gap: 10px; }
.ov-row { display: grid; grid-template-columns: 120px 1fr 48px; gap: 10px; align-items: center; font-size: 13.5px; }
.ov-row .mono { text-align: right; font-weight: 700; }
.ov-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- compartilhamento (somente leitura) ---------- */
.share-page { min-height: 100vh; display: grid; align-content: start; gap: 16px; padding: 22px 14px 40px; max-width: 1000px; margin: 0 auto; }
.share-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- utilidades responsivas ---------- */
.theme-toggle { min-width: 38px; }
.only-mobile { display: block; }
@media (min-width: 900px) { .only-mobile { display: none; } }
.sheet-area { display: grid; gap: 14px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- complementos ---------- */
.dim-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: end; padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.dim-row.bob { grid-template-columns: 1fr auto; }
.dim-row .icon-btn { height: 44px; }
.ring-sm { width: 56px; height: 56px; }
.ring-sm::before { inset: 5px; }
.ring-sm span { font-size: 12px; }
.view-in { animation: rise .35s var(--ease); }
.topbar-spacer { height: 0; }
.item .ring { justify-self: center; }
.calc-side .card + .card { margin-top: 14px; }
.hidden { display: none !important; }
@media (max-width: 899px) {
  .topbar { position: sticky; top: 0; z-index: 15; margin: -18px -14px 14px; padding: 12px 14px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .dim-row { grid-template-columns: 1fr 1fr; }
  .dim-row .icon-btn { grid-column: 1 / -1; width: 100%; }
}
@media (max-width: 480px) {
  .gab-count { min-width: 0; font-size: 12px; }
  .lg-meta { margin-left: 0; }
}
.item { grid-template-columns: auto 1fr; }
.item .item-actions { grid-column: 1 / -1; justify-content: flex-start; }
@media (min-width: 720px) { .item { grid-template-columns: auto 1fr auto; } .item .item-actions { grid-column: auto; } }
