/* ==================== CSS VARIABLES ==================== */
:root {
  --bg: #f2f6f8;
  --bg2: #ffffff;
  --bg3: #f2f6f8;
  --surface: #ffffff;
  --surface2: #edf3f6;
  --border: #d6e2e8;
  --text: #122a33;
  --text2: #3b4f5c;
  --text3: #8aa0ab;
  --primary: #1C6173;
  --primary-light: #4da7bc;
  --primary-dark: #144a58;
  --primary-ultra-light: #e8f1f4;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --info: #3b82f6;
  --navy: #1e3a5f;
  --shadow: 0 1px 3px rgba(28,97,115,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px rgba(28,97,115,.10), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 25px rgba(28,97,115,.15), 0 4px 6px rgba(0,0,0,.05);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 24px;
  --header-h: 108px;
  --fab-size: 56px;
}

[data-theme="dark"] {
  --bg: #0e1320;
  --bg2: #151c2c;
  --bg3: #0e1320;
  --surface: #151c2c;
  --surface2: #1c2539;
  --border: #28344c;
  --text: #eef3f9;
  --text2: #b8c8da;
  --text3: #6c7e98;
  --primary: #2a7d93;
  --primary-light: #4da7bc;
  --primary-ultra-light: #1c2539;
  --shadow: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,.25);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.35);
}

/* ==================== RESET ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overscroll-behavior: none;
}
input, select, textarea, button { font-family: inherit; }
button { cursor: pointer; border: none; background: none; }

/* ==================== LOGIN SCREEN ==================== */
.login-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(170deg, #0a0f1c 0%, #0e1726 55%, #143246 100%);
  padding: 24px;
  overflow: hidden;
}
.login-screen.hidden { display: none; }

.login-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.login-blob {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: .22;
}
.blob1 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #4da7bc, #1C6173);
  top: -80px; right: -60px;
  animation: blobFloat 8s ease-in-out infinite;
}
.blob2 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, #E07820, #9a4a10);
  bottom: 60px; left: -40px;
  animation: blobFloat 10s ease-in-out infinite reverse;
}
.blob3 {
  width: 150px; height: 150px;
  background: radial-gradient(circle, #6dbdd1, #2a7d93);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: blobFloat 12s ease-in-out infinite 2s;
}
@keyframes blobFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

.login-card {
  position: relative; z-index: 1;
  background: transparent;
  border: none;
  border-radius: var(--radius-lg);
  padding: 36px 28px 28px;
  width: 100%; max-width: 400px;
  display: flex; flex-direction: column; align-items: center; gap: 0;
}

.login-logo-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  margin-bottom: 8px;
}
.login-logo-icon {
  display: block;
  width: 110px; height: 110px;
  background: none; border: none; border-radius: 0; box-shadow: none;
  filter: drop-shadow(0 0 32px rgba(77,167,188,.45));
}
.login-logo-text { font-size: 34px; line-height: 1; letter-spacing: -.5px; }
.login-logo-spool { font-weight: 800; color: #4da7bc; }
.login-logo-kit   { font-weight: 400; color: #ff9e46; }

.login-slogan {
  font-size: 15px; color: rgba(255,255,255,.75);
  letter-spacing: .3px; margin-bottom: 16px;
  font-weight: 500;
}

/* ===== Feature pills ===== */
.feature-pills {
  display: flex; flex-wrap: wrap; gap: 7px;
  justify-content: center;
  margin-bottom: 24px;
}
.feature-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(43,107,142,.18);
  border: 1px solid rgba(77,167,188,.28);
  border-radius: 100px;
  padding: 5px 13px;
  font-size: 12px; font-weight: 500;
  color: rgba(255,255,255,.9);
  white-space: nowrap;
  backdrop-filter: blur(6px);
  transition: background .2s, border-color .2s;
}
.feature-pill:hover {
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.28);
}
.feature-pills.hidden { display: none; }

.login-divider {
  width: 100%; display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px;
  background: rgba(255,255,255,.15);
}
.login-divider span {
  font-size: 12px; color: rgba(255,255,255,.4);
  font-weight: 500; white-space: nowrap; text-transform: uppercase; letter-spacing: .6px;
}

.login-auth-btns {
  width: 100%; display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px;
}

.auth-btn {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 13px 18px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600;
  border: 1px solid rgba(255,255,255,.15);
  cursor: pointer; transition: all .2s;
  backdrop-filter: blur(8px);
}
.auth-icon { width: 20px; height: 20px; flex-shrink: 0; }

.auth-google {
  background: #151c2c; color: #b8c8da;
  border: 1px solid #28344c !important;
}
.auth-google:hover { background: #1c2539; transform: translateY(-1px); border-color: #3a4d70 !important; }

.auth-apple {
  background: rgba(10,10,10,.75); color: #fff;
}
.auth-apple:hover { background: rgba(10,10,10,.9); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.auth-apple .auth-icon { color: #fff; }

/* Login views */
.login-view { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 0; }
.login-view.hidden { display: none; }

.login-view-title {
  font-size: 18px; font-weight: 700; color: #fff;
  margin-bottom: 16px; text-align: center;
}

/* "ou" divider between Google and email form */
.login-or {
  width: 100%; display: flex; align-items: center; gap: 12px;
  margin: 10px 0 14px;
}
.login-or::before, .login-or::after {
  content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.15);
}
.login-or span {
  font-size: 11px; color: rgba(255,255,255,.35);
  font-weight: 500; text-transform: uppercase; letter-spacing: .6px;
}

/* Email/password form */
.login-form {
  width: 100%; display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px;
}
.login-form input {
  width: 100%; padding: 13px 15px;
  background: #151c2c;
  border: 1px solid #28344c;
  border-radius: 14px;
  color: #cfe0ee; font-size: 14px; font-family: inherit;
  outline: none; transition: border-color .2s, box-shadow .2s;
  box-sizing: border-box;
}
.login-form input::placeholder { color: rgba(255,255,255,.4); }
.login-form input:focus {
  border-color: #2a7d93;
  box-shadow: 0 0 0 3px rgba(42,125,147,.25);
}

/* Two-column name row */
.login-name-row { display: flex; gap: 10px; width: 100%; }
.login-name-row input { flex: 1; min-width: 0; }

/* Primary action button */
.auth-btn-primary {
  width: 100%; padding: 14px;
  background: linear-gradient(90deg, #E07820, #c8540a);
  box-shadow: 0 0 26px rgba(224,120,32,.35);
  color: #fff;
  border: none; border-radius: 14px;
  font-size: 15px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: opacity .2s, transform .15s;
}
.auth-btn-primary:hover { opacity: .92; transform: translateY(-1px); }
.auth-btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* Switch view link */
.login-switch {
  font-size: 13px; color: rgba(255,255,255,.5);
  margin-bottom: 8px; text-align: center;
}
.login-switch button {
  background: none; border: none; color: rgba(255,255,255,.8);
  font-size: 13px; font-family: inherit;
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer; padding: 0; transition: color .2s;
}
.login-switch button:hover { color: #fff; }

/* Email confirmation screen */
.login-confirm-icon { font-size: 48px; margin: 8px 0 16px; }
.login-confirm-msg {
  font-size: 14px; color: rgba(255,255,255,.75);
  text-align: center; line-height: 1.65; margin-bottom: 20px; padding: 0 4px;
}

.login-terms {
  font-size: 11px; color: rgba(255,255,255,.3);
  text-align: center; line-height: 1.7;
}
.login-terms a { color: rgba(255,255,255,.5); text-decoration: underline; }

/* ==================== LAYOUT ==================== */
#app { display: flex; flex-direction: column; min-height: 100dvh; }
#app.hidden { display: none; }

/* ==================== HEADER ==================== */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  /* Mobile: flex-wrap so brand+actions sit on row 1, nav on row 2 */
  display: flex; flex-wrap: wrap; align-items: center;
}
.header-left {
  flex: 1; display: flex; align-items: center; gap: 8px;
  padding: 10px 8px 10px 16px;
  order: 1;
}
.header-right {
  flex-shrink: 0; display: flex; gap: 4px; align-items: center;
  padding: 10px 16px 10px 0;
  order: 2; /* mobile: logo(1) | ações(2) na linha de cima */
}
.app-nav {
  flex: 0 0 100%; /* full-width second row on mobile */
  display: flex; overflow-x: auto; gap: 4px; padding: 0 12px 10px;
  scrollbar-width: none;
  order: 3; /* mobile: nav fica na linha de baixo */
}
.app-nav::-webkit-scrollbar { display: none; }

.header-logo-icon { display: block; height: 36px; width: 36px; }
[data-theme="dark"] .header-logo-icon { filter: drop-shadow(0 0 6px rgba(255,255,255,.15)); }
.header-logo-text { font-size: 20px; line-height: 1; letter-spacing: -.3px; }
.hl-spool { font-weight: 800; color: #2B6B8E; }
.hl-kit   { font-weight: 400; color: #E07820; }
[data-theme="dark"] .hl-spool { color: #7ec8e3; }
[data-theme="dark"] .hl-kit   { color: #E07820; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: background .15s;
  background: var(--surface2);
}
.icon-btn:hover { background: var(--border); }

.user-avatar-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-size: 14px; font-weight: 700;
  border: 2px solid rgba(255,255,255,.3);
}
.user-avatar-btn:hover { opacity: .9; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }

.nav-btn {
  flex-shrink: 0; padding: 7px 16px; border-radius: 20px;
  font-size: 13px; font-weight: 600; color: var(--text2);
  background: var(--surface2); transition: all .2s;
  white-space: nowrap; border: 1px solid var(--border);
}
.nav-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.nav-btn:hover:not(.active) { background: var(--border); }
.nav-btn::before { margin-right: 6px; }
.nav-btn[data-view="inventory"]::before { content: "📦"; }
.nav-btn[data-view="analytics"]::before { content: "📊"; }
.nav-btn[data-view="simulator"]::before { content: "🧮"; }
.nav-btn[data-view="settings"]::before  { content: "⚙️"; }

/* ===== BOTTOM NAV (mobile) ===== */
@media (max-width: 599px) {
  .app-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0,0,0,.10);
    display: flex; justify-content: space-around; align-items: stretch;
    gap: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    margin: 0; overflow: visible;
    order: unset; flex: unset;
  }
  .nav-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    gap: 2px; padding: 4px 2px;
    background: none; border: none; border-radius: 14px;
    font-size: 10px; font-weight: 600; color: var(--text3);
  }
  .nav-btn::before { margin-right: 0; font-size: 21px; line-height: 1.2; filter: grayscale(1) opacity(.55); }
  .nav-btn.active { background: none; color: var(--primary-light); font-weight: 700; }
  .nav-btn.active::before { filter: none; }
  .nav-btn:hover:not(.active) { background: none; }

}

/* ==================== USER DROPDOWN ==================== */
.user-dropdown {
  position: fixed; top: 60px; right: 12px; z-index: 200;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 8px; min-width: 200px;
  animation: fadeIn .15s ease;
}
.user-dropdown.hidden { display: none; }
@keyframes fadeIn { from { opacity:0; transform: translateY(-8px); } to { opacity:1; transform: none; } }
.user-dropdown-info {
  padding: 12px 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px;
}
.user-dropdown-info .ud-name { font-weight: 700; font-size: 14px; }
.user-dropdown-info .ud-email { font-size: 12px; color: var(--text3); margin-top: 2px; }
.user-dropdown-item {
  width: 100%; text-align: left; padding: 10px 8px;
  border-radius: var(--radius-sm); font-size: 14px; color: var(--text2);
  transition: background .15s;
}
.user-dropdown-item:hover { background: var(--surface2); }

/* ==================== MAIN ==================== */
#mainContent { flex: 1; padding-bottom: calc(var(--fab-size) + 24px); }
.view { display: none; }
.view.active { display: block; }

/* ==================== VIEW GREETING ==================== */
.view-greeting { padding: 18px 16px 0; }
.greet-line { font-size: 13px; color: var(--text3); }
.greet-title { font-size: 26px; font-weight: 800; color: var(--text); margin-top: 2px; letter-spacing: -.3px; }

/* ==================== TOOLBAR ==================== */
.view-toolbar { padding: 14px 16px 8px; }
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px;
  box-shadow: var(--shadow); transition: border-color .2s;
}
.search-bar:focus-within { border-color: var(--primary); }
.search-icon { font-size: 16px; opacity: .6; }
.search-bar input {
  flex: 1; border: none; background: none; color: var(--text);
  font-size: 15px; outline: none;
}
.search-bar input::placeholder { color: var(--text3); }

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px; margin-top: 10px;
}
.filter-select {
  width: 100%; padding: 7px 10px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text2); font-size: 13px; outline: none; transition: border-color .2s;
  min-width: 0;
}
.filter-select:focus { border-color: var(--primary); }

/* Toggle "Ocultar vazios" */
.filter-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 12px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text3); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .2s; white-space: nowrap;
  line-height: 1.4; width: 100%;
}
.filter-pill .pill-icon { font-size: 14px; }
.filter-pill:hover { border-color: var(--primary); color: var(--text2); background: var(--surface2); }
.filter-pill.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}


/* ==================== STATS BAR ==================== */
.stats-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px; padding: 8px 16px 4px;
}
.stat-chip {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  box-shadow: var(--shadow); min-width: 0;
}
.stat-chip .stat-val { font-size: 18px; font-weight: 700; color: var(--primary); }
.stat-chip .stat-lbl { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* Em telas maiores volta ao layout horizontal */
@media (min-width: 600px) {
  .stats-bar {
    display: flex; flex-wrap: nowrap;
    overflow-x: auto; scrollbar-width: none;
    gap: 10px; padding: 8px 16px 4px;
  }
  .stats-bar::-webkit-scrollbar { display: none; }
  .stat-chip { flex-shrink: 0; min-width: 100px; }
  .stat-chip .stat-val { font-size: 20px; }
}

/* ==================== FILAMENT GRID ==================== */
.filament-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; padding: 12px 16px;
}
@media (min-width: 640px) {
  .filament-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

.filament-card {
  background: var(--surface); border-radius: 20px;
  box-shadow: var(--shadow-md); overflow: hidden;
  display: flex; flex-direction: column;
  cursor: pointer; transition: transform .2s, box-shadow .2s, border-color .2s;
  border: 1.5px solid var(--border);
}
.filament-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }

.card-hero { position: relative; padding: 18px 0 0; display: flex; justify-content: center; }
.card-dot {
  width: 56px; height: 56px; border-radius: 50%;
  border: 2.5px solid var(--border);
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.card-badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; }
.badge {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
  background: rgba(0,0,0,.45); color: #fff; backdrop-filter: blur(4px);
}
.badge-rfid { background: rgba(28,97,115,.9); }
.badge-low { background: rgba(239,68,68,.85); }
.badge-empty { background: rgba(100,100,100,.85); }

.card-type-chip {
  position: absolute; top: 8px; right: 8px;
  font-size: 10px; font-weight: 700;
  background: var(--surface2); color: var(--text2);
  border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 20px;
}

.card-body { padding: 10px 14px 12px; flex: 1; display: flex; flex-direction: column; gap: 5px; text-align: center; }
.card-name { font-size: 14.5px; font-weight: 700; color: var(--text); line-height: 1.3; }
.card-sub { font-size: 11px; color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.card-weight-bar {
  height: 7px; background: var(--surface2); border-radius: 4px; overflow: hidden;
  margin-top: 4px; border: 1px solid var(--border);
}
.card-weight-fill { height: 100%; border-radius: 4px; transition: width .3s; }
.fill-full { background: linear-gradient(90deg, #2a7d93, #4da7bc); }
.fill-good { background: linear-gradient(90deg, #1C6173, #2a7d93); }
.fill-half { background: linear-gradient(90deg, #E07820, #f59a3c); }
.fill-low  { background: linear-gradient(90deg, #c0392b, #e74c3c); }

.card-weight-text { font-size: 11px; color: var(--text3); }

.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-top: 1px solid var(--border);
}
.card-price { font-size: 12px; font-weight: 700; color: var(--primary); }
.card-actions { display: flex; gap: 4px; }
.card-action-btn {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; background: var(--surface2); transition: background .15s;
}
.card-action-btn:hover { background: var(--border); }
.card-action-btn.danger:hover { background: #fee2e2; }

/* ==================== EMPTY STATE ==================== */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; padding: 60px 32px; text-align: center;
}
.empty-state.hidden { display: none; }
.empty-icon { font-size: 64px; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text2); }
.empty-state p { font-size: 14px; color: var(--text3); }

/* ==================== FAB ==================== */
.fab {
  position: fixed; bottom: 24px; right: 20px; z-index: 200;
  width: var(--fab-size); height: var(--fab-size);
  border-radius: 50%;
  background: linear-gradient(135deg, #f59a3c, #E07820);
  color: #fff; font-size: 28px; font-weight: 300;
  box-shadow: 0 4px 16px rgba(224,120,32,.45);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s, box-shadow .2s;
}
.fab:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(224,120,32,.6); }
.fab:active { transform: scale(.95); }

/* ==================== MODAL ==================== */
.modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: flex-end; }
.modal.hidden { display: none; }
.modal.modal-centered { align-items: center; justify-content: center; }
.modal-overlay {
  position: absolute; inset: 0; background: rgba(5,9,18,.62);
  backdrop-filter: blur(3px);
}
.modal-sheet {
  position: relative; z-index: 1;
  background: var(--surface); width: 100%;
  max-height: 95dvh; border-radius: 24px 24px 0 0;
  display: flex; flex-direction: column;
  animation: slideUp .3s cubic-bezier(.32,1.2,.7,1);
  border-top: 1px solid var(--border);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-header h2 { font-size: 18px; font-weight: 700; }
.modal-close { color: var(--text2); }
.modal-body { overflow-y: auto; padding: 16px 20px 24px; flex: 1; -webkit-overflow-scrolling: touch; }

/* ==================== FORM ==================== */
.form-section {
  margin-bottom: 20px; padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.form-section:last-of-type { border-bottom: none; }
.section-label {
  font-size: 13px; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px;
}
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-group:last-child { margin-bottom: 0; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text2); }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--bg3);
  color: var(--text); font-size: 15px; outline: none; transition: border-color .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; }

/* ==================== COLOR SECTION ==================== */
.color-section { display: flex; flex-direction: column; gap: 12px; }
.color-preview-wrapper { display: flex; justify-content: center; }
.color-preview {
  width: 120px; height: 120px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md), 0 0 0 4px var(--surface), 0 0 0 6px var(--border);
  transition: background .3s;
}
#colorPreviewText { font-size: 11px; font-weight: 700; mix-blend-mode: difference; color: #fff; }
.color-tools { display: flex; gap: 8px; justify-content: center; }

/* ==================== WEIGHT PROGRESS ==================== */
.weight-progress {
  height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; margin-top: 8px;
}
.weight-progress.hidden { display: none; }
.weight-bar-fill { height: 100%; border-radius: 5px; transition: width .4s; }
.weight-label { font-size: 12px; color: var(--text2); margin-top: 4px; text-align: right; }

/* ==================== RFID ==================== */
.rfid-panel { display: flex; flex-direction: column; gap: 12px; }
.rfid-status {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--surface2); border: 1px solid var(--border);
}
.rfid-icon { font-size: 24px; }
#rfidStatusText { font-size: 14px; color: var(--text2); }
.rfid-data {
  padding: 12px; background: var(--surface2); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text2); font-family: monospace;
}
.rfid-data.hidden { display: none; }

/* ==================== FORM ACTIONS ==================== */
.form-actions { display: flex; gap: 10px; padding-top: 8px; }
.form-actions .btn { flex: 1; }

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; transition: all .2s; gap: 6px; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}
.btn-primary:hover { opacity: .9; transform: translateY(-1px); }
.btn-outline { background: none; color: var(--text2); border: 1.5px solid var(--border); }
.btn-outline:hover { background: var(--surface2); border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ==================== CAMERA MODAL ==================== */
.camera-modal-sheet { max-height: 95dvh; }
.camera-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.camera-container {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: #000; aspect-ratio: 4/3; max-height: 50dvh;
}
#cameraVideo { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera-crosshair {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.crosshair-ring {
  width: 80px; height: 80px; border-radius: 50%;
  border: 3px solid rgba(45,212,191,.9);
  box-shadow: 0 0 0 2px rgba(0,0,0,.3), inset 0 0 0 2px rgba(0,0,0,.3);
}
.crosshair-center {
  position: absolute; width: 8px; height: 8px; border-radius: 50%;
  background: rgba(45,212,191,.9);
}
.camera-result {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; background: var(--surface2);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.detected-color-preview {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  box-shadow: var(--shadow-md); border: 3px solid var(--surface); transition: background .1s;
}
.detected-color-info { display: flex; flex-direction: column; gap: 4px; }
.detected-hex { font-size: 18px; font-weight: 700; font-family: monospace; }
.detected-name { font-size: 14px; color: var(--text2); }
.camera-actions { display: flex; gap: 10px; }
.camera-actions .btn { flex: 1; }

/* ==================== WEIGHT MODAL ==================== */
.weight-modal-sheet { max-height: 65dvh; }
.weight-modal-info {
  padding: 12px 16px; background: var(--surface2);
  border-radius: var(--radius-sm); margin-bottom: 16px;
  font-size: 14px; color: var(--text2); border-left: 3px solid var(--primary);
}
.weight-input-big {
  width: 100%; padding: 16px; font-size: 32px !important;
  text-align: center; font-weight: 700 !important;
  border-radius: var(--radius-sm) !important;
  border: 2px solid var(--primary) !important;
}

/* Tara da bobina */
.tare-row { margin-top: 12px; }
.tare-group label { display: flex; align-items: center; gap: 8px; }
.tare-badge {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  background: var(--primary); color: #fff;
  border-radius: 20px; white-space: nowrap;
}
.tare-input-wrap { display: flex; align-items: center; gap: 10px; }
.tare-input-wrap input { flex: 0 0 120px; }
.tare-hint {
  font-size: 12px; color: var(--text3); font-style: italic;
}
.tare-note {
  font-size: 11px; color: var(--text3); margin-top: 4px; line-height: 1.5;
}
.tare-toggle-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text2);
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface2); border: 1px solid var(--border);
  cursor: pointer; margin-bottom: 12px; user-select: none;
}
.tare-toggle-row input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
.tare-net-result {
  font-size: 13px; color: var(--primary); font-weight: 600;
  margin-top: 6px; text-align: center;
}

/* ==================== DETAIL MODAL ==================== */
.detail-hero { text-align: center; padding-top: 6px; }
.detail-blob {
  width: 108px; height: 108px; border-radius: 50%;
  margin: 0 auto;
  border: 2px solid var(--border);
}
.detail-sub { font-size: 12.5px; color: var(--text3); margin-top: 14px; }

.detail-ring-wrap { width: 185px; height: 185px; margin: 18px auto 6px; position: relative; }
.detail-ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.detail-ring-pct { font-size: 38px; font-weight: 800; line-height: 1; color: var(--text); }
.detail-ring-sub { font-size: 11.5px; color: var(--text3); margin-top: 6px; }

.detail-color-header {
  height: 100px; border-radius: var(--radius-sm); margin-bottom: 16px;
  display: flex; align-items: flex-end; padding: 12px;
}
.detail-info-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px;
}
.detail-info-item {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px 14px;
}
.detail-info-item .lbl { font-size: 11px; color: var(--text3); font-weight: 600; text-transform: uppercase; }
.detail-info-item .val { font-size: 16px; font-weight: 700; margin-top: 2px; }
.detail-actions { display: flex; gap: 10px; padding-top: 8px; flex-wrap: wrap; }
.detail-actions .btn { flex: 1; min-width: 140px; }

/* ==================== ANALYTICS ==================== */
.analytics-container { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.analytics-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1.5px solid var(--border); box-shadow: var(--shadow); padding: 16px;
}
.analytics-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 14px; color: var(--text2); }
.analytics-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.summary-item {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; box-shadow: var(--shadow);
}
.summary-item .s-lbl { font-size: 12px; color: var(--text3); }
.summary-item .s-val { font-size: 22px; font-weight: 800; color: var(--primary); margin-top: 4px; }
.summary-item.hl {
  background: linear-gradient(135deg, rgba(28,97,115,.16), rgba(224,120,32,.10));
  border-color: var(--primary-light);
}
.summary-item.hl .s-val { color: var(--text); }

/* projeção */
.proj-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 2px; border-bottom: 1px solid var(--surface2);
  font-size: 13px;
}
.proj-row:last-child { border-bottom: none; }
.proj-dot { width: 13px; height: 13px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(0,0,0,.15); }
.proj-name { flex: 1; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-eta { font-weight: 700; color: var(--text); flex-shrink: 0; }
.proj-eta.warn { color: #E07820; }
.proj-empty { font-size: 13px; color: var(--text3); line-height: 1.5; }

/* ==================== SETTINGS ==================== */
.settings-container { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.settings-profile-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius); padding: 20px; color: #fff;
  display: flex; align-items: center; gap: 14px;
}
.settings-profile-card:empty { display: none; }
.profile-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,.2); display: flex; align-items: center;
  justify-content: center; font-size: 22px; font-weight: 700;
  flex-shrink: 0; border: 2px solid rgba(255,255,255,.3);
}
.profile-name { font-weight: 700; font-size: 16px; }
.profile-email { font-size: 12px; opacity: .75; margin-top: 2px; }
.profile-provider { font-size: 11px; opacity: .6; margin-top: 4px; }

.settings-section {
  background: var(--surface); border-radius: var(--radius);
  border: 1.5px solid var(--border); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.settings-section h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; color: var(--primary); }
.settings-info { font-size: 14px; color: var(--text2); line-height: 1.6; }

/* ==================== CUSTOM TAGS ==================== */
.custom-tag {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 6px; font-size: 14px; color: var(--text);
}
.custom-tag-del {
  background: none; border: none; color: var(--danger);
  cursor: pointer; font-size: 16px; padding: 0 4px; line-height: 1;
}
.custom-tag-del:hover { opacity: .7; }
.custom-brand-row { flex-wrap: wrap; gap: 6px; padding: 10px 12px; }
.custom-tag-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }

/* Modo leitura da tara */
.brand-tare-view {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.brand-tare-text { font-size: 12px; color: var(--text3); white-space: nowrap; }
.brand-tare-text strong { color: var(--text2); font-weight: 600; }

/* Modo edição da tara */
.brand-tare-edit {
  display: flex; align-items: center; gap: 5px; flex-shrink: 0;
}
.brand-tare-edit.hidden, .brand-tare-view.hidden { display: none; }

/* Botão editar (lápis) */
.brand-edit-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 7px; font-size: 13px; cursor: pointer;
  color: var(--text3); line-height: 1.4;
  transition: border-color .15s, background .15s;
}
.brand-edit-btn:hover { border-color: var(--primary); background: var(--surface2); color: var(--primary); }

/* Botão salvar (✓) */
.brand-save-btn {
  background: var(--primary); border: none; border-radius: 6px;
  padding: 3px 9px; font-size: 14px; font-weight: 700; cursor: pointer;
  color: #fff; line-height: 1.4; transition: background .15s;
}
.brand-save-btn:hover { background: var(--primary-dark, #1e5470); }

/* Botão cancelar edição (✕) */
.brand-cancel-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 7px; font-size: 13px; cursor: pointer;
  color: var(--text3); line-height: 1.4; transition: opacity .15s;
}
.brand-cancel-btn:hover { opacity: .7; }

.custom-tare-inline {
  width: 62px; padding: 3px 6px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--bg3);
  color: var(--text); font-size: 13px; outline: none; text-align: center;
  transition: border-color .2s;
}
.custom-tare-inline:focus { border-color: var(--primary); }
.custom-tare-unit { font-size: 12px; color: var(--text3); }

/* Botão lixeira na brand row */
.custom-brand-row .custom-tag-del {
  font-size: 14px; margin-left: 2px;
}

/* Botão de bandeira na linha de marca existente */
.brand-flag-btn {
  font-size: 1.15rem; background: none;
  border: 1.5px solid transparent; border-radius: 5px;
  padding: 1px 3px; cursor: pointer; line-height: 1;
  transition: border-color .1s, background .1s;
}
.brand-flag-btn:hover { border-color: var(--primary-light); background: var(--surface2); }

/* Botão seletor de bandeira no add-brand row */
.brand-flag-picker-btn {
  font-size: 1.35rem; background: var(--surface2);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 5px 9px; cursor: pointer; line-height: 1; flex-shrink: 0;
  transition: border-color .15s;
}
.brand-flag-picker-btn:hover { border-color: var(--primary); }

/* Popover da grade de bandeiras */
.flag-picker-popover {
  position: fixed; z-index: 9999;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 8px;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px;
  max-width: 252px; max-height: 220px; overflow-y: auto;
}
.flag-picker-popover.hidden { display: none; }
.flag-option {
  font-size: 1.35rem; background: none;
  border: 1.5px solid transparent; border-radius: 6px;
  padding: 5px 3px; cursor: pointer; line-height: 1; text-align: center;
  transition: border-color .1s, background .1s;
}
.flag-option:hover { background: var(--surface2); border-color: var(--primary-light); }
.add-custom-row {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center;
}
.add-custom-row input {
  padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--bg3);
  color: var(--text); font-size: 14px; outline: none; transition: border-color .2s;
  min-width: 0;
}
/* nome da marca: ocupa toda a primeira linha no mobile */
.add-brand-name { flex: 1 1 100%; }
/* tara + botão ficam na segunda linha juntos */
.add-tare-input { flex: 1 1 80px; max-width: 120px; text-align: center; }
.add-custom-row .btn { flex-shrink: 0; white-space: nowrap; }
/* em telas maiores: tudo em uma linha */
@media (min-width: 400px) {
  .add-brand-name { flex: 1 1 auto; }
  .add-tare-input { flex: 0 0 90px; }
}
.add-custom-row input:focus { border-color: var(--primary); }
.custom-empty { font-size: 13px; color: var(--text3); font-style: italic; }

/* ==================== SIMULATOR ==================== */
.simulator-container { padding: 16px; display: flex; flex-direction: column; gap: 14px; padding-bottom: 40px; }

.sim-hero {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #1C6173, #0e3543);
  border-radius: var(--radius); padding: 18px 20px; color: #fff;
}
.sim-hero-icon { font-size: 36px; line-height: 1; }
.sim-hero-title { font-size: 18px; font-weight: 800; }
.sim-hero-sub { font-size: 13px; opacity: .75; margin-top: 2px; }

.sim-section {
  background: var(--surface); border-radius: var(--radius);
  border: 1.5px solid var(--border); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.sim-section h3 { font-size: 15px; font-weight: 700; color: var(--primary); margin-bottom: 2px; }
.sim-hint { font-size: 12px; color: var(--text3); margin-top: -4px; }

/* Filament rows */
.sim-filament-row {
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px;
  display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px;
}
.sim-filament-row:last-child { margin-bottom: 0; }
.sim-row-header { display: flex; justify-content: space-between; align-items: center; }
.sim-row-num { font-size: 12px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .5px; }
.sim-row-del {
  background: none; border: none; color: var(--danger);
  font-size: 15px; cursor: pointer; padding: 2px 7px;
  border-radius: 4px; transition: background .15s;
}
.sim-row-del:hover { background: rgba(239,68,68,.1); }

/* Stock status indicators */
.sim-stock-status {
  font-size: 12px; padding: 7px 10px; border-radius: var(--radius-sm);
  line-height: 1.4;
}
.sim-stock-ok   { background: rgba(16,185,129,.1);  color: #065f46; border: 1px solid rgba(16,185,129,.2); }
.sim-stock-warn { background: rgba(245,158,11,.1);  color: #92400e; border: 1px solid rgba(245,158,11,.25); }
.sim-stock-err  { background: rgba(239,68,68,.1);   color: #991b1b; border: 1px solid rgba(239,68,68,.25); font-weight: 600; }
[data-theme="dark"] .sim-stock-ok   { color: #6ee7b7; background: rgba(16,185,129,.12); }
[data-theme="dark"] .sim-stock-warn { color: #fcd34d; background: rgba(245,158,11,.12); }
[data-theme="dark"] .sim-stock-err  { color: #fca5a5; background: rgba(239,68,68,.12); }

/* Stock mini bar */
.sim-stock-bar-wrap { height: 5px; background: var(--border); border-radius: 3px; overflow: visible; margin-top: 4px; position: relative; }
.sim-stock-bar-avail { height: 100%; border-radius: 3px; background: var(--border); position: absolute; inset: 0; }
.sim-stock-bar-use { height: 100%; border-radius: 3px; position: absolute; top: 0; left: 0; transition: width .3s; }

/* Saved project cards */
.sim-saved-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }

.sim-project-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface2);
  margin-bottom: 8px; transition: border-color .15s;
}
.sim-project-card:last-child { margin-bottom: 0; }
.sim-project-card.sim-project-active {
  border-color: var(--primary); background: var(--primary-ultra-light);
}
.sim-project-info { flex: 1; min-width: 0; }
.sim-project-name {
  font-size: 14px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sim-project-meta { font-size: 11px; color: var(--text3); margin-top: 2px; }
.sim-project-btns { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Extra cost rows */
.sim-extra-row { margin-bottom: 8px; }
.sim-extra-fields { display: flex; gap: 8px; align-items: center; }
.sim-extra-fields input {
  padding: 9px 11px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--bg3);
  color: var(--text); font-size: 14px; outline: none; transition: border-color .2s;
}
.sim-extra-fields input:focus { border-color: var(--primary); }
.sim-extra-fields input[type="text"]   { flex: 2; }
.sim-extra-fields input[type="number"] { flex: 1; }

/* Stock warning alert */
.sim-alert {
  padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.5; margin-bottom: 14px;
}
.sim-alert-danger { background: rgba(239,68,68,.1); color: #991b1b; border: 1.5px solid rgba(239,68,68,.25); }
[data-theme="dark"] .sim-alert-danger { color: #fca5a5; background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.3); }

/* Result card */
.sim-result { margin-top: 4px; }
.sim-result-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1.5px solid var(--border); padding: 18px; box-shadow: var(--shadow-md);
}
.sim-result-card > h3 { font-size: 16px; font-weight: 800; margin-bottom: 16px; color: var(--text); }

.sim-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 4px; }
.sim-table th {
  text-align: left; padding: 6px 8px;
  font-size: 10px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 2px solid var(--border);
}
.sim-table th:last-child { text-align: right; }
.sim-table td { padding: 8px 8px; border-bottom: 1px solid var(--border); color: var(--text2); vertical-align: top; }
.sim-table td:last-child { text-align: right; font-weight: 600; white-space: nowrap; }
.sim-table .sim-tr-mat td { color: var(--text); }
.sim-table .sim-tr-mat-err td { color: var(--danger) !important; }
.sim-table .sim-tr-subtotal td { font-weight: 700; color: var(--text); padding-top: 10px; border-top: 2px solid var(--border); border-bottom: none; }
.sim-table .sim-tr-total td { font-size: 15px; font-weight: 800; color: var(--text); background: var(--surface2); padding: 10px 8px; border-top: 2px solid var(--primary); border-bottom: none; }
.sim-table .sim-tr-markup td { color: #E07820; font-weight: 700; border-bottom: none; }

.sim-price-highlight {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px; margin-top: 16px;
  background: linear-gradient(135deg, #E07820, #c45e10);
  border-radius: var(--radius-sm); color: #fff;
}
.sim-price-highlight .sim-ph-label { font-size: 13px; font-weight: 600; opacity: .9; }
.sim-price-val { font-size: 26px; font-weight: 900; letter-spacing: -.5px; }

.sim-result-hero {
  margin-bottom: 14px; border-radius: 22px; padding: 2px;
  background: linear-gradient(90deg, #1C6173, #E07820);
}
.sim-result-hero-inner {
  background: var(--surface); border-radius: 20px;
  padding: 24px 20px; text-align: center;
}
.srh-val { font-size: 40px; font-weight: 800; letter-spacing: -.5px; color: var(--text); }
.srh-lbl { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--text3); margin-top: 8px; }
.srh-sub { font-size: 12px; color: var(--text3); margin-top: 6px; }

.sim-breakdown {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-top: 16px;
}
.sim-bd-item {
  padding: 10px 12px; background: var(--surface2);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
}
.sim-bd-item { position: relative; overflow: hidden; }
.sim-bd-item::before { content:""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.bd-c1::before { background: #E07820; }
.bd-c2::before { background: #fac83c; }
.bd-c3::before { background: #4da7bc; }
.bd-c4::before { background: #0d9488; }
.sim-bd-item .sim-bd-lbl { font-size: 11px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.sim-bd-item .sim-bd-pct { font-size: 20px; font-weight: 800; color: var(--primary); }
.sim-bd-item .sim-bd-val { font-size: 12px; color: var(--text2); }

/* ==================== UTILITIES ==================== */
.hidden { display: none !important; }

/* ==================== WHAT'S NEW MODAL ==================== */
/* Estrutura totalmente independente — não herda .modal/.modal-sheet */
.wn-backdrop {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.65);
  display: flex; align-items: flex-end; justify-content: center;
}
.wn-backdrop.hidden { display: none; }

.wn-box {
  position: relative;
  width: 100%; max-height: 92dvh; overflow-y: auto;
  background-color: #ffffff;
  border-radius: 24px 24px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: slideUp .3s cubic-bezier(.32,1.2,.7,1);
}
[data-theme="dark"] .wn-box { background-color: #0d3b38; }

@media (min-width: 480px) {
  .wn-backdrop { align-items: center; }
  .wn-box {
    max-width: 420px; width: calc(100% - 32px);
    border-radius: 20px; max-height: 90dvh;
    animation: wnPopIn .3s cubic-bezier(.32,1.2,.7,1);
  }
}
@keyframes wnPopIn {
  from { opacity: 0; transform: scale(.93) translateY(12px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

.wn-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 0;
}
.wn-badge {
  font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  background: var(--accent); color: #fff;
  padding: 3px 10px; border-radius: 20px;
}
.wn-hero { text-align: center; font-size: 52px; line-height: 1; padding: 18px 0 8px; }
.wn-title {
  text-align: center; font-size: 20px; font-weight: 700;
  color: var(--text); margin: 0 20px 8px;
}
.wn-desc {
  text-align: center; font-size: 14px; color: var(--text2); line-height: 1.55;
  margin: 0 20px 16px;
}
.wn-steps {
  margin: 0 20px 16px; padding-left: 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.wn-steps li { font-size: 13px; color: var(--text2); line-height: 1.5; }
.wn-steps li strong { color: var(--text); }
.wn-steps li em { color: var(--primary); font-style: normal; font-weight: 600; }
.wn-skip-row {
  display: flex; align-items: center; gap: 8px;
  margin: 0 20px 16px; font-size: 13px; color: var(--text3); cursor: pointer;
}
.wn-skip-row input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; cursor: pointer; }
.wn-cta {
  display: block; width: calc(100% - 40px);
  margin: 0 20px 20px; font-size: 15px; padding: 12px;
}

/* ==================== LANGUAGE SELECTOR ==================== */
.lang-selector { display: flex; gap: 4px; align-items: center; }
.lang-btn {
  background: none; border: 1.5px solid transparent; border-radius: 8px;
  padding: 2px 4px; font-size: 17px; cursor: pointer; opacity: 0.45;
  transition: opacity .2s, border-color .2s; line-height: 1;
}
.lang-btn:hover { opacity: 0.75; }
.lang-btn.active { opacity: 1; border-color: var(--primary); }
.lang-selector-settings {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.lang-selector-settings .lang-btn {
  font-size: 15px; padding: 7px 14px; border-radius: 10px; opacity: 0.55;
  border: 1.5px solid var(--border); background: var(--surface2);
  display: flex; align-items: center; gap: 6px; font-family: inherit;
}
.lang-selector-settings .lang-btn.active {
  opacity: 1; border-color: var(--primary);
  background: var(--primary-faint, rgba(43,107,142,.1));
}

/* Login lang selector */
.lang-selector-login {
  justify-content: center; margin-top: 14px; gap: 6px;
}
.lang-selector-login .lang-btn {
  font-size: 20px; padding: 4px 7px; border-radius: 9px;
  opacity: 0.5; border-color: transparent;
}
.lang-selector-login .lang-btn:hover { opacity: 0.8; }
.lang-selector-login .lang-btn.active {
  opacity: 1; border-color: rgba(255,255,255,.5);
  background: rgba(255,255,255,.1);
}

/* ==================== TOAST ==================== */
.toast {
  position: fixed; bottom: calc(var(--fab-size) + 36px); left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: #fff; padding: 10px 20px;
  border-radius: 20px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg); z-index: 500; opacity: 0;
  transition: all .3s; pointer-events: none; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ==================== RESPONSIVE ==================== */

/* overflow-x: clip não cria scroll container (ao contrário de hidden),
   portanto não quebra position:sticky do header */
#app { overflow-x: clip; }
.modal-body { overflow-x: hidden; }

/* ---- Mobile: fix overflow on very narrow screens (< 480px) ---- */
@media (max-width: 479px) {
  /* Form rows stack vertically to prevent horizontal overflow */
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  /* Extra cost fields: description takes full row, amount + delete below */
  .sim-extra-fields {
    flex-wrap: wrap;
  }
  .sim-extra-fields input[type="text"] {
    flex: 1 1 100%;
    min-width: 0;
  }
  /* Stat chips: slightly smaller values */
  .stat-chip .stat-val { font-size: 18px; }
  .summary-item .s-val { font-size: 18px; }
  /* Sim breakdown stays 2-col even on small screens */
  .sim-result-hero {
  margin-bottom: 14px; border-radius: 22px; padding: 2px;
  background: linear-gradient(90deg, #1C6173, #E07820);
}
.sim-result-hero-inner {
  background: var(--surface); border-radius: 20px;
  padding: 24px 20px; text-align: center;
}
.srh-val { font-size: 40px; font-weight: 800; letter-spacing: -.5px; color: var(--text); }
.srh-lbl { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--text3); margin-top: 8px; }
.srh-sub { font-size: 12px; color: var(--text3); margin-top: 6px; }

.sim-breakdown { grid-template-columns: 1fr 1fr; }
  /* Price highlight: stack on very small */
  .sim-price-highlight { flex-direction: column; align-items: flex-start; gap: 4px; }
  .sim-price-val { font-size: 22px; }
}

/* ---- Desktop: filtros em linha única ---- */
@media (min-width: 600px) {
  .filter-row {
    display: flex; flex-wrap: nowrap; overflow-x: auto;
  }
  .filter-row::-webkit-scrollbar { display: none; }
  .filter-select { width: auto; flex-shrink: 0; }
  .filter-pill { width: auto; flex-shrink: 0; justify-content: flex-start; }
}

/* ---- Tablet (≥ 640px): mild improvements already exist + analytics 2-col ---- */
@media (min-width: 640px) {
  .analytics-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .analytics-summary {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .analytics-proj { grid-column: 1 / -1; }
}

/* ---- Desktop (≥ 960px): full layout redesign ---- */
@media (min-width: 960px) {
  :root { --header-h: 64px; }

  /* === HEADER: collapse to single row === */
  .app-header {
    flex-wrap: nowrap;
    height: var(--header-h);
    padding: 0 32px;
    gap: 0;
  }
  .header-left {
    flex: 0 0 auto;
    padding: 0;
    gap: 10px;
    margin-right: 24px;
    order: 1;
  }
  .app-nav {
    flex: 1 1 auto;
    overflow: visible;
    padding: 0;
    justify-content: center;
    gap: 6px;
    order: 2; /* desktop: nav no centro */
  }
  .nav-btn {
    padding: 8px 20px;
    font-size: 14px;
  }
  .header-right {
    flex: 0 0 auto;
    padding: 0;
    margin-left: 16px;
    order: 3; /* desktop: ações na direita */
  }
  /* User dropdown: align to single-row header */
  .user-dropdown { top: 72px; }

  /* === CONTENT: centered max-width container === */
  #mainContent {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 28px 40px calc(var(--fab-size) + 40px);
    box-sizing: border-box;
  }

  /* Reset inner paddings — #mainContent now provides horizontal padding */
  .view-toolbar { padding: 0 0 14px 0; }
  .stats-bar    { padding: 0 0 8px 0; }
  .filament-grid { padding: 0; }
  .analytics-container { padding: 0; }
  .simulator-container { padding: 0; }
  .settings-container  { padding: 0; }

  /* === INVENTORY === */
  .filament-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
  }
  .stats-bar { flex-wrap: wrap; overflow-x: visible; gap: 12px; }
  .stat-chip { min-width: 110px; }

  /* === ANALYTICS: 2×2 grid === */
  .analytics-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .analytics-summary {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .analytics-proj { grid-column: 1 / -1; }

  /* === MODAL: centered dialog instead of bottom sheet === */
  .modal {
    align-items: center;
    justify-content: center;
  }
  .modal-sheet {
    width: 580px;
    max-width: 92vw;
    border-radius: var(--radius);
    animation: fadeIn .2s ease;
  }
  .weight-modal-sheet { width: 440px; }
  .camera-modal-sheet { width: 520px; }

  /* === SIMULATOR: slightly wider sections === */
  .sim-hero { padding: 22px 28px; }
  .sim-section { padding: 20px; }

  /* === SETTINGS: 2-column grid === */
  .settings-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: start;
  }
  .settings-profile-card { grid-column: 1 / -1; }

  /* === FAB: larger bottom offset on desktop === */
  .fab { bottom: 32px; right: 32px; }
}

/* ==================== RESTOCK ALERT + MARKETPLACE ==================== */
.restock-banner {
  margin: 8px 16px 0;
  background: rgba(224,120,32,.08);
  border: 1px solid rgba(224,120,32,.35);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.restock-banner.hidden { display: none; }
.restock-head { font-size: 12.5px; font-weight: 700; color: #d97a1e; }
[data-theme="dark"] .restock-head { color: #ffb46e; }
.restock-item {
  display: flex; align-items: center; gap: 9px;
  margin-top: 9px; font-size: 12.5px; color: var(--text2);
}
.restock-item .rd { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(0,0,0,.15); }
.restock-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.restock-item b { margin-left: auto; color: #d97a1e; flex-shrink: 0; }
[data-theme="dark"] .restock-item b { color: #ffb46e; }
.rsearch {
  margin-left: 8px; padding: 4px 11px; border-radius: 11px; flex-shrink: 0;
  border: 1px solid rgba(224,120,32,.5); background: rgba(224,120,32,.14);
  color: #d97a1e; font-size: 11px; font-weight: 700; cursor: pointer;
  transition: background .15s;
}
[data-theme="dark"] .rsearch { color: #ffb46e; }
.rsearch:hover { background: rgba(224,120,32,.28); }

.market-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(0,0,0,.55); backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
}
.market-overlay.hidden { display: none; }
.market-sheet {
  width: 100%; max-width: 480px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px 24px 0 0; padding: 18px 22px 28px;
  animation: marketUp .25s ease;
}
@keyframes marketUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.market-grip { width: 38px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto 14px; }
.market-sheet h3 { font-size: 16px; }
.market-name { font-size: 12px; color: var(--text3); margin-top: 4px; }
.market-query {
  margin-top: 12px; background: var(--surface2); border: 1px dashed var(--border);
  border-radius: 10px; padding: 9px 13px; font-size: 12px;
  color: var(--primary); font-family: monospace; word-break: break-word;
}
.market-opt {
  display: flex; align-items: center; gap: 12px; margin-top: 11px;
  padding: 13px 16px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 14px; color: var(--text); text-decoration: none;
  font-size: 14px; font-weight: 600; transition: border-color .15s;
}
.market-opt:hover { border-color: var(--primary); }
.mi {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
}
.mi-ml { background: #ffe600; color: #2d3277; }
.mi-sh { background: #ee4d2d; color: #fff; }
.mi-am { background: #232f3e; color: #ff9900; }
.market-arr { margin-left: auto; color: var(--text3); }
.market-close {
  display: block; width: 100%; margin-top: 14px; padding: 12px;
  border: none; border-radius: 12px; background: transparent;
  color: var(--text3); font-size: 13.5px; cursor: pointer;
}
@media (min-width: 600px) {
  .market-overlay { align-items: center; }
  .market-sheet { border-radius: 24px; }
}

/* ===== Mobile: conteúdo e FAB acima da bottom nav (precisa vir por último no cascade) ===== */
@media (max-width: 599px) {
  #mainContent { padding-bottom: calc(86px + var(--fab-size) + env(safe-area-inset-bottom)); }
  .fab { bottom: calc(86px + env(safe-area-inset-bottom)); right: 16px; }
}

/* CTA laranja (v2) */
.btn-cta {
  background: linear-gradient(90deg, #E07820, #c8540a);
  color: #fff; font-weight: 700;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 22px rgba(224,120,32,.30);
  transition: opacity .15s, transform .15s;
}
.btn-cta:hover { opacity: .92; transform: translateY(-1px); }

/* ==================== ABOUT (Config) ==================== */
.about-box p { font-size: 13px; line-height: 1.6; color: var(--text2); margin: 12px 0; }
.about-head { display: flex; align-items: center; gap: 12px; }
.about-head strong { font-size: 16px; }
.about-head em { font-size: 12.5px; color: var(--text3); }
.about-logo { width: 44px; height: 44px; flex-shrink: 0; }
.about-version {
  font-size: 11px; font-weight: 700; color: #fff;
  background: linear-gradient(90deg, #1C6173, #E07820);
  border-radius: 10px; padding: 2px 8px; vertical-align: middle; margin-left: 4px;
}
.about-links { display: flex; gap: 10px; flex-wrap: wrap; }
.about-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--primary); font-size: 13px; font-weight: 600; text-decoration: none;
  transition: border-color .15s;
}
.about-link:hover { border-color: var(--primary); }


/* ============================================================
   SpoolKit v2 — refresh visual (append; remover este bloco reverte)
   ============================================================ */

/* ---- Estoque: cards em grade -> linhas escaneáveis ---- */
.filament-grid { grid-template-columns: 1fr; gap: 9px; padding: 12px 16px; }
@media (min-width: 660px) { .filament-grid { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); } }

.filament-card { flex-direction: row; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 14px; box-shadow: var(--shadow); }
.filament-card:hover { transform: translateY(-2px); }
.filament-card.card-row-low { border-color: rgba(239,68,68,.5); box-shadow: 0 1px 3px rgba(239,68,68,.12); }

.filament-card .card-dot { width: 42px; height: 42px; flex: none; border: 0; margin: 0; box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--border); }
.filament-card .card-dot.is-light { box-shadow: inset 0 0 0 1px rgba(0,0,0,.15), 0 0 0 3px var(--surface), 0 0 0 4px var(--border); }

.filament-card .card-body { flex: 1; min-width: 0; padding: 0; gap: 5px; text-align: left; }
.filament-card .card-name { font-size: 14px; display: flex; align-items: center; gap: 7px; }
.card-name-badge { font-size: 9px; font-weight: 700; color: #fff; background: var(--danger); border-radius: 20px; padding: 2px 6px; flex: none; }
.filament-card .card-sub { font-size: 11.5px; }
.card-meter { display: flex; align-items: center; gap: 8px; }
.card-meter .card-weight-bar { flex: 1; margin-top: 0; }
.card-meter .card-weight-text { font-size: 11px; white-space: nowrap; }

.card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.card-pct { font-size: 17px; font-weight: 800; color: var(--primary-light); line-height: 1; }
.card-pct.is-low { color: var(--danger); }
.card-side .card-actions { display: flex; gap: 2px; }
.card-side .card-action-btn { width: 26px; height: 26px; font-size: 12.5px; }

/* ---- Stats: faixa única compacta ---- */
#stats-bar.stats-bar { display: block; padding: 8px 16px 4px; }
.stat-strip { display: flex; align-items: stretch; background: var(--surface); border: 1.5px solid var(--border); border-radius: 12px; padding: 11px 4px; box-shadow: var(--shadow); }
.stat-cell { flex: 1; text-align: center; min-width: 0; }
.stat-cell .v { font-size: 16px; font-weight: 800; color: var(--primary); }
.stat-cell .l { font-size: 10px; color: var(--text3); margin-top: 1px; }
.stat-sep { width: 1px; background: var(--border); flex: none; }
@media (min-width: 600px) { .stat-cell .v { font-size: 18px; } }

/* ---- Nav inferior/superior: ícones de linha no lugar dos emojis ---- */
.nav-btn[data-view="inventory"]::before,
.nav-btn[data-view="analytics"]::before,
.nav-btn[data-view="simulator"]::before,
.nav-btn[data-view="settings"]::before {
  content: ""; display: inline-block; width: 20px; height: 20px;
  background-color: currentColor;
  -webkit-mask: var(--ic) no-repeat center / contain; mask: var(--ic) no-repeat center / contain;
}
.nav-btn[data-view="inventory"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z'/%3E%3Cpath d='m3.3 7 8.7 5 8.7-5'/%3E%3Cpath d='M12 22V12'/%3E%3C/svg%3E"); }
.nav-btn[data-view="analytics"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M18 17V9'/%3E%3Cpath d='M13 17V5'/%3E%3Cpath d='M8 17v-3'/%3E%3C/svg%3E"); }
.nav-btn[data-view="simulator"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='16' height='20' x='4' y='2' rx='2'/%3E%3Cline x1='8' x2='16' y1='6' y2='6'/%3E%3Cpath d='M8 14h.01M12 14h.01M16 14h.01M8 18h.01M12 18h.01M16 18h.01'/%3E%3C/svg%3E"); }
.nav-btn[data-view="settings"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' x2='4' y1='21' y2='14'/%3E%3Cline x1='4' x2='4' y1='10' y2='3'/%3E%3Cline x1='12' x2='12' y1='21' y2='12'/%3E%3Cline x1='12' x2='12' y1='8' y2='3'/%3E%3Cline x1='20' x2='20' y1='21' y2='16'/%3E%3Cline x1='20' x2='20' y1='12' y2='3'/%3E%3Cline x1='2' x2='6' y1='14' y2='14'/%3E%3Cline x1='10' x2='14' y1='8' y2='8'/%3E%3Cline x1='18' x2='22' y1='16' y2='16'/%3E%3C/svg%3E"); }
@media (max-width: 599px) {
  .nav-btn[data-view]::before { filter: none !important; width: 23px; height: 23px; }
}

/* ---- Polimento de superfícies ---- */
.search-bar { border-radius: 12px; }
.restock-banner { border-radius: 12px; }

/* ---- Filtros colapsados (sheet) ---- */
.toolbar-row { display: flex; gap: 8px; align-items: stretch; }
.toolbar-row .search-bar { flex: 1; }
.filters-toggle {
  position: relative; flex: none; width: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 12px; color: var(--primary); box-shadow: var(--shadow);
  transition: border-color .15s;
}
.filters-toggle:hover { border-color: var(--primary); }
.filters-toggle svg { width: 18px; height: 18px; }
.filters-count {
  position: absolute; top: -6px; right: -6px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent, #E07820); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 18px; text-align: center;
  border: 2px solid var(--bg);
}
.filters-count.hidden { display: none; }
.filters-sheet { position: fixed; inset: 0; z-index: 320; display: flex; align-items: flex-end; }
.filters-sheet.hidden { display: none; }
.filters-sheet-overlay { position: absolute; inset: 0; background: rgba(5,9,18,.55); backdrop-filter: blur(2px); }
.filters-sheet-panel {
  position: relative; z-index: 1; width: 100%;
  background: var(--surface); border-top: 1px solid var(--border);
  border-radius: 24px 24px 0 0; padding: 18px 20px calc(20px + env(safe-area-inset-bottom));
  animation: slideUp .28s cubic-bezier(.32,1.2,.7,1);
  max-width: 640px; margin: 0 auto;
}
.filters-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.filters-sheet-head h3 { font-size: 17px; font-weight: 700; color: var(--text); }
.filters-sheet .filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 0; overflow: visible; }
.filters-sheet .filter-select, .filters-sheet .filter-pill { width: 100%; }
.filters-sheet #btnHideEmpty { grid-column: 1 / -1; justify-content: center; }
.filters-apply { width: 100%; margin-top: 14px; }

/* ---- Simulador: seções em acordeão ---- */
.sim-section.sim-collapsible > h3 {
  cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0; user-select: none;
}
.sim-section.sim-collapsible > h3::after {
  content: ""; width: 18px; height: 18px; flex: none; background-color: currentColor;
  -webkit-mask: var(--chevron) no-repeat center / contain; mask: var(--chevron) no-repeat center / contain;
  transition: transform .2s;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
.sim-section.sim-collapsible:not(.collapsed) > h3 { margin-bottom: 10px; }
.sim-section.sim-collapsible:not(.collapsed) > h3::after { transform: rotate(180deg); }
.sim-section.sim-collapsible.collapsed > :not(h3) { display: none; }

/* ---- Ícones de linha em títulos i18n (sobrevivem à troca de idioma) ---- */
.section-label[data-ic]::before, h2[data-ic]::before {
  content: ""; display: inline-block; width: 16px; height: 16px;
  margin-right: 7px; vertical-align: -3px; background-color: currentColor;
  -webkit-mask: var(--ic) no-repeat center / contain; mask: var(--ic) no-repeat center / contain;
}
[data-ic="factory"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 20a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8l-7 5V8l-7 5V4a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z'/%3E%3Cpath d='M17 18h1M12 18h1M7 18h1'/%3E%3C/svg%3E"); }
[data-ic="droplet"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z'/%3E%3C/svg%3E"); }
[data-ic="scale"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z'/%3E%3Cpath d='m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z'/%3E%3Cpath d='M7 21h10'/%3E%3Cpath d='M12 3v18'/%3E%3Cpath d='M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2'/%3E%3C/svg%3E"); }
[data-ic="dollar"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' x2='12' y1='2' y2='22'/%3E%3Cpath d='M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'/%3E%3C/svg%3E"); }
[data-ic="radio"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.9 19.1C1 15.2 1 8.8 4.9 4.9'/%3E%3Cpath d='M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Cpath d='M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5'/%3E%3Cpath d='M19.1 4.9C23 8.8 23 15.1 19.1 19'/%3E%3C/svg%3E"); }
