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

/* ===================================================================
   BLACKROCK BANCO — UNIFIED DESIGN SYSTEM "Sovereign Dark"
   A single, cohesive visual language across all pages.
   =================================================================== */

:root {
  /* Core Palette */
  --bg-void: #05070a;
  --bg-deep: #0a0d12;
  --bg-surface: #111620;
  --bg-elevated: #1a1f2e;
  --bg-hover: #222840;

  /* Gold Accent System */
  --gold: #c9a227;
  --gold-bright: #e8c547;
  --gold-muted: #8a6d14;
  --gold-glow: rgba(201, 162, 39, 0.25);

  /* Cyan Accent System */
  --cyan: #00d4ff;
  --cyan-dim: #0099b8;
  --cyan-glow: rgba(0, 212, 255, 0.15);

  /* Status Colors */
  --green: #00e676;
  --green-glow: rgba(0, 230, 118, 0.2);
  --red: #ff3d5a;
  --red-glow: rgba(255, 61, 90, 0.15);
  --amber: #ffab00;

  /* Text */
  --text-primary: #e8ecf1;
  --text-secondary: rgba(232, 236, 241, 0.6);
  --text-tertiary: rgba(232, 236, 241, 0.35);

  /* Borders & Glass */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(0, 212, 255, 0.2);
  --glass-bg: rgba(17, 22, 32, 0.75);
  --glass-blur: blur(24px);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow-cyan: 0 0 30px rgba(0, 212, 255, 0.1);
  --shadow-glow-gold: 0 0 30px rgba(201, 162, 39, 0.1);
}

/* ===================================================================
   RESET & BASE
   =================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-void);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Background gradient — universal */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 212, 255, 0.06), transparent),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(201, 162, 39, 0.04), transparent);
  pointer-events: none;
  z-index: 0;
}

/* ===================================================================
   SCROLLBAR
   =================================================================== */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--gold-muted); }

/* ===================================================================
   TYPOGRAPHY
   =================================================================== */

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.15rem; }

.numeric-data {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.text-gold { color: var(--gold); }
.text-cyan { color: var(--cyan); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-muted { color: var(--text-secondary); }

/* ===================================================================
   LAYOUT
   =================================================================== */

.app-container {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* ===================================================================
   MARKET TICKER (Top Bar)
   =================================================================== */

.market-ticker-container,
.ops-ticker {
  width: 100%;
  background: rgba(0, 0, 0, 0.6);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  padding: 10px 0;
  position: relative;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.market-ticker,
.ticker-content {
  display: flex;
  white-space: nowrap;
  animation: ticker 35s linear infinite;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 40px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.ops-ticker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gold);
  display: flex;
  justify-content: space-between;
  padding: 8px 20px;
  border-bottom-color: rgba(201, 162, 39, 0.15);
}

.ops-ticker .ticker-content {
  display: flex;
  gap: 50px;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.4); }
}

/* ===================================================================
   HEADER — UNIFIED
   =================================================================== */

.terminal-header,
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 32px;
  position: relative;
  z-index: 2;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-text {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-primary);
  border-left: 3px solid var(--gold);
  padding-left: 12px;
}

.logo-text span {
  color: var(--cyan);
  font-weight: 300;
}

.terminal-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.3s, opacity 0.3s;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--cyan);
  transition: width 0.3s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--cyan);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ===================================================================
   GLASS PANELS & CARDS
   =================================================================== */

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.glass-card,
.habbo-window {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: border-color 0.3s, box-shadow 0.3s;
  overflow: hidden;
}

.glass-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow-cyan);
}

.habbo-window {
  padding: 0;
  margin-bottom: 24px;
}

.window-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.window-header h3 {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0;
}

/* ===================================================================
   STAT CARDS
   =================================================================== */

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.2s;
}

.stat-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--cyan);
}

.stat-card:nth-child(2)::before { background: var(--gold); }
.stat-card:nth-child(3)::before { background: var(--green); }
.stat-card:nth-child(4)::before { background: var(--red); }

.stat-label {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-sub {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.stat-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.stat-group:last-child { border-bottom: none; }

/* ===================================================================
   BUTTONS
   =================================================================== */

.btn {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 24px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-accent);
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-gold {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
}

.btn-gold:hover {
  background: var(--gold-bright);
  box-shadow: var(--shadow-glow-gold);
}

.btn-crimson {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.btn-crimson:hover {
  box-shadow: 0 0 20px var(--red-glow);
}

.neon-button {
  background: transparent;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  padding: 12px 24px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.3s;
}

.neon-button:hover {
  background: var(--cyan);
  color: var(--bg-void);
  box-shadow: 0 0 24px var(--cyan-glow);
}

.neon-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===================================================================
   INPUTS
   =================================================================== */

.terminal-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.terminal-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-glow);
}

.terminal-input::placeholder {
  color: var(--text-tertiary);
}

/* ===================================================================
   DASHBOARD GRID
   =================================================================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* ===================================================================
   CLIENT HERO
   =================================================================== */

.client-hero {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 32px;
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.client-hero h2 {
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===================================================================
   CREDIT SIMULATOR
   =================================================================== */

.simulator-container {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 24px;
  border-radius: var(--radius-md);
}

.furni-search-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  gap: 10px;
}

.collateral-basket {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin: 16px 0;
  min-height: 80px;
  background: var(--bg-surface);
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-subtle);
}

.collateral-item {
  background: var(--bg-elevated);
  padding: 10px;
  border-radius: var(--radius-sm);
  text-align: center;
  position: relative;
  border: 1px solid transparent;
  transition: border-color 0.3s;
}

.collateral-item:hover { border-color: var(--gold); }

.collateral-item .remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.6rem;
  cursor: pointer;
  border: 2px solid var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.credit-limit-panel {
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
  margin-top: 16px;
}

.ltv-indicator {
  height: 4px;
  background: var(--bg-hover);
  margin: 12px 0;
  border-radius: 2px;
  overflow: hidden;
}

.ltv-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-muted), var(--gold-bright));
  box-shadow: 0 0 12px var(--gold-glow);
  width: 0%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================================================
   INTEL STATS
   =================================================================== */

.intel-stat {
  background: var(--bg-elevated);
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.intel-label {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.intel-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  margin-top: 4px;
}

/* ===================================================================
   TRUST WIDGET & TEAM
   =================================================================== */

.trust-widget {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 32px;
  border-radius: var(--radius-md);
  margin-top: 40px;
}

.suplantacion-warning {
  background: var(--red-glow);
  border: 1px solid rgba(255, 61, 90, 0.3);
  border-radius: var(--radius-sm);
  color: var(--red);
  padding: 12px 16px;
  font-size: 0.78rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.team-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.3s;
}

.team-card:hover {
  border-color: var(--gold-muted);
}

.team-avatar {
  width: 64px;
  height: 110px;
  background-position: center top -15px;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.team-info h4 {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
  color: var(--gold);
}

.team-role {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===================================================================
   NORMATIVAS & SECTIONS
   =================================================================== */

.section-container {
  max-width: 1280px;
  margin: 64px auto;
  padding: 0 24px;
}

.normativas-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 32px;
}

/* ===================================================================
   STATUS INDICATORS
   =================================================================== */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

.status-on {
  background: var(--green);
  box-shadow: 0 0 8px var(--green-glow);
}

.status-off { background: var(--red); }

/* ===================================================================
   LOGIN MODAL
   =================================================================== */

.otp-display {
  background: var(--bg-elevated);
  border: 1px dashed var(--gold);
  border-radius: var(--radius-sm);
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: 6px;
  color: var(--gold-bright);
  margin: 20px 0;
  text-align: center;
}

/* ===================================================================
   TABLE STYLES
   =================================================================== */

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-primary);
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ===================================================================
   ANIMATIONS
   =================================================================== */

.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

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

/* ===================================================================
   FOOTER
   =================================================================== */

footer {
  text-align: center;
  margin-top: auto;
  padding: 32px 24px;
  color: var(--text-tertiary);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-top: 1px solid var(--border-subtle);
}

/* ===================================================================
   HIDDEN UTILITY
   =================================================================== */

.hidden { display: none !important; }

/* ===================================================================
   RESPONSIVE
   =================================================================== */

@media (max-width: 768px) {
  .terminal-header,
  .header {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .terminal-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .admin-stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .team-grid {
    grid-template-columns: 1fr;
  }

  .client-hero {
    flex-direction: column;
    text-align: center;
  }

  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }
}

@media (max-width: 480px) {
  .admin-stats-grid {
    grid-template-columns: 1fr;
  }

  .app-container {
    padding: 0 16px;
  }
}