/* ============================================================
   MMP PROPOSTA — app.css
   Design system inspirado na loja MMP
   amarelo-gema + azul-marinho + verde-kelly + vermelho CTA
============================================================ */

/* ==========================================================
   TOKENS
========================================================== */
:root {
  /* Brand */
  --navy:        #0B2545;
  --navy-2:      #16305C;
  --navy-3:      #22437A;
  --yellow:      #FFD233;
  --yellow-dk:   #E6B81F;
  --yellow-lt:   #FFF0B3;
  --green:       #6BB536;
  --green-dk:    #548C2A;
  --green-lt:    #E4F2D2;
  --red:         #DA2F2F;
  --red-dk:      #B42323;
  --red-lt:      #FADEDE;
  --cyan:        #25B4C2;

  /* Surface */
  --bg:          #F6F7F4;
  --bg-2:        #EEF0EB;
  --surface:     #FFFFFF;
  --surface-2:   #FAFAF5;
  --surface-3:   #F2F3EE;

  /* Ink */
  --ink:         #0D1524;
  --ink-2:       #223050;
  --ink-3:       #5A6786;
  --ink-4:       #94A0BE;

  /* Lines */
  --line:        #E8EAF0;
  --line-2:      #D3D8E4;
  --line-strong: #B5BCCF;

  /* Semantic */
  --success:     #4F9F2D;
  --success-lt:  #E5F3DB;
  --warn:        #E6A818;
  --warn-lt:     #FCF0CE;
  --danger:      var(--red);
  --danger-lt:   var(--red-lt);
  --info:        #3B7DB0;
  --info-lt:     #DBEBF7;

  /* Typography — display (Poppins, ~Google Sans do site MMP) + corpo (Nunito) */
  --f-display:   'Poppins', 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-sans:      'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono:      'JetBrains Mono', 'SF Mono', Menlo, monospace;

  /* Radii / Shadows */
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --sh-sm: 0 1px 2px rgba(11,37,69,.05);
  --sh:    0 1px 2px rgba(11,37,69,.05), 0 4px 14px rgba(11,37,69,.07);
  --sh-md: 0 4px 10px rgba(11,37,69,.08), 0 16px 36px rgba(11,37,69,.12);
  --sh-lg: 0 10px 25px rgba(11,37,69,.12), 0 30px 60px rgba(11,37,69,.18);

  --sidebar-w: 258px;
}

/* ==========================================================
   RESET
========================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--f-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; color: var(--ink); font-family: var(--f-display); letter-spacing: -.01em; }
/* Títulos/marca na fonte de display (Poppins) — dá a cara MMP, menos genérico */
.page-title, .card-title, .stat-value, .login-title, .login-brand-name,
.sidebar-brand-name, .boot-title, .page-eyebrow, .sect-title, .modal-head h3 { font-family: var(--f-display); }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* ==========================================================
   BOOT SCREEN
========================================================== */
#boot {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, var(--yellow) 0%, #FFC810 50%, var(--yellow-dk) 100%);
  display: grid; place-items: center;
  z-index: 9999;
  transition: opacity .35s;
}
#boot.gone { opacity: 0; pointer-events: none; }
.boot-inner { text-align: center; }
.boot-mark {
  width: 96px; height: 96px;
  background: var(--navy);
  color: var(--yellow);
  font-weight: 900; font-size: 32px;
  letter-spacing: -.04em;
  border-radius: 24px;
  display: grid; place-items: center;
  margin: 0 auto 20px;
  box-shadow: 0 12px 32px rgba(11,37,69,.25);
  animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.boot-title { color: var(--navy); font-weight: 900; font-size: 22px; letter-spacing: -.01em; }
.boot-msg   { color: var(--navy); opacity: .7; font-size: 13px; margin-top: 8px; font-weight: 600; }

/* ==========================================================
   LOGIN
========================================================== */
#login {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 20%, rgba(107,181,54,.08), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(218,47,47,.06), transparent 40%),
    linear-gradient(180deg, #FFE97A 0%, var(--yellow) 60%, #FFC810 100%);
  position: relative;
}
#login::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(11,37,69,.04) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}
.login-card {
  position: relative;
  width: 460px;
  max-width: 100%;
  background: var(--surface);
  border-radius: 24px;
  padding: 44px 44px 36px;
  box-shadow: 0 24px 70px rgba(11,37,69,.22), 0 4px 10px rgba(11,37,69,.08);
}
.login-stripe {
  position: absolute;
  left: -4px; right: -4px; top: -4px;
  height: 10px;
  border-radius: 16px 16px 0 0;
  background: repeating-linear-gradient(
    90deg,
    var(--red) 0 28px,
    var(--yellow) 28px 56px,
    var(--green) 56px 84px,
    var(--cyan) 84px 112px);
  opacity: .9;
}
.login-header {
  display: flex; align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}
.login-mark {
  width: 64px; height: 64px;
  background: var(--navy);
  color: var(--yellow);
  font-weight: 900; font-size: 22px;
  letter-spacing: -.03em;
  border-radius: 18px;
  display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(11,37,69,.25);
  position: relative;
}
.login-mark::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 10px;
  height: 3px;
  background: var(--yellow);
  border-radius: 2px;
}
.login-brand-text { line-height: 1.2; }
.login-brand-name { font-weight: 900; font-size: 17px; color: var(--navy); letter-spacing: -.01em; }
.login-brand-sub  { font-weight: 700; font-size: 11px; color: var(--ink-3); letter-spacing: .14em; text-transform: uppercase; margin-top: 2px; }

.login-title {
  font-weight: 800;
  font-size: 28px;
  color: var(--navy);
  line-height: 1.15;
  letter-spacing: -.02em;
  margin-bottom: 6px;
}
.login-sub { color: var(--ink-3); font-size: 14.5px; margin-bottom: 26px; font-weight: 500; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-error {
  color: var(--danger);
  font-size: 13px; font-weight: 600;
  min-height: 18px;
  display: flex; align-items: center; gap: 6px;
}
.login-foot {
  margin-top: 22px; padding-top: 20px;
  border-top: 1px dashed var(--line-2);
  display: flex; justify-content: space-between;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 700;
}

/* ==========================================================
   APP SHELL
========================================================== */
#app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ==========================================================
   SIDEBAR
========================================================== */
.sidebar {
  background: var(--navy);
  background-image: linear-gradient(180deg, #0E2A51 0%, #0B2545 40%, #081D37 100%);
  color: #C8D2E6;
  display: flex; flex-direction: column;
  padding: 18px 14px;
  position: sticky; top: 0;
  height: 100vh;
  border-right: 4px solid var(--yellow);
}
.sidebar-brand {
  display: flex; align-items: center;
  gap: 12px;
  padding: 6px 8px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 16px;
}
.sidebar-brand-mark {
  width: 44px; height: 44px;
  background: var(--yellow);
  color: var(--navy);
  font-weight: 900; font-size: 15px;
  letter-spacing: -.03em;
  border-radius: 12px;
  display: grid; place-items: center;
  position: relative;
  flex-shrink: 0;
}
.sidebar-brand-mark::after {
  content: "";
  position: absolute;
  left: 8px; right: 8px; bottom: 7px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
}
.sidebar-brand-name { color: #FFF; font-weight: 900; font-size: 16px; line-height: 1.15; }
.sidebar-brand-sub  { color: var(--yellow); font-weight: 700; font-size: 10px; letter-spacing: .15em; text-transform: uppercase; margin-top: 2px; }

.sidebar-nav {
  flex: 1;
  display: flex; flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.nav-group { margin-top: 18px; }
.nav-group-title {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #7A89AD;
  padding: 4px 12px 8px;
  font-weight: 800;
}
.nav-item {
  display: flex; align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: #B0BCD7;
  transition: all .15s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover {
  background: rgba(255,210,51,.08);
  color: #FFF;
}
.nav-item.active {
  background: rgba(255,210,51,.14);
  color: var(--yellow);
  font-weight: 800;
  box-shadow: inset 3px 0 0 var(--yellow);
}
.nav-hero {
  background: var(--red);
  color: #FFF !important;
  margin: 10px 0 4px;
  font-weight: 800;
  box-shadow: 0 4px 0 var(--red-dk);
  padding: 12px;
}
.nav-hero:hover { background: var(--red-dk); transform: translateY(1px); box-shadow: 0 3px 0 #8C1919; }
.nav-hero.active { background: var(--red-dk); box-shadow: inset 0 2px 0 rgba(0,0,0,.1); }

.sidebar-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.user-card {
  display: flex; align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255,255,255,.04);
  border-radius: 10px;
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--yellow);
  color: var(--navy);
  display: grid; place-items: center;
  font-weight: 900; font-size: 12px;
  letter-spacing: -.02em;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; color: #FFF; font-weight: 700; }
.user-role { font-size: 11px; color: #8596B7; font-weight: 600; }
.user-exit {
  color: #8596B7;
  padding: 6px;
  border-radius: 8px;
  transition: all .15s;
}
.user-exit:hover { color: var(--yellow); background: rgba(255,210,51,.1); }
.user-exit svg { width: 16px; height: 16px; display: block; }

/* ==========================================================
   MAIN / PAGE HEAD
========================================================== */
.main { padding: 32px 36px 80px; min-width: 0; }

.page-head {
  display: flex; align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 20px;
}
.page-title-group { min-width: 0; }
.page-eyebrow {
  display: inline-flex; align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--navy);
  font-weight: 800;
  background: var(--yellow);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
}
.page-title {
  font-family: var(--f-sans);
  font-weight: 900;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -.02em;
  color: var(--navy);
}
.page-title .accent { color: var(--red); }
.page-title .green  { color: var(--green); }
.page-sub {
  margin-top: 10px;
  font-size: 14px;
  color: var(--ink-3);
  max-width: 640px;
  font-weight: 500;
}
.page-actions { display: flex; gap: 10px; flex-shrink: 0; flex-wrap: wrap; }

.sect-title {
  display: flex; align-items: center;
  gap: 10px;
  margin: 28px 0 14px;
  font-weight: 900;
  color: var(--navy);
  font-size: 16px;
  letter-spacing: -.01em;
}
.sect-title::before {
  content: "";
  width: 4px; height: 18px;
  background: var(--green);
  border-radius: 2px;
}

/* ==========================================================
   BUTTONS
========================================================== */
.btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 800;
  font-size: 13.5px;
  line-height: 1.2;
  border: none;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--red);
  color: #FFF;
  box-shadow: 0 3px 0 var(--red-dk);
}
.btn-primary:hover:not(:disabled) {
  background: var(--red-dk);
  transform: translateY(1px);
  box-shadow: 0 2px 0 #8C1919;
}
.btn-secondary {
  background: var(--surface);
  color: var(--navy);
  border: 2px solid var(--line-2);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--navy); }
.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  padding: 8px 12px;
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--navy); }
.btn-yellow {
  background: var(--yellow);
  color: var(--navy);
  box-shadow: 0 3px 0 var(--yellow-dk);
}
.btn-yellow:hover:not(:disabled) { transform: translateY(1px); box-shadow: 0 2px 0 #C19C0C; }
.btn-green {
  background: var(--green);
  color: #FFF;
  box-shadow: 0 3px 0 var(--green-dk);
}
.btn-green:hover:not(:disabled) { transform: translateY(1px); box-shadow: 0 2px 0 #3F6D20; }
.btn-danger {
  background: var(--surface);
  color: var(--danger);
  border: 2px solid var(--line-2);
}
.btn-danger:hover:not(:disabled) { border-color: var(--danger); background: var(--danger-lt); }
.btn-lg { padding: 14px 22px; font-size: 14.5px; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }
.btn-block { width: 100%; }

/* ==========================================================
   FIELDS
========================================================== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 800;
}
.field-hint { font-size: 12px; color: var(--ink-3); font-weight: 500; }
input[type=text], input[type=password], input[type=number], input[type=email],
input[type=tel], input[type=date], select, textarea, .input {
  appearance: none;
  width: 100%;
  padding: 11px 13px;
  background: var(--surface);
  border: 2px solid var(--line-2);
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink);
  transition: border-color .12s, box-shadow .12s;
  line-height: 1.3;
  font-weight: 600;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(11,37,69,.1);
}
input::placeholder, textarea::placeholder { color: var(--ink-4); font-weight: 500; }
textarea { resize: vertical; min-height: 72px; }
select {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6' fill='none' stroke='%2322437A' stroke-width='1.7'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px;
  padding-right: 34px;
}

/* ==========================================================
   CARDS
========================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  box-shadow: var(--sh-sm);
}
.card + .card { margin-top: 16px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--surface-3);
  gap: 16px;
}
.card-title {
  font-weight: 900;
  font-size: 17px;
  color: var(--navy);
  letter-spacing: -.01em;
}
.card-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; font-weight: 500; }

/* ==========================================================
   STATS
========================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--line);
}
.stat-yellow::before { background: var(--yellow); }
.stat-green::before  { background: var(--green); }
.stat-red::before    { background: var(--red); }
.stat-navy::before   { background: var(--navy); }
.stat-label {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 800;
}
.stat-value {
  font-family: var(--f-sans);
  font-weight: 900;
  font-size: 30px;
  line-height: 1;
  margin-top: 10px;
  color: var(--navy);
  letter-spacing: -.02em;
}
.stat-note { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; font-weight: 600; }

/* ==========================================================
   TABLES
========================================================== */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-sm);
}
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 12px 14px;
  background: var(--surface-2);
  border-bottom: 2px solid var(--line);
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--ink-2);
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--yellow-lt); }
.table .num, .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.table .code, .code {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: -.01em;
  font-weight: 500;
}
.table .right, .right  { text-align: right; }
.table .center, .center { text-align: center; }

/* ==========================================================
   TOOLBAR
========================================================== */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar .search {
  flex: 1;
  min-width: 280px;
  position: relative;
}
.toolbar .search input { padding-left: 40px; }
.toolbar .search svg {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--ink-3);
  pointer-events: none;
}
.select-compact { max-width: 220px; }

/* ==========================================================
   BADGE
========================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  background: var(--surface-3);
  color: var(--ink-2);
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.5;
}
.badge-yellow  { background: var(--yellow-lt); color: #8C6A05; }
.badge-green   { background: var(--green-lt);  color: var(--green-dk); }
.badge-red     { background: var(--red-lt);    color: var(--red-dk); }
.badge-navy    { background: #DCE2EF;          color: var(--navy); }
.badge-success { background: var(--success-lt);color: var(--success); }
.badge-warn    { background: var(--warn-lt);   color: #8C6A05; }
.badge-info    { background: var(--info-lt);   color: var(--info); }

/* ==========================================================
   AUTOCOMPLETE
========================================================== */
.ac-wrap { position: relative; }
.ac-list {
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface);
  border: 2px solid var(--line-2);
  border-radius: var(--r);
  box-shadow: var(--sh-md);
  max-height: 360px;
  overflow-y: auto;
  z-index: 50;
}
/* Quando anexado ao body com position:fixed, escapar de clipping */
.ac-list-floating {
  position: fixed !important;
  top: auto; left: auto; right: auto;
  z-index: 500 !important;
  box-shadow: 0 10px 30px rgba(11,37,69,.18), 0 2px 6px rgba(11,37,69,.08);
  border: 2px solid var(--navy);
}
.ac-empty {
  padding: 18px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 600;
}
.ac-item {
  padding: 11px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  transition: background .1s;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.highlight { background: var(--yellow-lt); }
.ac-item-main { flex: 1; min-width: 0; }
.ac-item-name { color: var(--navy); font-weight: 700; }
.ac-item-meta { color: var(--ink-3); font-size: 12px; margin-top: 3px; font-weight: 500; }
.ac-item-price {
  font-family: var(--f-mono);
  color: var(--red);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}
.ac-item-code {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--navy);
  background: var(--yellow);
  padding: 2px 7px;
  border-radius: 5px;
  margin-right: 8px;
  font-weight: 700;
}
mark.hl {
  background: var(--yellow);
  color: var(--navy);
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 800;
}

/* ==========================================================
   PROPOSAL FORM (grid + items table)
========================================================== */
.grid12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.col-2  { grid-column: span 2; }
.col-3  { grid-column: span 3; }
.col-4  { grid-column: span 4; }
.col-6  { grid-column: span 6; }
.col-8  { grid-column: span 8; }
.col-12 { grid-column: span 12; }

.sect-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 4px;
}
.sect-divider::before, .sect-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.sect-divider-label {
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--navy);
  font-weight: 900;
}

.items-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
}
.items-table th {
  background: var(--surface-2);
  padding: 10px 12px;
  text-align: left;
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 800;
  border-bottom: 2px solid var(--line);
}
.items-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.items-table tr:last-child td { border-bottom: none; }
.items-table input, .items-table select {
  border: 2px solid transparent;
  background: transparent;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
}
.items-table input:hover, .items-table select:hover {
  border-color: var(--line-2);
  background: var(--surface);
}
.items-table input:focus, .items-table select:focus {
  border-color: var(--navy);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(11,37,69,.1);
}
.items-table .line-remove {
  color: var(--ink-3);
  padding: 6px;
  border-radius: 6px;
  width: 30px; height: 30px;
  display: inline-flex;
  align-items: center; justify-content: center;
  transition: all .15s;
}
.items-table .line-remove:hover { color: var(--danger); background: var(--danger-lt); }
.items-table .line-remove svg { width: 16px; height: 16px; }
.items-table .line-product-name {
  font-weight: 700;
  color: var(--navy);
  font-size: 13.5px;
}
.items-table .add-line-row td {
  background: linear-gradient(180deg, var(--yellow-lt) 0%, #FFF6CB 100%);
  padding: 12px;
}
.items-table .add-line-row input {
  background: var(--surface);
  border: 2px solid var(--line-2);
  font-weight: 600;
}

.totals-card {
  background: var(--navy);
  background-image: linear-gradient(135deg, var(--navy-2) 0%, var(--navy) 50%, #061426 100%);
  color: #E8EEF7;
  border-radius: var(--r-lg);
  padding: 24px 28px;
  margin-top: 18px;
  position: relative;
  overflow: hidden;
  border: 3px solid var(--yellow);
  box-shadow: 0 10px 30px rgba(11,37,69,.3);
}
.totals-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 10%, rgba(255,210,51,.12), transparent 60%);
  pointer-events: none;
}
.totals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 22px;
  align-items: end;
  position: relative;
}
.totals-item-label {
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--yellow);
  font-weight: 800;
  margin-bottom: 6px;
}
.totals-item-value {
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 22px;
  color: #FFF;
  letter-spacing: -.02em;
}
.totals-item-note {
  font-size: 11px;
  color: #8FA0C4;
  margin-top: 4px;
  font-weight: 600;
}
.totals-grand {
  text-align: right;
  padding-left: 22px;
  border-left: 2px dashed rgba(255,210,51,.3);
}
.totals-grand .totals-item-label { color: #FFF; opacity: .75; }
.totals-grand .totals-item-value {
  font-size: 38px;
  font-weight: 900;
  color: var(--yellow);
  line-height: 1;
  letter-spacing: -.02em;
}

/* ==========================================================
   TIMELINE
========================================================== */
.timeline { padding: 0; list-style: none; margin: 0; }
.tl-item {
  display: grid;
  grid-template-columns: 130px 28px 1fr;
  gap: 18px;
  padding: 16px 0;
  position: relative;
}
.tl-item::before {
  content: "";
  position: absolute;
  left: 141px;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--line-2);
}
.tl-item:last-child::before  { bottom: 50%; }
.tl-item:first-child::before { top: 50%; }
.tl-date {
  text-align: right;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--ink-3);
  padding-top: 3px;
  font-weight: 500;
}
.tl-date strong { display: block; color: var(--ink-2); font-weight: 700; font-size: 13px; }
.tl-dot {
  position: relative; z-index: 1;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--line-2);
  display: grid; place-items: center;
}
.tl-item.tl-done .tl-dot { background: var(--green); border-color: var(--green); }
.tl-item.tl-done .tl-dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #FFF; }
.tl-item.tl-active .tl-dot {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 0 5px var(--red-lt);
}
.tl-item.tl-active .tl-dot::after {
  content: "";
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #FFF;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(.6); } }
.tl-title { font-weight: 800; color: var(--navy); font-size: 14.5px; }
.tl-desc  { font-size: 13px; color: var(--ink-3); margin-top: 3px; font-weight: 500; }

/* ==========================================================
   EMPTY STATE
========================================================== */
.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--ink-3);
  font-weight: 500;
}
.empty-icon {
  width: 60px; height: 60px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: var(--yellow);
  color: var(--navy);
  display: grid; place-items: center;
}
.empty-icon svg { width: 28px; height: 28px; }
.empty-title { font-weight: 900; font-size: 18px; color: var(--navy); margin-bottom: 6px; }

/* ==========================================================
   TOAST
========================================================== */
#toast-holder {
  position: fixed;
  top: 20px; right: 20px;
  display: flex; flex-direction: column;
  gap: 10px;
  z-index: 1000;
  pointer-events: none;
}
.toast {
  background: var(--navy);
  color: #FFF;
  padding: 12px 18px;
  border-radius: var(--r);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--sh-lg);
  min-width: 260px;
  pointer-events: auto;
  animation: toast-in .25s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast-success { background: var(--green); }
.toast-error   { background: var(--danger); }
.toast-warn    { background: var(--warn); color: var(--navy); }
.toast svg { width: 17px; height: 17px; flex-shrink: 0; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================
   MODAL
========================================================== */
#modal-holder {
  position: fixed;
  inset: 0;
  background: rgba(11,37,69,.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
  backdrop-filter: blur(3px);
}
#modal-holder.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 28px 30px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--sh-lg);
  animation: modal-in .2s ease;
  border-top: 6px solid var(--yellow);
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}
.modal-title { font-weight: 900; font-size: 20px; color: var(--navy); margin-bottom: 6px; }
.modal-desc  { color: var(--ink-3); margin-bottom: 20px; font-weight: 500; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ==========================================================
   UTILS
========================================================== */
.mt-0  { margin-top: 0 !important; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.between { justify-content: space-between; }
.flex-1 { flex: 1; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.w-full { width: 100%; }
.muted  { color: var(--ink-3); }
.small  { font-size: 12px; }
.tabular { font-variant-numeric: tabular-nums; }

/* ==========================================================
   PRINT
========================================================== */
@media print {
  .sidebar, .page-actions, #toast-holder, #modal-holder, .add-line-row { display: none !important; }
  #app { grid-template-columns: 1fr !important; }
  .main { padding: 0 !important; }
  .card, .items-table { box-shadow: none; border-color: #CCC; }
  body { background: #FFF; }
  .totals-card {
    background: #FFF9E0 !important;
    color: var(--ink) !important;
    border: 2px solid var(--yellow);
  }
  .totals-card::before { display: none; }
  .totals-item-label, .totals-item-value { color: var(--navy) !important; }
  .totals-grand .totals-item-value { color: var(--red) !important; }
}

/* ==========================================================
   RESPONSIVE
========================================================== */
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 4px solid var(--yellow);
  }
  .main { padding: 20px; }
  .col-2, .col-3, .col-4, .col-6, .col-8 { grid-column: span 12; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .totals-grid { grid-template-columns: 1fr 1fr; }
  .totals-grand {
    grid-column: span 2;
    border-left: none;
    border-top: 2px dashed rgba(255,210,51,.3);
    padding: 16px 0 0;
    text-align: left;
  }
}

/* =========================================================
   Modal de escolha de kit + tela de kits
   ========================================================= */
.kit-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
}
.kit-item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  transition: background .12s;
  border: 1px solid transparent;
}
.kit-item:hover { background: var(--surface-2); }
.kit-item.selected { background: rgba(255,210,51,.15); border-color: var(--yellow); }
.kit-item input[type="radio"] { margin: 0; }
.kit-item-body { flex: 1; }
.kit-item-nome { font-weight: 600; color: var(--navy); }
.kit-item-meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.modal-kit { max-width: 580px; }

/* Lista de kits (kits.html) */
.kit-card {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 10px;
  background: var(--surface);
}
.kit-card:hover { border-color: var(--yellow); }
.kit-card h3 { margin: 0 0 4px; color: var(--navy); font-size: 15px; }
.kit-card .kit-desc { font-size: 13px; color: var(--ink-3); }
.kit-card .kit-chips { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.kit-card .kit-chip {
  background: var(--surface-2);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--ink-2);
}

/* Modal dados brutos Bitrix */
.modal-bitrix-raw { max-width: 800px; }
.modal-bitrix-raw pre {
  background: var(--surface-2);
  color: var(--ink);
  padding: 14px;
  border-radius: 8px;
  font-size: 11px;
  font-family: var(--f-mono);
  max-height: 500px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Imagem de produto no PDF */
.p-img {
  max-width: 36px;
  max-height: 36px;
  object-fit: contain;
  display: inline-block;
}

/* ==========================================================
   Modal genérico (.modal-overlay) — usado no kit + Bitrix debug
========================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,37,69,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 600;
  padding: 20px;
  backdrop-filter: blur(3px);
  overflow-y: auto;
  animation: modal-overlay-in .15s ease;
}
@keyframes modal-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal-overlay > .modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 640px;
  box-shadow: var(--sh-lg);
  border-top: 6px solid var(--yellow);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  animation: modal-in .2s ease;
  padding: 0;   /* substitui padding inline do .modal */
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 {
  margin: 0;
  color: var(--navy);
  font-size: 18px;
  font-weight: 800;
}
.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  font-weight: 300;
  color: var(--ink-3);
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
  border-radius: 6px;
  transition: all .12s;
}
.modal-close:hover {
  color: var(--navy);
  background: var(--surface-2);
}
.modal-body {
  padding: 16px 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 24px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* ==========================================================
   Logo MMP oficial (substitui o quadradinho nos marks)
========================================================== */
.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 8%;
  box-sizing: border-box;
}
/* Quando tem .logo-img dentro do mark, fundo fica branco pra contrastar com logo colorido */
.boot-mark:has(.logo-img),
.sidebar-brand-mark:has(.logo-img) {
  background: #FFF;
  border: 2px solid var(--yellow);
  overflow: hidden;
}
.p-logo:has(.logo-img) {
  background: #FFF !important;
  border: 1px solid var(--navy);
}
/* Login: logo grande centralizado */
.login-logo-img {
  width: 140px;
  height: auto;
  margin: 0 auto 16px;
  display: block;
}

/* ==========================================================
   Toggle PJ/PF no card de Dados do Cliente
========================================================== */
.tipo-toggle {
  display: inline-flex;
  gap: 4px;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 4px;
  border: 1px solid var(--line);
}
.tipo-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: all .15s;
  font-size: 13px;
  color: var(--ink-2);
}
.tipo-opt:hover:not(.active) {
  background: var(--surface);
}
.tipo-opt.active {
  background: var(--yellow);
  color: var(--navy);
  box-shadow: 0 1px 3px rgba(11,37,69,.15);
}
.tipo-opt.active b { color: var(--navy); }
.tipo-opt input[type="radio"] { display: none; }
.tipo-opt b { font-weight: 700; }
.tipo-opt small { opacity: .7; font-size: 11px; }
