@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--gray-900);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: inherit; }
button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); }

/* ─── App Layout ─────────────────────────────────────────── */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  overflow-y: auto;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  margin-bottom: 28px;
  border-radius: var(--r-sm);
  transition: background var(--t);
}
.brand-lockup:hover { background: var(--gray-50); }

.logo-svg {
  width: 22px;
  height: 22px;
  color: var(--gray-900);
  flex-shrink: 0;
}

.wordmark {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}
.wordmark-admi { color: var(--gray-900); }
.wordmark-fly  { color: var(--brand); }

.nav-section { margin-bottom: 24px; margin-top: 8px; }

.nav-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-400);
  padding: 0 8px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--gray-500);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--t);
  margin-bottom: 1px;
}
.nav-item:hover  { background: var(--gray-100); color: var(--gray-900); }
.nav-item.active { background: var(--brand-light); color: var(--brand); font-weight: 600; }
.nav-item-disabled { opacity: 0.5; cursor: not-allowed; }
.nav-item-disabled:hover { background: none; color: var(--gray-500); }
.nav-disabled-badge {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: 999px;
}

.pro-item { justify-content: flex-start; }
.pro-badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, #7C3AED, #4F46E5);
  color: white;
}
.pro-item:hover .pro-badge,
.pro-item.active .pro-badge { opacity: 1; }

.nav-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
  stroke-width: 2;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t);
}
.sidebar-user:hover { background: var(--gray-100); }

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  background: var(--brand);
  color: white;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-user-info { display: flex; flex-direction: column; overflow: hidden; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: var(--gray-900); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: var(--gray-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Main Content ───────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-width: 0;
}

.topbar {
  height: 56px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  letter-spacing: -0.01em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  background: var(--brand);
  color: white;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.page-content {
  padding: 24px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* ─── KPI Cards ──────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .kpi-grid { grid-template-columns: 1fr; } }

.kpi-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.kpi-card.k-danger  { border-color: rgba(220,38,38,0.25); }
.kpi-card.k-warning { border-color: rgba(217,119,6,0.25); }
.kpi-card.k-success { border-color: rgba(5,150,105,0.25); }

.kpi-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 8px;
}
.kpi-value.v-danger  { color: var(--danger); }
.kpi-value.v-warning { color: var(--warning); }
.kpi-value.v-success { color: var(--success); }

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
}
.kpi-trend.t-up      { color: var(--success); }
.kpi-trend.t-down    { color: var(--danger); }
.kpi-trend.t-neutral { color: var(--gray-500); }
.kpi-trend.t-warn    { color: var(--warning); }

/* ─── Charts ─────────────────────────────────────────────── */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 900px) { .chart-grid { grid-template-columns: 1fr; } }

.chart-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.chart-card-header { margin-bottom: 16px; }
.chart-card-title  { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.chart-card-sub    { font-size: 12px; color: var(--gray-400); margin-top: 2px; }

.chart-area {
  position: relative;
  height: 220px;
}

/* ─── Table Card ─────────────────────────────────────────── */
.table-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
}

.table-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.table-card-title { font-size: 14px; font-weight: 600; color: var(--gray-900); }

.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
  text-align: left;
  padding: 10px 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  border-bottom: 1px solid var(--border);
  background: var(--gray-50);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 20px;
  font-size: 13.5px;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover   { background: var(--gray-50); }
.data-table td.td-strong     { font-weight: 600; color: var(--gray-900); }
.data-table td.td-green      { color: var(--success); font-weight: 500; }
.data-table td.td-red        { color: var(--danger);  font-weight: 500; }
.data-table td.td-mono       { font-family: 'JetBrains Mono', 'SF Mono', monospace; }

/* ─── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  }
.badge-info    { background: var(--info-bg);    color: var(--info);    }
.badge-neutral { background: var(--gray-100);   color: var(--gray-500);}

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t);
  line-height: 1;
  white-space: nowrap;
}

.btn-primary { background: var(--gray-900); color: var(--white); border-color: var(--gray-900); }
.btn-primary:hover { background: #000; border-color: #000; }

.btn-brand { background: var(--brand); color: var(--white); border-color: var(--brand); }
.btn-brand:hover { background: var(--brand-hover); border-color: var(--brand-hover); }

.btn-outline { background: transparent; color: var(--gray-700); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--gray-50); }

.btn-ghost { background: transparent; color: var(--gray-500); border-color: transparent; }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-900); }

.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 20px; font-size: 14px; }
.btn-full { width: 100%; justify-content: center; }

/* ─── Inputs ─────────────────────────────────────────────── */
.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--gray-900);
  background: var(--white);
  outline: none;
  transition: border-color var(--t);
}
.input:focus { border-color: var(--brand); }
.input::placeholder { color: var(--gray-400); }

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap .input { padding-left: 36px; }
.input-wrap .input-icon {
  position: absolute;
  left: 11px;
  width: 16px;
  height: 16px;
  color: var(--gray-400);
  pointer-events: none;
}

/* ─── Progress ───────────────────────────────────────────── */
.progress-wrap {
  background: var(--gray-200);
  border-radius: var(--r-full);
  height: 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.4s ease;
  background: var(--brand);
}
.progress-fill.pf-success { background: var(--success); }
.progress-fill.pf-warning { background: var(--warning); }
.progress-fill.pf-danger  { background: var(--danger);  }

/* ─── Alert Items (Towerfly) ─────────────────────────────── */
.alerts-stack { display: flex; flex-direction: column; gap: 10px; }

.alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--r);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}
.alert-item.al-danger  { border-left-color: var(--danger);  }
.alert-item.al-warning { border-left-color: var(--warning); }
.alert-item.al-info    { border-left-color: var(--info);    }
.alert-item.al-success { border-left-color: var(--success); }

.alert-body  { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.alert-icon  { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; }
.alert-icon.danger  { color: var(--danger);  }
.alert-icon.warning { color: var(--warning); }
.alert-icon.info    { color: var(--info);    }
.alert-icon.success { color: var(--success); }
.alert-text  {}
.alert-title { font-size: 13.5px; font-weight: 600; color: var(--gray-900); margin-bottom: 2px; }
.alert-desc  { font-size: 12.5px; color: var(--gray-500); }

/* ─── Section header ─────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-title { font-size: 15px; font-weight: 600; color: var(--gray-900); }
.section-sub   { font-size: 12px; color: var(--gray-400); margin-top: 1px; }

/* ─── Generic card ───────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

/* ─── Goal card ──────────────────────────────────────────── */
.goal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.goal-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.goal-period  { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-400); margin-bottom: 6px; }
.goal-name    { font-size: 15px; font-weight: 600; color: var(--gray-900); margin-bottom: 16px; }
.goal-footer  { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12px; color: var(--gray-500); }
.goal-pct     { font-weight: 700; font-size: 14px; }

/* ─── PDV specific ───────────────────────────────────────── */
.pdv-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
  height: calc(100vh - 56px - 48px);
}

.pdv-left { display: flex; flex-direction: column; gap: 12px; }

.pdv-search-bar { display: flex; gap: 10px; }

/* ── Abas do PDV ── */
.pdv-tabs {
  display: flex;
  gap: 4px;
  background: var(--gray-100);
  border-radius: var(--r-sm);
  padding: 4px;
  flex-shrink: 0;
}
.pdv-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border: none;
  border-radius: calc(var(--r-sm) - 2px);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  background: transparent;
  cursor: pointer;
  transition: all var(--t);
}
.pdv-tab.active {
  background: var(--white);
  color: var(--gray-900);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.pdv-tab:hover:not(.active) { color: var(--gray-700); }

.pdv-aba { display: none; flex-direction: column; gap: 10px; flex: 1; min-height: 0; }
.pdv-aba.active { display: flex; }

.pdv-quick-products { display: flex; gap: 8px; flex-wrap: wrap; }

.pdv-quick-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--white);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--gray-600, var(--gray-700));
  cursor: pointer;
  transition: all var(--t);
}
.pdv-quick-btn:hover, .pdv-quick-btn.selected {
  background: var(--gray-900);
  color: var(--white);
  border-color: var(--gray-900);
}

.pdv-items-wrap {
  flex: 1;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pdv-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.pdv-items-header span { font-size: 13px; font-weight: 600; color: var(--gray-900); }

.pdv-items-scroll { flex: 1; overflow-y: auto; }

.pdv-checkout {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pdv-checkout-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--gray-900);
}
.pdv-checkout-header h2 { font-size: 14px; font-weight: 600; color: var(--white); }
.pdv-checkout-header p  { font-size: 12px; color: rgba(255,255,255,0.45); margin-top: 2px; }

.pdv-cart { flex: 1; overflow-y: auto; padding: 12px 16px; }

.pdv-cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}
.pdv-cart-item:last-child { border-bottom: none; }
.pdv-cart-item-name  { font-weight: 500; color: var(--gray-900); }
.pdv-cart-item-qty   { font-size: 11px; color: var(--gray-400); }
.pdv-cart-item-price { font-weight: 600; color: var(--gray-900); font-size: 13px; }

.pdv-totals {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.pdv-total-line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 5px;
}
.pdv-total-final {
  display: flex;
  justify-content: space-between;
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
  margin: 12px 0 16px;
}

.pdv-payment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.pdv-pay-btn {
  padding: 9px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--gray-50);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600, var(--gray-700));
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--t);
}
.pdv-pay-btn:hover, .pdv-pay-btn.selected {
  background: var(--gray-900);
  color: var(--white);
  border-color: var(--gray-900);
}

.btn-finalizar {
  width: 100%;
  padding: 13px;
  background: var(--brand);
  color: var(--white);
  border: none;
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background var(--t);
}
.btn-finalizar:hover { background: var(--brand-hover); }

/* ─── Badge em topbar ────────────────────────────────────── */
.topbar-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--success-bg);
  color: var(--success);
}
.topbar-badge.open   { background: var(--success-bg); color: var(--success); }
.topbar-badge.closed { background: var(--gray-100);  color: var(--gray-500); }

/* ─── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 460px;
  margin: 16px;
  transform: translateY(10px);
  transition: transform var(--t);
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 15px; font-weight: 600; color: var(--gray-900); }

.modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 12px; font-weight: 500; color: var(--gray-700); }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ─── Utilities ──────────────────────────────────────────── */
.flex          { display: flex; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-4  { margin-top: 16px; }
.mt-5  { margin-top: 20px; }
.mb-4  { margin-bottom: 16px; }
.mb-5  { margin-bottom: 20px; }
.text-muted   { color: var(--gray-400); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-brand   { color: var(--brand); }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

/* ─── Help button (?) ────────────────────────────────────── */
.help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-300);
  background: transparent;
  color: var(--gray-400);
  font-size: 9px;
  font-weight: 700;
  cursor: help;
  padding: 0;
  line-height: 1;
  vertical-align: middle;
  flex-shrink: 0;
  transition: border-color var(--t), color var(--t);
}
.help-btn:hover { border-color: var(--gray-500); color: var(--gray-700); }

/* ─── Vendasfly: Filtros ativos ──────────────────────────── */
.hist-filter-btn.active {
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 600;
}

/* ─── Notinha / Cupom ────────────────────────────────────── */
.notinha-cupom {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: var(--gray-800);
  padding-top: 8px;
}
.notinha-header {
  text-align: center;
  margin-bottom: 12px;
}
.notinha-logo {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--gray-900);
}
.notinha-sub {
  font-size: 11px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}
.notinha-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  margin-top: 4px;
}
.notinha-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 10px;
}
.notinha-meta > div {
  display: flex;
  align-items: center;
  gap: 5px;
}
.notinha-divisor {
  border-top: 1px dashed var(--gray-300);
  margin: 10px 0;
}
.notinha-itens {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.notinha-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.notinha-item-nome {
  font-weight: 600;
  font-size: 13px;
  color: var(--gray-900);
}
.notinha-item-detalhe {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--gray-500);
}
.notinha-totais {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.notinha-total-linha {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--gray-500);
}
.notinha-total-final {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 800;
  color: var(--gray-900);
  margin-top: 4px;
}
.notinha-pgto {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-700);
  margin-top: 2px;
}
.notinha-lucro {
  font-size: 11.5px;
  color: var(--gray-400);
  margin-top: 6px;
}
.notinha-rodape {
  text-align: center;
  margin-top: 14px;
  font-size: 12px;
  color: var(--gray-400);
  letter-spacing: 0.04em;
}

/* ─── Toast notifications ───────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 360px;
  width: calc(100vw - 48px);
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  pointer-events: all;
  animation: toastIn .22s cubic-bezier(.21,1.02,.73,1) forwards;
}
.toast.removing {
  animation: toastOut .18s ease forwards;
}
.toast-success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.toast-error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.toast-info    { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.toast-warn    { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.toast-icon    { font-size: 15px; flex-shrink: 0; line-height: 1.45; }
.toast-msg     { flex: 1; word-break: break-word; }
.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0 0 6px;
  font-size: 17px;
  line-height: 1;
  color: currentColor;
  opacity: 0.35;
  transition: opacity .12s;
}
.toast-close:hover { opacity: 0.75; }
@keyframes toastIn  {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0);   max-height: 80px; }
  to   { opacity: 0; transform: translateY(6px); max-height: 0; padding: 0; margin: 0; }
}

/* ─── Global spin keyframe ───────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .7s linear infinite; display: inline-block; }

/* ─── Focus-visible global ───────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

/* ─── Print: mostra só a notinha ────────────────────────── */
@media print {
  body > *:not(#print-area) { display: none !important; }
  #modal-notinha {
    position: static !important;
    background: none !important;
    display: block !important;
  }
  #modal-notinha-inner {
    box-shadow: none !important;
    border: none !important;
    max-width: 320px !important;
    margin: 0 auto !important;
  }
  .modal-header button { display: none !important; }
}
