/* ============================================================
 * Banco Command — Design System v2
 * Palette: deep navy #0b1120, accent teal #14b8a6, gold #d4a84a
 * Diferente da HeartPay: gradients azul/teal, cards com glass
 * ============================================================ */

:root {
  --bg-0: #060d1b;
  --bg-1: #0b1120;
  --bg-2: #111827;
  --bg-3: #1f2937;
  --bg-card: rgba(17,24,39,0.85);
  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.14);
  --text: #f1f5f9;
  --text-dim: #94a3b8;
  --text-faint: #64748b;
  --accent: #14b8a6;
  --accent-dim: #0d9488;
  --accent-soft: rgba(20,184,166,0.12);
  --gold: #d4a84a;
  --gold-dim: #b8902f;
  --gold-soft: rgba(212,168,74,0.10);
  --green: #22c55e;
  --red: #ef4444;
  --blue: #3b82f6;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 16px 48px rgba(0,0,0,0.5);
  --glass: saturate(1.8) blur(20px);
}

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

html, body {
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-1);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dim); }

/* === Layout shell === */
.cmd-app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.cmd-sidebar {
  background: var(--bg-0);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.cmd-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.cmd-sidebar-logo img { height: 36px; width: auto; }

.cmd-nav-section {
  padding: 12px 8px 6px;
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.cmd-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--text-dim);
  border-radius: 12px;
  font-weight: 500;
  font-size: 13px;
  transition: all 180ms ease;
}
.cmd-nav-link:hover {
  background: var(--bg-2);
  color: var(--text);
}
.cmd-nav-link.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}
.cmd-nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.cmd-main {
  padding: 32px 40px;
  min-width: 0;
}

.cmd-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
.cmd-page-title { font-size: 24px; font-weight: 700; }
.cmd-page-subtitle { color: var(--text-dim); margin-top: 4px; }

/* === Cards === */
.cmd-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.cmd-card-title { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; margin-bottom: 12px; }
.cmd-card-value { font-size: 28px; font-weight: 700; color: var(--text); }
.cmd-card-meta { font-size: 12px; color: var(--text-faint); margin-top: 6px; }

.cmd-grid { display: grid; gap: 16px; }
.cmd-grid-2 { grid-template-columns: repeat(2, 1fr); }
.cmd-grid-3 { grid-template-columns: repeat(3, 1fr); }
.cmd-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .cmd-grid-4, .cmd-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .cmd-grid-4, .cmd-grid-3, .cmd-grid-2 { grid-template-columns: 1fr; } }

/* === Forms === */
.cmd-form-group { margin-bottom: 18px; }
.cmd-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cmd-input, .cmd-select, .cmd-textarea {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}
.cmd-input:focus, .cmd-select:focus, .cmd-textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(20,184,166,0.04);
  box-shadow: 0 0 0 3px rgba(20,184,166,0.1);
}
.cmd-textarea { min-height: 100px; resize: vertical; }
.cmd-error { color: var(--red); font-size: 12px; margin-top: 6px; display: none; }
.cmd-error.is-visible { display: block; }

/* === Buttons === */
.cmd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 200ms ease;
  font-family: inherit;
  text-decoration: none;
}
.cmd-btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(20,184,166,0.3);
}
.cmd-btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-dim) 0%, #0a7e73 100%);
  box-shadow: 0 6px 20px rgba(20,184,166,0.4);
  transform: translateY(-1px);
}
.cmd-btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.cmd-btn-ghost:hover { background: var(--bg-2); border-color: var(--border-strong); }
.cmd-btn-danger { background: linear-gradient(135deg, var(--red), #dc2626); color: white; }
.cmd-btn-block { width: 100%; }
.cmd-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* === Table === */
.cmd-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cmd-table { width: 100%; border-collapse: collapse; }
.cmd-table th {
  text-align: left;
  padding: 14px 18px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cmd-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.cmd-table tr:last-child td { border-bottom: none; }
.cmd-table tr:hover td { background: rgba(20,184,166,0.03); }

/* === Badges === */
.cmd-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cmd-badge-success { background: rgba(34,197,94,0.15); color: var(--green); }
.cmd-badge-pending { background: rgba(20,184,166,0.15); color: var(--accent); }
.cmd-badge-error   { background: rgba(239,68,68,0.15); color: var(--red); }
.cmd-badge-info    { background: rgba(59,130,246,0.15); color: var(--blue); }
.cmd-badge-neutral { background: rgba(255,255,255,0.08); color: var(--text-dim); }

/* === Auth screens (login, register, forgot-password) === */
.cmd-auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(20,184,166,0.08), transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(59,130,246,0.06), transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(212,168,74,0.03), transparent 60%),
    linear-gradient(170deg, #060d1b 0%, #0b1120 40%, #111827 100%);
}
.cmd-auth-stack {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.cmd-auth-logo img { height: 52px; width: auto; }
.cmd-auth-card {
  width: 100%;
  background: rgba(17,24,39,0.75);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: 40px 34px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
}
.cmd-auth-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.cmd-auth-subtitle { color: var(--text-dim); margin-bottom: 26px; font-size: 13px; line-height: 1.6; }
.cmd-auth-footer { text-align: center; font-size: 13px; color: var(--text-dim); margin-top: 20px; }
.cmd-auth-footer a { font-weight: 600; color: var(--accent); }

/* === Toast === */
.cmd-toast-stack {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
  pointer-events: none;
}
.cmd-toast {
  background: rgba(31,41,55,0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 500;
  min-width: 260px;
  max-width: 380px;
  box-shadow: var(--shadow);
  pointer-events: auto;
  animation: cmd-toast-in 250ms ease-out;
}
.cmd-toast-success { border-left: 3px solid var(--green); }
.cmd-toast-error   { border-left: 3px solid var(--red); }
.cmd-toast-info    { border-left: 3px solid var(--accent); }
@keyframes cmd-toast-in { from { transform: translateX(20px) scale(0.95); opacity: 0; } to { transform: translateX(0) scale(1); opacity: 1; } }

/* === Spinner === */
.cmd-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: cmd-spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes cmd-spin { to { transform: rotate(360deg); } }

/* === Empty state === */
.cmd-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-faint);
}
.cmd-empty-title { font-size: 16px; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }

/* === Modal === */
.cmd-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.cmd-modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.cmd-modal-header {
  padding: 22px 26px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cmd-modal-title { font-size: 17px; font-weight: 700; }
.cmd-modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}
.cmd-modal-body { padding: 24px 26px; }
.cmd-modal-footer {
  padding: 18px 26px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* === Utilities === */
.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.flex { display: flex; } .gap-2 { gap: 8px; } .gap-4 { gap: 16px; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.hidden { display: none !important; }
