@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-1: #081120;
    --bg-2: #0f172a;
    --panel: rgba(15, 23, 42, 0.88);
    --panel-strong: rgba(17, 24, 39, 0.95);
    --border: rgba(148, 163, 184, 0.14);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --primary: #2563eb;
    --primary-2: #3b82f6;
    --primary-soft: rgba(59, 130, 246, 0.12);
    --success: #22c55e;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --sidebar-width: 280px;
    --topbar-height: 78px;
    --font-main: 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 25%),
        radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.12), transparent 30%),
        linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

body.no-scroll {
    overflow: hidden;
}

a {
    text-decoration: none;
}

.topbar {
    height: var(--topbar-height);
    position: sticky;
    top: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    background: rgba(8, 17, 32, 0.82);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.menu-toggle {
    width: 46px;
    height: 46px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.9);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.25s ease;
}

.menu-toggle:hover {
    background: var(--primary-soft);
    border-color: rgba(59, 130, 246, 0.28);
    color: #ffffff;
}

.menu-toggle i {
    font-size: 1.4rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}

.brand-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

.brand-icon i {
    font-size: 1.2rem;
    color: #fff;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand-subtitle {
    font-size: 0.78rem;
    color: var(--muted);
}

.topbar-badge {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.25);
    background: var(--primary-soft);
    color: #bfdbfe;
    font-size: 0.75rem;
    font-weight: 700;
}

.app-layout {
    display: flex;
    min-height: calc(100vh - var(--topbar-height));
}

.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    z-index: 1100;
    padding: 22px 16px;
    background: rgba(10, 18, 34, 0.96);
    backdrop-filter: blur(18px);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 18px 10px;
    margin-bottom: 14px;
}

.sidebar-logo {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    color: #fff;
}

.sidebar-logo i {
    font-size: 1.1rem;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 800;
}

.sidebar-subtitle {
    font-size: 0.76rem;
    color: var(--muted);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-section {
    margin: 14px 10px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 50px;
    padding: 12px 14px;
    border-radius: 15px;
    color: var(--text);
    border: 1px solid transparent;
    transition: 0.25s ease;
}

.sidebar-link i {
    font-size: 1rem;
    color: #93c5fd;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.035);
    border-color: var(--border);
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(59, 130, 246, 0.08));
    border-color: rgba(59, 130, 246, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.sidebar-link.disabled {
    justify-content: space-between;
    opacity: 0.55;
    cursor: not-allowed;
}

.sidebar-link.disabled i,
.sidebar-link.disabled span,
.sidebar-link.disabled small {
    color: var(--muted);
}

.sidebar-overlay {
    position: fixed;
    inset: var(--topbar-height) 0 0 0;
    background: rgba(2, 6, 23, 0.68);
    opacity: 0;
    visibility: hidden;
    transition: 0.25s ease;
    z-index: 1090;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.main-content {
    width: 100%;
    margin-left: var(--sidebar-width);
    padding: 32px;
    transition: margin-left 0.3s ease;
}

body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}

body.sidebar-collapsed .main-content {
    margin-left: 0;
}

.hero {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    padding: 42px;
    margin-bottom: 24px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--primary-soft);
    border: 1px solid rgba(59, 130, 246, 0.22);
    color: #bfdbfe;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 18px;
}

.hero-content {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
}

.hero-text {
    max-width: 620px;
}

.hero-title {
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.05;
    font-weight: 800;
    margin-bottom: 14px;
    letter-spacing: -0.03em;
}

.hero-title span {
    color: #60a5fa;
}

.hero-subtitle {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 22px;
}

.hero-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    font-weight: 700;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.28);
    transition: 0.25s ease;
}

.hero-button:hover {
    transform: translateY(-2px);
}

.hero-stat {
    min-width: 220px;
    padding: 24px;
    border-radius: 20px;
    background: rgba(2, 6, 23, 0.35);
    border: 1px solid var(--border);
    text-align: center;
}

.hero-stat strong {
    display: block;
    font-size: 2.2rem;
    color: #60a5fa;
    margin-bottom: 8px;
}

.hero-stat span {
    color: var(--muted);
    font-size: 0.9rem;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.info-card {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.info-card i {
    font-size: 1.7rem;
    color: #60a5fa;
    margin-bottom: 14px;
    display: inline-block;
}

.info-card h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.info-card p {
    color: var(--muted);
    line-height: 1.65;
    font-size: 0.95rem;
}

.cta-box {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 28px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.cta-box h4 {
    font-size: 1.2rem;
    margin-bottom: 6px;
}

.cta-box p {
    color: var(--muted);
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 18px;
    border-radius: 14px;
    border: 1px solid rgba(59, 130, 246, 0.28);
    background: var(--primary-soft);
    color: #bfdbfe;
    font-weight: 700;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--muted);
}

.calc-wrapper {
    max-width: 820px;
}

.calc-wrapper-wide {
    width: 100%;
    max-width: 100%;
}

.calc-card {
    width: 100%;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.84rem;
    color: #cbd5e1;
    font-weight: 600;
    margin-bottom: 8px;
}

.input-wrap {
    position: relative;
}

.input-wrap.prefix input {
    padding-left: 42px;
}

.input-wrap.suffix input {
    padding-right: 78px;
}

.input-prefix,
.input-suffix {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    pointer-events: none;
}

.input-prefix {
    left: 14px;
    color: #93c5fd;
    font-weight: 600;
}

.input-suffix {
    right: 14px;
    color: var(--muted);
}

.form-control {
    width: 100%;
    height: 52px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(2, 6, 23, 0.5);
    color: #fff;
    padding: 0 16px;
    outline: none;
    transition: 0.25s ease;
}

.form-control:focus {
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.form-control::placeholder {
    color: rgba(148, 163, 184, 0.55);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

input[type="number"] {
    -moz-appearance: textfield;
}

.calc-button {
    width: 100%;
    height: 54px;
    border: none;
    border-radius: 16px;
    margin-top: 22px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.25s ease;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.28);
}

.calc-button:hover {
    transform: translateY(-2px);
}

.hidden {
    display: none;
}

.result-box {
    margin-top: 24px;
}

.result-top {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(59, 130, 246, 0.08));
    border: 1px solid rgba(59, 130, 246, 0.24);
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    text-align: center;
    padding: 24px;
}

.result-label {
    display: block;
    font-size: 0.8rem;
    color: #bfdbfe;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.result-value {
    font-size: clamp(2rem, 5vw, 3rem);
    color: #60a5fa;
    font-weight: 800;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border: 1px solid rgba(59, 130, 246, 0.24);
    border-top: none;
    border-radius: 0 0 20px 20px;
    overflow: hidden;
}

.result-card {
    background: rgba(2, 6, 23, 0.42);
    padding: 22px;
}

.result-card:first-child {
    border-right: 1px solid rgba(59, 130, 246, 0.14);
}

.result-card-label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.result-card-value {
    font-size: 1.25rem;
    color: #e2e8f0;
}

.result-card-value.positive {
    color: var(--success);
}

.result-section {
    margin-top: 30px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 30px;
}

.summary-card {
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 22px;
    box-shadow: var(--shadow);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.summary-card-highlight {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.24), rgba(59, 130, 246, 0.08));
    border-color: rgba(59, 130, 246, 0.28);
}

.summary-label {
    display: block;
    font-size: 0.84rem;
    color: var(--muted);
    margin-bottom: 10px;
    line-height: 1.4;
}

.summary-value {
    display: block;
    font-size: 1.45rem;
    font-weight: 800;
    color: #e2e8f0;
    line-height: 1.2;
    word-break: break-word;
}

.summary-value.positive {
    color: var(--success);
}

.chart-card,
.table-card {
    margin-top: 24px;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.section-head {
    margin-bottom: 18px;
}

.section-head h3 {
    font-size: 1.2rem;
    margin-bottom: 6px;
    color: #e2e8f0;
}

.section-head p {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 440px;
    min-height: 440px;
    max-height: 440px;
    margin-top: 10px;
}

.chart-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.table-responsive-custom {
    overflow-x: auto;
    margin-top: 10px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.08);
    background: rgba(2, 6, 23, 0.22);
}

.evolution-table {
    width: 100%;
    min-width: 860px;
    border-collapse: separate;
    border-spacing: 0;
}

.evolution-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: left;
    font-size: 0.88rem;
    color: #cbd5e1;
    padding: 16px 18px;
    background: rgba(8, 17, 32, 0.98);
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    white-space: nowrap;
}

.evolution-table thead th:first-child {
    border-top-left-radius: 14px;
}

.evolution-table thead th:last-child {
    border-top-right-radius: 14px;
}

.evolution-table tbody td {
    padding: 15px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    color: #e2e8f0;
    font-size: 0.95rem;
    white-space: nowrap;
}

.evolution-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.evolution-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.08);
}

.evolution-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 14px;
}

.evolution-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 14px;
}


.money-input {
    font-variant-numeric: tabular-nums;
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    padding-right: 44px;
    background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%), linear-gradient(135deg, #94a3b8 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(50% - 3px), calc(100% - 14px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.suffix-short input {
    padding-right: 50px;
}

@media (max-width: 1200px) {
    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 24px 16px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .topbar-badge {
        display: none;
    }
}

@media (max-width: 768px) {
    .brand-subtitle {
        display: none;
    }

    .hero,
    .info-card,
    .cta-box,
    .calc-card {
        padding: 22px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

    .result-card:first-child {
        border-right: none;
        border-bottom: 1px solid rgba(59, 130, 246, 0.14);
    }

    .hero-stat {
        width: 100%;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .chart-card,
    .table-card {
        padding: 20px;
    }

    .chart-container {
        height: 300px;
        min-height: 300px;
        max-height: 300px;
    }

    .summary-card {
        min-height: auto;
    }

    .summary-value {
        font-size: 1.3rem;
    }

}