:root {
    --primary: #0f172a;
    --secondary: #2563eb;
    --bg-light: #f8fafc;
    --text-dark: #0f172a;
    --border: #e2e8f0;
    --success: #16a34a;
    --panel-border: #cbd5e1;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: #f1f5f9;
    color: var(--text-dark);
}

.container2 {
    display: flex;
    max-width: 1400px;
    margin: 2.5rem auto;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    min-height: 750px;
}


@media screen and (max-width: 470px) {
    .container2 {flex-direction:column;
}
/* Sidebar Framework */
.sidebar {
    width: 320px;
    background-color: var(--bg-light);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
}

.nav-group-title {
    padding: 0.75rem 1.75rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: #64748b;
    margin-top: 1rem;
}

.nav-btn {
    background: none;
    border: none;
    padding: 0.85rem 1.75rem;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 4px solid transparent;
}

.nav-btn:hover {
    background-color: #edf2f7;
    color: var(--secondary);
}

.nav-btn.active {
    background-color: #eff6ff;
    color: var(--secondary);
    border-left-color: var(--secondary);
}

/* Fluid Responsive Form Matrix */
.content {
    flex: 1;
    padding: 3rem;
}

.calc-section {
    display: none;
}

.calc-section.active-section {
    display: block;
    animation: fadeIn 0.25s linear;
}

h2 {
    color: var(--primary);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.formula-display {
    background-color: #f8fafc;
    padding: 0.85rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 2rem;
    font-size: 0.88rem;
    color: #475569;
}

code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-weight: 700;
    color: #be123c;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: #334155;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    font-size: 0.95rem;
    background-color: white;
    transition: all 0.2s;
}

.input-group input:focus, .input-group select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

.calc-btn {
    background-color: var(--secondary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    width: 100%;
    transition: background-color 0.2s;
}

.calc-btn:hover {
    background-color: #1d4ed8;
}

.result {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #14532d;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}