/* ==========================================================================
   Bandim — sistema de design
   Corporativo, tipográfico, sem decoração. Propriedades lógicas (LTR/RTL).
   ========================================================================== */
/* Vendas */
.sales-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0 0 28px; }
.sales-summary > div, .sales-card { padding: 24px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; }
.sales-summary dt { color: var(--steel); font-size: 13px; }
.sales-summary dd { margin: 12px 0 0; font-size: clamp(18px, 1.8vw, 25px); font-weight: 600; overflow-wrap: anywhere; }
.sales-card h3 { margin-bottom: 20px; }
.sales-filters, .sales-product-picker { display: grid; grid-template-columns: minmax(0, 2fr) minmax(120px, 1fr) auto; align-items: end; gap: 16px; margin-block: 20px; }
.sales-card label, .sales-dialog label { display: grid; gap: 8px; font-size: 14px; font-weight: 500; min-width: 0; }
.sales-card input, .sales-card select, .sales-dialog input, .sales-dialog select, .sales-dialog textarea { width: 100%; min-width: 0; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--white); color: var(--ink); font: inherit; }
.sales-dialog textarea { resize: vertical; }
.sales-table-wrap { overflow-x: auto; }
.sales-table { width: 100%; border-collapse: collapse; text-align: start; font-size: 14px; }
.sales-table th { padding: 12px; background: var(--surface); color: var(--steel); font-weight: 500; text-align: start; white-space: nowrap; }
.sales-table td { padding: 16px 12px; border-bottom: 1px solid var(--line); }
.sales-table small { display: block; color: var(--steel); margin-top: 4px; white-space: nowrap; }
.sales-badge { display: inline-block; padding: 4px 9px; border-radius: 20px; background: #E8F3EC; color: #20633E; white-space: nowrap; }
.sales-badge-debt { background: #FFF2D8; color: #805000; }
.sales-link, .sales-close { border: 0; background: none; color: var(--blue); cursor: pointer; font: inherit; }
.sales-link { text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.sales-pagination, .sales-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-top: 24px; }
.sales-pagination span, .sales-muted { color: var(--steel); font-size: 13px; }
.sales-secondary { background: var(--surface); color: var(--navy); border: 1px solid var(--line); }
.sales-secondary:hover { background: var(--sky); }
.sales-card button:disabled, .sales-dialog button:disabled { opacity: .5; cursor: not-allowed; }
.sales-notice { padding: 14px 18px; margin-bottom: 20px; background: #E8F3EC; color: #20633E; border-radius: 6px; }
.sales-error { color: var(--err); background: #FFF1EF; padding: 14px; border-radius: 6px; margin-block: 12px; }
.sales-empty { text-align: center; padding: 36px 16px; color: var(--steel); }
.sales-empty h3 { color: var(--ink); margin-bottom: 8px; }
.sales-dialog { width: min(800px, calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 28px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--white); }
.sales-dialog::backdrop { background: rgba(14,27,44,.55); }
.sales-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.sales-dialog-head h2 { font-size: 23px; }
.sales-close { font-size: 28px; width: 40px; height: 40px; }
.sales-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.sales-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-block: 24px; }
.sales-dialog .sales-check { display: flex; align-items: center; align-self: end; min-height: 42px; }
.sales-check input { width: 18px; min-height: 18px; }
.sales-totals { margin-block: 24px; padding: 18px; background: var(--surface); border-radius: 6px; }
.sales-totals p { display: flex; justify-content: space-between; gap: 20px; margin-block: 6px; }
.sales-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
@media(max-width:1100px) { .sales-summary { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) {
  .sales-filters, .sales-product-picker, .sales-form-grid { grid-template-columns: 1fr; }
  .sales-card, .sales-dialog { padding: 16px; }
  .sales-summary { gap: 10px; } .sales-summary > div { padding: 16px; }
  .sales-pagination { flex-wrap: wrap; gap: 10px; }
}
:root {
  /* Cor */
  --ink:      #0E1B2C;  /* texto forte */
  --navy:     #12355B;
  --blue:     #1F5FBF;  /* única cor de acento */
  --blue-d:   #174A96;
  --steel:    #5B6B7F;  /* texto secundário */
  --line:     #D9DFE7;
  --surface:  #F4F6F9;
  --white:    #FFFFFF;
  --ok:       #1E7B4F;
  --err:      #B3261E;
  --warn:     #8A5200;  /* aviso (Caps Lock, alertas) */
  --sky:      #E1F0FF;  /* fundo azul claro moderno */
  /* Layout */
  --sb: 264px; --sb-c: 72px; --hd: 60px;
  /* Tipo */
  --font: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5;
  color: var(--ink); background: var(--surface);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
[dir="rtl"] body { line-height: 1.65; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, select { font: inherit; color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; stroke-linejoin: miter; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
body.is-booting .shell { visibility: hidden; }
.noscript { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 32px; background: var(--ink); color: #fff; font-size: 16px; line-height: 1.6; text-align: center; }
.noscript strong { display: block; margin-block-end: 8px; font-size: 20px; font-weight: 600; }
.noscript small { display: block; margin-block-start: 8px; color: #A9B7C8; font-size: 14px; }

/* ---------- Shell ---------- */
.shell {
  display: grid; min-height: 100vh; min-height: 100dvh;
  grid-template-columns: var(--sb) 1fr;
  grid-template-rows: var(--hd) 1fr auto;
  grid-template-areas: "sb hd" "sb main" "sb ft";
  transition: grid-template-columns .25s var(--ease);
}
body.sb-collapsed .shell { grid-template-columns: var(--sb-c) 1fr; }

/* ---------- Sidebar ---------- */
.sidebar {
  grid-area: sb; background: var(--white); color: var(--steel);
  border-inline-end: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0;
  height: 100vh; height: 100dvh; overflow: hidden; z-index: 30;
}
.sidebar__brand { display: flex; align-items: center; gap: 12px; height: var(--hd); padding-inline: 24px; border-block-end: 1px solid var(--line); }
.sidebar__brand .brand-mark { stroke: var(--blue); }
.sidebar__logo { 
  width: 32px; 
  height: 32px; 
  object-fit: cover; 
  border-radius: 6px; 
  flex: none;
  transition: width .25s var(--ease), height .25s var(--ease);
}
body.sb-collapsed .sidebar__logo {
  width: 36px;
  height: 36px;
}
.brand-mark { width: 24px; height: 24px; flex: none; stroke: #fff; stroke-width: 3; }
.sidebar__word { color: var(--ink); font-weight: 600; font-size: 17px; letter-spacing: .01em; white-space: nowrap; }

.nav { flex: 1; overflow-y: auto; padding-block: 12px; }
.nav__group { padding: 20px 24px 8px; font-size: 12px; font-weight: 500; letter-spacing: .04em; color: var(--steel); white-space: nowrap; }
.nav__item {
  position: relative; display: flex; align-items: center; gap: 14px;
  height: 44px; padding-inline: 24px; color: var(--steel); white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav__item svg { width: 20px; height: 20px; flex: none; }
.nav__item:hover { background: var(--surface); color: var(--ink); }
.nav__item[aria-current="page"] { background: var(--sky); color: var(--blue); font-weight: 600; }
.nav__item[aria-current="page"]::before {
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 3px; background: var(--blue);
}
.sidebar__collapse {
  display: flex; align-items: center; gap: 14px; height: 52px; padding-inline: 24px;
  background: none; border: 0; border-block-start: 1px solid var(--line);
  color: var(--steel); cursor: pointer; white-space: nowrap; text-align: start;
}
.sidebar__collapse svg { width: 20px; height: 20px; flex: none; transition: transform .25s var(--ease); }
[dir="rtl"] .sidebar__collapse svg { transform: scaleX(-1); }
.sidebar__collapse:hover { background: var(--surface); color: var(--blue); }

/* Botão de instalação PWA */
.sidebar__install {
  display: flex; align-items: center; gap: 14px; height: 52px; padding-inline: 24px;
  background: linear-gradient(135deg, var(--blue), #2563EB); border: 0; border-radius: 8px;
  color: var(--white); cursor: pointer; white-space: nowrap; text-align: start; font-weight: 500;
  margin: 12px; transition: all .25s var(--ease);
}
.sidebar__install svg { width: 20px; height: 20px; flex: none; }
.sidebar__install:hover { background: linear-gradient(135deg, var(--blue-d), #1D4ED8); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(31,95,191,.25); }
.sidebar__install:active { transform: translateY(0); }

/* Recolhida: só ícones */
.sidebar__word, .nav__item span, .sidebar__collapse span, .sidebar__install span, .nav__group { transition: opacity .15s; }
body.sb-collapsed .sidebar__word,
body.sb-collapsed .nav__item span,
body.sb-collapsed .sidebar__collapse span,
body.sb-collapsed .sidebar__install span { opacity: 0; pointer-events: none; }
body.sb-collapsed .nav__group { opacity: 0; height: 12px; padding-block: 0; overflow: hidden; }
body.sb-collapsed .sidebar__collapse svg { transform: rotate(180deg); }
[dir="rtl"] body.sb-collapsed .sidebar__collapse svg { transform: scaleX(-1) rotate(180deg); }
body.sb-collapsed .sidebar__install { width: 48px; height: 48px; padding: 0; justify-content: center; margin-inline: 12px; }

/* ---------- Header ---------- */
.header {
  grid-area: hd; position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px; padding-inline: 32px;
  background: var(--white); border-block-end: 1px solid var(--line);
}
.header__menu { display: none; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; background: none; border: 0; cursor: pointer; }
.icon-btn svg { width: 22px; height: 22px; }
.crumb { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.crumb__root { color: var(--steel); }
.crumb__sep { color: var(--line); }
.crumb__page { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header__tools { margin-inline-start: auto; display: flex; align-items: center; gap: 24px; }

.sync { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--steel); }
.sync i { 
  width: 8px; 
  height: 8px; 
  background: var(--ok);
  border-radius: 50%;
  position: relative;
}
.sync[data-state="online"] i {
  animation: pulse 2s ease-in-out infinite;
}
.sync[data-state="online"] i::before {
  content: '';
  position: absolute;
  inset: -4px;
  border: 2px solid var(--ok);
  border-radius: 50%;
  opacity: 0;
  animation: ripple 2s ease-in-out infinite;
}
.sync[data-state="offline"] i { background: var(--err); animation: none; }
.sync[data-state="offline"] i::before { display: none; }
.sync[data-state="syncing"] i { background: var(--blue); animation: blink 1s steps(2) infinite; }
.sync[data-state="syncing"] i::before { display: none; }
@keyframes blink { 50% { opacity: .25; } }

.lang select {
  height: 36px; padding-inline: 10px; background: var(--white); border: 1px solid var(--line);
  border-radius: 2px; cursor: pointer;
}
.user { display: flex; align-items: center; gap: 12px; }
.user__avatar { display: grid; place-items: center; width: 36px; height: 36px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 600; }
.user__meta { display: flex; flex-direction: column; line-height: 1.25; }
.user__meta strong { font-size: 14px; font-weight: 600; }
.user__meta small { font-size: 12px; color: var(--steel); }

/* ---------- Main ---------- */
.main { grid-area: main; padding: 40px 32px 56px; max-width: 1200px; width: 100%; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-block-end: 32px; padding-block-end: 20px; border-block-end: 1px solid var(--line); }
.page-head h2 { font-size: 28px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.page-head p { margin-block-start: 6px; color: var(--steel); }
.btn { display: inline-flex; align-items: center; height: 40px; padding-inline: 20px; background: var(--blue); color: #fff; border: 0; border-radius: 2px; font-weight: 500; cursor: pointer; transition: background .15s; }
.btn:hover { background: var(--blue-d); }

/* Indicadores em tipografia pura: coluna de números sobre régua */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); border-block-start: 2px solid var(--ink); }
.figure { padding: 20px 24px 24px 0; }
.figure + .figure { padding-inline-start: 24px; border-inline-start: 1px solid var(--line); }
.figure dt { color: var(--steel); font-size: 14px; }
.figure dd { margin: 10px 0 0; font-size: 34px; font-weight: 500; letter-spacing: -.02em; line-height: 1.1; }
.figure dd small { font-size: 14px; font-weight: 400; color: var(--steel); margin-inline-start: 6px; letter-spacing: 0; }
.figure--alert dd { color: var(--err); }

.section { margin-block-start: 48px; }
.section h3 { font-size: 16px; font-weight: 600; margin-block-end: 12px; }
.empty { padding: 40px 0; border-block: 1px solid var(--line); color: var(--steel); display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.empty strong { display: block; color: var(--ink); font-weight: 500; margin-block-end: 2px; }

/* Skeleton */
.sk { background: linear-gradient(90deg, #E6EAF0 25%, #F1F3F7 50%, #E6EAF0 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.sk--title { height: 30px; width: 280px; max-width: 70%; margin-block-end: 36px; }
.sk-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 24px; }
.sk--fig { height: 84px; }
.sk--block { height: 120px; margin-block-start: 48px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Footer ---------- */
.footer {
  grid-area: ft; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 16px 32px; background: var(--white); border-block-start: 1px solid var(--line);
  font-size: 13px; color: var(--steel);
}
.footer__links { display: flex; gap: 24px; }
.footer__links a:hover { color: var(--blue); }
.footer__status { display: inline-flex; align-items: center; gap: 8px; }
.footer__status i { 
  width: 8px; 
  height: 8px; 
  background: var(--ok);
  border-radius: 50%;
  position: relative;
  animation: pulse 2s ease-in-out infinite;
}
.footer__status i::before {
  content: '';
  position: absolute;
  inset: -4px;
  border: 2px solid var(--ok);
  border-radius: 50%;
  opacity: 0;
  animation: ripple 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { 
    transform: scale(1);
    opacity: 1;
  }
  50% { 
    transform: scale(1.1);
    opacity: 0.8;
  }
}

@keyframes ripple {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.4;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}
.footer__credits { 
  width: 100%; 
  text-align: center; 
  padding-top: 8px; 
  border-top: 1px solid var(--line); 
  font-size: 12px;
  color: var(--steel);
}
.footer__credits strong { 
  color: var(--blue); 
  font-weight: 600; 
}

/* ---------- Loader de arranque ---------- */
#boot {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: var(--white); transition: opacity .45s var(--ease), visibility .45s;
}
#boot.is-done { opacity: 0; visibility: hidden; }
.boot__inner { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.boot__spinner {
  width: 52px;
  height: 52px;
  border: 4px solid var(--surface);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.boot__word { color: var(--ink); font-size: 20px; font-weight: 500; letter-spacing: .06em; }

/* Barra de progresso a cada navegação */
#topbar { position: fixed; inset-block-start: 0; inset-inline: 0; height: 2px; z-index: 90; background: var(--blue); transform-origin: left; transform: scaleX(0); opacity: 0; transition: transform .25s ease-out, opacity .25s; pointer-events: none; }
[dir="rtl"] #topbar { transform-origin: right; }

/* ---------- Responsivo ---------- */
.scrim { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; grid-template-areas: "hd" "main" "ft"; }
  body.sb-collapsed .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sb); transform: translateX(-100%); transition: transform .25s var(--ease); }
  [dir="rtl"] .sidebar { transform: translateX(100%); }
  body.sb-open .sidebar { transform: none; }
  body.sb-collapsed .sidebar__word, body.sb-collapsed .nav__item span, body.sb-collapsed .sidebar__collapse span, body.sb-collapsed .sidebar__install span { opacity: 1; pointer-events: auto; }
  body.sb-collapsed .nav__group { opacity: 1; height: auto; padding: 20px 24px 8px; }
  .sidebar__collapse { display: none; }
  body.sb-collapsed .sidebar__install { width: auto; height: 52px; padding-inline: 24px; justify-content: flex-start; }
  body.sb-open .scrim { display: block; position: fixed; inset: 0; background: rgba(14,27,44,.55); z-index: 25; }
  .header { padding-inline: 8px 16px; }
  .header__menu { display: grid; }
  .crumb__root, .crumb__sep, .user__meta, .sync span { display: none; }
  .header__tools { gap: 12px; }
  .main { padding: 28px 16px 40px; }
  .footer { padding-inline: 16px; }
  .figure + .figure { padding-inline-start: 0; border-inline-start: 0; border-block-start: 1px solid var(--line); }
  .figure { padding-inline-end: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   Login
   ========================================================================== */
.auth { display: none; min-height: 100vh; min-height: 100dvh; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--sky); }
body.is-auth .auth { display: grid; }
body.is-auth .shell { display: none; }

/* Painel de marca */
.auth__brand { position: relative; isolation: isolate; overflow: hidden; color: var(--white); background: var(--navy); padding: 48px clamp(28px, 4vw, 64px) 28px; display: flex; flex-direction: column; gap: 28px; min-height: 100%; }
.auth__brand::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(14,27,44,.86) 0%, rgba(14,27,44,.72) 45%, rgba(14,27,44,.15) 75%, rgba(14,27,44,.65) 100%); pointer-events: none; }
.auth__logo .brand-mark { stroke: var(--white); }
.auth__logo-img { 
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  flex: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.auth__logo-img:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}
.auth__logo, .auth__pitch, .auth__legal { position: relative; z-index: 2; }
.auth__logo { 
  display: flex; 
  flex-direction: column;
  align-items: center; 
  gap: 16px; 
  text-align: center;
  margin: 0 auto;
  padding: 20px 0;
}
.auth__logo-text {
  font-weight: 600;
  font-size: 24px;
  letter-spacing: 0.02em;
  color: var(--white);
}
.auth__pitch { display: grid; gap: 28px; }
.auth__headline { max-width: 15em; font-size: clamp(30px, 2.8vw, 44px); font-weight: 600; line-height: 1.15; letter-spacing: -.02em; }
[dir="rtl"] .auth__headline { letter-spacing: 0; line-height: 1.35; }
.auth__points { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; max-width: 30em; }
.auth__points li { display: grid; grid-template-columns: 24px 1fr; gap: 16px; align-items: start; }
.auth__points svg { width: 24px; height: 24px; stroke: #9BC8FF; }
.auth__points strong { display: block; font-weight: 600; }
.auth__points span { font-size: 14px; color: #E0EAF5; line-height: 1.6; }
.auth__art { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
[dir="rtl"] .auth__art { transform: scaleX(-1); }
.auth__legal { margin-block-start: auto; font-size: 12px; color: #E0EAF5; line-height: 1.6; }
.auth__legal small { display: block; margin-top: 8px; font-size: 11px; opacity: 0.85; }
.auth__legal strong { color: #fff; font-weight: 600; }

/* Painel do formulário */
.auth__panel { position: relative; display: flex; align-items: center; justify-content: center; padding: 72px 32px 48px; background: var(--white); }
.auth__tools { position: absolute; inset-block-start: 20px; inset-inline-end: 28px; }
.auth__tools label { display: inline-flex; align-items: center; gap: 6px; color: var(--steel); }
.auth__tools svg { width: 18px; height: 18px; }
.auth__tools select { height: 36px; border: 0; background: none; color: var(--ink); cursor: pointer; padding-inline: 4px; }
.auth__form { width: 100%; max-width: 400px; }
.auth__form h1 { font-size: 30px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
[dir="rtl"] .auth__form h1 { letter-spacing: 0; }
.auth__form .lead { margin: 8px 0 28px; color: var(--steel); }

.alert { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; margin-block-end: 20px; font-size: 14px; line-height: 1.45;
  border-inline-start: 3px solid var(--err); background: #FBEDEC; color: #7A1812; }
.alert[hidden] { display: none; }
.alert svg { width: 20px; height: 20px; flex: none; stroke: var(--err); }
.alert--info { border-inline-start-color: var(--blue); background: #EAF1FB; color: var(--navy); }
.alert--info svg { stroke: var(--blue); }

.field { margin-block-end: 20px; }
.field label { display: block; margin-block-end: 8px; font-size: 14px; font-weight: 500; }
.control { display: flex; align-items: center; height: 48px; background: var(--white); border: 1px solid #AEB9C7; border-radius: 2px; transition: border-color .15s, box-shadow .15s; }
.control:hover { border-color: var(--steel); }
.control:focus-within { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.control.is-invalid { border-color: var(--err); box-shadow: 0 0 0 1px var(--err); }
.control > svg { flex: none; width: 20px; height: 20px; margin-inline-start: 14px; color: var(--steel); }
.control:focus-within > svg { color: var(--blue); }
.control input { flex: 1; min-width: 0; height: 100%; padding-inline: 12px; border: 0; background: none; color: var(--ink); font: inherit; outline: none; }
.control input::placeholder { color: #8795A7; }
.control input:-webkit-autofill,
.control input:-webkit-autofill:hover,
.control input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 1000px var(--white) inset;
}
.control__toggle { display: grid; place-items: center; flex: none; width: 48px; height: 100%; background: none; border: 0; color: var(--steel); cursor: pointer; }
.control__toggle svg { width: 20px; height: 20px; }
.control__toggle:hover { color: var(--ink); }
.control__toggle:focus-visible { outline-offset: -4px; }
.hint { display: flex; align-items: center; gap: 6px; margin-block-start: 8px; font-size: 13px; color: var(--warn); }
.hint[hidden] { display: none; }
.hint svg { width: 16px; height: 16px; stroke: var(--warn); }
.field__error { display: flex; align-items: center; gap: 6px; margin-block-start: 8px; font-size: 13px; color: var(--err); }
.field__error[hidden] { display: none; }
.field__error svg { flex: none; width: 16px; height: 16px; stroke: var(--err); }

.check { position: relative; display: inline-flex; align-items: center; gap: 10px; margin-block-end: 24px; cursor: pointer; user-select: none; font-size: 14px; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check i { display: grid; place-items: center; width: 18px; height: 18px; background: var(--white); border: 1px solid #AEB9C7; border-radius: 2px; transition: background .12s, border-color .12s; }
.check i svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 2.4; opacity: 0; }
.check input:checked + i { background: var(--blue); border-color: var(--blue); }
.check input:checked + i svg { opacity: 1; }
.check input:focus-visible + i { outline: 2px solid var(--blue); outline-offset: 2px; }

.btn--block { width: 100%; height: 48px; justify-content: center; gap: 10px; font-size: 15px; }
.btn[disabled] { opacity: .75; cursor: progress; }
.btn:focus-visible { outline-offset: 3px; }
.spin { width: 18px; height: 18px; stroke: #fff; stroke-width: 2.4; animation: spin .8s linear infinite; }
.spin[hidden] { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth__help { margin-block-start: 20px; font-size: 13px; color: var(--steel); }
.demo { margin-block-start: 32px; padding-block-start: 16px; border-block-start: 1px solid var(--line); font-size: 13px; }
.demo summary { cursor: pointer; font-weight: 500; color: var(--navy); }
.demo__hint { margin-block: 8px 4px; color: var(--steel); }
.demo ul { list-style: none; margin: 0; padding: 0; }
.demo button { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; padding: 10px 0; background: none; border: 0; border-block-end: 1px solid var(--line); text-align: start; cursor: pointer; }
.demo button:hover { color: var(--blue); }
.demo small { color: var(--steel); font-size: 12px; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth__brand { padding: 24px 24px 18px; gap: 0; }
  .auth__logo {
    padding: 0;
    margin: 0;
  }
  .auth__logo-img {
    width: 56px;
    height: 56px;
  }
  .auth__logo-text {
    font-size: 18px;
  }
  .auth__pitch, .auth__art, .auth__legal { display: none; }
  .auth__panel { align-items: flex-start; padding: 56px 24px 40px; }
  .auth__tools { inset-block-start: 10px; inset-inline-end: 16px; }
  .auth__form h1 { font-size: 26px; }
}

/* Login com Google */
.divider { display: flex; align-items: center; gap: 16px; margin-block: 24px 20px; color: var(--steel); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.google[hidden], .google__btn[hidden], .google__note[hidden] { display: none; }
.google__btn { display: flex; justify-content: center; min-height: 44px; color-scheme: light; }
.google__btn.is-loading { height: 44px; background: linear-gradient(90deg, #E6EAF0 25%, #F1F3F7 50%, #E6EAF0 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.google__note { padding: 12px 14px; border-inline-start: 3px solid var(--steel); background: var(--surface); color: var(--steel); font-size: 13px; }
.auth__form.is-busy { pointer-events: none; opacity: .6; transition: opacity .15s; }

/* Social Login Buttons */
.social-login { margin-block-start: 24px; }
.social-login__buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-block-start: 20px;
}
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  cursor: pointer;
  transition: all .2s var(--ease);
  position: relative;
}
.social-btn svg {
  stroke: none;
  fill: currentColor;
}
.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.social-btn:active {
  transform: translateY(0);
}
.social-btn--google {
  border-color: #E8EAED;
}
.social-btn--google:hover {
  border-color: #4285F4;
  background: #F8FAFE;
}
.social-btn--facebook {
  border-color: #DFE3EE;
}
.social-btn--facebook:hover {
  border-color: #1877F2;
  background: #F0F5FF;
}
.social-btn--instagram {
  border-color: #E1E8ED;
}
.social-btn--instagram:hover {
  border-color: #E1306C;
  background: linear-gradient(135deg, #FFF5F7, #FFF9F0);
}

@media(max-width:500px) {
  .social-login__buttons { gap: 12px; }
  .social-btn { width: 50px; height: 50px; }
  .social-btn svg { width: 18px; height: 18px; }
}



/* ==========================================================================
   Super Admin Panel - Estilos específicos
   ========================================================================== */

/* Page header */
.page__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-block-end: 32px;
  padding-block-end: 20px;
  border-block-end: 1px solid var(--line);
}

.page__header h2 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.2;
}

.page__header p {
  margin-block-start: 6px;
  color: var(--steel);
  font-size: 15px;
}

/* Grid system */
.grid {
  display: grid;
  gap: 24px;
  margin-block-end: 32px;
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

/* Card component */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 24px;
}

.card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-block-end: 16px;
}

/* Card stats */
.card__stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card__value {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1;
  color: var(--ink);
}

.card__label {
  font-size: 13px;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Table */
.table-container {
  overflow-x: auto;
  margin-block: 16px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table thead {
  background: var(--surface);
}

.table th {
  padding: 12px 16px;
  text-align: start;
  font-weight: 600;
  color: var(--ink);
  border-block-end: 1px solid var(--line);
}

.table td {
  padding: 12px 16px;
  border-block-end: 1px solid var(--line);
}

.table tr:last-child td {
  border-block-end: none;
}

.table td.text-center {
  text-align: center;
  color: var(--steel);
  padding: 24px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 2px;
  background: var(--surface);
  color: var(--ink);
}

.badge--primary {
  background: var(--blue);
  color: #fff;
}

.badge--success {
  background: var(--ok);
  color: #fff;
}

.badge--warning {
  background: var(--warn);
  color: #fff;
}

.badge--danger {
  background: var(--err);
  color: #fff;
}

/* Buttons */
.btn--primary {
  background: var(--blue);
  color: #fff;
}

.btn--primary:hover {
  background: var(--blue-d);
}

.btn--sm {
  height: 32px;
  padding-inline: 12px;
  font-size: 13px;
  background: var(--surface);
  color: var(--ink);
}

.btn--sm:hover {
  background: var(--line);
}

.btn--danger {
  background: var(--err);
  color: #fff;
}

.btn--danger:hover {
  background: #9A1F18;
}

.btn--success {
  background: var(--ok);
  color: #fff;
}

.btn--success:hover {
  background: #16613E;
}

/* Filters */
.filters {
  display: flex;
  gap: 12px;
  margin-block-end: 24px;
  flex-wrap: wrap;
}

.input,
.select {
  height: 40px;
  padding-inline: 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  transition: border-color .15s;
}

.input {
  min-width: 240px;
  flex: 1;
}

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--blue);
}

.input::placeholder {
  color: var(--steel);
}

.select {
  min-width: 160px;
  cursor: pointer;
}

/* Actions section */
.actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.actions .btn {
  justify-content: center;
}

/* Plans card */
.card--plan {
  display: flex;
  flex-direction: column;
  position: relative;
}

.card--featured {
  border-color: var(--blue);
  border-width: 2px;
}

.card__header {
  margin-block-end: 16px;
}

.card__header h3 {
  margin-block-end: 8px;
}

.price {
  display: block;
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
}

.card__features {
  list-style: none;
  padding: 0;
  margin: 0 0 auto;
}

.card__features li {
  padding: 8px 0;
  border-block-end: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
}

.card__features li:last-child {
  border-block-end: none;
}

.card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-block-start: 24px;
  padding-block-start: 16px;
  border-block-start: 1px solid var(--line);
}

/* Chart placeholder */
.chart-placeholder {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px dashed var(--line);
  padding: 32px;
  text-align: center;
  color: var(--steel);
}

/* Stat rows (for reports) */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-block-end: 1px solid var(--line);
}

.stat-row:last-child {
  border-block-end: none;
}

.stat-label {
  color: var(--steel);
  font-size: 14px;
}

.stat-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}

/* Responsive */
@media (max-width: 900px) {
  .page__header {
    flex-direction: column;
    gap: 16px;
  }
  
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }
  
  .filters {
    flex-direction: column;
  }
  
  .input,
  .select {
    width: 100%;
    min-width: 0;
  }
}


/* ==========================================================================
   Modal Component
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 27, 44, 0.7);
  backdrop-filter: blur(2px);
}

.modal__content {
  position: relative;
  background: var(--white);
  border-radius: 2px;
  box-shadow: 0 8px 32px rgba(14, 27, 44, 0.24);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-block-end: 1px solid var(--line);
}

.modal__header h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.modal__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: none;
  border: 0;
  font-size: 28px;
  line-height: 1;
  color: var(--steel);
  cursor: pointer;
  transition: color 0.15s;
}

.modal__close:hover {
  color: var(--ink);
}

.modal__body {
  padding: 24px;
  overflow-y: auto;
}

.modal__body .field {
  margin-block-end: 20px;
}

.modal__body .field:last-of-type {
  margin-block-end: 0;
}

.modal__body label {
  display: block;
  margin-block-end: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.modal__footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-block-start: 24px;
  padding-block-start: 20px;
  border-block-start: 1px solid var(--line);
}

/* .btn define display, que vence o [hidden] do UA — igualar à convenção do projecto */
.modal__footer .btn[hidden] { display: none; }

@media (max-width: 600px) {
  .modal__content {
    max-width: 100%;
    margin: 0;
  }
  
  .modal__footer {
    flex-direction: column-reverse;
  }
  
  .modal__footer .btn {
    width: 100%;
  }
}


/* ==========================================================================
   Dialog System (Confirm & Alert)
   ========================================================================== */

#dialog-container {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
}

.dialog {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: all;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.dialog--show {
  opacity: 1;
}

.dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 27, 44, 0.75);
  backdrop-filter: blur(3px);
}

.dialog__box {
  position: relative;
  background: var(--white);
  border-radius: 4px;
  box-shadow: 0 12px 48px rgba(14, 27, 44, 0.3);
  width: 100%;
  max-width: 440px;
  transform: scale(0.95);
  transition: transform 0.2s ease-out;
}

.dialog--show .dialog__box {
  transform: scale(1);
}

.dialog__header {
  padding: 24px 24px 16px;
  border-block-end: 1px solid var(--line);
}

.dialog__header h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

.dialog__body {
  padding: 24px;
}

.dialog__body p {
  margin: 0;
  line-height: 1.6;
  color: var(--ink);
}

.dialog__footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 24px 24px;
}

/* Tipos de diálogo */
.dialog__box--warning .dialog__header {
  background: #FFF9E6;
  border-block-end-color: #FFE7A3;
}

.dialog__box--warning .dialog__header h3 {
  color: var(--warn);
}

.dialog__box--danger .dialog__header {
  background: #FBEDEC;
  border-block-end-color: #F5C6C3;
}

.dialog__box--danger .dialog__header h3 {
  color: var(--err);
}

.dialog__box--danger .dialog__footer .btn--primary {
  background: var(--err);
}

.dialog__box--danger .dialog__footer .btn--primary:hover {
  background: #9A1F18;
}

.dialog__box--success .dialog__header {
  background: #E8F5EE;
  border-block-end-color: #B8E6D0;
}

.dialog__box--success .dialog__header h3 {
  color: var(--ok);
}

.dialog__box--info .dialog__header {
  background: #EAF1FB;
  border-block-end-color: #C4DBEF;
}

.dialog__box--info .dialog__header h3 {
  color: var(--blue);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.toast {
  position: fixed;
  inset-block-start: 24px;
  inset-inline-end: 24px;
  background: var(--white);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(14, 27, 44, 0.2);
  padding: 16px 20px;
  max-width: 400px;
  pointer-events: all;
  cursor: pointer;
  transform: translateX(120%);
  transition: transform 0.3s ease-out;
  border-inline-start: 4px solid var(--blue);
}

[dir="rtl"] .toast {
  transform: translateX(-120%);
}

.toast--show {
  transform: translateX(0);
}

.toast__content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast__icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  font-size: 16px;
  font-weight: 600;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
}

.toast__message {
  flex: 1;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
}

.toast--success {
  border-inline-start-color: var(--ok);
}

.toast--success .toast__icon {
  background: var(--ok);
}

.toast--error {
  border-inline-start-color: var(--err);
}

.toast--error .toast__icon {
  background: var(--err);
}

.toast--warning {
  border-inline-start-color: var(--warn);
}

.toast--warning .toast__icon {
  background: var(--warn);
}

/* Responsive */
@media (max-width: 600px) {
  .dialog__box {
    max-width: 100%;
    margin: 0;
  }
  
  .dialog__footer {
    flex-direction: column-reverse;
  }
  
  .dialog__footer .btn {
    width: 100%;
  }
  
  .toast {
    inset-inline: 16px;
    inset-block-start: 16px;
    max-width: none;
  }
}

/* ==========================================================================
   Gráficos (relatórios do super admin) — SVG à mão, sem dependências
   ========================================================================== */
.chart { margin-block-start: 8px; }
.chart__hint {
  color: var(--steel);
  font-size: 0.8125rem;
  margin-block: 4px 8px;
}
.chart__total { font-size: 0.875rem; color: var(--steel); margin-block-end: 4px; }
.chart__total strong { color: var(--ink); font-weight: 600; }
.chart__svg { width: 100%; height: auto; display: block; }
.chart__svg text {
  fill: var(--steel);
  stroke: none;
  font-family: var(--font);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.chart__grid { stroke: var(--line); stroke-width: 1; }
.chart__line { stroke: var(--blue); stroke-width: 2; fill: none; }
.chart__area { fill: var(--sky); stroke: none; opacity: .8; }
.chart__dot { fill: var(--blue); stroke: var(--white); stroke-width: 1.5; }
.chart__value { fill: var(--ink); font-weight: 600; font-size: 11px; }

.bars { display: grid; gap: 14px; margin-block: 8px 12px; }
.bar-row--zero .bar-row__value,
.bar-row--zero .bar-row__meta { color: var(--steel); }
.bar-row__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-block-end: 5px;
}
.bar-row__name { font-weight: 600; font-size: 0.9375rem; }
.bar-row__value { font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.bar-row__track {
  height: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.bar-row__fill {
  height: 100%;
  background: var(--blue);
  transition: width .4s var(--ease);
}
.bar-row__meta { color: var(--steel); font-size: 0.75rem; margin-block-start: 4px; }
.text-muted { color: var(--steel); }
/* ---------- Ultra‑Pro Overlay Loader ---------- */
#loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(244, 246, 249, 0.85);
  backdrop-filter: blur(4px);
  display: none; /* shown via JS */
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

#loader-overlay .spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--surface);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* ==========================================================================
   Dashboard - Sale Cards
   ========================================================================== */

.sales-list {
  display: grid;
  gap: 16px;
}

.sale-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sale-card:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(31, 95, 191, 0.1);
  transform: translateY(-1px);
}

.sale-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
}

.sale-card__customer {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  display: block;
  margin-bottom: 4px;
}

.sale-card__time {
  font-size: 13px;
  color: var(--steel);
}

.sale-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 12px;
  white-space: nowrap;
}

.sale-card__badge--paid {
  background: #E8F5EE;
  color: var(--ok);
}

.sale-card__badge--partial {
  background: #FFF9E6;
  color: var(--warn);
}

.sale-card__badge--pending {
  background: var(--surface);
  color: var(--steel);
}

.sale-card__badge--cancelled {
  background: #FBEDEC;
  color: var(--err);
}

.sale-card__body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.sale-card__items {
  font-size: 14px;
  color: var(--steel);
}

.sale-card__amount {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.sale-card__footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 600px) {
  .sale-card__body {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .sale-card__amount {
    font-size: 16px;
  }
}

/* Stock */
.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.toolbar__filters {
  display: flex;
  gap: 12px;
  margin-inline-start: auto;
}

.search-box {
  flex: 1;
  min-width: 200px;
}

.search-box input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font: inherit;
}

.search-box input:focus {
  outline: 2px solid var(--blue);
  outline-offset: 0;
  background: var(--white);
}

.table-wrapper {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table thead {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.table th {
  padding: 14px 16px;
  text-align: start;
  font-weight: 600;
  color: var(--steel);
  white-space: nowrap;
}

.table td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background: var(--surface);
}

.row--inactive {
  opacity: 0.6;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge--success {
  background: #E8F3EC;
  color: #20633E;
}

.badge--warning {
  background: #FFF2D8;
  color: #805000;
}

.badge--error {
  background: #FFF1EF;
  color: #B3261E;
}

.badge--secondary {
  background: var(--surface);
  color: var(--steel);
}

.btn-group {
  display: flex;
  gap: 8px;
}

.btn--sm {
  padding: 6px 12px;
  font-size: 13px;
  min-height: auto;
}

.btn--error {
  background: var(--err);
  color: white;
}

.btn--error:hover {
  background: #8B1C15;
}

.form-row {
  margin-bottom: 20px;
}

.form-row--2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row--3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

@media(max-width: 900px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .toolbar__filters {
    margin-inline-start: 0;
    flex-direction: column;
  }
  
  .form-row--2,
  .form-row--3 {
    grid-template-columns: 1fr;
  }
}

/* Customers & Payments */
.modal--large .modal__content {
  max-width: 900px;
  width: calc(100% - 32px);
}

.customer-details__info {
  padding: 16px;
  background: var(--surface);
  border-radius: 6px;
  margin-bottom: 20px;
}

.customer-details__info p {
  margin: 8px 0;
  line-height: 1.6;
}

.table--compact {
  font-size: 13px;
}

.table--compact th,
.table--compact td {
  padding: 10px 12px;
}

.btn--primary {
  background: var(--blue);
  color: white;
}

.btn--primary:hover {
  background: var(--blue-d);
}

.table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

@media(max-width: 900px) {
  .modal--large .modal__content {
    max-width: 100%;
  }
}

/* Deliveries */
.deliveries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.delivery-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.delivery-card:hover {
  box-shadow: 0 4px 12px rgba(14, 27, 44, 0.1);
  transform: translateY(-2px);
}

.delivery-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.delivery-card__body {
  margin-bottom: 16px;
}

.delivery-card__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.5;
}

.delivery-card__row strong {
  color: var(--steel);
  font-weight: 500;
  min-width: 100px;
}

.delivery-card__row span {
  text-align: end;
  flex: 1;
}

.delivery-card__footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge--large {
  font-size: 14px;
  padding: 6px 14px;
}

.badge--info {
  background: #E1F0FF;
  color: #1F5FBF;
}

.btn--success {
  background: var(--ok);
  color: white;
}

.btn--success:hover {
  background: #166037;
}

/* Delivery Details */
.delivery-details > div {
  margin-bottom: 28px;
}

.delivery-details h4 {
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
}

.delivery-details h5 {
  margin: 16px 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--steel);
}

.delivery-details__status {
  padding: 16px;
  background: var(--surface);
  border-radius: 8px;
  text-align: center;
}

.delivery-details__info,
.delivery-details__sale {
  padding: 16px;
  background: var(--surface);
  border-radius: 8px;
}

.delivery-details__info p,
.delivery-details__sale p {
  margin: 8px 0;
  line-height: 1.6;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline__item {
  position: relative;
  padding-bottom: 24px;
}

.timeline__item::before {
  content: '';
  position: absolute;
  left: -25px;
  top: 8px;
  bottom: -8px;
  width: 2px;
  background: var(--line);
}

.timeline__item:last-child::before {
  display: none;
}

.timeline__marker {
  position: absolute;
  left: -31px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--line);
}

.timeline__item--active .timeline__marker {
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(31, 95, 191, 0.2);
}

.timeline__content strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.timeline__content p {
  margin: 2px 0;
  font-size: 13px;
  color: var(--steel);
}

.timeline__content small {
  font-size: 12px;
  color: var(--steel);
}

@media(max-width: 768px) {
  .deliveries-grid {
    grid-template-columns: 1fr;
  }
  
  .delivery-card__row {
    flex-direction: column;
    gap: 4px;
  }
  
  .delivery-card__row strong {
    min-width: auto;
  }
  
  .delivery-card__row span {
    text-align: start;
  }
}

/* Couriers */
.courier-details > div {
  margin-bottom: 28px;
}

.courier-details__info {
  padding: 16px;
  background: var(--surface);
  border-radius: 6px;
  margin-bottom: 20px;
}

.courier-details__info p {
  margin: 8px 0;
  line-height: 1.6;
}

.courier-details h4 {
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
}
