/* =====================================================================
   Patrimônio ERP — Design System (Dark, premium, minimalista)
   Inspirado em Apple / Linear / Stripe / Vercel / Raycast.
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg:            #0a0b0d;
  --bg-elev:       #0e1013;
  --surface:       #141619;
  --surface-2:     #1a1d22;
  --surface-3:     #22262d;
  --border:        rgba(255,255,255,.07);
  --border-strong: rgba(255,255,255,.12);
  --text:          #e8eaf0;
  --text-2:        #c2c7d2;
  --muted:         #868c9b;

  --primary:       #6366f1;
  --primary-2:     #818cf8;
  --primary-soft:  rgba(99,102,241,.14);
  --success:       #10b981;
  --success-soft:  rgba(16,185,129,.14);
  --danger:        #ef4444;
  --danger-soft:   rgba(239,68,68,.14);
  --warn:          #f59e0b;
  --warn-soft:     rgba(245,158,11,.14);
  --accent:        #8b5cf6;
  --accent-soft:   rgba(139,92,246,.14);

  --radius:        14px;
  --radius-sm:     10px;
  --radius-lg:     20px;
  --shadow:        0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg:     0 24px 60px rgba(0,0,0,.55);
  --sidebar-w:     264px;
  --ease:          cubic-bezier(.4,0,.2,1);
  --font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--primary-soft); }
.is-hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2d323b; }

/* Utilidades */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.fatal { padding: 40px; text-align: center; color: var(--muted); }
.loader { padding: 48px; text-align: center; color: var(--muted); font-size: 13px; }

/* =====================================================================
   LOGIN
   ===================================================================== */
.auth-screen { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-aside {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 120% at 20% 0%, #16182b 0%, #0a0b0d 60%);
  display: flex; align-items: center; padding: 64px;
}
.auth-aside__glow {
  position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,.35), transparent 60%);
  top: -120px; left: -80px; filter: blur(20px);
}
.auth-aside__content { position: relative; max-width: 440px; }
.auth-aside__content h2 { font-size: 34px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; margin-bottom: 16px; }
.auth-aside__content > p { color: var(--text-2); font-size: 15px; margin-bottom: 28px; }
.auth-features { list-style: none; display: grid; gap: 12px; }
.auth-features li { position: relative; padding-left: 26px; color: var(--text-2); }
.auth-features li::before {
  content: '✓'; position: absolute; left: 0; top: 0;
  width: 18px; height: 18px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-2);
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
}
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg); }
.auth-card { width: 100%; max-width: 380px; }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }
.auth-logo { width: 46px; height: 46px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-2); display: grid; place-items: center; }
.auth-logo svg { width: 24px; height: 24px; }
.auth-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.auth-sub { color: var(--muted); font-size: 13px; }
.auth-form { display: grid; gap: 16px; }
.auth-remember { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; cursor: pointer; }
.auth-remember input { accent-color: var(--primary); width: 15px; height: 15px; }
.auth-foot { margin-top: 24px; text-align: center; font-size: 12px; }

@media (max-width: 900px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}

/* =====================================================================
   LAYOUT PRINCIPAL
   ===================================================================== */
.app { display: block; }
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

/* Sidebar */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--bg-elev); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 14px; overflow-y: auto; z-index: 40;
}
.sidebar__brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 20px; }
.brand-logo { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; display: grid; place-items: center; }
.brand-logo svg { width: 20px; height: 20px; }
.brand-sub { margin-top: 1px; }
.sidebar__nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-group__title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 16px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 13.5px; font-weight: 500; transition: background .15s var(--ease), color .15s;
}
.nav-item__icon { width: 18px; height: 18px; display: grid; place-items: center; flex-shrink: 0; opacity: .8; }
.nav-item__icon svg { width: 18px; height: 18px; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.is-active { background: var(--primary-soft); color: var(--primary-2); }
.nav-item.is-active .nav-item__icon { opacity: 1; }
.nav-item--config { margin-top: 10px; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding-top: 14px; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 30; height: 62px; display: flex; align-items: center; gap: 14px;
  padding: 0 26px; background: rgba(10,11,13,.72); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar__menu { display: none; }
.topbar__title { font-weight: 600; font-size: 15px; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 12px; }
.user-chip__info { text-align: right; line-height: 1.25; }
.user-chip__name { font-weight: 600; font-size: 13px; display: block; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }

/* View */
.view { flex: 1; padding: 28px; max-width: 1400px; width: 100%; margin: 0 auto; opacity: 0; transform: translateY(6px); transition: opacity .28s var(--ease), transform .28s var(--ease); }
.view.is-ready { opacity: 1; transform: none; }

/* Mobile nav */
.nav-backdrop { display: none; }
@media (max-width: 980px) {
  .main { margin-left: 0; }
  .sidebar { transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 35; }
  .topbar__menu { display: grid; }
  .view { padding: 18px; }
}

/* =====================================================================
   CABEÇALHO DE PÁGINA
   ===================================================================== */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head__title { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.page-head__sub { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.page-head__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* =====================================================================
   BOTÕES
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 15px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; transition: all .15s var(--ease); white-space: nowrap;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn__icon { display: grid; place-items: center; }
.btn__icon svg { width: 16px; height: 16px; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--primary-2); box-shadow: 0 4px 14px rgba(99,102,241,.35); }
.btn--ghost { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--danger { background: var(--danger-soft); color: #fca5a5; border-color: rgba(239,68,68,.25); }
.btn--danger:hover { background: var(--danger); color: #fff; }
.btn--block { width: 100%; padding: 11px; }

.icon-btn {
  width: 32px; height: 32px; border-radius: 9px; border: 1px solid transparent; background: transparent;
  color: var(--muted); display: grid; place-items: center; transition: all .15s var(--ease);
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn--danger:hover { background: var(--danger-soft); color: #fca5a5; }
.row-actions { display: inline-flex; gap: 4px; justify-content: flex-end; }

/* =====================================================================
   FORMULÁRIOS
   ===================================================================== */
.input, .field select, .field textarea, input.input {
  width: 100%; background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13.5px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s; outline: none;
}
.input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input::placeholder { color: #5b606d; }
.input--search { min-width: 200px; }
input[type="color"].input { padding: 4px; height: 38px; cursor: pointer; }
input[type="date"].input { color-scheme: dark; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field__help { font-size: 11.5px; color: var(--muted); }
.field__check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-2); cursor: pointer; padding-top: 8px; }
.field__check input { accent-color: var(--primary); width: 16px; height: 16px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field--col1 { grid-column: span 1; }
.field--col2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
@media (max-width: 560px) { .form { grid-template-columns: 1fr; } .field--col2 { grid-column: span 1; } }

/* =====================================================================
   CARDS / GRID
   ===================================================================== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden; }
.card__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card__title { font-size: 14.5px; font-weight: 600; }
.card__body { padding: 18px 20px; }
.card__actions { display: flex; gap: 8px; }

.grid { display: grid; gap: 16px; margin-bottom: 20px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) { .grid--4, .grid--5 { grid-template-columns: repeat(2, 1fr); } .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) { .grid--2 { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .grid--3, .grid--4, .grid--5 { grid-template-columns: 1fr; } }

/* =====================================================================
   KPI
   ===================================================================== */
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; gap: 14px; align-items: flex-start; box-shadow: var(--shadow); transition: transform .15s var(--ease), border-color .15s; }
.kpi:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.kpi__icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-3); color: var(--text-2); }
.kpi__icon svg { width: 20px; height: 20px; }
.kpi__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kpi__label { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi__value { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.kpi__sub { font-size: 11.5px; color: var(--muted); }
.kpi--primary .kpi__icon { background: var(--primary-soft); color: var(--primary-2); }
.kpi--success .kpi__icon { background: var(--success-soft); color: var(--success); }
.kpi--danger .kpi__icon { background: var(--danger-soft); color: var(--danger); }
.kpi--accent .kpi__icon { background: var(--accent-soft); color: var(--accent); }
.kpi--warn .kpi__icon { background: var(--warn-soft); color: var(--warn); }

/* Stat (estoque) */
.stat { text-align: center; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.stat__num { display: block; font-size: 24px; font-weight: 700; }
.stat__label { font-size: 12px; color: var(--muted); }
.stat--success .stat__num { color: var(--success); }
.stat--accent .stat__num { color: var(--accent); }
.stat--warn .stat__num { color: var(--warn); }
.stat--danger .stat__num { color: var(--danger); }

/* Metas / progress */
.meta { display: flex; flex-direction: column; gap: 10px; }
.meta__head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 500; }
.meta__foot { display: flex; justify-content: space-between; font-size: 12px; }
.progress { height: 8px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.progress__bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 6px; transition: width .5s var(--ease); }

/* Growth */
.growth { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.growth > div { display: flex; flex-direction: column; gap: 4px; }
.growth strong { font-size: 20px; font-weight: 700; }

/* =====================================================================
   TABELA
   ===================================================================== */
.table-wrap { overflow-x: auto; margin: -18px -20px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: 12px 20px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 13px 20px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table strong { color: var(--text); font-weight: 600; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; line-height: 1.4; }
.badge--neutral { background: var(--surface-3); color: var(--text-2); }
.badge--muted { background: var(--surface-2); color: var(--muted); }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--danger { background: var(--danger-soft); color: #fca5a5; }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--accent { background: var(--accent-soft); color: var(--accent); }

/* Chips (filtros) */
.chips { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.chip { padding: 6px 13px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 500; transition: all .15s; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.is-active { background: var(--primary-soft); border-color: transparent; color: var(--primary-2); }

/* Empty state */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state.small { padding: 28px; }
.empty-state__icon { width: 48px; height: 48px; margin: 0 auto 14px; opacity: .4; }
.empty-state__icon svg { width: 48px; height: 48px; }

/* List */
.list { list-style: none; display: flex; flex-direction: column; }
.list__item { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list__item:last-child { border-bottom: none; }

/* =====================================================================
   GRÁFICOS
   ===================================================================== */
.chart-box { position: relative; width: 100%; }

/* =====================================================================
   BALANÇO PATRIMONIAL
   ===================================================================== */
.bp { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.bp__title { font-size: 13px; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--border-strong); }
.bp__group { margin-bottom: 20px; }
.bp__gtitle { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.bp__line { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13px; color: var(--text-2); }
.bp__line--sub { padding-left: 14px; color: var(--muted); }
.bp__line--total { border-top: 1px solid var(--border); font-weight: 700; color: var(--text); margin-top: 4px; }
.bp__col > .bp__line--total:last-child { border-top: 2px solid var(--border-strong); font-size: 15px; margin-top: 8px; padding-top: 12px; }
.bp__check { text-align: center; padding: 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; }
.bp__check.is-ok { background: var(--success-soft); color: var(--success); }
.bp__check.is-off { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 820px) { .bp { grid-template-columns: 1fr; gap: 8px; } .growth { grid-template-columns: 1fr; } }

/* =====================================================================
   DRE
   ===================================================================== */
.dre { display: flex; flex-direction: column; }
.dre__line { display: flex; justify-content: space-between; padding: 11px 4px; font-size: 14px; border-bottom: 1px solid var(--border); }
.dre__line.neg strong { color: var(--danger); }
.dre__line.sub { background: var(--surface-2); font-weight: 600; margin: 0 -20px; padding: 11px 24px; border-radius: 0; }
.dre__line.total { font-size: 17px; font-weight: 800; border-top: 2px solid var(--border-strong); border-bottom: none; margin-top: 6px; padding-top: 14px; }
.dre__line.pos strong { color: var(--success); }
.dre__line.negtot strong { color: var(--danger); }
.dre__margin { margin-top: 12px; text-align: right; font-size: 13px; }

/* Preview de venda */
.sale-preview { grid-column: span 2; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 6px; padding: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.sale-preview > div { display: flex; flex-direction: column; gap: 2px; }
.sale-preview span { font-size: 11px; color: var(--muted); }
.sale-preview strong { font-size: 15px; }
@media (max-width: 560px) { .sale-preview { grid-template-columns: repeat(2, 1fr); } }

.about p { margin-bottom: 6px; }

/* =====================================================================
   MODAL
   ===================================================================== */
.modal-overlay { position: fixed; inset: 0; background: rgba(4,5,7,.68); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; z-index: 100; opacity: 0; transition: opacity .2s var(--ease); }
.modal-overlay.is-open { opacity: 1; }
.modal { width: 100%; max-width: 520px; max-height: 90vh; background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateY(12px) scale(.98); transition: transform .22s var(--ease); overflow: hidden; }
.modal-overlay.is-open .modal { transform: none; }
.modal--sm { max-width: 400px; }
.modal--lg { max-width: 720px; }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal__title { font-size: 16px; font-weight: 600; }
.modal__close { width: 32px; height: 32px; border: none; background: transparent; color: var(--muted); font-size: 22px; border-radius: 8px; line-height: 1; }
.modal__close:hover { background: var(--surface-2); color: var(--text); }
.modal__body { padding: 22px; overflow-y: auto; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); background: var(--surface); }

/* =====================================================================
   TOASTS
   ===================================================================== */
.toast-host { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { display: flex; align-items: center; gap: 11px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 12px 16px; box-shadow: var(--shadow-lg); min-width: 260px; max-width: 380px; transform: translateX(120%); opacity: 0; transition: transform .28s var(--ease), opacity .28s; }
.toast.is-in { transform: none; opacity: 1; }
.toast__icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.toast__msg { font-size: 13px; color: var(--text); }
.toast--success .toast__icon { background: var(--success-soft); color: var(--success); }
.toast--error .toast__icon { background: var(--danger-soft); color: var(--danger); }
.toast--info .toast__icon { background: var(--primary-soft); color: var(--primary-2); }
.toast--warn .toast__icon { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 560px) { .toast-host { left: 16px; right: 16px; bottom: 16px; } .toast { min-width: 0; max-width: none; } }

/* =====================================================================
   UPGRADE ERP — Operações, Precificação, Produto
   ===================================================================== */
.text-warn { color: var(--warn); }
.ml-auto { margin-left: auto; }

/* Hub de operações */
.ops-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.op-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; transition: all .16s var(--ease); box-shadow: var(--shadow);
}
.op-card:hover { transform: translateY(-3px); border-color: var(--primary); background: var(--surface-2); }
.op-card__icon { font-size: 26px; line-height: 1; }
.op-card__label { font-weight: 600; font-size: 14.5px; color: var(--text); }
.op-card__desc { font-size: 12px; color: var(--muted); }
@media (max-width: 900px) { .ops-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .ops-grid { grid-template-columns: 1fr; } }

/* Alerta de preço */
.price-alert {
  background: var(--warn-soft); border: 1px solid rgba(245,158,11,.3); color: #fcd34d;
  border-radius: var(--radius-sm); padding: 13px 16px; margin-bottom: 20px; font-size: 13.5px;
}
.price-alert.is-hidden { display: none; }
.form .price-alert { grid-column: 1 / -1; margin-bottom: 0; }
.price-alert__row { margin-top: 6px; font-size: 12.5px; color: var(--text-2); }
.price-alert b { color: var(--text); }

/* Estrelas de oportunidade */
.stars { letter-spacing: 1px; font-size: 14px; }
.stars--good { color: #fbbf24; }
.stars--ok { color: #a3a3a3; }
.stars--bad { color: #f87171; }

/* Badges do produto */
.prod-badges { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }

/* Tabela de precificação */
.price-table, .cost-list { display: flex; flex-direction: column; }
.price-line, .cost-line { display: flex; justify-content: space-between; padding: 10px 2px; border-bottom: 1px solid var(--border); font-size: 13.5px; color: var(--text-2); }
.price-line:last-child, .cost-line:last-child { border-bottom: none; }
.price-line.ideal strong { color: var(--success); font-size: 15px; }
.price-line.anuncio strong { color: var(--primary-2); }
.price-line.min strong { color: var(--muted); }
.price-line.lucro strong { color: var(--success); }
.cost-line--total { border-top: 2px solid var(--border-strong); font-weight: 700; color: var(--text); font-size: 15px; padding-top: 12px; }

/* Simulador */
.simulator { display: flex; flex-direction: column; gap: 10px; }
.simulator .sale-preview { grid-column: auto; grid-template-columns: repeat(3, 1fr); margin-top: 4px; }
@media (max-width: 560px) { .simulator .sale-preview { grid-template-columns: repeat(2, 1fr); } }

/* Timeline */
.timeline { list-style: none; display: flex; flex-direction: column; }
.timeline__item { display: flex; gap: 14px; padding-bottom: 16px; position: relative; }
.timeline__item::before { content: ''; position: absolute; left: 15px; top: 30px; bottom: 0; width: 2px; background: var(--border); }
.timeline__item:last-child::before { display: none; }
.timeline__dot { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-size: 15px; flex-shrink: 0; z-index: 1; }
.timeline__body { flex: 1; }
.timeline__desc { display: flex; justify-content: space-between; gap: 10px; }
.timeline__val { font-weight: 600; color: var(--text); }
.timeline__date { display: block; margin-top: 2px; }

/* Galeria de fotos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo-grid img { width: 100%; height: 120px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* ===== Livro Diário / Razão (motor contábil v3) ===== */
.diario { display: flex; flex-direction: column; gap: 10px; }
.diario__entry { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.diario__head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface-3); }
.diario__head > div { flex: 1; }
.diario__num { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; min-width: 44px; }
.diario__body { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); }
.dl { background: var(--surface-2); padding: 10px 14px; }
.dl__lbl { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.dl--deb .dl__lbl { color: var(--success); }
.dl--cred .dl__lbl { color: var(--danger); }
.dl__part { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.dl__acc { color: var(--text-2); }
.razao__saldo { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; margin-top: 4px; border-top: 1px dashed var(--border); }
@media (max-width: 640px) { .diario__body { grid-template-columns: 1fr; } }
