/* ============================================================
   Estoque Fácil — "Livro-razão" design system
   Paper / Ink / Rust — IBM Plex — dense data, sober chrome
   ============================================================ */
:root {
  /* Paper & ink */
  --paper:      #F2EEE3;   /* warm cream background */
  --paper-2:    #E8E2D2;   /* slightly darker — sidebar */
  --surface:    #FBFAF5;   /* almost-white — cards */
  --surface-2:  #F7F4EC;   /* tinted surface for table heads */
  --ink:        #1C1917;   /* warm near-black */
  --ink-2:      #3F3A33;   /* warm dark gray */
  --ink-3:      #78716C;   /* muted */
  --ink-4:      #A8A29E;   /* faint */
  --rule:       #D6D1C4;   /* hairline */
  --rule-soft:  #E5E0D2;
  --rule-strong:#A8A29E;

  /* Accents — single rust + status */
  --rust:       #B45309;   /* primary action / brand */
  --rust-2:     #92400E;
  --rust-3:     #7C2D12;
  --rust-soft:  #FEEAD0;
  --rust-50:    #FEF3E7;

  --ok:         #15803D;
  --ok-soft:    #DCFCE7;
  --ok-50:      #F0FDF4;
  --warn:       #A16207;
  --warn-soft:  #FEF3C7;
  --alert:      #B91C1C;
  --alert-soft: #FEE2E2;
  --alert-50:   #FEF2F2;

  /* Misc */
  --radius:     6px;
  --radius-lg:  10px;
  --shadow-sm:  0 1px 0 rgba(28, 25, 23, 0.04);
  --shadow-md:  0 2px 6px rgba(28, 25, 23, 0.06), 0 1px 1px rgba(28, 25, 23, 0.04);
  --shadow-lg:  0 8px 24px rgba(28, 25, 23, 0.08), 0 2px 4px rgba(28, 25, 23, 0.05);

  --font-sans:  "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:  "IBM Plex Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;

  --ef-primary: var(--rust);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 13.5px;
  line-height: 1.45;
}
a { color: var(--rust); text-decoration: none; }
a:hover { color: var(--rust-2); text-decoration: underline; text-underline-offset: 2px; }

::selection { background: var(--rust); color: white; }

/* ============================================================
   App shell — horizontal navigation + main
   ============================================================ */
.ef-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.ef-app.collapsed { display: flex; }

/* ============================================================
   Horizontal navigation — cream paper, ink labels, rust active rule
   ============================================================ */
.ef-sidebar {
  background: var(--paper-2);
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  min-height: 64px;
  border-right: 0;
  border-bottom: 1px solid var(--rule);
  overflow: visible;
  z-index: 220;
}
.ef-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 0;
  border-right: 0;
  flex-shrink: 0;
}
.ef-brand-mark {
  width: 34px; height: 34px; flex-shrink: 0;
  background: var(--ink);
  color: var(--paper);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.02em;
  border-radius: 2px;
  position: relative;
}
.ef-brand-mark::after {
  content: ""; position: absolute; inset: 2px;
  border: 1px solid var(--paper); border-radius: 1px; opacity: .25;
  pointer-events: none;
}
.ef-brand-logo {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  object-fit: contain;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--surface);
  padding: 3px;
}
.ef-brand-name {
  font-weight: 600; color: var(--ink); font-size: 14.5px;
  letter-spacing: -0.01em; white-space: nowrap;
}
.ef-brand-sub {
  font-size: 10px; color: var(--ink-3);
  font-family: var(--font-mono); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-top: 1px; white-space: nowrap;
}

.ef-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 230;
  flex: none;
  min-height: 52px;
  max-height: 52px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  border-top: 1px solid var(--rule);
  background: var(--paper-2);
  box-shadow: 0 -4px 18px rgba(28, 25, 23, 0.06);
  scrollbar-width: thin;
}
.ef-nav-section {
  display: none;
  padding: 0;
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
}
.ef-nav-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
  height: 36px;
  padding: 0 9px;
  border-radius: 4px;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  overflow: visible;
  transition: background .1s, color .1s;
  text-decoration: none;
  flex: 0 0 auto;
}
.ef-nav-item:hover { background: rgba(28, 25, 23, 0.045); color: var(--ink); text-decoration: none; }
.ef-nav-item .bi { font-size: 13px; width: 15px; text-align: center; color: var(--ink-3); flex-shrink: 0; }
.ef-nav-item:hover .bi { color: var(--ink-2); }
.ef-stock-icon {
  --size: 15px;
  display: inline-block;
  width: var(--size);
  height: var(--size);
  flex: 0 0 var(--size);
  background: url("../img/stock-symbol.png") center / contain no-repeat;
  vertical-align: middle;
}
.ef-stock-icon--sm { --size: 12px; }
.ef-stock-icon--md { --size: 16px; }
.ef-stock-icon--lg { --size: 20px; }
.ef-stock-icon--xl { --size: 28px; }
@supports ((-webkit-mask: url("")) or (mask: url(""))) {
  .ef-stock-icon {
    background: currentColor;
    -webkit-mask: url("../img/stock-symbol.png") center / contain no-repeat;
    mask: url("../img/stock-symbol.png") center / contain no-repeat;
  }
}
.ef-nav-item .ef-stock-icon { opacity: .72; }
.ef-nav-item:hover .ef-stock-icon,
.ef-nav-item.active .ef-stock-icon { opacity: 1; }
.ef-nav-item span {
  display: block;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ef-nav-more {
  flex: 0 0 auto;
  margin-left: auto;
}
.ef-nav-more .ef-nav-item {
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
}
.ef-nav-more .ef-nav-item.show,
.ef-nav-more .ef-nav-item:focus {
  background: rgba(180, 83, 9, 0.08);
  color: var(--ink);
  box-shadow: none;
}
.ef-nav-more .dropdown-toggle::after {
  margin-left: 2px;
  color: var(--ink-3);
}
.ef-config-menu {
  position: fixed !important;
  right: 12px !important;
  bottom: 52px !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  min-width: 220px;
  max-width: calc(100vw - 24px);
  padding: 6px;
  margin-bottom: 8px !important;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 300;
}
.ef-config-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 4px;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
}
.ef-config-menu .dropdown-item .bi {
  width: 16px;
  color: var(--ink-3);
  text-align: center;
}
.ef-config-menu .dropdown-item:hover,
.ef-config-menu .dropdown-item:focus {
  background: rgba(28, 25, 23, 0.045);
  color: var(--ink);
}
.ef-config-menu .dropdown-item.active {
  background: rgba(180, 83, 9, 0.1);
  color: var(--ink);
}
.ef-config-menu .dropdown-item.active .bi {
  color: var(--rust);
}
.ef-config-menu .dropdown-divider {
  border-color: var(--rule);
  margin: 6px 4px;
}
.ef-nav-item.active {
  background: rgba(180, 83, 9, 0.08);
  color: var(--ink);
  font-weight: 600;
}
.ef-nav-item.active::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: -8px;
  bottom: auto;
  height: 2px;
  background: var(--rust);
  border-radius: 2px;
}
.ef-nav-item.active .bi { color: var(--rust); }
.ef-nav-badge {
  margin-left: auto;
  background: var(--alert);
  color: white;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600;
  padding: 0 5px;
  min-width: 16px;
  height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 2px;
  letter-spacing: 0;
  flex-shrink: 0;
}

.ef-sidebar-foot {
  border-top: 0;
  border-left: 0;
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
  max-width: min(230px, 34vw);
  margin-left: auto;
}
.ef-avatar {
  width: 28px; height: 28px; border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 600;
  font-size: 11px;
  letter-spacing: 0;
  flex-shrink: 0;
}
.ef-user-name { color: var(--ink); font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ef-user-role { color: var(--ink-3); font-size: 10.5px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; }

/* The old collapsed state may still exist in localStorage. Keep it neutral. */
.ef-app.collapsed .ef-brand-name,
.ef-app.collapsed .ef-brand-sub,
.ef-app.collapsed .ef-nav-item span:not(.ef-nav-badge),
.ef-app.collapsed .ef-user-name,
.ef-app.collapsed .ef-user-role { display: block; }
.ef-app.collapsed .ef-nav-section,
.ef-app.collapsed .ef-nav-badge { display: none; }
.ef-app.collapsed .ef-nav-item { justify-content: flex-start; padding: 0 9px; }
.ef-app.collapsed .ef-brand { justify-content: flex-start; padding: 12px 16px; }
.ef-app.collapsed .ef-sidebar-foot { justify-content: flex-start; }

/* ============================================================
   Topbar
   ============================================================ */
.ef-main { min-width: 0; display: flex; flex-direction: column; }
.ef-topbar {
  height: 52px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  position: sticky; top: 64px; z-index: 100;
  flex-shrink: 0;
}
.ef-topbar #sidebarToggle { display: none; }
.ef-crumbs {
  color: var(--ink-3); font-size: 12px;
  font-family: var(--font-mono);
  display: flex; gap: 6px; align-items: center;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.ef-crumbs .sep { color: var(--ink-4); }
.ef-crumbs .last { color: var(--ink); }

.ef-cmdk {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  height: 30px;
  padding: 0 8px 0 10px;
  color: var(--ink-3);
  font-size: 12px;
  cursor: pointer;
  width: clamp(180px, 24vw, 280px);
  min-width: 0;
  font-family: var(--font-sans);
  transition: background .1s, border-color .1s;
}
.ef-cmdk:hover { background: var(--surface-2); border-color: var(--rule-strong); color: var(--ink-2); }
.ef-cmdk .bi { font-size: 12px; }
.ef-cmdk .kbd {
  margin-left: auto;
  display: inline-flex; gap: 2px;
}
.kbd-key {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 0 5px;
  height: 18px;
  display: inline-flex; align-items: center;
  color: var(--ink-2);
}

.ef-icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  flex-shrink: 0;
  transition: background .1s, border-color .1s;
}
.ef-icon-btn:hover { background: var(--surface-2); border-color: var(--rule-strong); }

/* ============================================================
   Page content area
   ============================================================ */
.ef-main > main { flex: 1; min-width: 0; }
.ef-content {
  position: relative;
  padding: 26px 28px 96px;
  max-width: 1440px;
  width: 100%;
}
.ef-content.dense { padding: 18px 22px 96px; }

.ef-help-panel {
  position: fixed;
  top: 124px;
  right: 16px;
  width: 40px;
  margin: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  overflow: visible;
  z-index: 240;
}

.ef-help-panel[open] {
  width: min(360px, calc(100% - 56px));
  border: 1px solid var(--rule);
  border-left: 3px solid var(--rust);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.ef-help-panel summary {
  min-height: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  cursor: pointer;
  list-style: none;
  border-radius: 14px;
  outline: none;
}

.ef-help-panel summary::-webkit-details-marker {
  display: none;
}

.ef-help-button-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(28, 25, 23, 0.12));
  transition: transform .12s ease, filter .12s ease;
}

.ef-help-panel summary:hover .ef-help-button-img,
.ef-help-panel summary:focus-visible .ef-help-button-img {
  transform: translateY(-1px) scale(1.03);
  filter: drop-shadow(0 7px 14px rgba(28, 25, 23, 0.16));
}

.ef-help-panel .ef-help-chevron {
  display: none;
  transition: transform .15s ease;
}

.ef-help-panel[open] .ef-help-chevron {
  transform: rotate(180deg);
}

.ef-help-panel[open] summary {
  justify-content: flex-end;
  min-height: 48px;
  padding: 8px 12px;
  border-radius: 0;
  border-bottom: 1px solid var(--rule-soft);
}

.ef-help-panel[open] .ef-help-button-img {
  width: 40px;
  height: 40px;
}

.ef-help-panel[open] .ef-help-chevron {
  position: static;
  margin-left: 8px;
}

.ef-help-body {
  padding: 12px 16px 16px;
  color: var(--ink-2);
  font-size: 12.5px;
}

.ef-help-body p {
  margin: 12px 0 8px;
}

.ef-help-body ol {
  margin: 0;
  padding-left: 18px;
}

.ef-help-body li + li {
  margin-top: 4px;
}

/* ============================================================
   Page header
   ============================================================ */
.ef-page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 24px;
}
.ef-dateline {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.ef-dateline::after {
  content: ""; height: 1px; background: var(--rule); flex: 0 0 16px;
}
.ef-page-head h2 {
  margin: 0; font-size: 26px; font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-family: var(--font-sans);
}
.ef-page-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 5px; max-width: 64ch; }
.ef-actions { display: flex; gap: 6px; align-items: center; }

/* ============================================================
   Buttons
   ============================================================ */
.ef-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-sans);
  font-size: 12.5px; font-weight: 500;
  padding: 0 12px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background .1s, border-color .1s, color .1s;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}
.ef-btn:hover { background: var(--surface-2); border-color: var(--rule-strong); color: var(--ink); text-decoration: none; }
.ef-btn .bi { font-size: 13px; }
.ef-btn .ef-stock-icon,
.btn .ef-stock-icon {
  --size: 14px;
  color: currentColor;
}
.ef-btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.ef-btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); color: var(--paper); }
.ef-btn-rust {
  background: var(--rust);
  border-color: var(--rust);
  color: white;
}
.ef-btn-rust:hover { background: var(--rust-2); border-color: var(--rust-2); color: white; }
.ef-btn-danger { background: var(--alert); border-color: var(--alert); color: white; }
.ef-btn-danger:hover { background: #991B1B; border-color: #991B1B; color: white; }
.ef-btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.ef-btn-ghost:hover { background: rgba(28,25,23,.06); color: var(--ink); }
.ef-btn-sm { height: 26px; padding: 0 8px; font-size: 11.5px; gap: 5px; }
.ef-btn-sm .bi { font-size: 11px; }
.ef-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================
   Cards
   ============================================================ */
.ef-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.ef-card-pad { padding: 18px 20px; }
.ef-card-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.ef-card-head h3 {
  margin: 0; font-size: 12px; font-weight: 600; color: var(--ink);
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
  text-transform: uppercase;
}
.ef-card-head .sub { color: var(--ink-3); font-size: 12px; margin-top: 3px; font-family: var(--font-sans); text-transform: none; letter-spacing: 0; }
.ef-card-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--rule);
  background: var(--surface-2);
}

/* ============================================================
   Metric cards — domain-rich
   ============================================================ */
.ef-metrics {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 18px;
}
@media (max-width: 1100px) { .ef-metrics { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .ef-metrics { grid-template-columns: 1fr; } }

.ef-metric {
  padding: 18px 20px 16px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid transparent;
  display: flex; flex-direction: column; gap: 6px;
  position: relative;
}
.ef-metric:last-child { border-right: none; }
@media (max-width: 1100px) {
  .ef-metric:nth-child(2) { border-right: none; }
  .ef-metric:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
}
.ef-metric-label {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.ef-metric-value {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  display: flex; align-items: baseline; gap: 6px;
}
.ef-metric-value .unit {
  font-size: 13px; color: var(--ink-3); font-weight: 400;
  letter-spacing: 0;
}
.ef-metric-note {
  font-size: 11.5px; color: var(--ink-3);
  display: flex; align-items: center; gap: 6px;
  margin-top: auto;
}
.ef-metric-note .delta-up { color: var(--ok); font-family: var(--font-mono); font-size: 11px; }
.ef-metric-note .delta-down { color: var(--alert); font-family: var(--font-mono); font-size: 11px; }
.ef-metric.alert { background: var(--alert-50); }
.ef-metric.warn  { background: var(--rust-50); }

/* ============================================================
   Tables — dense, ledger-feel
   ============================================================ */
.ef-table-wrap { overflow-x: auto; }
.ef-table-wrap.sticky { max-height: 560px; overflow-y: auto; }
.ef-table-wrap.sticky thead th { position: sticky; top: 0; z-index: 2; }

.ef-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 12.5px;
}
.ef-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 9px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
  font-family: var(--font-mono);
}
.ef-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule-soft);
  color: var(--ink-2);
  vertical-align: middle;
}
.ef-table tr:last-child td { border-bottom: none; }
.ef-table tbody tr { transition: background .1s; }
.ef-table tbody tr:hover { background: rgba(180,83,9,0.04); }
.ef-table .num { font-variant-numeric: tabular-nums; text-align: right; font-family: var(--font-mono); }
.ef-table .mono { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); letter-spacing: 0; }
.ef-table .product-name { font-weight: 500; color: var(--ink); font-size: 12.5px; }
.ef-table .product-sku { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); margin-top: 1px; }

.ef-row-actions { display: inline-flex; gap: 2px; opacity: 0; transition: opacity .1s; }
tr:hover .ef-row-actions { opacity: 1; }
.ef-row-actions button, .ef-row-actions a {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 3px; color: var(--ink-3);
  cursor: pointer; font-size: 12px;
  text-decoration: none;
}
.ef-row-actions button:hover, .ef-row-actions a:hover { background: var(--surface-2); color: var(--ink); border-color: var(--rule); }
.ef-row-actions .danger:hover { color: var(--alert); border-color: #FECACA; background: var(--alert-50); }

/* ============================================================
   Status pills — stamp-like
   ============================================================ */
.ef-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--rule);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.5;
  white-space: nowrap;
}
.ef-pill.dot::before { content: "●"; font-size: 7px; }
.ef-pill.ok    { background: var(--ok-soft); color: #166534; border-color: #BBF7D0; }
.ef-pill.warn  { background: var(--rust-soft); color: var(--rust-3); border-color: #FDBA74; }
.ef-pill.alert { background: var(--alert-soft); color: #991B1B; border-color: #FECACA; }
.ef-pill.info  { background: #DBEAFE; color: #1E40AF; border-color: #BFDBFE; }
.ef-pill.muted { background: var(--paper-2); color: var(--ink-3); border-color: var(--rule); }
.ef-pill.ink   { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ============================================================
   ASCII bars
   ============================================================ */
.ef-bar-mini {
  display: inline-block; width: 80px; height: 8px;
  background: var(--paper-2); border: 1px solid var(--rule);
  border-radius: 2px; overflow: hidden;
  vertical-align: middle;
}
.ef-bar-mini > span { display: block; height: 100%; background: var(--ink); }
.ef-bar-mini.ok > span    { background: var(--ok); }
.ef-bar-mini.warn > span  { background: var(--rust); }
.ef-bar-mini.alert > span { background: var(--alert); }

/* ============================================================
   Forms
   ============================================================ */
.ef-form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.ef-field { display: flex; flex-direction: column; gap: 6px; }
.ef-field.col-12 { grid-column: span 12; }
.ef-field.col-6  { grid-column: span 6; }
.ef-field.col-4  { grid-column: span 4; }
.ef-field.col-3  { grid-column: span 3; }
@media (max-width: 720px) { .ef-field { grid-column: span 12 !important; } }
.ef-label {
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex; gap: 4px; align-items: center;
}
.ef-label .req { color: var(--alert); }
.ef-input, .ef-select, .ef-textarea {
  height: 34px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0 10px;
  background: var(--surface);
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color .1s, box-shadow .1s, background .1s;
  width: 100%;
}
.ef-textarea { height: auto; padding: 9px 10px; min-height: 80px; resize: vertical; }
.ef-input.mono { font-family: var(--font-mono); }
.ef-input:focus, .ef-select:focus, .ef-textarea:focus {
  border-color: var(--ink-2);
  background: white;
  box-shadow: 0 0 0 3px rgba(28,25,23,.08);
}
.ef-input::placeholder { color: var(--ink-4); }

.ef-input-group {
  display: flex; align-items: center;
  border: 1px solid var(--rule); border-radius: 4px; background: var(--surface);
  overflow: hidden;
  transition: border-color .1s, box-shadow .1s;
}
.ef-input-group .bi { color: var(--ink-3); padding: 0 0 0 10px; font-size: 13px; }
.ef-input-group input { border: none; box-shadow: none !important; height: 32px; background: transparent; outline: none; flex: 1; padding: 0 10px; font-family: var(--font-sans); font-size: 13px; color: var(--ink); }
.ef-input-group:focus-within { border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(28,25,23,.08); }

.ef-help { font-size: 11.5px; color: var(--ink-3); }
.ef-help.error { color: var(--alert); }

.ef-switch { width: 32px; height: 18px; border-radius: 999px; background: var(--rule-strong); position: relative; cursor: pointer; transition: background .15s; flex-shrink: 0; display: inline-block; }
.ef-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 999px; background: white; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s; }
.ef-switch.on { background: var(--rust); }
.ef-switch.on::after { left: 16px; }

/* ============================================================
   Alerts
   ============================================================ */
.ef-alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  border-radius: 4px;
  border: 1px solid;
  border-left-width: 3px;
  font-size: 12.5px;
  margin-bottom: 18px;
  background: var(--surface);
}
.ef-alert .bi { font-size: 14px; margin-top: 2px; }
.ef-alert .title { font-weight: 600; color: var(--ink); margin-bottom: 2px; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }
.ef-alert.info    { border-color: var(--rule); border-left-color: var(--ink); }
.ef-alert.info .bi { color: var(--ink); }
.ef-alert.success { border-color: #BBF7D0; border-left-color: var(--ok); background: var(--ok-50); }
.ef-alert.success .bi, .ef-alert.success .title { color: var(--ok); }
.ef-alert.warn    { border-color: #FDBA74; border-left-color: var(--rust); background: var(--rust-50); }
.ef-alert.warn .bi, .ef-alert.warn .title { color: var(--rust); }
.ef-alert.danger  { border-color: #FECACA; border-left-color: var(--alert); background: var(--alert-50); }
.ef-alert.danger .bi, .ef-alert.danger .title { color: var(--alert); }

/* ============================================================
   Segmented tabs
   ============================================================ */
.ef-tabs {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}
.ef-tabs button {
  background: transparent; border: none; padding: 0 12px;
  height: 30px;
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 500;
  cursor: pointer; color: var(--ink-3);
  border-right: 1px solid var(--rule);
}
.ef-tabs button:last-child { border-right: none; }
.ef-tabs button:hover { color: var(--ink); background: var(--surface-2); }
.ef-tabs button.active { background: var(--ink); color: var(--paper); }

/* ============================================================
   Login — minimal centered, no marketing panel
   ============================================================ */
.ef-login {
  min-height: 100vh;
  display: grid; place-items: center;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 31px, rgba(28,25,23,.04) 31px, rgba(28,25,23,.04) 32px),
    var(--paper);
  padding: 40px;
  position: relative;
}
.ef-login::before {
  content: "ESTOQUE FÁCIL · ALMOXARIFADO · ACESSO RESTRITO";
  position: absolute; top: 24px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.3em; color: var(--ink-3);
  white-space: nowrap;
}
.ef-login::after {
  content: "Sistema interno · não compartilhe sua senha";
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.18em; color: var(--ink-4);
  white-space: nowrap;
}
.ef-login-card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 32px 32px 28px;
  box-shadow: var(--shadow-md);
}
.ef-login-brand {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--rule);
}
.ef-login h1 {
  font-size: 20px; margin: 0 0 4px;
  font-weight: 500; letter-spacing: -0.01em;
  color: var(--ink);
}
.ef-login .sub {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 22px;
  display: block;
}

/* ============================================================
   Cmd+K palette
   ============================================================ */
.ef-cmdk-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(28, 25, 23, 0.4);
  backdrop-filter: blur(4px);
  display: grid; place-items: flex-start center;
  padding-top: 12vh;
  animation: efFadeIn .12s ease-out;
}
.ef-cmdk-palette {
  width: 100%; max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: efPopIn .12s ease-out;
}
.ef-cmdk-search {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
}
.ef-cmdk-search .bi { color: var(--ink-3); font-size: 16px; }
.ef-cmdk-search input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: var(--font-sans); font-size: 15px; color: var(--ink);
}
.ef-cmdk-search input::placeholder { color: var(--ink-4); }
.ef-cmdk-list { max-height: 360px; overflow-y: auto; padding: 6px; }
.ef-cmdk-group { padding: 8px 10px 4px; font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; }
.ef-cmdk-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--ink-2);
  font-size: 13px;
  transition: background .08s, color .08s;
}
.ef-cmdk-item:hover, .ef-cmdk-item.ef-selected {
  background: var(--ink);
  color: var(--paper);
}
.ef-cmdk-item .bi { width: 16px; text-align: center; font-size: 14px; color: var(--ink-3); }
.ef-cmdk-item:hover .bi, .ef-cmdk-item.ef-selected .bi { color: var(--paper); }
.ef-cmdk-item .ef-stock-icon { --size: 16px; opacity: .78; }
.ef-cmdk-item:hover .ef-stock-icon,
.ef-cmdk-item.ef-selected .ef-stock-icon {
  filter: brightness(0) invert(1);
  opacity: 1;
}
.ef-cmdk-foot {
  padding: 8px 14px;
  border-top: 1px solid var(--rule);
  display: flex; gap: 14px;
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.ef-cmdk-foot .kbd-key { font-size: 9.5px; height: 16px; padding: 0 4px; }

@keyframes efFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes efPopIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }

/* ============================================================
   Filters bar
   ============================================================ */
.ef-filters {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  flex-wrap: wrap;
}
.ef-filters .grow { flex: 1; min-width: 10px; }

/* ============================================================
   Timeline (movimentações)
   ============================================================ */
.ef-timeline { position: relative; padding: 4px 0; }
.ef-tl-day {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.12em;
  padding: 12px 20px 6px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--rule-soft);
  border-top: 1px solid var(--rule-soft);
  display: flex; align-items: center; gap: 10px;
  font-weight: 600;
}
.ef-tl-day:first-child { border-top: none; }
.ef-tl-day .ef-tl-count { color: var(--ink-4); font-weight: 400; }
.ef-tl-day .ef-tl-totals { margin-left: auto; display: flex; gap: 10px; font-family: var(--font-mono); }
.ef-tl-day .tot-in { color: var(--ok); }
.ef-tl-day .tot-out { color: var(--alert); }

.ef-tl-row {
  display: grid;
  grid-template-columns: 60px 32px 1fr 80px 110px 100px;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--rule-soft);
  transition: background .1s;
}
.ef-tl-row:hover { background: rgba(180,83,9,0.03); }
.ef-tl-row:last-child { border-bottom: none; }
.ef-tl-time {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-3);
}
.ef-tl-marker {
  width: 28px; height: 28px; border-radius: 4px;
  display: grid; place-items: center; font-size: 13px;
  flex-shrink: 0;
}
.ef-tl-marker.in  { background: var(--ok-soft); color: var(--ok); border: 1px solid #BBF7D0; }
.ef-tl-marker.out { background: var(--alert-soft); color: var(--alert); border: 1px solid #FECACA; }

.ef-tl-qty {
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ef-tl-qty.in  { color: var(--ok); }
.ef-tl-qty.out { color: var(--alert); }
.ef-tl-meta { color: var(--ink-3); font-size: 12px; }

/* ============================================================
   ABC bar chart
   ============================================================ */
.ef-abc { display: flex; flex-direction: column; gap: 10px; }
.ef-abc-row { display: grid; grid-template-columns: 18px 1fr 56px 56px; gap: 12px; align-items: center; font-size: 12px; }
.ef-abc-letter {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 11px;
  border-radius: 3px;
  color: white;
}
.ef-abc-row.a .ef-abc-letter { background: var(--ink); }
.ef-abc-row.b .ef-abc-letter { background: var(--rust); }
.ef-abc-row.c .ef-abc-letter { background: var(--ink-3); }
.ef-abc-bar {
  height: 10px; background: var(--paper-2);
  border-radius: 2px; overflow: hidden;
  border: 1px solid var(--rule);
}
.ef-abc-bar > span { display: block; height: 100%; }
.ef-abc-row.a .ef-abc-bar > span { background: var(--ink); }
.ef-abc-row.b .ef-abc-bar > span { background: var(--rust); }
.ef-abc-row.c .ef-abc-bar > span { background: var(--ink-3); }
.ef-abc-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; font-size: 12px; color: var(--ink-2); }
.ef-abc-pct { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); text-align: right; }

/* ============================================================
   Progress
   ============================================================ */
.ef-progress { height: 4px; background: var(--paper-2); border-radius: 2px; overflow: hidden; border: 1px solid var(--rule); }
.ef-progress > span { display: block; height: 100%; background: var(--ink); }
.ef-progress.ok    > span { background: var(--ok); }
.ef-progress.warn  > span { background: var(--rust); }
.ef-progress.alert > span { background: var(--alert); }

/* ============================================================
   Pagination
   ============================================================ */
.ef-pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--rule);
  color: var(--ink-3); font-size: 11.5px;
  font-family: var(--font-mono);
}
.ef-pagination .pages { display: flex; gap: 2px; }
.ef-pagination .pages button {
  min-width: 26px; height: 26px;
  border: 1px solid var(--rule);
  background: var(--surface); color: var(--ink-2);
  border-radius: 3px;
  font-family: var(--font-mono); font-size: 11.5px;
  cursor: pointer; padding: 0 6px;
}
.ef-pagination .pages button:hover { background: var(--surface-2); }
.ef-pagination .pages button.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ============================================================
   Empty state
   ============================================================ */
.ef-empty { padding: 48px 24px; text-align: center; color: var(--ink-3); }
.ef-empty .ico {
  width: 48px; height: 48px; margin: 0 auto 14px;
  border-radius: var(--radius); background: var(--surface-2);
  display: grid; place-items: center; font-size: 20px;
  color: var(--ink-3); border: 1px dashed var(--rule);
}
.ef-empty h4 { color: var(--ink); font-size: 14px; margin: 0 0 4px; font-weight: 600; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; }
.ef-empty p { font-size: 13px; margin: 0; color: var(--ink-3); }

/* ============================================================
   Layout grids
   ============================================================ */
.ef-divider { height: 1px; background: var(--rule); margin: 16px 0; }
.ef-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ef-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .ef-grid-2, .ef-grid-3 { grid-template-columns: 1fr; } }

@media (max-width: 1180px) {
  .ef-help-panel {
    position: fixed;
    top: 124px;
    right: 12px;
    width: 40px;
    margin: 0;
  }
  .ef-help-panel[open] {
    width: min(360px, calc(100vw - 32px));
  }
}

.ef-dashboard-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
@media (max-width: 1100px) { .ef-dashboard-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Scrollbars
   ============================================================ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 999px; border: 2px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   Compatibility: existing Bootstrap-based templates
   ============================================================ */
.ef-content .page-heading {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.ef-content .page-heading h2 {
  font-size: 22px; font-weight: 500; margin: 0;
  color: var(--ink); letter-spacing: -0.01em;
}
.ef-content .page-heading p { color: var(--ink-3); margin: 0; font-size: 12px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; }
.ef-content .form-page-heading {
  max-width: 760px;
}
.ef-content .panel-card { border: 1px solid var(--rule) !important; border-radius: var(--radius-lg) !important; background: var(--surface) !important; box-shadow: none !important; }
.ef-content .filter-card .card-body { background: var(--surface-2); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.ef-content .card { border: 1px solid var(--rule) !important; border-radius: var(--radius-lg) !important; background: var(--surface) !important; box-shadow: none !important; }
.ef-content .card-header { background: var(--surface-2) !important; border-bottom: 1px solid var(--rule) !important; }
.ef-content .card-footer { background: var(--surface-2) !important; border-top: 1px solid var(--rule) !important; }
.ef-content .table { font-size: 12.5px; color: var(--ink-2); }
.ef-content .table th { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); background: var(--surface-2); font-weight: 600; }
.ef-content .table-hover tbody tr:hover { background: rgba(180,83,9,0.04) !important; }
.ef-content .btn-primary { background: var(--rust) !important; border-color: var(--rust) !important; }
.ef-content .btn-primary:hover { background: var(--rust-2) !important; border-color: var(--rust-2) !important; }
.ef-content .alert-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--rule-soft);
}
.ef-content .alert-item:last-child { border-bottom: none; }
.ef-content .empty-state {
  padding: 36px 24px; text-align: center; color: var(--ink-3); font-size: 13px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.ef-content .empty-state .bi { font-size: 28px; color: var(--ink-4); }
.ef-content .empty-state .ef-stock-icon {
  --size: 28px;
  display: block;
  margin: 0 auto 8px;
  opacity: .4;
}

.product-thumb {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
  background: var(--surface-2);
  color: var(--ink-3);
}

.product-thumb-sm {
  width: 34px;
  height: 34px;
  border-radius: 5px;
}

.product-thumb-empty .bi {
  font-size: 18px;
}

.product-thumb-sm.product-thumb-empty .bi {
  font-size: 15px;
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.product-cell-sm {
  gap: 8px;
}

.product-cell-name {
  color: var(--ink);
  font-weight: 600;
  line-height: 1.2;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-cell-meta {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.3;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}

.product-photo-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.product-photo-preview img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--rule);
  background: var(--surface);
}

.product-upload-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.product-upload-box > img,
.product-upload-placeholder {
  width: 112px;
  height: 112px;
  flex: 0 0 112px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--rule);
  background: var(--surface);
}

.product-upload-placeholder {
  display: grid;
  place-items: center;
  color: var(--ink-3);
}

.product-upload-placeholder .bi {
  font-size: 30px;
}

.movement-note-input {
  min-height: 92px;
}

.movement-note {
  display: inline-flex;
  align-items: flex-start;
  gap: 7px;
  max-width: 360px;
  padding: 7px 9px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.35;
}

.movement-note .bi {
  color: var(--rust);
  font-size: 13px;
  margin-top: 1px;
  flex-shrink: 0;
}

.movement-note span {
  overflow-wrap: anywhere;
}

.movement-note-inline {
  display: flex;
  max-width: 320px;
  margin-top: 5px;
  padding: 4px 7px;
  font-size: 11.5px;
}

.movement-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.movement-summary-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
}

.movement-summary-card-success {
  border-color: #BBF7D0;
  background: linear-gradient(180deg, var(--ok-50), var(--surface));
}

.movement-summary-card-danger {
  border-color: #FECACA;
  background: linear-gradient(180deg, var(--alert-50), var(--surface));
}

.movement-summary-label {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.movement-summary-value {
  color: var(--ink);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
}

.movement-summary-note {
  color: var(--ink-3);
  font-size: 12px;
}

.movement-table th,
.movement-table td {
  vertical-align: top;
}

.movement-table {
  table-layout: fixed;
  width: 100%;
  font-size: 12.5px;
}

.movement-date-cell {
  min-width: 0;
  width: 112px;
}

.movement-date-primary {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
}

.movement-date-secondary {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  margin-top: 2px;
}

.movement-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  width: 100%;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.movement-qty-cell {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12.5px;
  white-space: nowrap;
}

.movement-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.movement-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.movement-tag strong {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  margin-right: 5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.movement-note-block {
  display: flex;
  max-width: 100%;
  margin-top: 10px;
  font-size: 11.5px;
}

.movement-table .product-cell-name,
.movement-table .product-cell-meta {
  max-width: 100%;
}

.movement-table .product-cell {
  gap: 0;
  align-items: flex-start;
}

.movement-table .product-cell-name {
  font-size: 12.5px;
  line-height: 1.25;
  white-space: normal;
}

.movement-table .product-cell-meta {
  font-size: 10.5px;
}

.product-detail-photo {
  max-width: 360px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
}

.product-detail-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.company-logo-upload {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.company-logo-upload img,
.company-logo-placeholder {
  width: 144px;
  height: 96px;
  flex: 0 0 144px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--rule);
  background: var(--surface);
  padding: 8px;
}

.company-logo-placeholder {
  display: grid;
  place-items: center;
  color: var(--ink-3);
}

.company-logo-placeholder .bi {
  font-size: 30px;
}

.company-cnpj-box {
  padding: 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.company-cnpj-entry {
  display: flex;
  gap: 8px;
  align-items: center;
}

.company-cnpj-entry .form-control {
  flex: 1;
}

.company-cnpj-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.company-cnpj-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 4px 5px 4px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.company-cnpj-chip button {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}

.company-cnpj-chip button:hover {
  background: var(--alert-soft);
  color: var(--alert);
}

.company-cnpj-empty {
  margin-top: 10px;
  color: var(--ink-3);
  font-size: 12px;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .ef-app { display: flex; }
  .ef-sidebar {
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    min-height: 64px;
  }
  .ef-brand {
    border-right: 0;
    border-bottom: 0;
    width: auto;
  }
  .ef-nav { padding: 6px 8px; }
  .ef-nav-item span {
    display: none;
  }
  .ef-nav-more .ef-nav-item span {
    display: none;
  }
  .ef-nav-item {
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
  }
  .ef-nav-more .ef-nav-item {
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
  }
  .ef-nav-item .bi { width: auto; font-size: 15px; }
  .ef-sidebar-foot { border-left: 0; padding: 0 8px; }
  .ef-sidebar-foot .ef-user-name,
  .ef-sidebar-foot .ef-user-role {
    display: none;
  }
  .ef-topbar { top: 64px; padding: 0 16px; }
  .ef-cmdk { width: 42px; min-width: 42px; justify-content: center; padding: 0; }
  .ef-cmdk span { display: none; }
  .ef-content { padding: 18px 16px 92px; }
  .product-upload-box { align-items: stretch; flex-direction: column; }
  .product-upload-box > img,
  .product-upload-placeholder {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    flex-basis: auto;
  }
  .company-logo-upload { align-items: stretch; flex-direction: column; }
  .company-logo-upload img,
  .company-logo-placeholder {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    flex-basis: auto;
  }
  .company-cnpj-entry { align-items: stretch; flex-direction: column; }
  .ef-tl-row { grid-template-columns: 50px 28px 1fr 60px; }
  .ef-tl-meta, .ef-tl-row > :nth-child(6) { display: none; }
  .movement-summary-grid { grid-template-columns: 1fr; }
  .movement-table { min-width: 0; }
}
