/* ═══════════════════════════════════════════════
   FOB PRO — PREMIUM DARK THEME
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:        #0a0b0f;
  --bg2:       #10121a;
  --bg3:       #161925;
  --bg4:       #1e2235;
  --border:    #252a3a;
  --border2:   #2e3450;
  --text:      #e8ecf5;
  --text2:     #8892b0;
  --text3:     #5c6582;

  --green:     #00d68f;
  --green-dim: #003d28;
  --blue:      #4da6ff;
  --blue-dim:  #001f40;
  --amber:     #ffc107;
  --amber-dim: #3d2e00;
  --purple:    #c084fc;
  --purple-dim:#2a0a4a;
  --red:       #ff4757;
  --red-dim:   #3d0a0f;

  --accent:    #4da6ff;
  --accent2:   #00d68f;

  --radius:    12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow:    0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.7);

  --sidebar-w: 260px;
  --topbar-h:  60px;
  --bnav-h:    72px;

  --font: 'Outfit', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100dvh;
}
input, select, button, textarea {
  font-family: inherit;
  font-size: inherit;
}
button { cursor: pointer; border: none; background: none; }
a { text-decoration: none; color: inherit; }
input:focus, select:focus, textarea:focus { outline: none; }

/* ── SCREENS ── */
.screen { display: none !important; min-height: 100dvh; }
.screen.active { display: block !important; }
#screen-login.active { display: flex !important; }
#screen-app.active   { display: flex !important; flex-direction: column; }

/* ═══════════════════ LOGIN ═══════════════════ */
#screen-login {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 30% 20%, #0d1a3a 0%, #0a0b0f 60%);
}
.login-bg { position: absolute; inset: 0; pointer-events: none; }
.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  animation: orbFloat 8s ease-in-out infinite;
}
.orb1 { width: 400px; height: 400px; background: #2563eb; top: -100px; left: -100px; animation-delay: 0s; }
.orb2 { width: 300px; height: 300px; background: #00d68f; bottom: -80px; right: -80px; animation-delay: 3s; }
.orb3 { width: 250px; height: 250px; background: #7c3aed; top: 40%; left: 60%; animation-delay: 6s; }

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -20px) scale(1.05); }
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 20px;
  background: rgba(22, 25, 37, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .5s cubic-bezier(.16,1,.3,1);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}
.logo-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, #2563eb, #00d68f);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: #fff;
  box-shadow: 0 4px 16px rgba(37,99,235,.4);
}
.logo-icon.sm { width: 36px; height: 36px; font-size: 15px; border-radius: 10px; }
.logo-main {
  font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.5px;
}
.logo-main em { color: var(--blue); font-style: normal; }
.logo-main.sm { font-size: 16px; }
.logo-sub { display: block; font-size: 11px; color: var(--text3); font-weight: 500; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .6px; }
.form-group input, .form-group select {
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text);
  font-size: 15px;
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(77,166,255,.15);
}
.form-group small { font-size: 11px; color: var(--text3); }
.remember-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text2); cursor: pointer;
}
.remember-label input { accent-color: var(--blue); }
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border-radius: var(--radius);
  padding: 13px 24px;
  font-size: 15px;
  font-weight: 600;
  transition: transform .15s, box-shadow .2s, opacity .15s;
  box-shadow: 0 4px 16px rgba(37,99,235,.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(37,99,235,.45); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.btn-full { width: 100%; }
.btn-secondary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg4);
  border: 1px solid var(--border2);
  color: var(--text2);
  border-radius: var(--radius);
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-secondary:hover { background: var(--bg3); border-color: var(--border2); color: var(--text); }
.btn-danger { color: var(--red) !important; border-color: var(--red-dim) !important; }
.btn-danger:hover { background: var(--red-dim) !important; }
.login-version { text-align: center; font-size: 11px; color: var(--text3); margin-top: 24px; }

/* ═══════════════════ APP LAYOUT ═══════════════════ */

/* ── TOPBAR ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--topbar-h);
  background: rgba(10,11,15,.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
}
.topbar-menu-btn {
  width: 36px; height: 36px;
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
  padding: 6px;
  border-radius: 8px;
  transition: background .15s;
}
.topbar-menu-btn:hover { background: var(--bg3); }
.topbar-menu-btn span {
  display: block; height: 2px; width: 18px;
  background: var(--text2); border-radius: 2px;
  transition: all .25s;
}
.topbar-brand { font-size: 18px; font-weight: 800; white-space: nowrap; }
.topbar-search-wrap {
  flex: 1;
  max-width: 500px;
}
.search-box {
  position: relative;
  display: flex; align-items: center;
}
.search-icon {
  position: absolute; left: 12px;
  color: var(--text3); pointer-events: none;
}
.search-box input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 8px 36px 8px 38px;
  color: var(--text);
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.search-box input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(77,166,255,.12);
}
.search-clear {
  position: absolute; right: 10px;
  color: var(--text3); font-size: 12px;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--bg4);
  opacity: 0; transition: opacity .15s;
}
.search-box input:not(:placeholder-shown) ~ .search-clear { opacity: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--text2);
  transition: background .15s, color .15s;
}
.topbar-btn:hover { background: var(--bg3); color: var(--text); }
.topbar-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  cursor: pointer;
}

/* ── SIDEBAR ── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 200;
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  padding: 20px 0;
}
.sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
.sidebar-overlay {
  position: fixed; inset: 0; z-index: 190;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
}
.sidebar-overlay.active { opacity: 1; pointer-events: all; }
.sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; }
.sidebar-empresa { display: block; font-size: 11px; color: var(--text3); margin-top: 2px; }
.sidebar-close {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; color: var(--text3); font-size: 14px;
  transition: background .15s, color .15s;
}
.sidebar-close:hover { background: var(--bg3); color: var(--text); }
.sidebar-nav { flex: 1; padding: 0 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--text2);
  font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
  position: relative; cursor: pointer;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: rgba(77,166,255,.12); color: var(--blue); }
.nav-badge {
  margin-left: auto;
  background: var(--amber);
  color: #000;
  font-size: 11px; font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 22px; text-align: center;
}
.sidebar-footer { padding: 16px 12px 0; border-top: 1px solid var(--border); margin-top: 8px; }
.sidebar-logout {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text3);
  font-size: 13px; font-weight: 500;
  width: 100%;
  transition: background .15s, color .15s;
}
.sidebar-logout:hover { background: var(--red-dim); color: var(--red); }

/* ── MAIN CONTENT ── */
.main-content {
  margin-top: var(--topbar-h);
  min-height: calc(100dvh - var(--topbar-h) - var(--bnav-h));
  padding: 24px 16px 20px;
  max-width: 960px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.page { display: none; animation: fadeInUp .3s cubic-bezier(.4,0,.2,1); }
.page.active { display: block; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.page-subtitle { font-size: 14px; color: var(--text2); margin-top: 4px; }

/* ═══════════════════ DASHBOARD ═══════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--border2); box-shadow: 0 4px 20px rgba(0,0,0,.3); }
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon.green { background: var(--green-dim); color: var(--green); }
.stat-icon.blue  { background: var(--blue-dim);  color: var(--blue);  }
.stat-icon.amber { background: var(--amber-dim); color: var(--amber); }
.stat-icon.purple{ background: var(--purple-dim);color: var(--purple);}
.stat-value { display: block; font-size: 24px; font-weight: 800; color: var(--text); }
.stat-label { display: block; font-size: 12px; color: var(--text3); font-weight: 500; margin-top: 2px; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.dash-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.dash-card-title { font-size: 13px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 16px; }
.tabela-info-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 24px 0;
  color: var(--text3); text-align: center;
}
.tabela-info-empty p { font-size: 14px; }
.tabela-info-active {
  display: flex; flex-direction: column; gap: 8px;
}
.tabela-info-active .ti-name { font-size: 15px; font-weight: 600; }
.tabela-info-active .ti-meta { font-size: 12px; color: var(--text3); }
.tabela-info-active .ti-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.ti-chip { background: var(--bg4); border: 1px solid var(--border); border-radius: 20px; padding: 4px 10px; font-size: 11px; color: var(--text2); }

.top-list { display: flex; flex-direction: column; gap: 8px; }
.top-list .empty-msg { font-size: 13px; color: var(--text3); padding: 16px 0; }
.top-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: var(--bg3);
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
}
.top-item:hover { background: var(--bg4); }
.top-num { font-size: 11px; font-weight: 700; color: var(--text3); min-width: 18px; }
.top-name { flex: 1; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-count { font-size: 11px; color: var(--text3); }

.dash-quick { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.quick-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text2);
  font-size: 12px; font-weight: 500;
  transition: all .15s;
}
.quick-btn:hover { background: rgba(77,166,255,.08); border-color: var(--blue); color: var(--blue); }

/* ═══════════════════ SEARCH ═══════════════════ */
.search-bar-wrap { margin-bottom: 16px; }
.search-bar-big {
  position: relative;
  display: flex; align-items: center;
  margin-bottom: 12px;
}
.search-bar-big svg { position: absolute; left: 16px; color: var(--text3); pointer-events: none; }
.search-bar-big input {
  width: 100%;
  background: var(--bg2);
  border: 2px solid var(--border2);
  border-radius: 50px;
  padding: 14px 48px;
  color: var(--text);
  font-size: 16px;
  transition: border-color .2s, box-shadow .2s;
}
.search-bar-big input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(77,166,255,.12);
}
.search-bar-clear {
  position: absolute; right: 16px;
  color: var(--text3); font-size: 14px;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--bg4);
  opacity: 0; transition: opacity .15s;
}
.search-bar-big input:not(:placeholder-shown) ~ .search-bar-clear { opacity: 1; }
.search-filters {
  display: flex; gap: 10px;
}
.search-filters select {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text2);
  font-size: 13px;
  flex: 1;
}
.search-filters select:focus { border-color: var(--blue); }
.search-status { font-size: 13px; color: var(--text3); margin-bottom: 12px; min-height: 18px; }
.results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.search-empty, .search-initial {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 60px 20px;
  text-align: center;
  color: var(--text3);
}
.search-empty h3, .search-initial h3 { font-size: 18px; font-weight: 600; color: var(--text2); }
.search-empty p, .search-initial p  { font-size: 14px; }
.hidden { display: none !important; }

/* ── PRODUCT CARD ── */
.prod-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: transform .15s, border-color .2s, box-shadow .15s;
  animation: cardIn .25s cubic-bezier(.4,0,.2,1) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px) scale(.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.prod-card:hover { transform: translateY(-2px); border-color: var(--border2); box-shadow: 0 4px 20px rgba(0,0,0,.3); }
.prod-card-head {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 12px;
}
.prod-badge {
  background: rgba(77,166,255,.12);
  border: 1px solid rgba(77,166,255,.25);
  color: var(--blue);
  font-size: 10px; font-weight: 700;
  font-family: var(--mono);
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.prod-name {
  font-size: 14px; font-weight: 600; line-height: 1.4;
  flex: 1;
}
.prod-fav-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--text3);
  flex-shrink: 0;
  transition: color .15s, background .15s;
}
.prod-fav-btn:hover { background: var(--amber-dim); color: var(--amber); }
.prod-fav-btn.active { color: var(--amber); }
.prod-meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 12px;
}
.prod-chip {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px; color: var(--text2);
}
.prod-chip.cat {
  background: rgba(192,132,252,.1);
  border-color: rgba(192,132,252,.25);
  color: var(--purple);
}
.prod-prices {
  display: flex; gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.price-box {
  flex: 1; min-width: 100px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.price-box .price-label { display: block; font-size: 10px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.price-box .price-val { display: block; font-size: 17px; font-weight: 700; font-family: var(--mono); }
.price-box.tabela .price-val { color: var(--text2); }
.price-box.custo .price-val  { color: var(--green); }
.price-box.lucro .price-val  { color: var(--amber); }
.prod-actions { display: flex; gap: 8px; }
.prod-actions .btn-calc {
  flex: 1;
  background: rgba(77,166,255,.1);
  border: 1px solid rgba(77,166,255,.25);
  color: var(--blue);
  border-radius: 10px;
  padding: 10px;
  font-size: 13px; font-weight: 600;
  transition: all .15s;
}
.prod-actions .btn-calc:hover { background: var(--blue); color: #fff; }

/* ═══════════════════ IMPORT ═══════════════════ */
.import-zone {
  background: var(--bg2);
  border: 2px dashed var(--border2);
  border-radius: var(--radius-xl);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  margin-bottom: 20px;
}
.import-zone:hover, .import-zone.drag-over { border-color: var(--blue); background: rgba(77,166,255,.04); }
.import-zone-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; pointer-events: none; }
.import-icon { color: var(--text3); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.import-zone h3 { font-size: 18px; font-weight: 700; }
.import-zone p { font-size: 14px; color: var(--text2); }
.import-formats { display: flex; gap: 8px; }
.fmt-badge {
  padding: 4px 12px; border-radius: 6px; font-size: 12px; font-weight: 700;
}
.fmt-badge.pdf  { background: rgba(255,71,87,.15); color: var(--red); }
.fmt-badge.xlsx { background: rgba(0,214,143,.15);  color: var(--green); }
.fmt-badge.csv  { background: rgba(77,166,255,.15);  color: var(--blue); }
.import-progress { margin-bottom: 20px; text-align: center; }
.progress-bar-wrap {
  background: var(--bg3); border-radius: 8px; height: 8px; overflow: hidden; margin-bottom: 10px;
}
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); border-radius: 8px; width: 0; transition: width .3s ease; }
.import-result {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px;
  margin-bottom: 20px;
}
.import-history h3 { font-size: 13px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 12px; }
.import-hist-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 8px;
}
.hist-icon { color: var(--blue); }
.hist-name { flex: 1; font-size: 13px; font-weight: 500; }
.hist-count { font-size: 12px; color: var(--text3); }
.hist-date { font-size: 11px; color: var(--text3); white-space: nowrap; }

/* ═══════════════════ FAVORITES ═══════════════════ */
.fav-toolbar {
  display: flex; gap: 10px; margin-bottom: 16px;
}
.fav-filter-input {
  flex: 1;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px;
  color: var(--text); font-size: 14px;
}
.fav-filter-input:focus { border-color: var(--blue); }

/* ═══════════════════ SETTINGS ═══════════════════ */
.settings-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.settings-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.settings-card h3 { font-size: 14px; font-weight: 700; color: var(--text2); }
.input-pct {
  display: flex; align-items: center;
  background: var(--bg4); border: 1px solid var(--border2);
  border-radius: var(--radius); overflow: hidden;
}
.input-pct input {
  flex: 1; background: transparent; border: none;
  padding: 11px 14px; color: var(--text); font-size: 15px;
}
.input-pct span {
  padding: 0 14px; color: var(--text3); font-size: 14px; font-weight: 600;
  background: var(--bg3); border-left: 1px solid var(--border);
  height: 100%; display: flex; align-items: center;
}
.settings-actions { flex-direction: row; flex-wrap: wrap; align-items: center; }

/* ═══════════════════ MODAL ═══════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-card {
  width: 100%; max-width: 600px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  max-height: 92dvh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.modal-overlay.open .modal-card { transform: translateY(0); }
.modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 24px 24px 0;
  position: sticky; top: 0; background: var(--bg2);
  z-index: 1; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 18px; font-weight: 800; }
.modal-subtitle { font-size: 12px; color: var(--text3); margin-top: 3px; font-family: var(--mono); }
.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; color: var(--text2);
  transition: background .15s, color .15s; flex-shrink: 0;
}
.modal-close:hover { background: var(--bg3); color: var(--text); }
.modal-body { padding: 20px 24px 32px; display: flex; flex-direction: column; gap: 20px; }
.calc-prices { display: flex; gap: 12px; }
.calc-price-item {
  flex: 1;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.calc-price-item span { font-size: 11px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.calc-price-item strong { font-size: 20px; font-weight: 800; font-family: var(--mono); }
.calc-price-item.highlight { background: rgba(0,214,143,.08); border-color: rgba(0,214,143,.25); }
.calc-price-item.highlight strong { color: var(--green); }
.calc-qtd-row label { font-size: 12px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .5px; display: block; margin-bottom: 10px; }
.qtd-presets { display: flex; gap: 8px; flex-wrap: wrap; }
.qtd-btn {
  min-width: 44px; height: 44px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text2);
  font-size: 14px; font-weight: 600;
  transition: all .15s;
}
.qtd-btn:hover, .qtd-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.qtd-custom { background: var(--bg4); min-width: 72px; padding: 0 8px; }
.qtd-custom input {
  background: transparent; border: none;
  color: var(--text); font-size: 14px; font-weight: 600;
  width: 100%; text-align: center;
}
.calc-discounts { display: flex; gap: 12px; }
.calc-discounts .form-group { flex: 1; }
.calc-results {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.calc-result-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.calc-result-row:last-child { border-bottom: none; }
.calc-result-row span { font-size: 13px; color: var(--text2); }
.calc-result-row strong { font-size: 14px; font-weight: 700; font-family: var(--mono); }
.calc-result-row.total { background: rgba(77,166,255,.06); }
.calc-result-row.total strong { color: var(--blue); font-size: 16px; }
.margem-badge { padding: 3px 10px; border-radius: 20px; font-size: 12px !important; }
.margem-ok    { background: var(--green-dim); color: var(--green); }
.margem-warn  { background: var(--amber-dim); color: var(--amber); }
.margem-bad   { background: var(--red-dim);   color: var(--red);   }
.calc-actions { display: flex; gap: 10px; }
.calc-actions button { flex: 1; }

/* ═══════════════════ BOTTOM NAV ═══════════════════ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: var(--bnav-h);
  background: rgba(16,18,26,.96);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex; align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom);
}
.bnav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--text3);
  font-size: 10px; font-weight: 600; letter-spacing: .3px;
  transition: color .15s;
}
.bnav-item.active { color: var(--blue); }
.bnav-center {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff !important;
  border-radius: 20px 20px 0 0;
  margin: 0 12px;
  box-shadow: 0 -4px 20px rgba(37,99,235,.4);
}

/* ═══════════════════ TOAST ═══════════════════ */
#toast-container {
  position: fixed; bottom: calc(var(--bnav-h) + 12px); left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px); max-width: 380px;
}
.toast {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn .3s cubic-bezier(.16,1,.3,1);
  pointer-events: all;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--blue); }
.toast.warning { border-left: 3px solid var(--amber); }
.toast.removing { animation: toastOut .25s ease forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(8px); } }

/* ═══════════════════ LOADING ═══════════════════ */
#loading-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.8);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}
.loading-spinner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.spinner-ring {
  width: 48px; height: 48px;
  border: 3px solid var(--border2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading-text { font-size: 14px; color: var(--text2); }

/* ═══════════════════ RESPONSIVE ═══════════════════ */
@media (min-width: 640px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .results-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-overlay { align-items: center; }
  .modal-card { border-radius: var(--radius-xl); max-height: 88dvh; }
}
@media (min-width: 900px) {
  .main-content { padding: 32px 24px 24px; }
  .results-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-menu-btn { display: none; }
  .sidebar {
    transform: translateX(0);
    top: var(--topbar-h);
  }
  .main-content { margin-left: var(--sidebar-w); }
  .bottom-nav { display: none; }
  .main-content { min-height: calc(100dvh - var(--topbar-h)); padding-bottom: 32px; }
}

/* ═══════════════════ SCROLLBAR ═══════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ═══════════════════ SELECTION ═══════════════════ */
::selection { background: rgba(77,166,255,.25); }
