/* ══════════════════════════════════════════════════════════════════
   Sell.ly CRM — Auto-generated CSS bundle
   DO NOT EDIT — modify files in styles/ instead.
   Generated: 2026-04-17T00:19:51Z
   ══════════════════════════════════════════════════════════════════ */


/* Design tokens & CSS variables */

/* ══════════════════════════════════════════════════════════════════
   Sell.ly CRM — Design System
   Apple-style Dark Mode Glassmorphism — SVG Icons, no emoji.
   ══════════════════════════════════════════════════════════════════ */

/* ── Design Tokens ─────────────────────────────────────────────── */
:root {
    /* Surface — deep dark with subtle blue undertone */
    --bg-primary: #060a14;
    --bg-secondary: #0c1222;
    --bg-card: rgba(12, 18, 34, 0.75);
    --bg-hover: rgba(30, 41, 64, 0.5);
    --bg-input: rgba(12, 18, 34, 0.5);
    --bg-elevated: rgba(18, 26, 48, 0.9);

    /* Glass — opaque dark panels (no blur for performance) */
    --glass-bg: rgba(12, 18, 34, 0.92);
    --glass-bg-solid: rgba(12, 18, 34, 0.97);
    --glass-border: rgba(148, 163, 184, 0.07);
    --glass-border-hover: rgba(99, 102, 241, 0.35);
    --glass-border-subtle: rgba(148, 163, 184, 0.04);

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #a5b4fc;

    /* Brand — refined indigo palette */
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-soft: rgba(99, 102, 241, 0.12);
    --accent-glow: rgba(99, 102, 241, 0.2);
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);

    /* Status */
    --success: #34d399;
    --danger: #f87171;
    --warning: #fbbf24;
    --info: #60a5fa;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    /* Shadows — richer depth */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 1px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45), 0 0 1px rgba(0,0,0,0.2);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 1px rgba(0,0,0,0.2);
    --shadow-glow: 0 0 24px var(--accent-glow), 0 0 48px rgba(99,102,241,0.08);
    --shadow-inner-glow: inset 0 1px 0 rgba(255,255,255,0.03);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Font */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}


/* Browser reset & box-sizing */

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

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

/* Ambient glow — static, no animation, no blur (GPU-friendly) */
body::before {
    content: ''; position: fixed; z-index: -1;
    width: 600px; height: 600px; border-radius: 50%;
    pointer-events: none; opacity: 0.25;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent 70%);
    top: -10%; left: -5%;
}


/* Typography base */

/* ── Typography ────────────────────────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
h2 { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em; }
h3 { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }

.page-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: var(--space-xl); padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--glass-border);
}
.page-title { color: var(--text-primary); }
.page-subtitle { color: var(--text-secondary); font-size: 0.875rem; margin-top: var(--space-xs); }


/* App layout, top bar, sidebar */

/* ── App Layout ────────────────────────────────────────────────── */
.app-layout {
    display: flex; min-height: 100vh;
}
.app-content-area {
    flex: 1; margin-left: 64px; display: flex; flex-direction: column;
    min-height: 100vh;
}
.app-main {
    flex: 1; padding: var(--space-xl); overflow-y: auto;
}

/* ── Top Bar ──────────────────────────────────────────────────── */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--space-md) var(--space-xl);
    border-bottom: 1px solid var(--glass-border);
    background: var(--glass-bg-solid);
    gap: var(--space-lg);
}
.topbar-search {
    flex: 1; max-width: 724px; margin: 0 auto;
    display: flex; align-items: center; gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: var(--bg-hover); border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    transition: border-color var(--transition-fast);
}
.topbar-search:focus-within {
    border-color: var(--glass-border-hover);
}
.topbar-search-icon {
    color: var(--text-muted); display: flex; flex-shrink: 0;
}
.topbar-search-icon svg { width: 16px; height: 16px; }
.topbar-search-input {
    flex: 1; background: transparent; border: none; outline: none;
    color: var(--text-primary); font-family: var(--font-sans);
    font-size: 0.875rem;
}
.topbar-search-input::placeholder { color: var(--text-muted); }
.topbar-actions {
    display: flex; align-items: center; gap: var(--space-md);
}
.topbar-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent-hover);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 600; cursor: pointer;
    transition: box-shadow var(--transition-fast);
}
.topbar-avatar:hover { box-shadow: 0 0 0 2px var(--accent); }

/* ── Sidebar ───────────────────────────────────────────────────── */
.sidebar {
    width: 64px; height: 100vh; position: fixed; left: 0; top: 0;
    background: var(--glass-bg-solid);
    border-right: 1px solid var(--glass-border);
    display: flex; flex-direction: column; z-index: 100;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.sidebar:hover {
    width: 240px;
}
.sidebar-brand {
    display: flex; align-items: center; gap: var(--space-md);
    padding: var(--space-lg); border-bottom: 1px solid var(--glass-border);
    min-height: 56px;
}
.brand-icon {
    color: var(--accent); display: flex; align-items: center;
    filter: drop-shadow(0 0 6px var(--accent-glow));
    flex-shrink: 0;
}
.brand-icon svg { width: 24px; height: 24px; }
.brand-text {
    font-size: 1.25rem; font-weight: 700; color: var(--text-primary);
    letter-spacing: -0.03em;
    background: var(--accent-gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
    white-space: nowrap; opacity: 0;
    transition: opacity 0.2s ease;
}
.sidebar:hover .brand-text { opacity: 1; }

.sidebar-nav { flex: 1; padding: var(--space-md) var(--space-xs); }
.sidebar-footer { padding: var(--space-md) var(--space-xs); border-top: 1px solid var(--glass-border); }

.nav-item {
    display: flex; align-items: center; gap: var(--space-md);
    padding: 10px 0; margin-bottom: 2px;
    padding-left: 20px;
    border-radius: var(--radius-sm); position: relative;
    color: var(--text-secondary); text-decoration: none;
    transition: all var(--transition-fast); cursor: pointer;
    border: none; background: none; width: 100%; font-size: 0.875rem;
    font-family: var(--font-sans);
    white-space: nowrap; overflow: hidden;
}
.nav-item:hover {
    background: var(--bg-hover); color: var(--text-primary);
}
.nav-item.active {
    background: var(--accent-soft); color: var(--accent-hover);
}
.nav-item.active::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px; border-radius: 0 3px 3px 0;
    background: var(--accent-gradient);
    box-shadow: 0 0 8px var(--accent-glow);
}
.nav-icon {
    width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: inherit; opacity: 0.65;
    transition: opacity var(--transition-fast);
}
.nav-icon svg { width: 18px; height: 18px; }
.nav-item:hover .nav-icon { opacity: 1; }
.nav-item.active .nav-icon { opacity: 1; }

.nav-label {
    opacity: 0; white-space: nowrap;
    transition: opacity 0.2s ease;
}
.sidebar:hover .nav-label { opacity: 1; }


/* Button system */

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-sm); border: 1px solid transparent;
    font-family: var(--font-sans); font-size: 0.875rem; font-weight: 500;
    cursor: pointer; transition: all var(--transition-fast);
    white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-full { width: 100%; }

.btn-primary {
    background: var(--accent); color: white; border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover); box-shadow: var(--shadow-glow);
}
.btn-secondary {
    background: transparent; color: var(--text-primary);
    border-color: var(--glass-border);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover); border-color: var(--accent);
}
.btn-danger {
    background: var(--danger); color: white; border-color: var(--danger);
}
.btn-ghost {
    background: transparent; color: var(--text-secondary); border: none;
}
.btn-ghost:hover:not(:disabled) { color: var(--text-primary); }

.spinner {
    width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white; border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* Forms & inputs */

/* ── Form ──────────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--space-md); }
.form-label {
    display: block; font-size: 0.8125rem; font-weight: 500;
    color: var(--text-secondary); margin-bottom: var(--space-xs);
}
.input {
    width: 100%; padding: var(--space-sm) var(--space-md);
    background: var(--bg-input); border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-family: var(--font-sans); font-size: 0.875rem;
    transition: border-color var(--transition-fast);
    outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input-error { border-color: var(--danger); }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: var(--space-xs); }

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
    background: var(--glass-bg);
    
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm), var(--shadow-inner-glow);
    transition: all var(--transition-normal);
}
.card:hover {
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-md), var(--shadow-inner-glow);
}
.card-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--glass-border);
}
.card-title { font-size: 0.9375rem; font-weight: 600; }
.card-body { padding: var(--space-lg); }


/* Cards, stat cards, dashboard grid, activities */

/* ── Stat Cards ────────────────────────────────────────────────── */
.kpi-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-md); margin-bottom: var(--space-xl);
}
.stat-card {
    background: var(--glass-bg);
    
    border: 1px solid var(--glass-border); border-radius: var(--radius-md);
    padding: var(--space-lg); display: flex; align-items: center; gap: var(--space-md);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm), var(--shadow-inner-glow);
    position: relative; overflow: hidden;
    animation: cardEnter 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}
.stat-card::before {
    content: ''; position: absolute; inset: 0;
    background: var(--glass-shine); pointer-events: none;
}
.stat-card:nth-child(1) { animation-delay: 0ms; }
.stat-card:nth-child(2) { animation-delay: 80ms; }
.stat-card:nth-child(3) { animation-delay: 160ms; }
.stat-card:nth-child(4) { animation-delay: 240ms; }
.stat-card:hover {
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-glow), var(--shadow-md);
    transform: translateY(-3px);
}
.stat-icon {
    width: 48px; height: 48px; border-radius: var(--radius-md);
    background: var(--accent-gradient);
    display: flex; align-items: center; justify-content: center;
    color: white; flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-content { flex: 1; }
.stat-value {
    font-size: 1.625rem; font-weight: 700; display: block;
    letter-spacing: -0.02em; line-height: 1.2;
}
.stat-label { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 2px; }
.stat-change { font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-full); }
.stat-change.positive { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.stat-change.negative { background: rgba(248, 113, 113, 0.15); color: var(--danger); }

/* ── Dashboard Grid ────────────────────────────────────────────── */
.dashboard-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-md);
}

/* ── Activities ────────────────────────────────────────────────── */
.activity-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.activity-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: var(--space-sm) 0; border-bottom: 1px solid rgba(99, 102, 241, 0.08);
}
.activity-item:last-child { border-bottom: none; }
.activity-action { font-size: 0.875rem; display: block; }
.activity-detail { font-size: 0.8125rem; color: var(--text-muted); }
.activity-time { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }


/* Table styles */

/* ── Table ─────────────────────────────────────────────────────── */
.table-container {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border); border-radius: var(--radius-md);
    overflow: hidden;
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: rgba(15, 23, 42, 0.5); }
.data-table th {
    padding: var(--space-md) var(--space-lg); text-align: left;
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
}
.data-table td {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(99, 102, 241, 0.06);
    font-size: 0.875rem;
}
.table-row { transition: background var(--transition-fast); }
.table-row:hover { background: var(--bg-hover); }
.table-row.clickable { cursor: pointer; }

.cell-name { display: flex; align-items: center; gap: var(--space-md); font-weight: 500; }
.contact-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--accent-gradient); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.75rem; letter-spacing: -0.02em;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

/* ── Status Badges ─────────────────────────────────────────────── */
.status-badge {
    font-size: 0.75rem; font-weight: 600; padding: 2px 10px;
    border-radius: var(--radius-full);
}
.status-lead { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.status-qualified { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.status-customer { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.status-churned { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.status-archived { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); }


/* Status badges */

/* ── Modal ─────────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0, 0, 0, 0.75);
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.2s ease;
}
.modal {
    background: var(--bg-secondary); border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg); width: 90%; max-width: 500px;
    box-shadow: var(--shadow-lg); animation: slideUp 0.25s ease;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: var(--space-lg); border-bottom: 1px solid var(--glass-border);
}
.modal-title { font-size: 1.125rem; font-weight: 600; }
.modal-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 1.25rem; cursor: pointer; padding: var(--space-xs);
    transition: color var(--transition-fast);
}
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: var(--space-lg); }
.modal-form { display: flex; flex-direction: column; gap: var(--space-sm); }
.modal-actions {
    display: flex; justify-content: flex-end; gap: var(--space-sm);
    margin-top: var(--space-md); padding-top: var(--space-md);
    border-top: 1px solid var(--glass-border);
}


/* Modal dialogs */

/* ── Login ─────────────────────────────────────────────────────── */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at 50% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
}
.login-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
    padding: var(--space-2xl); width: 100%; max-width: 400px;
    box-shadow: var(--shadow-lg);
}
.login-brand { text-align: center; margin-bottom: var(--space-xl); }
.brand-icon-large { font-size: 3rem; color: var(--accent); display: block; margin-bottom: var(--space-sm); }
.login-brand h1 { font-size: 2rem; letter-spacing: -0.03em; }
.login-subtitle { color: var(--text-muted); font-size: 0.875rem; }
.login-form { display: flex; flex-direction: column; gap: var(--space-sm); }
.login-error {
    background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger); padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm); font-size: 0.8125rem;
}


/* Utilities, header actions, view toggle */

/* ── Utilities ─────────────────────────────────────────────────── */
.text-danger { color: var(--danger); }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Header Actions ────────────────────────────────────────────── */
.header-actions { display: flex; align-items: center; gap: var(--space-md); }

/* ── View Toggle ───────────────────────────────────────────────── */
.view-toggle {
    display: flex; background: var(--bg-input);
    border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
    overflow: hidden;
}
.toggle-btn {
    padding: 6px 12px; background: none; border: none;
    color: var(--text-muted); cursor: pointer; font-size: 1rem;
    transition: all var(--transition-fast);
}
.toggle-btn.active {
    background: var(--accent); color: white;
}
.toggle-btn:hover:not(.active) { color: var(--text-primary); }

/* ── Contact Grid ──────────────────────────────────────────────── */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
    animation: fadeIn 0.3s ease;
}


/* Login page */

/* ── Skeleton Loading ──────────────────────────────────────────── */
.skeleton {
    position: relative; overflow: hidden;
}
.skeleton::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(99,102,241,0.05), transparent);
    animation: shimmer 1.5s infinite;
}
.skeleton-icon {
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.1);
}
.skeleton-content { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.skeleton-line {
    height: 14px; border-radius: 4px;
    background: rgba(99, 102, 241, 0.1);
}
.skeleton-line.wide { width: 70%; }
.skeleton-line.narrow { width: 40%; }

@keyframes shimmer { to { transform: translateX(100%); } }

/* ── Utilities ─────────────────────────────────────────────────── */
.text-danger { color: var(--danger); }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* Contact cards, grid, profile */

/* ── Contact Card ──────────────────────────────────────────────── */
.contact-card {
    background: var(--glass-bg);
    
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    transition: all var(--transition-normal);
    cursor: pointer;
}
.contact-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.contact-card-header {
    display: flex; align-items: center; gap: var(--space-md);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--glass-border);
}
.contact-card-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    color: white; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8125rem; flex-shrink: 0;
}
.contact-card-meta { flex: 1; min-width: 0; }
.contact-card-name {
    display: block; font-weight: 600; font-size: 0.9375rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.contact-card-nr {
    font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono);
}

.contact-card-body {
    display: flex; flex-direction: column; gap: 6px;
}
.contact-card-row {
    display: flex; align-items: center; gap: var(--space-sm);
    font-size: 0.8125rem; color: var(--text-secondary);
}
.card-icon {
    width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: var(--text-muted);
}
.card-icon svg { width: 16px; height: 16px; }

/* ── Status Dots ───────────────────────────────────────────────── */
.status-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.status-dot.status-lead { background: var(--info); }
.status-dot.status-qualified { background: var(--warning); }
.status-dot.status-customer { background: var(--success); }
.status-dot.status-churned { background: var(--danger); }
.status-dot.status-archived { background: var(--text-muted); }

/* ── Table Number Column ───────────────────────────────────────── */
.cell-number {
    font-family: var(--font-mono); font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ── Form Row (side by side) ───────────────────────────────────── */
.form-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md);
}

/* ── Empty State ───────────────────────────────────────────────── */
.empty-state {
    text-align: center; padding: var(--space-2xl);
    color: var(--text-muted);
}
.empty-icon {
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto var(--space-md);
    color: var(--text-muted);
}
.empty-icon svg { width: 48px; height: 48px; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: var(--space-xs); }
.empty-state p { font-size: 0.875rem; }

/* ── Contact Card Link ─────────────────────────────────────────── */
.contact-card-link { text-decoration: none; color: inherit; display: block; }

/* ── Profile Header ────────────────────────────────────────────── */
.profile-header {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--glass-border);
}
.back-link {
    display: inline-flex; align-items: center; gap: var(--space-sm);
    color: var(--text-muted); text-decoration: none;
    font-size: 0.8125rem; margin-bottom: var(--space-md);
    transition: color var(--transition-fast);
}
.back-link:hover { color: var(--accent); }
.back-icon { display: flex; align-items: center; }
.back-icon svg { width: 16px; height: 16px; }

.profile-header-info {
    display: flex; align-items: center; gap: var(--space-md);
}
.profile-name {
    font-size: 1.5rem; font-weight: 700;
}
.profile-nr {
    font-family: var(--font-mono); font-size: 0.875rem;
    color: var(--text-muted);
}

/* ── Profile Layout ────────────────────────────────────────────── */
.profile-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: var(--space-lg);
    align-items: start;
}
@media (max-width: 900px) {
    .profile-layout { grid-template-columns: 1fr; }
}

/* ── Profile Sidebar ───────────────────────────────────────────── */
.profile-sidebar {
    background: var(--glass-bg);
    
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    position: sticky; top: var(--space-lg);
}

.profile-avatar-section {
    text-align: center;
    padding-bottom: var(--space-lg);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--glass-border);
}
.profile-avatar {
    width: 72px; height: 72px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    color: white; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.5rem; margin: 0 auto var(--space-md);
}
.profile-sidebar-name {
    font-size: 1.125rem; font-weight: 600; margin-bottom: var(--space-xs);
}

/* ── Profile Sections ──────────────────────────────────────────── */
.profile-section {
    margin-bottom: var(--space-lg);
}
.profile-section:last-child { margin-bottom: 0; }

.profile-section-title {
    font-size: 0.6875rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--text-muted);
    margin-bottom: var(--space-md);
}

/* ── Detail Rows ───────────────────────────────────────────────── */
.detail-row {
    display: flex; align-items: flex-start; gap: var(--space-md);
    padding: var(--space-sm) 0;
}
.detail-icon {
    width: 18px; height: 18px; display: flex; align-items: center;
    justify-content: center; color: var(--text-muted); flex-shrink: 0;
    margin-top: 2px;
}
.detail-icon svg { width: 16px; height: 16px; }
.detail-content { flex: 1; min-width: 0; }
.detail-label {
    display: block; font-size: 0.6875rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em;
}
.detail-value {
    display: block; font-size: 0.875rem; word-break: break-word;
}

/* ── Tags ──────────────────────────────────────────────────────── */
.tags-list { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.tag {
    padding: 2px 10px; border-radius: var(--radius-full);
    background: rgba(99, 102, 241, 0.12); color: var(--accent);
    font-size: 0.75rem; font-weight: 500;
}

/* ── Profile Actions ───────────────────────────────────────────── */
.profile-actions {
    display: flex; flex-direction: column; gap: var(--space-sm);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--glass-border);
}
.btn-danger-ghost {
    display: flex; align-items: center; justify-content: center; gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: none; border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    color: var(--danger); cursor: pointer; font-family: var(--font-sans);
    font-size: 0.875rem; transition: all var(--transition-fast);
}
.btn-danger-ghost svg { width: 16px; height: 16px; }
.btn-danger-ghost:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
}

/* ── Glass Panel (right side) ──────────────────────────────────── */
.glass-panel {
    background: var(--glass-bg);
    
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}

.section-header {
    display: flex; align-items: center; gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}
.section-icon {
    width: 20px; height: 20px; display: flex; align-items: center;
    color: var(--accent);
}
.section-icon svg { width: 18px; height: 18px; }
.section-header h3 { flex: 1; font-size: 1rem; font-weight: 600; }
.section-count {
    background: rgba(99, 102, 241, 0.12); color: var(--accent);
    padding: 2px 8px; border-radius: var(--radius-full);
    font-size: 0.75rem; font-weight: 600;
}
.section-empty {
    color: var(--text-muted); font-size: 0.875rem;
    text-align: center; padding: var(--space-lg) 0;
}

/* ── Deal Cards ────────────────────────────────────────────────── */
.deals-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.deal-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--space-md);
    border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.deal-card:hover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.04);
}

/* Pipeline & deals */

.deal-info { flex: 1; min-width: 0; }
.deal-title { display: block; font-weight: 500; font-size: 0.875rem; }
.deal-value { font-size: 0.8125rem; color: var(--text-muted); font-family: var(--font-mono); }
.deal-stage {
    padding: 3px 10px; border-radius: var(--radius-full);
    font-size: 0.75rem; font-weight: 500; white-space: nowrap;
}

/* ── Activity Timeline ─────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; }
.timeline-item {
    display: flex; gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.06);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent); flex-shrink: 0;
    margin-top: 6px;
}
.timeline-content { flex: 1; min-width: 0; }
.timeline-action {
    display: block; font-size: 0.875rem; font-weight: 500;
    text-transform: capitalize;
}
.timeline-detail {
    display: block; font-size: 0.8125rem; color: var(--text-secondary);
    margin-top: 2px;
}
.timeline-meta {
    display: block; font-size: 0.75rem; color: var(--text-muted);
    margin-top: 4px;
}

/* ── Tasks ──────────────────────────────────────────────────── */
.task-filters {
    display: flex; gap: var(--space-sm); margin-bottom: var(--space-lg);
}
.filter-btn {
    padding: 6px 16px; border-radius: var(--radius-full);
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    color: var(--text-secondary); cursor: pointer; font-size: 0.8125rem;
    transition: all var(--transition-fast);
}
.filter-btn:hover { border-color: rgba(99, 102, 241, 0.3); }
.filter-btn.active {
    background: rgba(99, 102, 241, 0.15); border-color: var(--accent);
    color: var(--accent); font-weight: 600;
}
.task-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.task-item {
    display: flex; align-items: center; gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
}
.task-check {
    width: 22px; height: 22px; border-radius: 6px;
    border: 2px solid var(--glass-border); display: flex;
    align-items: center; justify-content: center;
    font-size: 0.75rem; flex-shrink: 0; cursor: pointer;
    transition: all var(--transition-fast);
}
.task-check.completed {
    background: rgba(34, 197, 94, 0.2); border-color: #22c55e; color: #22c55e;
}
.task-body { flex: 1; min-width: 0; }
.task-title { display: block; font-weight: 500; margin-bottom: 2px; }
.task-meta { display: block; font-size: 0.75rem; color: var(--text-muted); }
.priority-badge {
    padding: 2px 10px; border-radius: var(--radius-full);
    font-size: 0.6875rem; font-weight: 600; text-transform: uppercase;
}
.priority-low { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.priority-medium { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.priority-high { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.priority-urgent { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* ── Notes ──────────────────────────────────────────────────── */
.notes-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.note-card {
    padding: var(--space-md);
    border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
    position: relative;
    transition: all var(--transition-fast);
}
.note-card:hover { border-color: rgba(99, 102, 241, 0.3); }
.note-pin {
    position: absolute; top: 8px; right: 8px;
    background: rgba(99, 102, 241, 0.15); color: var(--accent);
    padding: 1px 8px; border-radius: var(--radius-full);
    font-size: 0.6875rem; font-weight: 600; text-transform: uppercase;
}
.note-content {
    font-size: 0.875rem; line-height: 1.5;
    white-space: pre-wrap; margin: 0 0 var(--space-sm);
}
.note-meta {
    font-size: 0.75rem; color: var(--text-muted);
}

/* ── Animations ────────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes cardEnter {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 8px var(--accent-glow); }
    50% { box-shadow: 0 0 20px var(--accent-glow), 0 0 40px rgba(99,102,241,0.06); }
}

/* ── Glass Panel (universal — opaque, no blur) ───────────────── */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition-fast);
}
.glass-panel:hover {
    border-color: var(--glass-border-hover);
}

/* ── Premium Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.15); border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.25); }

/* ── Loading Text ─────────────────────────────────────────────── */
.loading-text {
    text-align: center; padding: var(--space-2xl);
    color: var(--text-muted); font-size: 0.875rem;
    animation: pulseGlow 2s ease-in-out infinite;
}

/* ── Empty State ──────────────────────────────────────────────── */
.empty-state {
    text-align: center; padding: var(--space-2xl) var(--space-lg);
    color: var(--text-muted);
}
.empty-icon { display: block; margin: 0 auto var(--space-md); opacity: 0.4; }
.empty-icon svg { width: 48px; height: 48px; }

/* ── Error Banner ────────────────────────────────────────────── */
.error-banner {
    background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm); padding: var(--space-sm) var(--space-md);
    color: #ef4444; font-size: 0.875rem; margin-bottom: var(--space-md);
}

/* ── Selection Glow ───────────────────────────────────────────── */
::selection { background: rgba(99, 102, 241, 0.3); color: white; }

/* ── Companies Page ──────────────────────────────────────────── */
.companies-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-md);
}
.company-card { padding: var(--space-lg); }
.company-header { display: flex; align-items: center; gap: var(--space-md); margin-bottom: var(--space-md); }
.company-avatar {
    width: 42px; height: 42px; border-radius: var(--radius-md);
    background: var(--accent-gradient); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1rem; flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.company-name { font-weight: 600; font-size: 1rem; display: block; }
.company-industry { font-size: 0.8125rem; color: var(--text-secondary); }
.company-details { display: flex; flex-direction: column; gap: var(--space-xs); }
.company-detail {
    display: flex; align-items: center; gap: var(--space-sm);
    font-size: 0.8125rem; color: var(--text-muted);
}
.company-detail .detail-icon { width: 14px; height: 14px; opacity: 0.5; }
.company-detail .detail-icon svg { width: 14px; height: 14px; }

/* ── Pipeline Page ───────────────────────────────────────────── */
.pipeline-board {
    display: flex; gap: var(--space-md); overflow-x: auto;
    padding-bottom: var(--space-md); min-height: 400px;
}
.pipeline-column {
    min-width: 280px; max-width: 320px; flex-shrink: 0;
    display: flex; flex-direction: column;
}
.column-header {
    padding-bottom: var(--space-md); margin-bottom: var(--space-sm);
    border-bottom: 1px solid var(--glass-border);
}
.column-title { font-weight: 600; font-size: 0.9375rem; display: block; }
.column-meta { font-size: 0.75rem; color: var(--text-muted); }
.column-deals { display: flex; flex-direction: column; gap: var(--space-sm); flex: 1; }
.deal-card {
    padding: var(--space-md); border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border-subtle);
    background: rgba(18, 26, 48, 0.6);
    transition: all var(--transition-fast); cursor: pointer;
}
.deal-card:hover { border-color: var(--glass-border-hover); transform: translateY(-1px); }
.deal-title { font-weight: 500; font-size: 0.875rem; display: block; margin-bottom: 4px; }
.deal-value { font-size: 0.8125rem; color: var(--accent-hover); font-weight: 600; display: block; }
.deal-contact { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; display: block; }
.deal-empty { font-size: 0.8125rem; color: var(--text-muted); padding: var(--space-md); text-align: center; }

/* ── Calendar Page ───────────────────────────────────────────── */
.calendar-view { display: flex; flex-direction: column; gap: var(--space-md); }
.calendar-day { display: flex; flex-direction: column; }
.day-header {
    display: flex; justify-content: space-between; align-items: center;
    padding-bottom: var(--space-sm); margin-bottom: var(--space-sm);
    border-bottom: 1px solid var(--glass-border);
}
.day-date { font-weight: 600; font-size: 1rem; }
.day-count { font-size: 0.8125rem; color: var(--text-muted); }
.day-tasks { display: flex; flex-direction: column; gap: var(--space-xs); }
.calendar-task {
    display: flex; justify-content: space-between; align-items: center;
    padding: var(--space-sm) 0;
}
.calendar-task .task-title { font-size: 0.875rem; }

/* ── Settings Page ───────────────────────────────────────────── */
.settings-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: var(--space-md);
}
.settings-section { padding: var(--space-lg); }
.section-header {
    display: flex; align-items: center; gap: var(--space-sm);
    margin-bottom: var(--space-lg); padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--glass-border);
}
.section-icon { width: 20px; height: 20px; color: var(--accent); opacity: 0.7; }
.section-icon svg { width: 20px; height: 20px; }
.setting-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: var(--space-sm) 0; border-bottom: 1px solid var(--glass-border-subtle);
}
.setting-row:last-child { border-bottom: none; }
.setting-info { flex: 1; }
.setting-label { font-size: 0.875rem; font-weight: 500; display: block; }
.setting-desc { font-size: 0.75rem; color: var(--text-muted); }
.setting-value { font-size: 0.875rem; color: var(--text-secondary); font-weight: 500; }
.color-dot { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; }
.toggle-dot {
    width: 36px; height: 20px; border-radius: 10px;
    background: rgba(100, 116, 139, 0.3); position: relative;
    flex-shrink: 0;
}
.toggle-dot::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--text-muted); transition: all var(--transition-fast);
}
.toggle-dot.active { background: var(--accent-soft); }
.toggle-dot.active::after { left: 18px; background: var(--accent); }

/* ═══════════════════════════════════════════════════════════════
   Contact Profile Page — cp-* classes
   ═══════════════════════════════════════════════════════════════ */

/* ── Pipeline Bar ───────────────────────────────────────────── */
.cp-pipeline-bar {
    display: flex; align-items: center; gap: var(--space-md);
    padding: var(--space-md); margin-bottom: var(--space-lg);
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}
.cp-back-btn {
    display: flex; align-items: center; gap: var(--space-xs);
    color: var(--text-secondary); text-decoration: none; font-size: 0.875rem;

/* Calendar */

    padding: var(--space-xs) var(--space-md); border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border); white-space: nowrap;
    transition: all var(--transition-fast);
}
.cp-back-btn:hover { color: var(--text-primary); border-color: var(--accent); }
.cp-back-btn svg { width: 16px; height: 16px; }
.cp-stages {
    display: flex; flex: 1; border-radius: var(--radius-sm); overflow: hidden;
}
.cp-stage {
    flex: 1; padding: 8px var(--space-md); font-size: 0.8125rem; font-weight: 500;
    background: rgba(30, 41, 64, 0.6); color: var(--text-muted); border: none;
    cursor: pointer; transition: all var(--transition-fast); text-align: center;
    border-right: 1px solid rgba(100, 116, 139, 0.1);
}
.cp-stage:last-child { border-right: none; }
.cp-stage:hover { background: rgba(30, 41, 64, 0.9); color: var(--text-primary); }
.cp-stage.active { color: white; font-weight: 600; }
.cp-outcome-btns { display: flex; gap: var(--space-sm); flex-shrink: 0; }
.cp-won-btn, .cp-lost-btn {
    padding: 8px var(--space-lg); border-radius: var(--radius-sm);
    font-size: 0.8125rem; font-weight: 600; border: none; cursor: pointer;
    transition: all var(--transition-fast);
}
.cp-won-btn { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.cp-won-btn:hover { background: rgba(34, 197, 94, 0.3); }
.cp-lost-btn { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
.cp-lost-btn:hover { background: rgba(248, 113, 113, 0.3); }

/* ── Two-Column Layout ──────────────────────────────────────── */
.cp-layout { display: flex; gap: var(--space-sm); align-items: flex-start; }
.cp-left { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; gap: var(--space-sm); }
.cp-right { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-sm); }

/* ── Avatar Box ─────────────────────────────────────────────── */
.cp-avatar-box {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); padding: var(--space-xl);
    display: flex; flex-direction: column; align-items: center; text-align: center;
}
.cp-avatar {
    width: 72px; height: 72px; border-radius: 50%;
    background: var(--accent-gradient); color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em;
    margin-bottom: var(--space-md);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
}
.cp-name { font-size: 1.125rem; font-weight: 600; color: var(--text-primary); }

/* ── Action Buttons ─────────────────────────────────────────── */
.cp-actions {
    display: flex; gap: var(--space-sm); justify-content: center;
    padding: 0 var(--space-md);
}
.cp-action-btn {
    width: 40px; height: 40px; border-radius: 50%; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all var(--transition-fast);
    text-decoration: none;
}
.cp-action-btn svg { width: 18px; height: 18px; }
.cp-action-tel { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.cp-action-tel:hover { background: rgba(34, 197, 94, 0.3); }
.cp-action-mail { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.cp-action-mail:hover { background: rgba(59, 130, 246, 0.3); }
.cp-action-plus { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.cp-action-plus:hover { background: rgba(139, 92, 246, 0.3); }

/* ── Box (generic left-column card) ─────────────────────────── */
.cp-box {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); padding: var(--space-md);
}
.cp-box-title {
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: var(--space-sm);
}
.cp-empty { color: var(--text-muted); font-size: 0.8125rem; }

/* Products */
.cp-products { display: flex; flex-direction: column; }
.cp-product-row {
    display: flex; justify-content: space-between; padding: var(--space-xs) 0;
    font-size: 0.8125rem; border-bottom: 1px solid rgba(100,116,139,0.06);
}
.cp-product-name { color: var(--text-primary); font-weight: 600; }
.cp-product-val { color: var(--text-accent); font-weight: 500; }
.cp-product-total {
    display: flex; justify-content: space-between; padding-top: var(--space-sm);
    font-size: 0.875rem; font-weight: 600; color: var(--text-primary);
}

/* Contact Details */
.cp-detail-row {
    display: flex; justify-content: space-between; padding: 6px 0;
    font-size: 0.8125rem; border-bottom: 1px solid rgba(100,116,139,0.06);
}
.cp-detail-row:last-child { border-bottom: none; }
.cp-detail-label { color: var(--text-muted); }
.cp-detail-value { color: var(--text-primary); text-align: right; word-break: break-all; }

/* Scoring */
.cp-score { display: flex; align-items: center; gap: var(--space-md); }
.cp-score-value { font-size: 1.25rem; font-weight: 700; color: var(--warning); }
.cp-score-bar {
    flex: 1; height: 6px; background: rgba(100, 116, 139, 0.15);
    border-radius: 3px; overflow: hidden;
}
.cp-score-fill {
    height: 100%; border-radius: 3px;
    background: linear-gradient(90deg, var(--warning), var(--success));
}

/* ── Tabs ────────────────────────────────────────────────────── */
.cp-tabs {
    display: flex; gap: 2px; background: var(--glass-bg);
    border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
    padding: 3px; overflow: hidden;
}
.cp-tab {
    flex: 1; padding: 10px var(--space-md); font-size: 0.875rem; font-weight: 500;
    background: transparent; color: var(--text-muted); border: none;
    border-radius: var(--radius-sm); cursor: pointer;
    transition: all var(--transition-fast);
}
.cp-tab:hover { color: var(--text-primary); background: var(--bg-hover); }
.cp-tab.active { background: var(--accent); color: white; }

/* ── Note Editor ────────────────────────────────────────────── */
.cp-note-editor {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--space-xs);
    min-height: 240px; display: flex; flex-direction: column;
}
.cp-note-toolbar {
    display: flex; justify-content: flex-end; padding: var(--space-sm) var(--space-md);
}
.cp-template-btn {
    display: flex; align-items: center; gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm); font-size: 0.75rem;
    background: var(--bg-hover); color: var(--text-secondary); border: none;
    border-radius: var(--radius-sm); cursor: pointer;
    transition: all var(--transition-fast);
}
.cp-template-btn:hover { color: var(--text-primary); background: rgba(99,102,241,0.1); }
.cp-template-btn svg { width: 14px; height: 14px; }

/* Inner centered note input box */
.cp-note-input-box {
    width: 45%; margin: 20px auto;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    flex: 1; display: flex; flex-direction: column;
}
.cp-note-textarea {
    width: 100%; padding: var(--space-md);
    background: transparent; display: block;
    border: none; color: var(--text-primary); font-family: var(--font-sans);
    font-size: 0.875rem; resize: none; outline: none;
    min-height: 150px; text-align: center;
}
.cp-note-textarea::placeholder { color: var(--text-muted); }
.cp-note-footer {
    display: flex; justify-content: flex-end;
    padding: 0 var(--space-md) var(--space-sm);
}
.cp-send-btn {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--accent); border: none; color: white;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all var(--transition-fast);
}
.cp-send-btn:hover { background: var(--accent-hover); box-shadow: var(--shadow-glow); }
.cp-send-btn svg { width: 16px; height: 16px; }

/* ── Timeline Pill ──────────────────────────────────────────── */
.cp-timeline-pill {
    display: inline-flex; align-items: center; gap: var(--space-sm);
    padding: 8px var(--space-lg); border-radius: var(--radius-full);
    background: var(--accent-soft); color: var(--accent-hover);
    font-size: 0.8125rem; font-weight: 600; border: 1px solid rgba(99,102,241,0.2);
    cursor: pointer; transition: all var(--transition-fast);
    margin: 0 auto; display: flex; justify-content: center;
}
.cp-timeline-pill:hover { background: rgba(99,102,241,0.2); }
.cp-pill-arrow {
    display: inline-block; width: 0; height: 0;
    border-left: 5px solid transparent; border-right: 5px solid transparent;
    border-top: 5px solid currentColor; transition: transform var(--transition-fast);
}
.cp-pill-arrow.open { transform: rotate(180deg); }

/* ── Vertical Timeline ──────────────────────────────────────── */
.cp-timeline {
    position: relative; padding-left: 24px; margin-top: var(--space-md);
}
.cp-timeline::before {
    content: ''; position: absolute; left: 7px; top: 0; bottom: 0;
    width: 2px; background: rgba(100, 116, 139, 0.15); border-radius: 1px;
}
.cp-timeline-item {
    position: relative; padding-bottom: var(--space-lg); display: flex; gap: var(--space-md);
}
.cp-timeline-item:last-child { padding-bottom: 0; }
.cp-timeline-dot {
    position: absolute; left: -24px; top: 4px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--bg-primary); border: 2px solid var(--text-muted);
    z-index: 1;
}
.cp-timeline-body { flex: 1; }
.cp-timeline-text {
    font-size: 0.875rem; color: var(--text-primary); margin-bottom: var(--space-xs);
}
.cp-timeline-meta {
    display: flex; justify-content: space-between;
    font-size: 0.75rem; color: var(--text-muted);

/* Settings page */

}

/* ── Notes List ─────────────────────────────────────────────── */
.cp-notes-list {
    display: flex; flex-direction: column; gap: var(--space-sm);
    margin-top: var(--space-md);
}
.cp-note-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); padding: var(--space-md);
}
.cp-note-pin {
    display: inline-block; font-size: 0.6875rem; font-weight: 600;
    color: var(--warning); background: rgba(251, 191, 36, 0.12);
    padding: 2px 8px; border-radius: var(--radius-full); margin-bottom: var(--space-xs);
}
.cp-note-content {
    font-size: 0.875rem; color: var(--text-primary); white-space: pre-wrap;
    margin-bottom: var(--space-xs);
}
.cp-note-meta { font-size: 0.75rem; color: var(--text-muted); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .cp-layout { flex-direction: column; }
    .cp-left { width: 100%; }
    .cp-pipeline-bar { flex-wrap: wrap; }
    .cp-stages { min-width: 0; }
}

/* ═══════════════════════════════════════════════════════════════
   ADMIN PANEL
   ═══════════════════════════════════════════════════════════════ */
.admin-section { margin-top: var(--space-lg); }

/* Tab Navigation */
.admin-tabs {
    display: flex; gap: 4px; padding: 4px;
    background: rgba(0,0,0,0.2); border-radius: var(--radius-md);
    margin-bottom: var(--space-lg); overflow-x: auto;
}
.admin-tab {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius-sm);
    background: transparent; border: none; color: var(--text-muted);
    font-size: 0.85rem; cursor: pointer; white-space: nowrap;
    transition: all 0.2s;
}
.admin-tab:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.admin-tab-active {
    color: var(--text-primary); background: rgba(99,102,241,0.15);
    font-weight: 600;
}
.admin-tab svg { width: 16px; height: 16px; }
.admin-tab-content { min-height: 300px; }
.admin-section-header {
    display: flex; align-items: center; gap: var(--space-md);
    margin-bottom: var(--space-lg); flex-wrap: wrap;
}
.admin-section-header h2 { margin: 0; font-size: 1.25rem; }
.admin-section-header .text-muted {
    flex: 1; margin: 0; font-size: 0.85rem; color: var(--text-muted);
}

/* Group cards grid */
.admin-groups-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--space-md);
}


/* Admin panel, custom fields, roles, templates */

/* Card */
.admin-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); padding: var(--space-md);
}
.admin-form-card { margin-bottom: var(--space-md); }
.admin-card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: var(--space-sm); padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--glass-border);
}
.admin-card-header h3 { margin: 0; font-size: 1rem; color: var(--text-primary); }
.admin-card-actions { display: flex; gap: var(--space-xs); }

/* Fields list */
.admin-fields-list { display: flex; flex-direction: column; gap: var(--space-xs); }
.admin-field-item {
    display: flex; flex-direction: column; gap: 4px;
    padding: var(--space-xs) var(--space-sm);
    background: rgba(0,0,0,0.15); border-radius: var(--radius-sm);
}
.admin-field-main {
    display: flex; align-items: center; gap: var(--space-xs); width: 100%;
}
.admin-field-sort {
    display: flex; flex-direction: column; gap: 1px; flex-shrink: 0;
}
.admin-field-sort .btn-icon { font-size: 0.65rem; width: 20px; height: 14px; }
.admin-field-sort .btn-icon:disabled { opacity: 0.2; cursor: default; }
.admin-field-info { display: flex; gap: var(--space-sm); align-items: center; flex: 1; min-width: 0; }
.admin-field-name { font-size: 0.875rem; color: var(--text-primary); }
.admin-field-details {
    display: flex; gap: var(--space-sm); padding-left: 28px;
}
.admin-detail-tag {
    font-size: 0.65rem; color: var(--text-muted); font-style: italic;
}

/* Inline editing */
.admin-editable { cursor: pointer; }
.admin-editable:hover { color: var(--accent); }
.admin-inline-edit { display: flex; gap: var(--space-xs); align-items: center; }
.admin-inline-input {
    border-color: var(--accent) !important; background: rgba(0,0,0,0.3) !important;
}
.admin-field-type {
    font-size: 0.7rem; color: var(--accent); text-transform: uppercase;
    padding: 2px 6px; background: rgba(99,102,241,0.15); border-radius: var(--radius-sm);
}

/* Display flag toggles */
.admin-field-flags { display: flex; gap: 4px; align-items: center; }
.admin-flag {
    font-size: 0.6rem; padding: 2px 6px; border-radius: var(--radius-sm);
    border: 1px solid transparent; cursor: pointer; font-weight: 600;
    text-transform: uppercase; transition: all var(--transition-fast);
}
.admin-flag-on {
    background: rgba(52, 211, 153, 0.15); color: #34d399; border-color: rgba(52, 211, 153, 0.3);
}
.admin-flag-on:hover { background: rgba(52, 211, 153, 0.25); }
.admin-flag-off {
    background: rgba(255,255,255,0.04); color: var(--text-muted); border-color: rgba(255,255,255,0.08);
}
.admin-flag-off:hover { background: rgba(255,255,255,0.08); color: var(--text-secondary); }

.admin-field-badge {
    font-size: 0.65rem; padding: 2px 5px; border-radius: var(--radius-sm);
    text-transform: uppercase; font-weight: 600;
}
.admin-badge-required {
    background: rgba(248, 113, 113, 0.15); color: #f87171;
}
.admin-field-tech {
    font-size: 0.65rem; color: var(--text-muted); font-family: monospace;
    padding: 1px 4px; background: rgba(255,255,255,0.05); border-radius: 3px;
}

/* Add field form */
.admin-add-field-form {
    margin-top: var(--space-sm); padding-top: var(--space-sm);
    border-top: 1px solid var(--glass-border);
}
.admin-field-form-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xs);
    margin-bottom: var(--space-xs);
}
.admin-field-form-actions {
    display: flex; gap: var(--space-xs); justify-content: flex-end;
}
.admin-checkbox-label {
    display: flex; align-items: center; gap: var(--space-xs);
    font-size: 0.8rem; color: var(--text-secondary); cursor: pointer;
}
.admin-checkbox-label input[type="checkbox"] {
    accent-color: var(--accent);
}

/* Inputs */
.admin-input {
    flex: 1; padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary); border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-size: 0.875rem; outline: none;
}
.admin-input:focus { border-color: var(--accent); }
.admin-input-sm { padding: var(--space-xs) var(--space-sm); font-size: 0.8rem; }
.admin-select {
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-secondary); border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-size: 0.8rem; outline: none;
}

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md); border-radius: var(--radius-sm);
    font-size: 0.875rem; font-weight: 500; cursor: pointer; border: none;
    transition: all var(--transition-fast);
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-hover); }
.btn-sm { padding: var(--space-xs) var(--space-sm); font-size: 0.8rem; }
.btn svg { width: 16px; height: 16px; }

.btn-icon {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    background: transparent; border: none; color: var(--text-secondary);
    cursor: pointer; transition: all var(--transition-fast);
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon svg { width: 16px; height: 16px; }
.btn-icon-sm { width: 28px; height: 28px; }
.btn-icon-sm svg { width: 14px; height: 14px; }
.btn-icon-xs { width: 24px; height: 24px; }
.btn-icon-xs svg { width: 12px; height: 12px; }
.btn-danger:hover { color: #f87171; background: rgba(248, 113, 113, 0.1); }

/* Form rows */
.admin-form-row { display: flex; gap: var(--space-sm); align-items: center; }

/* Empty state */
.admin-empty { font-size: 0.8rem; margin-top: var(--space-xs); }
.admin-empty-state {
    text-align: center; padding: var(--space-xl) * 2;
    color: var(--text-muted);
}
.admin-empty-state svg { width: 48px; height: 48px; stroke: var(--text-muted); margin-bottom: var(--space-md); }
.admin-empty-state h3 { color: var(--text-secondary); margin-bottom: var(--space-xs); }

.admin-loading { color: var(--text-muted); padding: var(--space-lg); text-align: center; }

/* ── Admin Table ── */
.admin-table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-table thead { background: rgba(0,0,0,0.3); }
.admin-table th { padding: 10px 14px; text-align: left; font-weight: 600; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.admin-table td { padding: 10px 14px; border-top: 1px solid var(--border-subtle); vertical-align: middle; }
.admin-table tr:hover { background: rgba(255,255,255,0.02); }
.admin-row-inactive { opacity: 0.5; }

/* Status badges */
.admin-status-badge { padding: 3px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; border: none; cursor: pointer; transition: all 0.2s; }
.admin-status-active { background: rgba(52,211,153,0.15); color: #34d399; }
.admin-status-active:hover { background: rgba(52,211,153,0.25); }
.admin-status-inactive { background: rgba(248,113,113,0.15); color: #f87171; }
.admin-status-inactive:hover { background: rgba(248,113,113,0.25); }

/* User form grid */
.admin-user-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-md); margin-bottom: var(--space-md); }
.admin-form-group label { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }

/* Inline edit group (horizontal inputs) */
.admin-inline-edit-group { display: flex; gap: 4px; align-items: center; }

/* Smaller select */
.admin-select-sm { padding: 4px 8px; font-size: 0.8rem; min-width: 100px; }

/* ═══════════════════════════════════════════════════════════════════════════
   ROLES MANAGEMENT
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Role Form ── */
.role-form {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}
.role-form h3 { margin: 0 0 16px; font-size: 1.1rem; }
.role-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }

/* ── Color Picker ── */
.color-picker-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch {
    width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent;
    cursor: pointer; transition: all 0.2s;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch-active { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,0.3); transform: scale(1.15); }

/* ── Module Checkboxes ── */
.module-checkboxes { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.checkbox-card {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; padding: 8px 14px; cursor: pointer;
    transition: all 0.2s; font-size: 0.85rem;
}
.checkbox-card:hover { background: rgba(255,255,255,0.07); border-color: rgba(99,102,241,0.4); }
.checkbox-card input[type="checkbox"] { accent-color: #6366f1; }

/* ── Permission Groups ── */
.permission-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 10px; }
.permission-group {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px; padding: 14px;
}
.permission-group-title {
    font-size: 0.85rem; font-weight: 600; color: var(--primary);
    margin: 0 0 10px; text-transform: capitalize;
}
.permission-checkboxes { display: flex; flex-direction: column; gap: 6px; }
.checkbox-item {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.83rem; cursor: pointer; padding: 4px 0;
}
.checkbox-item input[type="checkbox"] { accent-color: #6366f1; }

/* ── Roles Grid ── */
.roles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

/* ── Role Card ── */
.role-card {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 18px; transition: all 0.2s;
}
.role-card:hover { border-color: rgba(99,102,241,0.3); background: rgba(255,255,255,0.05); }
.role-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.role-color-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.role-card-info { flex: 1; }
.role-name { font-size: 1rem; font-weight: 600; margin: 0; }
.role-meta { font-size: 0.78rem; color: rgba(255,255,255,0.5); }
.role-card-actions { display: flex; gap: 4px; }
.btn-icon {
    background: transparent; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px; padding: 4px 8px; cursor: pointer;
    font-size: 0.85rem; transition: all 0.2s;
}
.btn-icon:hover { background: rgba(255,255,255,0.08); }
.btn-icon-danger:hover { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.3); }

/* ── Role Tags (Permissions) ── */
.role-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.role-tag {
    font-size: 0.7rem; padding: 2px 8px; border-radius: 4px;
    background: rgba(99,102,241,0.12); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.2);
}
.role-tag-more { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5); border-color: rgba(255,255,255,0.1); }

/* ── Module Badges ── */
.role-modules { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.module-badge {
    font-size: 0.7rem; padding: 2px 8px; border-radius: 4px;
    background: rgba(34,197,94,0.1); color: #86efac; border: 1px solid rgba(34,197,94,0.2);
    text-transform: capitalize;
}

/* ── Role Card Footer ── */
.role-card-footer { border-top: 1px solid rgba(255,255,255,0.05); padding-top: 10px; }

/* ── Form Error ── */
.form-error {
    background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3);
    color: #fca5a5; padding: 10px 14px; border-radius: 8px;
    font-size: 0.85rem; margin-bottom: 14px;
}

/* ── Form Actions ── */
.form-actions { display: flex; gap: 10px; margin-top: 16px; }

/* Helper text */
.text-sm { font-size: 0.8rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   TEMPLATES MANAGEMENT
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Filter Bar ── */
.template-filter { display: flex; gap: 8px; margin-bottom: 20px; }
.filter-btn {
    padding: 6px 14px; border-radius: 8px; font-size: 0.83rem;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7); cursor: pointer; transition: all 0.2s;
}
.filter-btn:hover { background: rgba(255,255,255,0.08); }
.filter-btn-active {
    background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.4);
    color: #a5b4fc;
}

/* ── Template Form ── */
.template-form {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 24px; margin-bottom: 24px;
}
.template-form h3 { margin: 0 0 16px; font-size: 1.1rem; }
.template-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 16px; }
.template-textarea { font-family: 'JetBrains Mono', 'Fira Code', monospace; resize: vertical; min-height: 160px; }
.template-body-header { display: flex; justify-content: space-between; align-items: center; }
.btn-text {
    background: none; border: none; color: var(--primary); cursor: pointer;
    font-size: 0.8rem; padding: 0;
}
.btn-text:hover { text-decoration: underline; }

/* ── Variable Hints ── */
.variable-hints {
    background: rgba(99,102,241,0.06); border: 1px solid rgba(99,102,241,0.15);
    border-radius: 8px; padding: 12px; margin-bottom: 10px;
}
.variable-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; margin-top: 8px; }
.variable-item { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; }
.variable-key { background: rgba(255,255,255,0.06); padding: 2px 6px; border-radius: 4px; color: #a5b4fc; font-size: 0.75rem; }
.variable-desc { color: rgba(255,255,255,0.6); }

/* ── Templates Grid ── */
.templates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }

/* ── Template Card ── */
.template-card {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 18px; transition: all 0.2s;
}
.template-card:hover { border-color: rgba(99,102,241,0.3); background: rgba(255,255,255,0.05); }
.template-inactive { opacity: 0.5; }
.template-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.template-category-badge {
    font-size: 0.75rem; padding: 3px 10px; border-radius: 6px;
    background: rgba(99,102,241,0.12); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.2);
}
.template-category-badge[data-category="note"] { background: rgba(234,179,8,0.12); color: #fde68a; border-color: rgba(234,179,8,0.2); }
.template-category-badge[data-category="task"] { background: rgba(34,197,94,0.12); color: #86efac; border-color: rgba(34,197,94,0.2); }
.template-card-actions { display: flex; gap: 4px; }
.template-name { font-size: 1rem; font-weight: 600; margin: 0 0 6px; }
.template-subject { font-size: 0.83rem; color: rgba(255,255,255,0.6); margin: 0 0 8px; }
.template-preview {
    font-size: 0.78rem; color: rgba(255,255,255,0.4); margin: 0 0 12px;
    background: rgba(255,255,255,0.02); border-radius: 6px; padding: 10px;
    white-space: pre-wrap; word-wrap: break-word; border: 1px solid rgba(255,255,255,0.04);
    font-family: inherit; max-height: 120px; overflow-y: auto;
}
.template-card-footer { border-top: 1px solid rgba(255,255,255,0.05); padding-top: 10px; }

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN GRID — CARD-BASED MAIN MENU (Penpot design)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Grid page ── */
.admin-grid-page { display: flex; flex-direction: column; gap: 24px; padding: 0; }

/* ── Info / Security Bar ── */
.admin-info-bar {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(67, 77, 123, 0.52); border-radius: 35px;
    padding: 14px 28px; gap: 16px;
}
.admin-info-left { display: flex; align-items: center; gap: 12px; }
.admin-shield-icon { display: flex; align-items: center; }
.admin-shield-icon svg { width: 28px; height: 28px; }
.admin-title {
    font-size: 1.4rem; font-weight: 700; margin: 0; color: #fff;
    letter-spacing: -0.01em;
}
.admin-info-center { flex: 1; text-align: center; }
.admin-last-login { color: rgba(255,255,255,0.4); font-size: 0.9rem; }
.admin-info-right { display: flex; align-items: center; gap: 8px; }
.admin-status-dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
}
.admin-status-dot.admin-status-active {
    background: rgb(20, 163, 6);
    box-shadow: 0 0 8px rgba(20, 163, 6, 0.5);
}
.admin-status-label { color: rgba(255,255,255,0.5); font-size: 0.8rem; }

/* ── Cards Grid (4 columns, 2 rows) ── */
.admin-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 1200px) { .admin-cards-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .admin-cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .admin-cards-grid { grid-template-columns: 1fr; } }

/* ── Feature Card ── */
.admin-feature-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 16px; padding: 40px 24px;
    background: rgba(67, 77, 123, 0.52); border: 1px solid rgba(99, 102, 241, 0.08);
    border-radius: 35px; cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center; min-height: 220px;
    position: relative; overflow: hidden;
}
.admin-feature-card::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.12), transparent 70%);
    opacity: 0; transition: opacity 0.3s;
}
.admin-feature-card:hover {
    background: rgba(67, 77, 123, 0.7);
    border-color: rgba(99, 102, 241, 0.25);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(99, 102, 241, 0.1);
}
.admin-feature-card:hover::before { opacity: 1; }
.admin-feature-card:active { transform: translateY(-1px); }

.admin-card-icon {
    display: flex; align-items: center; justify-content: center;
    width: 56px; height: 56px;
    background: rgba(99, 102, 241, 0.12); border-radius: 16px;
    transition: all 0.3s;
    color: rgba(165, 180, 252, 0.9);
}
.admin-card-icon svg { width: 28px; height: 28px; }
.admin-feature-card:hover .admin-card-icon {
    transform: scale(1.1);
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.admin-card-text { position: relative; z-index: 1; }
.admin-card-text h3 {
    font-size: 1.15rem; font-weight: 600; color: #fff; margin: 0 0 4px;
    letter-spacing: -0.01em;
}
.admin-card-text p {
    font-size: 0.8rem; color: rgba(255,255,255,0.5); margin: 0;
    line-height: 1.3;
}

/* ── Detail View ── */
.admin-detail-page { display: flex; flex-direction: column; gap: 20px; }
.admin-detail-header { display: flex; align-items: center; gap: 16px; }
.admin-back-btn {
    display: flex; align-items: center; gap: 6px;
    background: rgba(67, 77, 123, 0.3); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px; padding: 8px 16px;
    color: rgba(255,255,255,0.7); font-size: 0.85rem; cursor: pointer;
    transition: all 0.2s;
}
.admin-back-btn:hover { background: rgba(67, 77, 123, 0.5); color: #fff; }
.admin-back-btn svg { width: 16px; height: 16px; }
.admin-detail-title { font-size: 1.3rem; font-weight: 600; color: #fff; margin: 0; }
.admin-detail-content { flex: 1; }

/* ── Coming Soon ── */
.admin-coming-soon {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 80px 40px; text-align: center;
    background: rgba(67, 77, 123, 0.15); border-radius: 24px;
    border: 1px dashed rgba(255,255,255,0.1);
}
.coming-soon-icon { margin-bottom: 16px; color: rgba(255,255,255,0.3); }
.coming-soon-icon svg { width: 48px; height: 48px; }
.admin-coming-soon h3 { font-size: 1.3rem; color: rgba(255,255,255,0.6); margin: 0 0 8px; }
.admin-coming-soon p { font-size: 0.9rem; color: rgba(255,255,255,0.35); margin: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN SUB-PAGES — Pipelines, Automation, Knowledge, Call Settings
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Shared Admin Section ── */
.admin-section { display: flex; flex-direction: column; gap: 20px; }
.admin-section-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.admin-section-title { font-size: 1.2rem; font-weight: 600; color: #fff; margin: 0; }
.admin-section-subtitle { font-size: 0.85rem; color: rgba(255,255,255,0.4); margin: 4px 0 0; }

.admin-create-form {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    background: rgba(67,77,123,0.2); padding: 16px; border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
}
.admin-create-form .input-field { flex: 1; min-width: 180px; }
.admin-create-form .input-textarea { flex-basis: 100%; min-width: 100%; }

.admin-empty-state {
    text-align: center; padding: 60px 40px; color: rgba(255,255,255,0.35);
    background: rgba(67,77,123,0.1); border-radius: 16px;
    border: 1px dashed rgba(255,255,255,0.08);
}

/* ── Pipelines ── */
.admin-pipelines-list { display: flex; flex-direction: column; gap: 12px; }
.pipeline-card {
    background: rgba(67,77,123,0.2); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px; overflow: hidden; transition: all 0.2s;
}
.pipeline-card-expanded { border-color: rgba(99,102,241,0.3); }
.pipeline-card-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; cursor: pointer; transition: background 0.2s;
}
.pipeline-card-header:hover { background: rgba(99,102,241,0.06); }
.pipeline-card-header h3 { font-size: 1rem; color: #fff; margin: 0; }
.pipeline-expand-icon { color: rgba(255,255,255,0.4); font-size: 0.8rem; }

.pipeline-stages { padding: 0 20px 20px; }
.stages-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.stages-header h4 { font-size: 0.9rem; color: rgba(255,255,255,0.6); margin: 0; }
.stages-list { display: flex; flex-direction: column; gap: 8px; }
.stage-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; background: rgba(0,0,0,0.15); border-radius: 8px;
}
.stage-color-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.stage-name { flex: 1; color: #fff; font-size: 0.85rem; }
.stage-prob { color: rgba(255,255,255,0.4); font-size: 0.8rem; min-width: 40px; text-align: right; }
.stage-create-form { padding: 12px; }
.stage-create-form input[type="color"] { width: 40px; height: 32px; border: none; border-radius: 6px; cursor: pointer; }

.btn-small {
    padding: 4px 10px; font-size: 0.75rem; background: rgba(99,102,241,0.2);
    border: 1px solid rgba(99,102,241,0.3); color: #a5b4fc; border-radius: 6px;
    cursor: pointer; transition: all 0.2s;
}
.btn-small:hover { background: rgba(99,102,241,0.3); }
.btn-danger-sm { background: transparent; border: none; color: rgba(255,100,100,0.6); cursor: pointer; font-size: 0.9rem; }
.btn-danger-sm:hover { color: #ff6464; }
.empty-hint { font-size: 0.85rem; color: rgba(255,255,255,0.3); text-align: center; padding: 16px 0; }
.input-small { max-width: 100px; }

/* ── Automation ── */
.admin-automations-list { display: flex; flex-direction: column; gap: 12px; }
.automation-card {
    background: rgba(67,77,123,0.2); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px; padding: 16px 20px; transition: all 0.2s;
}
.automation-active { border-color: rgba(20,163,6,0.3); }
.automation-card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.automation-info { flex: 1; }
.automation-info h3 { font-size: 1rem; color: #fff; margin: 0 0 6px; }
.automation-trigger-badge {
    font-size: 0.7rem; padding: 2px 8px; border-radius: 6px;
    background: rgba(99,102,241,0.15); color: #a5b4fc;
}
.automation-actions { display: flex; align-items: center; gap: 8px; }
.automation-card-bottom { margin-top: 10px; }
.automation-stat { font-size: 0.8rem; color: rgba(255,255,255,0.35); }

/* ── Toggles ── */
.toggle-btn {
    padding: 4px 12px; font-size: 0.75rem; border-radius: 20px;
    border: 1px solid; cursor: pointer; transition: all 0.2s;
}
.toggle-on { background: rgba(20,163,6,0.15); border-color: rgba(20,163,6,0.4); color: #4ade80; }
.toggle-off { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.1); color: rgba(255,255,255,0.4); }
.toggle-on:hover { background: rgba(20,163,6,0.25); }
.toggle-off:hover { background: rgba(255,255,255,0.08); }

/* ── Knowledge ── */
.knowledge-articles-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.knowledge-card {
    background: rgba(67,77,123,0.2); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px; padding: 16px 20px; transition: all 0.2s;
}
.knowledge-draft { opacity: 0.6; border-style: dashed; }
.knowledge-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.knowledge-category-badge {
    font-size: 0.7rem; padding: 2px 8px; border-radius: 6px;
    background: rgba(99,102,241,0.15); color: #a5b4fc;
}
.knowledge-card-actions { display: flex; gap: 6px; align-items: center; }
.knowledge-title { font-size: 1rem; color: #fff; margin: 0 0 8px; }
.knowledge-preview { font-size: 0.8rem; color: rgba(255,255,255,0.35); margin: 0; line-height: 1.4; }

.category-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn {
    padding: 5px 12px; font-size: 0.75rem; border-radius: 8px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.5); cursor: pointer; transition: all 0.2s;
}
.filter-btn:hover { background: rgba(255,255,255,0.08); }
.filter-active { background: rgba(99,102,241,0.2); border-color: rgba(99,102,241,0.4); color: #a5b4fc; }

/* ── Settings Form (Call Settings) ── */
.settings-form {
    display: flex; flex-direction: column; gap: 20px;
    background: rgba(67,77,123,0.15); border-radius: 16px; padding: 24px;
    border: 1px solid rgba(255,255,255,0.06); max-width: 600px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 0.85rem; color: rgba(255,255,255,0.6); font-weight: 500; }
.form-toggles { gap: 14px; }
.form-toggle-row { display: flex; justify-content: space-between; align-items: center; }
.form-actions { display: flex; align-items: center; gap: 12px; padding-top: 8px; }
.btn-save { padding: 10px 24px; }
.save-feedback { font-size: 0.85rem; color: #4ade80; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ═══════════════════════════════════════════════════════════════════════════
   AUTOMATION — Split-Panel Layout (board.svg Design)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Outer Split Container ── */
.automation-split {
    display: flex;
    height: calc(100vh - 160px);
    gap: 0;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.4);
}

/* ── Left Panel ── */
.automation-left-panel {
    width: 300px;
    min-width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: rgba(20,24,48,0.95);
    border-right: 1px solid rgba(255,255,255,0.06);
    overflow: hidden;
}

/* Panel header (title + add button) */
.automation-panel-header {
    display: flex;

/* Automation canvas & editor */

    align-items: center;
    justify-content: space-between;
    padding: 16px 14px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.automation-panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    letter-spacing: -0.01em;
}
.automation-add-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.3);
    color: #a5b4fc;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.automation-add-btn:hover { background: rgba(99,102,241,0.28); }

/* Create form inside left panel */
.automation-create-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(99,102,241,0.06);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.automation-create-input,
.automation-create-select {
    width: 100%;
    font-size: 0.8rem;
    padding: 6px 10px;
}
.automation-create-actions {
    display: flex;
    gap: 6px;
}

/* Scrollable list of cards */
.automation-list-items {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 8px;
}

/* Individual automation card in list */
.automation-list-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.04);
    background: rgba(255,255,255,0.02);
    cursor: pointer;
    transition: all 0.15s;
}
.automation-list-card:hover {
    background: rgba(99,102,241,0.08);
    border-color: rgba(99,102,241,0.2);
}
.automation-list-card-selected,
.automation-list-card-selected:hover {
    background: rgba(99,102,241,0.14) !important;
    border-color: rgba(99,102,241,0.45) !important;
}
.automation-list-card-active {
    border-left: 2px solid rgba(20,163,6,0.6);
}

.automation-list-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.automation-list-card-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.automation-list-card-meta {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}
.automation-list-trigger-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(99,102,241,0.15);
    color: #a5b4fc;
}
.automation-list-nodes-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.45);
}
.automation-list-card-runs {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.3);
}
.automation-list-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.automation-toggle-btn {
    width: 26px;
    height: 16px;
    border-radius: 8px;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
}
.automation-toggle-btn.toggle-on {
    background: rgba(20,163,6,0.2);
    border-color: rgba(20,163,6,0.5);
}
.automation-toggle-btn.toggle-off {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
}
.toggle-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}
.toggle-dot-on { background: #4ade80; }
.toggle-dot-off { background: rgba(255,255,255,0.25); }

.automation-list-delete-btn {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: transparent;
    border: none;
    color: rgba(255,100,100,0.4);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.automation-list-delete-btn:hover { color: #ff6464; background: rgba(255,100,100,0.1); }

/* Empty state in list */
.automation-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 40px 20px;
    text-align: center;
    color: rgba(255,255,255,0.2);
    font-size: 0.8rem;
}

/* ── Right Panel ── */
.automation-canvas-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Empty placeholder when no automation selected */
.automation-canvas-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 14px;
    color: rgba(255,255,255,0.15);
    padding: 40px;
    text-align: center;
}
.automation-canvas-empty-icon svg {
    width: 64px;
    height: 64px;
    stroke: rgba(99,102,241,0.3);
}
.automation-canvas-empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(255,255,255,0.2);
    margin: 0;
}
.automation-canvas-empty-hint {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.15);
    margin: 0;
    max-width: 280px;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FLOW CANVAS — n8n-style Automation Editor
   ═══════════════════════════════════════════════════════════════════════════ */

/* Flow editor takes the full right panel height */
.flow-editor { display: flex; flex-direction: column; height: 100%; gap: 0; }

/* ── Toolbar ── */
.flow-toolbar {
    display: flex; align-items: center; gap: 16px; padding: 12px 20px;
    background: rgba(30,35,64,0.95); border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.flow-back-btn {
    padding: 6px 14px; font-size: 0.8rem; border-radius: 8px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6); cursor: pointer; transition: all 0.2s;
}
.flow-back-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.flow-title { flex: 1; font-size: 1rem; color: #fff; margin: 0; }
.flow-toolbar-actions { display: flex; align-items: center; gap: 10px; }
.btn-red { background: rgba(239,68,68,0.2) !important; border-color: rgba(239,68,68,0.4) !important; color: #f87171 !important; }
.btn-red:hover { background: rgba(239,68,68,0.3) !important; }

/* ── Workspace (sidebar + canvas) ── */
.flow-workspace { display: flex; flex: 1; min-height: 0; overflow: hidden; position: relative; }

/* ── Sidebar ── */
.flow-sidebar {
    width: 220px; flex-shrink: 0; display: flex; flex-direction: column;
    background: rgba(20,24,48,0.95); border-right: 1px solid rgba(255,255,255,0.06);
    padding: 14px 0;
}
.flow-sidebar-title { font-size: 0.85rem; color: rgba(255,255,255,0.5); margin: 0 14px 10px; text-transform: uppercase; letter-spacing: 1px; }
.flow-sidebar-tabs { display: flex; gap: 2px; padding: 0 10px; margin-bottom: 10px; }
.flow-tab {
    flex: 1; padding: 5px 4px; font-size: 0.7rem; text-align: center; border-radius: 6px;
    background: transparent; border: 1px solid rgba(255,255,255,0.06); color: rgba(255,255,255,0.4);
    cursor: pointer; transition: all 0.2s;
}
.flow-tab:hover { background: rgba(255,255,255,0.06); }
.flow-tab-active { background: rgba(99,102,241,0.2); border-color: rgba(99,102,241,0.4); color: #a5b4fc; }

.flow-sidebar-nodes { flex: 1; overflow-y: auto; padding: 0 10px; display: flex; flex-direction: column; gap: 4px; }
.flow-palette-node {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
    border-left: 3px solid transparent; border-radius: 8px;
    cursor: pointer; transition: all 0.15s; color: #fff; font-size: 0.8rem;
}
.flow-palette-node:hover { background: rgba(99,102,241,0.1); border-color: rgba(99,102,241,0.2); transform: translateX(2px); }
.flow-palette-icon { font-size: 1rem; }
.flow-palette-label { font-size: 0.8rem; color: rgba(255,255,255,0.8); }

.flow-sidebar-hint {
    padding: 10px 14px; border-top: 1px solid rgba(255,255,255,0.06); margin-top: 8px;
}
.flow-sidebar-hint p { font-size: 0.7rem; color: rgba(255,255,255,0.25); margin: 2px 0; }

/* ── SVG Canvas ── */
.flow-canvas {
    flex: 1; background: #0d1025; cursor: default; user-select: none;
    min-height: 0;
}

/* ── Edges ── */
.flow-edge {
    fill: none; stroke: #6366F1; stroke-width: 2; opacity: 0.7;
    transition: opacity 0.15s;
}
.flow-edge:hover { opacity: 1; stroke-width: 3; }
.flow-edge-preview { stroke-dasharray: 6 4; opacity: 0.5; animation: flowDash 0.6s linear infinite; }
@keyframes flowDash { to { stroke-dashoffset: -10; } }

/* ── Nodes ── */
.flow-node { cursor: grab; transition: filter 0.15s; }
.flow-node:active { cursor: grabbing; }
.flow-node:hover .flow-node-body { filter: brightness(1.15); }
.flow-node-selected .flow-node-body { stroke-width: 3 !important; filter: drop-shadow(0 0 8px rgba(99,102,241,0.5)); }
.flow-node-type { font-family: inherit; letter-spacing: 0.5px; }
.flow-node-label { font-family: inherit; }

/* ── Ports ── */
.flow-port {
    fill: #1e2340; stroke: #6366F1; stroke-width: 2;
    cursor: crosshair; transition: all 0.15s;
}
.flow-port:hover { fill: #6366F1; r: 9; }


/* ── List View Enhancements ── */
.btn-canvas-edit {
    padding: 5px 12px; font-size: 0.75rem; border-radius: 8px;
    background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.3);
    color: #a5b4fc; cursor: pointer; transition: all 0.2s;
}
.btn-canvas-edit:hover { background: rgba(99,102,241,0.25); }
.automation-nodes-badge {
    font-size: 0.65rem; padding: 1px 6px; border-radius: 4px;
    background: rgba(99,102,241,0.1); color: rgba(165,180,252,0.7);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 2: Execution Run Controls & Live Overlay
   ═══════════════════════════════════════════════════════════════════════════ */

/* Run button */
.btn-run {
    padding: 5px 14px; font-size: 0.8rem; border-radius: 8px;
    background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.35);
    color: #34d399; cursor: pointer; transition: all 0.2s; font-weight: 600;
}
.btn-run:hover:not(:disabled) { background: rgba(16,185,129,0.25); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(16,185,129,0.2); }
.btn-run:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-running { animation: runPulse 1.5s ease-in-out infinite; }
@keyframes runPulse {
    0%, 100% { border-color: rgba(245,158,11,0.35); color: #fbbf24; }
    50% { border-color: rgba(245,158,11,0.7); box-shadow: 0 0 12px rgba(245,158,11,0.3); }
}

/* History button */
.btn-history {
    padding: 5px 14px; font-size: 0.8rem; border-radius: 8px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6); cursor: pointer; transition: all 0.2s;
}
.btn-history:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* Run History Panel — slides in from bottom */
.run-history-panel {
    position: absolute; bottom: 0; left: 220px; right: 0;
    height: 220px; background: rgba(13,16,37,0.97);
    border-top: 1px solid rgba(99,102,241,0.25);
    backdrop-filter: blur(12px);
    display: flex; flex-direction: column;
    z-index: 100;
    animation: slideUp 0.2s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.run-history-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.run-history-title { font-size: 0.85rem; color: rgba(255,255,255,0.7); font-weight: 600; }
.run-history-close {
    background: none; border: none; color: rgba(255,255,255,0.4);
    font-size: 1.2rem; cursor: pointer; padding: 0 4px; line-height: 1;
}
.run-history-close:hover { color: #fff; }
.run-history-list { flex: 1; overflow-y: auto; padding: 8px 16px; display: flex; flex-direction: column; gap: 4px; }
.run-history-empty { color: rgba(255,255,255,0.3); font-size: 0.8rem; text-align: center; margin-top: 20px; }
.run-history-item {
    display: flex; align-items: center; gap: 10px; padding: 7px 12px;
    background: rgba(255,255,255,0.03); border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
    font-size: 0.8rem; cursor: pointer; transition: background 0.15s;
}
.run-history-item:hover { background: rgba(99,102,241,0.08); }
.run-status-icon { font-size: 1rem; flex-shrink: 0; }
.run-timestamp { color: rgba(255,255,255,0.6); font-family: monospace; }
.run-duration { color: rgba(255,255,255,0.3); font-size: 0.75rem; }
.run-error { color: #fbbf24; font-size: 0.8rem; }

/* Flow editor parent must be relative for the panel to anchor */
.flow-editor { position: relative; }

/* Status badge animation on running nodes */
@keyframes nodePulse {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(245,158,11,0.4)); }
    50% { filter: drop-shadow(0 0 12px rgba(245,158,11,0.8)); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   INFINITE CANVAS — Grid-Toggle + Zoom Controls
   ═══════════════════════════════════════════════════════════════════════════ */

/* Canvas Controls wrapper (Zoom% + Grid-Toggle) */
.canvas-controls {
    display: flex; align-items: center; gap: 6px;
    padding: 2px 2px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
}

/* Zoom reset button */
.canvas-ctrl-btn {
    padding: 4px 10px; font-size: 0.75rem; font-weight: 600;
    background: transparent; border: none;
    color: rgba(255,255,255,0.55); cursor: pointer;
    border-radius: 8px; transition: all 0.15s;
    min-width: 46px; text-align: center;
    font-variant-numeric: tabular-nums;
}
.canvas-ctrl-btn:hover { background: rgba(99,102,241,0.15); color: #a5b4fc; }

/* Grid-Toggle group */
.grid-toggle-group {
    display: flex; align-items: center;
    border-left: 1px solid rgba(255,255,255,0.08);
    padding-left: 6px; gap: 2px;
}
.grid-btn {
    width: 26px; height: 24px; display: flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid transparent;
    border-radius: 6px; color: rgba(255,255,255,0.35); cursor: pointer;
    font-size: 0.75rem; transition: all 0.15s; font-weight: 700;
}
.grid-btn:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }
.grid-btn-active {
    background: rgba(99,102,241,0.18);
    border-color: rgba(99,102,241,0.35);
    color: #a5b4fc;
}

/* Make the SVG canvas cursor show panning state */
.flow-canvas { cursor: default; }
.flow-canvas:active { cursor: grabbing; }

/* ═══════════════════════════════════════════════════════════════════════════
   PROPERTIES PANEL — Slide-in Node Configuration
   ═══════════════════════════════════════════════════════════════════════════ */

.properties-panel {
    width: 0; overflow: hidden; transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(15,18,40,0.98); border-left: 1px solid rgba(255,255,255,0.06);
    display: flex; flex-direction: column; flex-shrink: 0;
}
.properties-panel-open {
    width: 340px; overflow-y: auto;
    animation: propertiesSlideIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes propertiesSlideIn {
    from { width: 0; opacity: 0; }
    to { width: 340px; opacity: 1; }
}

/* Header */
.properties-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 16px 12px; border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.properties-header-info { display: flex; align-items: center; gap: 10px; }
.properties-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0;
}
.properties-header-text { display: flex; flex-direction: column; gap: 2px; }
.properties-type-badge {
    font-size: 0.6rem; letter-spacing: 1px; color: rgba(255,255,255,0.35);
    font-weight: 700;
}
.properties-title { font-size: 0.95rem; font-weight: 600; color: #fff; margin: 0; }
.properties-close-btn {
    width: 28px; height: 28px; border-radius: 8px;
    background: rgba(255,255,255,0.06); border: none;
    color: rgba(255,255,255,0.4); font-size: 1rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.properties-close-btn:hover { background: rgba(255,100,100,0.15); color: #ff6464; }

/* Description */
.properties-description {
    font-size: 0.78rem; color: rgba(255,255,255,0.4); margin: 0;
    padding: 8px 16px 12px; line-height: 1.4;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

/* Sections */
.properties-section { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.properties-section-header { margin-bottom: 10px; }
.properties-section-title {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.8px;
    color: rgba(255,255,255,0.35); font-weight: 600;
}
.properties-config-section { padding: 12px 16px; }

/* Fields */
.properties-field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 4px; }
.properties-field-toggle { flex-direction: row; justify-content: space-between; align-items: center; }
.properties-label {
    font-size: 0.78rem; color: rgba(255,255,255,0.6); font-weight: 500;
}
.properties-field-hint {
    font-size: 0.7rem; color: rgba(255,255,255,0.25); font-style: italic;
}
.properties-input {
    width: 100%; padding: 8px 10px; font-size: 0.82rem;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; color: #fff; outline: none;
    transition: border-color 0.15s;
}
.properties-input:focus { border-color: rgba(99,102,241,0.5); }
.properties-input-number { max-width: 120px; }
.properties-input-small { flex: 1; }
.properties-select {
    width: 100%; padding: 8px 10px; font-size: 0.82rem;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; color: #fff; outline: none;
    appearance: none; cursor: pointer;
}
.properties-textarea {
    width: 100%; padding: 8px 10px; font-size: 0.82rem;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; color: #fff; outline: none; resize: vertical;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    min-height: 80px; line-height: 1.5;
}
.properties-textarea:focus { border-color: rgba(99,102,241,0.5); }

/* Toggle */
.properties-toggle {
    width: 36px; height: 20px; border-radius: 10px;
    border: 1px solid; cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; padding: 0 2px; position: relative;
}
.properties-toggle.toggle-on {
    background: rgba(20,163,6,0.2); border-color: rgba(20,163,6,0.5);
    justify-content: flex-end;
}
.properties-toggle.toggle-off {
    background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.15);
    justify-content: flex-start;
}

/* Array fields */
.properties-array-items { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.properties-array-item {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 8px; background: rgba(99,102,241,0.08);
    border: 1px solid rgba(99,102,241,0.15); border-radius: 6px;
}
.properties-array-value { flex: 1; font-size: 0.8rem; color: #a5b4fc; }
.properties-array-remove {
    width: 18px; height: 18px; border-radius: 4px;
    background: transparent; border: none; color: rgba(255,100,100,0.5);
    cursor: pointer; font-size: 0.7rem; display: flex; align-items: center;
    justify-content: center; transition: all 0.15s;
}
.properties-array-remove:hover { color: #ff6464; background: rgba(255,100,100,0.1); }
.properties-array-add { display: flex; gap: 4px; }

/* Ports info */
.properties-ports-list { display: flex; flex-direction: column; gap: 4px; }
.properties-port-item {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 8px; background: rgba(255,255,255,0.03); border-radius: 6px;
}
.properties-port-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #6366F1; flex-shrink: 0;
}
.properties-port-label { font-size: 0.8rem; color: rgba(255,255,255,0.7); }
.properties-port-id { font-size: 0.7rem; color: rgba(255,255,255,0.25); }

/* Template variables */
.properties-vars-section { border-bottom: none; }
.properties-vars-list {
    display: flex; flex-wrap: wrap; gap: 4px;
}
.properties-var {
    font-size: 0.7rem; padding: 2px 8px; border-radius: 4px;
    background: rgba(99,102,241,0.08); color: rgba(165,180,252,0.7);
    border: 1px solid rgba(99,102,241,0.12); cursor: pointer;
    transition: all 0.15s;
}
.properties-var:hover { background: rgba(99,102,241,0.15); color: #a5b4fc; }

.properties-empty-config { padding: 16px 0; }
.properties-hint { font-size: 0.8rem; color: rgba(255,255,255,0.25); margin: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   PALETTE SEARCH — Node search input
   ═══════════════════════════════════════════════════════════════════════════ */

.flow-sidebar-search { padding: 0 10px 8px; }
.flow-search-input {
    width: 100%; padding: 6px 10px; font-size: 0.78rem;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px; color: #fff; outline: none;
    transition: border-color 0.15s;
}
.flow-search-input:focus { border-color: rgba(99,102,241,0.4); }
.flow-search-input::placeholder { color: rgba(255,255,255,0.2); }

.flow-palette-empty {
    padding: 20px 10px; text-align: center;
    color: rgba(255,255,255,0.2); font-size: 0.78rem;
}
.flow-palette-info { display: flex; flex-direction: column; gap: 1px; }
.flow-palette-ports { font-size: 0.65rem; color: rgba(255,255,255,0.3); }

/* ═══════════════════════════════════════════════════════════════════════════
   EXECUTION-AWARE EDGES
   ═══════════════════════════════════════════════════════════════════════════ */

.flow-edge-done { stroke: #10B981; opacity: 0.9; }
.flow-edge-failed { stroke: #EF4444; opacity: 0.9; stroke-dasharray: 8 4; }
.flow-edge-running { stroke: #F59E0B; opacity: 0.9; animation: edgePulse 1.2s ease-in-out infinite; }
@keyframes edgePulse {
    0%, 100% { stroke-opacity: 0.5; }
    50% { stroke-opacity: 1; }
}
.flow-edge-label {
    font-family: inherit; pointer-events: none;
}

/* Running node animation */
.flow-node-running .flow-node-body {
    animation: nodeRunPulse 1.5s ease-in-out infinite;
}
@keyframes nodeRunPulse {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(245,158,11,0.3)); }
    50% { filter: drop-shadow(0 0 14px rgba(245,158,11,0.7)); }
}

/* Config preview in nodes */
.flow-node-config-preview {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    letter-spacing: -0.02em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 2: Context Menu, Shortcuts, Undo/Redo, Multi-Select
   ═══════════════════════════════════════════════════════════════════════════ */

/* Editor focus */
.flow-editor:focus { outline: none; }

/* ── Toolbar Undo/Redo Group ── */
.toolbar-undo-group {
    display: flex; gap: 2px; margin-left: 12px;
    background: rgba(255,255,255,0.04); border-radius: 8px; padding: 2px;
}
.toolbar-undo-btn {
    width: 30px; height: 28px; border-radius: 6px;
    background: transparent; border: none;
    color: rgba(255,255,255,0.6); font-size: 0.9rem;
    cursor: pointer; display: flex; align-items: center;
    justify-content: center; transition: all 0.15s;
}
.toolbar-undo-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.toolbar-btn-disabled {
    opacity: 0.25; pointer-events: none;
}

/* ── Context Menu ── */
.ctx-menu-backdrop {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
}
.ctx-menu {
    position: fixed; z-index: 1001; min-width: 200px;
    background: rgba(20,24,50,0.95);
    backdrop-filter: blur(16px) saturate(1.6);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px; padding: 6px 0;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 1px rgba(255,255,255,0.1);
    animation: ctxAppear 0.12s cubic-bezier(0.2, 0, 0.13, 1.5);
}
@keyframes ctxAppear {
    from { opacity: 0; transform: scale(0.92) translateY(-4px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.ctx-menu-section { padding: 2px 0; }
.ctx-menu-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 14px; width: 100%;
    background: transparent; border: none;
    color: rgba(255,255,255,0.8); font-size: 0.82rem;
    cursor: pointer; text-align: left; transition: all 0.1s;
}
.ctx-menu-item:hover { background: rgba(99,102,241,0.15); color: #fff; }
.ctx-menu-danger:hover { background: rgba(239,68,68,0.15); color: #f87171; }
.ctx-menu-disabled { opacity: 0.3; pointer-events: none; }
.ctx-icon { font-size: 0.9rem; width: 18px; text-align: center; }
.ctx-shortcut {
    margin-left: auto; font-size: 0.68rem; color: rgba(255,255,255,0.25);
    font-family: system-ui; letter-spacing: 0.5px;
}
.ctx-menu-divider {
    height: 1px; margin: 4px 12px;
    background: rgba(255,255,255,0.06);
}

/* ── Keyboard Shortcuts Overlay ── */
.shortcuts-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    z-index: 2000; display: flex; align-items: center; justify-content: center;
    animation: overlayIn 0.15s ease-out;
}
@keyframes overlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.shortcuts-modal {
    background: rgba(15,18,40,0.98);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px; padding: 0; width: 400px; max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    animation: modalIn 0.2s cubic-bezier(0.2, 0, 0.13, 1);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.shortcuts-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.shortcuts-title { font-size: 1rem; font-weight: 600; color: #fff; margin: 0; }
.shortcuts-close {
    width: 28px; height: 28px; border-radius: 8px;
    background: rgba(255,255,255,0.06); border: none;
    color: rgba(255,255,255,0.4); font-size: 0.9rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.shortcuts-close:hover { background: rgba(255,100,100,0.15); color: #ff6464; }
.shortcuts-list { padding: 8px 0; }
.shortcuts-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 20px; transition: background 0.1s;
}
.shortcuts-item:hover { background: rgba(255,255,255,0.03); }
.shortcuts-key {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px; padding: 3px 10px; font-size: 0.75rem;
    color: rgba(255,255,255,0.7); font-family: system-ui;
    min-width: 60px; text-align: center;
}
.shortcuts-desc { font-size: 0.82rem; color: rgba(255,255,255,0.5); }

/* ── Multi-Select Highlight ── */
.flow-node-multi-selected .flow-node-body {
    filter: drop-shadow(0 0 8px rgba(99,102,241,0.4));
}

/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 3: Minimap, Node Animations, Node Count Badge
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Minimap ── */
.minimap-container {
    position: absolute; bottom: 16px; right: 16px;
    width: 200px; height: 140px;
    border-radius: 12px; overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(10,12,30,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    cursor: crosshair; z-index: 50;
    transition: opacity 0.2s, transform 0.2s;
    opacity: 0.7;
}
.minimap-container:hover {
    opacity: 1; transform: scale(1.02);
    border-color: rgba(99,102,241,0.3);
}
.minimap-svg {
    width: 100%; height: 100%; display: block;
}

/* ── Node Count Badge ── */
.node-count-badge {
    position: absolute; bottom: 16px; left: 16px;
    padding: 6px 14px; border-radius: 20px;
    background: rgba(10,12,30,0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.06);
    font-size: 0.72rem; color: rgba(255,255,255,0.35);
    letter-spacing: 0.3px; z-index: 50;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* ── Node Appear Animation ── */
.flow-node {
    animation: nodeAppear 0.25s cubic-bezier(0.2, 0, 0.13, 1);
}
@keyframes nodeAppear {
    from { opacity: 0; transform: scale(0.9) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Node hover glow ── */
.flow-node-body {
    transition: filter 0.15s ease;
}
.flow-node:hover .flow-node-body {
    filter: drop-shadow(0 0 6px rgba(99,102,241,0.2));
}

/* ── Edge hover ── */
.flow-edge {
    transition: stroke-opacity 0.15s, stroke-width 0.15s;
    cursor: pointer;
}
.flow-edge:hover {
    stroke-opacity: 1 !important;
    stroke-width: 3px;
    filter: drop-shadow(0 0 4px rgba(99,102,241,0.3));
}

/* ── Connection preview pulse ── */
.flow-edge-preview {
    animation: edgePulse 1s ease infinite;
}
@keyframes edgePulse {
    0%, 100% { stroke-opacity: 0.6; }
    50% { stroke-opacity: 1; }
}

/* ── Ghost button style for toolbar ── */
.btn-ghost {
    background: rgba(255,255,255,0.04) !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    color: rgba(255,255,255,0.5) !important;
}
.btn-ghost:hover {
    background: rgba(255,255,255,0.08) !important;

/* Execution inspector */

/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 4: Execution Inspector & Timeline
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Execution Inspector Panel ── */
.exec-inspector {
    position: absolute; top: 0; right: -380px;
    width: 360px; height: 100%;
    background: rgba(10,14,35,0.97);
    backdrop-filter: blur(16px);
    border-left: 1px solid rgba(255,255,255,0.06);
    z-index: 80; overflow-y: auto;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.exec-inspector-open {
    right: 0;
    box-shadow: -8px 0 32px rgba(0,0,0,0.4);
}

.exec-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky; top: 0;
    background: rgba(10,14,35,0.98); z-index: 2;
}
.exec-header-info { display: flex; align-items: center; gap: 12px; }
.exec-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}
.exec-header-text { display: flex; flex-direction: column; gap: 2px; }
.exec-title { font-size: 0.9rem; font-weight: 600; color: #fff; margin: 0; }
.exec-close {
    width: 28px; height: 28px; border-radius: 8px;
    background: rgba(255,255,255,0.06); border: none;
    color: rgba(255,255,255,0.4); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.exec-close:hover { background: rgba(255,100,100,0.15); color: #ff6464; }

/* Status badge */
.exec-status {
    font-size: 0.7rem; padding: 2px 8px; border-radius: 10px;
    display: inline-flex; align-items: center; gap: 4px;
    font-weight: 500; width: fit-content;
}
.exec-status-done { background: rgba(16,185,129,0.15); color: #34D399; }
.exec-status-failed { background: rgba(239,68,68,0.15); color: #F87171; }
.exec-status-running {
    background: rgba(245,158,11,0.15); color: #FBBF24;
    animation: statusPulse 1.5s ease infinite;
}
.exec-status-skipped { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.4); }
@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Timing */
.exec-timing {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 20px; border-bottom: 1px solid rgba(255,255,255,0.03);
}
.exec-timing-label { font-size: 0.75rem; color: rgba(255,255,255,0.35); }
.exec-timing-value { font-size: 0.8rem; color: rgba(255,255,255,0.7); font-family: 'JetBrains Mono', monospace; }

/* Sections */
.exec-section { padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,0.03); }
.exec-section-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.exec-section-icon { font-size: 0.9rem; }
.exec-section-title { font-size: 0.78rem; font-weight: 600; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.5px; }

/* Data blocks */
.exec-data-block {
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px; padding: 12px; margin: 0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.72rem; color: rgba(255,255,255,0.6);
    line-height: 1.5; overflow-x: auto; white-space: pre-wrap;
    max-height: 200px; overflow-y: auto;
}

/* Error display */
.exec-error-section { background: rgba(239,68,68,0.04); }
.exec-error-msg {
    background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.15);
    border-radius: 8px; padding: 12px; margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem; color: #F87171;
    line-height: 1.5; white-space: pre-wrap;
}

/* Empty state */
.exec-empty { padding: 32px 20px; text-align: center; }
.exec-empty-text { font-size: 0.8rem; color: rgba(255,255,255,0.3); }

/* ── Execution Timeline ── */
.exec-timeline {
    position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 320px; max-height: 280px;
    background: rgba(10,14,35,0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
    z-index: 90; overflow: hidden;
    animation: tlSlideUp 0.3s cubic-bezier(0.2, 0, 0.13, 1);
}
@keyframes tlSlideUp {
    from { transform: translateX(-50%) translateY(100%); }
    to { transform: translateX(-50%) translateY(0); }
}
.exec-timeline-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.exec-timeline-title { font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,0.8); }
.exec-timeline-close {
    width: 24px; height: 24px; border-radius: 6px;
    background: rgba(255,255,255,0.06); border: none;
    color: rgba(255,255,255,0.4); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; transition: all 0.15s;
}
.exec-timeline-close:hover { background: rgba(255,100,100,0.15); color: #ff6464; }
.exec-timeline-list { padding: 8px 0; max-height: 220px; overflow-y: auto; }
.exec-timeline-empty { font-size: 0.78rem; color: rgba(255,255,255,0.3); text-align: center; padding: 16px; }

/* Timeline entries */
.exec-tl-entry {
    display: flex; gap: 12px; padding: 4px 16px; cursor: pointer;
    transition: background 0.1s;
}
.exec-tl-entry:hover { background: rgba(255,255,255,0.03); }
.exec-tl-connector {
    display: flex; flex-direction: column; align-items: center; width: 24px; flex-shrink: 0;
}
.exec-tl-status {
    width: 24px; height: 24px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; flex-shrink: 0;
}
.exec-tl-status-done { background: rgba(16,185,129,0.15); }
.exec-tl-status-failed { background: rgba(239,68,68,0.15); }
.exec-tl-status-running { background: rgba(245,158,11,0.15); animation: statusPulse 1.5s ease infinite; }
.exec-tl-line {
    width: 2px; flex: 1; min-height: 12px;
    background: rgba(255,255,255,0.08);
}
.exec-tl-info {
    display: flex; align-items: center; justify-content: space-between;
    flex: 1; min-height: 32px;
}
.exec-tl-label { font-size: 0.78rem; color: rgba(255,255,255,0.7); }
.exec-tl-duration {
    font-size: 0.68rem; color: rgba(255,255,255,0.3);
    font-family: 'JetBrains Mono', monospace;
}


/* Dashboard editor & widgets */

/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 5: Template Gallery
   ═══════════════════════════════════════════════════════════════════════════ */

/* Vorlagen button */
.btn-templates {
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.15)) !important;
    border: 1px solid rgba(99,102,241,0.3) !important;
    color: rgba(255,255,255,0.8) !important;
}
.btn-templates:hover {
    background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(139,92,246,0.25)) !important;
    color: #fff !important;
    border-color: rgba(99,102,241,0.5) !important;
}

/* Overlay */
.tmpl-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
    z-index: 3000; display: flex; align-items: center; justify-content: center;
    animation: overlayIn 0.15s ease-out;
}

/* Modal */
.tmpl-modal {
    background: rgba(12,15,38,0.98);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px; width: 720px; max-height: 85vh;
    overflow: hidden; display: flex; flex-direction: column;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 1px rgba(255,255,255,0.1);
    animation: modalIn 0.25s cubic-bezier(0.2, 0, 0.13, 1);
}

/* Header */
.tmpl-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 24px 28px 16px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.tmpl-header-left { display: flex; flex-direction: column; gap: 4px; }
.tmpl-title { font-size: 1.2rem; font-weight: 700; color: #fff; margin: 0; }
.tmpl-subtitle { font-size: 0.78rem; color: rgba(255,255,255,0.4); }
.tmpl-close {
    width: 32px; height: 32px; border-radius: 10px;
    background: rgba(255,255,255,0.06); border: none;
    color: rgba(255,255,255,0.4); font-size: 1rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.tmpl-close:hover { background: rgba(255,100,100,0.15); color: #ff6464; }

/* Filters */
.tmpl-filters { padding: 16px 28px; display: flex; flex-direction: column; gap: 12px; }
.tmpl-search {
    width: 100%; padding: 10px 16px; border-radius: 10px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    color: #fff; font-size: 0.85rem; outline: none;
    transition: border-color 0.15s;
}
.tmpl-search:focus { border-color: rgba(99,102,241,0.4); }
.tmpl-search::placeholder { color: rgba(255,255,255,0.25); }
.tmpl-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.tmpl-cat {
    padding: 5px 14px; border-radius: 20px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.5); font-size: 0.75rem; cursor: pointer;
    transition: all 0.15s;
}
.tmpl-cat:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }
.tmpl-cat-active {
    background: rgba(99,102,241,0.15) !important;
    border-color: rgba(99,102,241,0.3) !important;
    color: #818CF8 !important;
}

/* Card Grid */
.tmpl-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
    padding: 16px 28px 28px; overflow-y: auto; flex: 1;
}

/* Cards */
.tmpl-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px; padding: 18px; cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0, 0.13, 1);
}
.tmpl-card:hover {
    background: rgba(99,102,241,0.06);
    border-color: rgba(99,102,241,0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.tmpl-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tmpl-card-icon { font-size: 1.5rem; }
.tmpl-card-name { font-size: 0.88rem; font-weight: 600; color: #fff; margin: 0 0 6px; }
.tmpl-card-desc { font-size: 0.75rem; color: rgba(255,255,255,0.4); line-height: 1.5; margin: 0 0 12px; }
.tmpl-card-meta { display: flex; align-items: center; gap: 10px; }
.tmpl-card-nodes {
    font-size: 0.68rem; color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.04); padding: 2px 8px; border-radius: 8px;
}
.tmpl-card-cat {
    font-size: 0.68rem; color: rgba(99,102,241,0.6);
    background: rgba(99,102,241,0.08); padding: 2px 8px; border-radius: 8px;
}

/* Difficulty badges */
.tmpl-diff {
    font-size: 0.62rem; padding: 2px 8px; border-radius: 8px;
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.tmpl-diff-easy { background: rgba(16,185,129,0.12); color: #34D399; }
.tmpl-diff-medium { background: rgba(245,158,11,0.12); color: #FBBF24; }
.tmpl-diff-hard { background: rgba(139,92,246,0.12); color: #A78BFA; }

/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 6: Toast Notifications, Status Bar, Production Polish
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Toast Notifications ── */
.toast-container {
    position: fixed; bottom: 20px; right: 20px;
    z-index: 5000; display: flex; flex-direction: column-reverse;
    gap: 8px; pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 18px; border-radius: 12px; min-width: 260px;
    pointer-events: auto; cursor: default;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    animation: toastIn 0.3s cubic-bezier(0.2, 0, 0.13, 1);
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
.toast-success {
    background: rgba(16,185,129,0.12);
    border: 1px solid rgba(16,185,129,0.2);
    color: #34D399;
}
.toast-error {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.2);
    color: #F87171;
}
.toast-warning {
    background: rgba(245,158,11,0.12);
    border: 1px solid rgba(245,158,11,0.2);
    color: #FBBF24;
}
.toast-info {
    background: rgba(99,102,241,0.12);
    border: 1px solid rgba(99,102,241,0.2);
    color: #818CF8;
}
.toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast-msg { font-size: 0.8rem; flex: 1; }
.toast-dismiss {
    width: 20px; height: 20px; border-radius: 6px;
    background: rgba(255,255,255,0.06); border: none;
    color: rgba(255,255,255,0.3); font-size: 0.65rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.15s; flex-shrink: 0;
}
.toast-dismiss:hover { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.6); }

/* ── Status Bar ── */
.status-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px; height: 28px; flex-shrink: 0;
    background: rgba(8,10,28,0.95);
    border-top: 1px solid rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.68rem; color: rgba(255,255,255,0.3);
    letter-spacing: 0.3px;
}
.sb-left, .sb-right { display: flex; align-items: center; gap: 4px; }
.sb-item { padding: 0 6px; }
.sb-divider { color: rgba(255,255,255,0.1); padding: 0 2px; }
.sb-zoom { font-family: 'JetBrains Mono', monospace; }
.sb-save { padding: 0 6px; }
.sb-save-idle { color: rgba(255,255,255,0.2); }
.sb-save-saving {
    color: #FBBF24;
    animation: statusPulse 1s ease infinite;
}
.sb-save-saved { color: #34D399; }
.sb-save-error { color: #F87171; }
.sb-autosave { padding: 0 6px; }
.sb-autosave-on { color: rgba(16,185,129,0.5); }
.sb-autosave-off { color: rgba(255,255,255,0.15); }


/* ═══════════════════════════════════════════════════════════════════
   Dashboard Editor — Interactive Canvas with Drag & Drop
   ═══════════════════════════════════════════════════════════════════ */

.dashboard-editor {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: calc(100vh - 120px);
    padding: 0;
}

/* ── Toolbar ── */
.de-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: rgba(15,23,42,0.6);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    backdrop-filter: blur(16px);
    flex-shrink: 0;
}
.de-toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.de-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.de-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
}

/* Grid size controls */
.de-grid-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
}
.de-grid-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.de-grid-btn:hover {
    background: rgba(99,102,241,0.15);
    border-color: rgba(99,102,241,0.3);
    color: #818cf8;
}
.de-grid-info {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    padding: 0 4px;
    font-variant-numeric: tabular-nums;
}
.de-grid-sep {
    font-size: 10px;
    color: rgba(255,255,255,0.2);
    padding: 0 2px;
}
.de-widget-count {
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    padding: 4px 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
}

/* Unsaved indicator */
.de-unsaved {
    font-size: 11px;
    font-weight: 600;
    color: #fbbf24;
    animation: unsavedPulse 2s ease-in-out infinite;
}
@keyframes unsavedPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Buttons */
.de-btn {
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.de-btn-add {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    box-shadow: 0 2px 12px rgba(99,102,241,0.3);
}
.de-btn-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(99,102,241,0.4);
}
.de-btn-icon {
    font-size: 16px;
    font-weight: 700;
}
.de-btn-save {
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.5);
}
.de-btn-save.active {
    background: rgba(16,185,129,0.1);
    border-color: rgba(16,185,129,0.3);
    color: #10b981;
}
.de-btn-save.active:hover {
    background: rgba(16,185,129,0.2);
    box-shadow: 0 2px 12px rgba(16,185,129,0.2);
}

/* ── Error ── */
.de-error {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(248,113,113,0.08);
    border: 1px solid rgba(248,113,113,0.2);
    border-radius: 10px;
    color: #fca5a5;
    font-size: 13px;
}
.de-error button {
    background: none;
    border: none;
    color: #f87171;
    font-size: 18px;
    cursor: pointer;
}

/* ── Loading ── */
.de-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex: 1;
    color: rgba(255,255,255,0.4);
}
.de-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(99,102,241,0.15);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.de-spinner.small { width: 20px; height: 20px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════
   Interactive Canvas — THE GRID
   ═══════════════════════════════════════════════════════════════ */

.de-canvas {
    display: grid;
    gap: 10px;
    padding: 16px;
    flex: 1;
    background: rgba(15,23,42,0.4);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    user-select: none;
    transition: background 0.3s ease;
}
.de-canvas.dragging {
    background: rgba(15,23,42,0.6);
    border-color: rgba(99,102,241,0.15);
}

/* ── Grid cell backgrounds ── */
.de-grid-cell {
    border: 1.5px dashed rgba(255,255,255,0.04);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1;
    min-height: 120px;
}
.de-grid-cell.empty {
    border-color: rgba(255,255,255,0.06);
}
.de-grid-cell.empty:hover {
    border-color: rgba(99,102,241,0.25);
    background: rgba(99,102,241,0.03);
}
.de-canvas.dragging .de-grid-cell.empty {
    border-color: rgba(99,102,241,0.15);
    background: rgba(99,102,241,0.02);
}

/* Add cell button */
.de-add-cell {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
    color: rgba(255,255,255,0.15);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}
.de-grid-cell.empty:hover .de-add-cell { opacity: 1; }
.de-add-cell:hover {
    background: rgba(99,102,241,0.15);
    border-color: rgba(99,102,241,0.4);
    color: #818cf8;
    transform: scale(1.1);
}

/* ═══════════════════════════════════════════════════════════════
   Widgets — Draggable Cards
   ═══════════════════════════════════════════════════════════════ */

.de-widget {
    position: relative;
    background: linear-gradient(145deg, rgba(30,41,59,0.9), rgba(15,23,42,0.95));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    z-index: 10;
    min-height: 0;
}
.de-widget:hover {
    border-color: rgba(99,102,241,0.25);
    box-shadow: 0 4px 24px rgba(0,0,0,0.3), 0 0 0 1px rgba(99,102,241,0.1);
}
.de-widget.dragging {
    opacity: 0.85;
    border-color: rgba(99,102,241,0.5);
    box-shadow: 0 8px 40px rgba(99,102,241,0.2), 0 0 0 2px rgba(99,102,241,0.3);
    z-index: 100;
    transform: scale(1.02);
    cursor: grabbing;
}

/* ── Widget Header (Drag Handle) ── */
.de-widget-header {
    display: flex;
    align-items: center;
    padding: 8px 12px 4px;
    gap: 6px;
    cursor: grab;
}
.de-widget-header:active { cursor: grabbing; }

.de-drag-handle {
    font-size: 12px;
    color: rgba(255,255,255,0.12);
    letter-spacing: 2px;
    transition: color 0.2s ease;
    flex-shrink: 0;
}
.de-widget:hover .de-drag-handle { color: rgba(99,102,241,0.4); }

.de-widget-title {
    flex: 1;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.de-widget-remove {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(248,113,113,0.08);
    color: #f87171;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.15s ease;
}
.de-widget:hover .de-widget-remove { opacity: 1; }
.de-widget-remove:hover { background: rgba(248,113,113,0.2); transform: scale(1.1); }

/* ── Widget Body ── */
.de-widget-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px 10px;
    min-height: 0;
    overflow: hidden;
}
.de-widget-loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════
   Resize Handles — Edge & Corner Grips
   ═══════════════════════════════════════════════════════════════ */

.de-resize-e,
.de-resize-s,
.de-resize-se {
    position: absolute;
    z-index: 20;
    transition: opacity 0.15s ease;
    opacity: 0;
}
.de-widget:hover .de-resize-e,
.de-widget:hover .de-resize-s,
.de-widget:hover .de-resize-se {
    opacity: 1;
}

/* Right edge */
.de-resize-e {
    right: 0;
    top: 20%;
    bottom: 20%;
    width: 6px;
    cursor: ew-resize;
    border-radius: 0 4px 4px 0;
}
.de-resize-e::after {
    content: '';
    position: absolute;
    right: 1px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    border-radius: 2px;
    background: rgba(99,102,241,0.4);
    transition: background 0.15s ease;
}
.de-resize-e:hover::after { background: rgba(99,102,241,0.8); }

/* Bottom edge */
.de-resize-s {
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 6px;
    cursor: ns-resize;
    border-radius: 0 0 4px 4px;
}
.de-resize-s::after {
    content: '';
    position: absolute;
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%);
    height: 3px;
    width: 20px;
    border-radius: 2px;
    background: rgba(99,102,241,0.4);
    transition: background 0.15s ease;
}
.de-resize-s:hover::after { background: rgba(99,102,241,0.8); }

/* Bottom-right corner */
.de-resize-se {
    right: 0;
    bottom: 0;
    width: 14px;
    height: 14px;
    cursor: nwse-resize;
    border-radius: 0 0 12px 0;
}
.de-resize-se::after {
    content: '';
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 8px;
    height: 8px;
    border-right: 2px solid rgba(99,102,241,0.4);
    border-bottom: 2px solid rgba(99,102,241,0.4);
    border-radius: 0 0 3px 0;
    transition: border-color 0.15s ease;
}
.de-resize-se:hover::after {
    border-color: rgba(99,102,241,0.8);
}

/* ═══════════════════════════════════════════════════════════════
   SVG Charts
   ═══════════════════════════════════════════════════════════════ */

.widget-number { text-align: center; width: 100%; }
.widget-number-value {
    font-size: clamp(24px, 4vw, 42px);
    font-weight: 800;
    line-height: 1.2;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.widget-number-unit { font-size: 13px; color: rgba(255,255,255,0.35); margin-top: 2px; }
.widget-chart { width: 100%; height: 100%; min-height: 80px; }

/* ═══════════════════════════════════════════════════════════════
   Widget Creator Modal
   ═══════════════════════════════════════════════════════════════ */

.wc-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.wc-modal {
    background: linear-gradient(165deg, rgba(30,41,59,0.98), rgba(15,23,42,0.99));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    width: min(600px, 90vw);
    max-height: 80vh;
    display: flex; flex-direction: column;
    box-shadow: 0 20px 80px rgba(0,0,0,0.5);
    animation: modalSlideIn 0.2s ease;
}
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

.wc-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.wc-header h3 { margin: 0; font-size: 16px; color: rgba(255,255,255,0.9); }
.wc-close-btn {
    width: 28px; height: 28px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.4); font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s ease;
}
.wc-close-btn:hover { background: rgba(248,113,113,0.1); border-color: rgba(248,113,113,0.2); color: #f87171; }

.wc-body { padding: 18px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }

.wc-categories { display: flex; gap: 6px; flex-wrap: wrap; }
.wc-cat-btn {
    padding: 5px 12px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.5);
    font-size: 11px; font-weight: 600; cursor: pointer;
    transition: all 0.15s ease; text-transform: capitalize;
}
.wc-cat-btn.active, .wc-cat-btn:hover {
    background: rgba(99,102,241,0.12); border-color: rgba(99,102,241,0.3); color: #818cf8;
}

.wc-search {
    width: 100%; padding: 10px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px; color: rgba(255,255,255,0.85); font-size: 13px;
    outline: none; transition: border-color 0.2s ease;
}
.wc-search:focus { border-color: rgba(99,102,241,0.4); }
.wc-search::placeholder { color: rgba(255,255,255,0.2); }

.wc-kpi-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; padding-right: 4px; }
.wc-kpi-item {
    width: 100%; padding: 10px 14px; border-radius: 10px;
    border: 1px solid transparent; background: rgba(255,255,255,0.02);
    color: rgba(255,255,255,0.7); font-size: 13px; cursor: pointer;
    text-align: left; transition: all 0.15s ease;
    display: flex; align-items: center; gap: 10px;
}
.wc-kpi-item:hover { background: rgba(99,102,241,0.06); border-color: rgba(99,102,241,0.15); }
.wc-kpi-item.selected { background: rgba(99,102,241,0.1); border-color: rgba(99,102,241,0.3); color: #e0e7ff; }
.wc-kpi-icon { font-size: 16px; flex-shrink: 0; }
.wc-kpi-meta { flex: 1; }
.wc-kpi-name { font-weight: 600; }
.wc-kpi-desc { font-size: 11px; color: rgba(255,255,255,0.35); margin-top: 2px; }

.wc-config { padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.06); display: flex; flex-direction: column; gap: 12px; }
.wc-config-label { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.5px; }

.wc-display-types, .wc-time-ranges { display: flex; gap: 6px; flex-wrap: wrap; }
.wc-dt-btn, .wc-tr-btn {
    padding: 6px 14px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.5); font-size: 12px; font-weight: 600; cursor: pointer;
    transition: all 0.15s ease;
}
.wc-dt-btn.active, .wc-dt-btn:hover,
.wc-tr-btn.active, .wc-tr-btn:hover {
    background: rgba(99,102,241,0.12); border-color: rgba(99,102,241,0.3); color: #818cf8;
}

.wc-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid rgba(255,255,255,0.06); }
.wc-cancel-btn {
    padding: 8px 18px; border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.5); font-size: 13px; cursor: pointer;
    transition: all 0.15s ease;
}
.wc-cancel-btn:hover { background: rgba(255,255,255,0.06); }
.wc-create-btn {
    padding: 8px 22px; border-radius: 10px; border: none;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white; font-size: 13px; font-weight: 600; cursor: pointer;
    box-shadow: 0 2px 12px rgba(99,102,241,0.3);
    transition: all 0.15s ease;
}
.wc-create-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(99,102,241,0.4); }
.wc-create-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.wc-empty-config { padding: 20px; text-align: center; color: rgba(255,255,255,0.3); }
.wc-empty-icon { font-size: 32px; }
.wc-empty-config p { font-size: 13px; margin: 0; }

/* ═══════════════════════════════════════════════════════════════
   Dashboard Page — Read-only Widget Grid
   ═══════════════════════════════════════════════════════════════ */

.dash-widget-grid {
    display: grid;
    gap: 14px;
    margin-top: 20px;
    min-height: 300px;
}

.dash-widget {
    background: linear-gradient(145deg, rgba(30,41,59,0.85), rgba(15,23,42,0.92));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    animation: dashWidgetIn 0.4s ease backwards;
}
.dash-widget:hover {
    border-color: rgba(99,102,241,0.15);
    box-shadow: 0 4px 24px rgba(0,0,0,0.2), 0 0 0 1px rgba(99,102,241,0.06);
    transform: translateY(-2px);
}
@keyframes dashWidgetIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Stagger animation delay for each widget */
.dash-widget:nth-child(1)  { animation-delay: 0.0s; }
.dash-widget:nth-child(2)  { animation-delay: 0.05s; }
.dash-widget:nth-child(3)  { animation-delay: 0.10s; }
.dash-widget:nth-child(4)  { animation-delay: 0.15s; }
.dash-widget:nth-child(5)  { animation-delay: 0.20s; }
.dash-widget:nth-child(6)  { animation-delay: 0.25s; }
.dash-widget:nth-child(7)  { animation-delay: 0.30s; }
.dash-widget:nth-child(8)  { animation-delay: 0.35s; }
.dash-widget:nth-child(9)  { animation-delay: 0.40s; }
.dash-widget:nth-child(10) { animation-delay: 0.45s; }
.dash-widget:nth-child(11) { animation-delay: 0.50s; }
.dash-widget:nth-child(12) { animation-delay: 0.55s; }

.dash-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 6px;
}
.dash-widget-title {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-widget-range {
    font-size: 10px;
    color: rgba(255,255,255,0.2);
    padding: 2px 8px;
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
    flex-shrink: 0;
}

.dash-widget-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px 14px;
    min-height: 100px;
    overflow: hidden;
}

.dash-widget-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

/* ── Empty dashboard hint ── */
.dash-empty-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    margin-top: 20px;
    background: rgba(15,23,42,0.4);
    border: 1px dashed rgba(255,255,255,0.08);
    border-radius: 16px;
    text-align: center;
}
.dash-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.dash-empty-hint p {
    margin: 0;
    color: rgba(255,255,255,0.4);
    font-size: 14px;
}
.dash-empty-sub {
    margin-top: 8px !important;
    font-size: 12px !important;
    color: rgba(255,255,255,0.25) !important;
}
.dash-editor-link {
    color: #818cf8;
    text-decoration: none;
    font-weight: 600;
}
.dash-editor-link:hover {
    color: #a5b4fc;
    text-decoration: underline;
}

.dash-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    margin-top: 20px;
}

/* ── Live indicator dot (pulses green when WS connected) ── */
.dash-live-dot {
    color: #22c55e;
    font-size: 10px;
    margin-left: 8px;
    animation: live-pulse 2s ease-in-out infinite;
    vertical-align: middle;
}
@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}


/* Tenant management */

/* ═══════════════════════════════════════════════════════════════════════════
   TENANT MANAGEMENT
   ═══════════════════════════════════════════════════════════════════════════ */

/* Create form grid — 3 columns */
.tenant-create-grid {
    grid-template-columns: repeat(3, 1fr) !important;
}

/* Subdomain input with .selly.tech suffix */
.tenant-subdomain-input {
    display: flex;
    align-items: center;
    gap: 0;
}
.tenant-subdomain-input .admin-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
    flex: 1;
}
.tenant-subdomain-suffix {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-left: none;
    padding: 8px 12px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
    height: 38px;
    display: flex;
    align-items: center;
}

/* Tenant name cell with master badge */
.tenant-name-cell {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* Subdomain code display */
.tenant-subdomain-code {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.8rem;
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
}

/* Lead count progress bar */
.tenant-lead-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 100px;
}
.tenant-lead-info span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.tenant-lead-track {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}
.tenant-lead-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}
.tenant-lead-ok { background: var(--status-green, #22c55e); }
.tenant-lead-warn { background: var(--status-amber, #f59e0b); }
.tenant-lead-danger { background: var(--status-red, #ef4444); }

/* Stats overlay */
.tenant-stats-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.15s ease;
}
.tenant-stats-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    min-width: 420px;
    max-width: 520px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
}
.tenant-stats-card h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}
.tenant-stats-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.tenant-stats-close:hover { color: var(--text-primary); }
.tenant-stats-id {
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    margin-bottom: var(--space-md);
}
.tenant-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}
.tenant-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}
.tenant-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    line-height: 1.2;
}
.tenant-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* Alert success */
.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.alert-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
}
.alert-close:hover { opacity: 1; }

/* Text center utility */
.text-center { text-align: center; }

