/* ==========================================================================
   Control de Consumo — High-Contrast Clean UI & Premium Dark Design
   Muebles Suecia Design System
   ========================================================================== */

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

:root {
  /* Color Palette */
  --bg-primary: #0b0f19;
  --bg-surface: #151d2a;
  --bg-surface-hover: #1e293b;
  --bg-input: #0f172a;
  
  /* Brand Accents */
  --accent-pink: #ec4899;
  --accent-pink-hover: #f43f5e;
  --accent-indigo: #6366f1;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  /* Text Color Hierarchy (Crisp & High Contrast) */
  --text-main: #ffffff;
  --text-muted: #e2e8f0;
  --text-dim: #94a3b8;
  
  /* Borders */
  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-border-hover: #ec4899;
  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --transition-fast: 0.15s ease;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(236, 72, 153, 0.12) 0%, transparent 45%);
  background-attachment: fixed;
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6, .brand-title {
  font-family: 'Outfit', sans-serif;
  color: #ffffff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-pink);
}

/* Header Navbar */
.app-header {
  background: #111827;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.9rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-icon-wrapper {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-indigo));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
}

.brand-title {
  font-weight: 800;
  font-size: 1.35rem;
  color: #ffffff;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: #f472b6;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.btn-nav-back {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  background: #1f2937;
  border: 1px solid #374151;
  transition: var(--transition-fast);
}

.btn-nav-back:hover {
  color: #ffffff;
  background: #374151;
  border-color: var(--accent-pink);
}

/* Layout Main Container */
.app-container {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Hero Section */
.hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.hero-title {
  font-size: 2.1rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.hero-subtitle {
  color: #cbd5e1;
  font-size: 0.98rem;
  margin-top: 0.3rem;
}

/* Glass Panels */
.glass-panel {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.glass-panel-interactive:hover {
  transform: translateY(-3px);
  border-color: var(--accent-pink);
  box-shadow: 0 12px 35px rgba(236, 72, 153, 0.25);
}

/* Action Buttons */
.btn-primary {
  background: linear-gradient(135deg, #ec4899 0%, #d946ef 100%);
  color: #ffffff !important;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(236, 72, 153, 0.4);
  transition: var(--transition-fast);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(236, 72, 153, 0.6);
}

.btn-secondary {
  background: #1f2937;
  color: #ffffff !important;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #374151;
  transition: var(--transition-fast);
}

.btn-secondary:hover {
  background: #374151;
  border-color: var(--accent-cyan);
  color: #ffffff !important;
  transform: translateY(-2px);
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.kpi-card {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: #151d2a;
}

.kpi-icon-box {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.kpi-icon-pink { background: rgba(236, 72, 153, 0.2); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.4); }
.kpi-icon-indigo { background: rgba(99, 102, 241, 0.2); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.4); }
.kpi-icon-cyan { background: rgba(6, 182, 212, 0.2); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.4); }
.kpi-icon-emerald { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }

.kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
}

.kpi-label {
  font-size: 0.8rem;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-top: 0.35rem;
}

/* Charts Section */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

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

.chart-card {
  padding: 1.5rem;
}

.card-header-clean {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}

.card-title-clean {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Toolbar & Filters */
.toolbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 280px;
  max-width: 500px;
}

.search-input-wrapper i {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1.1rem;
  pointer-events: none;
}

/* Forms & Inputs */
.form-group-clean {
  margin-bottom: 1.4rem;
}

.form-label-clean {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-control-glass, .input-glass {
  width: 100%;
  background: #0f172a !important;
  border: 1px solid #374151;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  padding: 0.8rem 1.1rem 0.8rem 2.8rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition-fast);
}

.form-control-glass::placeholder, .input-glass::placeholder {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
  opacity: 1;
}

.form-control-glass:focus, .input-glass:focus {
  border-color: var(--accent-pink);
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.3);
  background: #090e1a !important;
}

/* Browser Select Dropdown */
select.form-control-glass, select.input-glass {
  padding-left: 1.1rem;
  cursor: pointer;
}

select option {
  background-color: #0f172a !important;
  color: #ffffff !important;
  padding: 0.6rem 1rem;
}

/* HIGH CONTRAST TABLE STYLING */
.table-responsive-glass {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid #374151;
  background: #111827;
}

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

.table-glass th {
  background: #1f2937 !important;
  color: #ffffff !important;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
  padding: 1.1rem 1.25rem;
  border-bottom: 2px solid #374151;
  text-align: left;
}

.table-glass td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid #1f2937;
  vertical-align: middle;
  font-size: 0.95rem;
  color: #ffffff !important;
  background: #111827;
}

/* Zebra Striping for Maximum Readability */
.table-glass tbody tr:nth-child(even) td {
  background: #172033 !important;
}

.table-glass tbody tr:hover td {
  background: #25334d !important;
}

/* Badges */
.badge-ot {
  background: rgba(236, 72, 153, 0.2);
  color: #f472b6 !important;
  border: 1px solid rgba(236, 72, 153, 0.4);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-status {
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.badge-status-success { background: rgba(16, 185, 129, 0.2); color: #34d399 !important; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-status-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24 !important; border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-status-danger { background: rgba(244, 63, 94, 0.2); color: #fb7185 !important; border: 1px solid rgba(244, 63, 94, 0.4); }
.badge-status-indigo { background: rgba(99, 102, 241, 0.2); color: #818cf8 !important; border: 1px solid rgba(99, 102, 241, 0.4); }

/* Progress Bar */
.progress-container {
  background: #374151;
  border-radius: 50px;
  height: 9px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 50px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.bg-emerald { background: linear-gradient(90deg, #059669, #10b981); }
.bg-amber { background: linear-gradient(90deg, #d97706, #f59e0b); }
.bg-rose { background: linear-gradient(90deg, #e11d48, #f43f5e); }

/* Autocomplete Dropdown */
.autocomplete-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #0f172a !important;
  border: 1px solid var(--accent-pink);
  border-radius: var(--radius-md);
  margin-top: 0.4rem;
  max-height: 260px;
  overflow-y: auto;
  z-index: 200;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.autocomplete-item {
  padding: 0.85rem 1.1rem;
  cursor: pointer;
  border-bottom: 1px solid #1e293b;
  transition: var(--transition-fast);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #ffffff !important;
}

.autocomplete-item:hover {
  background: #1e293b !important;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* Footer */
.app-footer {
  text-align: center;
  padding: 1.5rem;
  color: #94a3b8;
  font-size: 0.88rem;
  border-top: 1px solid #1f2937;
  margin-top: auto;
}
