/* ──────────────────────────────────────────────────────────────────────
   Insight Studio — Design system
   Inter, slate-on-white, vibrant accents, smooth animations.
   ────────────────────────────────────────────────────────────────────── */

:root {
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', 'JetBrains Mono', ui-monospace, monospace;

    --primary: #18181B;
    --primary-hover: #27272A;
    --primary-light: rgba(24, 24, 27, 0.04);
    --secondary: #52525B;
    --accent: #18181B;
    --accent-hover: #27272A;

    --bg: #FAFAFA;
    --card-bg: #FFFFFF;
    --surface-muted: #F4F4F5;
    --surface-hover: #FAFAFA;

    --text-main: #18181B;
    --text-secondary: #3F3F46;
    --text-light: #71717A;
    --text-disabled: #A1A1AA;

    --success: #18181B;
    --success-bg: #F4F4F5;
    --success-border: #D4D4D8;
    --danger: #DC2626;
    --danger-bg: #FEF2F2;
    --danger-border: #FECACA;
    --warning: #DC2626;
    --warning-bg: #FEF2F2;
    --warning-border: #FECACA;

    --border: #E4E4E7;
    --border-strong: #D4D4D8;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04);

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    --header-height: 56px;

    /* Animation timing */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-primary);
    color: var(--text-main);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    background: linear-gradient(
        135deg,
        #FAFAFA 0%,
        #F0F4FF 25%,
        #FDF2F8 50%,
        #F0FDF4 75%,
        #FAFAFA 100%
    );
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

a { color: inherit; }

/* ── Title bar ─────────────────────────────────────────────────────── */
.title-bar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    z-index: 1000;
}
.title-bar-content {
    max-width: 1440px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.title-bar img.logo { height: 24px; width: auto; display: block; }

.title-bar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 24px;
}
.nav-link {
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s var(--ease-out-expo);
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 14px;
    right: 14px;
    height: 1px;
    background: var(--text-main);
    border-radius: 1px;
    transform: scaleX(0);
    transition: transform 0.2s var(--ease-out-expo);
}
.nav-link:hover { background: var(--surface-muted); color: var(--text-main); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link.active { color: var(--text-main); background: var(--surface-muted); font-weight: 600; }
.nav-link.active::after { transform: scaleX(1); }

.title-bar-spacer { flex: 1; }
.auth-controls { display: flex; align-items: center; }

/* User dropdown */
.user-dropdown { position: relative; }
.user-button {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 10px 5px 5px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 0.8125rem; font-weight: 500;
    color: var(--text-secondary);
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.user-button:hover { background-color: var(--surface-muted); color: var(--text-main); }
.user-button:focus-visible {
    outline: none;
    border-color: var(--text-main);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}
.user-button > span {
    max-width: 160px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}
.user-button svg { color: var(--text-light); transition: transform 0.15s; }
.user-button[aria-expanded="true"] svg.chevron { transform: rotate(180deg); }

.user-avatar, .user-avatar-placeholder {
    width: 26px; height: 26px;
    border-radius: 50%; object-fit: cover; flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}
.user-avatar-placeholder {
    background: var(--accent); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.02em;
}

.dropdown-content {
    position: absolute; top: calc(100% + 6px); right: 0;
    min-width: 240px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    overflow: hidden;
    z-index: 1001;
}
.dropdown-content.show { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-header {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-muted);
}
.dropdown-avatar, .dropdown-avatar-placeholder {
    grid-row: 1 / span 2;
    width: 36px; height: 36px;
    border-radius: 50%; object-fit: cover;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}
.dropdown-avatar-placeholder {
    background: var(--accent); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.875rem; font-weight: 600;
}
.dropdown-name {
    font-size: 0.875rem; font-weight: 600;
    color: var(--text-main); line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dropdown-email {
    font-size: 0.75rem; font-weight: 400;
    color: var(--text-light); line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dropdown-menu { padding: 4px; }
.dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    color: var(--text-secondary); text-decoration: none;
    font-size: 0.8125rem; font-weight: 500;
    border-radius: var(--radius-sm);
    transition: background-color 0.12s, color 0.12s;
}
.dropdown-item svg { color: var(--text-light); transition: color 0.12s; flex-shrink: 0; }
.dropdown-item:hover { background-color: var(--surface-muted); color: var(--text-main); }
.dropdown-item:hover svg { color: var(--text-secondary); }
.dropdown-item.signout:hover { background-color: var(--danger-bg); color: var(--danger); }
.dropdown-item.signout:hover svg { color: var(--danger); }
.dropdown-divider { height: 1px; background-color: var(--border); margin: 4px 0; }

/* ── Main layout ───────────────────────────────────────────────────── */
.main-content { padding-top: var(--header-height); }

.page-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}
.page-container.narrow { max-width: 720px; }
.page-container.wide { max-width: 1280px; }

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.page-header-text { flex: 1; min-width: 0; }
.page-eyebrow {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}
.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.025em;
    line-height: 1.2;
    margin: 0 0 8px 0;
}
.page-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}
.page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-bottom: 14px;
}
.breadcrumb a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.12s;
}
.breadcrumb a:hover { color: var(--text-main); }
.breadcrumb-sep { color: var(--text-disabled); }
.breadcrumb-current { color: var(--text-main); font-weight: 500; }

/* ── Card ──────────────────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.card + .card { margin-top: 16px; }
.card-section { padding: 24px 28px; }
.card-section + .card-section { border-top: 1px solid var(--border); }
.card-section-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 14px 0;
}
.card-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 4px 0;
    letter-spacing: -0.01em;
}
.card-section-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 18px 0;
    line-height: 1.55;
}

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn:disabled, .btn[aria-disabled="true"] {
    opacity: 0.5; pointer-events: none; cursor: not-allowed;
}
.btn svg { flex-shrink: 0; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}
.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px var(--primary);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-secondary);
    border-color: var(--border-strong);
}
.btn-secondary:hover {
    background: var(--surface-muted);
    color: var(--text-main);
}
.btn-secondary:focus-visible {
    outline: none;
    border-color: var(--text-main);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--surface-muted); color: var(--text-main); }

.btn-danger-ghost {
    background: transparent;
    color: var(--text-light);
    border-color: transparent;
}
.btn-danger-ghost:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.btn-sm { padding: 5px 10px; font-size: 0.8125rem; gap: 6px; }
.btn-block { width: 100%; }

/* ── Forms ─────────────────────────────────────────────────────────── */
.form-grid {
    display: grid;
    gap: 18px;
}
.form-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) {
    .form-grid.cols-2, .form-grid.cols-3 { grid-template-columns: 1fr; }
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-main);
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-help {
    font-size: 0.75rem;
    color: var(--text-light);
    line-height: 1.5;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--card-bg);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}
.form-input::placeholder { color: var(--text-disabled); }
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--text-main);
    box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px var(--border-strong);
}
.form-input:disabled,
.form-select:disabled {
    background: var(--surface-muted);
    color: var(--text-light);
    cursor: not-allowed;
}

.form-input.error,
.form-select.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px var(--danger-border);
}
.form-input.error:focus,
.form-select.error:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px var(--danger-border);
}
.form-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 4px;
}

.form-select {
    padding-right: 32px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

/* Checkbox styling */
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
    user-select: none;
}
.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    appearance: none;
    -webkit-appearance: none;
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.form-checkbox input[type="checkbox"]:checked {
    background: var(--text-main);
    border-color: var(--text-main);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
}
.form-checkbox input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px var(--text-main);
}
.form-checkbox input[type="checkbox"]:hover:not(:checked) {
    border-color: var(--text-light);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ── Upload zone ───────────────────────────────────────────────────── */
.upload-zone {
    display: block;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    background: var(--surface-muted);
    transition: all 0.15s ease;
    cursor: pointer;
}
.upload-zone:hover,
.upload-zone.dragging {
    border-color: var(--text-light);
    background: var(--surface-hover);
}
.upload-zone-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    background: var(--primary);
    border: none;
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}
.upload-zone-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}
.upload-zone-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}
.upload-zone input[type="file"] { display: none; }

/* ── Tables ────────────────────────────────────────────────────────── */
.table-container { overflow-x: auto; }
.styled-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    text-align: left;
    font-variant-numeric: tabular-nums;
}
.styled-table thead tr {
    background-color: #18181B;
    color: #FFFFFF;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.04em;
    font-size: 0.6875rem;
    border-bottom: 1px solid var(--border-strong);
    border-top: 1px solid var(--border);
}
.styled-table th, .styled-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.styled-table tbody tr:hover {
    background-color: var(--surface-muted);
}
.styled-table tbody td { color: var(--text-main); font-weight: 400; }
.styled-table tbody td:first-child { font-weight: 500; color: var(--text-main); }
.styled-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.styled-table .actions { text-align: right; white-space: nowrap; }
.styled-table .actions .btn { margin-left: 4px; }

/* ── Empty state ───────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}
.empty-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    background: var(--surface-muted);
    color: var(--text-light);
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
}
.empty-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}
.empty-desc {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin: 0;
}

/* ── Badges ────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.4;
    background: var(--surface-muted);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    font-variant-numeric: normal;
}
.badge-xlsx { background: var(--surface-muted); color: var(--text-secondary); border-color: var(--border); }
.badge-xls  { background: var(--surface-muted); color: var(--text-secondary); border-color: var(--border); }
.badge-csv  { background: var(--surface-muted); color: var(--text-secondary); border-color: var(--border); }

/* ── Flash messages ────────────────────────────────────────────────── */
.flash-list {
    list-style: none;
    margin: 0 0 20px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.flash {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid;
    font-size: 0.875rem;
    line-height: 1.5;
}
.flash-success {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success);
}
.flash-error {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger);
}
.flash svg { flex-shrink: 0; margin-top: 1px; }

/* ── KPI tiles (forecast result summary) ───────────────────────────── */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.kpi-tile {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
}
.kpi-tile-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}
.kpi-tile-value {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

/* ── Plotly container ──────────────────────────────────────────────── */
.chart-wrap {
    width: 100%;
    min-height: 420px;
    padding: 8px;
}

/* ── Identity (profile header) ─────────────────────────────────────── */
.identity-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-muted);
}
.identity-avatar, .identity-avatar-placeholder {
    width: 64px; height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.1), 0 1px 2px rgba(15, 23, 42, 0.06);
}
.identity-avatar-placeholder {
    background: var(--accent); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 600;
}
.identity-meta { flex: 1; min-width: 0; }
.identity-name {
    font-size: 1.125rem; font-weight: 600;
    color: var(--text-main); letter-spacing: -0.01em;
    line-height: 1.3; margin: 0 0 2px 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.identity-email {
    font-size: 0.875rem; color: var(--text-light);
    line-height: 1.4; margin: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Small utilities ───────────────────────────────────────────────── */
.text-light { color: var(--text-light); }
.text-secondary { color: var(--text-secondary); }
.mono { font-family: var(--font-mono); font-size: 0.8125rem; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 640px) {
    .page-container { padding: 24px 16px 64px; }
    .card-section { padding: 20px; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .styled-table th, .styled-table td { padding: 8px 12px; }
}

/* ── AI Explanation Sidebar ─────────────────────────────────────────── */
.page-with-sidebar {
    display: flex;
    gap: 24px;
    max-width: 1600px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.page-main-content {
    flex: 1;
    min-width: 0;
    max-width: 1100px;
}

.ai-sidebar {
    width: 380px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--header-height) + 24px);
    max-height: calc(100vh - var(--header-height) - 48px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ai-sidebar-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    max-height: 100%;
    overflow: hidden;
}

.ai-sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-muted);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.ai-sidebar-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-lg);
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.ai-sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    letter-spacing: -0.01em;
}

.ai-sidebar-subtitle {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-light);
    margin: 2px 0 0 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ai-sidebar-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* AI Analysis section headers - matches card-section-title styling */
.ai-sidebar-content .ai-section-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 18px 0 10px 0;
    padding: 8px 12px;
    background: var(--surface-muted);
    border-radius: var(--radius-md);
    border-left: 2px solid var(--text-light);
    letter-spacing: -0.01em;
}

.ai-sidebar-content .ai-section-header:first-child {
    margin-top: 0;
}

.ai-sidebar-content .ai-subsection-header {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 14px 0 8px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.ai-sidebar-content .ai-main-header {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 14px 0;
    letter-spacing: -0.01em;
}

.ai-sidebar-content h1,
.ai-sidebar-content h2,
.ai-sidebar-content h3,
.ai-sidebar-content h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 16px 0 8px 0;
    letter-spacing: -0.01em;
}

.ai-sidebar-content h1:first-child,
.ai-sidebar-content h2:first-child,
.ai-sidebar-content h3:first-child,
.ai-sidebar-content h4:first-child {
    margin-top: 0;
}

/* AI list styling - matches styled-table and card-section patterns */
.ai-sidebar-content .ai-list {
    margin: 0 0 14px 0;
    padding-left: 0;
    list-style: none;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.ai-sidebar-content .ai-list li {
    position: relative;
    padding: 10px 14px 10px 32px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.55;
    border-bottom: 1px solid var(--border);
}

.ai-sidebar-content .ai-list li:last-child {
    border-bottom: none;
}

.ai-sidebar-content .ai-list li::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 14px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-light);
}

.ai-sidebar-content .ai-list li:hover {
    background: var(--surface-hover);
}

.ai-sidebar-content p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 14px 0;
}

.ai-sidebar-content ul,
.ai-sidebar-content ol {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 14px 0;
    padding-left: 20px;
}

.ai-sidebar-content li {
    margin-bottom: 6px;
}

.ai-sidebar-content strong {
    color: var(--text-main);
    font-weight: 600;
}

.ai-sidebar-content code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: var(--surface-muted);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.ai-sidebar-content em {
    font-style: italic;
    color: var(--text-secondary);
}

/* AI-generated tables */
.ai-sidebar-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    margin: 0 0 14px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.ai-sidebar-content table thead tr {
    background-color: #18181B;
    color: #FFFFFF;
}

.ai-sidebar-content table th {
    padding: 10px 12px;
    font-weight: 600;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ai-sidebar-content table td {
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
}

.ai-sidebar-content strong em,
.ai-sidebar-content em strong {
    color: var(--text-main);
}

/* Metric highlights within AI content */
.ai-sidebar-content p strong:first-child {
    display: inline-block;
    color: var(--text-main);
}

/* Visual separator between sections */
.ai-sidebar-content .ai-section-header + p {
    margin-top: 10px;
}

/* Ensure last paragraph/list has no bottom margin */
.ai-sidebar-content > *:last-child {
    margin-bottom: 0;
}

/* Compact variant for dense content */
.ai-sidebar-content.compact .ai-list li {
    padding: 8px 12px 8px 28px;
}

.ai-sidebar-content.compact .ai-list li::before {
    left: 12px;
    top: 12px;
}

.ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    background: var(--surface-muted);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.ai-loading .loading-dots {
    margin-bottom: 16px;
}

.ai-loading .loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
}

.ai-loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border);
    border-top-color: var(--text-light);
    border-radius: 50%;
    animation: ai-spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

.ai-loading-text {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.ai-error {
    padding: 16px;
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius-md);
    color: var(--danger);
    font-size: 0.8125rem;
    line-height: 1.55;
}

.ai-error strong {
    color: var(--danger);
}

.ai-error-retry {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.ai-sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--card-bg);
    flex-shrink: 0;
}

.ai-powered-by {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ai-powered-by svg {
    color: var(--text-disabled);
}

/* Collapse button for sidebar */
.ai-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--text-main);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    z-index: 100;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.ai-sidebar-toggle:hover {
    background: var(--primary-hover);
}

@media (max-width: 1200px) {
    .page-with-sidebar {
        flex-direction: column;
    }

    .ai-sidebar {
        width: 100%;
        position: relative;
        top: 0;
        max-height: none;
        order: -1;
    }

    .ai-sidebar-content {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .ai-sidebar {
        display: none;
    }

    .ai-sidebar.mobile-open {
        display: flex;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        z-index: 999;
        border-radius: 0;
        max-height: none;
    }

    .ai-sidebar.mobile-open .ai-sidebar-card {
        border-radius: 0;
        max-height: 100%;
    }

    .ai-sidebar-toggle {
        display: flex;
    }

    .page-with-sidebar {
        padding: 24px 16px 100px;
    }
}

/* ── Settings Page ─────────────────────────────────────────────────── */
.settings-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.settings-container .page-header {
    margin-bottom: 32px;
}

.settings-container .page-header h1 {
    font-size: 1.625rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.02em;
    margin: 0 0 6px 0;
}

.settings-container .page-subtitle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin: 0;
}

.settings-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
}

.section-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.section-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 4px 0;
}

.section-description {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.section-description code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: var(--surface-muted);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-main);
}

.prompt-editor-container {
    padding: 20px 24px;
}

.prompt-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toolbar-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-main);
}

.last-updated {
    font-size: 0.75rem;
    color: var(--text-light);
}

.toolbar-right {
    display: flex;
    gap: 8px;
}

.prompt-textarea {
    width: 100%;
    min-height: 400px;
    padding: 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--surface-muted);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text-main);
    resize: vertical;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.prompt-textarea:focus {
    border-color: var(--text-main);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.04);
    background: var(--card-bg);
}

.prompt-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.save-status {
    font-size: 0.8125rem;
    font-weight: 500;
    transition: opacity 0.15s;
}

.save-status.success {
    color: var(--success);
}

.save-status.error {
    color: var(--danger);
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ai-spin 0.6s linear infinite;
}

.variables-reference {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    background: var(--surface-muted);
    border-radius: 0 0 12px 12px;
}

.variables-reference h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 6px 0;
}

.variables-intro {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
}

.variables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.variable-group h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 10px 0;
}

.variable-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.variable-list li {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    padding: 4px 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.variable-list code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: var(--surface-muted);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-main);
    border: 1px solid var(--border);
    white-space: nowrap;
}

@media (max-width: 640px) {
    .settings-container {
        padding: 24px 16px 64px;
    }

    .prompt-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .toolbar-right {
        width: 100%;
    }

    .toolbar-right .btn {
        flex: 1;
    }

    .prompt-textarea {
        min-height: 300px;
    }

    .variables-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Permissions Page ─────────────────────────────────────────────────── */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.section-header > div:first-child {
    flex: 1;
    min-width: 0;
}

/* Permission badges */
.permission-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 4px;
    margin-bottom: 2px;
}

.permission-read {
    background: var(--surface-muted);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.permission-write {
    background: var(--surface-muted);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.permission-delete {
    background: var(--surface-muted);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.permission-run {
    background: var(--surface-muted);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

/* Role and info badges */
.badge-role {
    background: var(--surface-muted);
    color: var(--text-main);
    border-color: var(--border);
    font-weight: 600;
}

.badge-info {
    background: var(--surface-muted);
    color: var(--text-secondary);
    border-color: var(--border);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: var(--warning-border);
}

.badge-success {
    background: var(--surface-muted);
    color: var(--text-secondary);
    border-color: var(--border);
}

.badge-danger {
    background: var(--surface-muted);
    color: var(--text-secondary);
    border-color: var(--border);
}

.text-muted {
    color: var(--text-disabled);
}

/* Permission legend */
.permission-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Modal styles */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal-backdrop.show {
    display: block;
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    z-index: 1001;
}

.modal.show {
    display: block;
}

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

.modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 120px);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid var(--border);
}

/* Form styles for modals */
.modal .form-group {
    margin-bottom: 16px;
}

.modal .form-group:last-of-type {
    margin-bottom: 0;
}

.modal .form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 6px;
}

.modal .form-group input[type="text"],
.modal .form-group input[type="email"],
.modal .form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    color: var(--text-main);
    background: var(--card-bg);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.modal .form-group input:focus,
.modal .form-group select:focus {
    border-color: var(--text-main);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.04);
}

.modal .form-group small.form-help {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 4px;
}

.modal .form-static {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 8px 0;
}

/* Permissions grid in modals */
.permissions-grid {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.permission-row {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
}

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

.permission-row:hover {
    background: var(--surface-muted);
}

.resource-label {
    width: 100px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-main);
    flex-shrink: 0;
}

.permission-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    flex: 1;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--border-strong);
    border-radius: 3px;
    appearance: none;
    -webkit-appearance: none;
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked {
    background: var(--text-main);
    border-color: var(--text-main);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
}

.checkbox-label input[type="checkbox"]:hover:not(:checked) {
    border-color: var(--text-light);
}

/* Custom permissions toggle */
#custom-permissions-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .modal {
        width: 95%;
        max-width: none;
    }

    .modal-body {
        padding: 16px;
    }

    .permission-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .resource-label {
        width: auto;
    }

    .permission-checkboxes {
        width: 100%;
    }

    .section-header {
        flex-direction: column;
    }

    .section-header .btn {
        width: 100%;
    }
}

/* ── Global Animations & Effects ───────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.animate-in {
    animation: fadeInUp 0.5s var(--ease-out-expo) forwards;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }

/* Subtle background pattern for pages */
.page-container {
    position: relative;
}

/* Glow effect for important elements */
.glow-effect {
    animation: pulse-glow 2s infinite;
}

/* Float animation for icons */
.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* Success state enhancement */
.flash-success {
    background: var(--surface-muted);
    border-left: 2px solid var(--text-main);
}

/* Error state enhancement */
.flash-error {
    background: var(--danger-bg);
    border-left: 2px solid var(--danger);
    color: var(--danger);
}


/* Empty state enhancement */
.empty-state {
    border-radius: var(--radius-lg);
}

.empty-icon {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-light);
}

/* ── Loading Dots Animation ───────────────────────────────────────────── */
/* Reusable animated loading indicator - three bouncing dots */
.loading-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    background: var(--text-light);
    border-radius: 50%;
    animation: loadingBounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes loadingBounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Loading dots size variants */
.loading-dots.sm span {
    width: 4px;
    height: 4px;
}

.loading-dots.lg span {
    width: 8px;
    height: 8px;
    gap: 6px;
}

/* Loading state container - for wrapping content during API calls */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.loading-state.inline {
    display: inline-flex;
    padding: 0;
    gap: 8px;
}

/* Button loading state */
.btn.is-loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn.is-loading .btn-text {
    visibility: hidden;
}

.btn.is-loading .loading-dots {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.btn.is-loading .loading-dots span {
    background: currentColor;
}

/* ── Insights Grid ─────────────────────────────────────────────────── */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.insight-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.insight-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.insight-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--surface-muted);
    border-radius: var(--radius-md);
    color: var(--text-main);
    flex-shrink: 0;
}

.insight-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.insight-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.insight-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}
