:root {
  --ink: #152522;
  --muted: #63726f;
  --brand: #12615b;
  --brand-dark: #0b443f;
  --mint: #dff3ec;
  --cream: #f6f4ed;
  --paper: #fffefa;
  --line: #dce3df;
  --warning: #bb6a22;
  --danger: #ae3e3e;
  --shadow: 0 18px 45px rgba(25, 50, 45, .10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #dfe7e3;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 20% 0, #f7f5ee 0, #e5ece8 55%, #d7e1dc 100%); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(100%, 520px); min-height: 100vh; margin: 0 auto; background: var(--cream); position: relative; box-shadow: var(--shadow); padding-bottom: 88px; }
.topbar { min-height: 88px; display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; gap: 10px; padding: max(18px, env(safe-area-inset-top)) 20px 14px; background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 4; }
.brand-mark { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: white; background: var(--brand); font-size: 22px; }
.eyebrow { color: var(--brand); letter-spacing: .16em; font-size: 10px; font-weight: 800; margin: 0 0 2px; }
h1 { font-size: 20px; line-height: 1.1; margin: 0; }
h2 { font-size: 18px; margin: 0; }
h3 { font-size: 15px; margin: 0; }
p { line-height: 1.45; }
.icon-button { width: 42px; height: 42px; border: 0; border-radius: 50%; background: #edf2ef; color: var(--ink); }
main { padding: 20px; }
.hero { background: linear-gradient(145deg, var(--brand-dark), var(--brand)); color: white; padding: 24px; border-radius: 24px; position: relative; overflow: hidden; box-shadow: 0 16px 32px rgba(18,97,91,.22); }
.hero::after { content: "✓"; position: absolute; right: 12px; bottom: -38px; opacity: .09; font-size: 150px; transform: rotate(8deg); }
.catalog-inactive { opacity: .58; }
.hero .eyebrow { color: #aee7d7; }
.hero h2 { font-size: 27px; max-width: 280px; margin: 5px 0 10px; }
.hero p { color: #d7efea; margin: 0 0 20px; max-width: 330px; font-size: 14px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 14px; border: 1px solid transparent; background: var(--brand); color: white; font-weight: 750; text-decoration: none; }
.hero .button { background: white; color: var(--brand-dark); }
.button.secondary { background: transparent; border-color: var(--line); color: var(--ink); }
.button.danger { background: #fff0ed; color: var(--danger); }
.button.full { width: 100%; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 26px 2px 12px; }
.section-head button { border: 0; background: transparent; color: var(--brand); font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.stat span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.stat strong { font-size: 22px; }
.list { display: grid; gap: 10px; }
.card { width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); padding: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: inherit; }
.card-main { min-width: 0; }
.card-main strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-main small { display: block; color: var(--muted); margin-top: 4px; }
.amount { font-weight: 800; white-space: nowrap; }
.status { display: inline-flex; padding: 4px 8px; border-radius: 99px; background: #ecefed; color: var(--muted); font-size: 11px; font-weight: 750; margin-top: 7px; }
.status.aprovado, .status.pago { background: var(--mint); color: var(--brand-dark); }
.status.recusado { background: #fee8e5; color: var(--danger); }
.empty { text-align: center; padding: 38px 22px; border: 1px dashed #bdcac5; border-radius: 20px; color: var(--muted); background: rgba(255,255,255,.45); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }
.fab { position: fixed; bottom: 92px; right: max(20px, calc((100vw - 480px) / 2)); width: 56px; height: 56px; border-radius: 18px; border: 0; background: var(--brand); color: white; font-size: 28px; box-shadow: 0 12px 25px rgba(18,97,91,.30); z-index: 3; }
.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 520px); height: calc(72px + env(safe-area-inset-bottom)); padding: 9px 12px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(255,254,250,.96); backdrop-filter: blur(15px); border-top: 1px solid var(--line); z-index: 5; }
.bottom-nav button { border: 0; background: transparent; color: #7a8985; font-size: 10px; font-weight: 700; display: grid; place-items: center; gap: 2px; }
.bottom-nav span { font-size: 21px; line-height: 1; }
.bottom-nav button.active { color: var(--brand); }
.search { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 15px; padding: 0 15px; margin-bottom: 14px; background: var(--paper); }
dialog { border: 0; padding: 0; width: min(calc(100% - 24px), 500px); max-height: 90vh; border-radius: 24px; box-shadow: var(--shadow); background: var(--paper); }
dialog::backdrop { background: rgba(10,30,26,.58); backdrop-filter: blur(3px); }
.modal-card { padding: 22px; overflow-y: auto; max-height: 90vh; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-head button { border: 0; background: #edf2ef; width: 36px; height: 36px; border-radius: 50%; }
.field { display: grid; gap: 7px; margin: 13px 0; }
.field label { font-size: 12px; color: var(--muted); font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid #ccd6d1; border-radius: 13px; background: white; color: var(--ink); }
.field textarea { min-height: 76px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions { display: flex; gap: 10px; margin-top: 20px; }
.actions > * { flex: 1; }
.quote-item { display: grid; grid-template-columns: 105px 1fr 84px 38px; gap: 8px; align-items: end; padding: 12px 0; border-bottom: 1px solid var(--line); }
.quote-item .field { margin: 0; }
.remove-item { min-height: 46px; border: 0; background: #fff0ed; color: var(--danger); border-radius: 12px; }
.total-box { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; background: var(--mint); padding: 16px; border-radius: 15px; color: var(--brand-dark); }
.profile-card { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 20px; }
.profile-logo { width: 72px; height: 72px; border-radius: 18px; background: var(--brand); display: grid; place-items: center; color: white; font-size: 26px; margin-bottom: 14px; overflow: hidden; }
.profile-logo img { width: 100%; height: 100%; object-fit: contain; background: white; }
.logo-editor { display: grid; grid-template-columns: 74px 1fr; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #f7f9f7; }
.logo-preview { width: 74px; height: 74px; border-radius: 15px; display: grid; place-items: center; overflow: hidden; background: var(--brand); color: white; font-size: 26px; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; background: white; }
.logo-help { color: var(--muted); font-size: 11px; margin: 5px 0 0; }
#toast { position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 20px); background: var(--ink); color: white; padding: 12px 16px; border-radius: 12px; font-size: 13px; opacity: 0; pointer-events: none; transition: .22s; z-index: 10; max-width: calc(100% - 40px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.detail-grid { display: grid; gap: 10px; margin: 16px 0; }
.detail-row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.detail-row span { color: var(--muted); }
.auth-wrap { min-height: calc(100vh - 150px); display: grid; align-content: center; gap: 18px; }
.auth-intro { text-align: center; padding: 10px 20px; }
.auth-intro .brand-mark { margin: 0 auto 16px; width: 60px; height: 60px; font-size: 30px; }
.auth-intro h2 { font-size: 25px; }
.auth-intro p { color: var(--muted); margin-bottom: 0; }
.auth-card { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 20px; }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 13px; background: #e8eeeb; margin-bottom: 16px; }
.auth-switch button { min-height: 39px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 700; }
.auth-switch button.active { background: white; color: var(--brand); box-shadow: 0 3px 10px rgba(20,40,35,.08); }
.sync-note { font-size: 12px; color: var(--muted); text-align: center; }
.sync-indicator { display:block; width:max-content; margin-top:4px; color:var(--brand); font-size:10px; font-weight:700; }
.sync-indicator.pending { color:var(--warning); }
.pending-dot { color:var(--warning); font-size:11px; font-weight:700; }

@media (max-width: 360px) { main { padding: 15px; } .topbar { padding-left: 15px; padding-right: 15px; } .hero { padding: 20px; } }
@media (max-width: 460px) { .quote-item { grid-template-columns: 1fr 1fr 38px; } .quote-item .field:nth-child(2) { grid-column:1 / -1; grid-row:1; } }
@media print { .topbar, .bottom-nav, .fab, .no-print { display: none !important; } body, .app-shell { background: white; box-shadow: none; } main { padding: 0; } }
