/* ============================================================
   Invoices bee6 — tema Liquid Glass (dark) conforme brand bee6:
   fundo preto, superfícies de vidro translúcidas, primary #ee8d49.
   ============================================================ */

:root {
  --primary: #ee8d49;
  --secondary: #b8364f;
  --accent: #396e82;
  --bg: #000000;
  --text: #d5d5ce;
  --text-muted: rgba(213, 213, 206, 0.6);
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --font-display: 'Staatliches', Arial, sans-serif;
  --font-body: 'Archivo', Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  min-height: 100vh;
}

h1, h2 { font-family: var(--font-display); letter-spacing: 0.02em; margin: 0; }
h3 { font-family: var(--font-body); font-weight: 700; margin: 0; }
.muted { color: var(--text-muted); }

/* Glass card: átomo do design system bee6 */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ---------- Logo ---------- */
.bee6-logo { display: inline-flex; align-items: center; }
.bee6-logo svg { display: block; width: auto; height: 40px; }
/* Wordmark vem sem fill (preto) — em fundo escuro força branco */
.bee6-logo svg path:not([class]) { fill: #fff; }
.gate-logo svg { height: 56px; }
.topbar-logo svg { height: 30px; }

/* O atributo hidden perde para qualquer display: explícito (ex.: .gate
   é flex) — reforça com !important para o toggle gate/app funcionar. */
[hidden] { display: none !important; }

/* ---------- Gate de login ---------- */
.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.gate-card {
  padding: 3rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
}
.gate-card h1 { color: var(--primary); font-size: 2.5rem; }
.gate-error { color: var(--secondary); font-size: 0.9rem; margin: 0; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-wrap: wrap;
}
.tabs { display: flex; gap: 0.25rem; flex: 1; flex-wrap: wrap; }
.tab {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.95rem;
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 300ms ease;
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.tab.active {
  color: var(--primary);
  border-color: rgba(238, 141, 73, 0.35);
  background: rgba(238, 141, 73, 0.08);
}
.user-chip { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; }

/* ---------- Layout principal ---------- */
.main { max-width: 1080px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.view-head h2 { color: var(--text); font-size: 1.9rem; }

/* ---------- Botões ---------- */
.btn {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 10px;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 300ms ease;
}
.btn-primary {
  background: var(--primary);
  color: #14100b;
  box-shadow: 0 4px 20px rgba(238, 141, 73, 0.25);
}
.btn-primary:hover { background: #f2a066; box-shadow: 0 6px 28px rgba(238, 141, 73, 0.4); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--glass-border);
}
.btn-ghost:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.2); }
.btn-danger {
  background: transparent;
  color: var(--secondary);
  border-color: rgba(184, 54, 79, 0.4);
}
.btn-danger:hover { background: rgba(184, 54, 79, 0.12); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ---------- Listas / tabelas ---------- */
.card-list { display: flex; flex-direction: column; gap: 0.75rem; }
.item-card {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  transition: border-color 300ms ease;
}
.item-card:hover { border-color: rgba(255, 255, 255, 0.15); }
.item-card .item-info { flex: 1; min-width: 220px; }
.item-card .item-title { font-weight: 500; color: var(--text); }
.item-card .item-sub { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.15rem; }
.item-card .item-actions { display: flex; gap: 0.5rem; }
.item-amount { font-weight: 500; color: var(--primary); white-space: nowrap; }

.empty-state {
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
}

/* ---------- Formulários ---------- */
.form-card { padding: 1.5rem; margin-bottom: 1.5rem; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.field input, .field select, .field textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.95rem;
  padding: 0.6rem 0.8rem;
  transition: border-color 300ms ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: rgba(238, 141, 73, 0.5);
}
.field select option { background: #111; color: var(--text); }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; justify-content: flex-end; }

/* Linhas dinâmicas (perfil de pagamento, itens da invoice) */
.dyn-row {
  display: grid;
  grid-template-columns: 1fr 1.6fr auto;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  align-items: center;
}
.dyn-row input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  padding: 0.5rem 0.7rem;
}
.dyn-row input:focus { outline: none; border-color: rgba(238, 141, 73, 0.5); }
.item-row { grid-template-columns: 2.2fr 0.8fr auto; }

/* Sugestões de itens (serviços/plataformas do cliente) */
.suggestion {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: border-color 300ms ease;
  font-size: 0.9rem;
}
.suggestion:hover { border-color: rgba(238, 141, 73, 0.4); }
.suggestion input { accent-color: var(--primary); }
.suggestion .s-amount { margin-left: auto; color: var(--primary); }

/* Total da invoice */
.total-row {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  align-items: baseline;
  padding: 1rem 0.25rem 0;
  border-top: 1px solid var(--glass-border);
  margin-top: 0.75rem;
}
.total-row .t-label { color: var(--text-muted); text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.05em; }
.total-row .t-value { font-size: 1.4rem; font-weight: 700; color: var(--primary); }

/* Badge de status/moeda */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(57, 110, 130, 0.6);
  color: #7fb3c8;
  letter-spacing: 0.04em;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 20, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(238, 141, 73, 0.4);
  color: var(--text);
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  z-index: 100;
  font-size: 0.9rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.toast.error { border-color: rgba(184, 54, 79, 0.6); }

/* Área de impressão fica fora da tela no uso normal */
.print-root { display: none; }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .topbar { gap: 0.75rem; padding: 0.75rem 1rem; }
  .user-chip #user-email { display: none; }
  .main { padding: 1.25rem 1rem 3rem; }
  /* Menos blur em mobile por performance, conforme brand bee6 */
  .glass-card { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .dyn-row, .item-row { grid-template-columns: 1fr; }
}
