* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0f0f13;
  --surface:  #1a1a24;
  --border:   #2a2a3a;
  --accent:   #7c3aed;
  --accent2:  #a855f7;
  --text:     #e2e8f0;
  --muted:    #64748b;
  --success:  #22c55e;
  --danger:   #ef4444;
  --warning:  #f59e0b;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;
}

/* ── Login ─────────────────────────────────────────────────── */
.login-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%; max-width: 380px;
}
.login-card h1 {
  font-size: 1.5rem; font-weight: 700;
  background: linear-gradient(135deg, var(--accent2), #60a5fa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
.login-card p { color: var(--muted); font-size: .875rem; margin-bottom: 28px; }

/* ── Layout ────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 230px; min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 24px 0;
  position: fixed; top: 0; left: 0;
}
.sidebar-logo {
  padding: 0 24px 24px;
  font-size: 1.1rem; font-weight: 700;
  background: linear-gradient(135deg, var(--accent2), #60a5fa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 24px;
  cursor: pointer; border: none; background: none;
  color: var(--muted); font-size: .9rem; text-align: left; width: 100%;
  border-radius: 0; transition: all .15s;
}
.nav-item:hover { color: var(--text); background: rgba(124,58,237,.1); }
.nav-item.active { color: var(--accent2); background: rgba(124,58,237,.15); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

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

.main { margin-left: 230px; padding: 32px; flex: 1; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.card-title {
  font-size: 1rem; font-weight: 600; margin-bottom: 20px;
  color: var(--text);
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
}
.stat-label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 2rem; font-weight: 700; margin-top: 4px; }
.stat-value.accent  { color: var(--accent2); }
.stat-value.success { color: var(--success); }
.stat-value.warning { color: var(--warning); }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.form-group input,
.form-group select {
  width: 100%; padding: 10px 14px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .9rem;
  outline: none; transition: border-color .15s;
}
.form-group input:focus,
.form-group select:focus { border-color: var(--accent); }
.form-group select option { background: var(--bg); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  padding: 10px 20px; border-radius: 8px; border: none;
  cursor: pointer; font-size: .875rem; font-weight: 500;
  transition: opacity .15s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { opacity: .85; }
.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent2); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-sm      { padding: 6px 12px; font-size: .8rem; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Table ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th {
  text-align: left; padding: 10px 14px;
  color: var(--muted); font-size: .75rem;
  text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
}
td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; padding: 2px 10px;
  border-radius: 999px; font-size: .75rem; font-weight: 500;
}
.badge-success { background: rgba(34,197,94,.15);  color: var(--success); }
.badge-danger  { background: rgba(239,68,68,.15);  color: var(--danger);  }
.badge-warning { background: rgba(245,158,11,.15); color: var(--warning); }
.badge-muted   { background: rgba(100,116,139,.15);color: var(--muted);   }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px; width: 100%; max-width: 440px;
}
.modal h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 20px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ── Credentials box ────────────────────────────────────────── */
.cred-box {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px; margin-top: 16px;
}
.cred-box p { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.cred-row {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(124,58,237,.1); border-radius: 6px;
  padding: 10px 14px; margin-bottom: 8px; font-family: monospace; font-size: 1rem;
}
.cred-row:last-child { margin-bottom: 0; }
.copy-btn {
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 0; transition: color .15s;
}
.copy-btn:hover { color: var(--accent2); }

/* ── QR Code PIX ────────────────────────────────────────────── */
.pix-box {
  text-align: center; padding: 20px;
  background: var(--bg); border-radius: 10px; margin-top: 16px;
}
.pix-box img { width: 180px; height: 180px; margin: 0 auto 12px; display: block; }
.pix-code {
  font-size: .75rem; word-break: break-all; color: var(--muted);
  background: var(--surface); border-radius: 6px; padding: 10px; margin-top: 8px;
}

/* ── Toasts ─────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px; z-index: 999;
}
.toast {
  padding: 12px 18px; border-radius: 8px; font-size: .875rem;
  animation: slideIn .2s ease;
  max-width: 320px;
}
.toast-success { background: var(--success); color: #fff; }
.toast-error   { background: var(--danger);  color: #fff; }
.toast-info    { background: var(--accent);  color: #fff; }

@keyframes slideIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Misc ───────────────────────────────────────────────────── */
.page-title {
  font-size: 1.4rem; font-weight: 700; margin-bottom: 24px;
}
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.empty {
  text-align: center; padding: 48px 24px;
  color: var(--muted); font-size: .9rem;
}
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: .75rem; background: rgba(124,58,237,.2); color: var(--accent2);
}
