/* ══════════════════════════════
   TOKENS — match landing page
══════════════════════════════ */
:root {
    --brand: #0099CC;
    --brand-l: #33bbee;
    --brand-dim: rgba(0, 153, 204, 0.10);
    --brand-border: rgba(0, 153, 204, 0.22);
    --sidebar-w: 240px;
    --topbar-h: 56px;
}

[data-theme="dark"] {
    --bg: #07090c;
    --bg2: #0c1017;
    --card: #0f151d;
    --card2: #141c26;
    --border: rgba(255, 255, 255, 0.07);
    --text: #d8e4ee;
    --muted: #5d7080;
    --muted2: #3a4f60;
    --head: #fff;
    --sidebar-bg: #09111a;
    --topbar-bg: rgba(9, 17, 26, 0.92);
    --shadow: rgba(0, 0, 0, 0.5);
    --input-bg: #0c1320;
    --overlay: rgba(0, 0, 0, 0.65);
    --report-bg: #111922;
    --report-text: #d8e4ee;
}

[data-theme="light"] {
    --bg: #f0f4f8;
    --bg2: #e6ecf3;
    --card: #fff;
    --card2: #f5f8fc;
    --border: rgba(0, 0, 0, 0.08);
    --text: #2d3a4a;
    --muted: #6b7f94;
    --muted2: #a0b0bf;
    --head: #0d1a26;
    --sidebar-bg: #fff;
    --topbar-bg: rgba(255, 255, 255, 0.94);
    --shadow: rgba(0, 0, 0, 0.10);
    --input-bg: #f4f7fb;
    --overlay: rgba(0, 0, 0, 0.45);
    --report-bg: #fff;
    --report-text: #1a2535;
}

/* ══════════════════════════════
   BASE
══════════════════════════════ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background .3s, color .3s;
}

/* ══════════════════════════════
   SSO LOGIN PAGE
══════════════════════════════ */
.sso-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.sso-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(0, 153, 204, 0.022) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 153, 204, 0.022) 1px, transparent 1px);
    background-size: 52px 52px;
    pointer-events: none;
}

.sso-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(0, 153, 204, 0.08) 0%, transparent 65%);
    pointer-events: none;
}

.sso-card {
    position: relative;
    z-index: 1;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px 44px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 64px var(--shadow);
    text-align: center;
}

.sso-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 32px;
}

.sso-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--brand);
    border-radius: 10px;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.sso-logo-icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.sso-logo-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--head);
    letter-spacing: -0.5px;
}

.sso-logo-text .ai {
    color: var(--brand);
}

.sso-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 5px 12px;
    border: 1px solid var(--brand-border);
    border-radius: 20px;
    background: var(--brand-dim);
    margin-bottom: 24px;
}

.sso-card h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--head);
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.sso-card p {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 32px;
}

.sso-btn {
    width: 100%;
    padding: 15px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all .2s;
    margin-bottom: 16px;
}

.sso-btn:hover {
    background: var(--brand-l);
    box-shadow: 0 8px 24px rgba(0, 153, 204, .3);
}

.sso-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.sso-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    font-size: 12px;
    color: var(--muted2);
}

.sso-divider::before,
.sso-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.sso-demo-note {
    font-size: 12px;
    color: var(--muted);
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    line-height: 1.6;
}

.sso-footer {
    margin-top: 24px;
    font-size: 12px;
    color: var(--muted2);
}

.sso-footer a {
    color: var(--brand);
    text-decoration: none;
}

/* Loading state */
.sso-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.sso-loading.show {
    display: flex;
}

.sso-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--brand-dim);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

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

.sso-loading p {
    font-size: 14px;
    color: var(--muted);
    font-weight: 500;
}

/* ══════════════════════════════
   APP SHELL
══════════════════════════════ */
.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform .3s, background .3s;
}

.sidebar-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo-icon {
    width: 30px;
    height: 30px;
    background: var(--brand);
    border-radius: 7px;
    display: grid;
    place-items: center;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-logo-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.sidebar-logo-text {
    font-size: 17px;
    font-weight: 800;
    color: var(--head);
}

.sidebar-logo-text .ai {
    color: var(--brand);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.sidebar-section {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--muted2);
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 14px 10px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    transition: all .18s;
    margin-bottom: 2px;
    user-select: none;
}

.nav-item i {
    font-size: 17px;
    flex-shrink: 0;
}

.nav-item:hover {
    color: var(--brand);
    background: var(--brand-dim);
}

.nav-item.active {
    color: var(--brand);
    background: var(--brand-dim);
    font-weight: 600;
}

.nav-item .nav-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    background: #f87171;
    color: #fff;
    border-radius: 10px;
    padding: 1px 7px;
    min-width: 18px;
    text-align: center;
}

.sidebar-footer {
    padding: 14px 10px;
    border-top: 1px solid var(--border);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 9px;
    cursor: pointer;
    transition: background .18s;
}

.user-chip:hover {
    background: var(--card2);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), #005577);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.user-info {
    min-width: 0;
}

.user-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--head);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 10.5px;
    color: var(--muted);
}

/* Top bar */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    height: var(--topbar-h);
    background: var(--topbar-bg);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    flex-shrink: 0;
    gap: 16px;
    position: relative;
    z-index: 300;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--head);
}

.topbar-period {
    font-size: 12px;
    color: var(--muted);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 5px 12px;
    cursor: pointer;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 16px;
    position: relative;
    transition: all .18s;
}

.topbar-btn:hover {
    color: var(--brand);
    border-color: var(--brand-border);
}

.topbar-btn .notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    background: #f87171;
    border-radius: 50%;
    border: 1.5px solid var(--topbar-bg);
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    color: #4ade80;
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: 20px;
    padding: 4px 10px;
}

.live-dot {
    width: 5px;
    height: 5px;
    background: #4ade80;
    border-radius: 50%;
    animation: livepulse 2s infinite;
}

@keyframes livepulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .3;
    }
}

.hamburger-btn {
    display: none;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    place-items: center;
    font-size: 18px;
}

/* Content */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* ══════════════════════════════
   CARDS + LAYOUT
══════════════════════════════ */
.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--head);
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.page-sub {
    font-size: 13px;
    color: var(--muted);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.kpi-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    transition: border-color .2s;
}

.kpi-card:hover {
    border-color: var(--brand-border);
}

.kpi-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kpi-label i {
    font-size: 13px;
}

.kpi-value {
    font-size: 26px;
    font-weight: 900;
    color: var(--head);
    letter-spacing: -1px;
    line-height: 1;
}

.kpi-value.brand {
    color: var(--brand);
}

.kpi-sub {
    font-size: 11px;
    margin-top: 5px;
}

.kpi-sub.up {
    color: #f87171;
}

.kpi-sub.dn {
    color: #4ade80;
}

.kpi-sub.neutral {
    color: var(--muted);
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--head);
}

.card-body {
    padding: 20px;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.three-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
}

.chip-green {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.chip-red {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.chip-yellow {
    background: rgba(250, 204, 21, 0.1);
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.2);
}

.chip-blue {
    background: var(--brand-dim);
    color: var(--brand);
    border: 1px solid var(--brand-border);
}

.chip-gray {
    background: rgba(100, 120, 140, 0.1);
    color: var(--muted);
    border: 1px solid var(--border);
}

/* ══════════════════════════════
   CHARTS
══════════════════════════════ */
.chart-wrap {
    position: relative;
}

.chart-tooltip {
    position: absolute;
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 11px;
    color: var(--text);
    pointer-events: none;
    z-index: 10;
    display: none;
    box-shadow: 0 4px 16px var(--shadow);
}

.chart-tooltip strong {
    color: var(--head);
    display: block;
    font-size: 12px;
    margin-bottom: 2px;
}

/* ══════════════════════════════
   TEAM BARS
══════════════════════════════ */
.team-table {
    width: 100%;
}

.team-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.team-row:last-child {
    border-bottom: none;
}

.team-name {
    width: 120px;
    flex-shrink: 0;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--head);
}

.team-bar-wrap {
    flex: 1;
    background: var(--bg2);
    border-radius: 6px;
    height: 22px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.team-bar {
    height: 100%;
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    transition: width .6s ease;
}

.team-bar span {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    white-space: nowrap;
}

.team-amt {
    width: 58px;
    text-align: right;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.team-pct {
    width: 38px;
    text-align: right;
    font-size: 11px;
    color: var(--muted);
    flex-shrink: 0;
}

/* ══════════════════════════════
   ALERTS
══════════════════════════════ */
.alert-feed {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid;
    cursor: pointer;
    transition: opacity .18s;
}

.alert-item:hover {
    opacity: .85;
}

.alert-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.alert-body h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--head);
    margin-bottom: 3px;
}

.alert-body p {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.55;
}

.alert-meta {
    margin-top: 5px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.alert-time {
    font-size: 11px;
    color: var(--muted2);
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

.alert-critical {
    background: rgba(248, 113, 113, 0.05);
    border-color: rgba(248, 113, 113, 0.25);
}

.alert-warning {
    background: rgba(250, 204, 21, 0.05);
    border-color: rgba(250, 204, 21, 0.2);
}

.alert-info {
    background: rgba(0, 153, 204, 0.05);
    border-color: var(--brand-border);
}

.alert-success {
    background: rgba(74, 222, 128, 0.04);
    border-color: rgba(74, 222, 128, 0.2);
}

/* ══════════════════════════════
   BOARD REPORT
══════════════════════════════ */
.report-doc {
    background: var(--report-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    max-width: 860px;
    margin: 0 auto;
}

.report-cover {
    background: linear-gradient(135deg, #0099CC, #005577);
    padding: 44px 52px;
    color: #fff;
}

.report-cover h1 {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.report-cover p {
    font-size: 15px;
    opacity: .85;
    margin-bottom: 20px;
}

.report-meta {
    display: flex;
    gap: 28px;
}

.report-meta-item label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: .7;
    display: block;
    margin-bottom: 4px;
}

.report-meta-item span {
    font-size: 14px;
    font-weight: 700;
}

.report-body {
    padding: 40px 52px;
}

.report-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 32px;
}

.report-kpi {
    background: var(--card2);
    padding: 18px 20px;
    text-align: center;
}

.rk-v {
    font-size: 22px;
    font-weight: 900;
    color: var(--brand);
    letter-spacing: -0.5px;
}

.rk-l {
    font-size: 10px;
    color: var(--muted);
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.report-section {
    margin-bottom: 32px;
}

.report-section h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--head);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--brand);
    display: inline-block;
}

.report-insight {
    padding: 14px 18px;
    background: rgba(74, 222, 128, 0.05);
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: 9px;
    font-size: 13px;
    color: var(--report-text);
    line-height: 1.7;
    margin-bottom: 10px;
}

.report-insight strong {
    color: #4ade80;
}

.report-warning {
    padding: 14px 18px;
    background: rgba(248, 113, 113, 0.05);
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: 9px;
    font-size: 13px;
    color: var(--report-text);
    line-height: 1.7;
    margin-bottom: 10px;
}

.report-warning strong {
    color: #f87171;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.report-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
}

.report-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.report-table tr:last-child td {
    border-bottom: none;
}

.report-footer {
    padding: 24px 52px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 11.5px;
    color: var(--muted);
}

.export-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.export-bar h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--head);
}

/* ══════════════════════════════
   RECOMMENDATIONS
══════════════════════════════ */
.rec-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.rec-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    position: relative;
    transition: all .2s;
}

.rec-card:hover {
    border-color: var(--brand-border);
    transform: translateY(-1px);
}

.rec-card.featured {
    border-color: var(--brand);
    background: linear-gradient(145deg, rgba(0, 153, 204, 0.06), var(--card));
}

.rec-type {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rec-card h3 {
    font-size: 15px;
    font-weight: 800;
    color: var(--head);
    margin-bottom: 8px;
    letter-spacing: -0.2px;
}

.rec-card p {
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 14px;
}

.rec-saving {
    font-size: 24px;
    font-weight: 900;
    color: #4ade80;
    letter-spacing: -0.5px;
}

.rec-saving-label {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

.rec-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    font-size: 12px;
    font-weight: 700;
    color: var(--brand);
    background: var(--brand-dim);
    border: 1px solid var(--brand-border);
    border-radius: 7px;
    padding: 8px 14px;
    cursor: pointer;
    transition: all .18s;
}

.rec-action:hover {
    background: var(--brand);
    color: #fff;
}

.rec-tag {
    position: absolute;
    top: 16px;
    right: 16px;
}

/* ══════════════════════════════
   INTEGRATIONS
══════════════════════════════ */
.int-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 28px;
}

.int-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px;
    transition: all .2s;
}

.int-card.connected {
    border-color: rgba(74, 222, 128, 0.3);
}

.int-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.int-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.int-logo i {
    font-size: 24px;
    color: var(--head);
}

.int-logo-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--head);
}

.int-body {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
}

.int-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.int-stat-row:last-child {
    border-bottom: none;
}

.int-stat-label {
    color: var(--muted);
}

.int-stat-value {
    color: var(--head);
    font-weight: 600;
}

.int-actions {
    margin-top: 14px;
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 7px 14px;
    border-radius: 7px;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all .2s;
}

.btn-primary-sm {
    background: var(--brand);
    color: #fff;
}

.btn-primary-sm:hover {
    background: var(--brand-l);
}

.btn-ghost-sm {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-ghost-sm:hover {
    border-color: var(--brand-border);
    color: var(--brand);
}

.btn-danger-sm {
    background: transparent;
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-danger-sm:hover {
    background: rgba(248, 113, 113, 0.08);
}

.model-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.model-pill {
    font-size: 10px;
    font-weight: 600;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 2px 8px;
    color: var(--muted);
    font-family: monospace;
}

/* ══════════════════════════════
   ALERTS DROPDOWN
══════════════════════════════ */
.alerts-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 380px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 16px 48px var(--shadow);
    z-index: 9999;
    overflow: hidden;
    animation: modalIn .18s ease;
}

.alerts-dropdown.open {
    display: flex;
    flex-direction: column;
}

.alerts-dd-header {
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.alerts-dd-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--head);
}

.alerts-dd-count {
    font-size: 10px;
    font-weight: 700;
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.25);
    border-radius: 20px;
    padding: 2px 8px;
}

.alerts-dd-clear {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--brand);
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    padding: 0;
    transition: opacity .15s;
}

.alerts-dd-clear:hover {
    opacity: .7;
}

.alerts-dd-feed {
    overflow-y: auto;
    max-height: 420px;
    display: flex;
    flex-direction: column;
}

.dd-alert-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background .15s;
    position: relative;
}

.dd-alert-item:last-child {
    border-bottom: none;
}

.dd-alert-item:hover {
    background: var(--card2);
}

.dd-alert-item.read {
    opacity: .55;
}

.dd-alert-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.dd-alert-body h5 {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--head);
    margin-bottom: 3px;
    line-height: 1.4;
}

.dd-alert-body p {
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dd-alert-time {
    font-size: 10px;
    color: var(--muted2);
    white-space: nowrap;
    margin-left: auto;
    flex-shrink: 0;
    padding-top: 1px;
}

.dd-unread-dot {
    position: absolute;
    top: 16px;
    right: 14px;
    width: 6px;
    height: 6px;
    background: var(--brand);
    border-radius: 50%;
}

.alerts-dd-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    text-align: center;
    flex-shrink: 0;
}

.alerts-dd-footer button {
    font-size: 12px;
    font-weight: 600;
    color: var(--brand);
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: opacity .15s;
}

.alerts-dd-footer button:hover {
    opacity: .7;
}

@media (max-width: 480px) {
    .alerts-dropdown {
        width: calc(100vw - 32px);
        right: -60px;
    }
}

/* ══════════════════════════════
   CONNECT MODAL
══════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    background: var(--overlay);
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 24px 64px var(--shadow);
    animation: modalIn .2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.98);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.modal-head {
    padding: 24px 24px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.modal-head h3 {
    font-size: 17px;
    font-weight: 800;
    color: var(--head);
    letter-spacing: -0.3px;
}

.modal-head p {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 4px;
}

.modal-close {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 14px;
    display: grid;
    place-items: center;
}

.modal-close:hover {
    color: var(--head);
    background: var(--card2);
}

.modal-body {
    padding: 20px 24px;
}

.field {
    margin-bottom: 16px;
}

.field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    display: block;
    margin-bottom: 6px;
}

.field label span {
    color: var(--brand);
}

.field input,
.field select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: var(--text);
    transition: border-color .2s;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-dim);
}

.field input::placeholder {
    color: var(--muted2);
}

.field .field-hint {
    font-size: 11px;
    color: var(--muted);
    margin-top: 5px;
}

.modal-foot {
    padding: 14px 24px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Test connection states */
.connect-progress {
    display: none;
    padding: 16px 0;
}

.connect-progress.show {
    display: block;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    color: var(--muted);
    padding: 6px 0;
}

.progress-step.done {
    color: #4ade80;
}

.progress-step.active {
    color: var(--brand);
}

.progress-step i {
    font-size: 15px;
    flex-shrink: 0;
}

/* ══════════════════════════════
   THEME TOGGLE (compact for topbar)
══════════════════════════════ */
.theme-toggle-sm {
    display: flex;
    align-items: center;
    gap: 3px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3px;
}

.tt-sm {
    width: 24px;
    height: 24px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 11px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all .18s;
    color: var(--muted);
}

.tt-sm.active {
    background: var(--brand);
    color: #fff;
}

/* ══════════════════════════════
   PLATFORM MINI CARDS (overview)
══════════════════════════════ */
.platform-mini {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    transition: border-color .2s;
}

.platform-mini:hover {
    border-color: var(--brand-border);
}

.pm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.pm-logo {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--head);
}

.pm-logo i {
    font-size: 18px;
}

.pm-cost {
    font-size: 19px;
    font-weight: 900;
    color: var(--head);
    letter-spacing: -0.5px;
    margin-bottom: 3px;
}

.pm-trend {
    font-size: 10.5px;
}

.pm-models {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */
@media(max-width:860px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 300;
        transform: translateX(-100%);
        width: 260px;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px var(--shadow);
    }

    .hamburger-btn {
        display: grid;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rec-grid,
    .int-grid,
    .two-col,
    .three-col {
        grid-template-columns: 1fr;
    }

    .report-kpis {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-area {
        padding: 16px;
    }

    .report-body,
    .report-cover,
    .report-footer {
        padding-left: 24px;
        padding-right: 24px;
    }
}

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

    .topbar {
        padding: 0 14px;
    }
}