/* ==========================================================================
   styles.css - Calculadora de Costos de Conversión (DA 22-10 & DA 23-01)
   Tema & Layout oficial idéntico a https://eliascpa.dyndns.org/
   Fernández CPA & Business Consultant, LLC / Fernández Law Office
   ========================================================================== */

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

:root {
    --ink: #17243a;
    --muted: #667085;
    --surface: #ffffff;
    --surface-subtle: #f8fafc;
    --line: #e4eaf2;
    --line-subtle: #edf2f7;
    --line-hover: #bad5fa;
    --blue: #1769e0;
    --blue-dark: #1056bb;
    --blue-soft: #edf5ff;
    --blue-border: #d2e4fc;
    --gold: #b7791f;
    --gold-dark: #975a16;
    --gold-bg: #fffaf0;
    --gold-border: #faeccd;
    --emerald: #059669;
    --emerald-soft: #ecfdf5;
    --emerald-border: #a7f3d0;
    --crimson: #dc2626;
    --crimson-soft: #fef2f2;
    --crimson-border: #fecaca;
    --shadow: 0 12px 35px rgba(28,48,88,.09);
    --shadow-sm: 0 2px 5px rgba(16,24,40,.03);
    --shadow-card: 0 2px 6px rgba(16,24,40,.03);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    color: var(--ink);
    background-color: #f6f8fc;
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Notice Banner */
.notice {
    margin: 0 0 24px;
    padding: 16px 20px;
    border-left: 5px solid var(--gold);
    border-radius: 12px;
    color: #5b6474;
    background: var(--gold-bg);
    font-size: 0.92rem;
    line-height: 1.55;
    border-top: 1px solid var(--gold-border);
    border-right: 1px solid var(--gold-border);
    border-bottom: 1px solid var(--gold-border);
    box-shadow: var(--shadow-sm);
}

.notice strong {
    color: #4a3a16;
}

/* Hero Banner idéntico a https://eliascpa.dyndns.org/ */
.hero {
    padding: 34px clamp(24px, 5vw, 48px);
    color: #ffffff;
    border-radius: 24px;
    background: radial-gradient(circle at 88% 12%, rgba(118, 193, 255, .35), transparent 32%),
                linear-gradient(120deg, #102b57 0%, #1769e0 100%);
    box-shadow: 0 18px 42px rgba(23, 105, 224, .22);
    position: relative;
    overflow: hidden;
}

.hero-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.45;
    pointer-events: none;
}

.eyebrow {
    margin: 0 0 8px;
    color: #b9d9ff;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.hero-title {
    margin: 0;
    font-size: clamp(1.85rem, 3.5vw, 2.7rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.035em;
}

.hero-copy {
    max-width: 720px;
    margin: 12px 0 0;
    color: #e6f1ff;
    font-size: 1rem;
    line-height: 1.6;
}

/* Tarjetas y Contenedores */
.app-card {
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease-in-out;
}

.app-card:hover {
    border-color: var(--line-hover);
    box-shadow: var(--shadow);
}

/* KPI Metric Cards */
.kpi-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3.5px;
    background: var(--blue);
}

.kpi-card.emerald::before { background: var(--emerald); }
.kpi-card.crimson::before { background: var(--crimson); }
.kpi-card.gold::before { background: var(--gold); }

/* Inputs, Selects y Formularios */
.form-input, .form-select {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    background-color: #ffffff;
    font-size: 0.92rem;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
    outline: 0;
}

.form-input:focus, .form-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(23, 105, 224, .12);
}

.form-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* Botones con estilo del portal central */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    background-color: var(--blue);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.92rem;
    border-radius: 11px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(23, 105, 224, .25);
    transition: all 0.18s ease;
}

.btn-primary:hover {
    background-color: var(--blue-dark);
    box-shadow: 0 6px 16px rgba(23, 105, 224, .35);
    transform: translateY(-1px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    background-color: #ffffff;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.88rem;
    border-radius: 11px;
    border: 1px solid var(--line);
    cursor: pointer;
    transition: all 0.18s ease;
}

.btn-secondary:hover {
    background-color: #f4f7fb;
    border-color: #cbd5e1;
    color: var(--blue-dark);
}

.btn-soft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 13px;
    background-color: var(--blue-soft);
    color: var(--blue);
    font-weight: 600;
    font-size: 0.82rem;
    border-radius: 9999px;
    border: 1px solid var(--blue-border);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-soft:hover {
    background-color: #dbeafe;
    color: var(--blue-dark);
}

.btn-gold {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    background: linear-gradient(135deg, #b7791f, #975a16);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.88rem;
    border-radius: 11px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(183, 121, 31, 0.25);
    transition: all 0.18s ease;
}

.btn-gold:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

/* Tabs de Navegación */
.nav-tabs-wrapper {
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.nav-tabs {
    display: flex;
    gap: 6px;
    min-width: max-content;
    padding: 4px;
    background: #e9eff8;
    border-radius: 12px;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 15px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--ink);
    background: rgba(255,255,255,0.6);
}

.tab-btn.active {
    color: var(--blue-dark);
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(16,43,87,0.1);
}

/* Tablas Estilizadas */
.breakdown-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
}

.breakdown-table th {
    text-align: left;
    padding: 10px 13px;
    background-color: #f4f7fb;
    color: #475569;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.74rem;
    border-bottom: 1px solid var(--line);
}

.breakdown-table th:first-child { border-top-left-radius: 10px; }
.breakdown-table th:last-child { border-top-right-radius: 10px; }

.breakdown-table td {
    padding: 10px 13px;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.breakdown-table tr:last-child td {
    border-bottom: none;
}

.breakdown-table tbody tr:hover {
    background-color: #f8fafc;
}

.assets-table {
    min-width: 1050px;
    table-layout: fixed;
}

.assets-table .asset-col-description { width: 240px; }
.assets-table .asset-col-category { width: 180px; }
.assets-table .asset-col-money { width: 165px; }
.assets-table .asset-col-gain { width: 165px; }
.assets-table .asset-col-lifo { width: 110px; }
.assets-table .asset-col-actions { width: 45px; }

.assets-table input[type="number"] {
    min-width: 0;
    font-size: 0.82rem;
}

/* Badges y Pills */
.badge-portal {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-blue {
    background: var(--blue-soft);
    color: var(--blue);
    border: 1px solid var(--blue-border);
}

.badge-emerald {
    background: var(--emerald-soft);
    color: var(--emerald);
    border: 1px solid var(--emerald-border);
}

.badge-gold {
    background: var(--gold-bg);
    color: var(--gold);
    border: 1px solid var(--gold-border);
}

.badge-crimson {
    background: var(--crimson-soft);
    color: var(--crimson);
    border: 1px solid var(--crimson-border);
}

.mono-num {
    font-family: 'JetBrains Mono', monospace;
    font-feature-settings: 'tnum' on, 'lnum' on;
}

/* Range Slider */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}
input[type=range]:focus {
    outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: #e2e8f0;
    border-radius: 3px;
}
input[type=range]::-webkit-slider-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--blue);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -6px;
    box-shadow: 0 0 6px rgba(23, 105, 224, 0.5);
}

/* Estilos de Impresión */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 10pt !important;
    }
    .no-print {
        display: none !important;
    }
    .print-only {
        display: block !important;
    }
    .app-card, .kpi-card {
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        break-inside: avoid;
    }
    .breakdown-table th {
        background: #f1f5f9 !important;
        color: #000000 !important;
        border-bottom: 1px solid #000000 !important;
    }
    .breakdown-table td {
        border-bottom: 1px solid #e2e8f0 !important;
        color: #000000 !important;
    }
}
