@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Noto+Sans+Thai:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #FFC42D;
    /* Primary Yellow */
    --primary-light: #FFE082;
    --accent: #FFC42D;
    --secondary: #7D7D7D;
    --success: #5CC57A;
    --risk: #E87272;
    --warning: #FFAD60;
    --bg: #F7F7F7;
    /* Soft Light Grey */
    --sidebar-bg: #000000;
    /* Deep Black */
    --sidebar-active: #FFC42D;
    --card-bg: #ffffff;
    --white: #FFFFFF;
    --border: rgba(0, 0, 0, 0.05);
    --text-main: #1A1A1A;
    --text-muted: #7D7D7D;
    --text-sub: #A0A0A0;
    --sidebar-width: 240px;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #FFC42D, #FFD66B);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', 'Noto Sans Thai', sans-serif;
    background: var(--bg);
    color: var(--text-main);
    min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    flex-shrink: 0;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sb-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sb-logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sb-logo-text {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.sb-logo-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.sb-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 24px 12px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-item.active {
    background: var(--sidebar-active);
    color: #000;
    box-shadow: 0 4px 15px rgba(255, 196, 45, 0.3);
}

.nav-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.nav-bottom {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.nav-item.logout-btn:hover {
    background: var(--risk);
    color: #fff;
}

/* Sub-tabs for Review Email */
.sub-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    background: #fff;
    padding: 8px;
    border-radius: 12px;
    width: fit-content;
    border: 1px solid var(--border);
}

.sub-tab-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.sub-tab-btn.active {
    background: var(--primary);
    color: #fff;
}

.sub-tab-content {
    display: none;
}

.sub-tab-content.active {
    display: block;
}

/* ── MAIN CONTENT ── */
.main {
    margin-left: var(--sidebar-width);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    position: sticky;
    top: 0;
    z-index: 900;
    background: var(--bg);
    padding: 16px 0;
    border-bottom: 1px solid transparent;
    transition: all 0.3s;
}

.topbar.scrolled {
    background: rgba(247, 247, 247, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
}

.page-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ── TIME FILTER PILL ── */
.time-filter-container {
    position: relative;
}

.time-filter-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--primary);
    color: #000;
    padding: 10px 22px;
    border-radius: 99px;
    border: none;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 196, 45, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.time-filter-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 196, 45, 0.45);
}

.time-filter-pill i:first-child {
    font-size: 16px;
}

.time-filter-pill i:last-child {
    font-size: 12px;
    opacity: 0.7;
}

.filter-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 200px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    padding: 8px;
    display: none;
    z-index: 1000;
    border: 1px solid rgba(0, 0, 0, 0.05);
    animation: filterSlideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-dropdown.active {
    display: block;
}

.filter-option {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-option:hover {
    background: #f7f7f7;
    color: var(--primary);
}

.filter-option.active {
    background: #FFC42D;
    color: #000;
}

.filter-option.active::after {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
}

@keyframes filterSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.view-toggle {
    background: #fff;
    border: 1px solid var(--border);
    padding: 4px;
    border-radius: 10px;
    display: flex;
    gap: 4px;
}

.toggle-btn {
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--text-muted);
    transition: 0.2s;
}

.toggle-btn.active {
    background: var(--primary);
    color: #fff;
}

.peak-chart-box {
    background: linear-gradient(145deg, #111111 0%, #1a1a1a 100%);
    border-radius: 18px;
    padding: 24px;
    height: 200px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 196, 45, 0.1);
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.kpi {
    background: var(--card-bg);
    border-radius: 18px;
    padding: 24px;
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Gradient variation for first KPI */
.kpi:first-child {
    background: var(--gradient-primary);
    border: none;
    box-shadow: 0 10px 30px rgba(255, 196, 45, 0.2);
}

.kpi:first-child .kpi-label,
.kpi:first-child .kpi-val,
.kpi:first-child .kpi-sub {
    color: #000;
}

.kpi:first-child .kpi-sub.up {
    color: rgba(255, 255, 255, 0.9);
}

.kpi:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(55, 48, 163, 0.08);
}

.kpi-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-sub);
    margin-bottom: 8px;
}

.kpi-val {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
}

.kpi-sub {
    font-size: 11px;
    font-weight: 600;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.up {
    color: var(--success);
}

.dn {
    color: var(--risk);
}

.grid-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid var(--border);
}

.card-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i {
    color: var(--primary);
}

.badge-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 99px;
    background: var(--primary);
    color: #000;
}

/* ── CONTENT SECTIONS ── */
.content-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── CUSTOM COMPONENTS ── */
.brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f3f0ff;
}

.brand-row:last-child {
    border-bottom: none;
}

.brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.brand-info {
    flex: 1;
}

.brand-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.brand-meta {
    font-size: 11px;
    color: var(--text-sub);
    font-weight: 500;
    margin-top: 2px;
}

.brand-val {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
    text-align: right;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.faq-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.faq-rank {
    font-size: 11px;
    color: #c4c2dd;
    font-weight: 700;
    min-width: 20px;
    text-align: right;
}

.faq-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    flex: 1;
}

.faq-track {
    flex: 0 0 150px;
    height: 6px;
    background: #ede9fe;
    border-radius: 4px;
    overflow: hidden;
}

.faq-fill {
    height: 100%;
    border-radius: 4px;
}

.faq-n {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 45px;
    text-align: right;
}

.risk-item {
    padding: 14px;
    border-radius: 12px;
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}

.risk-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.risk-content {
    flex: 1;
}

.risk-t {
    font-size: 13px;
    font-weight: 700;
}

.risk-d {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.4;
}

.sentiment-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.sentiment-box {
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
}

.sent-val {
    font-size: 18px;
    font-weight: 800;
    display: block;
    margin-bottom: 4px;
}

.sent-lbl {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-sub);
    text-transform: uppercase;
}

.data-table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.data-table th {
    text-align: left;
    font-size: 11px;
    color: var(--text-sub);
    text-transform: uppercase;
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 12px;
    font-size: 13px;
    border-bottom: 1px solid rgba(237, 233, 254, 0.5);
}

/* ── MOBILE MENU TOGGLE ── */
.menu-toggle {
    display: flex;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--border);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1100;
    margin-right: 16px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30, 27, 75, 0.4);
    backdrop-filter: blur(4px);
    z-index: 900;
}

/* ── RESPONSIVE MEDIA QUERIES ── */
@media (max-width: 1280px) {
    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-main {
        grid-template-columns: 1fr;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }

    .grid-main .card[style*="grid-column: span 2"] {
        grid-column: span 1 !important;
    }
}

@media (max-width: 992px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        width: 240px;
    }

    .sidebar-overlay.open {
        display: block;
    }

    .main {
        margin-left: 0;
        padding: 20px;
    }

    .menu-toggle {
        display: flex;
    }

    .topbar {
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .kpi-row {
        grid-template-columns: 1fr;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-right {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .view-toggle {
        order: 2;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }

    .page-title {
        font-size: 20px;
    }

    .card {
        padding: 16px;
    }

    .kpi-val {
        font-size: 24px;
    }
}

/* ── DASHBOARD COMPONENTS ── */
.brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.brand-info {
    flex: 1;
}

.brand-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.brand-meta {
    font-size: 11px;
    color: var(--text-sub);
}

.brand-val {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-main);
}

.peak-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 12px;
}

/* ── PRODUCT TREND ENHANCEMENTS ── */
.trend-container {
    display: flex;
    gap: 20px;
    height: 300px;
}

.ai-summary-box {
    flex: 0 0 240px;
    padding: 15px;
    background: var(--bg);
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-sub);
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.ai-summary-box strong {
    color: var(--primary);
    font-size: 14px;
}

.ai-summary-text {
    font-style: italic;
    color: var(--text-main);
}

.trend-graph-wrapper {
    flex: 1;
    position: relative;
    min-width: 0;
    /* Fixes chart resizing issue in flex */
}

.brand-row.interactive {
    cursor: pointer;
    border: 1px solid transparent;
    padding: 8px 12px;
    margin: 0 -12px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.brand-row.interactive:hover {
    background: var(--primary-light);
}

.brand-row.active {
    background: var(--primary-light);
    border-color: var(--primary);
}

/* ── TIME FILTER BUTTON ── */
.time-filter-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: var(--primary);
    color: #000;
    border-radius: 99px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(255, 196, 45, 0.2);
}

.time-filter-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 196, 45, 0.3);
}

.time-filter-pill i:first-child {
    font-size: 16px;
}

.time-filter-pill i:last-child {
    font-size: 12px;
    opacity: 0.7;
    transition: all 0.2s ease;
}


.filter-option:hover {
    background: var(--bg);
    color: var(--primary);
}

.filter-option.active {
    background: var(--primary-light);
    color: var(--primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 0;
}

.custom-range-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.date-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.date-field label {
    font-size: 11px;
    color: var(--text-muted);
}

.date-field input {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    font-size: 13px;
    color: var(--text-main);
    width: 100%;
    font-family: inherit;
}

.apply-btn {
    margin-top: 16px;
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s ease;
}

.apply-btn:hover {
    opacity: 0.9;
}

/* ── RANKED LIST COMPONENTS ── */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.faq-rank {
    width: 20px;
    height: 20px;
    background: var(--bg);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-sub);
    flex-shrink: 0;
}

.faq-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.faq-track {
    width: 60px;
    height: 6px;
    background: var(--bg);
    border-radius: 99px;
    overflow: hidden;
    flex-shrink: 0;
}

.faq-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--primary);
}

.faq-n {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-sub);
    min-width: 40px;
    text-align: right;
}

/* ── LOGIN PAGE ── */
.login-body {
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    font-family: 'Plus Jakarta Sans', 'Noto Sans Thai', sans-serif;
}

.login-container {
    width: 100%;
    max-width: 440px;
    animation: fadeIn 0.8s ease;
}

.login-card {
    background: #fff;
    border-radius: 32px;
    padding: 48px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
    text-align: center;
}

.login-logo {
    width: 64px;
    height: 64px;
    background: var(--primary);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: #fff;
    font-size: 28px;
}

.login-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
}

.login-sub {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 40px;
    font-weight: 500;
}

.form-group {
    text-align: left;
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-sub);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg);
    border: 1px solid transparent;
    border-radius: 14px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s;
    color: var(--text-main);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(33, 33, 43, 0.05);
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    margin-top: 12px;
}

.login-btn:hover {
    background: #2d2d3a;
    transform: translateY(-2px);
}

.login-btn:active {
    transform: translateY(0);
}

.login-footer {
    margin-top: 32px;
    font-size: 13px;
    color: var(--text-sub);
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* ── AUTH UI ── */
.error-msg {
    background: #fef2f2;
    color: #b91c1c;
    padding: 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    display: none;
    border: 1px solid rgba(185, 28, 28, 0.1);
    animation: shake 0.4s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* ── TOOLTIP FOR "OTHER" ── */
.tooltip-container {
    position: relative;
    cursor: help;
}

.tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: var(--primary);
    color: #fff;
    text-align: left;
    border-radius: 8px;
    padding: 10px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 11px;
    line-height: 1.4;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--primary) transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ── MODAL SYSTEM ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.open {
    display: flex;
    opacity: 1;
}

.modal-card {
    background: #fff;
    width: 100%;
    max-width: 600px;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.open .modal-card {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
}

.modal-body {
    margin-bottom: 24px;
}

.modal-textarea {
    width: 100%;
    height: 200px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main);
    resize: none;
    transition: all 0.2s;
}

.modal-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(33, 33, 43, 0.05);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-save {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-save:hover {
    background: #2d2d3a;
}

.btn-cancel {
    background: #eee;
    color: var(--text-muted);
    border: none;
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #e2e2e2;
}

/* ── FAQ DEEP DIVE ── */
.faq-deep-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.faq-deep-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.faq-deep-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
}

.faq-deep-hdr {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.faq-deep-q {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.4;
    flex: 1;
}

.faq-deep-count {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    font-family: var(--font-mono);
}

.faq-deep-meta {
    font-size: 12px;
    color: var(--text-sub);
    font-weight: 600;
}

.faq-deep-track {
    height: 4px;
    background: #f1f5f9;
    border-radius: 2px;
    overflow: hidden;
}

.faq-deep-fill {
    height: 100%;
    border-radius: 2px;
}

.faq-ex-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-ex-item {
    font-size: 12px;
    color: var(--text-main);
    padding: 8px 12px;
    background: #f8fafc;
    border-left: 3px solid #e2e8f0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.faq-deep-sugg {
    font-size: 13px;
    font-weight: 500;
    color: #92400e;
    /* Darker amber for readability on yellow */
    padding: 14px 16px;
    background: #fffbeb;
    /* Soft light yellow background */
    border: 1px solid #fef3c7;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    line-height: 1.5;
}

.faq-deep-sugg-hdr {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #d97706;
    /* Stronger amber for header */
}

.faq-deep-sugg i {
    color: #d97706;
    font-size: 14px;
}

/* --- CHAT ROOM TYPE STYLES --- */
.room-split {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 1.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.room-num {
    text-align: center;
}

.room-num .n {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
}

.room-num .l {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 700;
    text-transform: uppercase;
}

.sat-bar {
    height: 28px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    background: var(--border);
}

.sat-seg {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.95);
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.section-subtitle {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-subtitle::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.dur-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.2s;
}

.dur-bar-row:hover {
    background: rgba(0, 0, 0, 0.02);
}

.dur-bar-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
    width: 65px;
    flex-shrink: 0;
    text-align: right;
}

.dur-bar-track {
    flex: 1;
    background: var(--border);
    border-radius: 6px;
    height: 10px;
    overflow: hidden;
    position: relative;
}

.dur-bar-fill {
    height: 100%;
    border-radius: 6px;
    position: absolute;
    left: 0;
    top: 0;
    transition: width 1.2s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.dur-bar-val {
    font-size: 12px;
    font-weight: 800;
    width: 75px;
}

.insight-pill {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.insight-pill:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    border-color: var(--primary);
}

.insight-pill-val {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 4px;
}

.insight-pill-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 700;
}

.class-guide-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 8px;
    background: #f8fafc;
    border-left: 4px solid;
    transition: transform 0.2s;
}

.class-guide-item:hover {
    transform: translateX(4px);
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.class-guide-icon {
    font-size: 18px;
}

.class-guide-title {
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 2px;
}

.class-guide-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ── TOP FILTER BUTTONS ── */
.tf-btn {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #f8fafc;
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.tf-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--text-main);
}

.tf-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(55, 48, 163, 0.15);
}

/* ── DARK THEME CARDS ── */
.card-dark {
    background: #0a0c10 !important;
    border: 1px solid #1e293b !important;
    padding: 32px !important;
}

.card-dark .tf-btn {
    background: #1a1f26;
    border-color: #2d3748;
    color: #94a3b8;
}

.card-dark .tf-btn.active {
    background: #FFC42D;
    border-color: #FFC42D;
    color: #000;
    box-shadow: 0 0 15px rgba(255, 196, 45, 0.4);
}

.card-dark .faq-deep-item {
    background: #fffbeb;
    /* Soft light yellow */
    border: 1px solid #fde68a;
    border-top: 4px solid transparent;
    /* Set dynamically */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.card-dark .faq-deep-q {
    color: #1e293b;
    /* Dark text for light card */
    font-size: 17px;
    font-weight: 800;
}

.card-dark .faq-deep-count {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.card-dark .faq-deep-meta {
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 10px;
    font-weight: 700;
}

.card-dark .faq-ex-item {
    background: rgba(0, 0, 0, 0.03);
    color: #334155;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-left: 3px solid rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

.card-dark .faq-deep-sugg {
    background: #fefce8;
    border: 1px solid #fef08a;
    color: #854d0e;
}

.card-dark .faq-deep-sugg-hdr {
    color: #f59e0b;
}

/* --- SHARED SEGMENTATION LAYOUT --- */
.segment-grid {
    display: grid;
    grid-template-columns: 6fr 4fr;
    gap: 40px;
    align-items: start;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.takeaway-box {
    background: var(--bg);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
}

/* ── Keywords & Intents Module ── */
.kw-grid {
    display: grid;
    grid-template-columns: 6.5fr 3.5fr;
    gap: 32px;
    margin-top: 10px;
}

.kw-category {
    margin-bottom: 24px;
}

.kw-category h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.kw-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kw-tag {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all 0.2s;
}

.kw-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.kw-tag.product {
    background: #eef2ff;
    color: #4338ca;
    border-color: #c7d2fe;
}

.kw-tag.commercial {
    background: #f0fdf4;
    color: #15803d;
    border-color: #bbf7d0;
}

.kw-tag.urgent {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.recommend-box {
    background: #f8fafc;
    border-left: 4px solid #3b82f6;
    padding: 16px;
    border-radius: 8px;
    margin-top: 20px;
}

.recommend-box h4 {
    margin: 0 0 6px 0;
    font-size: 13px;
    color: #1e40af;
    display: flex;
    align-items: center;
    gap: 6px;
}

.recommend-box p {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    color: #475569;
}

@media (max-width: 1024px) {
    .kw-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Sidebar Collapsed Mode ── */
.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .sb-logo-text,
.sidebar.collapsed .sb-logo-sub,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-bottom .nav-item span {
    display: none;
}

.sidebar.collapsed .sb-logo {
    padding: 20px 0;
    justify-content: center;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px 10px;
    height: 48px;
}

.sidebar.collapsed .nav-item i {
    margin: 0;
    font-size: 18px;
}

.main.collapsed {
    margin-left: 80px;
}

@media (max-width: 992px) {
    .main.collapsed {
        margin-left: 0;
    }
}

/* ── SEND TOAST NOTIFICATION ── */
.send-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-left: 4px solid var(--success);
    min-width: 300px;
    max-width: 420px;
    transform: translateX(130%);
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.send-toast.show {
    transform: translateX(0);
}

.send-toast-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f0fdf4;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    color: var(--success);
}

.send-toast-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-main);
}

.send-toast-detail {
    font-size: 11px;
    color: var(--text-sub);
    margin-top: 3px;
    line-height: 1.4;
}

.send-toast-close {
    color: var(--text-sub);
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
    font-size: 14px;
    padding: 4px;
    transition: color 0.2s;
}

.send-toast-close:hover {
    color: var(--text-main);
}

/* ── HISTORY FILTERS ── */
.history-filters {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: var(--bg);
    border-radius: 14px;
    border: 1px solid var(--border);
}

.history-filter-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-sub);
}

.history-filter-select {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    min-width: 180px;
}

.history-filter-select:focus {
    border-color: var(--primary);
}

/* ── CONFIDENCE REASON TEXT ── */
.conf-reason {
    font-size: 10px;
    color: var(--text-sub);
    margin-top: 4px;
    line-height: 1.4;
    font-weight: 500;
    max-width: 110px;
    text-align: center;
}

/* ── SIDEBAR ACTIVE USERS WIDGET ── */
.sb-active-users {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(92, 197, 122, 0.12);
    border: 1px solid rgba(92, 197, 122, 0.25);
    margin-bottom: 8px;
    cursor: default;
}

.sb-au-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(92, 197, 122, 0.25);
    animation: pulse-green 2s infinite;
    flex-shrink: 0;
}

@keyframes pulse-green {

    0%,
    100% {
        box-shadow: 0 0 0 3px rgba(92, 197, 122, 0.25);
    }

    50% {
        box-shadow: 0 0 0 7px rgba(92, 197, 122, 0.08);
    }
}

.sb-au-count {
    font-size: 16px;
    font-weight: 800;
    color: var(--success);
    line-height: 1;
}

.sb-au-label {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.sidebar.collapsed .sb-active-users {
    justify-content: center;
    padding: 10px;
}

.sidebar.collapsed .sb-au-info {
    display: none;
}

/* ── ORIGINAL MAIL VIEW BUTTON ── */
.btn-view-mail {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 700;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    font-family: inherit;
}

.btn-view-mail:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

/* ── TOPIC TAGS (inline in table) ── */
.topic-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    border: 1.5px solid transparent;
}

.topic-tag.order {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.2);
}

.topic-tag.delivery {
    background: rgba(59, 130, 246, 0.1);
    color: #1e40af;
    border-color: rgba(59, 130, 246, 0.2);
}

.topic-tag.pricing {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
    border-color: rgba(245, 158, 11, 0.2);
}

.topic-tag.product {
    background: rgba(139, 92, 246, 0.1);
    color: #4c1d95;
    border-color: rgba(139, 92, 246, 0.2);
}

.topic-tag.urgent {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border-color: rgba(239, 68, 68, 0.2);
}

/* ── ORIGINAL MAIL MODAL ── */
.mail-meta-grid {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 6px 12px;
    font-size: 13px;
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.mail-meta-label {
    color: var(--text-sub);
    font-weight: 700;
    align-self: center;
}

.mail-body-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-line;
    color: var(--text-main);
    min-height: 120px;
}

/* ── Refined Keywords UI ── */
.kw-tag {
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1.5px solid transparent;
}

.kw-tag.product {
    background: rgba(67, 56, 202, 0.08);
    color: #4338ca;
    border-color: rgba(67, 56, 202, 0.15);
}

.kw-tag.commercial {
    background: rgba(21, 128, 61, 0.08);
    color: #15803d;
    border-color: rgba(21, 128, 61, 0.15);
}

.kw-tag.urgent {
    background: rgba(185, 28, 28, 0.08);
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.15);
}

.kw-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: white;
}

.recommend-box {
    background: #fdfdff;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #3b82f6;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.recommend-box h4 {
    color: #1e3a8a;
    font-size: 14px;
    margin-bottom: 8px;
}

.recommend-box p {
    color: #475569;
    font-size: 13px;
    line-height: 1.7;
    font-weight: 500;
}

/* ── AI PREMIUM INSIGHT BOX (IMAGE STYLE) ── */
.ai-intelligence-box {
    background: #facc15 !important;
    border-radius: 18px !important;
    padding: 16px 20px !important;
    /* Reduced padding */
    position: relative;
    overflow: hidden;
    color: #000 !important;
    box-shadow: 0 10px 30px rgba(250, 204, 21, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Top align */
    gap: 8px;
    /* Tighten internal spacing */
}

.ai-intelligence-box::after {
    content: '\f5dc';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    bottom: -10px;
    /* Moved down */
    right: -10px;
    font-size: 80px;
    /* Smaller watermark */
    color: rgba(0, 0, 0, 0.05);
    pointer-events: none;
    transform: rotate(-10deg);
}

.ai-header-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 2px;
    opacity: 0.8;
}

.ai-quote-text {
    font-size: 13px;
    /* Slightly smaller */
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 5px;
    position: relative;
    z-index: 1;
}

.ai-footer-label {
    font-size: 9px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    opacity: 0.7;
    margin-top: auto;
    /* Push to bottom if space allows */
}

.ai-footer-label i {
    font-size: 10px;
}

/* ── DASHBOARD PREMIUM REFINEMENT ── */
.grid-main {
    display: grid;
    gap: 24px;
    margin-bottom: 24px;
}

.card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.card-hdr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bg);
}

.card-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: var(--primary);
    font-size: 16px;
}

/* ── RISK ITEMS REFINEMENT ── */
.risk-item {
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    gap: 16px;
    border: 1px solid transparent;
    transition: 0.2s;
}

.risk-item:hover {
    filter: brightness(0.98);
    transform: scale(1.01);
}

.risk-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* ── PREMIUM TABLE ── */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.data-table th {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 10px;
    font-weight: 700;
    text-align: left;
}

.data-table td {
    padding: 12px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}

.data-table tr td:first-child {
    border-left: 1px solid #f1f5f9;
    border-radius: 10px 0 0 10px;
}

.data-table tr td:last-child {
    border-right: 1px solid #f1f5f9;
    border-radius: 0 10px 10px 0;
}

/* ── LIVE INTELLIGENCE BOX REFINEMENT ── */
.insight-box {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}