@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* Visually hidden (screen reader only) — Radix Dialog a11y */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

:root {
    /* Surface */
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --bg-input: #f8fafc;
    --bg-hover: #f1f5f9;

    /* Text (MD2 hierarchy) */
    --text-heading: #344767;
    --text-primary: #7b809a;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --text-label: #475569;
    --text-inverse: #ffffff;

    /* Brand */
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-light: #eff6ff;
    --color-primary-bg: rgba(37,99,235,0.08);

    /* Semantic (MD2) */
    --color-success: #4CAF50;
    --color-success-light: #dcfce7;
    --color-warning: #fb8c00;
    --color-warning-light: #fff8f0;
    --color-danger: #F44335;
    --color-danger-light: #fef2f2;
    --color-info: #1A73E8;
    --color-info-light: #eef2ff;

    /* Borders */
    --border-color: #dee2e6;
    --border-light: #f1f5f9;
    --border-strong: #cbd5e1;

    /* Border Radius (MD2) */
    --border-radius-xs: 2px;
    --border-radius-sm: 3px;
    --border-radius-md: 6px;
    --border-radius-lg: 8px;
    --border-radius-xl: 12px;
    --border-radius-2xl: 16px;
    --border-radius-pill: 30px;
    --border-radius-section: 10rem;

    /* Shadows (MD2) */
    --shadow-xs: 0 2px 9px -5px rgba(0,0,0,.15);
    --shadow-sm: 0 5px 10px 0 rgba(0,0,0,.12);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);
    --shadow-btn: 0 4px 7px -1px rgba(0,0,0,.11), 0 2px 4px -1px rgba(0,0,0,.07);

    /* Colored Shadows (MD2) */
    --shadow-colored-primary: 0 4px 20px 0 rgba(0,0,0,.14), 0 7px 10px -5px rgba(37,99,235,.4);
    --shadow-colored-success: 0 4px 20px 0 rgba(0,0,0,.14), 0 7px 10px -5px rgba(76,175,80,.4);
    --shadow-colored-warning: 0 4px 20px 0 rgba(0,0,0,.14), 0 7px 10px -5px rgba(251,140,0,.4);
    --shadow-colored-danger:  0 4px 20px 0 rgba(0,0,0,.14), 0 7px 10px -5px rgba(244,67,53,.4);
    --shadow-colored-info:    0 4px 20px 0 rgba(0,0,0,.14), 0 7px 10px -5px rgba(26,115,232,.4);
    --shadow-colored-purple:  0 4px 20px 0 rgba(0,0,0,.14), 0 7px 10px -5px rgba(124,58,237,.4);
    --shadow-colored-teal:    0 4px 20px 0 rgba(0,0,0,.14), 0 7px 10px -5px rgba(13,148,136,.4);

    /* Gradients (MD2) */
    --gradient-primary: linear-gradient(135deg, #5b7fff, #2563eb);
    --gradient-primary-dark: linear-gradient(135deg, #1d4ed8, #1e40af);
    --gradient-info: linear-gradient(135deg, #49a3f1, #1A73E8);
    --gradient-success: linear-gradient(135deg, #66BB6A, #43A047);
    --gradient-warning: linear-gradient(135deg, #FFA726, #FB8C00);
    --gradient-danger: linear-gradient(135deg, #EF5350, #E53935);
    --gradient-purple: linear-gradient(135deg, #7c3aed, #6366f1);
    --gradient-teal: linear-gradient(135deg, #14b8a6, #0d9488);
    --gradient-dark: linear-gradient(135deg, #42424a, #191919);
    --gradient-sidebar: linear-gradient(180deg, #0f172a, #1a2035);
    --gradient-header: linear-gradient(135deg, #f8fafc, #f1f5f9);

    /* Fonts */
    --font-primary: 'Inter', sans-serif;
    --font-header: 'Outfit', sans-serif;

    /* Metrics */
    --color-call-em: #22c55e;
    --color-row-em: #f97316;
    --color-struct-em: #15803d;
    --color-schema-em: #ef4444;

    /* Transitions */
    --transition-btn: all .15s ease-in;
    --transition-card: all .2s ease;
    --transition-panel: transform .35s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
}

button, [role="button"] {
    white-space: nowrap !important;
}

body {
    background-color: var(--bg-color) !important;
    color: var(--text-primary);
    font-family: var(--font-primary) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 14px;
    line-height: 1.5;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
::-webkit-scrollbar-track {
    background: transparent;
}

/* ============================================================
   TREE VIEW
   ============================================================ */

.sog-tree-node-content {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 4px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
    font-size: 14px;
}
.sog-tree-node-content:hover {
    background: var(--bg-color);
}

.sog-tree-label {
    color: var(--text-heading);
    font-weight: 450;
    white-space: nowrap;
    font-size: 14px;
}

.sog-tree-star {
    color: #eab308;
    display: inline-flex;
    align-items: center;
}

.sog-tree-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.sog-tree-icon::before {
    content: '';
    display: block;
    width: 14px;
    height: 14px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.sog-tree-icon-star::before {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='%23eab308' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E");
    width: 13px;
    height: 13px;
}
.sog-tree-icon-folder::before {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='%2364748b' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z'/%3E%3C/svg%3E");
}
.sog-tree-icon-table::before {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='%2364748b' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z'/%3E%3C/svg%3E");
}
.sog-tree-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}
.sog-tree-chevron::before {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.sog-tree-chevron-right::before {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='%2394a3b8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z'/%3E%3C/svg%3E");
}
.sog-tree-chevron-down::before {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='%2394a3b8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z'/%3E%3C/svg%3E");
}

/* Section Type Badges */
.sog-type-tab,
.sog-type-form,
.sog-type-outline,
.sog-type-hybrid,
.sog-type-matrix {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
}
.sog-type-tab    { background: #eef2ff; color: #1A73E8; }
.sog-type-form   { background: #f5f3ff; color: #7c3aed; }
.sog-type-outline { background: #f0fdf4; color: #4CAF50; }
.sog-type-hybrid { background: #fff7ed; color: #c2410c; }
.sog-type-matrix { background: #f0fdfa; color: #0d9488; }

/* ============================================================
   PREVIEW ROW-TYPE BADGES
   ============================================================ */

.sog-rt-subtotal {
    font-weight: 700;
    color: #1A73E8;
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
}
.sog-rt-header {
    font-weight: 600;
    color: #1e293b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
}
.sog-rt-detail {
    color: #64748b;
    padding: 2px 8px;
    font-size: 0.8em;
}

/* ============================================================
   TABLE
   ============================================================ */

.sog-table-wrapper {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
}

.sog-table-wrapper .rt-TableRoot {
    min-width: 100%;
}

.sog-table-wrapper table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
    white-space: nowrap;
}

.sog-table-wrapper thead {
    background: var(--gradient-header);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.sog-table-wrapper th {
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-heading);
    border-right: 1px solid var(--border-light);
    border-bottom: 2px solid var(--border-color);
    background: transparent;
    font-size: 12px;
    letter-spacing: 0.025em;
    text-transform: none;
}

.sog-table-wrapper td {
    padding: 10px 16px;
    color: var(--text-primary);
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    background: #ffffff;
    vertical-align: top;
    line-height: 1.5;
    font-size: 13px;
}

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

.sog-table-wrapper tr:hover td {
    background-color: rgba(37,99,235,0.02);
}

.sog-table-wrapper tr.sog-row-critical td {
    border-left: 3px solid var(--color-danger);
    background: rgba(244,67,53,0.02);
}
.sog-table-wrapper tr.sog-row-warning td {
    border-left: 3px solid var(--color-warning);
    background: rgba(251,140,0,0.02);
}

/* ── Global sticky table headers ────────────────────────────
   Applied to ALL Reflex (Radix) tables. When the table is inside
   a scrollable container, thead stays fixed at top.
   .sog-table-wrapper overrides with gradient bg + enhanced styles.
   ──────────────────────────────────────────────────────────── */
.rt-TableRoot thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #ffffff;
}

/* ─────────────────────────────────────────────────────────────
   PROGRESS BAR (MD2 Gradient)
   ============================================================ */

.sog-progress-track {
    height: 10px;
    background: #f1f5f9;
    border-radius: var(--border-radius-pill);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
    width: 100%;
}

.sog-progress-fill {
    height: 100%;
    border-radius: var(--border-radius-pill);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.sog-progress-fill.sog-progress-primary {
    background: var(--gradient-primary);
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.sog-progress-fill.sog-progress-success {
    background: var(--gradient-success);
    box-shadow: 0 2px 8px rgba(76,175,80,0.25);
}
.sog-progress-fill.sog-progress-warning {
    background: var(--gradient-warning);
    box-shadow: 0 2px 8px rgba(251,140,0,0.25);
}
.sog-progress-fill.sog-progress-danger {
    background: var(--gradient-danger);
    box-shadow: 0 2px 8px rgba(244,67,53,0.25);
}
.sog-progress-fill.sog-progress-info {
    background: var(--gradient-info);
    box-shadow: 0 2px 8px rgba(26,115,232,0.25);
}

@keyframes sogShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.sog-progress-fill.sog-progress-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    background-size: 200% 100%;
    animation: sogShimmer 2s infinite;
}

/* ============================================================
   PROGRESS BAR (MD2 Gradient)
   ============================================================ */

.sog-action-bar {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xl);
    padding: 16px 24px;
    display: flex;
    gap: 12px;
    align-items: center;
    box-shadow: var(--shadow-md);
}

/* ============================================================
   UPLOAD ZONE
   ============================================================ */

.sog-upload-zone {
    flex: 0 0 100px;
    height: 100px;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-lg);
    background: var(--color-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-card);
}
.sog-upload-zone:hover {
    border-color: var(--color-primary);
    background: #e0f2fe;
    box-shadow: var(--shadow-colored-primary);
}

/* ============================================================
   CARD (MD2 — gradient header + colored shadow)
   ============================================================ */

.sog-card {
    background: var(--card-bg);
    border: none;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    position: relative;
    overflow: hidden;
}
.sog-card:hover {
    box-shadow: var(--shadow-colored-primary);
    transform: translateY(-2px);
}

/* Card gradient header — always visible */
.sog-card-header {
    background: var(--gradient-primary);
    padding: 20px 24px;
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
    position: relative;
}
.sog-card-header .sog-card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}
.sog-card-header .sog-card-badge {
    background: rgba(255,255,255,0.2);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

/* Card body */
.sog-card-body {
    padding: 24px;
}

/* ============================================================
   STAT CARD (dim_card replacement — always gradient top)
   ============================================================ */

.sog-stat-card {
    background: var(--card-bg);
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 20px 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex: 1;
    min-width: 100px;
}
.sog-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 1;
}
.sog-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-colored-primary);
}

/* Stat card color variants */
.sog-stat-card.sog-stat-success::before { background: var(--gradient-success); }
.sog-stat-card.sog-stat-warning::before { background: var(--gradient-warning); }
.sog-stat-card.sog-stat-danger::before  { background: var(--gradient-danger); }
.sog-stat-card.sog-stat-info::before    { background: var(--gradient-info); }

/* ============================================================
   OVERALL GAUGE CARD (large stat card)
   ============================================================ */

.sog-gauge-card {
    background: var(--card-bg);
    border: none;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-md);
    padding: 24px;
    position: relative;
    overflow: hidden;
}
.sog-gauge-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient-primary);
}

.sog-gauge-score {
    font-family: 'Outfit', sans-serif;
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
}

.sog-gauge-bar-track {
    width: 100%;
    height: 10px;
    background: var(--border-light);
    border-radius: 5px;
    overflow: hidden;
}
.sog-gauge-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--gradient-primary);
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}
.sog-gauge-bar-fill.sog-gauge-success {
    background: var(--gradient-success);
    box-shadow: 0 2px 8px rgba(76,175,80,0.3);
}
.sog-gauge-bar-fill.sog-gauge-warning {
    background: var(--gradient-warning);
    box-shadow: 0 2px 8px rgba(251,140,0,0.3);
}
.sog-gauge-bar-fill.sog-gauge-danger {
    background: var(--gradient-danger);
    box-shadow: 0 2px 8px rgba(244,67,53,0.3);
}

/* ============================================================
   METRIC BOX (MD2 — gradient header always visible)
   ============================================================ */

.sog-metric-box {
    background: var(--card-bg);
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.sog-metric-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 1;
}
.sog-metric-box:hover {
    box-shadow: var(--shadow-colored-primary);
    transform: translateY(-3px);
}

/* ============================================================
   SIDEBAR — MD2 Premium (gradient topbar + pill items + glow)
   ============================================================ */

.sog-sidebar {
    width: 250px;
    min-width: 250px;
    height: 100vh;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 40%, #1e293b 100%);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    position: sticky;
    left: 0;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.04);
}

/* Gradient top accent bar */
.sog-sidebar-topbar {
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #5b7fff, #2563eb, #7c3aed, #2563eb, #5b7fff);
    background-size: 200% 100%;
    animation: ezGradientShift 4s ease infinite;
    flex-shrink: 0;
}

/* Brand */
.sog-sidebar-brand {
    padding: 24px 16px 20px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sog-sidebar-brand-title {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.sog-sidebar-brand-sub {
    font-size: 10px;
    color: rgba(148,163,184,0.7);
    margin-top: 2px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Section label — pill bg */
.sog-sidebar-section-label {
    margin: 4px 16px 4px 16px;
    padding: 6px 12px;
    font-size: 9px;
    font-weight: 700;
    color: rgba(148,163,184,0.6);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
}

/* Accordion section header — clickable */
.sog-sidebar-section-header {
    display: flex;
    align-items: center;
    font-size: 9px;
    font-weight: 700;
    color: rgba(148,163,184,0.6);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    user-select: none;
}

.sog-sidebar-section-header:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(148,163,184,0.8);
}

/* Accordion section body — expand/collapse */
.sog-sidebar-section-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sog-sidebar-section-body.expanded {
    max-height: 500px;
}

/* Item — full-width hover box */
.sog-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    margin: 1px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    color: rgba(203,213,225,0.75);
    text-decoration: none;
    border-radius: 0;
    border-left: 3px solid transparent;
    position: relative;
    width: 100%;
}
.sog-sidebar-item:hover {
    background: rgba(255,255,255,0.08);
    color: #f1f5f9;
    border-left-color: rgba(37,99,235,0.4);
}

/* Active item — full-width gradient + left accent */
.sog-sidebar-item-active {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    margin: 1px 0;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    border-radius: 0;
    border-left: 3px solid transparent;
    background: linear-gradient(90deg, rgba(37,99,235,0.22) 0%, rgba(37,99,235,0.06) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
    position: relative;
    width: 100%;
}
.sog-sidebar-item-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #5b7fff, #2563eb);
    border-radius: 0;
    box-shadow: 0 0 10px rgba(37,99,235,0.5);
}
.sog-sidebar-item-active:hover {
    background: linear-gradient(90deg, rgba(37,99,235,0.30) 0%, rgba(37,99,235,0.10) 100%);
}

.sog-sidebar-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.55;
    transition: opacity 0.2s ease;
}
.sog-sidebar-item:hover .sog-sidebar-icon {
    opacity: 0.8;
}
.sog-sidebar-item-active .sog-sidebar-icon {
    opacity: 1;
}

/* Footer */
.sog-sidebar-footer {
    margin-top: auto;
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 10px;
    color: rgba(71,85,105,0.8);
}

/* ── Sidebar color variants (full-width) ── */
.sog-sidebar-item-green {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    margin: 1px 0;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    border-radius: 0;
    border-left: 3px solid transparent;
    background: linear-gradient(90deg, rgba(76,175,80,0.22) 0%, rgba(76,175,80,0.06) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
    position: relative;
    width: 100%;
}
.sog-sidebar-item-green::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #66BB6A, #43A047);
    border-radius: 0;
    box-shadow: 0 0 10px rgba(76,175,80,0.5);
}
.sog-sidebar-item-green:hover { background: linear-gradient(90deg, rgba(76,175,80,0.30) 0%, rgba(76,175,80,0.10) 100%); }
.sog-sidebar-item-green .sog-sidebar-icon { opacity: 1; }

.sog-sidebar-item-orange {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    margin: 1px 0;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    border-radius: 0;
    border-left: 3px solid transparent;
    background: linear-gradient(90deg, rgba(251,140,0,0.22) 0%, rgba(251,140,0,0.06) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
    position: relative;
    width: 100%;
}
.sog-sidebar-item-orange::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #FFA726, #FB8C00);
    border-radius: 0;
    box-shadow: 0 0 10px rgba(251,140,0,0.5);
}
.sog-sidebar-item-orange:hover { background: linear-gradient(90deg, rgba(251,140,0,0.30) 0%, rgba(251,140,0,0.10) 100%); }
.sog-sidebar-item-orange .sog-sidebar-icon { opacity: 1; }

.sog-sidebar-item-blue {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    margin: 1px 0;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    border-radius: 0;
    border-left: 3px solid transparent;
    background: linear-gradient(90deg, rgba(33,150,243,0.22) 0%, rgba(33,150,243,0.06) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
    position: relative;
    width: 100%;
}
.sog-sidebar-item-blue::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #42A5F5, #1E88E5);
    border-radius: 0;
    box-shadow: 0 0 10px rgba(33,150,243,0.5);
}
.sog-sidebar-item-blue:hover { background: linear-gradient(90deg, rgba(33,150,243,0.30) 0%, rgba(33,150,243,0.10) 100%); }
.sog-sidebar-item-blue .sog-sidebar-icon { opacity: 1; }

.sog-sidebar-item-teal {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    margin: 1px 0;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    border-radius: 0;
    border-left: 3px solid transparent;
    background: linear-gradient(90deg, rgba(13,148,136,0.22) 0%, rgba(13,148,136,0.06) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
    position: relative;
    width: 100%;
}
.sog-sidebar-item-teal::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #14b8a6, #0d9488);
    border-radius: 0;
    box-shadow: 0 0 10px rgba(13,148,136,0.5);
}
.sog-sidebar-item-teal:hover { background: linear-gradient(90deg, rgba(13,148,136,0.30) 0%, rgba(13,148,136,0.10) 100%); }
.sog-sidebar-item-teal .sog-sidebar-icon { opacity: 1; }

/* ── Workflow Guide: guided next-step highlight ── */
.sog-sidebar-item-guided {
    background: linear-gradient(90deg, rgba(251,191,36,0.18) 0%, rgba(251,191,36,0.04) 100%);
    border-left: 3px solid rgba(251,191,36,0.7);
}
.sog-sidebar-item-guided .sog-sidebar-icon {
    opacity: 0.9;
}
.sog-sidebar-item-guided:hover {
    background: linear-gradient(90deg, rgba(251,191,36,0.28) 0%, rgba(251,191,36,0.08) 100%);
    border-left-color: rgba(251,191,36,0.9);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */

.sog-main-content {
    min-height: 100vh;
    background: var(--bg-color);
}

/* ============================================================
   EASY MODE DASHBOARD — Premium Redesign
   ============================================================ */

.ez-fade-in {
    animation: ezFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes ezFadeIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

@keyframes ezPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

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

@keyframes ezSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Workspace ── */
.ez-workspace {
    background: linear-gradient(135deg, #eef2ff 0%, #f0f2f5 30%, #f8fafc 70%, #eff6ff 100%);
    color: var(--text-heading);
    font-family: var(--font-primary);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 32px;
    gap: 28px;
    position: relative;
}

.ez-workspace::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(37,99,235,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(124,58,237,0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.ez-workspace > * {
    position: relative;
    z-index: 1;
}

/* ── Header Bar ── */
.ez-header-bar {
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: var(--border-radius-2xl);
    padding: 16px 28px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
}

/* ── Mode Toggle ── */
.ez-mode-toggle-group {
    background: rgba(226,232,240,0.6);
    backdrop-filter: blur(8px);
    padding: 3px;
    border-radius: 30px;
    display: inline-flex;
    gap: 2px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
    border: 1px solid rgba(226,232,240,0.4);
}

.ez-mode-toggle-btn {
    border: none;
    background: transparent;
    padding: 8px 18px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 26px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-primary);
    letter-spacing: 0.02em;
}

.ez-mode-toggle-btn.ez-active {
    background: #ffffff;
    color: #1E293B;
    box-shadow: 0 2px 8px rgba(30,41,59,0.12), 0 1px 3px rgba(0,0,0,0.08);
}

/* ── Controls Bar ── */
.ez-controls-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 4px;
}

.ez-search-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 400px;
}

.ez-search-input {
    width: 100%;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(222,226,230,0.4);
    border-radius: var(--border-radius-pill);
    padding: 14px 20px 14px 48px;
    font-size: 14px;
    color: var(--text-heading);
    font-family: var(--font-primary);
    outline: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 12px rgba(0,0,0,0.02);
}

.ez-search-input:focus {
    border-color: var(--color-primary);
    background: rgba(255,255,255,0.95);
    box-shadow: 0 0 0 4px rgba(37,99,235,0.08), 0 8px 24px rgba(37,99,235,0.06);
    width: 480px;
}

/* ── Pipeline Stepper Bar — colored split chips ── */
.ez-pip-bar {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 8px;
    padding: 16px 0;
}

/* ALL pill — same width as stage chips */
.ez-pip-all {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 10px 8px;
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    border-radius: var(--border-radius-xl);
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(222,226,230,0.4);
    cursor: pointer;
    transition: all 0.25s ease;
    flex-shrink: 0;
}
.ez-pip-all:hover {
    background: rgba(239,246,255,0.9);
    border-color: rgba(37,99,235,0.3);
}
.ez-pip-all-on {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 10px 8px;
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    border-radius: var(--border-radius-xl);
    background: var(--color-primary-light);
    border: 2px solid rgba(37,99,235,0.5);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(37,99,235,0.15);
    flex-shrink: 0;
}

/* Stage chip — uniform fixed width */
.ez-pip-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 8px;
    width: 88px;
    min-width: 88px;
    max-width: 88px;
    border-radius: var(--border-radius-xl);
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(222,226,230,0.35);
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}
.ez-pip-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
}

/* Active chip: deeper bg + stronger border + colored shadow */
.ez-pip-chip-on {
    border: 2px solid;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}
.ez-pip-chip-on:hover {
    transform: translateY(-1px);
}

/* ── Stage color tokens ── */
/* Gray — stage 1 */
.ez-stage-gray .ez-pip-icon { background: #f1f5f9; color: #94a3b8; }
.ez-stage-gray .ez-pip-count { color: #64748b; }
.ez-stage-gray .ez-pip-label { color: #94a3b8; }
.ez-stage-gray.ez-pip-chip-on { background: #f1f5f9; border-color: #94a3b8; box-shadow: 0 3px 12px rgba(148,163,184,0.2); }
.ez-stage-gray .ez-pip-icon.ez-pip-icon-on { background: #94a3b8; color: #fff; box-shadow: 0 2px 6px rgba(148,163,184,0.3); }
.ez-stage-gray.ez-pip-chip-on .ez-pip-count { color: #334155; }
.ez-stage-gray.ez-pip-chip-on .ez-pip-label { color: #475569; }

/* Amber — stage 2 */
.ez-stage-amber .ez-pip-icon { background: #fffbeb; color: #d97706; }
.ez-stage-amber .ez-pip-count { color: #92400e; }
.ez-stage-amber .ez-pip-label { color: #b45309; }
.ez-stage-amber.ez-pip-chip-on { background: #fef3c7; border-color: #f59e0b; box-shadow: 0 3px 12px rgba(245,158,11,0.2); }
.ez-stage-amber .ez-pip-icon.ez-pip-icon-on { background: #f59e0b; color: #fff; box-shadow: 0 2px 6px rgba(245,158,11,0.3); }
.ez-stage-amber.ez-pip-chip-on .ez-pip-count { color: #78350f; }
.ez-stage-amber.ez-pip-chip-on .ez-pip-label { color: #92400e; }

/* Blue — stage 3 */
.ez-stage-blue .ez-pip-icon { background: #eff6ff; color: #2563eb; }
.ez-stage-blue .ez-pip-count { color: #1e40af; }
.ez-stage-blue .ez-pip-label { color: #3b82f6; }
.ez-stage-blue.ez-pip-chip-on { background: #dbeafe; border-color: #3b82f6; box-shadow: 0 3px 12px rgba(59,130,246,0.2); }
.ez-stage-blue .ez-pip-icon.ez-pip-icon-on { background: #3b82f6; color: #fff; box-shadow: 0 2px 6px rgba(59,130,246,0.3); }
.ez-stage-blue.ez-pip-chip-on .ez-pip-count { color: #1e3a8a; }
.ez-stage-blue.ez-pip-chip-on .ez-pip-label { color: #1d4ed8; }

/* Purple — stage 4 */
.ez-stage-purple .ez-pip-icon { background: #f5f3ff; color: #7c3aed; }
.ez-stage-purple .ez-pip-count { color: #5b21b6; }
.ez-stage-purple .ez-pip-label { color: #8b5cf6; }
.ez-stage-purple.ez-pip-chip-on { background: #ede9fe; border-color: #8b5cf6; box-shadow: 0 3px 12px rgba(139,92,246,0.2); }
.ez-stage-purple .ez-pip-icon.ez-pip-icon-on { background: #8b5cf6; color: #fff; box-shadow: 0 2px 6px rgba(139,92,246,0.3); }
.ez-stage-purple.ez-pip-chip-on .ez-pip-count { color: #4c1d95; }
.ez-stage-purple.ez-pip-chip-on .ez-pip-label { color: #6d28d9; }

/* Green — stage 5 */
.ez-stage-green .ez-pip-icon { background: #f0fdf4; color: #16a34a; }
.ez-stage-green .ez-pip-count { color: #15803d; }
.ez-stage-green .ez-pip-label { color: #22c55e; }
.ez-stage-green.ez-pip-chip-on { background: #dcfce7; border-color: #22c55e; box-shadow: 0 3px 12px rgba(34,197,94,0.2); }
.ez-stage-green .ez-pip-icon.ez-pip-icon-on { background: #22c55e; color: #fff; box-shadow: 0 2px 6px rgba(34,197,94,0.3); }
.ez-stage-green.ez-pip-chip-on .ez-pip-count { color: #14532d; }
.ez-stage-green.ez-pip-chip-on .ez-pip-label { color: #166534; }

.ez-stage-orange .ez-pip-icon { background: #fff7ed; color: #ea580c; }
.ez-stage-orange .ez-pip-count { color: #9a3412; }
.ez-stage-orange .ez-pip-label { color: #c2410c; }
.ez-stage-orange.ez-pip-chip-on { background: #ffedd5; border-color: #f97316; box-shadow: 0 3px 12px rgba(249,115,22,0.2); }
.ez-stage-orange .ez-pip-icon.ez-pip-icon-on { background: #f97316; color: #fff; box-shadow: 0 2px 6px rgba(249,115,22,0.3); }
.ez-stage-orange.ez-pip-chip-on .ez-pip-count { color: #7c2d12; }
.ez-stage-orange.ez-pip-chip-on .ez-pip-label { color: #9a3412; }

.ez-stage-mono .ez-pip-icon { background: #334155; color: #e2e8f0; }
.ez-stage-mono .ez-pip-count { color: #1e293b; }
.ez-stage-mono .ez-pip-label { color: #334155; }
.ez-stage-mono.ez-pip-chip-on { background: #1e293b; border-color: #1e293b; box-shadow: 0 3px 12px rgba(30,41,59,0.3); }
.ez-stage-mono .ez-pip-icon.ez-pip-icon-on { background: #1e293b; color: #fff; box-shadow: 0 2px 6px rgba(30,41,59,0.4); }
.ez-stage-mono.ez-pip-chip-on .ez-pip-count { color: #f1f5f9; }
.ez-stage-mono.ez-pip-chip-on .ez-pip-label { color: #e2e8f0; }

/* Icon circle */
.ez-pip-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.25s ease;
}
.ez-pip-icon svg { width: 13px !important; height: 13px !important; }

.ez-pip-icon-on {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ez-pip-icon-on svg { width: 13px !important; height: 13px !important; }

.ez-pip-count {
    font-size: 15px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    line-height: 1;
    transition: color 0.2s ease;
}

.ez-pip-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
    transition: color 0.2s ease;
}

/* Arrow connector */
.ez-pip-arrow {
    color: #cbd5e1;
    font-size: 14px;
    flex-shrink: 0;
    line-height: 1;
}
.ez-pip-arrow::after {
    content: '›';
    font-size: 16px;
    font-weight: 700;
    color: #cbd5e1;
}

/* ── Card Grid ── */
.ez-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
    gap: 24px;
}

/* ── Hero Case Card ── */
.ez-case-card {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.9);
    border-radius: var(--border-radius-2xl);
    box-shadow: 0 4px 24px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    padding: 0;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    user-select: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.ez-case-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: var(--gradient-primary);
    background-size: 200% 200%;
    animation: ezGradientShift 6s ease infinite;
    opacity: 1;
    transition: none;
}

/* Card stage gradients */
.ez-case-card.ez-card-s1::before { background: linear-gradient(135deg, #475569, #1e293b); background-size: 200% 200%; animation: ezGradientShift 6s ease infinite; }
.ez-case-card.ez-card-s2::before { background: linear-gradient(135deg, #fbbf24, #d97706); background-size: 200% 200%; animation: ezGradientShift 6s ease infinite; }
.ez-case-card.ez-card-s3::before { background: linear-gradient(135deg, #94a3b8, #64748b); background-size: 200% 200%; animation: ezGradientShift 6s ease infinite; }
.ez-case-card.ez-card-s4::before { background: linear-gradient(135deg, #a78bfa, #7c3aed); background-size: 200% 200%; animation: ezGradientShift 6s ease infinite; }
.ez-case-card.ez-card-s5::before { background: linear-gradient(135deg, #4ade80, #16a34a); background-size: 200% 200%; animation: ezGradientShift 6s ease infinite; }
.ez-case-card.ez-card-s6::before { background: linear-gradient(135deg, #94a3b8, #64748b); background-size: 200% 200%; animation: ezGradientShift 6s ease infinite; }
.ez-case-card.ez-card-s7::before { background: linear-gradient(135deg, #5b7fff, #2563eb); background-size: 200% 200%; animation: ezGradientShift 6s ease infinite; }

/* Card hover shadow per stage */
.ez-case-card.ez-card-s1:hover { box-shadow: 0 12px 40px rgba(30,41,59,0.3), 0 4px 12px rgba(0,0,0,0.06); }
.ez-case-card.ez-card-s2:hover { box-shadow: 0 12px 40px rgba(217,119,6,0.2), 0 4px 12px rgba(0,0,0,0.06); }
.ez-case-card.ez-card-s3:hover { box-shadow: 0 12px 40px rgba(100,116,139,0.2), 0 4px 12px rgba(0,0,0,0.06); }
.ez-case-card.ez-card-s4:hover { box-shadow: 0 12px 40px rgba(124,58,237,0.2), 0 4px 12px rgba(0,0,0,0.06); }
.ez-case-card.ez-card-s5:hover { box-shadow: 0 12px 40px rgba(22,163,74,0.2), 0 4px 12px rgba(0,0,0,0.06); }
.ez-case-card.ez-card-s6:hover { box-shadow: 0 12px 40px rgba(100,116,139,0.2), 0 4px 12px rgba(0,0,0,0.06); }
.ez-case-card.ez-card-s7:hover { box-shadow: 0 12px 40px rgba(37,99,235,0.2), 0 4px 12px rgba(0,0,0,0.06); }

.ez-case-card::after {
    content: '';
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.85));
    z-index: 1;
}

.ez-case-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 12px 40px rgba(37,99,235,0.15), 0 4px 12px rgba(0,0,0,0.06);
    border-color: transparent;
}

.ez-case-card:hover .ez-double-click-hint {
    color: var(--color-primary);
}

.ez-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 20px 24px 16px 24px;
    position: relative;
    z-index: 2;
}

.ez-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ez-card-icon {
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(8px);
    color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ez-card-title {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    font-family: var(--font-header);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.ez-status-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 30px;
    white-space: nowrap;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
    letter-spacing: 0.02em;
}

.ez-status-completed  { background: rgba(220,252,231,0.9); color: #15803d; box-shadow: 0 2px 6px rgba(76,175,80,0.2); }
.ez-status-in-progress { background: rgba(239,246,255,0.9); color: #1d4ed8; box-shadow: 0 2px 6px rgba(37,99,235,0.2); }
.ez-status-warning     { background: rgba(254,243,199,0.9); color: #d97706; box-shadow: 0 2px 6px rgba(251,140,0,0.2); }
.ez-status-critical    { background: rgba(254,226,226,0.9); color: #dc2626; box-shadow: 0 2px 6px rgba(244,67,53,0.2); }

.ez-card-body {
    display: flex;
    gap: 24px;
    align-items: center;
    padding: 0 24px 20px 24px;
    position: relative;
    z-index: 2;
}

.ez-radar-sm svg { width: 88px !important; height: 88px !important; }
.ez-radar-md svg { width: 110px !important; height: 110px !important; }

/* ── Score Circles (larger) ── */
.ez-score-circle-wrap {
    position: relative;
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.08));
}

.ez-score-circle-wrap svg {
    transform: rotate(-90deg);
    width: 96px;
    height: 96px;
}

.ez-score-circle-bg {
    fill: none;
    stroke: rgba(241,245,249,0.6);
    stroke-width: 6;
}

.ez-score-circle-fill {
    fill: none;
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.ez-circle-excellent { stroke: var(--color-success); filter: drop-shadow(0 0 6px rgba(76,175,80,0.3)); }
.ez-circle-good      { stroke: var(--color-warning); filter: drop-shadow(0 0 6px rgba(251,140,0,0.3)); }
.ez-circle-critical  { stroke: var(--color-danger); filter: drop-shadow(0 0 6px rgba(244,67,53,0.3)); }
.ez-circle-waiting   { stroke: #94a3b8; }

.ez-score-text {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ez-score-val {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-heading);
    font-family: var(--font-header);
    line-height: 1;
}

.ez-score-label {
    font-size: 8px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.04em;
}

/* ── Progress ── */
.ez-progress-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.ez-progress-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.ez-step-text {
    font-weight: 700;
    color: var(--text-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ez-pct-text {
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-left: 8px;
    font-weight: 600;
}

.ez-progress-bar-track {
    height: 8px;
    background: rgba(241,245,249,0.8);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}

.ez-progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.ez-progress-bar-fill.ez-completed {
    background: var(--gradient-success);
    box-shadow: 0 2px 8px rgba(76,175,80,0.3);
}

.ez-progress-bar-fill.ez-default {
    background: var(--gradient-primary);
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

.ez-progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    background-size: 200% 100%;
    animation: sogShimmer 2.5s ease infinite;
}

.ez-error-row {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ── Card Footer ── */
.ez-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(222,226,230,0.4);
    padding: 16px 24px;
    background: rgba(248,250,252,0.4);
}

.ez-download-group {
    display: flex;
    gap: 8px;
}

.ez-btn-download {
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(222,226,230,0.5);
    color: var(--text-secondary);
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-primary);
    letter-spacing: 0.01em;
}

.ez-btn-download:hover {
    border-color: #1E293B;
    color: #1E293B;
    background: rgba(30,41,59,0.06);
    box-shadow: 0 4px 12px rgba(30,41,59,0.1);
    transform: translateY(-2px);
}

.ez-double-click-hint {
    font-size: 11px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}

.ez-empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
    font-size: 15px;
}

/* ── Create Popup ── */
.ez-create-popup {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(222,226,230,0.4);
    border-radius: var(--border-radius-xl);
    box-shadow: 0 12px 40px rgba(0,0,0,0.1);
    padding: 8px;
    z-index: 50;
    min-width: 240px;
}

.ez-create-popup-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-heading);
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: var(--font-primary);
}

.ez-create-popup-item:hover {
    background: rgba(30,41,59,0.06);
    color: #1E293B;
    box-shadow: 0 2px 8px rgba(30,41,59,0.08);
}

/* ── Slide Panel ── */
.ez-slide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
}

.ez-slide-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15,23,42,0.2);
    backdrop-filter: blur(4px);
    z-index: 30;
}

.ez-slide-panel {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    width: 53vw;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(222,226,230,0.3);
    box-shadow: -12px 0 40px rgba(0,0,0,0.08);
    z-index: 31;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform .4s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateX(100%);
}

.ez-slide-panel.ez-slide-visible {
    transform: translateX(0);
}

.ez-slide-header {
    display: none;
}

.ez-step-pill {
    background: #1e293b;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 30px;
    padding: 4px 12px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.ez-slide-body {
    padding: 28px;
    max-width: 100%;
    box-sizing: border-box;
}
.ez-slide-body .sog-card {
    min-width: 0 !important;
    width: 100% !important;
}

/* ── Expert Editor Slide Panel (50%) ── */
.expert-slide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
}

.expert-slide-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15,23,42,0.15);
    z-index: 40;
}

.expert-slide-panel {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    width: 50vw;
    background: rgba(255,255,255,0.99);
    border-left: 1px solid rgba(222,226,230,0.4);
    box-shadow: -8px 0 32px rgba(0,0,0,0.06);
    z-index: 41;
    overflow: hidden;
    transition: transform .35s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateX(100%);
}

.expert-slide-panel.expert-slide-visible {
    transform: translateX(0);
}

/* ── EASY Mode Editor Slide Panel (Left Side) ── */
.ez-editor-slide-panel {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 47vw;
    background: rgba(255,255,255,0.99);
    border-right: 1px solid rgba(222,226,230,0.4);
    box-shadow: 8px 0 32px rgba(0,0,0,0.06);
    z-index: 35;
    overflow: hidden;
    transition: transform .35s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateX(-100%);
}

.ez-editor-slide-panel.ez-editor-slide-visible {
    transform: translateX(0);
}

/* ============================================================
   MARKDOWN REPORT BODY
   ============================================================ */

.md-report-body h1 { font-size: 24px; font-weight: 700; color: var(--text-heading); margin: 20px 0 12px; border-bottom: 2px solid var(--border-color); padding-bottom: 8px; }
.md-report-body h2 { font-size: 20px; font-weight: 700; color: var(--text-heading); margin: 16px 0 8px; border-bottom: 1px solid var(--border-color); padding-bottom: 6px; }
.md-report-body h3 { font-size: 16px; font-weight: 600; color: var(--text-heading); margin: 12px 0 6px; }
.md-report-body h4 { font-size: 14px; font-weight: 600; color: var(--text-label); margin: 10px 0 4px; }
.md-report-body p { font-size: 14px; line-height: 1.7; color: var(--text-primary); margin: 6px 0; }
.md-report-body ul, .md-report-body ol { font-size: 14px; line-height: 1.7; color: var(--text-primary); padding-left: 20px; margin: 6px 0; }
.md-report-body li { margin: 3px 0; }
.md-report-body code { background: var(--border-light); padding: 2px 6px; border-radius: 4px; font-size: 13px; font-family: 'Fira Code', monospace; }
.md-report-body pre { background: #1e293b; color: #e2e8f0; padding: 16px; border-radius: var(--border-radius-lg); overflow-x: auto; font-size: 13px; line-height: 1.6; margin: 10px 0; }
.md-report-body pre code { background: transparent; padding: 0; color: inherit; }
.md-report-body blockquote { border-left: 4px solid var(--color-info); background: var(--color-info-light); padding: 12px 16px; margin: 10px 0; border-radius: 0 6px 6px 0; }
.md-report-body blockquote p { margin: 0; color: #4338ca; }
.md-report-body table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 13px; }
.md-report-body th { background: var(--border-light); font-weight: 600; color: var(--text-heading); padding: 10px 12px; border: 1px solid var(--border-color); text-align: left; }
.md-report-body td { padding: 8px 12px; border: 1px solid var(--border-color); color: var(--text-primary); }
.md-report-body tr:nth-child(even) td { background: var(--bg-input); }
.md-report-body strong { font-weight: 700; color: var(--text-heading); }
.md-report-body em { color: var(--color-info); font-style: italic; }
.md-report-body hr { border: none; border-top: 1px solid var(--border-color); margin: 16px 0; }

/* ── Chat SVG Slide Panel ── */
.chat-svg-slide-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 9998; }
.chat-svg-slide-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.3); }
.chat-svg-slide-panel {
    position: fixed; top: 0; right: 0; width: 50vw; height: 100vh;
    background: #ffffff; z-index: 9999;
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.chat-svg-slide-panel.chat-svg-slide-visible { transform: translateX(0); }
.chat-svg-slide-body { flex: 1; padding: 16px; display: flex; justify-content: center; align-items: flex-start; }
.chat-svg-slide-body img { max-width: 100%; height: auto; image-rendering: crisp-edges; }
.chat-msg-content img { max-width: 100%; border: 1px solid #e2e8f0; border-radius: 8px; margin: 8px 0; cursor: pointer; }
.chat-msg-content .mermaid { text-align: center; margin: 12px 0; padding: 16px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; overflow-x: auto; cursor: pointer; }
.chat-msg-content .mermaid svg { max-width: 100%; height: auto; }
.chat-msg-content .mermaid pre { color: #ef4444; font-size: 12px; text-align: left; }

/* ── Chat Markdown Formatting ── */
.chat-msg-content h1, .chat-msg-content h2, .chat-msg-content h3, .chat-msg-content h4 {
    margin: 12px 0 6px; color: #0f172a; font-weight: 700; line-height: 1.3;
}
.chat-msg-content h1 { font-size: 18px; }
.chat-msg-content h2 { font-size: 16px; }
.chat-msg-content h3 { font-size: 15px; }
.chat-msg-content h4 { font-size: 14px; }
.chat-msg-content p { margin: 6px 0; }
.chat-msg-content ul, .chat-msg-content ol { margin: 6px 0; padding-left: 20px; }
.chat-msg-content li { margin: 3px 0; }
.chat-msg-content strong { font-weight: 700; color: #0f172a; }
.chat-msg-content em { font-style: italic; color: #475569; }
.chat-msg-content code {
    font-family: 'JetBrains Mono', monospace; font-size: 12px;
    background: #f1f5f9; padding: 1px 5px; border-radius: 3px; color: #be123c;
}
.chat-msg-content pre {
    background: #1e293b; color: #e2e8f0; padding: 12px; border-radius: 8px;
    overflow-x: auto; font-size: 12px; margin: 8px 0;
}
.chat-msg-content pre code { background: none; color: inherit; padding: 0; }
.chat-msg-content blockquote {
    border-left: 3px solid #93c5fd; background: #eff6ff;
    padding: 8px 12px; margin: 8px 0; border-radius: 0 4px 4px 0; color: #1e3a5f;
}
.chat-msg-content hr { border: none; border-top: 1px solid #e2e8f0; margin: 12px 0; }
.chat-msg-content a { color: #2563eb; text-decoration: underline; }

/* ── Chat Markdown Tables ── */
.chat-msg-content table {
    border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 12px;
    overflow-x: auto; display: block;
}
.chat-msg-content thead { background: #0f172a; }
.chat-msg-content th {
    color: #f8fafc; font-weight: 600; text-align: left;
    padding: 8px 10px; border: 1px solid #334155; white-space: nowrap;
}
.chat-msg-content td {
    padding: 6px 10px; border: 1px solid #e2e8f0; color: #334155; vertical-align: top;
}
.chat-msg-content tbody tr:nth-child(even) { background: #f8fafc; }
.chat-msg-content tbody tr:hover { background: #eff6ff; }

/* ══ Value Validation (vv-table) ═══════════════════════════ */
.vv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 8px;
}
.vv-table thead {
    background: #f1f5f9;
}
.vv-table th {
    padding: 8px 12px;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 2px solid #e2e8f0;
    text-align: left;
    font-size: 12px;
}
.vv-table td {
    padding: 8px 12px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
    line-height: 1.5;
}
.vv-table td code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #475569;
}
.vv-table tbody tr:hover {
    background: #f8fafc;
}
.vv-table tbody tr:nth-child(even) {
    background: #fcfcfd;
}

/* EZ 대시보드 문서 계층 플로팅 패널 — 브라우저 하단 고정 */
.ez-hierarchy-float {
    position: fixed !important;
    bottom: 16px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: min(900px, 90vw) !important;
    max-height: 280px !important;
    overflow-y: auto !important;
    z-index: 9999 !important;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.15) !important;
    opacity: 0.98 !important;
}

/* AI 인텔리전스 추천 사이드바 — 1200px 미만에서 숨김 */
.chat-sidebar {
    display: flex;
}
@media (max-width: 1199px) {
    .chat-sidebar {
        display: none !important;
    }
}

/* 사이드바 버튼 텍스트 줄바꿈 — Radix size="1" 고정 높이 오버라이드 */
.chat-sidebar-btn {
    height: auto !important;
    min-height: 32px;
    white-space: normal !important;
    word-break: break-word !important;
    text-align: left !important;
    padding: 8px 12px !important;
    line-height: 1.4 !important;
    display: flex !important;
    align-items: center !important;
}

/* ── 반응형 미디어쿼리 (UX-7) ─────────────────────────── */

/* 태블릿 가로 (1024-1199px): 사이드바 축소, 카드 1열 */
@media (max-width: 1199px) {
    .sog-sidebar {
        width: 200px !important;
        min-width: 200px !important;
    }
    .sog-card {
        min-width: 0 !important;
    }
    .chat-sidebar {
        display: none !important;
    }
}

/* 태블릿 세로 (768-1023px): 사이드바 더 축소 */
@media (max-width: 1023px) {
    .sog-sidebar {
        width: 180px !important;
        min-width: 180px !important;
    }
    .sog-sidebar .nav-text {
        font-size: 11px !important;
    }
    .ez-slide-panel {
        width: 80vw !important;
    }
    .sog-card {
        padding: 12px !important;
    }
}

/* 모바일 (480-767px): 사이드바 숨김, 토글 버튼 표시 */
@media (max-width: 767px) {
    .sog-sidebar {
        display: none !important;
    }
    .sog-main {
        margin-left: 0 !important;
        padding: 8px !important;
    }
    .ez-slide-panel {
        width: 95vw !important;
    }
    .sog-card {
        min-width: 0 !important;
        padding: 8px !important;
    }
    .sog-card-header {
        padding: 12px !important;
    }
    .sog-table-wrapper {
        overflow-x: auto !important;
    }
}

/* 작은 모바일 (<480px) */
@media (max-width: 479px) {
    .sog-main {
        padding: 4px !important;
    }
    .sog-card {
        padding: 6px !important;
        border-radius: 8px !important;
    }
    .ez-card {
        min-width: 280px !important;
    }
}

/* ── 접근성 (UX-8) ─────────────────────────── */
.sog-sidebar-item:focus-visible {
    outline: 2px solid #6366f1 !important;
    outline-offset: -2px;
}

.sog-card-header:focus-visible {
    outline: 2px solid #6366f1 !important;
}

/* ── Toast 컨테이너 (UX-5) ─────────────────── */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 400px;
}

.toast-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: toast-slide-in 0.3s ease;
}

@keyframes toast-slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: none; opacity: 1; }
}

/* ── 온보딩 오버레이 (UX-10) ────────────────── */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.onboarding-popup {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    max-width: 480px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

/* ── 컨텍스트 도움말 툴팁 (UX-11) ────────────────── */
.sog-tooltip { position: relative; display: inline-block; cursor: help; }
.sog-tooltip .sog-tooltip-text {
    visibility: hidden;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s;
}
.sog-tooltip:hover .sog-tooltip-text { visibility: visible; opacity: 1; }

/* LangGraph 자가교정 버블 */
.correction-bubble {
    animation: correction-pulse 0.4s ease;
}
@keyframes correction-pulse {
    0% { opacity: 0; transform: translateX(-10px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* ── 다크모드 (H2) ───────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    body, .sog-main {
        background: #0f172a !important;
        color: #cbd5e1 !important;
    }
    .sog-card {
        background: #1e293b !important;
        color: #e2e8f0 !important;
        border-color: #334155 !important;
    }
    .sog-card-header {
        background: #1e293b !important;
        color: #f1f5f9 !important;
        border-bottom-color: #334155 !important;
    }
    .sog-sidebar {
        background: linear-gradient(180deg, #020617, #0f172a) !important;
    }
    .sog-sidebar-section-header {
        color: #94a3b8 !important;
    }
    .sog-sidebar-item {
        color: #cbd5e1 !important;
    }
    .sog-sidebar-item:hover {
        background: #1e293b !important;
    }
    .sog-main-content {
        background: #0f172a !important;
    }
    input, textarea, select, .sog-input {
        background: #0f172a !important;
        color: #e2e8f0 !important;
        border-color: #334155 !important;
    }
    .rx-table {
        background: #1e293b !important;
        color: #e2e8f0 !important;
    }
    .rx-table th {
        background: #334155 !important;
        color: #f1f5f9 !important;
    }
    .rx-table td {
        border-color: #334155 !important;
    }
    code, pre {
        background: #0f172a !important;
        color: #e2e8f0 !important;
    }
    .toast-item {
        box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
    }
}
