/* CFIB Toolbox — Site Styles */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700;800&display=swap');

:root {
    --cfib-red: #C41230;
    --cfib-red-dark: #9e0e26;
    --cfib-red-light: #e8192f;
    --cfib-blue: #0076BB;
    --sidebar-width: 240px;
    --sidebar-bg: #0076BB;
    --sidebar-text: #000000;
    --sidebar-active: #000000;
    --sidebar-section: rgba(255,255,255,0.85);
    --content-bg: #f4f5f7;
}

/* ─── Layout ─────────────────────────────────────────────────── */
html, body { height: 100%; margin: 0; font-family: 'Source Sans 3', 'Segoe UI', sans-serif; font-size: 18px; }

#wrapper { min-height: 100vh; }

/* ─── Sidebar ─────────────────────────────────────────────────── */
#sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
}

.sidebar-header {
    background: #fff;
    padding: 14px 20px 10px;
}

.cfib-logo {
    font-size: 26px;
    font-weight: 800;
    color: var(--cfib-blue);
    letter-spacing: 3px;
}

.sidebar-subtitle {
    font-size: 11px;
    color: #555;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 4px;
}

.sidebar-nav {
    list-style: none;
    padding: 12px 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav li.nav-section {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--sidebar-section);
    padding: 14px 20px 4px;
    font-weight: 700;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}

.sidebar-nav li a:hover {
    background: rgba(0,0,0,0.1);
    color: #000;
}

.sidebar-nav li a.active {
    background: rgba(0,0,0,0.15);
    color: #000;
    font-weight: 600;
    border-left-color: #fff;
}

.nav-icon { font-size: 15px; opacity: 0.75; }

.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
}

.sidebar-user {
    font-size: 12px;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.logout-link {
    font-size: 12px;
    color: var(--cfib-red);
    text-decoration: none;
}

.logout-link:hover { text-decoration: underline; }

/* ─── Content ─────────────────────────────────────────────────── */
#content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--content-bg);
    flex: 1;
}

.content-inner { padding: 32px 36px; max-width: 1100px; }

/* ─── Page Header ─────────────────────────────────────────────── */
.page-header {
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e0e0e0;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: #222;
    margin: 0;
}

.page-header p {
    margin: 4px 0 0;
    color: #666;
    font-size: 16px;
}

/* ─── Cards ───────────────────────────────────────────────────── */
.card { border: none; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); margin-bottom: 20px; }
.card-header { background: #fff; border-bottom: 1px solid #eee; font-weight: 600; font-size: 16px; border-radius: 8px 8px 0 0 !important; padding: 14px 20px; }

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn-cfib {
    background: var(--cfib-red);
    color: #fff;
    border: none;
    padding: 10px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-cfib:hover { background: var(--cfib-red-dark); color: #fff; }
.btn-cfib:disabled { background: #aaa; cursor: not-allowed; }

/* ─── Login Page ──────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cfib-blue);
}

.login-box {
    background: #fff;
    border-radius: 10px;
    padding: 40px 44px;
    width: 380px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.login-logo {
    font-size: 32px;
    font-weight: 800;
    color: var(--cfib-red);
    letter-spacing: 4px;
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 13px;
    color: #888;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 28px;
}

.login-box label { font-size: 15px; font-weight: 600; color: #444; }
.login-box input { border-radius: 5px; font-size: 16px; }
.login-box input:focus { border-color: var(--cfib-red); box-shadow: 0 0 0 3px rgba(196,18,48,0.12); }

.login-error {
    background: #fff0f2;
    border: 1px solid #f5c0c8;
    color: var(--cfib-red-dark);
    border-radius: 5px;
    padding: 10px 14px;
    font-size: 15px;
    margin-bottom: 16px;
}

/* ─── Summary Stats ───────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-box {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.stat-box .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #222;
    line-height: 1;
}

.stat-box .stat-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 6px;
}

.stat-box.ok .stat-value  { color: #1e8a4a; }
.stat-box.fail .stat-value { color: var(--cfib-red); }
.stat-box.warn .stat-value { color: #c47a12; }

/* ─── Results Table ───────────────────────────────────────────── */
.results-table { font-size: 15px; }
.results-table th { background: #f0f0f3; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; color: #555; font-weight: 600; }
.members-table { min-width: 1280px; }
.members-table td { vertical-align: middle; white-space: nowrap; }
.badge-ok   { background: #d4f5e2; color: #1a7a42; border-radius: 4px; padding: 2px 8px; font-size: 13px; font-weight: 600; }
.badge-fail { background: #fde0e5; color: #9e0e26; border-radius: 4px; padding: 2px 8px; font-size: 13px; font-weight: 600; }
.badge-skip { background: #f0f0f0; color: #666;    border-radius: 4px; padding: 2px 8px; font-size: 13px; font-weight: 600; }
.badge-warn { background: #fff3cd; color: #856404; border-radius: 4px; padding: 2px 8px; font-size: 13px; font-weight: 600; }

/* ─── Issues List ─────────────────────────────────────────────── */
.issue-list { font-size: 14px; color: #9e0e26; margin: 0; padding-left: 16px; }

/* ─── Log ─────────────────────────────────────────────────────── */
.log-box {
    background: #1e1e2d;
    color: #c4c4d0;
    border-radius: 6px;
    padding: 16px 18px;
    font-family: 'Consolas', monospace;
    font-size: 13px;
    max-height: 320px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ─── Loading ─────────────────────────────────────────────────── */
#loadingOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    gap: 16px;
}

.spinner {
    width: 48px; height: 48px;
    border: 5px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
