:root {
    --bg-base:       #0a0d14;
    --bg-surface:    #111520;
    --bg-card:       #161c2d;
    --bg-card-hover: #1c2438;
    --border:        #1e2a42;
    --border-bright: #2d3f5e;

    --primary:       #00c2ff;
    --primary-dim:   rgba(0, 194, 255, 0.12);
    --primary-glow:  rgba(0, 194, 255, 0.25);

    --accent:        #00ffb3;
    --accent-dim:    rgba(0, 255, 179, 0.10);

    --danger:        #ff4d6d;
    --danger-dim:    rgba(255, 77, 109, 0.12);
    --warning:       #ffb547;
    --warning-dim:   rgba(255, 181, 71, 0.12);
    --success:       #00ffb3;
    --success-dim:   rgba(0, 255, 179, 0.10);

    --text-primary:  #e8edf5;
    --text-secondary:#8a9bb8;
    --text-muted:    #4a5a78;

    --font-display:  'DM Serif Display', Georgia, serif;
    --font-body:     'Outfit', sans-serif;
    --font-mono:     'IBM Plex Mono', monospace;

    --radius-sm:  6px;
    --radius-md:  12px;
    --radius-lg:  20px;

    --shadow-card: 0 4px 24px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.03) inset;
    --shadow-glow: 0 0 40px rgba(0, 194, 255, 0.08);
}

/* ─── RESET & BASE ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

/* Subtle grid texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,194,255,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,194,255,0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* ─── NAVBAR ───────────────────────────────────────────────────────── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 13, 20, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 5%;
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--primary);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 12px var(--primary); }
    50% { opacity: 0.5; box-shadow: 0 0 4px var(--primary); }
}

.nav-links {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.nav-links a:hover { color: var(--text-primary); background: var(--bg-card); }

/* ─── BUTTONS ──────────────────────────────────────────────────────── */
.btn-login {
    background: transparent;
    border: 1px solid var(--border-bright);
    color: var(--text-secondary) !important;
    padding: 8px 18px !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.875rem !important;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.btn-login:hover {
    border-color: var(--primary);
    color: var(--primary) !important;
    background: var(--primary-dim) !important;
}

.btn-calcular {
    background: linear-gradient(135deg, #0077aa, #00c2ff);
    color: #000 !important;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    width: 100%;
    cursor: pointer;
    transition: all 0.25s;
    font-family: var(--font-body);
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.btn-calcular::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.15));
    opacity: 0;
    transition: opacity 0.2s;
}

.btn-calcular:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 8px 24px var(--primary-glow);
}
.btn-calcular:hover::after { opacity: 1; }
.btn-calcular:active { transform: translateY(0); }

.btn-cta {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), #00d4a0);
    color: #000;
    padding: 16px 36px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s;
    letter-spacing: 0.2px;
}

.btn-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 255, 179, 0.3);
}

/* ─── CARDS ────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
    position: relative;
    transition: border-color 0.2s;
}

.card:hover { border-color: var(--border-bright); }

.card h3 {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary);
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

/* ─── LAYOUT ───────────────────────────────────────────────────────── */
.container {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding: 32px 5%;
    max-width: 1500px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.inputs-panel { flex: 1; min-width: 320px; max-width: 420px; }
.results-panel { flex: 2; min-width: 340px; }

/* ─── HEADER (app page) ────────────────────────────────────────────── */
.app-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 40px 5% 32px;
    position: relative;
    overflow: hidden;
}

.app-header::after {
    content: '';
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--primary-dim) 0%, transparent 70%);
    pointer-events: none;
}

.app-header h1 {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.2;
}

.app-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 600px;
}

/* ─── FORMS ────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

input[type="number"], select {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: var(--font-mono);
    color: var(--text-primary);
    transition: all 0.2s;
    appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }

input[type="number"]:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px var(--primary-dim);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a9bb8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

select option { background: var(--bg-card); color: var(--text-primary); }

/* Select styled wrapper */
.select-group {
    background: var(--bg-card);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.select-group .select-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.select-group-content { flex: 1; }
.select-group-content label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary);
    margin-bottom: 6px;
    font-weight: 600;
}

.select-group-content select {
    border: 1px solid var(--border);
    background: var(--bg-surface);
}

/* ─── KPI BOXES ────────────────────────────────────────────────────── */
.kpi-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    padding: 20px;
}

.kpi-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}

.kpi-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.kpi-box:hover::before { opacity: 1; }
.kpi-box:hover { border-color: var(--border-bright); background: var(--bg-card-hover); }

.kpi-box h3 {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-bottom: 0;
    border-bottom: none;
    text-transform: uppercase;
}

.kpi-box p {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.kpi-value {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    display: block;
}

/* ─── ALERTS ───────────────────────────────────────────────────────── */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
    border: 1px solid;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    animation: slideIn 0.3s ease;
}

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

.alert-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-body h4 {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 3px;
}

.alert-body p { font-size: 0.85rem; line-height: 1.5; opacity: 0.85; }

.alert-warning {
    background: var(--warning-dim);
    border-color: rgba(255, 181, 71, 0.3);
    color: #f5c842;
}

.alert-danger {
    background: var(--danger-dim);
    border-color: rgba(255, 77, 109, 0.3);
    color: #ff7a92;
}

.alert-success {
    background: var(--success-dim);
    border-color: rgba(0, 255, 179, 0.25);
    color: #00ffb3;
}

/* ─── TABLE ────────────────────────────────────────────────────────── */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: auto;
    margin-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}

/* Scrollbar estilizado */
.table-container::-webkit-scrollbar { height: 6px; }
.table-container::-webkit-scrollbar-track { background: var(--bg-surface); }
.table-container::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }
.table-container::-webkit-scrollbar-thumb:hover { background: var(--primary); }

table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

thead tr {
    background: var(--bg-surface);
    border-bottom: 2px solid var(--border-bright);
}

thead th {
    padding: 14px 16px;
    text-align: right;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--primary);
    font-weight: 600;
    white-space: nowrap;
}

thead th:first-child { text-align: left; color: var(--text-muted); }

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

tbody tr:nth-child(even) { background: rgba(255,255,255,0.015); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-card-hover) !important; }

tbody td {
    padding: 11px 16px;
    text-align: right;
    color: var(--text-secondary);
    white-space: nowrap;
}

tbody td:first-child {
    text-align: left;
    color: var(--text-primary);
    font-weight: 600;
}

.negative { color: var(--danger) !important; font-weight: 600; }
.positive { color: var(--accent) !important; font-weight: 600; }

/* ─── CHART ────────────────────────────────────────────────────────── */
.chart-container {
    position: relative;
}

/* No forzar altura fija: Chart.js usa aspectRatio: 2.2 para controlarse solo */
.chart-container canvas {
    display: block;
    width: 100% !important;
}

/* ─── TOOLTIP ──────────────────────────────────────────────────────── */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--border-bright);
    color: var(--text-muted);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: help;
    position: relative;
    flex-shrink: 0;
}

.tooltip-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-surface);
    border: 1px solid var(--border-bright);
    color: var(--text-secondary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    width: 230px;
    font-size: 0.8rem;
    line-height: 1.5;
    font-family: var(--font-body);
    font-weight: 400;
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 99;
    box-shadow: var(--shadow-card);
}

.tooltip-icon:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ─── AUTH PAGES ───────────────────────────────────────────────────── */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
    position: relative;
}

.auth-body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 60% 40%, rgba(0, 194, 255, 0.04) 0%, transparent 60%),
                radial-gradient(ellipse at 30% 70%, rgba(0, 255, 179, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

.auth-card h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.auth-card > p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 28px;
}

.auth-card .form-group {
    margin-bottom: 20px;
}

.auth-card p:last-child {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 20px;
}

.auth-card p a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-card p a:hover { text-decoration: underline; }

.hidden { display: none !important; }

.btn-mercadopago {
    background: linear-gradient(135deg, #00b1ea, #009ee3) !important;
}

/* ─── LANDING ──────────────────────────────────────────────────────── */
.landing-body {
    background: var(--bg-base);
}

.hero-section {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 20px 80px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 30%, rgba(0, 194, 255, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(0, 255, 179, 0.04) 0%, transparent 60%);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 20px;
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid rgba(0, 194, 255, 0.3);
    border-radius: 50px;
    background: var(--primary-dim);
}

.hero-content h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.hero-content h1 .highlight {
    color: var(--primary);
    font-style: italic;
}

.hero-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 40px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.hero-stat span {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary);
}

.hero-stat p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 80px 8%;
    position: relative;
    z-index: 1;
}

.feature-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.feature-box::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s;
}

.feature-box:hover { 
    border-color: var(--border-bright); 
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.feature-box:hover::after { transform: scaleX(1); }

.feature-icon {
    font-size: 2rem;
    margin-bottom: 16px;
    display: block;
}

.feature-box h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.feature-box p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ─── ADMIN PANEL ──────────────────────────────────────────────────── */
.admin-container {
    padding: 40px 5%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.admin-header {
    margin-bottom: 36px;
}

.admin-header h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.admin-header p { color: var(--text-secondary); font-size: 0.9rem; }

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.stat-card h3 {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--primary);
    line-height: 1;
}


/* ─── PRODUCTO ROWS ─────────────────────────────────────────────────── */
.producto-row input:focus {
    outline: none;
    border-color: var(--primary) !important;
    background: var(--bg-card) !important;
    box-shadow: 0 0 0 3px var(--primary-dim);
}

.producto-row input::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

/* ─── RESPONSIVE ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .inputs-panel { max-width: 100%; }
    .kpi-container { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .container { padding: 16px; gap: 16px; }
    .navbar { padding: 0 4%; }
    .hero-stats { flex-direction: column; gap: 24px; }
    .kpi-container { grid-template-columns: 1fr 1fr; }
    .card { padding: 20px; }
    thead th, tbody td { padding: 10px 10px; }
}
/* =========================================
   ESTILOS DEL MODAL DE FEEDBACK
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 13, 20, 0.85); /* Usa el color base con opacidad */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 35px 30px;
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-card), var(--shadow-glow);
    animation: fadeIn 0.3s ease;
}

.modal-content h3 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.modal-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

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

.form-textarea {
    width: 100%;
    margin-top: 5px;
    padding: 14px;
    background: var(--bg-surface);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    resize: vertical;
    font-family: var(--font-body);
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: all 0.2s;
}

.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px var(--primary-dim);
}

.modal-actions {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-primary {
    background: linear-gradient(135deg, #0077aa, #00c2ff);
    color: #000;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.25s;
}

.btn-primary:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 8px 24px var(--primary-glow);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-bright);
    color: var(--text-secondary);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.95rem;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover { 
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-dim);
}

@media (max-width: 768px) {
    .container {
        padding: 20px 5%; /* Menos padding lateral en celulares */
        flex-direction: column; /* Asegura que los paneles se apilen */
    }
    .inputs-panel, .results-panel {
        width: 100%;
        max-width: 100%;
    }
    .kpi-container {
        grid-template-columns: 1fr; /* 1 KPI por fila en celular */
    }
    /* El navbar para que no se aprieten los botones */
    .nav-links {
        gap: 8px; 
    }
    .btn-login {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
    }
}
/* =========================================
   CORRECCIONES VISUALES V1
   ========================================= */

/* 1. Permitir que los globos de texto (tooltips) sobresalgan de sus cajas */
.kpi-container, 
.kpi-box, 
#kpi-panel,
.results-panel .card {
    overflow: visible !important;
}

/* 2. Gráfico y tabla ocupan el 100% del ancho cuando están visibles (apilados hacia abajo) */
#chart-panel, 
#table-panel {
    width: 100%;
    flex: 0 0 100%;
    margin-top: 25px;
    box-sizing: border-box;
}

/* Ajuste extra para asegurar que el canvas del gráfico respete el contenedor */
.chart-container canvas {
    max-width: 100% !important;
    height: auto !important;
}