/* ====================================================================
   CAROL CONFEITARIA & SALGADOS — DESIGN SYSTEM 2.0
   Visual moderno: sidebar escura, cards com gradiente, ícones SVG,
   microinterações e layout responsivo (desktop + celular).
   Paleta: Ink (azul-noite) · Caramelo/Âmbar · Esmeralda · Slate
   ==================================================================== */

:root {
  /* Base */
  --ink: #0b1220;
  --ink-2: #111b30;
  --ink-3: #1b2744;
  --primary: #0f172a;
  --primary-hover: #1e293b;
  --primary-subtle: #f1f5f9;

  /* Marca */
  --gold: #fbbf24;
  --brand: #c2570c;
  --brand-hover: #9a3f08;
  --brand-light: #ffedd5;
  --brand-subtle: #fff7ed;
  --grad-brand: linear-gradient(135deg, #e0690f 0%, #b4490a 100%);
  --grad-brand-soft: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  --grad-ink: linear-gradient(135deg, #0b1220 0%, #16213a 55%, #2b2113 130%);

  --secondary: #334155;

  /* Estados */
  --success: #059669;
  --success-light: #ecfdf5;
  --success-border: #a7f3d0;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --warning-border: #fde68a;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --danger-border: #fecaca;
  --info: #2563eb;
  --info-light: #eff6ff;

  /* Superfícies */
  --bg-body: #f3f5fa;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --border-color: #e6eaf2;
  --border-color-dark: #cfd7e4;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 18px;
  --border-radius-xl: 24px;
  --border-radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 16px -4px rgba(15, 23, 42, 0.10), 0 2px 6px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 18px 36px -12px rgba(15, 23, 42, 0.22);
  --shadow-glow: 0 10px 24px -8px rgba(194, 87, 12, 0.55);
  --shadow-modal: 0 30px 60px -12px rgba(15, 23, 42, 0.35);

  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-w: 272px;
}

/* ====================================================================
   RESET & BASE
   ==================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  background-image:
    radial-gradient(900px 420px at 85% -10%, rgba(251, 146, 60, 0.10), transparent 60%),
    radial-gradient(700px 400px at 0% 0%, rgba(99, 102, 241, 0.06), transparent 60%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { color: var(--primary); font-weight: 800; letter-spacing: -0.02em; }
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; }

/* Ícone SVG padrão */
.ic {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.2em;
}

:focus-visible { outline: 3px solid rgba(224, 105, 15, 0.45); outline-offset: 2px; }

/* ====================================================================
   SHELL: SIDEBAR + ÁREA PRINCIPAL
   ==================================================================== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem 1.25rem;
  background:
    radial-gradient(420px 260px at 0% 0%, rgba(251, 146, 60, 0.20), transparent 65%),
    linear-gradient(180deg, #0b1220 0%, #101a30 100%);
  color: #cbd5e1;
  z-index: 60;
  overflow-y: auto;
}

.brand-wrapper { display: flex; align-items: center; gap: 0.8rem; padding: 0 0.5rem 1.25rem; }

.brand-logo-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--grad-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: var(--shadow-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}
.brand-logo-icon.sm { width: 38px; height: 38px; border-radius: 12px; font-size: 1.15rem; }

.brand-text h1 { font-size: 1rem; line-height: 1.2; color: #fff; font-weight: 800; }
.brand-tagline { font-size: 0.72rem; color: #94a3b8; margin-top: 0.15rem; }

.nav-menu { list-style: none; display: flex; flex-direction: column; gap: 0.2rem; }

.nav-section-label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #5b6b87;
  padding: 1.1rem 0.85rem 0.4rem;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.72rem 0.9rem;
  border-radius: 12px;
  color: #9fb0c9;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  border: 1px solid transparent;
}
.nav-link .ic { font-size: 1.2rem; }
.nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-link.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(251, 146, 60, 0.22), rgba(251, 146, 60, 0.04));
  border-color: rgba(251, 191, 36, 0.18);
}
.nav-link.active .ic { color: var(--gold); }
.nav-link.active::before {
  content: "";
  position: absolute;
  left: -1rem;
  top: 22%;
  bottom: 22%;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.7);
}
.lbl-short { display: none; }

.sidebar-card {
  margin-top: auto;
  padding: 1rem;
  border-radius: var(--border-radius-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 0.78rem;
}
.sidebar-card strong { display: block; color: #fff; font-size: 0.85rem; margin: 0.5rem 0 0.2rem; }
.sidebar-card p { color: #94a3b8; line-height: 1.45; }
.sidebar-card-icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: rgba(251, 191, 36, 0.15); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
}

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 2rem;
  background: rgba(243, 245, 250, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(207, 215, 228, 0.6);
}
.topbar-brand { display: none; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 0.95rem; color: var(--primary); min-width: 0; }
.topbar-brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-greeting { display: flex; flex-direction: column; line-height: 1.25; }
.topbar-greeting strong { font-size: 1.05rem; color: var(--primary); }
.topbar-greeting span { font-size: 0.8rem; color: var(--text-muted); }
.topbar-greeting span::first-letter { text-transform: uppercase; }
.topbar-actions { display: flex; gap: 0.5rem; align-items: center; }

.main-content { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 1.5rem 2rem 2rem; }

.page-view { display: none; }
.page-view.active { display: block; animation: viewIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Cabeçalho de página */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.page-title-wrap { display: flex; align-items: center; gap: 1rem; }
.page-icon {
  width: 52px; height: 52px; border-radius: 16px;
  background: var(--grad-ink); color: var(--gold);
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
  box-shadow: var(--shadow-md); flex-shrink: 0;
}
.page-title { font-size: 1.6rem; font-weight: 800; line-height: 1.15; }
.page-subtitle { font-size: 0.875rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ====================================================================
   BOTÕES
   ==================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: var(--border-radius-md);
  font-size: 0.875rem; font-weight: 700; line-height: 1.2;
  cursor: pointer; border: 1px solid transparent;
  transition: var(--transition); white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-md); }

.btn-brand { background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-glow); }
.btn-brand:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 14px 28px -8px rgba(194, 87, 12, 0.6); }
.btn-brand:active { transform: scale(0.97); }

.btn-outline { background: #fff; border-color: var(--border-color-dark); color: var(--secondary); }
.btn-outline:hover { background: var(--bg-subtle); border-color: var(--secondary); color: var(--primary); }

.btn-ghost { background: transparent; color: var(--secondary); }
.btn-ghost:hover { background: rgba(15, 23, 42, 0.06); }

.btn-glass { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: rgba(255, 255, 255, 0.18); }
.btn-glass:hover { background: rgba(255, 255, 255, 0.22); }

.btn-success { background: linear-gradient(135deg, #10b981, #059669); color: #fff; box-shadow: 0 10px 22px -10px rgba(5, 150, 105, 0.7); }
.btn-success:hover { filter: brightness(1.06); transform: translateY(-1px); }

.btn-danger { background: var(--danger-light); color: var(--danger); border-color: var(--danger-border); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn-sm { padding: 0.42rem 0.8rem; font-size: 0.8rem; border-radius: 10px; }
.btn-lg { padding: 1rem 1.5rem; font-size: 1rem; border-radius: 14px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border-color); color: var(--secondary);
  cursor: pointer; transition: var(--transition);
}
.icon-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); transform: translateY(-1px); }
.icon-btn.ok { color: var(--success); background: var(--success-light); border-color: var(--success-border); }
.icon-btn.ok:hover { background: var(--success); color: #fff; border-color: var(--success); }
.icon-btn.bad { color: var(--danger); background: var(--danger-light); border-color: var(--danger-border); }
.icon-btn.bad:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.action-group { display: flex; gap: 0.4rem; align-items: center; }

/* ====================================================================
   CARDS, BADGES, ESTADOS VAZIOS
   ==================================================================== */
.card {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 1.35rem;
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }

.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.1rem; }
.card-title { font-size: 1.05rem; display: flex; align-items: center; gap: 0.55rem; }
.card-title .ic { color: var(--brand); }
.card-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }

.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.7rem; border-radius: var(--border-radius-full);
  font-size: 0.74rem; font-weight: 700; line-height: 1; white-space: nowrap;
}
.badge .ic { font-size: 0.9rem; }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-paid { background: var(--success-light); color: #047857; border: 1px solid var(--success-border); }
.badge-pending { background: var(--warning-light); color: #92400e; border: 1px solid var(--warning-border); }
.badge-inactive { background: #f1f5f9; color: #64748b; border: 1px solid var(--border-color-dark); }
.badge-doce { background: #fdf2f8; color: #9d174d; border: 1px solid #fbcfe8; }
.badge-salgado { background: var(--brand-subtle); color: #9a3412; border: 1px solid #fed7aa; }

.empty-state, .cart-empty { text-align: center; padding: 2.5rem 1rem; color: var(--text-muted); }
.empty-icon {
  width: 60px; height: 60px; margin: 0 auto 0.85rem; border-radius: 18px;
  background: var(--bg-subtle); color: var(--text-light);
  display: flex; align-items: center; justify-content: center; font-size: 1.7rem;
}
.empty-title { font-weight: 800; color: var(--primary); }
.empty-text { font-size: 0.82rem; margin-top: 0.25rem; }
.empty-state.ok .empty-icon { background: var(--success-light); color: var(--success); }

.loading-state { display: flex; align-items: center; justify-content: center; gap: 0.75rem; padding: 3rem 1rem; color: var(--text-muted); font-size: 0.9rem; font-weight: 600; }
.grid-full { grid-column: 1 / -1; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--border-color-dark); border-top-color: var(--brand); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ====================================================================
   HERO (TELA DE PEDIDO)
   ==================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding: 2.25rem 2.5rem;
  margin-bottom: 1.75rem;
  border-radius: var(--border-radius-xl);
  background:
    radial-gradient(480px 260px at 100% 0%, rgba(251, 146, 60, 0.45), transparent 65%),
    radial-gradient(360px 260px at 0% 120%, rgba(99, 102, 241, 0.35), transparent 65%),
    var(--grad-ink);
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.hero-content { position: relative; z-index: 2; max-width: 600px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.8rem; border-radius: var(--border-radius-full);
  background: rgba(251, 191, 36, 0.15); color: var(--gold);
  border: 1px solid rgba(251, 191, 36, 0.3);
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
}
.hero h2 { color: #fff; font-size: 2.1rem; line-height: 1.15; margin: 0.9rem 0 0.7rem; }
.hero h2 em { font-style: normal; background: linear-gradient(90deg, #fbbf24, #fb923c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: #b6c2d9; font-size: 0.95rem; max-width: 520px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; }
.hero-chip {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.45rem 0.85rem; border-radius: var(--border-radius-full);
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.8rem; font-weight: 600; color: #e2e8f0; backdrop-filter: blur(6px);
}
.hero-chip .ic { color: var(--gold); }

.hero-art { position: relative; width: 240px; height: 170px; flex-shrink: 0; z-index: 1; }
.hero-orb {
  position: absolute; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.2); backdrop-filter: blur(8px);
  box-shadow: 0 18px 30px -12px rgba(0, 0, 0, 0.5);
  animation: float 6s ease-in-out infinite;
}
.orb-a { width: 120px; height: 120px; font-size: 3.6rem; right: 40px; top: 10px; }
.orb-b { width: 80px; height: 80px; font-size: 2.3rem; left: 0; bottom: 0; animation-delay: -2s; }
.orb-c { width: 64px; height: 64px; font-size: 1.8rem; right: 0; bottom: 6px; animation-delay: -4s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ====================================================================
   TELA DE PEDIDO: FILTROS, CATÁLOGO E CARRINHO
   ==================================================================== */
.order-layout { display: grid; grid-template-columns: 1fr 390px; gap: 1.75rem; align-items: start; }

.product-filters { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.category-pills { display: flex; gap: 0.45rem; flex-wrap: wrap; }

.filter-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 1.05rem; border-radius: var(--border-radius-full);
  border: 1px solid var(--border-color-dark); background: #fff; color: var(--text-muted);
  font-size: 0.84rem; font-weight: 700; cursor: pointer; transition: var(--transition);
}
.filter-pill:hover { color: var(--primary); border-color: var(--secondary); transform: translateY(-1px); }
.filter-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: var(--shadow-md); }
.filter-pill.active .ic { color: var(--gold); }

.search-box { position: relative; flex: 1; max-width: 330px; min-width: 200px; }
.search-box-wide { max-width: 440px; }
.search-input {
  width: 100%; padding: 0.65rem 0.9rem 0.65rem 2.6rem;
  border: 1px solid var(--border-color-dark); border-radius: var(--border-radius-full);
  font-size: 0.875rem; font-family: inherit; background: #fff; outline: none; transition: var(--transition);
}
.search-input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(224, 105, 15, 0.14); }
.search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-light); pointer-events: none; }

/* Grade de produtos */
.products-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 1.15rem; }

.product-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: var(--border-radius-lg);
  border: 1.5px solid var(--border-color); box-shadow: var(--shadow-sm);
  transition: var(--transition); animation: cardIn 0.4s ease both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-color-dark); }
.product-card.in-cart { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(224, 105, 15, 0.12), var(--shadow-md); }

.product-thumb-box {
  position: relative; height: 150px; overflow: hidden;
  background: linear-gradient(135deg, #fff7ed, #ffe4cc);
  display: flex; align-items: center; justify-content: center;
}
.product-thumb-box.salgado { background: linear-gradient(135deg, #fef3c7, #fde7b0); }
.product-thumb-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.product-card:hover .product-thumb-img { transform: scale(1.08); }
.product-thumb-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem;
  color: #b4783c; font-size: 0.72rem; font-weight: 700;
}
.product-thumb-placeholder span { font-size: 2.8rem; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.15)); }

.product-category-tag {
  position: absolute; top: 0.65rem; left: 0.65rem; z-index: 2;
  backdrop-filter: blur(8px); background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
}
.qty-badge {
  position: absolute; top: 0.6rem; right: 0.6rem; z-index: 2;
  min-width: 30px; height: 30px; padding: 0 0.5rem; border-radius: var(--border-radius-full);
  background: var(--grad-brand); color: #fff; font-weight: 800; font-size: 0.85rem;
  display: none; align-items: center; justify-content: center;
  box-shadow: var(--shadow-glow);
}
.product-card.in-cart .qty-badge { display: flex; animation: pop 0.25s ease; }
@keyframes pop { 0% { transform: scale(0.5); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }

.product-info-body { padding: 1rem 1rem 1.05rem; flex: 1; display: flex; flex-direction: column; }
.product-name { font-size: 1rem; font-weight: 800; line-height: 1.3; margin-bottom: 0.3rem; }
.product-desc {
  font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.9rem; min-height: 2.4em;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-bottom-row { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.product-price { font-size: 1.2rem; font-weight: 800; color: var(--brand); letter-spacing: -0.02em; }

/* Controle de quantidade */
.qty-control { display: inline-flex; align-items: center; background: var(--bg-subtle); border-radius: var(--border-radius-full); padding: 3px; border: 1px solid var(--border-color); }
.qty-btn {
  width: 30px; height: 30px; border-radius: 50%; border: none; background: #fff; color: var(--primary);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: var(--transition); box-shadow: var(--shadow-sm);
}
.qty-btn.plus { background: var(--primary); color: #fff; }
.qty-btn:hover { transform: scale(1.1); }
.qty-btn.plus:hover { background: var(--brand); }
.qty-btn:active { transform: scale(0.92); }
.qty-val { min-width: 30px; text-align: center; font-weight: 800; font-size: 0.9rem; }

/* Carrinho */
.order-summary-card {
  position: sticky; top: 5.5rem; overflow: hidden;
  background: #fff; border-radius: var(--border-radius-xl);
  border: 1px solid var(--border-color); box-shadow: var(--shadow-lg);
}
.summary-title {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 1.1rem 1.25rem; color: #fff; background: var(--grad-ink);
}
.summary-title-main { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.05rem; }
.summary-title-main > .ic { color: var(--gold); }
.count-pill {
  min-width: 24px; height: 24px; padding: 0 0.45rem; border-radius: var(--border-radius-full);
  background: var(--gold); color: #422006; font-size: 0.75rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}

.cart-items-list { max-height: 300px; overflow-y: auto; padding: 0.4rem 1.25rem; }
.cart-item {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0;
  border-bottom: 1px dashed var(--border-color); animation: cardIn 0.25s ease;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-thumb {
  width: 44px; height: 44px; border-radius: 12px; overflow: hidden; flex-shrink: 0;
  background: var(--brand-subtle); display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.cart-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 700; font-size: 0.88rem; line-height: 1.25; }
.cart-item-sub { font-size: 0.74rem; color: var(--text-muted); }
.cart-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; }
.cart-item-price { font-weight: 800; font-size: 0.9rem; }
.qty-control.sm .qty-btn { width: 24px; height: 24px; }
.qty-control.sm .qty-val { min-width: 24px; font-size: 0.8rem; }

/* Toggle pagamento */
.payment-toggle-section { margin: 0.5rem 1.25rem 0; padding: 1rem; background: var(--bg-subtle); border-radius: var(--border-radius-lg); border: 1px solid var(--border-color); }
.toggle-label { display: block; margin-bottom: 0.6rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.toggle-options { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.toggle-btn {
  position: relative; padding: 0.8rem 0.5rem; text-align: center; cursor: pointer;
  border: 2px solid var(--border-color); background: #fff; border-radius: var(--border-radius-md);
  transition: var(--transition); color: var(--secondary);
}
.toggle-btn:hover { border-color: var(--border-color-dark); transform: translateY(-1px); }
.toggle-ic { display: block; margin: 0 auto 0.3rem; font-size: 1.35rem; color: var(--text-light); }
.toggle-title { display: block; font-weight: 800; font-size: 0.85rem; }
.toggle-sub { display: block; font-size: 0.68rem; color: var(--text-muted); margin-top: 0.1rem; }
.toggle-btn.active.now { border-color: var(--success); background: var(--success-light); color: #065f46; }
.toggle-btn.active.now .toggle-ic { color: var(--success); }
.toggle-btn.active.later { border-color: var(--warning); background: var(--warning-light); color: #92400e; }
.toggle-btn.active.later .toggle-ic { color: var(--warning); }

.payment-methods-select { margin-top: 0.7rem; display: flex; gap: 0.45rem; }
.method-chip {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.35rem;
  padding: 0.5rem 0.4rem; font-size: 0.76rem; font-weight: 700; cursor: pointer;
  border-radius: var(--border-radius-sm); border: 1px solid var(--border-color-dark);
  background: #fff; color: var(--secondary); transition: var(--transition);
}
.method-chip:hover { border-color: var(--primary); }
.method-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.method-chip.active .ic { color: var(--gold); }

.summary-footer { padding: 1rem 1.25rem 1.25rem; }
.cart-total-box { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; padding-top: 0.5rem; }
.cart-total-label { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); }
.cart-total-val { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; color: var(--primary); }
.secure-note { display: flex; align-items: center; justify-content: center; gap: 0.4rem; margin-top: 0.75rem; font-size: 0.72rem; color: var(--text-light); }
.secure-note .ic { color: var(--success); }

/* ====================================================================
   CONSULTA DE DÍVIDAS
   ==================================================================== */
.debt-search-hero {
  position: relative; max-width: 720px; margin: 1rem auto 2rem; padding: 2.75rem 2rem 2.5rem;
  text-align: center; border-radius: var(--border-radius-xl); color: #fff;
  background:
    radial-gradient(420px 240px at 100% 0%, rgba(251, 146, 60, 0.4), transparent 65%),
    var(--grad-ink);
  box-shadow: var(--shadow-lg);
}
.debt-hero-icon {
  width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 20px;
  background: rgba(251, 191, 36, 0.15); border: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--gold); display: flex; align-items: center; justify-content: center; font-size: 1.9rem;
}
.debt-search-hero h2 { color: #fff; font-size: 1.7rem; margin-bottom: 0.5rem; }
.debt-search-hero p { color: #b6c2d9; font-size: 0.95rem; margin-bottom: 1.6rem; }
.debt-search-input-group { position: relative; max-width: 520px; margin: 0 auto; }
.debt-big-input {
  width: 100%; padding: 1.05rem 1.25rem 1.05rem 3.4rem; font-size: 1.05rem; font-family: inherit; font-weight: 600;
  border: 2px solid transparent; border-radius: var(--border-radius-full); outline: none;
  background: #fff; color: var(--primary); transition: var(--transition); box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.5);
}
.debt-big-input:focus { border-color: var(--gold); box-shadow: 0 0 0 5px rgba(251, 191, 36, 0.25), 0 14px 30px -10px rgba(0, 0, 0, 0.5); }
.debt-search-icon { position: absolute; left: 1.3rem; top: 50%; transform: translateY(-50%); font-size: 1.3rem; color: var(--text-light); }

.suggestions-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 20; display: none; text-align: left;
  max-height: 240px; overflow-y: auto; background: #fff; border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg); box-shadow: var(--shadow-lg); padding: 0.35rem;
}
.suggestion-item {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.6rem 0.75rem; border-radius: var(--border-radius-md); cursor: pointer; color: var(--primary); transition: var(--transition);
}
.suggestion-item:hover { background: var(--brand-subtle); }
.suggestion-left { display: flex; align-items: center; gap: 0.65rem; }
.suggestion-item small { font-size: 0.72rem; color: var(--brand); font-weight: 700; display: inline-flex; align-items: center; gap: 0.25rem; }

.debt-result-card {
  max-width: 800px; margin: 0 auto; overflow: hidden; background: #fff;
  border-radius: var(--border-radius-xl); border: 1px solid var(--border-color); box-shadow: var(--shadow-lg);
  animation: cardIn 0.35s ease;
}
.debt-result-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; padding: 1.6rem 1.75rem; border-bottom: 1px solid var(--border-color); }
.debt-result-header.has-debt { background: linear-gradient(135deg, #fffbeb, #fef3c7); border-bottom-color: var(--warning-border); }
.debt-result-header.clean { background: linear-gradient(135deg, #ecfdf5, #d1fae5); border-bottom-color: var(--success-border); }
.debt-person { display: flex; align-items: center; gap: 1rem; }
.debt-eyebrow { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }
.debt-name { font-size: 1.5rem; }
.debt-content { padding: 1.75rem; }
.debt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.debt-stat { padding: 1.2rem; border-radius: var(--border-radius-lg); background: var(--bg-subtle); border: 1px solid var(--border-color); }
.debt-stat-label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.debt-stat-value { display: block; margin-top: 0.35rem; font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; }
.debt-stat-value.warn { color: var(--warning); }
.debt-stat-value.good { color: var(--success); }
.section-label { font-size: 0.95rem; margin-bottom: 0.7rem; display: flex; align-items: center; gap: 0.5rem; }
.section-label .ic { color: var(--brand); }
.pending-list { border: 1px solid var(--border-color); border-radius: var(--border-radius-lg); padding: 0.25rem 1.1rem; margin-bottom: 1.5rem; }
.pending-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; padding: 0.9rem 0; border-bottom: 1px dashed var(--border-color); }
.pending-row:last-child { border-bottom: none; }
.pending-items { font-weight: 600; font-size: 0.9rem; }
.pending-date { font-size: 0.78rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.3rem; margin-top: 0.15rem; }
.pending-total { font-weight: 800; font-size: 1.1rem; color: var(--warning); }
.debt-clear { text-align: center; padding: 1.5rem 1rem 0.5rem; }
.debt-clear .empty-icon { background: var(--success-light); color: var(--success); width: 72px; height: 72px; border-radius: 50%; font-size: 2rem; }
.debt-clear h4 { font-size: 1.3rem; }
.debt-clear p { color: var(--text-muted); font-size: 0.9rem; margin: 0.3rem 0 1.2rem; }

.pix-payment-box {
  display: flex; flex-direction: column; gap: 0.75rem; padding: 1.25rem;
  border-radius: var(--border-radius-lg); border: 1.5px dashed #34d399;
  background: linear-gradient(135deg, #f0fdf9, #ecfdf5);
}
.pix-title { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; color: #065f46; }
.pix-payment-box p { font-size: 0.85rem; color: #047857; }
.pix-key-display {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.55rem 0.55rem 0.55rem 1rem;
  background: #fff; border: 1px solid var(--success-border); border-radius: var(--border-radius-md);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; color: var(--primary); word-break: break-all;
}
.pix-meta { font-size: 0.76rem; color: #047857; }

/* ====================================================================
   DASHBOARD
   ==================================================================== */
.metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.15rem; margin-bottom: 1.75rem; }

.metric-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 1.35rem; border-radius: var(--border-radius-lg); background: #fff;
  border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); transition: var(--transition);
}
.metric-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.metric-card::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 130px; height: 130px; border-radius: 50%;
  background: var(--accent-soft, transparent); opacity: 0.6; pointer-events: none;
}
.metric-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; position: relative; z-index: 1; }
.metric-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.metric-icon {
  width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
  background: var(--accent-bg, var(--bg-subtle)); color: var(--accent, var(--secondary)); box-shadow: 0 8px 16px -8px var(--accent, transparent);
}
.metric-val { position: relative; z-index: 1; font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; color: var(--primary); }
.metric-sub { position: relative; z-index: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; font-size: 0.8rem; color: var(--text-muted); }
.dot-sep { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.5; }

.metric-today { --accent: #fbbf24; --accent-bg: rgba(251, 191, 36, 0.16); background: var(--grad-ink); border-color: transparent; }
.metric-today::after { background: radial-gradient(circle, rgba(251, 146, 60, 0.55), transparent 70%); opacity: 1; }
.metric-today .metric-label, .metric-today .metric-sub { color: #aebbd2; }
.metric-today .metric-val { color: #fff; }
.metric-week { --accent: #4f46e5; --accent-bg: #eef2ff; --accent-soft: #eef2ff; }
.metric-month { --accent: #7c3aed; --accent-bg: #f5f3ff; --accent-soft: #f5f3ff; }
.metric-debt { --accent: #d97706; --accent-bg: #fffbeb; --accent-soft: #fef3c7; }
.metric-debt .metric-val { color: var(--warning); }
.metric-paid { --accent: #059669; --accent-bg: #ecfdf5; --accent-soft: #d1fae5; }
.metric-paid .metric-val { color: var(--success); }

.metric-ring { flex-direction: row; align-items: center; gap: 1.25rem; justify-content: flex-start; }
.ring {
  --pct: 0; flex-shrink: 0; width: 104px; height: 104px; border-radius: 50%; position: relative;
  background: conic-gradient(#10b981 calc(var(--pct) * 1%), #fde68a 0);
  display: flex; align-items: center; justify-content: center; transition: background 0.6s ease;
}
.ring-inner {
  width: 76px; height: 76px; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.15rem; box-shadow: inset 0 2px 6px rgba(15, 23, 42, 0.08);
}
.ring-info { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.ring-legend { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--text-muted); flex-wrap: wrap; }
.ring-legend strong { color: var(--primary); }
.lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-paid { background: #10b981; }
.lg-pending { background: #fbbf24; }

.dashboard-columns { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 1.5rem; margin-bottom: 1rem; }

/* Lista de devedores */
.debtor-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 0.5rem; border-bottom: 1px solid var(--border-color); border-radius: var(--border-radius-md); transition: var(--transition); }
.debtor-item:hover { background: #fffbf3; }
.debtor-item:last-child { border-bottom: none; }
.debtor-left { display: flex; align-items: center; gap: 0.85rem; min-width: 0; flex: 1; }
.debtor-name { font-weight: 800; }
.debtor-count { font-size: 0.78rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.debtor-right { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; justify-content: flex-end; }
.debtor-amount { font-weight: 800; font-size: 1.1rem; color: var(--warning); }

/* Ranking de produtos */
.top-item { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 1rem; }
.top-rank {
  width: 30px; height: 30px; border-radius: 10px; flex-shrink: 0; background: var(--bg-subtle); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.82rem;
}
.top-item:nth-child(1) .top-rank { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #78350f; }
.top-item:nth-child(2) .top-rank { background: linear-gradient(135deg, #e2e8f0, #94a3b8); color: #1e293b; }
.top-item:nth-child(3) .top-rank { background: linear-gradient(135deg, #fed7aa, #ea8a3c); color: #7c2d12; }
.top-body { flex: 1; min-width: 0; }
.top-row { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.85rem; margin-bottom: 0.35rem; }
.top-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-qty { font-weight: 700; color: var(--brand); white-space: nowrap; }
.progress { height: 8px; border-radius: 999px; background: var(--bg-subtle); overflow: hidden; }
.progress > div { height: 100%; border-radius: 999px; background: var(--grad-brand); transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }

/* ====================================================================
   BARRA DE ESTATÍSTICAS, TOOLBAR E TABELAS
   ==================================================================== */
.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stat-mini { display: flex; align-items: center; gap: 0.9rem; padding: 1rem 1.15rem; background: #fff; border: 1px solid var(--border-color); border-radius: var(--border-radius-lg); box-shadow: var(--shadow-sm); }
.stat-mini small { display: block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.stat-mini strong { font-size: 1.3rem; letter-spacing: -0.02em; }
.stat-mini-ic { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.ic-blue { background: #eff6ff; color: #2563eb; }
.ic-green { background: #ecfdf5; color: #059669; }
.ic-amber { background: #fffbeb; color: #d97706; }
.ic-red { background: #fef2f2; color: #dc2626; }

.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.9rem 1.1rem; margin-bottom: 1.25rem; }
.toolbar:hover { box-shadow: var(--shadow-sm); }
.toolbar-right { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }

.table-responsive { width: 100%; overflow-x: auto; background: #fff; border-radius: var(--border-radius-lg); border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.875rem; }
.data-table th {
  background: #f8fafc; color: var(--text-muted); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--border-color); white-space: nowrap;
}
.data-table td { padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.data-table tbody tr { transition: background 0.15s ease; }
.data-table tbody tr:hover { background: #fffbf5; }
.data-table tbody tr:last-child td { border-bottom: none; }
.cell-strong { font-weight: 700; color: var(--primary); }
.cell-muted { font-size: 0.8rem; color: var(--text-muted); }
.cell-items { max-width: 320px; font-size: 0.84rem; color: var(--secondary); }
.cell-price { font-weight: 800; font-size: 1rem; letter-spacing: -0.01em; }
.cell-price.pending { color: var(--warning); }
.cell-price.brand { color: var(--brand); }
.cell-user { display: flex; align-items: center; gap: 0.7rem; }
.qty-chip { display: inline-block; padding: 0.1rem 0.45rem; margin-right: 0.15rem; border-radius: 6px; background: var(--brand-light); color: var(--brand-hover); font-weight: 800; font-size: 0.75rem; }

.table-thumb { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; border: 1px solid var(--border-color); display: block; }
.table-thumb-empty { width: 52px; height: 52px; border-radius: 14px; background: var(--bg-subtle); color: var(--text-light); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }

/* Avatares */
.avatar {
  width: 40px; height: 40px; border-radius: 13px; flex-shrink: 0; color: #fff; font-weight: 800; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center; letter-spacing: 0.02em; box-shadow: var(--shadow-sm);
}
.avatar.lg { width: 56px; height: 56px; border-radius: 18px; font-size: 1.15rem; }
.avatar.sm { width: 32px; height: 32px; border-radius: 10px; font-size: 0.72rem; }
.av-0 { background: linear-gradient(135deg, #f59e0b, #d97706); }
.av-1 { background: linear-gradient(135deg, #6366f1, #4338ca); }
.av-2 { background: linear-gradient(135deg, #10b981, #047857); }
.av-3 { background: linear-gradient(135deg, #ec4899, #be185d); }
.av-4 { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.av-5 { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

/* ====================================================================
   FORMULÁRIOS & MODAIS
   ==================================================================== */
.form-group { margin-bottom: 1.15rem; }
.form-label { display: block; font-size: 0.82rem; font-weight: 700; color: var(--primary); margin-bottom: 0.4rem; }
.form-control {
  width: 100%; padding: 0.7rem 0.9rem; border: 1px solid var(--border-color-dark); border-radius: var(--border-radius-md);
  font-size: 0.9rem; font-family: inherit; color: var(--primary); background: #fff; outline: none; transition: var(--transition);
}
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(224, 105, 15, 0.14); }
.form-control-sm { width: auto; padding: 0.55rem 0.85rem; border-radius: var(--border-radius-full); font-weight: 600; }
.form-control-lg { padding: 0.9rem 1rem; font-size: 1rem; font-weight: 700; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.check-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem 1rem; background: var(--bg-subtle); border-radius: var(--border-radius-md); cursor: pointer; font-weight: 700; font-size: 0.875rem; }
.check-row input { width: 18px; height: 18px; accent-color: var(--brand); }

.photo-upload-area { display: block; padding: 1.4rem; text-align: center; cursor: pointer; border: 2px dashed var(--border-color-dark); border-radius: var(--border-radius-lg); background: var(--bg-subtle); transition: var(--transition); }
.photo-upload-area:hover { border-color: var(--brand); background: var(--brand-subtle); }
.photo-upload-icon { width: 56px; height: 56px; margin: 0 auto 0.6rem; border-radius: 18px; background: var(--grad-brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; box-shadow: var(--shadow-glow); }
.photo-upload-area p { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }
.photo-preview { display: none; max-height: 200px; max-width: 100%; margin: 0 auto; border-radius: var(--border-radius-md); object-fit: cover; box-shadow: var(--shadow-md); }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 1.5rem; align-items: start; max-width: 1000px; }
.preview-card { background: var(--grad-ink); border-color: transparent; }
.preview-card:hover { box-shadow: var(--shadow-sm); }
.preview-eyebrow { display: block; margin-bottom: 0.85rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); }

dialog {
  border: none; border-radius: var(--border-radius-xl); box-shadow: var(--shadow-modal); padding: 0;
  max-width: 560px; width: 92%; margin: auto; overflow: hidden; color: var(--text-main); background: #fff;
}
dialog[open] { animation: modalIn 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(0.97); } to { opacity: 1; transform: none; } }
dialog::backdrop { background: rgba(8, 13, 26, 0.65); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }

.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.5rem; background: var(--grad-ink); }
.modal-title-wrap { display: flex; align-items: center; gap: 0.8rem; }
.modal-icon { width: 38px; height: 38px; border-radius: 12px; background: rgba(251, 191, 36, 0.16); color: var(--gold); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.modal-icon.icon-success { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.modal-title { font-size: 1.1rem; color: #fff; }
.modal-close-btn { width: 34px; height: 34px; border-radius: 10px; border: none; cursor: pointer; background: rgba(255, 255, 255, 0.1); color: #cbd5e1; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.modal-close-btn:hover { background: var(--danger); color: #fff; }
.modal-body { padding: 1.5rem; max-height: 72vh; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.75rem; padding: 1rem 1.5rem; background: #f8fafc; border-top: 1px solid var(--border-color); }

.summary-chip-box { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.15rem; margin-bottom: 1.25rem; background: var(--grad-brand-soft); border: 1px solid #fed7aa; border-radius: var(--border-radius-lg); }
.summary-chip-label { display: block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #9a3412; }
.summary-chip-value { font-size: 1.4rem; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }

.settle-lead { margin-bottom: 1rem; color: var(--secondary); }
.amount-box { text-align: center; padding: 1.4rem; margin-bottom: 1.25rem; border-radius: var(--border-radius-lg); background: linear-gradient(135deg, #ecfdf5, #d1fae5); border: 1px solid var(--success-border); }
.amount-label { display: block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #047857; }
.amount-value { font-size: 2.3rem; font-weight: 800; color: var(--success); letter-spacing: -0.03em; }

/* Detalhes da venda */
.detail-box { padding: 1rem 1.1rem; margin-bottom: 1.25rem; background: var(--bg-subtle); border-radius: var(--border-radius-lg); }
.detail-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.3rem 0; font-size: 0.88rem; }
.detail-row span:first-child { color: var(--text-muted); font-size: 0.82rem; }
.detail-items { margin-bottom: 1.1rem; }
.detail-item { display: flex; justify-content: space-between; gap: 1rem; padding: 0.65rem 0; border-bottom: 1px dashed var(--border-color-dark); font-size: 0.9rem; }
.detail-item small { display: block; font-size: 0.74rem; color: var(--text-muted); }
.detail-total { display: flex; justify-content: space-between; align-items: center; padding-top: 0.9rem; border-top: 2px solid var(--primary); }
.detail-total strong:last-child { font-size: 1.5rem; letter-spacing: -0.02em; }

/* ====================================================================
   TOASTS & RODAPÉ
   ==================================================================== */
#toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; z-index: 9999; pointer-events: none; }
.toast {
  pointer-events: auto; min-width: 290px; max-width: 400px; display: flex; align-items: center; gap: 0.8rem;
  padding: 0.8rem 1.1rem 0.8rem 0.85rem; background: #fff; border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border-color); font-size: 0.875rem; font-weight: 600;
  animation: toastIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
.toast-icon { width: 34px; height: 34px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; background: #eff6ff; color: var(--info); }
.toast.toast-success .toast-icon { background: var(--success-light); color: var(--success); }
.toast.toast-error .toast-icon { background: var(--danger-light); color: var(--danger); }
.toast.toast-warning .toast-icon { background: var(--warning-light); color: var(--warning); }
.toast.toast-info .toast-icon { background: #eff6ff; color: var(--info); }

.app-footer { margin-top: 2.5rem; padding: 1.25rem 0 0; text-align: center; color: var(--text-light); font-size: 0.78rem; border-top: 1px solid var(--border-color); }

/* ====================================================================
   RESPONSIVO
   ==================================================================== */
@media (max-width: 1180px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .order-layout { grid-template-columns: 1fr 350px; }
}

@media (max-width: 1024px) {
  /* Sidebar vira barra de navegação inferior */
  .sidebar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: auto; flex-direction: row;
    padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom));
    background: rgba(11, 18, 32, 0.96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255, 255, 255, 0.1); overflow: visible;
  }
  .sidebar .brand-wrapper, .sidebar .sidebar-card, .nav-section-label { display: none; }
  .sidebar nav { width: 100%; }
  .nav-menu { flex-direction: row; gap: 0; }
  .nav-menu li { flex: 1; min-width: 0; }
  .nav-link { flex-direction: column; justify-content: center; gap: 0.15rem; padding: 0.45rem 0.1rem; font-size: 0.62rem; text-align: center; border: none; }
  .nav-link .ic { font-size: 1.3rem; }
  .nav-link.active { background: rgba(251, 146, 60, 0.16); }
  .nav-link.active::before { left: 25%; right: 25%; top: -0.4rem; bottom: auto; width: auto; height: 3px; border-radius: 0 0 4px 4px; }
  .lbl-full { display: none; }
  .lbl-short { display: inline; }

  .topbar-brand { display: flex; }
  .topbar-greeting { display: none; }
  .topbar { padding: 0.7rem 1rem; }
  .main-content { padding: 1.25rem 1rem calc(5.5rem + env(safe-area-inset-bottom)); }
  #toast-container { bottom: 5.5rem; right: 1rem; left: 1rem; }
  .toast { min-width: 0; max-width: none; }

  .order-layout { grid-template-columns: 1fr; }
  .order-summary-card { position: static; }
  .dashboard-columns { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}

@media (max-width: 720px) {
  .hero { padding: 1.6rem 1.4rem; }
  .hero h2 { font-size: 1.55rem; }
  .hero-art { display: none; }
  .page-title { font-size: 1.3rem; }
  .page-icon { width: 44px; height: 44px; font-size: 1.25rem; border-radius: 14px; }
  .metrics-grid { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: 1fr; }
  .metric-val { font-size: 1.75rem; }
  .products-catalog { grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
  .product-thumb-box { height: 120px; }
  .product-bottom-row { flex-direction: column; align-items: stretch; }
  .product-price { text-align: center; }
  .qty-control { justify-content: space-between; }
  .debt-search-hero { padding: 2rem 1.25rem; }
  .debtor-item { flex-direction: column; align-items: stretch; }
  .debtor-right { justify-content: space-between; }
  .toolbar { padding: 0.85rem; }
  .search-box { max-width: none; }
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; }
}

@media (max-width: 420px) {
  .products-catalog { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.pix-key-display .btn { font-family: var(--font-sans); }

/* Modo administrador: telas de gestão ficam ocultas no menu para os clientes */
body:not(.is-admin) .admin-only { display: none !important; }
