:root {
  --bg: #f5f7fb;
  --bg-soft: #fafbfc;
  --surface: #ffffff;
  --surface-soft: #fcfcfd;
  --ink: #1f2937;
  --ink-soft: #4b5563;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d7dce4;
  --accent: #f3a20b;
  --accent-strong: #de8f00;
  --accent-soft: #fff5dc;
  --accent-pale: #fffaf0;
  --good: #107c56;
  --danger: #b42318;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: linear-gradient(180deg, #f6f8fb 0%, #eef2f7 100%); }
body { min-height: 100vh; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; color: #304156; }
input, select, textarea, .search {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus, .search:focus {
  border-color: rgba(243, 162, 11, .85);
  box-shadow: 0 0 0 4px rgba(243, 162, 11, .12);
}
input[readonly] { background: #f7f8fa; color: #667085; }

.btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: white;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.btn.full { width: 100%; }
.btn.primary { border-color: var(--accent); background: var(--accent); color: #161616; }
.btn.primary:hover { background: #e99904; }
.btn.soft { background: var(--accent-pale); color: #9a5f00; border-color: #f3d799; }
.btn.ghost { background: #f8fafc; }
.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: white;
  display: grid;
  place-items: center;
  color: #4b5563;
}

.eyebrow {
  margin: 0;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
  color: #b7790b;
  text-transform: uppercase;
}
.muted { color: var(--muted); }
.brand-logo { width: 100%; height: auto; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
}
.login-brand {
  padding: 34px;
  display: grid;
  background: radial-gradient(circle at top left, rgba(243, 162, 11, .18), transparent 36%), linear-gradient(135deg, #f8fafc 0%, #eef3f8 100%);
}
.login-brand-card {
  align-self: center;
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 30px;
  padding: 42px;
  box-shadow: var(--shadow);
}
.login-brand-logo { max-width: 300px; margin-bottom: 24px; }
.login-brand h1 { margin: 10px 0 14px; font-size: clamp(34px, 4vw, 54px); line-height: 1.02; letter-spacing: -.05em; }
.login-brand p:not(.eyebrow) { max-width: 620px; color: #536173; font-size: 16px; line-height: 1.7; }
.login-feature-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.login-feature-row span {
  padding: 10px 14px;
  border-radius: 999px;
  background: white;
  border: 1px solid #ecdfbf;
  color: #7a5b16;
  font-size: 12px;
  font-weight: 800;
}
.login-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 26px;
}
.login-card {
  width: min(460px, 100%);
  padding: 30px;
  border-radius: 26px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.85);
  box-shadow: var(--shadow);
}
.login-card-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.login-form-logo { max-width: 240px; }
.login-card h2 { margin: 4px 0 0; font-size: 28px; letter-spacing: -.04em; }
.login-help { margin: 14px 0 0; font-size: 12px; color: #667085; line-height: 1.6; }
.mobile-logo-row { display: none; }
.mobile-logo-img { max-width: 220px; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid rgba(214, 221, 232, .75);
  background: linear-gradient(180deg, #fcfdff 0%, #f4f7fb 100%);
}
.sidebar-brand-card {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #fff9ea 100%);
  border: 1px solid #f0e4c7;
  box-shadow: 0 12px 28px rgba(17, 24, 39, .05);
}
.sidebar-logo { max-width: 198px; }
.sidebar-welcome { margin-top: 12px; padding-top: 12px; border-top: 1px solid #f3ead1; }
.sidebar-welcome small { display: block; color: #8c6a18; font-size: 11px; }
.sidebar-welcome strong { display: block; margin-top: 4px; font-size: 15px; color: #182534; }
#nav { display: grid; gap: 8px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0 14px;
  background: transparent;
  color: #314155;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}
.nav-item:hover { background: rgba(243, 162, 11, .08); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(243, 162, 11, .14), rgba(243, 162, 11, .04));
  border-color: rgba(243, 162, 11, .28);
  color: #1d2433;
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-icon {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: white;
  border: 1px solid #eceff4;
  color: #8b6b1e;
  font-size: 12px;
  font-weight: 900;
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid #e4e8ef;
  display: flex;
  gap: 10px;
  align-items: center;
}
.user-chip {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.user-chip > span {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: #7a5200;
  font-weight: 800;
}
.user-chip strong, .user-chip small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.user-chip strong { font-size: 12px; color: #162131; }
.user-chip small { margin-top: 2px; font-size: 10px; color: #798497; }
.workspace { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(214, 221, 232, .8);
  background: rgba(250, 251, 253, .92);
  backdrop-filter: blur(12px);
}
.topbar h2 { margin: 4px 0 0; font-size: 28px; letter-spacing: -.05em; }
.topbar-actions { margin-left: auto; }
.menu-btn { display: none; }
.content { width: 100%; max-width: 1500px; margin: 0 auto; padding: 22px 24px 40px; flex: 1; }

.grid { display: grid; gap: 16px; }
.grid.cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(220, 226, 235, .85);
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .05);
}
.card.pad { padding: 20px; }
.stat { padding: 18px; }
.stat .label { color: #6c7a8c; font-size: 12px; font-weight: 800; }
.stat strong { display: block; margin-top: 8px; font-size: 28px; letter-spacing: -.05em; }
.stat small { display: block; margin-top: 6px; color: #8a94a4; font-size: 11px; }
.section-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.section-head h3 { margin: 0; font-size: 20px; letter-spacing: -.04em; }
.section-head p { margin: 6px 0 0; color: #6f7d8d; font-size: 12px; }
.section-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.quote-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}
.quote-main { display: grid; gap: 16px; min-width: 0; }
.summary-side {
  padding: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fffefb 100%);
}
.summary-side h3 { margin: 0; font-size: 18px; }
.summary-side .hint { margin: 5px 0 16px; color: #7d8796; font-size: 11px; }
.summary-list { display: grid; gap: 10px; }
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: #536173;
  font-size: 12px;
}
.summary-row strong { color: #1f2937; font-size: 13px; }
.summary-row.total {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.summary-row.total span { font-size: 13px; font-weight: 700; color: #3c4758; }
.summary-row.total strong { font-size: 22px; letter-spacing: -.04em; }
.summary-actions { display: grid; gap: 10px; margin-top: 18px; }
.summary-mini-note { margin-top: 14px; padding: 12px; border-radius: 14px; background: var(--accent-pale); border: 1px solid #f2dfb4; color: #7a5a14; font-size: 11px; line-height: 1.55; }

.quote-form-card .fields { gap: 10px 12px; }
.fields { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.field { grid-column: span 4; min-width: 0; }
.field.span-2 { grid-column: span 2; }
.field.span-3 { grid-column: span 3; }
.field.span-4 { grid-column: span 4; }
.field.span-5 { grid-column: span 5; }
.field.span-6 { grid-column: span 6; }
.field.span-7 { grid-column: span 7; }
.field.span-8 { grid-column: span 8; }
.field.span-9 { grid-column: span 9; }
.field.span-12 { grid-column: span 12; }
.field .help { margin-top: 4px; font-size: 10px; color: #8b95a5; }
.input-action { display: flex; gap: 8px; align-items: stretch; }
.input-action input { flex: 1; }
.quote-form-card input, .quote-form-card select, .quote-form-card textarea { font-size: 13px; }
.compact-hint {
  margin-top: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  background: #fafbff;
  border: 1px dashed #d8ddeb;
  color: #6a7380;
  font-size: 11px;
  line-height: 1.55;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 14px 14px 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tab {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px 12px 0 0;
  border: 1px solid transparent;
  border-bottom: 0;
  background: transparent;
  color: #748193;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.tab.active {
  background: white;
  color: #1c2433;
  border-color: var(--line);
}
.tab-panel { padding: 18px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th {
  background: #fbfbfc;
  color: #7a8596;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 11px 12px;
  border-bottom: 1px solid #edf1f5;
  font-size: 12px;
  color: #455262;
  vertical-align: top;
}
tr:last-child td { border-bottom: 0; }
td strong { color: #1b2432; }
.table-actions { display: flex; gap: 6px; }
.mini-btn {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: white;
  color: #465365;
  font-size: 11px;
  font-weight: 800;
}
.mini-btn.danger { color: var(--danger); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search { min-width: 260px; max-width: 420px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #5a6779;
  font-size: 10px;
  font-weight: 900;
}
.badge.good { background: #ecfdf3; color: var(--good); }
.badge.warn { background: var(--accent-pale); color: #8a5a00; }
.badge.off { background: #f3f4f6; color: #7b8190; }
.limit-box {
  background: linear-gradient(180deg, #fffaf0 0%, #fffef8 100%);
  border: 1px solid #f1dfb6;
  border-radius: 14px;
  padding: 12px 14px;
  color: #82580b;
  font-size: 11px;
  line-height: 1.65;
}
.meta-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
.meta-row {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  font-size: 11px;
  color: #6b7280;
}
.meta-row strong { color: #1f2937; font-size: 11px; }
.empty { text-align: center; padding: 34px 18px; color: #8892a1; }
.empty .empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #f6f7f9;
  border: 1px solid #eceff3;
  color: #b4bdcb;
  font-size: 20px;
}
.empty strong { display: block; color: #1f2937; font-size: 14px; margin-bottom: 4px; }
.empty span { font-size: 11px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 15, 22, .45);
  backdrop-filter: blur(4px);
}
.modal {
  width: min(760px, 100%);
  max-height: min(90vh, 920px);
  overflow-y: auto;
  background: #ffffff;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.5);
  box-shadow: 0 26px 64px rgba(0, 0, 0, .18);
}
.modal-head {
  display: flex;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-head p { margin: 6px 0 0; color: #6f7c8b; font-size: 11px; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; border-top: 1px solid var(--line); }
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 300;
  min-width: 260px;
  max-width: 430px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #111827;
  color: white;
  box-shadow: 0 14px 36px rgba(0,0,0,.18);
  font-size: 12px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #ab2b2b; }
.mobile-item-list { display: none; }
.mobile-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px;
  background: #fff;
}
.mobile-item + .mobile-item { margin-top: 8px; }
.mobile-item h4 { margin: 0; font-size: 13px; }
.mobile-item .sub { color: #7b8697; font-size: 11px; margin-top: 4px; }
.mobile-item-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; font-size: 11px; }
.mobile-item-grid span { color: #7b8697; }
.mobile-item-grid strong { display: block; margin-top: 3px; color: #182433; }
.mobile-item .table-actions { margin-top: 10px; }

@media (max-width: 1200px) {
  .grid.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quote-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { min-height: 100vh; padding: 18px; }
  .mobile-logo-row { display: block; margin-bottom: 12px; }
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 286px;
    transform: translateX(-104%);
    transition: transform .22s ease;
    z-index: 60;
    box-shadow: 18px 0 40px rgba(15, 23, 42, .14);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: grid; }
  .topbar { padding: 14px 16px; min-height: 72px; }
  .topbar h2 { font-size: 24px; }
  .content { padding: 16px 14px 32px; }
  .field, .field.span-2, .field.span-3, .field.span-4, .field.span-5, .field.span-6, .field.span-7, .field.span-8, .field.span-9 { grid-column: span 6; }
  .field.span-12 { grid-column: span 12; }
  .table-desktop-items { display: none; }
  .mobile-item-list { display: block; }
}
@media (max-width: 620px) {
  .grid.cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat strong { font-size: 22px; }
  .card.pad, .summary-side { padding: 16px; }
  .field, .field.span-2, .field.span-3, .field.span-4, .field.span-5, .field.span-6, .field.span-7, .field.span-8, .field.span-9, .field.span-12 { grid-column: span 12; }
  .section-head { flex-direction: column; }
  .section-head .actions { width: 100%; margin-left: 0; }
  .section-head .actions .btn { width: 100%; }
  .summary-row.total strong { font-size: 18px; }
  .summary-actions .btn { width: 100%; }
  .input-action { flex-direction: column; }
  .topbar-actions .btn { min-width: 44px; padding: 0 12px; font-size: 0; }
  .topbar-actions .btn::after { content: '+'; font-size: 18px; }
  .modal-backdrop { padding: 8px; place-items: end center; }
  .modal { border-radius: 20px 20px 0 0; max-height: 92vh; }
  .login-card { padding: 24px 20px; }
}

@media print {
  body { background: white !important; }
  #loginView, #appView, #modalBackdrop, #toast { display: none !important; }
}

/* ===== Embalar V2 - acabamento visual ===== */
:root {
  --bg: #f7f9fc;
  --bg-soft: #fbfcfe;
  --ink: #202936;
  --ink-soft: #526071;
  --muted: #7a8595;
  --line: #e8ecf1;
  --line-strong: #dce2e9;
  --accent: #f5a20a;
  --accent-strong: #e89500;
  --accent-soft: #fff4d9;
  --accent-pale: #fffaf0;
  --shadow: 0 10px 30px rgba(31, 41, 55, .055);
}
html, body { background: #f6f8fb; }
label { gap: 5px; font-size: 11px; font-weight: 750; color: #3b4858; }
input, select, textarea, .search { min-height: 38px; border-radius: 10px; padding: 8px 10px; font-size: 12px; }
textarea { min-height: 96px; }
.btn { min-height: 38px; border-radius: 10px; padding: 0 14px; font-size: 12px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; }

.login-brand { background: radial-gradient(circle at 18% 15%, rgba(245,162,10,.11), transparent 30%), #f6f8fb; }
.login-brand-card { padding: 38px; background: rgba(255,255,255,.88); border: 1px solid #edf0f4; box-shadow: 0 20px 55px rgba(31,41,55,.07); }
.login-brand-logo { max-width: 330px; }
.login-brand h1 { font-size: clamp(30px, 3.7vw, 49px); }
.login-card { border: 1px solid #e9edf2; box-shadow: 0 20px 55px rgba(31,41,55,.08); }
.login-form-logo { max-width: 270px; }
.login-card h2 { font-size: 24px; }

.app-shell { grid-template-columns: 272px minmax(0, 1fr); }
.sidebar { padding: 16px; gap: 14px; border-right: 1px solid #e8edf3; background: #fbfcfe; }
.sidebar-brand-card { padding: 16px; border-radius: 17px; background: #fff; border: 1px solid #e7ebf0; box-shadow: 0 8px 24px rgba(31,41,55,.045); position: relative; overflow: hidden; }
.sidebar-brand-card::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, #f5a20a 0 35%, #2b2b2d 35% 100%); opacity: .9; }
.sidebar-logo { max-width: 214px; }
.sidebar-welcome { margin-top: 10px; padding-top: 10px; }
.sidebar-welcome small { color: #858e9b; font-size: 10px; }
.sidebar-welcome strong { font-size: 13px; }
#nav { gap: 5px; }
.nav-item { min-height: 42px; border-radius: 11px; padding: 0 11px; font-size: 12px; gap: 9px; }
.nav-item.active { background: #fff7e8; border-color: #f4dfb5; box-shadow: inset 3px 0 0 var(--accent); }
.nav-icon { width: 20px; height: 20px; border-radius: 7px; font-size: 10px; }
.user-chip { border-radius: 12px; padding: 8px; }
.user-chip > span { width: 32px; height: 32px; flex-basis: 32px; border-radius: 9px; font-size: 11px; }

.topbar { min-height: 68px; padding: 13px 20px; background: rgba(250,251,253,.96); }
.topbar h2 { margin-top: 2px; font-size: 21px; letter-spacing: -.025em; }
.content { max-width: 1580px; padding: 18px 20px 34px; }
.card { border-radius: 16px; box-shadow: 0 8px 24px rgba(31,41,55,.04); }
.card.pad { padding: 16px; }
.stat { padding: 15px; }
.stat strong { font-size: 24px; }
.section-head { margin-bottom: 11px; }
.section-head h3 { font-size: 16px; letter-spacing: -.02em; }
.section-head p { margin-top: 4px; font-size: 10.5px; }

.quote-layout { grid-template-columns: minmax(0, 1fr) 286px; gap: 13px; }
.quote-main { gap: 13px; }
.quote-form-card .fields { gap: 8px 10px; }
.quote-form-card input, .quote-form-card select, .quote-form-card textarea { font-size: 12px; }
.summary-side { position: static !important; top: auto !important; align-self: start; padding: 15px; background: #fff; }
.summary-side h3 { font-size: 15px; letter-spacing: -.01em; }
.summary-side .hint { margin: 4px 0 12px; font-size: 9.5px; }
.summary-list { gap: 7px; }
.summary-row { font-size: 10.5px; }
.summary-row strong { font-size: 11px; }
.summary-row.total { padding-top: 10px; }
.summary-row.total span { font-size: 11px; }
.summary-row.total strong { font-size: 18px; }
.summary-actions { gap: 7px; margin-top: 13px; }
.summary-mini-note { margin-top: 10px; padding: 9px; border-radius: 10px; font-size: 9.5px; line-height: 1.45; }
.tabs { padding: 10px 10px 0; }
.tab { min-height: 37px; padding: 0 12px; border-radius: 10px 10px 0 0; font-size: 10.5px; }
.tab-panel { padding: 14px; }
.compact-hint { padding: 9px 10px; border-radius: 10px; font-size: 9.5px; }
.standard-terms-preview { margin-top: 10px; padding: 11px; border: 1px solid #eee2ca; border-radius: 12px; background: #fffdf8; }
.standard-terms-preview > strong { display: block; margin-bottom: 7px; font-size: 11px; color: #283343; }
.standard-terms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 14px; font-size: 9.5px; color: #687386; line-height: 1.45; }
.standard-terms-grid span::before { content: '• '; color: #d98b00; font-weight: 900; }
.standard-terms-preview small { display: block; margin-top: 8px; color: #8a651f; font-size: 9px; line-height: 1.45; }

.table-wrap { border-radius: 12px; }
th { padding: 8px 9px; font-size: 8.5px; }
td { padding: 9px; font-size: 10.5px; }
.mini-btn { min-height: 30px; border-radius: 8px; font-size: 9.5px; padding: 0 8px; }
.badge { padding: 4px 7px; font-size: 8.5px; }
.limit-box { border-radius: 11px; padding: 10px 11px; font-size: 10px; }
.meta-list { gap: 5px; }
.meta-row { padding: 3px 0; font-size: 9.5px; }
.meta-row strong { max-width: 64%; text-align: right; font-size: 9.5px; }
.meta-row.highlight { margin-top: 2px; padding: 8px 9px; border-radius: 9px; background: #fff7e7; border: 1px solid #f2dfb9; color: #75520d; }
.modal { border-radius: 17px; }
.modal-head { padding: 15px 17px 10px; }
.modal-head h3 { font-size: 15px; }
.modal-body { padding: 14px 17px; }
.modal-foot { padding: 10px 17px 14px; }
.mobile-item-wide { grid-column: 1 / -1; padding-top: 5px; border-top: 1px dashed #e6eaf0; }

.mobile-product-list { display: none; }
.mobile-product-card { padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.mobile-product-card + .mobile-product-card { margin-top: 8px; }
.mobile-product-card h4 { margin: 0; font-size: 12px; }
.mobile-product-card .sub { margin-top: 2px; color: var(--muted); font-size: 9.5px; }
.mobile-product-card .product-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.mobile-product-card .product-meta-grid span { display: block; font-size: 8.5px; color: #8a94a3; }
.mobile-product-card .product-meta-grid strong { display: block; margin-top: 2px; font-size: 10px; color: #293544; }
.mobile-product-card .table-actions { margin-top: 9px; }

@media (max-width: 1200px) {
  .quote-layout { grid-template-columns: 1fr; }
  .summary-side { order: 2; max-width: none; }
  .summary-list { grid-template-columns: repeat(3, 1fr); display: grid; gap: 8px; }
  .summary-row { display: block; padding: 8px; border: 1px solid #edf0f4; border-radius: 9px; }
  .summary-row strong { display: block; margin-top: 3px; }
  .summary-row.total { margin: 0; padding: 8px; border-top: 1px solid #f0d8a8; background: #fffaf0; }
  .summary-actions { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .sidebar { width: 292px; padding: 14px; }
  .sidebar-logo { max-width: 220px; }
  .topbar { min-height: 62px; padding: 11px 13px; }
  .topbar h2 { font-size: 18px; }
  .content { padding: 12px 10px 24px; }
  .card.pad { padding: 13px; }
  .field, .field.span-2, .field.span-3, .field.span-4, .field.span-5, .field.span-6, .field.span-7, .field.span-8, .field.span-9 { grid-column: span 6; }
  .field.span-12 { grid-column: span 12; }
  .standard-terms-grid { grid-template-columns: 1fr; }
  #productsTable .table-wrap { display: none; }
  .mobile-product-list { display: block; }
}

@media (max-width: 620px) {
  body { background: #f7f8fa; }
  .login-panel { padding: 12px; }
  .login-card { padding: 21px 17px; border-radius: 19px; }
  .login-form-logo { max-width: 235px; }
  .mobile-logo-row { margin-bottom: 8px; }
  .grid.cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 12px; }
  .stat .label { font-size: 9px; }
  .stat strong { font-size: 18px; }
  .field, .field.span-2, .field.span-3, .field.span-4, .field.span-5, .field.span-6, .field.span-7, .field.span-8, .field.span-9, .field.span-12 { grid-column: span 12; }
  .quote-form-card .fields { gap: 8px; }
  .summary-side { padding: 13px; }
  .summary-list { grid-template-columns: 1fr 1fr; }
  .summary-actions { grid-template-columns: 1fr; }
  .summary-row.total { grid-column: 1 / -1; }
  .tabs { padding-left: 8px; padding-right: 8px; }
  .tab { flex: 1; padding: 0 7px; }
  .tab-panel { padding: 11px; }
  .section-head h3 { font-size: 14px; }
  .mobile-item { border-radius: 12px; padding: 11px; }
  .mobile-item-grid { gap: 7px; }
  .input-action { gap: 6px; }
  .input-action .btn { width: 100%; }
  .modal-backdrop { padding: 6px; }
  .modal { max-height: 94vh; border-radius: 18px 18px 0 0; }
  .modal-foot { position: sticky; bottom: 0; background: rgba(255,255,255,.97); }
  .modal-foot .btn { flex: 1; }
}

@media (max-width: 900px) { .mobile-logo-row { display: none !important; } }


/* ===== Embalar V4 - assinatura das telas ===== */
.screen-credit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #8a929e;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
  transition: color .18s ease, transform .18s ease;
}
.screen-credit::before { content: '◦'; color: #f3a20b; font-size: 15px; line-height: 0; }
.screen-credit:hover { color: #b87908; transform: translateY(-1px); }
.login-credit { margin-top: 16px; }
.app-credit-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  padding: 10px 18px 14px;
  border-top: 1px solid #edf0f4;
  background: rgba(250,251,253,.9);
}
@media (max-width: 620px) {
  .login-credit { margin-top: 13px; }
  .app-credit-footer { padding: 9px 12px 12px; }
  .screen-credit { font-size: 9.5px; }
}
