/* ==========================================================================
   KIKOS PASTES & EMPANADAS — DESIGN SYSTEM & STYLESHEET
   Fintech-grade, modern dark theme with warm artisanal gold & amber accents
   ========================================================================== */

:root {
  --bg-main: #0B0F17;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --bg-input: #111827;
  --bg-subtle: rgba(255, 255, 255, 0.03);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(245, 158, 11, 0.5);

  --primary: #F59E0B;
  --primary-hover: #D97706;
  --primary-glow: rgba(245, 158, 11, 0.25);

  --success: #10B981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --danger: #EF4444;
  --danger-glow: rgba(239, 68, 68, 0.2);
  --warning: #F59E0B;
  --info: #3B82F6;

  --text-primary: #F9FAFB;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --backdrop-blur: blur(16px);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(245, 158, 11, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(16, 185, 129, 0.04) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ==================== HEADER ==================== */
.app-header {
  background: rgba(11, 15, 23, 0.85);
  backdrop-filter: var(--backdrop-blur);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.4));
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #FFF 30%, #F59E0B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34D399;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: #111827;
  background: var(--primary);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F59E0B, #B45309);
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ==================== LAYOUT & VIEWS ==================== */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.view-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view-panel.active {
  display: block;
}

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

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.view-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.view-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.control-group label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.control-group select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.control-group select option {
  background: var(--bg-input);
  color: var(--text-primary);
}

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

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
}

.kpi-card.gold-glow::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #F59E0B, #FBBF24);
}

.kpi-card.emerald-glow::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #10B981, #34D399);
}

.kpi-card.blue-glow::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #3B82F6, #60A5FA);
}

.kpi-card.purple-glow::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #8B5CF6, #A78BFA);
}

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.kpi-icon {
  font-size: 1.2rem;
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-sans);
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.kpi-unit {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kpi-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==================== BRANCH CARDS GRID ==================== */
.section-title-group {
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.section-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.branch-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.branch-card {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.2s ease;
}

.branch-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.branch-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.branch-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.branch-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  background: var(--bg-subtle);
  padding: 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.b-stat {
  display: flex;
  flex-direction: column;
}

.b-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.b-stat-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.b-stat-val.gold { color: #FBBF24; }
.b-stat-val.emerald { color: #34D399; }

/* Alert Banner */
.alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
  backdrop-filter: var(--backdrop-blur);
}

.alert-banner.warning-card {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.alert-icon {
  font-size: 1.8rem;
}

.alert-body {
  flex: 1;
}

.alert-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #FCD34D;
  margin-bottom: 0.25rem;
}

.alert-text {
  font-size: 0.85rem;
  color: #E5E7EB;
  line-height: 1.45;
}

/* ==================== CHARTS GRID ==================== */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-card {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.chart-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.chart-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.chart-canvas-container {
  height: 280px;
  position: relative;
}

/* ==================== TABLES ==================== */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.data-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

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

.text-right { text-align: right; }
.font-bold { font-weight: 700; color: var(--text-primary); }
.text-danger { color: #F87171 !important; }
.text-success { color: #34D399 !important; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #FCD34D;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Buttons */
.btn {
  font-family: var(--font-sans);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: #111827;
  padding: 0.65rem 1.25rem;
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 0.65rem 1.25rem;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 0.45rem 0.85rem;
}
.btn-outline:hover {
  background: rgba(245, 158, 11, 0.1);
}

.btn-warning {
  background: #F59E0B;
  color: #111827;
  padding: 0.55rem 1rem;
}

.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 1.5rem; font-size: 1rem; border-radius: var(--radius-md); }
.btn-block { width: 100%; }

/* ==================== MOBILE CAPTURE APP VIEW ==================== */
.mobile-layout-container {
  display: grid;
  grid-template-columns: minmax(360px, 460px) 1fr;
  gap: 2rem;
  align-items: flex-start;
  max-width: 1050px;
  margin: 0 auto;
}

.mobile-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  position: relative;
}

.mobile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}

.store-badge-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.device-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.store-select-field {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
}

.store-select-field option {
  background: #1F2937;
}

.mobile-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.mobile-subtabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.35rem;
}

.subtab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-align: center;
}

.subtab-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #FFF;
}

.subtab-btn.active {
  background: rgba(245, 158, 11, 0.18);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-weight: 700;
}

.subform-panel {
  display: none;
}
.subform-panel.active {
  display: block;
}

.form-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin: 1.25rem 0 0.75rem 0;
}

.form-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.form-row {
  display: grid;
  gap: 0.75rem;
}

.form-row.two-cols {
  grid-template-columns: 1fr 1fr;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-textarea {
  background: #0B0F17;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.big-input {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.input-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.preview-box {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.preview-row strong {
  color: var(--primary);
  font-size: 0.95rem;
}

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

/* Photo Upload Area */
.photo-upload-area {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
}

.photo-upload-area:hover {
  border-color: var(--primary);
  background: rgba(245, 158, 11, 0.04);
}

.upload-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 0.4rem;
}

.upload-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.photo-preview-img {
  max-width: 100%;
  max-height: 180px;
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
}

/* Instructions card */
.instructions-card {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.info-icon { font-size: 1.35rem; }

.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.info-list li {
  position: relative;
  padding-left: 1.25rem;
}

.info-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-size: 1.2rem;
  top: -0.15rem;
}

.info-card-footer {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.info-stat {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ==================== P&L HISTORICO VIEW ==================== */
.pnl-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.strip-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.strip-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.strip-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 0.25rem;
}

.strip-item.highlight-gold .strip-val { color: #FBBF24; }
.strip-item.highlight-emerald .strip-val { color: #34D399; }

.pnl-tables-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
}

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

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
}

/* ==================== SIMULATOR VIEW ==================== */
.simulator-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 1.75rem;
}

.slider-group {
  margin-bottom: 1.25rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.slider-val {
  color: var(--primary);
  font-weight: 700;
}

.sim-slider {
  width: 100%;
  accent-color: var(--primary);
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  cursor: pointer;
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.sim-kpi-highlight {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.sim-kpi-item {
  display: flex;
  flex-direction: column;
}

.sim-kpi-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.sim-kpi-value {
  font-size: 1.45rem;
  font-weight: 800;
  margin-top: 0.25rem;
}

.sim-kpi-value.gold { color: #FBBF24; }
.sim-kpi-value.emerald { color: #34D399; }
.sim-kpi-value.blue { color: #60A5FA; }

.sim-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sim-row {
  display: grid;
  grid-template-columns: 1fr 1fr 120px;
  align-items: center;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.02);
}

.sim-row.header-row {
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  background: transparent;
}

.sim-row.subtotal {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
}

.formula-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Toast */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #1F2937;
  color: #FFF;
  border: 1px solid var(--border-subtle);
  padding: 0.85rem 1.35rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 1000;
  animation: slideUp 0.3s ease;
}

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

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .pnl-tables-grid { grid-template-columns: 1fr; }
  .simulator-grid { grid-template-columns: 1fr; }
  .mobile-layout-container { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .charts-grid { grid-template-columns: 1fr; }
  .header-container { flex-direction: column; align-items: stretch; }
  .nav-tabs { overflow-x: auto; width: 100%; }
}

/* ==================== MODAL OVERLAY ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.modal-content {
  background: #111827;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0,0,0,0.7);
  animation: modalScale 0.25s ease-out;
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ==================== USER SWITCHER DROPDOWN ==================== */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 310px;
  background: #0F172A;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.85);
  z-index: 1000;
  overflow: hidden;
  animation: fadeInDown 0.2s ease-out;
}

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

.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.78rem;
  font-weight: 700;
  color: #FFF;
}

.dropdown-list {
  max-height: 380px;
  overflow-y: auto;
}

.dropdown-user-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease;
}

.dropdown-user-item:hover {
  background: rgba(245, 158, 11, 0.12);
}

.dropdown-user-item.active {
  background: rgba(99, 102, 241, 0.2);
  border-left: 3px solid #6366F1;
}

.user-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  color: #FFF;
  flex-shrink: 0;
}

/* Role Badges */
.role-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.role-badge-super-admin {
  background: rgba(147, 51, 234, 0.2);
  color: #C084FC;
  border: 1px solid rgba(147, 51, 234, 0.4);
}

.role-badge-logistica {
  background: rgba(56, 189, 248, 0.2);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.role-badge-socio {
  background: rgba(245, 158, 11, 0.2);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.role-badge-encargada {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.role-badge-operativo {
  background: rgba(148, 163, 184, 0.2);
  color: #CBD5E1;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

/* Permission Pills */
.perm-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #E2E8F0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin: 0.15rem;
}

/* Partner Equity Branch Cards & Progress Bars */
.equity-branch-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.partner-stacked-bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  margin: 0.75rem 0 1rem 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.partner-bar-segment {
  height: 100%;
  transition: width 0.3s ease;
  position: relative;
}

.partner-bar-segment:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  color: #FFF;
  font-size: 0.68rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

/* ==================== LOGIN SCREEN & PIN CHANGE MODAL ==================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, #171E31 0%, #080D1A 100%);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(20px);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(245, 158, 11, 0.15);
  border-radius: 24px;
  padding: 2.25rem 2rem;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #F59E0B, #E11D48, #F59E0B);
  background-size: 200% 100%;
  animation: authGlow 4s linear infinite;
}

@keyframes authGlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 2rem;
  margin-bottom: 0.85rem;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.2);
}

.auth-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #FFF;
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 0.82rem;
  color: #94A3B8;
}

.auth-form-group {
  margin-bottom: 1.25rem;
}

.auth-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #E2E8F0;
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.auth-input {
  width: 100%;
  background: #0B0F19;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  color: #FFF;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
}

.auth-input:focus {
  border-color: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
  background: #0F172A;
}

.auth-input-pin {
  letter-spacing: 0.35em;
  font-size: 1.25rem;
  text-align: center;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
}

.auth-btn-submit {
  width: 100%;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #0F172A;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 0.9rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3);
  transition: all 0.2s ease;
  margin-top: 1.5rem;
}

.auth-btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.4);
}

.auth-btn-submit:active {
  transform: translateY(0);
}

.auth-error-box {
  display: none;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #FCA5A5;
  font-size: 0.8rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  text-align: center;
}

.auth-users-hint {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  color: #64748B;
  text-align: center;
  line-height: 1.4;
}


