/* ---------------------------------------------------------------------------
   OR Problem Solver — custom theme on top of Bootstrap FLATLY
   --------------------------------------------------------------------------- */

:root {
    --or-primary: #2c3e50;
    --or-accent: #18bc9c;
    --or-bg: #f4f6f9;
    --sidebar-width: 250px;
}

body {
    background-color: var(--or-bg);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ---- Shell / layout ---------------------------------------------------- */
.app-shell {
    min-height: 100vh;
}

.content {
    margin-left: var(--sidebar-width);
    padding: 2rem 2.5rem;
}

/* ---- Sidebar ----------------------------------------------------------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #2c3e50 0%, #1f2d3a 100%);
    color: #ecf0f1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 0.5rem 1rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 1rem;
}

.sidebar-title {
    color: #fff;
    font-weight: 700;
    margin-bottom: 0.15rem;
    font-size: 1.6rem;
}

.sidebar-subtitle {
    color: #18bc9c;
    font-size: 0.78rem;
    margin-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-nav {
    flex-grow: 1;
}

.sidebar-section {
    color: #18bc9c;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin: 1rem 0 0.4rem 0.6rem;
    opacity: 0.85;
}

.sidebar-link {
    color: #cfd8e0 !important;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    padding: 0.6rem 0.9rem !important;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff !important;
}

.sidebar-link.active {
    background: var(--or-accent) !important;
    color: #fff !important;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 1rem;
    color: #8b9aa7;
    text-align: center;
}

/* ---- Page header ------------------------------------------------------- */
.page-header {
    margin-bottom: 1.5rem;
}

.page-title {
    font-weight: 700;
    color: var(--or-primary);
    margin-bottom: 0.25rem;
}

.page-description {
    color: #5a6b7b;
    font-size: 1.02rem;
    max-width: 70ch;
    margin-bottom: 0;
}

/* ---- KPI tiles --------------------------------------------------------- */
.kpi-card {
    border: none;
    border-left: 5px solid var(--or-primary);
    border-radius: 10px;
}

.kpi-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #7a8a99;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.kpi-value {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--or-primary);
    line-height: 1.1;
}

.kpi-primary  { border-left-color: #2c3e50; }
.kpi-success  { border-left-color: #18bc9c; }
.kpi-info     { border-left-color: #3498db; }
.kpi-warning  { border-left-color: #f39c12; }
.kpi-danger   { border-left-color: #e74c3c; }

/* ---- Cards ------------------------------------------------------------- */
.card {
    border: none;
    border-radius: 10px;
}

.card-header {
    background: #fff;
    border-bottom: 2px solid #eef1f4;
    font-weight: 600;
    color: var(--or-primary);
}

/* ---- Home section headers ---------------------------------------------- */
.home-section-title {
    font-weight: 700;
    color: var(--or-primary);
    margin-bottom: 0.1rem;
    padding-bottom: 0.4rem;
    border-bottom: 3px solid var(--or-accent);
    display: inline-block;
}

/* ---- Home module cards ------------------------------------------------- */
.module-card {
    border-radius: 12px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    height: 100%;
    text-decoration: none;
    color: inherit;
    display: block;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.7rem 1.5rem rgba(44, 62, 80, 0.18) !important;
    color: inherit;
}

.module-icon {
    font-size: 2.4rem;
    line-height: 1;
    margin-bottom: 0.6rem;
}

/* ---- Explainer panel --------------------------------------------------- */
.explainer .accordion-button {
    font-weight: 600;
    color: var(--or-primary);
    background: #eef6f4;
}

.explainer .accordion-button:not(.collapsed) {
    color: #fff;
    background: var(--or-primary);
    box-shadow: none;
}

.explainer .accordion-button:focus {
    box-shadow: none;
}

.explainer-head {
    font-weight: 700;
    color: var(--or-accent);
    margin-bottom: 0.5rem;
}

.explainer-text {
    color: #44525f;
    font-size: 0.92rem;
    margin-bottom: 0.5rem;
}

.explainer-steps {
    color: #44525f;
    font-size: 0.9rem;
    padding-left: 1.1rem;
    margin-bottom: 0;
}

.explainer-steps li {
    margin-bottom: 0.25rem;
}

.explainer-note {
    font-size: 0.85rem;
    margin-bottom: 0;
}

/* ---- AG Grid sizing ---------------------------------------------------- */
.ag-theme-alpine {
    --ag-header-background-color: #f4f6f9;
    --ag-odd-row-background-color: #fbfcfd;
}

/* ---- Responsive: collapse sidebar on small screens -------------------- */
@media (max-width: 768px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        flex-direction: column;
    }
    .content {
        margin-left: 0;
        padding: 1.25rem;
    }
}
