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

/* ══════════════════════════════════════════
   VARIÁVEIS — PALETA VIOLETA / ÍNDIGO
   ══════════════════════════════════════════ */
:root {
  /* Fundos (Azul bem claro) */
  --bg-base:    #f0f9ff;
  --bg-surface: #e0f2fe;

  /* Glassmorphism para fundo claro */
  --glass-bg:         rgba(255,255,255,0.6);
  --glass-bg-hover:   rgba(255,255,255,0.85);
  --glass-bg-strong:  rgba(255,255,255,0.95);
  --glass-border:     rgba(99,102,241,0.15);
  --glass-border-active: rgba(99,102,241,0.4);

  /* Cores primárias (Azul/Roxo original) */
  --primary:       #4f46e5;  
  --primary-light: #6366f1;  
  --primary-dark:  #3730a3;  
  --primary-glow:  rgba(99,102,241,0.25);
  --accent:        #8b5cf6;  
  --accent-light:  #a78bfa;  

  /* Marca */
  --brand-orange: #4f46e5;
  --brand-cyan:   #06b6d4;

  /* Semânticas */
  --success: #10b981;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info:    #3b82f6;

  /* Texto (Escuro para fundo claro) */
  --text-primary: #0f172a;
  --text-muted:   #475569;
  --text-accent:  #1e293b;
  --text-dim:     #94a3b8;

  /* Compatibilidade legada */
  --bg-color:      var(--bg-base);
  --surface-color: var(--glass-bg);
  --primary-color: var(--primary);
  --primary-hover: var(--primary-dark);
  --text-main:     var(--text-primary);
  --border-color:  var(--glass-border);

  /* Geometria */
  --radius-xs:  6px;
  --radius-sm:  10px;
  --radius-md:  16px;
  --radius-lg:  22px;
  --radius-xl:  32px;

  /* Sombras para modo claro */
  --shadow-xs: 0 2px 8px rgba(0,0,0,0.05);
  --shadow-sm: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.5);
  --shadow-glow: 0 0 24px var(--primary-glow);
  --shadow-btn:  0 4px 16px rgba(99,102,241,0.3);
  --shadow-btn-hover: 0 8px 24px rgba(99,102,241,0.45);
  
  /* Transições e Animações */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animações Globais */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spinAround {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin-loading {
  animation: spinAround 0.8s linear infinite !important;
}

.fade-in-item {
  animation: fadeInUp 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ══════════════════════════════════════════
   RESET & BASE
   ══════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  min-height: 100vh;
  background-color: var(--bg-base);
  background-image:
    radial-gradient(ellipse 80% 70% at -5% -5%,   rgba(99,102,241,0.12) 0%, transparent 65%),
    radial-gradient(ellipse 60% 60% at 105% 105%,  rgba(139,92,246,0.1) 0%, transparent 65%),
    radial-gradient(ellipse 50% 50% at 50%  100%,  rgba(56,189,248,0.06) 0%, transparent 80%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ══════════════════════════════════════════
   CONTAINER
   ══════════════════════════════════════════ */
.container {
  width: 100%;
  max-width: 840px;
  padding: 2rem 1.5rem;
  margin: 0 auto;
}

/* ══════════════════════════════════════════
   TOPBAR (layout ESCALÊ)
   ══════════════════════════════════════════ */
.topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  background: rgba(14,12,40,0.85);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.topbar-brand {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.topbar-center {
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.02em;
}

.topbar-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.icon-btn:hover {
  background: var(--primary-glow);
  border-color: var(--glass-border-active);
  color: var(--primary-light);
  transform: translateY(-1px);
}
.topbar .icon-btn {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
}
.topbar .icon-btn:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* ══════════════════════════════════════════
   BOTTOM NAV (mobile — ESCALÊ style)
   ══════════════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: rgba(14,12,40,0.92);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--glass-border);
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.75rem 0.5rem;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.7rem;
  font-weight: 500;
  transition: all 0.2s;
}
.bottom-nav-item i { font-size: 1.15rem; }
.bottom-nav-item.active,
.bottom-nav-item:hover {
  color: var(--primary-light);
}
.bottom-nav-item.active i {
  filter: drop-shadow(0 0 6px var(--primary));
}

/* ══════════════════════════════════════════
   HEADER (páginas de formulário)
   ══════════════════════════════════════════ */
header {
  text-align: center;
  margin-bottom: 2rem;
  padding-top: 1rem;
}

h1 {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #f97316, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 400;
}

/* ── Marca freelaÊ ── */
.brand-freela {
  color: var(--text-primary);
  -webkit-text-fill-color: var(--text-primary);
  font-weight: 800;
}
.topbar .brand-freela, .bottom-nav .brand-freela {
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}
.brand-e {
  color: var(--brand-orange);
  -webkit-text-fill-color: var(--brand-orange);
  font-weight: 800;
}
.brand-tagline {
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.brand-badge {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  font-weight: 800;
}

/* ══════════════════════════════════════════
   GLASSMORPHISM CARD
   ══════════════════════════════════════════ */
.card {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167,139,250,0.3), transparent);
}

/* ══════════════════════════════════════════
   KPI CARDS (dashboard ESCALÊ style)
   ══════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 600px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
}

.kpi-card {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.2rem 1rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
  --kpi-glow-color: rgba(99, 102, 241, 0.2);
}
.kpi-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--kpi-gradient, linear-gradient(90deg, var(--primary), var(--accent)));
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px var(--kpi-glow-color), 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: var(--glass-border-active);
  background: var(--glass-bg-hover);
}
.kpi-card.green  {
  --kpi-gradient: linear-gradient(90deg, #10b981, #34d399);
  --kpi-glow-color: rgba(16, 185, 129, 0.25);
}
.kpi-card.orange {
  --kpi-gradient: linear-gradient(90deg, #f97316, #fbbf24);
  --kpi-glow-color: rgba(249, 115, 22, 0.25);
}
.kpi-card.cyan   {
  --kpi-gradient: linear-gradient(90deg, #00c9e0, #38bdf8);
  --kpi-glow-color: rgba(0, 201, 224, 0.25);
}

.kpi-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--primary-glow);
  border: 1px solid rgba(139,92,246,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  color: var(--primary-light);
  margin-bottom: 0.9rem;
  transition: var(--transition-smooth);
}
.kpi-card.green  .kpi-icon { background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.3); color: #34d399; }
.kpi-card.orange .kpi-icon { background: rgba(249,115,22,0.12); border-color: rgba(249,115,22,0.3); color: #fb923c; }
.kpi-card.cyan   .kpi-icon { background: rgba(0,201,224,0.12);  border-color: rgba(0,201,224,0.3);  color: #00c9e0; }

.kpi-card:hover .kpi-icon {
  transform: scale(1.1) rotate(5deg);
  filter: brightness(1.2);
}

.kpi-value {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.1;
  transition: var(--transition-smooth);
}
.kpi-label {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* ══════════════════════════════════════════
   TOOLBAR / SEARCH
   ══════════════════════════════════════════ */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.25rem;
  align-items: center;
}
.search-box {
  position: relative;
  flex-grow: 1;
  min-width: 200px;
}
.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
}
.search-box input { padding-left: 2.5rem; }

.filter-group { display: flex; gap: 0.4rem; }
.filter-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-xl);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  transition: var(--transition-smooth);
}
.filter-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.filter-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 14px var(--primary-glow);
}

/* ══════════════════════════════════════════
   LISTA DE FREELANCERS (dashboard)
   ══════════════════════════════════════════ */
.freela-list { display: flex; flex-direction: column; gap: 0.75rem; }

.freela-item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-left: 4px solid transparent;
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  display: grid;
  grid-template-columns: auto auto 2fr 1fr 1fr 2fr auto;
  align-items: center;
  gap: 1rem;
  transition: var(--transition-smooth);
}
.freela-item.freela-staff { border-left-color: var(--accent); }
.freela-item.freela-delivery { border-left-color: var(--success); }

.freela-item:hover {
  transform: translateX(6px) translateY(-1px);
  background: var(--glass-bg-strong);
  border-color: var(--glass-border-active);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.08), 0 2px 8px rgba(0, 0, 0, 0.02);
}
.freela-pic {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--glass-border);
  transition: var(--transition-smooth);
}
.freela-item:hover .freela-pic {
  border-color: var(--primary-light);
  transform: scale(1.05);
  box-shadow: 0 0 8px var(--primary-glow);
}

.badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
}
.badge-staff    { background: rgba(99,102,241,0.18); color: var(--accent-light); border: 1px solid rgba(99,102,241,0.3); }
.badge-delivery { background: rgba(16,185,129,0.18); color: #34d399;             border: 1px solid rgba(16,185,129,0.3); }

.valor-box {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--success);
  letter-spacing: -0.02em;
}

.pix-block {
  background: rgba(99, 102, 241, 0.05);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  border: 1px dashed rgba(99, 102, 241, 0.25);
  color: var(--text-primary);
  transition: var(--transition-smooth);
}
.pix-block:hover {
  background: rgba(99, 102, 241, 0.09);
  border-color: rgba(99, 102, 241, 0.45);
}
.copy-btn {
  color: var(--primary-light);
  cursor: pointer;
  background: none;
  border: none;
  margin-left: 4px;
  font-size: 0.8rem;
  transition: color 0.2s, transform 0.1s;
}
.copy-btn:hover { color: var(--brand-cyan); transform: scale(1.1); }
.copy-btn:active { transform: scale(0.9); }

.actions { display: flex; gap: 0.35rem; }
.action-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}
.action-btn:hover {
  background: var(--primary-glow);
  border-color: var(--primary-light);
  color: var(--primary-light);
  transform: scale(1.08) translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

@media (max-width: 768px) {
  .freela-item { grid-template-columns: auto auto 1fr; }
  .freela-item > *:nth-child(n+4) { grid-column: 3; }
}

/* ══════════════════════════════════════════
   ESTADOS VAZIOS / LOADING
   ══════════════════════════════════════════ */
.loading-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}
.loading-state i { font-size: 1.5rem; margin-bottom: 0.8rem; display: block; }
.fa-spin { animation: spin 1s infinite linear; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════
   FORMULÁRIOS
   ══════════════════════════════════════════ */
.form-group { margin-bottom: 1.4rem; }

label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-accent);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.78rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  -webkit-appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px #171413 inset !important;
  -webkit-text-fill-color: #f1f5f9 !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* Opções do select legíveis no dark mode */
select option { background: #1a1540; color: var(--text-primary); }

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--primary);
  margin-top: 2px;
}

hr {
  border: none;
  border-top: 1px solid var(--glass-border);
  margin: 1.75rem 0;
}

/* ══════════════════════════════════════════
   BOTÕES
   ══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.4rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: var(--shadow-btn);
  letter-spacing: 0.01em;
  text-decoration: none;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-btn-hover);
  filter: brightness(1.1);
}
.btn:active { transform: translateY(0); }

.btn-secondary {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  box-shadow: none;
}
.btn-secondary:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-active);
  color: var(--primary-light);
  box-shadow: none;
  filter: none;
}

.btn-block { width: 100%; justify-content: center; padding: 0.9rem; font-size: 1rem; }

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #f87171);
  box-shadow: 0 4px 16px rgba(239,68,68,0.35);
}

/* ══════════════════════════════════════════
   CÂMERA & ASSINATURA
   ══════════════════════════════════════════ */
.camera-container, .signature-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  background: rgba(0,0,0,0.25);
  padding: 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}
video {
  width: 100%;
  max-width: 320px;
  border-radius: var(--radius-sm);
  background: #000;
  border: 1px solid var(--glass-border);
}
canvas.photo-canvas { max-width: 320px; border-radius: var(--radius-sm); }
canvas.signature-pad {
  background: #fff;
  border-radius: var(--radius-sm);
  width: 100%;
  height: 200px;
  touch-action: none;
  border: 1px solid rgba(255,255,255,0.2);
}

/* ══════════════════════════════════════════
   QR CODES (index.html)
   ══════════════════════════════════════════ */
.qr-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.qr-box {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding: 1.8rem;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  transition: transform 0.3s, box-shadow 0.3s;
  min-width: 220px;
}
.qr-box:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-glow);
  border-color: var(--glass-border-active);
}
.qr-box h2 { font-size: 1.3rem; letter-spacing: -0.02em; }
.qr-box.staff    h2 { color: var(--accent-light); }
.qr-box.delivery h2 { color: var(--success); }
.qr-code {
  background: white;
  padding: 0.9rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

/* ══════════════════════════════════════════
   UTILS
   ══════════════════════════════════════════ */
.hidden { display: none !important; }

/* ══════════════════════════════════════════
   PORTAL DE EMPRESAS
   ══════════════════════════════════════════ */
.empresa-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  transition: transform 0.2s, border-color 0.2s;
}
.empresa-card:hover {
  transform: translateY(-2px);
  border-color: rgba(234,88,12,0.3);
}
.empresa-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  color: var(--primary-light);
  background: none;
  -webkit-text-fill-color: var(--primary-light);
}

.link-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}
.link-chip:hover {
  background: rgba(99,102,241,0.12);
  color: var(--accent-light);
  border-color: rgba(99,102,241,0.4);
}
.link-chip.delivery:hover {
  background: rgba(16,185,129,0.12);
  color: #34d399;
  border-color: rgba(16,185,129,0.4);
}
.link-chip.danger:hover {
  background: rgba(239,68,68,0.12);
  color: #f87171;
  border-color: rgba(239,68,68,0.4);
}
.link-chip.copied {
  background: rgba(16,185,129,0.12);
  color: #34d399;
  border-color: rgba(16,185,129,0.4);
}

.config-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.3);
  color: #34d399;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
}

/* ══════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(4,3,14,0.82);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  backdrop-filter: blur(8px) saturate(120%);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-content {
  background: rgba(15,13,40,0.95);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 700px;
  padding: 2rem;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 0 1px rgba(139,92,246,0.1) inset;
}

.config-table { width: 100%; border-collapse: collapse; margin: 0.5rem 0 1rem; }
.config-table th {
  text-align: left;
  color: var(--text-accent);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.config-table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.config-table input {
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--glass-border);
  color: white;
  border-radius: var(--radius-xs);
  padding: 0.35rem 0.5rem;
  width: 100px;
}
.config-table input:focus { border-color: var(--primary-light); }

#contract-preview {
  background: white;
  color: black;
  padding: 2rem;
  border-radius: var(--radius-sm);
}
#contract-preview h3 { color: black; margin-bottom: 1rem; }
#contract-preview p  { color: #333; margin-bottom: 0.5rem; }

/* ══════════════════════════════════════════
   STATUS BADGES & TOTAL BAR
   ══════════════════════════════════════════ */
.total-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16,185,129,0.12);
  color: var(--success);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid rgba(16,185,129,0.25);
}

/* ══════════════════════════════════════════
   RELATÓRIO DE IMPRESSÃO
   ══════════════════════════════════════════ */
.print-only { display: none; }

@media print {
  .no-print  { display: none !important; }
  .print-only { display: block !important; }
  .bottom-nav { display: none !important; }
  .topbar { display: none !important; }

  body {
    background: white !important;
    color: black !important;
    font-family: 'Arial', sans-serif;
    font-size: 12px;
  }
  .print-report { padding: 1rem; color: black; }
  .print-report h1 { font-size: 1rem; font-weight: 700; margin: 0 0 0.15rem; color: black !important; -webkit-text-fill-color: black !important; background: none !important; }
  .print-report h2 { font-size: 0.9rem; font-weight: 600; margin: 0 0 0.2rem; color: black !important; }
  .print-report p  { font-size: 0.85rem; margin: 0 0 1rem; color: #555; }

  .print-table { width: 100%; border-collapse: collapse; margin-top: 0.8rem; }
  .print-table th {
    background: #1a1540;
    color: white;
    padding: 0.6rem 0.8rem;
    text-align: left;
    font-size: 0.82rem;
  }
  .print-table td {
    padding: 0.5rem 0.8rem;
    font-size: 0.82rem;
    border-bottom: 1px solid #e2e8f0;
    color: #1e293b;
  }
  .print-table tr:nth-child(even) td { background: #f8fafc; }
  .print-table tfoot td {
    font-weight: bold;
    border-top: 2px solid #1a1540;
    padding-top: 0.7rem;
  }
}

/* ══════════════════════════════════════════
   NOVAS FUNCIONALIDADES DO DASHBOARD
   ══════════════════════════════════════════ */

/* 1. Filtro de Intervalo de Datas */
.date-range-group {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.date-range-group input[type="date"] {
  width: auto;
  max-width: 145px;
  font-size: 0.82rem;
  padding: 0.5rem 0.75rem;
  height: 36px;
}
.date-separator {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* 2. Container do Gráfico Expansível */
.chart-container-card {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition-smooth);
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.chart-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.chart-toggle-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}
.chart-toggle-btn:hover {
  background: var(--primary-glow);
  color: var(--primary-light);
}
.chart-toggle-btn i {
  transition: transform 0.3s;
}
.chart-toggle-btn.collapsed i {
  transform: rotate(-180deg);
}
.chart-body {
  max-height: 280px;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s, margin-top 0.4s;
  opacity: 1;
  margin-top: 1rem;
}
.chart-body.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}
#dashboard-chart {
  width: 100% !important;
  max-height: 250px;
}

/* 3. Checkbox na Listagem e Toolbar */
.chk-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 0.1rem;
}
.chk-custom {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--glass-border);
  accent-color: var(--primary);
  cursor: pointer;
  transition: var(--transition-smooth);
}
.chk-custom:hover {
  border-color: var(--primary-light);
  box-shadow: 0 0 6px var(--primary-glow);
  transform: scale(1.05);
}
.select-all-box {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
  background: var(--glass-bg);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--glass-border);
  height: 36px;
  user-select: none;
}
.select-all-box:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
  background: var(--glass-bg-hover);
}

/* 4. Barra Flutuante de Ações em Lote */
.bulk-actions-bar {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 12, 40, 0.95);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 0.8rem 1.5rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55), 0 0 16px var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  z-index: 800;
  width: calc(100% - 2.5rem);
  max-width: 760px;
  transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.bulk-actions-bar.active {
  bottom: 24px;
}
.bulk-info {
  font-size: 0.88rem;
  font-weight: 600;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.bulk-info i {
  color: var(--primary-light);
}
.bulk-actions-group {
  display: flex;
  gap: 0.6rem;
}

/* Ajustes de botões */
.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
  color: white;
}
.btn-success:hover {
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45);
  filter: brightness(1.1);
  transform: translateY(-2px);
}
.btn-bulk-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
}
.btn-bulk-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .bulk-actions-bar.active {
    bottom: 84px; /* acima do bottom nav no mobile */
  }
  .bulk-actions-bar {
    flex-direction: column;
    gap: 0.8rem;
    padding: 1rem;
    width: calc(100% - 1.5rem);
  }
  .bulk-actions-group {
    width: 100%;
    justify-content: center;
  }
}

/* 5. Banner de Instalação PWA */
.pwa-install-banner {
  position: fixed;
  bottom: -120px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 12, 40, 0.95);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 16px rgba(124,58,237,0.4);
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 1000;
  width: 92%;
  max-width: 380px;
  transition: bottom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.pwa-install-banner:not(.hidden) {
  bottom: 84px; /* acima da bottom nav */
}
.pwa-install-banner img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
}
.pwa-install-info {
  flex: 1;
}
.pwa-install-info h4 {
  margin: 0 0 0.2rem 0;
  font-size: 0.95rem;
  color: var(--text-light);
}
.pwa-install-info p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}
.pwa-install-btn {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
  transition: transform 0.2s;
}
.pwa-install-btn:active {
  transform: scale(0.95);
}
.pwa-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 0.5rem;
  cursor: pointer;
}
