/* ═══════════════════════════════════════════════════
   Autonomous SOP Knowledge Graph Builder
   Enterprise Design System — styles.css
   ═══════════════════════════════════════════════════ */

/* ── CSS Custom Properties ─────────────────────── */
:root {
    /* Palette - Light Professional Theme */
    --bg-deep:          #f8fafc;
    --bg-body:          #f1f5f9;
    --bg-sidebar:       #ffffff;
    --bg-card:          #ffffff;
    --bg-card-alt:      #f8fafc;
    --bg-card-hover:    #f1f5f9;
    --bg-overlay:       rgba(15, 23, 42, 0.4);

    --accent:           #0f62fe;
    --accent-hover:     #0050e6;
    --accent-light:     #4589ff;
    --accent-glow:      rgba(15, 98, 254, 0.15);

    --success:          #198038;
    --success-light:    #24a148;
    --success-bg:       rgba(25, 128, 56, 0.08);
    --success-glow:     rgba(25, 128, 56, 0.2);

    --warning:          #f1c21b;
    --warning-light:    #f1c21b;
    --warning-bg:       rgba(241, 194, 27, 0.08);
    --warning-glow:     rgba(241, 194, 27, 0.2);

    --danger:           #da1e28;
    --danger-light:     #fa4d56;
    --danger-bg:        rgba(218, 30, 40, 0.08);

    --pending:          #8d8d8d;
    --pending-bg:       #e0e0e0;

    --text-primary:     #161616;
    --text-secondary:   #525252;
    --text-muted:       #6f6f6f;
    --text-on-dark:     #161616; /* Reusing var name but making it dark for light bg */
    --text-white:       #161616; /* Reusing var name but making it dark for light bg */

    --border-light:     #e0e0e0;
    --border-card:      #c6c6c6;

    /* Typography */
    --font-family:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Sizing */
    --sidebar-width:    240px;
    --header-height:    72px;
    --radius-sm:        6px;
    --radius-md:        10px;
    --radius-lg:        16px;
    --radius-xl:        20px;
    --radius-pill:      50px;

    /* Shadows */
    --shadow-sm:        0 1px 3px rgba(0,0,0,0.08);
    --shadow-md:        0 4px 16px rgba(0,0,0,0.10);
    --shadow-lg:        0 8px 32px rgba(0,0,0,0.14);
    --shadow-card:      0 2px 12px rgba(0,0,0,0.07);
    --shadow-glow-accent: 0 0 24px var(--accent-glow);
    --shadow-glow-success: 0 0 20px var(--success-glow);
    --shadow-glow-warning: 0 0 20px var(--warning-glow);

    /* Transitions */
    --ease-out:         cubic-bezier(0.22, 1, 0.36, 1);
    --transition-fast:  0.18s var(--ease-out);
    --transition-med:   0.3s var(--ease-out);
    --transition-slow:  0.5s var(--ease-out);
}

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
    font-family: var(--font-family);
    /* background: var(--bg-body); */
    color: var(--text-on-dark);
    min-height: 100vh;
    overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
img, svg { display: block; }

/* ── Scrollbar ─────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* ═══════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════ */
.sidebar {
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-width); height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid rgba(0,0,0,0.06);
    display: flex; flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-med);
    overflow: hidden;
}
.sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-width))); }

/* Sidebar header */
.sidebar-header { padding: 24px 20px 20px; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; }
.brand-icon {
    width: 40px; height: 40px; border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.brand-icon svg { width: 22px; height: 22px; color: #fff; }
.brand-text { display: flex; flex-direction: column; }
.brand-title { font-size: .85rem; font-weight: 700; color: var(--text-white); letter-spacing: 0.02em; }
.brand-subtitle { font-size: .72rem; font-weight: 500; color: var(--accent-light); letter-spacing: 0.06em; text-transform: uppercase; }

/* Sidebar nav */
.sidebar-nav { flex: 1; padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: var(--radius-md);
    color: var(--text-muted); font-size: .82rem; font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}
.nav-item:hover:not(.disabled) { background: rgba(0,0,0,0.05); color: var(--text-on-dark); }
.nav-item.active {
    background: rgba(37, 99, 235, 0.12);
    color: var(--accent-light);
}
.nav-item.active::before {
    content: ''; position: absolute; left: 0; top: 8px; bottom: 8px;
    width: 3px; border-radius: 2px; background: var(--accent);
}
.nav-item.disabled { opacity: 0.4; pointer-events: none; }
.nav-icon { width: 20px; height: 20px; flex-shrink: 0; }
.nav-icon svg { width: 100%; height: 100%; }
.nav-badge {
    margin-left: auto; font-size: .62rem; font-weight: 600;
    padding: 2px 7px; border-radius: var(--radius-pill);
    background: rgba(0,0,0,0.08); color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em;
}

/* Sidebar footer */
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(0,0,0,0.06); }
.sidebar-version { font-size: .68rem; color: var(--text-muted); }

/* ── Hamburger Toggle ──────────────────────────── */
.sidebar-toggle {
    position: fixed;
    top: 40px;
    left: 256px;   /* sidebar width + small gap */
    z-index: 150;

    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;

    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;

    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.sidebar-toggle span {
    display: block; width: 18px; height: 2px;
    background: var(--text-on-dark); border-radius: 1px;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}
.sidebar-toggle:hover {
    background: rgba(37,99,235,0.08);
}
/* When sidebar is open, push the hamburger to the right of the sidebar */
body:not(.sidebar-collapsed) .sidebar-toggle {
    left: 256px;
}
body.sidebar-collapsed .sidebar-toggle { left: 16px; }
body.sidebar-collapsed .sidebar-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.sidebar-collapsed .sidebar-toggle span:nth-child(2) { opacity: 0; }
body.sidebar-collapsed .sidebar-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════ */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 32px 40px 80px 72px;
    transition: margin-left var(--transition-med);
    min-height: 100vh;
}
.main-content.sidebar-closed { margin-left: 0; }

/* ── Page Header ───────────────────────────────── */
.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 36px; gap: 20px; flex-wrap: wrap;
}
.page-title {
    font-size: 1.7rem; font-weight: 800; color: var(--text-white);
    letter-spacing: -0.02em; line-height: 1.2;
}
.page-subtitle {
    font-size: .88rem; color: var(--text-muted);
    margin-top: 6px; font-weight: 400;
}
.header-status {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px; border-radius: var(--radius-pill);
    background: rgba(0,0,0,0.05); font-size: .78rem; font-weight: 500;
}
.status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--success); flex-shrink: 0;
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* ── Sections ──────────────────────────────────── */
.section { margin-bottom: 36px; }
.section.hidden { display: none; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title {
    display: flex; align-items: center; gap: 10px;
    font-size: 1.05rem; font-weight: 700; color: var(--text-white);
}
.section-icon { width: 22px; height: 22px; color: var(--accent-light); }
.section-icon svg { width: 100%; height: 100%; }

/* ═══════════════════════════════════════════════════
   UPLOAD CARD
   ═══════════════════════════════════════════════════ */
.upload-card {
    border: 2px dashed rgba(0,0,0,0.12);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-med);
    background: rgba(0,0,0,0.02);
    position: relative;
}
.upload-card:hover, .upload-card.drag-over {
    border-color: var(--accent-light);
    background: rgba(37, 99, 235, 0.06);
    box-shadow: var(--shadow-glow-accent);
}
.upload-card.drag-over {
    transform: scale(1.01);
}
.upload-icon { width: 56px; height: 56px; margin: 0 auto 16px; color: var(--text-muted); }
.upload-icon svg { width: 100%; height: 100%; }
.upload-title { font-size: 1rem; font-weight: 600; color: var(--text-on-dark); margin-bottom: 4px; }
.upload-subtitle { font-size: .82rem; color: var(--text-muted); margin-bottom: 12px; }
.upload-hint { font-size: .72rem; color: var(--text-muted); opacity: 0.6; }

/* File chips */
.file-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.file-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    background: rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: var(--radius-md);
    font-size: .8rem; color: var(--text-on-dark);
    transition: all var(--transition-fast);
}
.file-chip:hover { background: rgba(0,0,0,0.1); }
.file-chip-icon { width: 18px; height: 18px; color: var(--danger-light); flex-shrink: 0; }
.file-chip-name { font-weight: 500; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip-size { font-size: .7rem; color: var(--text-muted); }
.file-chip-status {
    font-size: .65rem; font-weight: 600; padding: 2px 8px;
    border-radius: var(--radius-pill); text-transform: uppercase; letter-spacing: 0.04em;
}
.file-chip-status.uploaded { background: var(--success-bg); color: var(--success); }
.file-chip-remove {
    width: 18px; height: 18px; color: var(--text-muted);
    cursor: pointer; transition: color var(--transition-fast); flex-shrink: 0;
}
.file-chip-remove:hover { color: var(--danger); }
.file-chip-remove svg { width: 100%; height: 100%; }

/* ═══════════════════════════════════════════════════
   PIPELINE TIMELINE
   ═══════════════════════════════════════════════════ */
.pipeline-scroll-wrapper {
    overflow-x: auto; padding-bottom: 12px;
    scrollbar-width: thin;
}
.pipeline-container {
    display: flex; gap: 0; min-width: max-content;
    padding: 8px 0;
}
.pipeline-stage {
    display: flex; align-items: center; position: relative;
}
.pipeline-stage:first-child .stage-connector { display: none; }

/* Connector line */
.stage-connector {
    width: 40px; height: 3px;
    background: rgba(0,0,0,0.1);
    flex-shrink: 0;
    transition: background var(--transition-med);
    position: relative;
}
.pipeline-stage.completed .stage-connector {
    background: linear-gradient(90deg, var(--success), var(--success-light));
}
.pipeline-stage.running .stage-connector {
    background: linear-gradient(90deg, var(--success), var(--warning));
}

/* Stage card */
.stage-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    padding: 10px;
    border-radius: 50%;
    border: 3px solid rgba(0,0,0,0.08);
    background: var(--bg-card);
    width: 130px; height: 130px;
    min-width: 130px;
    transition: all var(--transition-med);
    position: relative;
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

/* Status-based styles */
.pipeline-stage.completed .stage-card {
    border-color: var(--success);
    background: var(--success-bg);
    box-shadow: var(--shadow-glow-success);
}
.pipeline-stage.running .stage-card {
    border-color: var(--warning);
    background: var(--warning-bg);
    box-shadow: var(--shadow-glow-warning);
    animation: stage-pulse 1.8s ease-in-out infinite;
}
.pipeline-stage.failed .stage-card {
    border-color: var(--danger);
    background: var(--danger-bg);
}

@keyframes stage-pulse {
    0%, 100% { box-shadow: 0 0 12px var(--warning-glow); }
    50% { box-shadow: 0 0 28px var(--warning-glow); }
}

/* Stage icon */
.stage-icon-wrapper {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.06);
    transition: all var(--transition-med);
}
.stage-icon-wrapper svg { width: 20px; height: 20px; color: var(--text-muted); transition: color var(--transition-med); }
.pipeline-stage.completed .stage-icon-wrapper { background: var(--success); }
.pipeline-stage.completed .stage-icon-wrapper svg { color: #fff; }
.pipeline-stage.running .stage-icon-wrapper { background: var(--warning); }
.pipeline-stage.running .stage-icon-wrapper svg { color: #fff; }
.pipeline-stage.failed .stage-icon-wrapper { background: var(--danger); }
.pipeline-stage.failed .stage-icon-wrapper svg { color: #fff; }

/* Stage text */
.stage-info { text-align: center; max-width: 100px; }
.stage-title { display: block; font-size: .68rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.stage-desc { display: none; } /* Hidden for circular agentic look */

/* Stage badge */
.stage-badge {
    font-size: .6rem; font-weight: 700; padding: 3px 10px;
    border-radius: var(--radius-pill); text-transform: uppercase; letter-spacing: 0.06em;
}
.stage-badge.pending { background: rgba(0,0,0,0.06); color: var(--pending); }
.stage-badge.running { background: var(--warning-bg); color: var(--warning); }
.stage-badge.completed { background: var(--success-bg); color: var(--success); }
.stage-badge.failed { background: var(--danger-bg); color: var(--danger); }

/* ═══════════════════════════════════════════════════
   ACTION BUTTONS
   ═══════════════════════════════════════════════════ */
.actions-section {
    display: flex; gap: 14px; flex-wrap: wrap;
}
.btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 13px 28px; border-radius: var(--radius-md);
    font-size: .85rem; font-weight: 600;
    transition: all var(--transition-fast);
    position: relative; overflow: hidden;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary {
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    color: #fff;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.45);
    transform: translateY(-1px);
}
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-secondary {
    background: rgba(0,0,0,0.06);
    color: var(--text-on-dark);
    border: 1px solid rgba(0,0,0,0.12);
}
.btn-secondary:hover {
    background: rgba(0,0,0,0.1);
    border-color: rgba(0,0,0,0.2);
}
.btn-cached {
    background: linear-gradient(135deg, #0d9488, #0891b2);
    color: #fff;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.3);
}
.btn-cached:hover {
    box-shadow: 0 6px 24px rgba(13, 148, 136, 0.45);
    transform: translateY(-1px);
}

/* Loading state */
.btn.loading { pointer-events: none; }
.btn.loading::after {
    content: ''; position: absolute; inset: 0;
    background: inherit; border-radius: inherit;
    display: flex; align-items: center; justify-content: center;
}
.btn-spinner {
    width: 20px; height: 20px;
    border: 2px solid rgba(0,0,0,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════
   EXTRACTION PREVIEW — TABS & CONTENT
   ═══════════════════════════════════════════════════ */

/* Scenario tabs */
.scenario-tabs {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: 14px;
}
.stab {
    padding: 8px 16px; border-radius: var(--radius-pill);
    font-size: .75rem; font-weight: 600;
    background: rgba(0,0,0,0.05); color: var(--text-muted);
    border: 1px solid rgba(0,0,0,0.08);
    transition: all var(--transition-fast);
    cursor: pointer;
}
.stab:hover { background: rgba(0,0,0,0.1); color: var(--text-on-dark); }
.stab.active {
    background: rgba(37, 99, 235, 0.15); color: var(--accent-light);
    border-color: var(--accent);
}

/* Entity tabs */
.entity-tabs {
    display: flex; gap: 4px; flex-wrap: wrap;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    padding-bottom: 2px;
}
.etab {
    padding: 10px 18px;
    font-size: .78rem; font-weight: 500;
    color: var(--text-muted); border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
    cursor: pointer;
}
.etab:hover { color: var(--text-on-dark); background: rgba(0,0,0,0.04); }
.etab.active { color: var(--accent-light); border-bottom-color: var(--accent); }

/* Entity content */
.entity-content {
    min-height: 120px;
}

/* Entity cards */
.entity-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}
.entity-card {
    padding: 18px 20px;
    background: rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}
.entity-card:hover { background: rgba(0,0,0,0.07); border-color: rgba(0,0,0,0.15); }
.entity-card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.entity-card-title { font-size: .85rem; font-weight: 600; color: var(--text-white); }
.entity-card-id { font-size: .65rem; color: var(--text-muted); font-family: monospace; }
.entity-card-body { font-size: .78rem; color: var(--text-on-dark); line-height: 1.5; }
.entity-card-body .field { margin-bottom: 4px; }
.entity-card-body .field-label { color: var(--text-muted); font-weight: 500; }
.entity-card-body .field-value { color: var(--text-on-dark); }

/* Entity table (for relationships) */
.entity-table-wrapper { overflow-x: auto; }
.entity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .78rem;
}
.entity-table th {
    text-align: left; padding: 10px 14px;
    background: rgba(0,0,0,0.04);
    color: var(--text-muted); font-weight: 600;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    white-space: nowrap;
}
.entity-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    color: var(--text-on-dark);
}
.entity-table tr:hover td { background: rgba(0,0,0,0.03); }
.rel-type-badge {
    display: inline-block;
    padding: 2px 8px; border-radius: var(--radius-pill);
    font-size: .68rem; font-weight: 600;
    background: rgba(37, 99, 235, 0.15); color: var(--accent-light);
    font-family: monospace; white-space: nowrap;
}

/* ═══════════════════════════════════════════════════
   GRAPH SUMMARY
   ═══════════════════════════════════════════════════ */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
.summary-card {
    padding: 20px;
    background: rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all var(--transition-fast);
}
.summary-card:hover { background: rgba(0,0,0,0.07); border-color: var(--accent); transform: translateY(-2px); }
.summary-count {
    font-size: 2rem; font-weight: 800; color: var(--accent-light);
    line-height: 1; margin-bottom: 6px;
}
.summary-label { font-size: .76rem; color: var(--text-muted); font-weight: 500; }

/* ═══════════════════════════════════════════════════
   SUCCESS BANNER
   ═══════════════════════════════════════════════════ */
.success-banner {
    margin-top: 24px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: banner-appear 0.6s var(--ease-out) both;
}
.success-banner.hidden { display: none; }
.success-banner-content {
    display: flex; align-items: center; gap: 18px;
    padding: 22px 28px;
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.12), rgba(37, 99, 235, 0.10));
    border: 1px solid rgba(22, 163, 74, 0.25);
    border-radius: var(--radius-lg);
}
.success-icon { width: 40px; height: 40px; color: var(--success); flex-shrink: 0; }
.success-icon svg { width: 100%; height: 100%; }
.success-text strong { display: block; font-size: .92rem; color: var(--text-white); margin-bottom: 4px; }
.success-text span { font-size: .8rem; color: var(--text-on-dark); }

@keyframes banner-appear {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════ */
.toast-container {
    position: fixed; top: 24px; right: 24px;
    z-index: 200; display: flex; flex-direction: column; gap: 10px;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 18px; border-radius: var(--radius-md);
    min-width: 320px; max-width: 440px;
    font-size: .8rem; color: var(--text-white);
    box-shadow: var(--shadow-lg);
    animation: toast-in 0.4s var(--ease-out) both;
}
.toast.toast-error { background: rgba(220, 38, 38, 0.95); }
.toast.toast-success { background: rgba(22, 163, 74, 0.95); }
.toast.toast-info { background: rgba(37, 99, 235, 0.95); }
.toast-icon { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.toast-icon svg { width: 100%; height: 100%; }
.toast-body { flex: 1; }
.toast-title { font-weight: 600; margin-bottom: 2px; }
.toast-message { font-size: .75rem; opacity: 0.9; }
.toast-close {
    width: 18px; height: 18px; flex-shrink: 0;
    cursor: pointer; opacity: 0.6; transition: opacity var(--transition-fast);
    color: #fff;
}
.toast-close:hover { opacity: 1; }
.toast-close svg { width: 100%; height: 100%; }

.toast.removing { animation: toast-out 0.3s var(--ease-out) both; }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px); } }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .sidebar { transform: translateX(calc(-1 * var(--sidebar-width))); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0 !important; padding: 24px 18px 60px; }
    .sidebar-toggle { left: 14px !important; }
    .page-title { font-size: 1.3rem; }
    .entity-cards { grid-template-columns: 1fr; }
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .summary-grid { grid-template-columns: 1fr; }
    .pipeline-container { gap: 0; }
    .stage-card { min-width: 130px; padding: 14px; }
    .actions-section { flex-direction: column; }
    .btn { width: 100%; justify-content: center; }
}

/* ═══════════════════════════════════════════════════
   UTILITY ANIMATIONS
   ═══════════════════════════════════════════════════ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp 0.4s var(--ease-out) both; }
