/* ============================================================
   EVMS Dashboard — Soft Minimal & Card-based Density
   ============================================================
   ✓ Light Mode optimized (#F9FAFB background)
   ✓ White cards with shadow-sm + hover:shadow-md
   ✓ Tailwind-inspired Slate / Blue / Emerald palette
   ✓ Noto Sans KR + JetBrains Mono
   ✓ 12px ~ 16px rounded corners
   ✓ Clean, breathing whitespace
   ============================================================ */

/* ─── Design Tokens ─────────────────────────────────────── */
:root {
    --font-sans: 'Noto Sans KR', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    --sidebar-w: 240px;
    --topbar-h: 56px;
    --radius-sm: 2px;
    --radius-md: 3px;
    --radius-lg: 4px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    /* ─ Soft Minimal Light Palette ─ */
    --bg-body: #F9FAFB;
    --bg-surface: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-sidebar: #FFFFFF;
    --bg-input: #F1F5F9;
    --bg-hover: #F8FAFC;
    --bg-active: #EFF6FF;
    --bg-badge: #F1F5F9;

    --border-default: #E2E8F0;
    --border-hover: #CBD5E1;
    --border-glow: #93C5FD;

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-link: #2563EB;

    --accent: #2563EB;
    --accent-bright: #3B82F6;
    --accent-glow: rgba(37, 99, 235, 0.08);

    --success: #10B981;
    --success-bright: #34D399;
    --success-subtle: rgba(16, 185, 129, 0.08);
    --warning: #F59E0B;
    --warning-bright: #FBBF24;
    --warning-subtle: rgba(245, 158, 11, 0.08);
    --danger: #EF4444;
    --danger-bright: #F43F5E;
    --danger-subtle: rgba(239, 68, 68, 0.06);
    --info: #0EA5E9;
    --info-bright: #38BDF8;
    --purple: #8B5CF6;
    --purple-bright: #A78BFA;

    --orange: #F97316;
    --orange-bright: #FB923C;
    --orange-subtle: rgba(249, 115, 22, 0.08);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

    --gradient-brand: linear-gradient(135deg, #2563EB, #7C3AED);
    --gradient-text: linear-gradient(90deg, #2563EB, #7C3AED, #0EA5E9);
    color-scheme: light;
}

/* ─── Dark Theme Override ───────────────────────────────── */
[data-theme="dark"] {
    --bg-body: #0F172A;
    --bg-surface: #1E293B;
    --bg-card: #1E293B;
    --bg-sidebar: #0F172A;
    --bg-input: #334155;
    --bg-hover: rgba(59, 130, 246, 0.06);
    --bg-active: rgba(59, 130, 246, 0.12);
    --bg-badge: rgba(255, 255, 255, 0.06);

    --border-default: #334155;
    --border-hover: #475569;
    --border-glow: #60A5FA;

    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --text-link: #60A5FA;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
}

/* ─── Keyframe Animations ───────────────────────────────── */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

    to {
        background-position: 200% 0;
    }
}

/* ─── Global Reset ──────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
    font-size: 14px;
    letter-spacing: -0.01em;
}

/* ─── Loading Screen ────────────────────────────────────── */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    transition: opacity 0.5s var(--ease);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-default);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

#loading-screen .loading-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
    margin-top: 16px;
}

/* ─── Layout ────────────────────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ───────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s var(--ease-out);
}

.sidebar-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-default);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-brand);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    position: relative;
}

.logo-icon::after {
    display: none;
}

.sidebar-header .logo-text h5 {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0;
}

.sidebar-header .logo-text small {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 400;
}

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

.nav-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: var(--text-muted);
    padding: 14px 10px 6px;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    margin: 1px 0;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s var(--ease);
}

.sidebar .nav-link i {
    width: 18px;
    text-align: center;
    font-size: 0.82rem;
    flex-shrink: 0;
    opacity: 0.5;
    transition: all 0.15s var(--ease);
}

.sidebar .nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar .nav-link:hover i {
    opacity: 1;
    color: var(--accent);
}

.sidebar .nav-link.active {
    background: var(--bg-active);
    color: var(--accent);
    font-weight: 600;
}

.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.sidebar .nav-link.active {
    position: relative;
}

.sidebar .nav-link.active i {
    opacity: 1;
    color: var(--accent);
}

/* ── Chat with AI: Naver Green Gradient Animation ── */
@keyframes naverShimmer {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes naverPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

@keyframes naverGlow {

    0%,
    100% {
        box-shadow: 0 0 4px rgba(3, 199, 90, 0.2);
    }

    50% {
        box-shadow: 0 0 12px rgba(3, 199, 90, 0.4);
    }
}

.sidebar .nav-link[data-section="ai"].active {
    background: linear-gradient(90deg, rgba(3, 199, 90, 0.06), rgba(30, 200, 0, 0.12), rgba(3, 199, 90, 0.06));
    background-size: 300% 100%;
    animation: naverShimmer 4s ease infinite, naverGlow 3s ease-in-out infinite;
    border-radius: 8px;
}

.sidebar .nav-link[data-section="ai"].active span {
    background: linear-gradient(90deg, #03C75A, #1EC800, #00D95F, #03C75A);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: naverShimmer 4s ease infinite;
    font-weight: 800;
}

.sidebar .nav-link[data-section="ai"].active i {
    color: #03C75A;
    animation: naverPulse 2s ease-in-out infinite;
}

.sidebar .nav-link[data-section="ai"].active::before {
    background: linear-gradient(180deg, #03C75A, #1EC800);
    height: 24px;
    width: 3px;
}

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

.theme-btn {
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s var(--ease);
    width: 100%;
}

.theme-btn:hover {
    background: var(--bg-active);
    color: var(--accent);
    border-color: var(--border-hover);
}

/* ─── Main Content ──────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    width: calc(100vw - var(--sidebar-w));
    max-width: calc(100vw - var(--sidebar-w));
    overflow-x: hidden;
    overflow-y: auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ─── Top Bar ───────────────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-default);
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-toggle-btn {
    background: none;
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.15s var(--ease);
}

.sidebar-toggle-btn:hover {
    border-color: var(--border-hover);
    color: var(--accent);
}

/* ─── Content Wrapper ───────────────────────────────────── */
.content-wrapper {
    flex: 1;
    padding: 16px;
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

/* AI 페이지 활성화 시 — 패딩 제거, flex 채움 */
.content-wrapper.ai-page-active {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ─── Global Header (sticky, all pages) ────────────────── */
#global-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 8px 16px 0;
    background: var(--bg-body);
}

.gh-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.gh-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.gh-cell .gh-label {
    font-size: 0.62rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.3px;
}

.gh-cell .gh-value {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
}

.gh-divider {
    width: 1px;
    height: 28px;
    background: var(--border-default);
    flex-shrink: 0;
}

.gh-title {
    font-size: 1.34rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #03C75A, #00B4D8, #2563EB, #03C75A);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: titleGradientSweep 4s ease-in-out infinite;
}

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

    100% {
        background-position: -100% 0;
    }
}

/* Marquee bar ─ Aurora Glassmorphism */
.gh-marquee {
    margin: 4px 16px 4px;
    overflow: hidden;
    padding: 6px 0;
    position: relative;
    border-radius: var(--radius-lg);
    /* Glassmorphism base */
    background: linear-gradient(135deg,
            rgba(59, 130, 246, 0.08) 0%,
            rgba(139, 92, 246, 0.06) 25%,
            rgba(6, 182, 212, 0.08) 50%,
            rgba(16, 185, 129, 0.06) 75%,
            rgba(244, 114, 182, 0.06) 100%);
    background-size: 400% 100%;
    animation: auroraShift 12s ease-in-out infinite;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(148, 163, 184, 0.12);
    box-shadow: 0 1px 8px rgba(59, 130, 246, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

@keyframes auroraShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.gh-marquee-inner {
    display: flex;
    white-space: nowrap;
    gap: 0;
    will-change: transform;
}

.gh-marquee-text {
    font-size: 0.72rem;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
    flex-shrink: 0;
    padding-right: 0;
}

.gh-marquee-inner .kw-glow {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6, #06b6d4, #10b981);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    animation: kwShimmer 3s ease-in-out infinite;
}

@keyframes kwShimmer {

    0%,
    100% {
        background-position: 0% center;
    }

    50% {
        background-position: 100% center;
    }
}

/* ─── Section Header ────────────────────────────────────── */
.section-header {
    margin-bottom: 20px;
}

.section-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.section-header p {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
    margin: 0;
}

/* ─── Glass Card → White Card ───────────────────────────── */
.glass-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.glass-card::before {
    display: none;
}

.glass-card::after {
    display: none;
}

.glass-card:hover {
    box-shadow: var(--shadow-md);
}

/* ─── Card Header ───────────────────────────────────────── */
.card-header-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-default);
}

.card-header-row h6 {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header-row h6 i {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ─── KPI Cards ─────────────────────────────────────────── */
.kpi-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s var(--ease);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.kpi-card::before {
    display: none;
}

.kpi-card::after {
    display: none;
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: all 0.2s var(--ease);
}

.kpi-card .kpi-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.kpi-card .kpi-value {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.kpi-trend {
    font-size: 0.68rem;
    font-weight: 600;
    margin-top: auto;
    padding-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.kpi-trend.up {
    color: var(--success);
}

.kpi-trend.down {
    color: var(--danger);
}

.kpi-trend.neutral {
    color: var(--text-muted);
    font-weight: 500;
}

/* KPI Accent Colors */
.kpi-accent-blue .kpi-icon {
    background: #EFF6FF;
    color: #2563EB;
}

.kpi-accent-green .kpi-icon {
    background: #ECFDF5;
    color: #10B981;
}

.kpi-accent-amber .kpi-icon {
    background: #FFFBEB;
    color: #F59E0B;
}

.kpi-accent-purple .kpi-icon {
    background: #F5F3FF;
    color: #8B5CF6;
}

.kpi-accent-info .kpi-icon {
    background: #F0F9FF;
    color: #0EA5E9;
}

.kpi-accent-danger .kpi-icon {
    background: #FEF2F2;
    color: #EF4444;
}

.kpi-accent-orange .kpi-icon {
    background: #FFF7ED;
    color: #F97316;
}

/* ─── Tables ────────────────────────────────────────────── */
.table {
    font-size: 0.78rem;
    color: var(--text-secondary);
    border-collapse: collapse;
}

.table thead th {
    background: var(--bg-body);
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-default);
    white-space: nowrap;
}

.table tbody td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border-default);
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: var(--bg-hover);
}

.table .mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* ─── Alert Banner ──────────────────────────────────────── */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 500;
    animation: fadeSlideUp 0.3s var(--ease) both;
}

.alert-banner i {
    font-size: 1rem;
    flex-shrink: 0;
}

.alert-banner.alert-info {
    background: #EFF6FF;
    color: #1D4ED8;
    border: 1px solid #BFDBFE;
}

.alert-banner.alert-success {
    background: #ECFDF5;
    color: #047857;
    border: 1px solid #A7F3D0;
}

.alert-banner.alert-warning {
    background: #FFFBEB;
    color: #B45309;
    border: 1px solid #FDE68A;
}

.alert-banner.alert-danger {
    background: #FEF2F2;
    color: #B91C1C;
    border: 1px solid #FECACA;
}

/* ─── Tab Pills ─────────────────────────────────────────── */
.tab-pill {
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s var(--ease);
}

.tab-pill:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.tab-pill.active {
    background: var(--text-primary);
    color: #FFFFFF;
    border-color: var(--text-primary);
    font-weight: 600;
}

/* ─── SVG Gauge ─────────────────────────────────────────── */
.gauge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.gauge-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.gauge-value {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* ─── Bullet Graph ──────────────────────────────────────── */
.bullet-graph {
    margin-bottom: 10px;
}

.bullet-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
}

.bullet-track {
    position: relative;
    height: 20px;
    background: var(--bg-body);
    border-radius: 4px;
    border: 1px solid var(--border-default);
    overflow: hidden;
}

.bullet-bar {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 0;
    border-radius: 3px;
    transition: width 1s var(--ease-out);
}

.bullet-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--text-primary);
    z-index: 2;
}

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .content-wrapper {
        padding: 16px;
    }
}

@media (max-width: 767.98px) {
    .content-wrapper {
        padding: 12px;
    }

    .kpi-card .kpi-value {
        font-size: 1rem;
    }
}

/* Sidebar mobile overlay */
@media (max-width: 991.98px) {
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(2px);
        z-index: 999;
        transition: opacity 0.3s var(--ease);
    }
}

/* ─── Hero Page Title Overlay ───────────────────────────── */
.hero-page-title {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 10 !important;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.35);
    padding: 10px 32px;
    border-radius: 8px;
    font-size: 2.2rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.92) !important;
    letter-spacing: 0.15em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

/* ─── PMIS: Project Hero Image Carousel ─────────────────── */
.project-hero {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 100%;
    min-height: 280px;
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-sm);
}

.project-hero .hero-slides {
    display: flex;
    transition: transform 0.6s var(--ease-out);
    height: 100%;
}

.project-hero .hero-slide {
    min-width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
}

.project-hero .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0.45) 100%);
    pointer-events: none;
    z-index: 1;
}

.project-hero .hero-caption {
    position: absolute;
    bottom: 16px;
    left: 20px;
    right: 20px;
    z-index: 2;
    color: #fff;
}

.project-hero .hero-caption h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 2px;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

.project-hero .hero-caption p {
    font-size: 0.7rem;
    opacity: 0.85;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.project-hero .hero-dots {
    position: absolute;
    bottom: 12px;
    right: 20px;
    display: flex;
    gap: 5px;
    z-index: 3;
}

.project-hero .hero-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s var(--ease);
}

.project-hero .hero-dot.active {
    background: #fff;
    transform: scale(1.3);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}

.project-hero .hero-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-primary);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s var(--ease);
    font-size: 0.72rem;
    box-shadow: var(--shadow-sm);
}

.project-hero .hero-nav:hover {
    background: #fff;
    box-shadow: var(--shadow-md);
}

.project-hero .hero-nav.prev {
    left: 10px;
}

.project-hero .hero-nav.next {
    right: 10px;
}

/* ─── PMIS: Compact Meta Grid ───────────────────────────── */
.meta-compact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
}

.meta-item-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-default);
    font-size: 0.72rem;
    transition: background 0.1s var(--ease);
}

.meta-item-compact:hover {
    background: var(--bg-hover);
}

.meta-item-compact .mc-label {
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    margin-right: 6px;
    flex-shrink: 0;
}

.meta-item-compact .mc-value {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.meta-item-compact .mc-value.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 991.98px) {
    .project-hero {
        min-height: 200px;
    }

    .meta-compact-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   AI Analysis Page — CUBE Commander Layout
   ============================================================ */

/* ─── AI Page Active State ───────────────────────────────── */
.content-wrapper.ai-page-active {
    padding: 0 !important;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px);
}

/* ─── Layout ─────────────────────────────────────────────── */
.ai-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    gap: 0;
    overflow: hidden;
}

.ai-chat-panel {
    width: 30%;
    min-width: 280px;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    border-right: 2px solid var(--border);
    background: var(--bg-card);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
}

.ai-canvas-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary, var(--bg-primary));
    overflow: hidden;
}

/* ─── Context Bar ────────────────────────────────────────── */
.ai-context-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.ai-context-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ai-context-badge {
    font-size: 0.65rem;
    background: var(--primary);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.ai-settings-btn {
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.ai-settings-btn:hover {
    background: var(--primary);
    color: #fff;
}

/* ─── Chat Messages ──────────────────────────────────────── */
.ai-chat-messages {
    flex: 1;
    min-height: 150px;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-msg {
    display: flex;
    gap: 6px;
    max-width: 95%;
    animation: aiMsgIn 0.3s ease;
}

@keyframes aiMsgIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-msg-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-msg-system,
.ai-msg-ai {
    align-self: flex-start;
}

.ai-msg-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8B5CF6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.55rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.ai-msg-bubble {
    padding: 7px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    line-height: 1.45;
}

.ai-msg-user .ai-msg-bubble {
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ai-msg-user {
    justify-content: flex-end;
}

.ai-msg-avatar-user {
    background: linear-gradient(135deg, #10B981, #059669) !important;
}

.ai-msg-user-text {
    display: block;
}

.ai-msg-time {
    display: block;
    font-size: 0.52rem;
    opacity: 0.7;
    text-align: right;
    margin-top: 2px;
}

.ai-msg-ai .ai-msg-bubble,
.ai-msg-system .ai-msg-bubble {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.ai-msg-title {
    font-weight: 700;
    font-size: 0.68rem;
    color: var(--primary);
    margin-bottom: 2px;
}

.ai-msg-meta {
    font-size: 0.58rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.ai-msg-bubble p {
    margin: 0 0 4px 0;
}

.ai-msg-bubble p:last-child {
    margin: 0;
}

.ai-msg-quote {
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid var(--primary);
    padding: 4px 8px;
    margin-bottom: 6px;
    border-radius: 0 6px 6px 0;
    font-size: 0.62rem;
    color: var(--primary);
    font-style: italic;
    line-height: 1.4;
}

/* 이전 대화 클릭 UI */
.ai-msg-clickable {
    transition: all 0.2s ease;
    border: 1px solid var(--border);
}

.ai-msg-clickable:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.15) !important;
    transform: translateX(2px);
}

.ai-msg-selected {
    border-color: var(--primary) !important;
    background: rgba(59, 130, 246, 0.06) !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2), 0 4px 12px rgba(59, 130, 246, 0.12) !important;
}

.ai-msg-click-hint {
    font-size: 0.58rem;
    color: var(--primary);
    opacity: 0;
    margin-top: 4px;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-msg-clickable:hover .ai-msg-click-hint {
    opacity: 1;
}

.ai-msg-quote i {
    font-size: 0.5rem;
    margin-right: 3px;
    opacity: 0.6;
}

/* ─── Preset Chips ───────────────────────────────────────── */
.ai-chips-area {
    border-top: 1px solid var(--border);
    padding: 6px 10px;
    max-height: 160px;
    overflow-y: auto;
    flex-shrink: 0;
}

.ai-chip-categories {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.ai-chip-cat {
    font-size: 0.68rem;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.ai-chip-cat:hover {
    border-color: var(--cat-color);
    color: var(--cat-color);
}

.ai-chip-cat.active {
    background: var(--cat-color);
    color: #fff;
    border-color: var(--cat-color);
}

.ai-chip-questions {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ai-chip-q {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    animation: chipIn 0.2s ease both;
}

@keyframes chipIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ai-chip-q:hover {
    border-color: var(--primary);
    background: var(--primary-light, rgba(59, 130, 246, 0.06));
}

.ai-chip-tag {
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    background: rgba(59, 130, 246, 0.1);
    padding: 1px 6px;
    border-radius: 4px;
}

.ai-chip-text {
    font-size: 0.65rem;
    color: var(--text-primary);
    line-height: 1.3;
}

/* ─── Input Area ─────────────────────────────────────────── */
.ai-input-area {
    padding: 8px 10px;
    border-top: 2px solid var(--border);
    background: var(--bg-card);
}

.ai-input-wrapper {
    display: flex;
    gap: 6px;
    align-items: center;
}

.ai-input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.75rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    outline: none;
    transition: border 0.2s;
    font-family: var(--font-sans);
}

.ai-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ai-send-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.ai-send-btn:hover {
    background: #2563EB;
    transform: scale(1.05);
}

.ai-input-hint {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ai-input-hint a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* ─── Tab Bar ────────────────────────────────────────────── */
.ai-tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    padding: 0 16px;
}

.ai-tab {
    padding: 10px 18px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-tab:hover {
    color: var(--text-primary);
}

.ai-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ─── Canvas Content ─────────────────────────────────────── */
.ai-canvas-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.ai-canvas-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 16px;
    color: var(--text-muted);
}

.ai-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ─── Welcome Screen ─────────────────────────────────────── */
.ai-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 30px 20px;
}

.ai-welcome-hero {
    text-align: center;
}

.ai-welcome-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), #8B5CF6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.6rem;
    margin: 0 auto 16px;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.ai-welcome-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.ai-welcome-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0 0 4px;
}

.ai-welcome-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

.ai-welcome-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 720px;
}

.ai-welcome-category {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.25s;
}

.ai-welcome-category:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.ai-welcome-cat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.ai-welcome-cat-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ai-welcome-cat-desc {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.ai-welcome-cat-count {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-secondary, var(--bg-primary));
    padding: 2px 8px;
    border-radius: 10px;
}

.ai-welcome-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.ai-welcome-stat {
    text-align: center;
}

.ai-stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    font-family: var(--font-mono);
}

.ai-stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* ─── Summary Tab ────────────────────────────────────────── */
.ai-summary-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-summary-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.ai-elapsed {
    font-size: 0.68rem;
    color: var(--primary);
    font-weight: 600;
}

.ai-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.ai-kpi-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.ai-kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.ai-kpi-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
}

.ai-kpi-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.ai-summary-text {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.ai-summary-text i {
    color: #F59E0B;
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.ai-summary-text p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* ─── CM Analysis Section (Hybrid Mode) ─────────────────── */
.ai-cm-analysis {
    margin-top: 16px;
    padding: 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.04), rgba(59, 130, 246, 0.04));
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.ai-cm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ai-cm-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-cm-header h4 i {
    color: #8B5CF6;
}

.ai-query-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ai-badge-hybrid {
    background: rgba(59, 130, 246, 0.12);
    color: #3B82F6;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.ai-badge-consulting {
    background: rgba(139, 92, 246, 0.12);
    color: #8B5CF6;
    border: 1px solid rgba(139, 92, 246, 0.25);
}

.ai-agenda-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.ai-agenda-badge i {
    color: #F59E0B;
}

.ai-agenda-badge strong {
    color: var(--text-primary);
    font-weight: 600;
}

.ai-cm-card {
    margin-bottom: 10px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ai-cm-card:last-child {
    margin-bottom: 0;
}

.ai-cm-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.ai-cm-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 0.82rem;
    font-weight: 700;
}

.ai-cm-card-body {
    padding: 10px 14px 14px;
    font-size: 0.8rem;
    line-height: 1.7;
    color: var(--text-primary);
}

/* Situation - Blue */
.ai-cm-situation {
    background: rgba(59, 130, 246, 0.04);
    border-color: rgba(59, 130, 246, 0.15);
}

.ai-cm-situation .ai-cm-card-header {
    color: #2563EB;
    background: rgba(59, 130, 246, 0.08);
}

/* Theory - Purple */
.ai-cm-theory {
    background: rgba(139, 92, 246, 0.04);
    border-color: rgba(139, 92, 246, 0.15);
}

.ai-cm-theory .ai-cm-card-header {
    color: #7C3AED;
    background: rgba(139, 92, 246, 0.08);
}

/* Recommendation - Green */
.ai-cm-recommendation {
    background: rgba(16, 185, 129, 0.04);
    border-color: rgba(16, 185, 129, 0.15);
}

.ai-cm-recommendation .ai-cm-card-header {
    color: #059669;
    background: rgba(16, 185, 129, 0.08);
}

/* Risk - Red/Orange */
.ai-cm-risk {
    background: rgba(239, 68, 68, 0.04);
    border-color: rgba(239, 68, 68, 0.15);
}

.ai-cm-risk .ai-cm-card-header {
    color: #DC2626;
    background: rgba(239, 68, 68, 0.08);
}

/* Strategies - Teal */
.ai-cm-strategies {
    background: rgba(20, 184, 166, 0.04);
    border-color: rgba(20, 184, 166, 0.15);
}

.ai-cm-strategies .ai-cm-card-header {
    color: #0D9488;
    background: rgba(20, 184, 166, 0.08);
}

/* Strategy Items */
.ai-strategy-item {
    padding: 12px 14px;
    margin-bottom: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-left: 4px solid #0D9488;
    border: 1px solid rgba(20, 184, 166, 0.12);
    border-left: 4px solid #0D9488;
}

.ai-strategy-item:last-child {
    margin-bottom: 0;
}

.ai-strategy-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0D9488;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(20, 184, 166, 0.12);
}

.ai-strategy-detail {
    display: flex;
    gap: 10px;
    padding: 5px 0;
    font-size: 0.78rem;
    line-height: 1.6;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.ai-strategy-detail:last-child {
    border-bottom: none;
}

.ai-detail-label {
    flex-shrink: 0;
    width: 90px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.ai-detail-label i {
    font-size: 0.7rem;
    width: 14px;
    text-align: center;
}

.ai-detail-value {
    flex: 1;
    color: var(--text-primary);
}

.ai-detail-effect .ai-detail-label {
    color: #059669;
}

.ai-detail-cost .ai-detail-label {
    color: #D97706;
}

/* Tradeoff - Orange */
.ai-cm-tradeoff {
    background: rgba(245, 158, 11, 0.04);
    border-color: rgba(245, 158, 11, 0.15);
}

.ai-cm-tradeoff .ai-cm-card-header {
    color: #D97706;
    background: rgba(245, 158, 11, 0.08);
}

/* Simulation - Indigo */
.ai-cm-simulation {
    background: rgba(99, 102, 241, 0.04);
    border-color: rgba(99, 102, 241, 0.15);
}

.ai-cm-simulation .ai-cm-card-header {
    color: #4F46E5;
    background: rgba(99, 102, 241, 0.08);
}


/* ─── Data Table ─────────────────────────────────────────── */
.ai-table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.ai-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.ai-data-table th {
    text-align: left;
    padding: 8px 12px;
    background: var(--bg-secondary, #F1F5F9);
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.ai-data-table td {
    padding: 6px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    white-space: nowrap;
}

.ai-data-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.04);
}

.ai-grid-sortable {
    cursor: pointer;
    user-select: none;
}

.ai-grid-sortable:hover {
    color: var(--primary);
}

.ai-grid-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ai-grid-count {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.ai-btn-sm {
    font-size: 0.72rem;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.ai-btn-sm:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.ai-btn-link {
    font-size: 0.72rem;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.ai-summary-preview {
    margin-top: 4px;
}

.ai-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ─── SQL Detail ─────────────────────────────────────────── */
.ai-sql-detail {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.ai-sql-detail summary {
    padding: 8px 14px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    background: var(--bg-secondary, #F8FAFC);
}

.ai-sql-code {
    margin: 0;
    padding: 12px 14px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    line-height: 1.6;
    background: var(--bg-card);
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
}

/* ─── Chart Tab ──────────────────────────────────────────── */
.ai-chart-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ai-chart-toolbar {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.ai-chart-type-btn {
    font-size: 0.7rem;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.ai-chart-type-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.ai-chart-type-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.ai-chart-container {
    flex: 1;
    min-height: 400px;
    position: relative;
}

.ai-chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--text-muted);
    gap: 12px;
}

/* ─── API Key Modal ──────────────────────────────────────── */
.ai-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.ai-modal {
    background: var(--bg-card);
    border-radius: 16px;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

.ai-modal-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-modal-close {
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
}

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

.ai-key-input-group {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.ai-key-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.82rem;
    font-family: var(--font-mono);
    background: var(--bg-primary);
    color: var(--text-primary);
    outline: none;
}

.ai-key-input:focus {
    border-color: var(--primary);
}

.ai-key-toggle {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
    cursor: pointer;
    padding: 0 12px;
    color: var(--text-muted);
}

.ai-model-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-model-badge {
    font-size: 0.72rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
}

.ai-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    align-items: center;
}

.ai-btn-secondary {
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.ai-btn-primary {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    background: var(--primary) !important;
    color: #fff !important;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
    visibility: visible !important;
    opacity: 1 !important;
}

.ai-btn-primary:hover {
    background: #2563EB;
}

/* ============================================================
   CUBE View Page
   ============================================================ */
.cube-page {
    padding: 4px 0;
}

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

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

.cube-title-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.cube-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.cube-subtitle {
    margin: 2px 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cube-controls {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 16px;
}

.cube-control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cube-control-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.cube-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.78rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-width: 160px;
    outline: none;
    cursor: pointer;
}

.cube-select:focus {
    border-color: var(--primary);
}

.cube-run-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.cube-run-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.cube-control-divider {
    width: 1px;
    height: 36px;
    background: var(--border);
    margin: 0 4px;
    align-self: flex-end;
    margin-bottom: 8px;
}

.cube-filter-select {
    border-color: rgba(139, 92, 246, 0.3);
}

.cube-filter-select:focus {
    border-color: #8B5CF6;
}

.cube-filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(99, 102, 241, 0.12));
    color: #7C3AED;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 8px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.cube-result {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 16px;
    min-height: 300px;
}

.cube-chart-area {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 16px;
    margin-top: 16px;
}

.cube-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.cube-chart-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.cube-chart-title i {
    color: var(--primary);
}

.cube-chart-container {
    position: relative;
    width: 100%;
    height: 360px;
}

.cube-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 240px;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.cube-table-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.78rem;
    color: var(--text-primary);
}

.cube-measure-label {
    font-size: 0.72rem;
    color: var(--primary);
    font-weight: 600;
}

.cube-pivot-table th.cube-corner {
    font-size: 0.65rem;
    color: var(--text-muted);
    min-width: 100px;
}

.cube-pivot-table th.cube-row-label {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-secondary, #F8FAFC);
    position: sticky;
    left: 0;
}

.cube-pivot-table td.cube-total,
.cube-pivot-table th.cube-total {
    background: var(--bg-secondary, #F1F5F9) !important;
}

.cube-pivot-table td.cube-grand-total {
    background: rgba(59, 130, 246, 0.1) !important;
    color: var(--primary);
}

.cube-total-row td,
.cube-total-row th {
    background: var(--bg-secondary, #F1F5F9) !important;
    border-top: 2px solid var(--border);
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .ai-layout {
        flex-direction: column;
        height: auto;
    }

    .ai-chat-panel {
        width: 100%;
        min-width: auto;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .ai-canvas-panel {
        min-height: 50vh;
    }

    .cube-controls {
        flex-direction: column;
    }

    .cube-select {
        min-width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════
   AI Report Page — CM 자동 보고서
   ═══════════════════════════════════════════════════════════ */
.rpt-page {
    padding: 0 4px;
}

.rpt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 4px 12px;
    flex-wrap: wrap;
    gap: 12px;
}

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

.rpt-title-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    background: var(--gradient-brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.rpt-title {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin: 0;
}

.rpt-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 2px 0 0;
}

.rpt-date {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-input);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-default);
}

/* Tabs */
.rpt-tabs {
    display: flex;
    gap: 4px;
    padding: 4px 4px 0;
    border-bottom: 1px solid var(--border-default);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rpt-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: 1px solid transparent;
    border-bottom: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    white-space: nowrap;
}

.rpt-tab i {
    font-size: 0.78rem;
    opacity: 0.6;
}

.rpt-tab:hover {
    color: var(--accent);
    background: var(--bg-hover);
}

.rpt-tab.active {
    color: var(--accent);
    background: var(--bg-card);
    border-color: var(--border-default);
    position: relative;
}

.rpt-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--bg-card);
}

.rpt-tab.active i {
    opacity: 1;
}

/* Content */
.rpt-content {
    padding: 16px 4px 32px;
    min-height: 400px;
}

.rpt-section {
    animation: fadeSlideUp 0.4s var(--ease) both;
}

.rpt-report-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.rpt-report-title i {
    color: var(--accent);
    font-size: 1rem;
}

.rpt-report-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* KPI Row */
.rpt-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

/* Cards */
.rpt-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    margin-bottom: 12px;
    transition: box-shadow 0.2s var(--ease);
}

.rpt-card:hover {
    box-shadow: var(--shadow-md);
}

.rpt-card-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rpt-card-title i {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.rpt-card-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 12px;
    margin-bottom: 12px;
}

.rpt-card-sm {
    min-height: 0;
}

.rpt-card-lg {
    min-height: 0;
}

.rpt-card-danger {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.02);
}

/* Progress bar */
.rpt-bar-bg {
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
    width: 100%;
}

.rpt-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s var(--ease-out);
}

/* Heatmap */
.rpt-heatmap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0;
}

.rpt-heat-cell {
    border-radius: var(--radius-md);
    padding: 10px 14px;
    text-align: center;
    min-width: 80px;
    transition: transform 0.15s var(--ease);
}

.rpt-heat-cell:hover {
    transform: scale(1.05);
}

.rpt-heat-name {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.rpt-heat-val {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 800;
}

/* Placeholder */
.rpt-placeholder-card {
    text-align: center;
    padding: 48px 24px;
    background: var(--bg-card);
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-lg);
}

.rpt-placeholder-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-input);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 16px;
}

.rpt-placeholder-card h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.rpt-placeholder-card p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.rpt-placeholder-preview {
    max-width: 600px;
    margin: 20px auto 0;
    text-align: left;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* Dark theme overrides for report */
[data-theme="dark"] .rpt-card-danger {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.06);
}

[data-theme="dark"] .rpt-placeholder-card {
    border-color: var(--border-hover);
}

/* Responsive */
@media (max-width: 768px) {
    .rpt-card-row {
        grid-template-columns: 1fr;
    }

    .rpt-kpi-row {
        grid-template-columns: 1fr 1fr;
    }

    .rpt-tabs {
        gap: 2px;
    }

    .rpt-tab {
        padding: 8px 12px;
        font-size: 0.72rem;
    }
}

/* Company link */
.rpt-company-link {
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s var(--ease);
}

.rpt-company-link:hover {
    color: var(--accent-bright);
    text-decoration: underline;
}

.rpt-company-link:hover i {
    opacity: 0.8 !important;
}

/* Close button */
.rpt-close-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: all 0.15s var(--ease);
}

.rpt-close-btn:hover {
    background: var(--danger-subtle);
    color: var(--danger);
    border-color: var(--danger);
}

/* Mini KPI (for detail card) */
.rpt-mini-kpi {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--bg-input);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
}

.rpt-mini-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 500;
}

.rpt-mini-value {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Detail card */
.rpt-detail-card {
    margin-top: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   UI/UX ENHANCEMENTS — Premium Polish
   ═══════════════════════════════════════════════════════════════ */

/* ─── 1. Sidebar 3D Spinning Cube ───────────────────────── */
.sidebar-cube-area {
    padding: 12px 0 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-default);
    background: var(--bg-sidebar);
    overflow: hidden;
}

.sidebar-cube-area .cube-container {
    width: 80px;
    height: 80px;
    perspective: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes rotateCube3D {
    0% {
        transform: rotateX(0deg) rotateY(0deg);
    }

    100% {
        transform: rotateX(360deg) rotateY(360deg);
    }
}

.sidebar-cube-area .cube {
    width: 40px;
    height: 40px;
    position: relative;
    transform-style: preserve-3d;
    animation: rotateCube3D 15s infinite linear;
}

.sidebar-cube-area .cube:hover {
    animation-duration: 5s;
}

.sidebar-cube-area .cube div {
    position: absolute;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 8px;
    letter-spacing: 0.5px;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: linear-gradient(135deg,
            rgba(0, 150, 199, 0.45),
            rgba(0, 180, 216, 0.45),
            rgba(72, 202, 228, 0.45));
    backdrop-filter: blur(5px);
    box-shadow:
        inset 0 0 10px rgba(255, 255, 255, 0.15),
        0 0 8px rgba(0, 180, 216, 0.3);
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}

.sidebar-cube-area .front {
    transform: translateZ(20px);
}

.sidebar-cube-area .back {
    transform: rotateY(180deg) translateZ(20px);
}

.sidebar-cube-area .right {
    transform: rotateY(90deg) translateZ(20px);
}

.sidebar-cube-area .left {
    transform: rotateY(-90deg) translateZ(20px);
}

.sidebar-cube-area .top {
    transform: rotateX(90deg) translateZ(20px);
}

.sidebar-cube-area .bottom {
    transform: rotateX(-90deg) translateZ(20px);
}

.sidebar-cube-area .cube-label {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ─── 2. AI Typing Animation ────────────────────────────── */
@keyframes typingDots {

    0%,
    20% {
        opacity: 0.2;
    }

    50% {
        opacity: 1;
    }

    80%,
    100% {
        opacity: 0.2;
    }
}

.ai-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
}

.ai-typing-indicator .dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: typingDots 1.4s ease-in-out infinite;
}

.ai-typing-indicator .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-typing-indicator .dot:nth-child(3) {
    animation-delay: 0.4s;
}

.ai-msg-typing .ai-msg-bubble {
    min-height: 38px;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ai-msg {
    animation: messageAppear 0.3s var(--ease-out);
}

/* ─── 3. Data Grid Enhancements ─────────────────────────── */
.ai-data-table tbody tr:nth-child(even) {
    background: rgba(59, 130, 246, 0.02);
}

[data-theme="dark"] .ai-data-table tbody tr:nth-child(even) {
    background: rgba(59, 130, 246, 0.04);
}

.ai-data-table tbody tr {
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.ai-data-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.06) !important;
    border-left-color: var(--accent);
}

[data-theme="dark"] .ai-data-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.1) !important;
}

.ai-data-table td.num-cell {
    text-align: right;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.ai-data-table td.currency-cell {
    text-align: right;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
}

.ai-grid-sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease;
}

.ai-grid-sortable:hover {
    color: var(--accent) !important;
}

/* ─── 4. AI Report Tab Indicators ───────────────────────── */
.rpt-tab-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 4px;
    vertical-align: middle;
    background: var(--text-muted);
    opacity: 0.4;
    transition: all 0.3s ease;
}

.rpt-tab-dot.generated {
    background: var(--success);
    opacity: 1;
    box-shadow: 0 0 4px var(--success);
}

/* Tab transition */
.rpt-tab-content {
    animation: fadeSlideUp 0.3s var(--ease-out);
}

/* ─── 5. Count-up Animation Support ─────────────────────── */
.countup-value {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

@keyframes countupFlash {
    0% {
        color: var(--accent);
    }

    100% {
        color: inherit;
    }
}

.countup-done {
    animation: countupFlash 0.6s ease-out;
}

/* ─── 6. Chart Tooltip Customization ────────────────────── */
.chart-custom-tooltip {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-default) !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    box-shadow: var(--shadow-lg) !important;
    font-family: var(--font-sans) !important;
    font-size: 0.72rem !important;
    max-width: 220px;
}

.chart-custom-tooltip .tooltip-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 0.74rem;
}

.chart-custom-tooltip .tooltip-value {
    color: var(--accent);
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.chart-custom-tooltip .tooltip-pct {
    color: var(--text-muted);
    font-size: 0.62rem;
    margin-top: 2px;
}

/* ─── 7. Dark Mode Refinements ──────────────────────────── */
[data-theme="dark"] .ai-msg-ai .ai-msg-bubble,
[data-theme="dark"] .ai-msg-system .ai-msg-bubble {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(71, 85, 105, 0.4);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .ai-msg-user .ai-msg-bubble {
    background: linear-gradient(135deg, #1e40af, #1d4ed8);
    border-color: transparent;
}

[data-theme="dark"] .card,
[data-theme="dark"] .ai-kpi-card {
    border: 1px solid rgba(71, 85, 105, 0.3);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(96, 165, 250, 0.05);
}

[data-theme="dark"] .ai-data-table {
    border-color: rgba(71, 85, 105, 0.3);
}

[data-theme="dark"] .ai-data-table th {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(71, 85, 105, 0.3);
}

[data-theme="dark"] .sidebar-cube-area {
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.98), rgba(15, 23, 42, 0.95));
    border-color: rgba(71, 85, 105, 0.3);
}

[data-theme="dark"] .rpt-card {
    border-color: rgba(71, 85, 105, 0.3);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* AI Chat Glow effect for active user */
.ai-msg-user .ai-msg-bubble {
    box-shadow: 0 1px 6px rgba(37, 99, 235, 0.12);
}

/* Smooth page transition enhancement */
#content-area {
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

/* ═══════════════════════════════════════════════════════════════
   LANDING PAGE — Apple-Inspired Minimal Design
   ═══════════════════════════════════════════════════════════════ */

#landing-page {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #FBFBFD;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: 'Noto Sans KR', 'Inter', -apple-system, sans-serif;
    color: #1D1D1F;
    -webkit-font-smoothing: antialiased;
}

#landing-bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.85;
}

.landing-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 32px 48px;
    position: relative;
    z-index: 1;
}

/* Header */
.landing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid #D2D2D7;
    margin-bottom: 56px;
}

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

.landing-logo-cube {
    width: 40px;
    height: 40px;
    perspective: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.landing-cube-container {
    width: 40px;
    height: 40px;
    perspective: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.landing-cube {
    width: 24px;
    height: 24px;
    position: relative;
    transform-style: preserve-3d;
    animation: rotateCube3D 15s infinite linear;
}

.landing-cube div {
    position: absolute;
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 5px;
    letter-spacing: 0.3px;
    color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #1D1D1F;
    text-shadow: none;
    backdrop-filter: none;
    box-shadow: none;
}

.lc-front {
    transform: translateZ(12px);
}

.lc-back {
    transform: rotateY(180deg) translateZ(12px);
}

.lc-right {
    transform: rotateY(90deg) translateZ(12px);
}

.lc-left {
    transform: rotateY(-90deg) translateZ(12px);
}

.lc-top {
    transform: rotateX(90deg) translateZ(12px);
}

.lc-bottom {
    transform: rotateX(-90deg) translateZ(12px);
}

.landing-logo-text {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #1D1D1F;
}

.landing-header-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #86868B;
    text-decoration: none;
    transition: color 0.25s ease;
}

.landing-header-link:hover {
    color: #0071E3;
}

.landing-header-link i {
    font-size: 0.78rem;
}

/* Hero */
.landing-hero {
    text-align: center;
    padding: 0 0 56px;
}

.landing-hero-inner {
    max-width: 900px;
    margin: 0 auto;
}

.landing-hero-eyebrow {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #86868B;
    margin-bottom: 24px;
}

.landing-hero-title {
    font-size: 3.4rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.3;
    color: #1D1D1F;
    margin: 0 0 28px;
}

.landing-hero-accent {
    background: linear-gradient(135deg, #0071E3 0%, #00C7FF 50%, #0071E3 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: landingAccentShimmer 3s ease-in-out infinite;
    font-weight: 900;
}

@keyframes landingAccentShimmer {

    0%,
    100% {
        background-position: 0% center;
    }

    50% {
        background-position: 200% center;
    }
}

.landing-hero-desc {
    font-size: 1.15rem;
    color: #86868B;
    line-height: 1.8;
    margin: 0;
}

/* API Key */
.landing-api-section {
    margin-bottom: 64px;
}

.landing-api-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #fff;
    border: 1px solid #D2D2D7;
    border-radius: 12px;
    padding: 16px 20px;
    transition: box-shadow 0.3s ease;
}

.landing-api-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.landing-api-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.landing-api-key-icon {
    font-size: 0.85rem;
    color: #86868B;
}

.landing-api-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1D1D1F;
}

.landing-api-sub {
    font-size: 0.62rem;
    color: #86868B;
    margin-top: 1px;
}

.landing-api-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 380px;
}

.landing-api-input-wrap {
    position: relative;
    flex: 1;
}

.landing-api-input {
    width: 100%;
    padding: 8px 36px 8px 12px;
    border-radius: 8px;
    border: 1.5px solid #D2D2D7;
    background: #FBFBFD;
    color: #1D1D1F;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.landing-api-input::placeholder {
    color: #C7C7CC;
}

.landing-api-input:focus {
    border-color: #1D1D1F;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.landing-api-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #86868B;
    cursor: pointer;
    padding: 4px 6px;
    font-size: 0.72rem;
    transition: color 0.2s;
}

.landing-api-eye:hover {
    color: #1D1D1F;
}

.landing-api-link {
    font-size: 0.65rem;
    color: #0071E3;
    text-decoration: none;
    white-space: nowrap;
    font-weight: 500;
    transition: opacity 0.2s;
}

.landing-api-link:hover {
    opacity: 0.7;
}

.landing-api-link i {
    font-size: 0.5rem;
    margin-left: 2px;
}

/* ─── Data Pipeline Diagram ─── */
.landing-pipeline-section {
    margin-bottom: 80px;
}

.pipeline-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 56px 32px;
    position: relative;
    background: rgba(245, 245, 247, 0.1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(232, 232, 237, 0.25);
    border-radius: 20px;
}

/* Columns */
.pipeline-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.pipeline-inputs,
.pipeline-outputs {
    width: 160px;
    flex-shrink: 0;
}

.pipeline-center {
    flex-shrink: 0;
    width: 220px;
    text-align: center;
}

/* Labels */
.pipeline-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #86868B;
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
}

/* Nodes */
.pipeline-node {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(210, 210, 215, 0.25);
    transition: all 0.3s ease;
    animation: pipelineNodeEntry 0.6s ease both;
    animation-delay: var(--delay, 0s);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.pipeline-node:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
    border-color: #0071E3;
}

.pipeline-node i {
    font-size: 0.95rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.pipeline-node-input i {
    color: #0071E3;
}

.pipeline-node-output i {
    color: #1D1D1F;
}

.pipeline-node span {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1D1D1F;
    white-space: nowrap;
}

@keyframes pipelineNodeEntry {
    0% {
        opacity: 0;
        transform: translateY(16px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Flow arrows */
.pipeline-flow {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    width: 100px;
    flex-shrink: 0;
    padding: 20px 0;
}

.pipeline-arrow {
    height: 2px;
    width: 100%;
    background: linear-gradient(90deg, #D2D2D7 0%, #a0a0a5 50%, #D2D2D7 100%);
    border-radius: 1px;
    position: relative;
    overflow: visible;
}

/* Animated particles */
.pipeline-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    animation: pipelineParticle 2s ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

.pipeline-flow-left .pipeline-particle {
    background: radial-gradient(circle, #0071E3, rgba(0, 113, 227, 0.2));
    box-shadow: 0 0 12px rgba(0, 113, 227, 0.6), 0 0 4px rgba(0, 113, 227, 0.9);
}

.pipeline-flow-right .pipeline-particle {
    background: radial-gradient(circle, #34C759, rgba(52, 199, 89, 0.2));
    box-shadow: 0 0 12px rgba(52, 199, 89, 0.6), 0 0 4px rgba(52, 199, 89, 0.9);
}

@keyframes pipelineParticle {
    0% {
        left: -10px;
        opacity: 0;
    }

    8% {
        opacity: 1;
    }

    92% {
        opacity: 1;
    }

    100% {
        left: calc(100% + 10px);
        opacity: 0;
    }
}

/* Center Cube */
.pipeline-cube-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 160px;
    height: 160px;
    margin: 0 auto 16px;
}

.pipeline-cube-glow {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 180, 216, 0.18) 0%, rgba(72, 202, 228, 0.08) 50%, transparent 70%);
    animation: pipelineCubeGlow 3s ease-in-out infinite;
}

@keyframes pipelineCubeGlow {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.4);
        opacity: 1;
    }
}

.pipeline-cube-container {
    width: 160px;
    height: 160px;
    perspective: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.pipeline-cube {
    width: 80px;
    height: 80px;
    position: relative;
    transform-style: preserve-3d;
    animation: rotateCube3D 12s infinite linear;
}

.pipeline-cube div {
    position: absolute;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.8px;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: linear-gradient(135deg,
            rgba(0, 150, 199, 0.5),
            rgba(0, 180, 216, 0.5),
            rgba(72, 202, 228, 0.5));
    backdrop-filter: blur(8px);
    box-shadow:
        inset 0 0 16px rgba(255, 255, 255, 0.15),
        0 0 14px rgba(0, 180, 216, 0.35);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.pc-front {
    transform: translateZ(40px);
}

.pc-back {
    transform: rotateY(180deg) translateZ(40px);
}

.pc-right {
    transform: rotateY(90deg) translateZ(40px);
}

.pc-left {
    transform: rotateY(-90deg) translateZ(40px);
}

.pc-top {
    transform: rotateX(90deg) translateZ(40px);
}

.pc-bottom {
    transform: rotateX(-90deg) translateZ(40px);
}

.pipeline-center-label {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1D1D1F;
    letter-spacing: -0.02em;
}

.pipeline-center-sub {
    font-size: 0.78rem;
    color: #86868B;
    margin-top: 4px;
}

/* Pipeline responsive */
@media (max-width: 768px) {
    .pipeline-diagram {
        flex-direction: column;
        gap: 16px;
        padding: 24px 0;
    }

    .pipeline-inputs,
    .pipeline-outputs {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .pipeline-node {
        width: auto;
    }

    .pipeline-label {
        width: 100%;
        text-align: center;
    }

    .pipeline-flow {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        gap: 12px;
        padding: 0;
        height: 40px;
    }

    .pipeline-arrow {
        width: 2px;
        height: 100%;
    }

    .pipeline-particle {
        left: 50% !important;
        transform: translateX(-50%);
        animation: pipelineParticleVert 1.8s ease-in-out infinite;
        animation-delay: var(--delay, 0s);
    }

    @keyframes pipelineParticleVert {
        0% {
            top: -8px;
            opacity: 0;
        }

        10% {
            opacity: 1;
        }

        90% {
            opacity: 1;
        }

        100% {
            top: calc(100% + 8px);
            opacity: 0;
        }
    }

    .pipeline-center {
        width: auto;
    }

    .pipeline-cube-wrap {
        width: 100px;
        height: 100px;
        margin-bottom: 8px;
    }
}

/* Features */
.landing-features-section {
    margin-bottom: 64px;
}

.landing-section-header {
    margin-bottom: 40px;
}

.landing-section-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #1D1D1F;
    margin: 0 0 8px;
}

.landing-section-header p {
    font-size: 1rem;
    color: #86868B;
    margin: 0;
    line-height: 1.6;
}

.landing-fcard-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.landing-fcard {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    background: #fff;
    border: 1px solid #D2D2D7;
    border-radius: 12px;
    padding: 28px 32px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.landing-fcard:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
}

.landing-fcard-num {
    font-size: 2.4rem;
    font-weight: 900;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.04em;
    line-height: 1;
    flex-shrink: 0;
    background: linear-gradient(180deg, #1d1d1f 0%, #86868B 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    min-width: 48px;
    padding-top: 2px;
}

.landing-fcard-body {
    flex: 1;
}

.landing-fcard h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1D1D1F;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.landing-fcard p {
    font-size: 0.88rem;
    color: #86868B;
    line-height: 1.7;
    margin: 0;
}

/* Tech Stack */
.landing-tech-section {
    margin-bottom: 56px;
}

.landing-tech-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #86868B;
    text-align: center;
    margin-bottom: 14px;
    font-family: 'Inter', sans-serif;
}

.landing-tech-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 100%);
    border: 1px solid #D2D2D7;
    border-radius: 12px;
    padding: 24px 36px;
}

.landing-tech-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.landing-tech-item i {
    font-size: 1.2rem;
    color: #86868B;
}

.landing-tech-item strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1D1D1F;
}

.landing-tech-item span {
    display: block;
    font-size: 0.7rem;
    color: #86868B;
}

.landing-tech-divider {
    width: 1px;
    height: 32px;
    background: #D2D2D7;
}

/* CTA Button */
.landing-cta-section {
    text-align: center;
    margin-bottom: 48px;
}

.landing-start-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 64px;
    border-radius: 12px;
    border: none;
    background-color: #1D1D1F;
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 240px;
    min-height: 54px;
    letter-spacing: -0.01em;
}

.landing-start-btn:hover {
    opacity: 0.88;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.landing-start-btn:active {
    transform: translateY(0);
    opacity: 0.95;
}

.landing-start-text,
.landing-start-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.landing-mini-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: landingSpin 0.8s linear infinite;
}

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

/* Footer — see new styles below */
.landing-footer-dot {
    color: #D2D2D7;
}

/* Responsive */
@media (max-width: 768px) {
    .landing-fcard {
        flex-direction: column;
        gap: 12px;
        padding: 20px 20px;
    }

    .landing-fcard-num {
        font-size: 1.8rem;
        min-width: auto;
    }

    .landing-section-header h2 {
        font-size: 1.4rem;
    }

    .landing-hero-title {
        font-size: 2.2rem;
    }

    .landing-content {
        padding: 0 16px 32px;
    }

    .landing-api-card {
        flex-direction: column;
        align-items: stretch;
    }

    .landing-api-right {
        max-width: 100%;
    }

    .landing-tech-row {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }

    .landing-tech-divider {
        width: 60px;
        height: 1px;
    }
}

/* Exit Animation */
#landing-page.landing-exit {
    animation: landingFadeOut 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes landingFadeOut {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        pointer-events: none;
    }
}

/* Enter Animation (return from dashboard) */
#landing-page.landing-enter {
    animation: landingFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes landingFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sidebar Home Button */
.sidebar-home-btn {
    border-top: 1px solid var(--border) !important;
    margin-bottom: 4px;
}

.sidebar-home-btn i {
    color: #0071E3;
}

.sidebar-home-btn:hover {
    background: rgba(0, 113, 227, 0.08) !important;
}

/* ═══════════════════════════════════════════════════════════════
   SCROLL REVEAL ANIMATION
   ═══════════════════════════════════════════════════════════════ */
.landing-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.landing-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════
   STATS COUNTER SECTION
   ═══════════════════════════════════════════════════════════════ */
.landing-stats-section {
    margin-bottom: 48px;
}

.landing-stats-row {
    display: flex;
    justify-content: center;
    gap: 48px;
}

.landing-stat {
    text-align: center;
}

.landing-stat-num {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #0071E3 0%, #00C7FF 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
    margin-bottom: 6px;
    font-family: 'Inter', sans-serif;
}

.landing-stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #86868B;
    letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════════
   HOW IT WORKS SECTION
   ═══════════════════════════════════════════════════════════════ */
.landing-how-section {
    margin-bottom: 80px;
}

.landing-how-row {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 24px;
}

.landing-how-step {
    text-align: center;
    max-width: 240px;
    flex: 1;
}

.landing-how-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, #0071E3 0%, #00C7FF 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(0, 113, 227, 0.2);
}

.landing-how-icon i {
    font-size: 1.4rem;
    color: #fff;
}

.landing-how-num {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: #0071E3;
    margin-bottom: 8px;
    font-family: 'Inter', sans-serif;
}

.landing-how-step h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1D1D1F;
    margin: 0 0 10px;
}

.landing-how-step p {
    font-size: 0.82rem;
    color: #86868B;
    line-height: 1.7;
    margin: 0;
}

.landing-how-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 28px;
    color: #D2D2D7;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD PREVIEW SECTION
   ═══════════════════════════════════════════════════════════════ */
.landing-preview-section {
    margin-bottom: 80px;
}

.landing-preview-card {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #D2D2D7;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.08);
    background: #fff;
}

.landing-preview-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #F5F5F7;
    border-bottom: 1px solid #E5E5EA;
}

.preview-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.preview-title {
    margin-left: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #86868B;
    letter-spacing: 0.02em;
}

.landing-preview-body {
    display: flex;
    min-height: 280px;
}

.preview-sidebar-mock {
    width: 160px;
    background: #FAFAFA;
    border-right: 1px solid #E5E5EA;
    padding: 12px 0;
    flex-shrink: 0;
}

.preview-nav-item {
    padding: 7px 16px;
    font-size: 0.68rem;
    font-weight: 500;
    color: #86868B;
    cursor: default;
    transition: background 0.2s;
}

.preview-nav-item.active {
    background: rgba(0, 113, 227, 0.08);
    color: #0071E3;
    font-weight: 600;
    border-left: 2px solid #0071E3;
}

.preview-nav-item.ai {
    color: #0071E3;
    font-weight: 600;
}

.preview-main-mock {
    flex: 1;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.preview-kpi-row {
    display: flex;
    gap: 16px;
}

.preview-kpi {
    flex: 1;
    background: #F5F5F7;
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
}

.preview-kpi-val {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1D1D1F;
    margin-bottom: 4px;
    font-family: 'Inter', sans-serif;
}

.preview-kpi-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #86868B;
}

.preview-chart-row {
    display: flex;
    gap: 16px;
    flex: 1;
}

.preview-chart {
    flex: 1;
    background: #F5F5F7;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    min-height: 100px;
    position: relative;
}

.preview-chart-bar {
    flex: 1;
    height: var(--h, 50%);
    background: linear-gradient(180deg, #0071E3, #00C7FF);
    border-radius: 4px 4px 0 0;
}

.preview-chart-line {
    position: absolute;
    inset: 20px 16px;
    background: linear-gradient(90deg, transparent 0%, #0071E3 20%, #00C7FF 50%, #0071E3 80%, transparent 100%);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60'%3E%3Cpath d='M0 50 Q25 10 50 30 T100 20 T150 40 T200 15' fill='none' stroke='black' stroke-width='3'/%3E%3C/svg%3E") no-repeat center/contain;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60'%3E%3Cpath d='M0 50 Q25 10 50 30 T100 20 T150 40 T200 15' fill='none' stroke='black' stroke-width='3'/%3E%3C/svg%3E") no-repeat center/contain;
    opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER VERSION BADGE
   ═══════════════════════════════════════════════════════════════ */
.landing-footer {
    text-align: center;
    padding: 20px 0 0;
    border-top: 1px solid #E5E5EA;
    font-size: 0.62rem;
    color: #86868B;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.landing-footer-main {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.landing-footer-version {
    font-size: 0.58rem;
    font-weight: 600;
    color: #B0B0B5;
    letter-spacing: 0.5px;
    padding: 3px 12px;
    background: #F0F0F2;
    border-radius: 20px;
    display: inline-block;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — New Sections
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .landing-stats-row {
        flex-wrap: wrap;
        gap: 24px;
    }

    .landing-stat {
        min-width: 120px;
    }

    .landing-stat-num {
        font-size: 2.2rem;
    }

    .landing-how-row {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .landing-how-arrow {
        transform: rotate(90deg);
        padding-top: 0;
    }

    .landing-preview-body {
        flex-direction: column;
    }

    .preview-sidebar-mock {
        width: 100%;
        display: flex;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid #E5E5EA;
        padding: 8px;
        gap: 4px;
    }

    .preview-nav-item {
        white-space: nowrap;
        padding: 5px 10px;
        border-radius: 6px;
    }

    .preview-nav-item.active {
        border-left: none;
    }

    .preview-kpi-row {
        flex-wrap: wrap;
    }

    .preview-kpi {
        min-width: 80px;
    }
}

/* end of file */