/* TreeIQ Feeds Portal — single self-contained CSS */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #F5F7FB;
    color: #0F172A;
    font-size: 14px;
    line-height: 1.5;
}
a { color: #4A6CF7; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}
.sidebar {
    background: #1E293B;
    color: #CBD5E1;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 20px;
    border-bottom: 1px solid #334155;
    color: #F1F5F9;
    font-weight: 700;
    font-size: 1.05rem;
}
.sidebar nav {
    flex: 1;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
}
.sidebar nav a {
    color: #94A3B8;
    padding: 10px 20px;
    text-decoration: none;
    font-size: .9rem;
    border-left: 3px solid transparent;
    transition: all .12s;
}
.sidebar nav a:hover {
    color: #F1F5F9;
    background: rgba(148,163,184,.05);
}
.sidebar nav a.active {
    color: #15803D;
    background: rgba(21,128,61,.08);
    border-left-color: #15803D;
    font-weight: 600;
}
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid #334155;
}
.user-info { margin-bottom: 8px; }
.user-name { color: #F1F5F9; font-weight: 600; font-size: .85rem; }
.user-role { color: #64748B; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.logout {
    display: inline-block;
    color: #94A3B8;
    font-size: .78rem;
    margin-top: 6px;
}
.logout:hover { color: #F87171; }

.content { display: flex; flex-direction: column; min-width: 0; }
.content-header {
    background: #FFFFFF;
    border-bottom: 1px solid #E2E8F0;
    padding: 24px 32px;
}
.content-header h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0F172A;
}
.content-header .subtitle {
    color: #64748B;
    font-size: .85rem;
    margin-top: 4px;
}
.content-body { flex: 1; padding: 28px 32px; overflow-x: auto; }
.content-footer {
    background: #FFFFFF;
    border-top: 1px solid #E2E8F0;
    padding: 16px 32px;
    color: #94A3B8;
    font-size: .74rem;
    display: flex;
    justify-content: space-between;
}

/* Cards */
.card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.card h2 {
    font-size: .92rem;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #E2E8F0;
}

/* KPI grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.kpi-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 16px 18px;
}
.kpi-label {
    font-size: .68rem;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 700;
}
.kpi-value {
    font-size: 1.65rem;
    font-weight: 700;
    color: #0F172A;
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}
.kpi-sub {
    font-size: .74rem;
    color: #64748B;
    margin-top: 4px;
}

/* Tables */
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}
table.data thead th {
    background: #F8FAFC;
    color: #475569;
    text-transform: uppercase;
    font-size: .68rem;
    letter-spacing: .05em;
    font-weight: 700;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid #E2E8F0;
}
table.data tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid #F1F5F9;
    color: #334155;
}
table.data tbody tr:hover { background: #F8FAFC; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 4px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: .85rem;
    font-weight: 600;
    border: 1px solid #4A6CF7;
    background: #4A6CF7;
    color: #FFFFFF;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
}
.btn:hover { background: #3b54c9; text-decoration: none; }
.btn-ghost {
    background: transparent;
    color: #4A6CF7;
}
.btn-ghost:hover { background: rgba(74,108,247,.06); }
.btn-sm { padding: 5px 11px; font-size: .76rem; }

/* Login page */
.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #F5F7FB;
}
.login-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 36px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
.login-card .brand {
    border: none;
    padding: 0 0 18px;
    color: #0F172A;
    justify-content: center;
}
.login-card h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 18px;
    text-align: center;
}
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    font-size: .76rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
}
.form-group input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #CBD5E1;
    border-radius: 6px;
    font-size: .9rem;
    color: #0F172A;
}
.form-group input:focus {
    outline: none;
    border-color: #4A6CF7;
    box-shadow: 0 0 0 3px rgba(74,108,247,.1);
}
.error {
    background: #FEF2F2;
    color: #991B1B;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid #FECACA;
    font-size: .82rem;
    margin-bottom: 14px;
}

/* Sparkline / mini-chart */
.sparkline {
    width: 100%;
    height: 28px;
    display: block;
}
