/* ═══════════════════════════════════════════════════════════
   AsaasAdmin — styles.css
   ═══════════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ── */
:root {
  --bg:          #0a0c0f;
  --surface:     #111318;
  --surface2:    #181b22;
  --border:      #1e2330;
  --border2:     #252b3a;
  --accent:      #00e5a0;
  --accent-dim:  rgba(0, 229, 160, 0.1);
  --accent-glow: rgba(0, 229, 160, 0.25);
  --red:         #ff4757;
  --red-dim:     rgba(255, 71, 87, 0.12);
  --yellow:      #ffd32a;
  --yellow-dim:  rgba(255, 211, 42, 0.12);
  --blue:        #3d7fff;
  --blue-dim:    rgba(61, 127, 255, 0.12);
  --purple-dim:  rgba(188, 140, 255, 0.12);
  --purple:      #bc8cff;
  --text:        #e8eaf0;
  --text2:       #8b91a7;
  --text3:       #5a6078;

  --font-display: 'DM Serif Display', serif;
  --font-body:    'Sora', sans-serif;
  --font-mono:    'DM Mono', monospace;

  --radius:    10px;
  --radius-lg: 16px;
  --shadow:    0 4px 24px rgba(0, 0, 0, 0.4);
}

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

/* ── BASE ── */
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.6;
}

/* Textura de ruído sutil no fundo */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.5;
}

/* ── TELAS ── */
.screen {
  display: none;
  min-height: 100vh;
}
.screen.active {
  display: flex;
}

/* ═══════════════════════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════════════════════ */
#login-screen {
  align-items: center;
  justify-content: center;
  position: relative;
}

.login-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 80%);
  opacity: 0.4;
}

.login-orb {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 160, 0.12) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.login-card {
  position: relative;
  width: 420px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03);
  animation: fadeUp 0.6s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.login-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 20px var(--accent-glow);
}

.login-logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text);
}
.login-logo-text span { color: var(--accent); }

.login-title {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text);
  margin-bottom: 6px;
}

.login-sub {
  color: var(--text3);
  font-size: 13px;
  margin-bottom: 32px;
}

/* ═══════════════════════════════════════════════════════════
   FORMULÁRIOS
   ═══════════════════════════════════════════════════════════ */
.field {
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
input::placeholder { color: var(--text3); }
input:disabled { opacity: 0.5; cursor: not-allowed; }

.input-prefix {
  position: relative;
}
.input-prefix > span {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  pointer-events: none;
}
.input-prefix input {
  padding-left: 28px;
}

.error-msg {
  background: var(--red-dim);
  border: 1px solid rgba(255, 71, 87, 0.25);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--red);
  margin-bottom: 16px;
  display: none;
}
.error-msg.show {
  display: block;
}

/* ═══════════════════════════════════════════════════════════
   BOTÕES
   ═══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius);
  border: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary {
  background: var(--accent);
  color: #061a10;
  width: 100%;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 0 24px var(--accent-glow);
}
.btn-primary:hover:not(:disabled) {
  background: #00f7ad;
  box-shadow: 0 0 32px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border2);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface2);
  color: var(--text);
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(255, 71, 87, 0.25);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(255, 71, 87, 0.2);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════
   LAYOUT ADMIN
   ═══════════════════════════════════════════════════════════ */
#admin-screen {
  flex-direction: row;
}

/* ── Sidebar ── */
.sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.sidebar-logo-icon {
  width: 30px;
  height: 30px;
  background: var(--accent);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 0 12px var(--accent-glow);
}

.sidebar-logo-text {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text);
}
.sidebar-logo-text span { color: var(--accent); }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0 20px;
  margin: 12px 0 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text3);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13.5px;
  position: relative;
}
.nav-item:hover {
  color: var(--text);
  background: var(--surface2);
}
.nav-item.active {
  color: var(--accent);
  background: var(--accent-dim);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

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

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.user-name {
  font-size: 13px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.user-role { font-size: 11px; color: var(--text3); }

/* ── Main ── */
.main {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}

.page-title {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--text);
}
.page-subtitle { font-size: 13px; color: var(--text3); }
.topbar-actions { display: flex; gap: 10px; align-items: center; }

.content { padding: 32px; }

/* ═══════════════════════════════════════════════════════════
   STATS
   ═══════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.06;
  background: var(--accent-color, var(--accent));
  transform: translate(30%, -30%);
}

.stat-icon { font-size: 20px; margin-bottom: 12px; display: block; }
.stat-value {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 12px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 20px;
}
.badge-green { background: var(--accent-dim); color: var(--accent); }
.badge-blue  { background: var(--blue-dim);   color: var(--blue);   }

/* ═══════════════════════════════════════════════════════════
   CARD / TABELA
   ═══════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.card-title   { font-size: 15px; font-weight: 600; color: var(--text); }
.card-subtitle{ font-size: 12px; color: var(--text3); margin-top: 1px; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 8px 14px;
  width: 260px;
}
.search-bar input {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 13px;
}
.search-bar input:focus { box-shadow: none; border: none; }

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

thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }

td {
  padding: 14px 24px;
  font-size: 13.5px;
  color: var(--text2);
  vertical-align: middle;
}
.td-name { color: var(--text); font-weight: 500; }

.wallet-id {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 3px 9px;
  border-radius: 6px;
}

.pct-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pct-chip {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
}
.chip-pix     { background: var(--accent-dim);  color: var(--accent); }
.chip-cc      { background: var(--blue-dim);    color: var(--blue);   }
.chip-cc-parc { background: var(--yellow-dim);  color: var(--yellow); }
.chip-debito  { background: var(--purple-dim);  color: var(--purple); }

.actions { display: flex; gap: 6px; }

.tag-active {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 500;
}
.tag-active::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

/* ═══════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 100;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  animation: modalUp 0.25s ease;
}

@keyframes modalUp {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.modal-header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text);
  margin-bottom: 3px;
}
.modal-sub { font-size: 12px; color: var(--text3); }

.modal-close {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  width: 30px; height: 30px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--text3);
  transition: all 0.15s;
}
.modal-close:hover { color: var(--text); border-color: var(--text3); }

.modal-body   { padding: 24px 28px; }
.modal-footer {
  padding: 16px 28px 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 20px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.charges-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.charge-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.charge-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.charge-badge { width: 8px; height: 8px; border-radius: 50%; }
.charge-name  { font-size: 12px; font-weight: 600; color: var(--text2); }

/* ── Confirm modal ── */
.confirm-modal { width: 380px; }
.confirm-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--red-dim);
  border: 1px solid rgba(255, 71, 87, 0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════════════════
   SPINNER / LOADING
   ═══════════════════════════════════════════════════════════ */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #061a10;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

.spinner-dark {
  width: 18px; height: 18px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  gap: 12px;
  color: var(--text3);
  font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 28px; right: 28px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
  font-size: 13px;
  color: var(--text);
  z-index: 9999;
  max-width: 320px;
  transform: translateX(120%);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.show { transform: translateX(0); }
.toast-icon { font-size: 18px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════ */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state-icon  { font-size: 48px; margin-bottom: 14px; opacity: 0.4; }
.empty-state-title { font-size: 16px; color: var(--text2); margin-bottom: 6px; }
.empty-state-sub   { font-size: 13px; color: var(--text3); }

/* ═══════════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════════ */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVO
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { width: 200px; }
  .content { padding: 20px; }
  .topbar  { padding: 16px 20px; flex-wrap: wrap; gap: 12px; }
  .charges-grid { grid-template-columns: 1fr; }
}
