/* Rome Design System — Setproduct Sales Analytics Dashboard Palette
   Shared CSS for Engineering Calculator Suite
   Updated: 2026-09-23 */

:root {
    /* Color Palette */
    --bg-0: #F6F5F5;
    --bg-1: #FBFAF9;
    --bg-2: #FFFFFF;
    --panel: #FFFFFF;
    --grid-line: rgba(9, 9, 10, 0.05);
    --grid-line-strong: rgba(9, 9, 10, 0.08);
    --border: #EAE7E5;
    --border-soft: #F0EEEC;
    --text-hi: #09090A;
    --text-mid: #5A5D61;
    --text-dim: #9A9CA1;
    --text-dim2: #9A9CA1;
    
    /* Data & Status Colors */
    --amber: #EB3935;           /* Danger/Critical */
    --amber-soft: rgba(235, 57, 53, 0.10);
    --cyan: #2F4046;            /* Data accent / Primary */
    --cyan-soft: rgba(47, 64, 70, 0.08);
    --peach: #E5B6A6;           /* Warning/At-Risk */
    --slate: #7D859D;           /* Secondary accent */
    --success: #3A7D5C;         /* Good/On-Track */
    --danger: #EB3935;
    
    /* Typography */
    --mono: 'IBM Plex Mono', ui-monospace, monospace;
    --disp: 'Inter', sans-serif;
    --body: 'Inter', sans-serif;
    
    /* Spacing & Radius */
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 9px;
    
    /* Shadows */
    --shadow-card: 0 1px 2px rgba(9, 9, 10, 0.04), 0 10px 30px -12px rgba(9, 9, 10, 0.10);
    --shadow-soft: 0 1px 2px rgba(9, 9, 10, 0.03);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

/* Base Styles */
body {
    background: var(--bg-0);
    color: var(--text-hi);
    font-family: var(--body);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

::selection {
    background: var(--peach);
    color: var(--text-hi);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-0);
}

::-webkit-scrollbar-thumb {
    background: #D8D5D2;
    border-radius: 6px;
}

/* Container & Layout */
.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px 60px;
}

.app-header {
    margin-bottom: 24px;
}

.app-header h1 {
    font-family: var(--disp);
    font-weight: 800;
    font-size: 28px;
    letter-spacing: -0.02em;
    color: var(--text-hi);
    margin: 0;
}

.app-header .app-subtitle {
    font-family: var(--body);
    font-size: 13.5px;
    color: var(--text-mid);
    margin: 6px 0 0;
}

/* Logo Styling */
.logo-link {
    display: inline-block;
    margin-bottom: 16px;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.logo-link:hover {
    transform: scale(1.05);
}

.logo {
    width: 128px;
    height: 128px;
    display: block;
    border-radius: 8px;
    object-fit: contain;
}

@media (max-width: 900px) {
    .logo {
        width: 100px;
        height: 100px;
    }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--text-hi);
    flex-wrap: wrap;
}

.tab {
    padding: 12px 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-dim);
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: all 0.12s;
}

.tab:hover {
    background: #fff;
    color: var(--text-mid);
}

.tab.active {
    background: var(--text-hi);
    color: #fff;
    border-color: var(--text-hi);
}

/* Panels & Cards */
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-top: none;
    padding: 20px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
}

.card-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-mid);
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
}

/* Forms & Inputs */
.input-group {
    margin-bottom: 16px;
}

label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-mid);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 900px) {
    .input-grid {
        grid-template-columns: 1fr;
    }
}

input, select {
    font-family: var(--body);
    font-size: 12.5px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-hi);
}

input {
    background: var(--bg-1);
    width: 100%;
}

input.mono {
    font-family: var(--mono);
}

input:focus {
    border-color: var(--text-hi);
    background: #fff;
    outline: none;
}

select {
    background: white;
    cursor: pointer;
}

select:focus {
    border-color: var(--text-hi);
    outline: none;
}

/* Results & Data Display */
.result {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-left: 4px solid var(--cyan);
    padding: 14px;
    border-radius: var(--radius-sm);
    margin-top: 16px;
}

.result-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--cyan);
    font-family: var(--mono);
    margin-bottom: 3px;
}

.result-label {
    font-size: 11px;
    color: var(--text-mid);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Formulas & Reference */
.formulas, .formula-wrap {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-card);
    margin-top: 20px;
}

.formulas-title, .formula-wrap .card-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-mid);
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
}

.formula-item {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-soft);
}

.formula-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.formula-name {
    font-weight: 600;
    color: var(--text-hi);
    margin-bottom: 6px;
    font-size: 12.5px;
}

.formula-expr {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--cyan);
    background: var(--cyan-soft);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin-bottom: 6px;
}

.formula-note {
    font-size: 11.5px;
    color: var(--text-dim);
    margin-top: 4px;
    line-height: 1.5;
}

/* Info & Alert Boxes */
.info-box {
    background: #FBF3EA;
    border-left: 4px solid var(--amber);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-top: 12px;
    font-size: 11.5px;
    color: #5C3D2E;
    line-height: 1.5;
}

.info-box strong {
    color: var(--text-hi);
}

/* Grid Layouts */
.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.calc-grid.three-col {
    grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 900px) {
    .calc-grid,
    .calc-grid.three-col {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.mono {
    font-family: var(--mono);
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
