/* ===========================================
   RESPONSIVE TYPOGRAPHY SYSTEM
   Escala fluida: 13px (320px) → 16px (375px) → 18px (1024px+)
   Todos los tamaños relativos (rem, em) se adaptan automáticamente.
   =========================================== */
html {
    font-size: clamp(13px, 3.2vw, 18px);
    -webkit-text-size-adjust: 100%;
}

html, body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #f5f7f5;
    color: #1a2e1a;
}

/* Forzar tamaño legible en pantallas muy pequeñas (< 360px) */
@media (max-width: 359px) {
    html { font-size: 12px; }
}

/* Tablets y Desktop: tamaño óptimo fijo */
@media (min-width: 768px) {
    html { font-size: 16px; }
}

@media (min-width: 1280px) {
    html { font-size: 17px; }
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d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A5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.status-bar-safe-area {
    display: none;
}

@supports (-webkit-touch-callout: none) {
    .status-bar-safe-area {
        display: flex;
        position: sticky;
        top: 0;
        height: env(safe-area-inset-top);
        background-color: #f7f7f7;
        width: 100%;
        z-index: 1;
    }

    .flex-column, .navbar-brand {
        padding-left: env(safe-area-inset-left);
    }
}

/* Page Entry Animations */
.animate-in {
    animation-fill-mode: both;
}

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

.slide-in-from-bottom-4 {
    animation: slideInBottom 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInBottom {
    from { transform: translateY(1rem); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.duration-500 { animation-duration: 500ms; }
.duration-700 { animation-duration: 700ms; }
.duration-1000 { animation-duration: 1000ms; }

/* Missing Animations */
.slide-in-from-top {
    animation: slideInTop 0.4s ease-out forwards;
}

.slide-in-from-right {
    animation: slideInRight 0.4s ease-out forwards;
}

.slide-in-from-bottom-2 {
    animation: slideInBottom2 0.5s ease-out forwards;
}

.slide-in-from-bottom-10 {
    animation: slideInBottom10 0.6s ease-out forwards;
}

.zoom-in-95 {
    animation: zoomIn95 0.3s ease-out forwards;
}

@keyframes slideInTop {
    from { transform: translateY(-1rem); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(1rem); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInBottom2 {
    from { transform: translateY(0.5rem); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideInBottom10 {
    from { transform: translateY(2.5rem); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes zoomIn95 {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
/* Tailwind Offline Shim - Critical Classes */
.bg-white { background-color: #ffffff; }
.dark .bg-slate-900 { background-color: #0f172a; }
.bg-slate-50 { background-color: #f8fafc; }
.bg-lime-600 { background-color: #65a30d; }
.bg-blue-600 { background-color: #2563eb; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-lime-50 { background-color: #f7fee7; }

.rounded-3xl { border-radius: 1.5rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.p-10 { padding: 2.5rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) {
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:flex-row { flex-direction: row; }
    .md\:bg-white { background-color: #ffffff; }
    .md\:bg-slate-50 { background-color: #f8fafc; }
    .md\:text-lime-600 { color: #65a30d; }
    .md\:flex-1 { flex: 1 1 0%; }
    .md\:shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
    .md\:rounded-2xl { border-radius: 1rem; }
    .md\:border-none { border-style: none; }
    
    .dark .md\:bg-slate-700 { background-color: #334155; }
    .dark .md\:bg-slate-800\/50 { background-color: rgba(30, 41, 59, 0.5); }
}

.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }

.text-white { color: #ffffff; }
.text-slate-800 { color: #1e293b; }
.text-slate-500 { color: #64748b; }
.text-slate-400 { color: #94a3b8; }
.text-blue-600 { color: #2563eb; }
.text-lime-600 { color: #65a30d; }

.font-black { font-weight: 900; }
.font-bold { font-weight: 700; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-widest { letter-spacing: 0.1em; }
.uppercase { text-transform: uppercase; }

.border { border-width: 1px; border-style: solid; }
.border-slate-100 { border-color: #f1f5f9; }
.dark .border-slate-800 { border-color: #1e293b; }

.w-full { width: 100%; }
.h-16 { height: 4rem; }
.w-16 { width: 4rem; }

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* ===========================================
   FOREX EDGE THEME (LIGHT)
   =========================================== */
.sidebar {
  width: 240px;
  background: #ffffff;
  border-right: 1px solid #e5ede5;
  padding: 20px 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  left: 0;
  top: 0;
  z-index: 100;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 25px;
  border-bottom: 1px solid #e5ede5;
  margin-bottom: 20px;
}
.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.9em;
}
.logo-text {
  font-size: 1.05em;
  font-weight: 700;
  color: #1a2e1a;
  letter-spacing: 0.5px;
}
.nav-section { padding: 0 12px; margin-bottom: 15px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #5a6b5a;
  text-decoration: none;
  font-size: 0.9em;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all 0.2s ease;
  cursor: pointer;
}
.nav-item:hover { background: #f0f7f0; color: #10b981; }
.nav-item.active {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  color: #059669;
  font-weight: 600;
  border-left: 3px solid #10b981;
}
.nav-icon { width: 20px; text-align: center; font-size: 1em; }
.sidebar-bottom {
  padding: 20px;
  border-top: 1px solid #e5ede5;
  margin-top: 20px;
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #f0f7f0;
  border-radius: 10px;
  margin-bottom: 15px;
}
.user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
}
.user-info { flex: 1; }
.user-name { font-weight: 600; font-size: 0.85em; color: #1a2e1a; }
.user-plan {
  font-size: 0.7em;
  color: #059669;
  background: #d1fae5;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 2px;
}
.promo-card {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
}
.promo-icon { font-size: 1.8em; margin-bottom: 8px; }
.promo-title { font-weight: 700; color: #059669; margin-bottom: 5px; font-size: 0.9em; }
.promo-text { font-size: 0.75em; color: #5a6b5a; margin-bottom: 10px; line-height: 1.4; }
.promo-progress {
  background: #fff;
  border-radius: 6px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 5px;
}
.promo-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  width: 87%;
}
.promo-stat { font-size: 0.7em; color: #059669; font-weight: 600; }
.main {
  margin-left: 240px;
  flex: 1;
  padding: 25px 30px;
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0 !important; padding: 15px !important; }
}
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}
.page-title h1 {
  font-size: 1.6em;
  color: #1a2e1a;
  font-weight: 700;
  margin-bottom: 4px;
}
.page-title p {
  color: #6b7b6b;
  font-size: 0.9em;
}
.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.date-picker {
  background: #fff;
  border: 1px solid #e5ede5;
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85em;
  color: #1a2e1a;
  cursor: pointer;
}
.btn-custom {
  background: #fff;
  border: 1px solid #e5ede5;
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85em;
  color: #1a2e1a;
  cursor: pointer;
  font-weight: 500;
}
.btn-custom-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

/* KPI CARDS */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.kpi-card {
  background: #fff;
  border: 1px solid #e5ede5;
  border-radius: 12px;
  padding: 18px;
  transition: all 0.3s ease;
}
.kpi-card:hover {
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
  transform: translateY(-2px);
}
.kpi-label {
  font-size: 0.75em;
  color: #6b7b6b;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.kpi-value {
  font-size: 1.5em;
  font-weight: 800;
  color: #1a2e1a;
  margin-bottom: 5px;
}
.kpi-change {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75em;
  color: #10b981;
  font-weight: 600;
}
.kpi-change.negative { color: #ef4444; }
.kpi-sparkline { height: 30px; margin-top: 8px; }
.kpi-sparkline svg { width: 100%; height: 100%; }

/* CHART SECTION */
.dashboard-grid {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 1100px) { .dashboard-grid { grid-template-columns: 1fr; } }

.chart-card {
  background: #fff;
  border: 1px solid #e5ede5;
  border-radius: 12px;
  padding: 20px;
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.chart-title {
  font-size: 1em;
  font-weight: 700;
  color: #1a2e1a;
}
.chart-tabs {
  display: flex;
  gap: 5px;
  background: #f0f7f0;
  padding: 4px;
  border-radius: 8px;
}
.chart-tab {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.8em;
  color: #6b7b6b;
  cursor: pointer;
  font-weight: 500;
}
.chart-tab.active {
  background: #fff;
  color: #059669;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.icon-btn {
  width: 28px;
  height: 28px;
  background: #f0f7f0;
  border: none;
  border-radius: 6px;
  color: #059669;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-card {
  background: #fff;
  border: 1px solid #e5ede5;
  border-radius: 12px;
  padding: 20px;
}
.donut-title {
  font-size: 1em;
  font-weight: 700;
  color: #1a2e1a;
  margin-bottom: 20px;
}
.donut-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 15px;
}
.donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.donut-value {
  font-size: 1.6em;
  font-weight: 800;
  color: #1a2e1a;
}
.donut-label {
  font-size: 0.7em;
  color: #6b7b6b;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.8em;
}
.legend-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.legend-name { color: #5a6b5a; }
.legend-value { font-weight: 700; color: #1a2e1a; }

/* BOTTOM GRID */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 20px;
}
@media (max-width: 1100px) { .bottom-grid { grid-template-columns: 1fr; } }

.info-card {
  background: #fff;
  border: 1px solid #e5ede5;
  border-radius: 12px;
  padding: 20px;
}
.info-title {
  font-size: 1em;
  font-weight: 700;
  color: #1a2e1a;
  margin-bottom: 15px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f0f7f0;
  font-size: 0.85em;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: #6b7b6b; }
.info-value { font-weight: 700; color: #1a2e1a; }
.info-value.green { color: #10b981; }
.info-value.red { color: #ef4444; }

.donut-small-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 15px;
}
.donut-small-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.donut-small-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.donut-small-value {
  font-size: 1.1em;
  font-weight: 800;
  color: #1a2e1a;
}
.donut-small-label {
  font-size: 0.65em;
  color: #6b7b6b;
}
.instruments-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.instrument-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78em;
  padding: 4px 0;
}
.instrument-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.instrument-dot { width: 8px; height: 8px; border-radius: 50%; }
.instrument-name { color: #1a2e1a; font-weight: 500; }
.instrument-pct { color: #6b7b6b; font-weight: 600; }

.bar-chart {
  height: 180px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 10px;
  padding: 10px 0;
  margin-top: 10px;
}
.bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.bar {
  width: 100%;
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  border-radius: 4px 4px 0 0;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
  position: relative;
  transition: all 0.3s ease;
}
.bar:hover { background: linear-gradient(180deg, #10b981 0%, #059669 100%); }
.bar.negative {
  background: linear-gradient(180deg, #fca5a5 0%, #ef4444 100%);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2);
}
.bar-label { font-size: 0.7em; color: #6b7b6b; }
.bar-value {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7em;
  font-weight: 700;
  color: #10b981;
  white-space: nowrap;
}
.bar.negative .bar-value { color: #ef4444; }
