/* ══════════════════════════════════════════════════════════════════
   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;
}

/* ── 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 ────────────────────────────────────────────────── */
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 ────────────────────────────────────────────────── */
.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; }

/* ── 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); } }

/* ── 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); }

/* ── 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 ─────────────────────────────────────────────────────── */
.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); }

/* ── 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);
}

/* ── 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;
}

/* ── 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; }

/* ── 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;
}

/* ── 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);
}
.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;
    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);
}

/* ── 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);
}

/* 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; } }

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

.flow-editor { display: flex; flex-direction: column; height: calc(100vh - 120px); 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; }

/* ── 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; }
.flow-port-input { }
.flow-port-output { }

/* ── 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);
}
