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

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

:root {
  --cobre-darkest:   #06060c;
  --cobre-deep:      #0a0a18;
  --cobre-surface:   #0f0e22;
  --cobre-surface2:  #161430;
  --cobre-surface3:  #1e1b3c;
  --cobre-mid:       #2c2250;

  /* Cobre (Copper) — el alma del diseño */
  --cobre:           #c97a3c;
  --cobre-bright:    #e8944a;
  --cobre-light:     #f0ab6e;
  --cobre-glow:      rgba(201, 122, 60, 0.35);

  /* Tech/Data accents */
  --teal:            #2dd4bf;
  --teal-dim:        #14a88e;
  --indigo:          #4f6cdb;
  --indigo-dim:      #3a54b8;
  --rose:            #f43f5e;

  /* Text */
  --text-primary:    #e0dce8;
  --text-secondary:  #b8b0cc;
  --text-dim:        #7a7290;
  --text-muted:      #5a5270;

  /* Borders */
  --border:          #1e1b3c;
  --border-light:    #2c2250;

  /* Gradients */
  --grad-cobre:      linear-gradient(135deg, #c97a3c, #e8944a);
  --grad-cobre-glow: linear-gradient(135deg, #c97a3c, #f0ab6e);
  --grad-teal:       linear-gradient(135deg, #14a88e, #2dd4bf);
  --grad-indigo:     linear-gradient(135deg, #3a54b8, #4f6cdb);
  --grad-hero:       linear-gradient(135deg, #e8e0f0 0%, #f0ab6e 40%, #c97a3c 70%, #4f6cdb 100%);

  /* Radii & Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-cobre: 0 8px 32px rgba(6, 6, 12, 0.6);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cobre-darkest);
  color: var(--text-primary);
  min-height: 100vh;
  padding: 2rem 1rem;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Background Ambient Grid */
.bg-ambient {
  position: fixed; inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-ambient .noir {
  position: absolute; inset: 0;
  background: 
    radial-gradient(ellipse at 20% 30%, rgba(79, 108, 219, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(201, 122, 60, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(45, 212, 191, 0.03) 0%, transparent 50%);
}

.bg-ambient .grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(79, 108, 219, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 108, 219, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
}

/* App Main Container */
.app-container {
  position: relative;
  z-index: 10;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Header Cobre */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  background: rgba(15, 14, 34, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-cobre);
  position: relative;
  z-index: 1000;
  overflow: visible;
}

.dropdown-options-container {
  position: relative;
  z-index: 9999;
}

#options-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 240px;
  background: #0f0e22 !important;
  backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(201, 122, 60, 0.35) !important;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.95), 0 0 25px rgba(201, 122, 60, 0.25) !important;
  z-index: 999999 !important;
  overflow: visible !important;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  font-size: 2.2rem;
  background: rgba(201, 122, 60, 0.12);
  border: 1px solid rgba(201, 122, 60, 0.25);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(201, 122, 60, 0.2);
}

.logo-text h1 {
  font-family: 'Sora', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  background: var(--grad-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.badge-cobre {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: rgba(201, 122, 60, 0.08);
  border: 1px solid rgba(201, 122, 60, 0.18);
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--cobre-light);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 0.2rem;
}

.badge-cobre .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cobre);
  box-shadow: 0 0 8px var(--cobre);
}

/* Action Buttons */
.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-cobre {
  background: rgba(201, 122, 60, 0.08);
  border: 1px solid rgba(201, 122, 60, 0.25);
  color: var(--cobre-light);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.25s ease;
}

.btn-cobre:hover {
  background: rgba(201, 122, 60, 0.18);
  border-color: var(--cobre);
  transform: translateY(-1px);
}

.btn-cobre-solid {
  background: var(--grad-cobre);
  color: #fff;
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--cobre-glow);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-cobre-solid:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201, 122, 60, 0.45);
}

/* Navigation Bar Tabs */
.nav-pages-bar {
  display: flex;
  gap: 0.35rem;
  background: rgba(10, 10, 24, 0.6);
  backdrop-filter: blur(12px);
  padding: 0.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 2rem;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.page-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.page-tab:hover {
  color: var(--text-secondary);
  background: rgba(30, 27, 60, 0.4);
}

.page-tab.active {
  background: rgba(201, 122, 60, 0.15);
  border-color: rgba(201, 122, 60, 0.3);
  color: var(--cobre-light);
  box-shadow: 0 0 14px rgba(201, 122, 60, 0.12);
}

/* Page Views */
.page-view {
  display: none;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-view.active {
  display: flex;
}

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

/* Panels & Cards */
.panel-cobre {
  background: rgba(15, 14, 34, 0.6);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-cobre);
  position: relative;
  overflow: hidden;
}

.panel-cobre::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cobre), var(--teal), transparent);
  opacity: 0.5;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font-family: 'Sora', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.metric-card {
  background: rgba(10, 10, 24, 0.5);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.metric-card:hover {
  border-color: rgba(201, 122, 60, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.metric-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.metric-val {
  font-family: 'Sora', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  background: var(--grad-cobre);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.metric-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
  font-family: 'JetBrains Mono', monospace;
}

.card-teal .metric-val {
  background: var(--grad-teal);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card-rose .metric-val {
  color: var(--rose);
  background: none;
  -webkit-text-fill-color: var(--rose);
}

.card-indigo .metric-val {
  background: var(--grad-indigo);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  background: rgba(6, 6, 12, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus {
  border-color: var(--cobre);
  box-shadow: 0 0 0 3px rgba(201, 122, 60, 0.12);
}

/* Data List & Tables */
.data-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.data-row {
  background: rgba(10, 10, 24, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.25s ease;
}

.data-row:hover {
  background: rgba(15, 14, 34, 0.6);
  border-color: rgba(201, 122, 60, 0.2);
  transform: translateX(2px);
}

.row-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.row-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.val-cobre {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--cobre-light);
}

.val-green {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--teal);
}

/* RESPONSIVE DESIGN (Mobile & Desktop) */
@media (max-width: 768px) {
  body {
    padding: 0.75rem 0.5rem;
  }

  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem;
  }

  .header-actions {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
  }

  .logo-text h1 {
    font-size: 1.4rem;
  }

  .nav-pages-bar {
    padding: 0.3rem;
    gap: 0.25rem;
  }

  .page-tab {
    padding: 0.5rem 0.85rem;
    font-size: 0.78rem;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .metric-val {
    font-size: 1.5rem;
  }

  .panel-cobre {
    padding: 1.1rem;
  }

  form[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  div[style*="grid-template-columns: 1fr 340px"] {
    grid-template-columns: 1fr !important;
  }
}
