:root {
    --primary-color: #0f172a; --secondary-color: #1e293b;
    --accent-color: #3b82f6; --accent-hover: #2563eb;
    --success-color: #10b981; --success-dark: #059669;
    --warning-color: #f59e0b; --danger-color: #ef4444;
    --background-color: #f1f5f9; --card-bg: #ffffff;
    --text-main: #334155; --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius-md: 0.25rem; --radius-lg: 0.5rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body { background-color: var(--background-color); color: var(--text-main); display: flex; min-height: 100vh; flex-direction: column; font-size: 0.9rem; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

.navbar { background-color: var(--primary-color); padding: 0.75rem 1rem; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.navbar-brand h1 { font-size: 1.15rem; font-weight: 700; color: #ffffff; }
.navbar-brand p { font-size: 0.7rem; color: #94a3b8; text-transform: uppercase; }
.navbar-controls { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

select, input { -webkit-appearance: none; -moz-appearance: none; appearance: none; outline: none; }

.lang-select { 
    background-color: #1e293b; color: white; border: 1px solid #334155; padding: 0.5rem 2rem 0.5rem 0.75rem; 
    border-radius: var(--radius-md); font-size: 0.8rem; cursor: pointer; min-height: 38px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" fill="white" viewBox="0 0 16 16"><path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/></svg>');
    background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 10px;
}

.main-wrapper { display: flex; flex: 1; max-width: 1400px; margin: 0 auto; width: 100%; padding: 1rem; gap: 1rem; flex-wrap: wrap; }
.sidebar { width: 220px; background-color: var(--card-bg); border-radius: var(--radius-lg); padding: 1rem; border: 1px solid var(--border-color); height: fit-content; }
.menu-title { font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); font-weight: 700; margin-bottom: 0.75rem; }
.menu-item { padding: 0.75rem 0.5rem; margin-bottom: 0.25rem; border-radius: var(--radius-md); cursor: pointer; font-weight: 500; font-size: 0.85rem; display: flex; gap: 0.5rem; align-items: center; transition: all 0.2s; min-height: 44px; }
.menu-item:hover { background-color: #f8fafc; color: var(--accent-color); }
.menu-item.active { background-color: #eff6ff; color: var(--accent-color); font-weight: 600; }

.content-area { flex: 1; min-width: 0; width: 100%; }
.section-view { display: none; width: 100%; }
.section-view.active { display: block; animation: fadeIn 0.3s ease-in-out; }

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

.finance-card { background-color: var(--card-bg); border-radius: var(--radius-lg); padding: 1.25rem; border: 1px solid var(--border-color); margin-bottom: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.finance-card h2 { font-size: 1.1rem; color: var(--primary-color); margin-bottom: 1rem; border-bottom: 1px solid var(--background-color); padding-bottom: 0.5rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group label { font-size: 0.8rem; font-weight: 600; color: var(--text-main); }

.form-group input, .form-group select { 
    padding: 0.6rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); 
    font-size: 0.95rem; background-color: #f8fafc; color: var(--text-main); width: 100%;
    transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus { border-color: var(--accent-color); }
.form-group select {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="%2364748b" viewBox="0 0 16 16"><path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/></svg>');
    background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 12px; padding-right: 2.2rem;
}

.math-display { background-color: #f8fafc; border: 1px dashed #cbd5e1; border-radius: var(--radius-md); padding: 1rem; margin: 1rem 0; }
.math-title { font-size: 0.75rem; text-transform: uppercase; font-weight: 700; color: var(--text-muted); margin-bottom: 0.75rem; letter-spacing: 0.5px; }
.math-row { display: flex; justify-content: space-between; margin-bottom: 0.4rem; font-size: 0.85rem; }
.math-total { border-top: 1px solid var(--border-color); margin-top: 0.75rem; padding-top: 0.75rem; font-size: 0.95rem; font-weight: 700; color: var(--primary-color); display: flex; justify-content: space-between; }

.btn-primary { 
    width: 100%; background-color: var(--success-color); color: white; border: none; 
    padding: 0.75rem; border-radius: var(--radius-md); font-size: 0.95rem; font-weight: 700; 
    text-transform: uppercase; cursor: pointer; min-height: 48px;
    transition: background 0.2s, transform 0.1s; 
}
.btn-primary:hover { background-color: var(--success-dark); }
.btn-primary:active { transform: scale(0.99); }

.results-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; width: 100%; }
.result-card { background-color: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.margin-title { font-size: 1.05rem; font-weight: 800; color: var(--primary-color); border-bottom: 1px solid var(--border-color); padding-bottom: 0.4rem; }

.pvp-display, .net-profit { padding: 0.75rem; border-radius: var(--radius-md); text-align: center; }
.pvp-display { background-color: #f1f5f9; border-left: 4px solid var(--accent-color); }
.net-profit { background-color: #dcfce7; color: #166534; border-left: 4px solid var(--success-color); }
.pvp-display span, .net-profit span { display: block; font-size: 0.75rem; text-transform: uppercase; font-weight: 700; margin-bottom: 0.25rem; opacity: 0.9; }
.pvp-display strong { font-size: 1.35rem; color: var(--primary-color); }
.net-profit strong { font-size: 1.25rem; }

.calc-verification { padding: 0.75rem; background-color: #f8fafc; border: 1px dashed #cbd5e1; border-radius: var(--radius-md); font-size: 0.75rem; }
.v-row { display: flex; justify-content: space-between; margin-bottom: 0.25rem; }
.v-row.subtotal { border-bottom: 1px solid #e2e8f0; margin-bottom: 0.35rem; padding-bottom: 0.35rem; }
.v-row.final-profit { border-top: 1px solid #e2e8f0; margin-top: 0.35rem; padding-top: 0.35rem; font-weight: 700; color: var(--success-dark); font-size: 0.85rem; }
.deduction { color: var(--danger-color); font-weight: 600; }

@media (max-width: 992px) { 
    .main-wrapper { flex-direction: column; } 
    .sidebar { width: 100%; display: flex; flex-wrap: wrap; gap: 0.5rem; }
    .menu-title { width: 100%; }
    .menu-item { flex: 1; justify-content: center; text-align: center; margin-bottom: 0; min-width: 140px; }
}
@media (max-width: 480px) {
    .navbar { flex-direction: column; align-items: flex-start; gap: 0.75rem; padding: 1rem; }
    .navbar-controls { width: 100%; justify-content: flex-end; }
    .form-grid { grid-template-columns: 1fr; }
    .menu-item { min-width: 100%; }
}

.site-footer {
    background-color: #f1f5f9;
    padding: 24px 15px;
    text-align: center;
    font-family: Arial, sans-serif;
    color: #334155;
    border-top: 1px solid #e2e8f0;
    margin-top: auto; 
}
.footer-copyright { margin-bottom: 12px; font-weight: bold; font-size: 16px; }
.footer-contact { margin-bottom: 16px; font-size: 15px; }
.footer-contact a { color: #2563eb; text-decoration: none; transition: color 0.3s ease; }
.footer-contact a:hover { color: #1d4ed8; text-decoration: underline; }
.footer-disclaimer { font-size: 12px; color: #64748b; max-width: 800px; margin: 0 auto; line-height: 1.6; }