/* ═══════════════════════════════════════════════════════════════
   CRM THEME v3.0 — "Onyx" Design System
   Aesthetic: Linear/Vercel-inspired dark SaaS with warm accents
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&family=Playfair+Display:wght@400;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── DESIGN TOKENS ── */
:root {
    --font-body: 'Instrument Sans', -apple-system, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
    --shadow-glow: 0 0 20px rgba(var(--accent-rgb), 0.15);
    --sidebar-w: 260px;
    --sidebar-collapsed: 64px;
    --nav-h: 0px;
}







/* ── THEME: CYBERPUNK (OLED Black) ── */
[data-theme="cyberpunk"] {
    --bg: #000000;
    --bg-raised: #0A0A0A;
    --surface: #0F0F0F;
    --surface-hover: #161616;
    --card: #0F0F0F;
    --card-hover: #161616;
    --border: rgba(255,255,255,0.05);
    --border-hover: rgba(255,255,255,0.1);
    --border-accent: rgba(255,255,255,0.15);
    --text: #FAFAFA;
    --text-secondary: #888888;
    --text-tertiary: #555555;
    --accent: #FFFFFF;
    --accent-hover: #E0E0E0;
    --accent-muted: rgba(255,255,255,0.06);
    --accent-rgb: 255,255,255;
    --btn-text: #000000;
    --red: #FF6B6B;
    --red-muted: rgba(255,107,107,0.1);
    --amber: #FFD93D;
    --amber-muted: rgba(255,217,61,0.1);
    --emerald: #6BCB77;
    --emerald-muted: rgba(107,203,119,0.1);
    --blue: #4D96FF;
    --blue-muted: rgba(77,150,255,0.1);
    --sidebar-bg: #000000;
    --sidebar-border: rgba(255,255,255,0.04);
    --sidebar-item-hover: rgba(255,255,255,0.04);
    --sidebar-item-active: rgba(255,255,255,0.08);
    --input-bg: #0A0A0A;
    --scrollbar-thumb: rgba(255,255,255,0.06);
    --scrollbar-hover: rgba(255,255,255,0.12);
    --overlay: rgba(0,0,0,0.85);
    /* Backward compat */
    --muted: var(--text-tertiary);
    --dim: var(--text-secondary);
    --accent-l: var(--accent-hover);
    --accent-g: var(--accent-muted);
    --border-l: var(--border-hover);
    --emerald-g: var(--emerald-muted);
    --card-h: var(--card-hover);
}

/* ── THEME: AURORA (Frost Glass) ── */
[data-theme="aurora"] {
    --bg: #F0F2F5;
    --bg-raised: rgba(255,255,255,0.85);
    --surface: rgba(255,255,255,0.72);
    --surface-hover: rgba(255,255,255,0.9);
    --card: rgba(255,255,255,0.65);
    --card-hover: rgba(255,255,255,0.8);
    --border: rgba(0,0,0,0.06);
    --border-hover: rgba(0,0,0,0.1);
    --border-accent: rgba(139,92,246,0.2);
    --text: #1E1B4B;
    --text-secondary: #6366F1;
    --text-tertiary: #A5B4FC;
    --accent: #7C3AED;
    --accent-hover: #8B5CF6;
    --accent-muted: rgba(124,58,237,0.08);
    --accent-rgb: 124,58,237;
    --btn-text: #FFFFFF;
    --red: #F43F5E;
    --red-muted: rgba(244,63,94,0.08);
    --amber: #F59E0B;
    --amber-muted: rgba(245,158,11,0.08);
    --emerald: #10B981;
    --emerald-muted: rgba(16,185,129,0.08);
    --blue: #6366F1;
    --blue-muted: rgba(99,102,241,0.08);
    --sidebar-bg: rgba(255,255,255,0.6);
    --sidebar-border: rgba(0,0,0,0.06);
    --sidebar-item-hover: rgba(0,0,0,0.04);
    --sidebar-item-active: rgba(124,58,237,0.1);
    --input-bg: rgba(255,255,255,0.5);
    --scrollbar-thumb: rgba(0,0,0,0.1);
    --scrollbar-hover: rgba(0,0,0,0.16);
    --overlay: rgba(30,27,75,0.5);
    /* Backward compat */
    --muted: var(--text-tertiary);
    --dim: var(--text-secondary);
    --accent-l: var(--accent-hover);
    --accent-g: var(--accent-muted);
    --border-l: var(--border-hover);
    --emerald-g: var(--emerald-muted);
    --card-h: var(--card-hover);
}

/* ── THEME: MATRIX (Fintech) ── */
[data-theme="matrix"] {
    --bg: #060B11;
    --bg-raised: #0B1219;
    --surface: #101921;
    --surface-hover: #162230;
    --card: #101921;
    --card-hover: #162230;
    --border: rgba(45,212,191,0.08);
    --border-hover: rgba(45,212,191,0.16);
    --border-accent: rgba(45,212,191,0.25);
    --text: #E2E8F0;
    --text-secondary: #64748B;
    --text-tertiary: #3E5060;
    --accent: #2DD4BF;
    --accent-hover: #5EEAD4;
    --accent-muted: rgba(45,212,191,0.1);
    --accent-rgb: 45,212,191;
    --btn-text: #060B11;
    --red: #FB7185;
    --red-muted: rgba(251,113,133,0.1);
    --amber: #FBBF24;
    --amber-muted: rgba(251,191,36,0.1);
    --emerald: #2DD4BF;
    --emerald-muted: rgba(45,212,191,0.1);
    --blue: #38BDF8;
    --blue-muted: rgba(56,189,248,0.1);
    --sidebar-bg: #060B11;
    --sidebar-border: rgba(45,212,191,0.06);
    --sidebar-item-hover: rgba(45,212,191,0.05);
    --sidebar-item-active: rgba(45,212,191,0.1);
    --input-bg: #0B1219;
    --scrollbar-thumb: rgba(45,212,191,0.1);
    --scrollbar-hover: rgba(45,212,191,0.18);
    --overlay: rgba(6,11,17,0.85);
    /* Backward compat */
    --muted: var(--text-tertiary);
    --dim: var(--text-secondary);
    --accent-l: var(--accent-hover);
    --accent-g: var(--accent-muted);
    --border-l: var(--border-hover);
    --emerald-g: var(--emerald-muted);
    --card-h: var(--card-hover);
}

/* ═══════════════════════════════════════════════════════════════
   GLOBAL RESET & BASE
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; background: #0e1320; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    overflow-x: hidden;
}

::selection { background: rgba(var(--accent-rgb), 0.25); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* ═══════════════════════════════════════════════════════════════
   LAYOUT SYSTEM — Sidebar + Main Content
   ═══════════════════════════════════════════════════════════════ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.sidebar-brand-icon {
    width: 32px; height: 32px;
    background: var(--accent);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
    color: var(--btn-text);
    flex-shrink: 0;
}
.sidebar-brand-text {
    font-family: var(--font-display);
    font-size: 16px; font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-section {
    padding: 12px 12px 4px;
}
.sidebar-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-tertiary);
    padding: 8px 8px 6px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
}
.sidebar-item:hover {
    background: var(--sidebar-item-hover);
    color: var(--text);
}
.sidebar-item.active {
    background: var(--sidebar-item-active);
    color: var(--accent);
    border-color: var(--border-accent);
    font-weight: 600;
}
.sidebar-item .si-icon {
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
    opacity: 0.7;
}
.sidebar-item.active .si-icon { opacity: 1; }

.sidebar-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--red);
    color: #fff;
    line-height: 1.4;
    min-width: 18px;
    text-align: center;
}
.sidebar-badge.accent { background: var(--accent); color: var(--btn-text); }
.sidebar-badge.muted { background: var(--border); color: var(--text-secondary); }

.sidebar-footer {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.sidebar-user:hover { background: var(--sidebar-item-hover); }
.sidebar-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    color: var(--btn-text);
    flex-shrink: 0;
}
.sidebar-user-info { overflow: hidden; flex: 1; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; }

/* ── MAIN CONTENT AREA ── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s;
}

/* ── TOP BAR ── */
.topbar {
    height: 56px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: var(--bg-raised);
    position: sticky;
    top: 0;
    z-index: 40;
    flex-shrink: 0;
    backdrop-filter: blur(12px);
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.topbar-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
}
.topbar-breadcrumb {
    font-size: 12px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.topbar-breadcrumb span { color: var(--text-secondary); }
.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Mobile hamburger */
.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    color: var(--text);
    cursor: pointer;
    font-size: 18px;
}

/* ── PAGE CONTENT ── */
.page-content {
    padding: 28px;
    flex: 1;
}

/* ═══════════════════════════════════════════════════════════════
   COMPONENT LIBRARY
   ═══════════════════════════════════════════════════════════════ */

/* ── CARDS ── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--border-hover); }
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.card-header .card-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}
.card-subtitle {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* ── STAT CARDS ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--border-hover); }
.stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}
.stat-value {
    font-family: var(--font-body);
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}
.stat-change {
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
}

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border-hover); }

.btn-primary {
    background: var(--accent);
    color: var(--btn-text);
    border-color: transparent;
    font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hover); color: var(--btn-text); box-shadow: var(--shadow-glow); }

.btn-danger { color: var(--red); border-color: var(--red-muted); }
.btn-danger:hover { background: var(--red-muted); color: var(--red); }

.btn-success { color: var(--emerald); border-color: var(--emerald-muted); }
.btn-success:hover { background: var(--emerald-muted); }

.btn-ghost { border-color: transparent; }
.btn-ghost:hover { background: var(--surface-hover); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 7px; font-size: 11px; border-radius: 4px; }
.btn-lg { padding: 12px 24px; font-size: 14px; }

.btn-icon {
    width: 34px; height: 34px;
    padding: 0;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-icon.sm { width: 28px; height: 28px; font-size: 13px; }

/* ── INPUTS ── */
.input {
    width: 100%;
    padding: 9px 13px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 13.5px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}
.input::placeholder { color: var(--text-tertiary); }
.input-sm { padding: 6px 10px; font-size: 12.5px; }
.input-lg { padding: 12px 16px; font-size: 14px; }

textarea.input { resize: vertical; min-height: 80px; }
select.input { cursor: pointer; }

.input-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-tertiary);
    display: block;
    margin-bottom: 5px;
}

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

/* ── BADGES ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    line-height: 1.4;
    white-space: nowrap;
}
.badge-red { background: var(--red-muted); color: var(--red); }
.badge-amber { background: var(--amber-muted); color: var(--amber); }
.badge-emerald { background: var(--emerald-muted); color: var(--emerald); }
.badge-blue { background: var(--blue-muted); color: var(--blue); }
.badge-accent { background: var(--accent-muted); color: var(--accent); }
.badge-muted { background: var(--surface-hover); color: var(--text-secondary); }

/* Compatibility aliases */
.st-red { background: var(--red-muted); color: var(--red); }
.st-amber { background: var(--amber-muted); color: var(--amber); }
.st-emerald { background: var(--emerald-muted); color: var(--emerald); }
.st-indigo { background: var(--blue-muted); color: var(--blue); }
.st-slate { background: var(--surface-hover); color: var(--text-secondary); }

/* ── TABLES ── */
.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.tbl thead { position: sticky; top: 0; z-index: 5; }
.tbl th {
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-tertiary);
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
}
.tbl td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text);
}
.tbl tbody tr { transition: background var(--transition); }
.tbl tbody tr:hover { background: var(--surface-hover); }
.tbl .lead-name { font-weight: 600; font-size: 13.5px; }
.tbl .lead-sub { font-size: 11.5px; color: var(--text-tertiary); margin-top: 1px; }
.tbl .lead-date { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); }

/* ── FLASH NOTICE ── */
.flash {
    background: var(--emerald-muted);
    border: 1px solid rgba(52,211,153,0.2);
    color: var(--emerald);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease;
}
.flash-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.6;
    transition: opacity var(--transition);
}
.flash-close:hover { opacity: 1; }

/* ── CHAT / MESSAGING ── */
.chat-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    max-height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.chat-msg { display: flex; flex-direction: column; max-width: 80%; }
.chat-msg.out { align-self: flex-end; }
.chat-msg.in { align-self: flex-start; }
.chat-meta { font-size: 10px; color: var(--text-tertiary); margin-bottom: 3px; padding: 0 4px; }
.bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}
.bubble.in { background: var(--surface); border: 1px solid var(--border); }
.bubble.out-wa { background: rgba(52,211,153,0.12); border: 1px solid rgba(52,211,153,0.15); }
.bubble.out-tk { background: var(--accent-muted); border: 1px solid rgba(var(--accent-rgb),0.15); }
.chat-status { font-size: 10px; text-align: right; margin-top: 4px; opacity: 0.7; }

/* ── MODALS ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay);
    backdrop-filter: blur(8px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.active { display: flex; animation: fadeIn 0.2s ease; }

.modal-box {
    background: var(--surface);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 660px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}
.modal-head {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 5;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.modal-head h2 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}
.modal-body { padding: 24px; }

/* ── PAGINATION ── */
.pag {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ── HERO (Simplified) ── */
.page-hero {
    padding: 28px 0 20px;
}
.page-hero-greeting {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.page-hero-sub {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ── GRID HELPERS ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* ── KANBAN BOARD ── */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: start;
}
.k-column {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    min-height: 300px;
    max-height: calc(100vh - 180px);
}
.k-col-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.k-col-title {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.k-col-body {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
    min-height: 120px;
}
.k-col-body.drag-over {
    background: var(--accent-muted);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.task-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
    cursor: grab;
    transition: all var(--transition);
    user-select: none;
}
.task-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); }
.task-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
    box-shadow: var(--shadow-lg);
}
.task-card .t-title { font-weight: 600; font-size: 13px; margin-bottom: 6px; line-height: 1.4; }
.task-card .t-client { font-size: 11px; color: var(--accent); font-weight: 500; margin-bottom: 8px; }
.task-card .t-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: var(--text-tertiary);
}
.task-card .t-assignee {
    background: var(--surface-hover);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 10px;
}

/* ── LEAD PROGRESS BAR ── */
.lead-bar {
    display: flex;
    gap: 1px;
    height: 4px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--border);
}
.lb-red { background: var(--red); }
.lb-amber { background: var(--amber); }
.lb-emerald { background: var(--emerald); }

/* ── INSTANCE ROW (master.php) ── */
.instance-row {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 8px;
    transition: all var(--transition);
    position: relative;
}
.instance-row:hover { border-color: var(--border-hover); background: var(--card-hover); }
.instance-indicator {
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
}

/* ── EMPTY STATE ── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-tertiary);
}
.empty-state-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.4;
}
.empty-state-text {
    font-size: 14px;
    font-weight: 500;
}

/* ── TOOLBAR / FILTER BAR ── */
.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 14px 0;
}
.toolbar .input { max-width: 280px; }

/* ── DETAIL VIEW ── */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.detail-name {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
}
.detail-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    flex-wrap: wrap;
}
.control-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

/* ── ACTION PANELS (master.php expandable) ── */
.action-panel {
    display: none;
    margin-top: 14px;
    padding: 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-raised);
    border-radius: var(--radius);
}
.action-panel.active {
    display: block;
    animation: slideDown 0.25s ease;
}

/* ── LOGIN PAGE ── */
.login-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}
.login-visual {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(-45deg, #0f0c29, #302b63, #24243e, #1a1a2e, #16213e, #0f3460);
    background-size: 400% 400%;
    animation: loginGradient 15s ease infinite;
    position: relative;
    overflow: hidden;
}
.login-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(99,102,241,.15) 0%, transparent 70%),
                radial-gradient(ellipse at 70% 80%, rgba(16,185,129,.1) 0%, transparent 60%);
    pointer-events: none;
}
.login-visual h1, .login-visual p, .login-visual .login-title { color: #fff !important; }
.login-visual p { color: rgba(255,255,255,.6) !important; }
@keyframes loginGradient {
    0% { background-position: 0% 50%; }
    25% { background-position: 50% 100%; }
    50% { background-position: 100% 50%; }
    75% { background-position: 50% 0%; }
    100% { background-position: 0% 50%; }
}
.login-form-side {
    width: 440px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: #ffffff;
    border-left: none;
}
.login-form-side .input { background: #f9fafb; border-color: #e5e7eb; color: #111827; }
.login-form-side .input::placeholder { color: #9ca3af; }
.login-form-side .btn-primary { background: var(--accent) !important; color: var(--accent-fg, #fff) !important; border-color: var(--accent) !important; }
.login-form-side .btn-primary:hover { background: var(--accent-hover) !important; }
.login-form-side a { color: #6366f1; }
.login-form-inner { width: 100%; max-width: 340px; }
.login-title {
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 4px;
}
.login-sub {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 28px;
}

/* ── Backward Compatibility Aliases ── */
.btn-accent { background: var(--accent); color: var(--btn-text); border-color: transparent; font-weight: 600; }
.btn-accent:hover { background: var(--accent-hover); color: var(--btn-text); box-shadow: var(--shadow-glow); }
.btn-green { color: var(--emerald); border-color: var(--emerald-muted); background: var(--emerald-muted); }
.btn-green:hover { background: var(--emerald); color: var(--btn-text); }
.btn-logout { font-size: 12px; color: var(--text-tertiary); text-decoration: none; padding: 4px 8px; border-radius: var(--radius-sm); transition: color var(--transition); }
.btn-logout:hover { color: var(--red); }

/* card-title standalone (outside card-header) */
.card-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.animate-in { animation: fadeIn 0.3s ease; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .kanban-board { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        z-index: 60;
        box-shadow: 4px 0 24px rgba(0,0,0,0.25);
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: flex; }
    .page-content { padding: 16px; }
    .topbar { padding: 0 16px; }

    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .login-visual { display: none; }
    .login-form-side { width: 100%; border-left: none; }

    .detail-header { flex-direction: column; }

    /* Mobile overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 55;
    }
    .sidebar-overlay.active { display: block; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    html { font-size: 14px; }
    .page-hero-greeting { font-size: 20px; }
    .topbar-title { font-size: 14px; }
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-tertiary); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mono { font-family: var(--font-mono); }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.gap-sm { gap: 8px; }
.gap-md { gap: 14px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ═══════════════════════════════════════════════════════════════
   CRM UI ENHANCEMENTS — confirm modal, toast, loading, skeleton
   ═══════════════════════════════════════════════════════════════ */

/* ── CONFIRM MODAL ─────────────────────────────────────────────── */
.crm-confirm-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.crm-confirm-overlay.active { display: flex; }
.crm-confirm-box {
    background: var(--bg-elevated, #ffffff);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 32px 28px 24px;
    width: min(380px, 90vw);
    box-shadow: 0 24px 64px rgba(0,0,0,.2);
    text-align: center;
    animation: confirmIn .18s ease;
}
@keyframes confirmIn {
    from { transform: scale(.92); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
.crm-confirm-icon { font-size: 36px; margin-bottom: 12px; }
.crm-confirm-msg  { font-size: 15px; color: var(--text); margin-bottom: 24px; line-height: 1.5; }
.crm-confirm-actions { display: flex; gap: 10px; justify-content: center; }
.crm-confirm-actions .btn { min-width: 100px; }

/* ── TOAST NOTIFICATIONS ──────────────────────────────────────── */
.crm-toast-container {
    position: fixed; bottom: 24px; right: 24px;
    z-index: 10000;
    display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
}
.crm-toast {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 13px; font-weight: 500;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .25s ease, transform .25s ease;
    max-width: 320px;
    pointer-events: auto;
}
.crm-toast.visible { opacity: 1; transform: translateY(0); }
.crm-toast-success { background: var(--emerald); }
.crm-toast-error   { background: var(--red); }
.crm-toast-warning { background: var(--amber, #f59e0b); }
.crm-toast-info    { background: var(--accent); }
.crm-toast-icon    { font-size: 16px; flex-shrink: 0; }

/* ── LOADING SPINNER ──────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.btn.loading { pointer-events: none; opacity: .7; position: relative; }
.btn.loading::after {
    content: '';
    position: absolute; right: 10px; top: 50%;
    width: 14px; height: 14px;
    margin-top: -7px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}

/* ── WA SKELETON ─────────────────────────────────────────────── */
.wa-skeleton { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.wa-sk-bubble {
    height: 36px; border-radius: 12px;
    background: linear-gradient(90deg, var(--bg) 25%, var(--border) 50%, var(--bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease infinite;
    max-width: 70%;
}
.wa-sk-bubble.out   { align-self: flex-end; }
.wa-sk-bubble.short { max-width: 45%; height: 28px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── SIDEBAR MOBILE TRANSITION ──────────────────────────────── */
@media (max-width: 768px) {
    .sidebar { transition: transform .28s cubic-bezier(.4,0,.2,1); }
}

/* ── HOVER IMPROVEMENTS ─────────────────────────────────────── */
.stat-card { transition: transform .18s ease, box-shadow .18s ease; }
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0,0,0,.18);
}
.kanban-card { transition: transform .15s ease, box-shadow .15s ease; }
.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.15);
}

/* ── BADGE PULSE (notifiche non lette) ──────────────────────── */
@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb, 99,102,241),.7); }
    50%       { box-shadow: 0 0 0 6px rgba(var(--accent-rgb, 99,102,241),0); }
}
.badge-pulse { animation: badgePulse 2s ease infinite; }

/* ── FOCUS VISIBLE ──────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ══════════════════════════════════════════════════════════════
   HEAT SCORE BADGES (Gradi di Calore Lead)
   ═══════════════════════════════════════════════════════════ */
.badge-heat-5 { background: var(--red-muted); color: var(--red); font-weight: 700; }
.badge-heat-4 { background: rgba(230,126,34,.15); color: #E67E22; font-weight: 700; }
.badge-heat-3 { background: var(--amber-muted); color: var(--amber); font-weight: 700; }
.badge-heat-2 { background: var(--blue-muted); color: var(--blue); font-weight: 700; }
.badge-heat-1 { background: var(--surface-hover); color: var(--text-tertiary); font-weight: 600; }
.badge-heat-0 { background: var(--surface-hover); color: var(--text-tertiary); }

.heat-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
}
.heat-indicator .heat-emoji { font-size: 14px; }

/* ══════════════════════════════════════════════════════════════
   PIPELINE KANBAN
   ═══════════════════════════════════════════════════════════ */
.pipeline-board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 12px;
    min-height: calc(100vh - 180px);
    -webkit-overflow-scrolling: touch;
}
.pipeline-column {
    min-width: 280px;
    max-width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.pipeline-column-header {
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--border);
}
.pipeline-column-header .stage-icon { margin-right: 6px; }
.pipeline-column-header .stage-count {
    background: var(--surface-hover);
    color: var(--text-secondary);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}
.pipeline-column-body {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
    min-height: 100px;
}
.pipeline-column-body.sortable-ghost-class {
    background: rgba(var(--accent-rgb), 0.05);
}
.pipeline-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 8px;
    cursor: grab;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.pipeline-card:active { cursor: grabbing; }
.pipeline-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.pipeline-card.sortable-chosen {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}
.pipeline-card .pc-name {
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text);
    margin-bottom: 4px;
}
.pipeline-card .pc-company {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.pipeline-card .pc-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.pipeline-card .pc-heat {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
}
.pipeline-card .pc-source {
    font-size: 11px;
    color: var(--text-tertiary);
}
.pipeline-card .pc-agent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--accent-muted);
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
}
.pipeline-card .pc-date {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-tertiary);
    margin-left: auto;
}

/* Pipeline responsive */
@media (max-width: 768px) {
    .pipeline-board { gap: 8px; }
    .pipeline-column { min-width: 250px; }
}

/* ══════════════════════════════════════════════════════════════
   NOTIFICATION BELL
   ═══════════════════════════════════════════════════════════ */
.notif-bell {
    position: relative;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.notif-bell:hover { background: var(--surface-hover); }
.notif-bell .notif-count {
    position: absolute;
    top: 0; right: 0;
    background: var(--red);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px; height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
}
.notif-dropdown.open { display: block; }
.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    line-height: 1.4;
    transition: background var(--transition);
}
.notif-item:hover { background: var(--surface-hover); }
.notif-item:last-child { border-bottom: none; }
.notif-item .notif-title { font-weight: 600; color: var(--text); }
.notif-item .notif-body { color: var(--text-secondary); margin-top: 2px; }
.notif-item .notif-time {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════════
   FOLLOWUP SEQUENCE UI
   ═══════════════════════════════════════════════════════════ */
.followup-timeline {
    position: relative;
    padding-left: 24px;
}
.followup-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.followup-step {
    position: relative;
    padding: 12px 0 12px 16px;
    font-size: 13px;
}
.followup-step::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 18px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg);
}
.followup-step.sent::before { background: var(--emerald); }
.followup-step.failed::before { background: var(--red); }
.followup-step.pending::before { background: var(--text-tertiary); }
.followup-step .fs-channel {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--surface-hover);
    color: var(--text-secondary);
}
.followup-step .fs-delay {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
}

/* ══════════════════════════════════════════════════════════════
   ANALYTICS WIDGETS
   ═══════════════════════════════════════════════════════════ */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 16px;
}
.analytics-widget {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.analytics-widget .aw-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.analytics-widget .aw-value {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
}
.analytics-widget .aw-subtitle {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

@media (max-width: 768px) {
    .analytics-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   PIPELINE FORECAST · header weighted + badge value/close su card
   Allineato al pattern .card / .pc-* / var(--accent) del theme.
   ═══════════════════════════════════════════════════════════ */
.forecast-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.forecast-bar .fb-block { display: flex; flex-direction: column; gap: 2px; }
.forecast-bar .fb-label {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 600;
}
.forecast-bar .fb-value-main {
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}
.forecast-bar .fb-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}
.forecast-bar .fb-divider { width: 1px; height: 32px; background: var(--border); }
.forecast-bar .fb-warning {
    margin-left: auto;
    font-size: 12px;
    color: var(--amber);
    background: var(--amber-soft);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--amber);
}

.pipeline-column .pc-stage-prob {
    font-size: 10px;
    color: var(--text-tertiary);
    font-weight: 500;
    margin-left: 4px;
}
.pipeline-column .pc-stage-forecast {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    padding: 4px 10px;
    background: var(--accent-soft);
    border-bottom: 1px solid var(--border);
    text-align: right;
}
.pipeline-column .pc-stage-forecast .pcsf-label { color: var(--text-tertiary); font-family: var(--font); }

.pipeline-card .pc-deal {
    display: flex;
    gap: 6px;
    margin: 4px 0;
    flex-wrap: wrap;
}
.pipeline-card .pc-value {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 2px 7px;
    border-radius: var(--radius-sm);
}
.pipeline-card .pc-close {
    font-size: 11px;
    color: var(--text-tertiary);
    background: var(--bg-sunken);
    padding: 2px 7px;
    border-radius: var(--radius-sm);
}
.pipeline-card .pc-close.urgent {
    color: var(--amber);
    background: var(--amber-soft);
}

/* Aside dettagli commerciali · contributo forecast box */
.aside-forecast-pill {
    margin-top: 10px;
    padding: 8px 10px;
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    text-align: center;
}
.aside-forecast-pill .afp-sub {
    color: var(--text-tertiary);
    font-size: 10px;
    font-family: var(--font);
    display: block;
    margin-top: 2px;
}

/* ══════════════════════════════════════════════════════════════
   CINEMATIC COLOR SYSTEM (merged from clarity_theme.css 2026-05-14)
   ══════════════════════════════════════════════════════════════ */

/**
 * LeadSpeed CRM — "Clarity" Theme
 * Light, performante, timeline-centric.
 * Ispirato a: Linear, Fantastical, Superhuman, Vercel.
 *
 * Usage: caricare QUESTO file DOPO crm_theme.css per overridare.
 * Oppure sostituire crm_theme.css direttamente.
 */

:root {
    /* Cinematic Bloomberg dark navy — TEMA UNICO */
    --bg: #0e1320;
    --bg-elevated: #141c30;
    --bg-sunken: #0a0e1a;
    --bg-hover: #1a2540;
    --bg-raised: #141c30;
    --bg-muted: #1a2540;

    --border: #1e2a4a;
    --border-strong: #2a3a5c;
    --border-focus: #f97316;
    --border-hover: #2a3a5c;
    --border-muted: #1e2a4a;
    --border-accent: #f97316;

    --text: #ffffff;
    --text-secondary: #c1c8d8;
    --text-tertiary: #8b95ab;
    --text-muted: #5b6b8c;

    --accent: #f97316;
    --accent-hover: #ea6c10;
    --accent-soft: rgba(249,115,22,.12);
    --accent-fg: #ffffff;
    --accent-muted: rgba(249,115,22,.06);
    --accent-rgb: 249, 115, 22;

    --red: #ef4444;
    --red-soft: rgba(239,68,68,.12);
    --red-muted: rgba(239,68,68,.12);
    --orange: #f97316;
    --orange-soft: rgba(249,115,22,.12);
    --amber: #f59e0b;
    --amber-soft: rgba(245,158,11,.12);
    --amber-muted: rgba(245,158,11,.12);
    --blue: #3b82f6;
    --blue-soft: rgba(59,130,246,.12);
    --blue-muted: rgba(59,130,246,.12);
    --emerald: #10b981;
    --emerald-soft: rgba(16,185,129,.12);
    --emerald-muted: rgba(16,185,129,.12);
    --purple: #8b5cf6;
    --purple-soft: rgba(139,92,246,.12);

    --heat-5: #ef4444;
    --heat-4: #f97316;
    --heat-3: #f59e0b;
    --heat-2: #3b82f6;
    --heat-1: #5b6b8c;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, Consolas, monospace;
    --font-display: 'Inter', system-ui, sans-serif;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;

    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 10px;
    --radius-xl: 14px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow: 0 2px 4px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.3);
    --shadow-lg: 0 16px 32px rgba(0,0,0,.5);
    --shadow-focus: 0 0 0 3px rgba(249,115,22,.2);

    --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);

    --sidebar-w: 240px;
    --topbar-h: 52px;

    --card: var(--bg-elevated);
    --card-hover: var(--bg-hover);
    --surface: var(--bg-elevated);
    --surface-hover: var(--bg-hover);
    --muted: var(--text-muted);
    --btn-text: #ffffff;
    --sidebar-bg: var(--bg-sunken);
    --sidebar-border: var(--border);
    --sidebar-item-hover: var(--bg-hover);
    --sidebar-item-active: var(--accent-soft);
    --input-bg: var(--bg-sunken);
    --scrollbar-thumb: var(--border-strong);
    --scrollbar-hover: var(--accent);
    --overlay: rgba(0, 0, 0, .5);
}

/* Apply to body (any data-theme value) */
body, body[data-theme] {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-feature-settings: 'tnum';
    -webkit-font-smoothing: antialiased;
}


/* ══════════════════════════════════════════════════════════════
   LAYOUT: Sidebar + Main (minimal, tight)
   ═══════════════════════════════════════════════════════════ */
.app-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    padding: var(--space-4) var(--space-3);
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    margin-bottom: var(--space-4);
}

.sidebar-brand-icon {
    width: 30px; height: 30px;
    background: var(--text);
    color: var(--bg-elevated);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    font-family: var(--font-mono);
    letter-spacing: -0.5px;
}

.sidebar-brand-text {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.2px;
    color: var(--text);
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.sidebar-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: var(--space-4) var(--space-3) var(--space-2);
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.sidebar-item:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.sidebar-item.active {
    background: var(--bg-sunken);
    color: var(--text);
    font-weight: 600;
}

.sidebar-item .si-icon {
    font-size: 15px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.85;
}

.sidebar-badge {
    margin-left: auto;
    background: var(--accent);
    color: var(--accent-fg);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.3;
}

.sidebar-badge.accent { background: var(--accent); }
.sidebar-badge.muted { background: var(--border-strong); color: var(--text-secondary); }
.sidebar-badge.red { background: var(--red); }

.sidebar-footer {
    margin-top: auto;
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
}

.sidebar-avatar {
    width: 28px; height: 28px;
    background: var(--bg-sunken);
    color: var(--text);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    overflow: hidden;
}

.sidebar-user-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    background: var(--bg);
}

/* ══════════════════════════════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════════════════════════ */
.topbar {
    height: var(--topbar-h);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 0 var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 40;
    gap: var(--space-4);
}

.topbar-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.topbar-actions {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text);
    padding: var(--space-2);
}

/* ══════════════════════════════════════════════════════════════
   PAGE CONTENT
   ═══════════════════════════════════════════════════════════ */
.page-content {
    padding: var(--space-6);
    max-width: 1400px;
}

/* ══════════════════════════════════════════════════════════════
   BUTTONS — minimal, solid, fast
   ═══════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
    line-height: 1;
}

.btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

.btn-primary {
    background: var(--text);
    color: var(--bg-elevated);
    border-color: var(--text);
}

.btn-primary:hover {
    background: #1f1f1f;
    border-color: #1f1f1f;
}

.btn-accent {
    background: var(--accent);
    color: var(--accent-fg);
    border-color: var(--accent);
}

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

.btn-success {
    background: var(--emerald);
    color: #fff;
    border-color: var(--emerald);
}

.btn-danger {
    background: var(--bg-elevated);
    color: var(--red);
    border-color: var(--red-soft);
}

.btn-danger:hover {
    background: var(--red-soft);
    border-color: var(--red);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-xs { padding: 3px 8px; font-size: 10px; }
.btn-lg { padding: 10px 18px; font-size: 14px; }

.btn-icon {
    width: 32px; height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-icon.sm { width: 26px; height: 26px; }

/* ══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════ */
.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5) var(--space-6);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
    border-color: var(--border-strong);
}

.card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    letter-spacing: -0.1px;
}

/* ══════════════════════════════════════════════════════════════
   STATS GRID
   ═══════════════════════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-3);
}

.stat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    transition: all var(--transition);
}

.stat-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

/* ══════════════════════════════════════════════════════════════
   INPUTS
   ═══════════════════════════════════════════════════════════ */
.input, input[type="text"], input[type="email"], input[type="tel"],
input[type="password"], input[type="number"], input[type="date"],
input[type="time"], select, textarea {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: all var(--transition);
}

.input:focus, input:focus, select:focus, textarea:focus {
    border-color: var(--text);
    box-shadow: var(--shadow-focus);
}

.input-sm { padding: 6px 10px; font-size: 12px; }
.input-lg { padding: 11px 16px; font-size: 15px; }

.input-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-tertiary);
    margin-bottom: var(--space-1);
    display: block;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

/* ══════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    line-height: 1.3;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.badge-accent { background: var(--accent-soft); color: var(--accent-hover); }
.badge-muted { background: var(--bg-sunken); color: var(--text-tertiary); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-emerald { background: var(--emerald-soft); color: var(--emerald); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }

/* Compatibility aliases */
.st-red { background: var(--red-soft); color: var(--red); }
.st-amber { background: var(--amber-soft); color: var(--amber); }
.st-emerald { background: var(--emerald-soft); color: var(--emerald); }
.st-indigo { background: var(--blue-soft); color: var(--blue); }
.st-slate { background: var(--bg-sunken); color: var(--text-tertiary); }

/* Heat badges */
.badge-heat-5 { background: var(--red-soft); color: var(--red); }
.badge-heat-4 { background: var(--orange-soft); color: var(--orange); }
.badge-heat-3 { background: var(--amber-soft); color: var(--amber); }
.badge-heat-2 { background: var(--blue-soft); color: var(--blue); }
.badge-heat-1 { background: var(--bg-sunken); color: var(--text-tertiary); }
.badge-heat-0 { background: var(--bg-sunken); color: var(--text-tertiary); }

/* ══════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════ */
.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tbl thead { position: sticky; top: 0; z-index: 5; background: var(--bg-sunken); }

.tbl th {
    padding: 10px var(--space-4);
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border);
}

.tbl td {
    padding: 12px var(--space-4);
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.tbl tbody tr {
    transition: background var(--transition);
}

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

.lead-date {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
}

.lead-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}

.lead-sub {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* ══════════════════════════════════════════════════════════════
   TIMELINE — the heart of Clarity
   ═══════════════════════════════════════════════════════════ */
.timeline-container {
    max-width: 900px;
    margin: 0 auto;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--border);
}

.timeline-header h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.6px;
    color: var(--text);
    margin-bottom: 4px;
}

.timeline-header .subtitle {
    font-size: 13px;
    color: var(--text-tertiary);
}

.timeline-events {
    position: relative;
    padding-left: 28px;
    border-left: 2px solid var(--border);
}

.tl-event {
    position: relative;
    padding: 0 0 var(--space-5) var(--space-5);
}

.tl-event::before {
    content: '';
    position: absolute;
    left: calc(-28px - 2px);
    top: 8px;
    width: 14px;
    height: 14px;
    background: var(--bg-elevated);
    border: 2px solid var(--border-strong);
    border-radius: 50%;
    box-sizing: border-box;
}

.tl-event.now::before {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 5px var(--accent-soft);
    animation: tl-pulse 2s ease-in-out infinite;
}

@keyframes tl-pulse {
    0%, 100% { box-shadow: 0 0 0 5px var(--accent-soft); }
    50% { box-shadow: 0 0 0 8px rgba(20,184,166,.1); }
}

.tl-event.hot::before { background: var(--red); border-color: var(--red); }
.tl-event.warm::before { background: var(--amber); border-color: var(--amber); }
.tl-event.cold::before { background: var(--blue); border-color: var(--blue); }
.tl-event.done::before { background: var(--emerald); border-color: var(--emerald); }

.tl-time {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
    margin-bottom: var(--space-2);
    font-family: var(--font-mono);
}

.tl-time.urgent { color: var(--red); }

.tl-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    transition: all var(--transition);
}

.tl-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

.tl-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    letter-spacing: -0.1px;
}

.tl-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: var(--space-3);
}

.tl-card-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════════
   COMMAND PALETTE (Cmd+K)
   ═══════════════════════════════════════════════════════════ */
.cmdk-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}

.cmdk-overlay.open {
    display: flex;
}

.cmdk-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    box-shadow: 0 30px 80px rgba(0,0,0,.25);
    width: 100%;
    max-width: 560px;
    overflow: hidden;
    animation: cmdk-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cmdk-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.cmdk-input {
    width: 100%;
    padding: 18px 24px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font-size: 16px;
    outline: none;
}

.cmdk-input::placeholder {
    color: var(--text-muted);
}

.cmdk-list {
    max-height: 400px;
    overflow-y: auto;
    padding: var(--space-2);
}

.cmdk-group-label {
    padding: var(--space-3) var(--space-4) var(--space-2);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.8px;
}

.cmdk-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
    transition: background 100ms ease;
}

.cmdk-item:hover,
.cmdk-item.selected {
    background: var(--bg-sunken);
}

.cmdk-item-icon {
    width: 28px; height: 28px;
    background: var(--bg-sunken);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.cmdk-item-text {
    flex: 1;
}

.cmdk-item-title {
    font-weight: 600;
    color: var(--text);
}

.cmdk-item-desc {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.cmdk-item-shortcut {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.cmdk-item-shortcut kbd {
    display: inline-block;
    padding: 2px 6px;
    background: var(--bg-sunken);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-left: 2px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-secondary);
}

.cmdk-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-sunken);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: var(--text-tertiary);
}

.cmdk-footer .cmdk-hints {
    display: flex;
    gap: var(--space-3);
}

.cmdk-footer kbd {
    display: inline-block;
    padding: 1px 5px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-secondary);
    margin-right: 3px;
}

/* ══════════════════════════════════════════════════════════════
   THREAD VIEW — unified lead conversation
   ═══════════════════════════════════════════════════════════ */
.thread-container {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.thread-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border);
    background: var(--bg-sunken);
}

.thread-events {
    padding: var(--space-5) var(--space-6);
    max-height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.thread-event {
    position: relative;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    background: var(--bg-sunken);
    font-size: 13px;
    line-height: 1.55;
}

.thread-event.out {
    background: var(--accent-soft);
    margin-left: 40px;
}

.thread-event.note {
    background: #fffef0;
    border: 1px solid #fde68a;
}

.thread-event .meta {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.thread-event .channel {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 9px;
    font-weight: 700;
}

/* ══════════════════════════════════════════════════════════════
   PIPELINE (kept, restyled to match)
   ═══════════════════════════════════════════════════════════ */
.pipeline-board {
    display: flex;
    gap: var(--space-3);
    overflow-x: auto;
    padding-bottom: var(--space-3);
    min-height: calc(100vh - 180px);
}

.pipeline-column {
    min-width: 280px;
    max-width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-sunken);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.pipeline-column-header {
    padding: 14px 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--border);
    background: var(--bg-elevated);
}

.pipeline-column-header .stage-count {
    background: var(--bg-sunken);
    color: var(--text-tertiary);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
}

.pipeline-column-body {
    flex: 1;
    padding: var(--space-2);
    overflow-y: auto;
    min-height: 100px;
}

.pipeline-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-2);
    cursor: grab;
    transition: all var(--transition);
}

.pipeline-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

.pipeline-card.sortable-chosen {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.pipeline-card .pc-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 3px;
}

.pipeline-card .pc-company {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: var(--space-2);
}

.pipeline-card .pc-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    font-size: 10px;
}

.pipeline-card .pc-date {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    margin-left: auto;
}

/* ══════════════════════════════════════════════════════════════
   NOTIFICATION BELL
   ═══════════════════════════════════════════════════════════ */
.notif-bell {
    position: relative;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: background var(--transition);
}

.notif-bell:hover {
    background: var(--bg-hover);
}

.notif-bell .notif-count {
    position: absolute;
    top: 2px; right: 2px;
    background: var(--red);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    min-width: 15px; height: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* ══════════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════ */
.login-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

.login-visual {
    flex: 1;
    background: linear-gradient(135deg, var(--bg-sunken), var(--bg));
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-form-side {
    width: 440px;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    border-left: 1px solid var(--border);
}

.login-form-inner {
    width: 100%;
    max-width: 320px;
}

.login-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
    letter-spacing: -0.4px;
}

.login-sub {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: var(--space-5);
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .menu-toggle {
        display: block;
    }
    .page-content {
        padding: var(--space-4);
    }
}

/* ══════════════════════════════════════════════════════════════
   SCROLLBAR — subtle
   ═══════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
}

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

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Selection */
::selection {
    background: var(--accent-soft);
    color: var(--accent-hover);
}

/* ══════════════════════════════════════════════════════════════
   THREAD VIEW — lead detail (lead.php)
   ═══════════════════════════════════════════════════════════ */
.thread-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}
@media (max-width: 1100px) {
    .thread-layout { grid-template-columns: 1fr; }
    .thread-aside { order: -1; }
}

.thread-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

/* Lead header card */
.thread-lead-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.tlh-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    font-family: var(--font-body);
    flex-shrink: 0;
    letter-spacing: 0.5px;
}
.tlh-info { flex: 1; min-width: 0; }
.tlh-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    letter-spacing: -0.015em;
}
.tlh-sub {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 2px;
}
.tlh-badges {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.tlh-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* Composer */
.thread-composer {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    transition: border-color var(--transition);
}
.thread-composer:focus-within { border-color: var(--accent); }
.thread-composer textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: vertical;
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.55;
    background: transparent;
    color: var(--text);
    padding: 4px 0 10px;
    min-height: 60px;
}
.thread-composer textarea::placeholder { color: var(--text-muted); }
.thread-composer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}
.thread-composer-tabs {
    display: flex;
    gap: 6px;
}
.thread-composer-tabs .tab {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-sunken);
    cursor: pointer;
}
.thread-composer-tabs .tab.active {
    background: var(--accent-soft);
    color: var(--accent-hover);
}

/* Feed */
.thread-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.thread-feed-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}
.thread-row {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.thread-row:last-child { border-bottom: 0; }
.thread-row:hover { background: var(--bg-sunken); }
.thread-row-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-sunken);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
    border: 1px solid var(--border);
}
.thread-row.note .thread-row-icon { background: #fffef0; border-color: #fde68a; }
.thread-row.status .thread-row-icon { background: var(--blue-soft); border-color: var(--blue-soft); }
.thread-row-body { flex: 1; min-width: 0; }
.thread-row-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}
.thread-row-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.thread-row-time {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    flex-shrink: 0;
}
.thread-row-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}
.thread-row-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-top: 6px;
    word-wrap: break-word;
}

/* Aside */
.thread-aside {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 20px;
}
.aside-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
}
.aside-card-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 10px;
}
.aside-form { margin-bottom: 10px; }
.aside-form:last-child { margin-bottom: 0; }
.aside-form label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.4px;
    margin-bottom: 4px;
}
.aside-data {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 14px;
    font-size: 12px;
}
.aside-data dt {
    color: var(--text-tertiary);
    font-weight: 500;
}
.aside-data dd {
    margin: 0;
    color: var(--text);
    font-weight: 500;
    word-break: break-word;
}
.aside-data a { color: var(--accent-hover); }

.heat-picker {
    display: flex;
    gap: 4px;
}
.heat-btn {
    flex: 1;
    padding: 8px 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition);
}
.heat-btn:hover { border-color: var(--accent); color: var(--accent-hover); }
.heat-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ══════════════════════════════════════════════════════════════
   HOME FEED (admin.php dashboard rewrite)
   ═══════════════════════════════════════════════════════════ */
.home-hero {
    margin-bottom: 24px;
}
.home-hero h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0 0 6px;
}
.home-hero p {
    color: var(--text-tertiary);
    font-size: 13px;
    margin: 0;
}
.home-microstats {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-tertiary);
}
.home-microstats strong {
    color: var(--text);
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: 14px;
}
.home-microstats .divider {
    color: var(--border-strong);
}

.home-feed {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.home-feed-title {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.feed-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background var(--transition);
}
.feed-row:hover { background: var(--bg-sunken); }
.feed-row:last-child { border-bottom: 0; }
.feed-row-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-sunken);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.feed-row-main { flex: 1; min-width: 0; }
.feed-row-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.feed-row-sub {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}
.feed-row-aside {
    text-align: right;
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    flex-shrink: 0;
}

/* Heat badge classes */
.badge.heat-1 { background: var(--blue-soft); color: var(--blue); }
.badge.heat-2 { background: var(--blue-soft); color: var(--blue); }
.badge.heat-3 { background: var(--amber-soft); color: var(--amber); }
.badge.heat-4 { background: var(--orange-soft); color: var(--orange); }
.badge.heat-5 { background: var(--red-soft); color: var(--red); }

/* ══════════════════════════════════════════════════════════════
   HELP PANEL — override colori per tema chiaro (crm_help.js)
   Il pannello d'aiuto usa fallback scuri inline. Qui li sovrascriviamo
   per leggibilità sotto Clarity.
   ═══════════════════════════════════════════════════════════ */
body[data-theme="cinematic"] .crm-help-panel {
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 40px rgba(0,0,0,.12);
}
body[data-theme="cinematic"] .crm-help-header {
    border-bottom: 1px solid var(--border);
}
body[data-theme="cinematic"] .crm-help-icon {
    background: var(--accent-soft);
}
body[data-theme="cinematic"] .crm-help-title {
    color: var(--text);
}
body[data-theme="cinematic"] .crm-help-close {
    border: 1px solid var(--border);
    color: var(--text-tertiary);
}
body[data-theme="cinematic"] .crm-help-close:hover {
    background: var(--red);
    color: #fff;
}
body[data-theme="cinematic"] .crm-help-step {
    background: var(--bg-sunken);
    border: 1px solid var(--border);
}
body[data-theme="cinematic"] .crm-help-step-body h4 {
    color: var(--text);
}
body[data-theme="cinematic"] .crm-help-step-body p {
    color: var(--text-secondary);
}
body[data-theme="cinematic"] .crm-help-step-body code {
    background: var(--accent-soft);
    color: var(--accent-hover);
}
body[data-theme="cinematic"] .crm-help-tip {
    background: var(--emerald-soft);
    border: 1px solid var(--emerald-soft);
    color: var(--text-secondary);
}
body[data-theme="cinematic"] .crm-help-tip strong {
    color: var(--emerald);
}
body[data-theme="cinematic"] .crm-help-warn {
    background: var(--amber-soft);
    border: 1px solid var(--amber-soft);
    color: var(--text-secondary);
}
body[data-theme="cinematic"] .crm-help-warn strong {
    color: var(--amber);
}
body[data-theme="cinematic"] .crm-help-divider {
    color: var(--text-tertiary);
}
body[data-theme="cinematic"] .crm-help-divider::before,
body[data-theme="cinematic"] .crm-help-divider::after {
    background: var(--border);
}
body[data-theme="cinematic"] .crm-help-kbd {
    background: var(--bg-sunken);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
body[data-theme="cinematic"] .crm-help-footer {
    border-top: 1px solid var(--border);
}
body[data-theme="cinematic"] .crm-help-nav button {
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
}
body[data-theme="cinematic"] .crm-help-nav button:hover,
body[data-theme="cinematic"] .crm-help-nav button.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
body[data-theme="cinematic"] .crm-help-page-info {
    color: var(--text-tertiary);
}

/* ══════════════════════════════════════════════════════════════
   LEAD SPEED — PERFORMANCE WARM OVERRIDE
   Override palette + typography to match landing page leadspeed.it
   Applied automatically since loaded last; cascade wins.
   Palette: crema carta / arancio Meta / font Space Grotesk + JetBrains Mono
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');



/* Block clarity warm-Siena rimosso · sostituito da cinematic dark navy (vedi fine file) */

/* Headings con letter-spacing e peso Warm */
h1, h2, h3, h4, h5,
.topbar-title,
.card-title,
.sidebar-brand-text {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Code/mono elements */
code, pre, .mono,
.badge,
input[type="text"].mono,
.sidebar-user-role {
    font-family: 'JetBrains Mono', monospace;
}



/* ══════════════════════════════════════════════════════════════
   CINEMATIC THEME OVERRIDE · data-theme="cinematic"
   Dark navy + arancio segnale (Bloomberg-style).
   Override delle CSS custom property della base · layout invariato.
   Tutti i componenti esistenti ricolorano automaticamente.
   ══════════════════════════════════════════════════════════════ */
body[data-theme="cinematic"] {
    /* Base palette · dark navy */
    --bg: #0e1320;
    --bg-elevated: #141c30;
    --bg-sunken: #0a0e1a;
    --bg-hover: #1a2540;
    --bg-raised: #141c30;
    --bg-muted: #1a2540;

    --border: #1e2a4a;
    --border-strong: #2a3a5c;
    --border-focus: #f97316;
    --border-hover: #2a3a5c;
    --border-muted: #1e2a4a;
    --border-accent: #f97316;

    --text: #ffffff;
    --text-secondary: #c1c8d8;
    --text-tertiary: #8b95ab;
    --text-muted: #5b6b8c;

    /* Accent · arancio segnale Bloomberg */
    --accent: #f97316;
    --accent-hover: #ea6c10;
    --accent-soft: rgba(249,115,22,.12);
    --accent-fg: #ffffff;
    --accent-muted: rgba(249,115,22,.06);
    --accent-rgb: 249, 115, 22;

    /* Status · stessi colori, tinte adattate dark */
    --red: #ef4444;
    --red-soft: rgba(239,68,68,.12);
    --orange: #f97316;
    --orange-soft: rgba(249,115,22,.12);
    --amber: #f59e0b;
    --amber-soft: rgba(245,158,11,.12);
    --blue: #3b82f6;
    --blue-soft: rgba(59,130,246,.12);
    --emerald: #10b981;
    --emerald-soft: rgba(16,185,129,.12);
    --purple: #8b5cf6;
    --purple-soft: rgba(139,92,246,.12);

    /* Heat score · invariati (i tile gestiscono contrasto da soli) */
    --heat-5: #ef4444;
    --heat-4: #f97316;
    --heat-3: #f59e0b;
    --heat-2: #3b82f6;
    --heat-1: #5b6b8c;

    /* Shadow · piu profonde su dark */
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow: 0 2px 4px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.3);
    --shadow-lg: 0 16px 32px rgba(0,0,0,.5);

    /* Typography fallback · resta Inter/JetBrains se gia caricati,
       altrimenti i sans/mono fallback browser */
    background: var(--bg);
    color: var(--text);
}

/* Selezione testo · arancio soft */
body[data-theme="cinematic"] ::selection { background: var(--accent-soft); color: var(--accent); }

/* Scrollbar dark */
body[data-theme="cinematic"] ::-webkit-scrollbar { width: 10px; height: 10px; }
body[data-theme="cinematic"] ::-webkit-scrollbar-track { background: var(--bg); }
body[data-theme="cinematic"] ::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
body[data-theme="cinematic"] ::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Inputs · forza override per text/select/textarea (alcuni hanno style locali) */
body[data-theme="cinematic"] input[type="text"],
body[data-theme="cinematic"] input[type="email"],
body[data-theme="cinematic"] input[type="tel"],
body[data-theme="cinematic"] input[type="number"],
body[data-theme="cinematic"] input[type="password"],
body[data-theme="cinematic"] input[type="search"],
body[data-theme="cinematic"] input[type="url"],
body[data-theme="cinematic"] input[type="date"],
body[data-theme="cinematic"] textarea,
body[data-theme="cinematic"] select {
    background: var(--bg-sunken);
    color: var(--text);
    border-color: var(--border);
}
body[data-theme="cinematic"] input:focus,
body[data-theme="cinematic"] textarea:focus,
body[data-theme="cinematic"] select:focus {
    border-color: var(--accent);
    outline-color: var(--accent);
}

/* Code blocks · dark con accent */
body[data-theme="cinematic"] code, [data-theme="cinematic"] pre {
    background: var(--bg-sunken);
    color: var(--text-secondary);
}

/* ══════════════════════════════════════════════════════════════
   CINEMATIC OVERRIDE · componenti hardcoded warm Siena
   I blocchi warm sopra usano hex fissi con — bypassano
   le var del theme system. Qui ri-overrido i componenti chiave
   per body[data-theme="cinematic"] usando var() del block dark navy.
   ══════════════════════════════════════════════════════════════ */

/* Sidebar · gerarchia depth: sunken (più scuro del body) */
body[data-theme="cinematic"] .sidebar {
    background: var(--bg-sunken);
    border-right: 1px solid var(--border);
}
/* Topbar · solid, NON trasparente · stessa profondità sidebar */
body[data-theme="cinematic"] .topbar {
    background: var(--bg-sunken);
    border-bottom: 1px solid var(--border);
    backdrop-filter: none;
}
/* Main content · default body bg */
body[data-theme="cinematic"] .main-content,
body[data-theme="cinematic"] .page-content {
    background: var(--bg);
}
body[data-theme="cinematic"] .sidebar-item { color: var(--text-secondary); }
body[data-theme="cinematic"] .sidebar-item:hover { background: var(--bg-hover); color: var(--text); }
body[data-theme="cinematic"] .sidebar-item.active { background: var(--accent-soft); color: var(--accent); }
body[data-theme="cinematic"] .sidebar-brand-icon { background: var(--accent); color: var(--accent-fg); }
body[data-theme="cinematic"] .sidebar-label { color: var(--text-muted); }
body[data-theme="cinematic"] .sidebar-brand-text { color: var(--text); }
body[data-theme="cinematic"] .sidebar-user-name { color: var(--text); }
body[data-theme="cinematic"] .sidebar-user-role { color: var(--text-tertiary); }

/* Topbar breadcrumb */
body[data-theme="cinematic"] .topbar-breadcrumb,
body[data-theme="cinematic"] .topbar-breadcrumb span { color: var(--text-secondary); }

/* Cards */
body[data-theme="cinematic"] .card,
body[data-theme="cinematic"] .sw-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
}

/* Buttons primary · sovrascrivi warm Siena */
body[data-theme="cinematic"] .btn-primary,
body[data-theme="cinematic"] .btn-accent {
    background: var(--accent);
    color: var(--accent-fg);
    border-color: var(--accent);
}
body[data-theme="cinematic"] .btn-primary:hover,
body[data-theme="cinematic"] .btn-accent:hover {
    background: var(--accent-hover);
}

/* Inputs */
body[data-theme="cinematic"] .input,
body[data-theme="cinematic"] input[type="text"],
body[data-theme="cinematic"] input[type="email"],
body[data-theme="cinematic"] input[type="tel"],
body[data-theme="cinematic"] input[type="password"],
body[data-theme="cinematic"] input[type="number"],
body[data-theme="cinematic"] input[type="search"],
body[data-theme="cinematic"] input[type="url"],
body[data-theme="cinematic"] input[type="date"],
body[data-theme="cinematic"] select,
body[data-theme="cinematic"] textarea {
    background: var(--bg-sunken);
    border: 1px solid var(--border);
    color: var(--text);
}
body[data-theme="cinematic"] .input:focus,
body[data-theme="cinematic"] input:focus,
body[data-theme="cinematic"] select:focus,
body[data-theme="cinematic"] textarea:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Flash */
body[data-theme="cinematic"] .flash {
    background: rgba(16,185,129,.10);
    border: 1px solid rgba(16,185,129,.25);
    color: #34d399;
}

/* Tables */
body[data-theme="cinematic"] .tbl thead th {
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}
body[data-theme="cinematic"] .tbl tbody tr { border-bottom: 1px dashed var(--border); }

/* Chat bubbles */
body[data-theme="cinematic"] .bubble.in,
body[data-theme="cinematic"] .chat-msg.in .bubble,
body[data-theme="cinematic"] .chat-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
}
body[data-theme="cinematic"] .bubble.out,
body[data-theme="cinematic"] .bubble.out-wa,
body[data-theme="cinematic"] .chat-msg.out .bubble,
body[data-theme="cinematic"] .bubble.out-tk {
    background: var(--accent-soft);
    border: 1px solid rgba(249,115,22,.3);
    color: var(--text);
}
body[data-theme="cinematic"] .chat-meta { color: var(--text-muted); }
body[data-theme="cinematic"] .chat-status { color: var(--text-muted); }

/* Pipeline columns/cards */
body[data-theme="cinematic"] .pipeline-column,
body[data-theme="cinematic"] .pipeline-card,
body[data-theme="cinematic"] .lead-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}
body[data-theme="cinematic"] .pipeline-column-header {
    border-bottom: 2px solid var(--accent);
    color: var(--text);
}
body[data-theme="cinematic"] .pipeline-card:hover,
body[data-theme="cinematic"] .lead-card:hover {
    border-color: var(--accent);
}

/* Stat cards / hero KPIs */
body[data-theme="cinematic"] .stat-card,
body[data-theme="cinematic"] .kpi-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
}

/* ══════════════════════════════════════════════════════════════════════
   CINEMATIC PIPELINE LANGUAGE · stile bp-* esteso a tutto il CRM
   Bloomberg dashboard: tipografia Inter + JetBrains Mono numeri,
   eyebrow uppercase letterspacing, hero numerico, tile compatti,
   border 1px sottili, raggio 8-10px, no shadow, accent orange segnale.
   Applica SOLO quando body[data-theme="cinematic"].
   ══════════════════════════════════════════════════════════════════════ */

/* ───── Import font (Inter + JetBrains Mono) ───── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

body[data-theme="cinematic"] {
    --bp-font: 'Inter', -apple-system, sans-serif;
    --bp-font-num: 'JetBrains Mono', 'SF Mono', monospace;
    font-family: var(--bp-font);
    font-feature-settings: 'tnum';
    -webkit-font-smoothing: antialiased;
}

/* ───── Tipografia ───── */
body[data-theme="cinematic"] h1,
body[data-theme="cinematic"] h2,
body[data-theme="cinematic"] h3,
body[data-theme="cinematic"] h4,
body[data-theme="cinematic"] h5 {
    font-family: var(--bp-font);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}
body[data-theme="cinematic"] h1 { font-size: 28px; line-height: 1.15; }
body[data-theme="cinematic"] h2 { font-size: 20px; line-height: 1.2; }
body[data-theme="cinematic"] h3 { font-size: 16px; }
body[data-theme="cinematic"] code,
body[data-theme="cinematic"] pre,
body[data-theme="cinematic"] .mono,
body[data-theme="cinematic"] .num {
    font-family: var(--bp-font-num);
}

/* ───── Eyebrow / label uppercase letterspacing ───── */
body[data-theme="cinematic"] .stat-label,
body[data-theme="cinematic"] .kpi-label,
body[data-theme="cinematic"] .card-label,
body[data-theme="cinematic"] .sidebar-label,
body[data-theme="cinematic"] .form-label,
body[data-theme="cinematic"] .section-label,
body[data-theme="cinematic"] label.label,
body[data-theme="cinematic"] .eyebrow {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    font-family: var(--bp-font);
}

/* ───── Hero numerico (stat-card, kpi, hero block) ───── */
body[data-theme="cinematic"] .stat-card,
body[data-theme="cinematic"] .kpi-card,
body[data-theme="cinematic"] .hero-card,
body[data-theme="cinematic"] .metric-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: none;
}
body[data-theme="cinematic"] .stat-value,
body[data-theme="cinematic"] .kpi-value,
body[data-theme="cinematic"] .hero-num,
body[data-theme="cinematic"] .metric-value {
    font-size: 32px;
    font-weight: 300;
    letter-spacing: -1px;
    line-height: 1;
    color: var(--text);
    font-family: var(--bp-font);
    font-feature-settings: 'tnum';
}
body[data-theme="cinematic"] .stat-value .cents,
body[data-theme="cinematic"] .hero-num .cents {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 4px;
}

/* ───── Tile compatti (.lead-card, .pipeline-card, .timeline event) ───── */
body[data-theme="cinematic"] .lead-card,
body[data-theme="cinematic"] .pipeline-card,
body[data-theme="cinematic"] .tile,
body[data-theme="cinematic"] .timeline-event,
body[data-theme="cinematic"] .event-card,
body[data-theme="cinematic"] .task-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: none;
    transition: all 120ms ease;
}
body[data-theme="cinematic"] .lead-card:hover,
body[data-theme="cinematic"] .pipeline-card:hover,
body[data-theme="cinematic"] .tile:hover,
body[data-theme="cinematic"] .timeline-event:hover,
body[data-theme="cinematic"] .event-card:hover,
body[data-theme="cinematic"] .task-card:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
    transform: none;
}
body[data-theme="cinematic"] .lead-name,
body[data-theme="cinematic"] .tile-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body[data-theme="cinematic"] .lead-meta,
body[data-theme="cinematic"] .tile-meta,
body[data-theme="cinematic"] .card-meta {
    display: flex;
    gap: 8px;
    font-size: 10px;
    color: var(--text-muted);
    align-items: center;
    font-family: var(--bp-font-num);
}

/* ───── Card generico (background + border + raggio) ───── */
body[data-theme="cinematic"] .card,
body[data-theme="cinematic"] .panel,
body[data-theme="cinematic"] .box {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: none;
}

/* ───── Tables tipografiche ───── */
body[data-theme="cinematic"] .tbl,
body[data-theme="cinematic"] table {
    border-collapse: collapse;
}
body[data-theme="cinematic"] .tbl thead th,
body[data-theme="cinematic"] table thead th {
    font-family: var(--bp-font);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
    background: transparent;
}
body[data-theme="cinematic"] .tbl tbody td,
body[data-theme="cinematic"] table tbody td {
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
    color: var(--text-secondary);
    font-size: 13px;
}
body[data-theme="cinematic"] .tbl tbody tr:hover,
body[data-theme="cinematic"] table tbody tr:hover {
    background: var(--bg-hover);
}

/* ───── Numeric cells: tabular-nums + mono ───── */
body[data-theme="cinematic"] .num,
body[data-theme="cinematic"] td.num,
body[data-theme="cinematic"] .badge.num,
body[data-theme="cinematic"] .count,
body[data-theme="cinematic"] .amount {
    font-family: var(--bp-font-num);
    font-feature-settings: 'tnum';
}

/* ───── Buttons stile bp ───── */
body[data-theme="cinematic"] .btn {
    font-family: var(--bp-font);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 6px;
    transition: all 120ms;
    box-shadow: none;
}
body[data-theme="cinematic"] .btn-ghost,
body[data-theme="cinematic"] .btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
body[data-theme="cinematic"] .btn-ghost:hover,
body[data-theme="cinematic"] .btn-secondary:hover {
    color: var(--text);
    border-color: var(--text-muted);
    background: var(--bg-hover);
}

/* ───── Badges stile pipeline (mono + sottili) ───── */
body[data-theme="cinematic"] .badge,
body[data-theme="cinematic"] .chip,
body[data-theme="cinematic"] .tag {
    font-family: var(--bp-font-num);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(249,115,22,.3);
}

/* ───── Page header / breadcrumb ───── */
body[data-theme="cinematic"] .page-header,
body[data-theme="cinematic"] .crumb,
body[data-theme="cinematic"] .breadcrumb {
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-family: var(--bp-font);
}

/* ───── Hero block grande (timeline header "Ciao tuttuu-svc") ───── */
body[data-theme="cinematic"] .greeting,
body[data-theme="cinematic"] .page-title-large {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
    line-height: 1.15;
    color: var(--text);
}

/* ───── Stat box small (lead totali / lead caldi) ───── */
body[data-theme="cinematic"] .stat-mini,
body[data-theme="cinematic"] .kpi-mini {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    text-align: center;
    min-width: 80px;
}
body[data-theme="cinematic"] .stat-mini-value {
    font-size: 28px;
    font-weight: 300;
    color: var(--text);
    line-height: 1;
    font-feature-settings: 'tnum';
}
body[data-theme="cinematic"] .stat-mini-label {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 600;
}

/* ───── Separator line (between sections) ───── */
body[data-theme="cinematic"] hr,
body[data-theme="cinematic"] .divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* ───── Timeline event (pagina /timeline.php) ───── */
body[data-theme="cinematic"] .timeline-track {
    border-left: 1px solid var(--border);
    padding-left: 24px;
}
body[data-theme="cinematic"] .timeline-event-time {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-family: var(--bp-font-num);
}
body[data-theme="cinematic"] .timeline-event-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-top: 4px;
}
body[data-theme="cinematic"] .timeline-event-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ───── Empty state / placeholder ───── */
body[data-theme="cinematic"] .empty,
body[data-theme="cinematic"] .placeholder {
    color: var(--text-muted);
    font-style: normal;
    text-align: center;
    padding: 40px 20px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: transparent;
}

/* ───── Forms tipografia ───── */
body[data-theme="cinematic"] form label {
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
}

/* ───── Links accent ───── */
body[data-theme="cinematic"] a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 120ms;
}
body[data-theme="cinematic"] a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ───── Bloomberg: nessuna shadow inutile ───── */
body[data-theme="cinematic"] .card,
body[data-theme="cinematic"] .panel,
body[data-theme="cinematic"] .box,
body[data-theme="cinematic"] .stat-card,
body[data-theme="cinematic"] .kpi-card,
body[data-theme="cinematic"] .modal {
    box-shadow: none;
}

/* ───── Modal stile drawer (bp-drawer) ───── */
body[data-theme="cinematic"] .modal,
body[data-theme="cinematic"] .drawer {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
}
body[data-theme="cinematic"] .modal-header,
body[data-theme="cinematic"] .drawer-head {
    border-bottom: 1px solid var(--border);
    padding: 18px 22px;
}


/* ═══════════════════════════════════════════════════════════════════════
   TIMELINE.PHP · stile pipeline cinematic (override completo)
   ═══════════════════════════════════════════════════════════════════════ */
/* Kpi mini hero (Lead totali/caldi/da approvare) */
.kpi-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.kpi-mini {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    text-align: center;
    min-width: 90px;
}
.kpi-mini-value {
    font-size: 28px;
    font-weight: 300;
    color: var(--text);
    letter-spacing: -1px;
    line-height: 1;
    font-feature-settings: 'tnum';
}
.kpi-mini-label {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 600;
}
.kpi-mini-hot {
    border-color: rgba(239,68,68,.35);
    background: rgba(239,68,68,.08);
}
.kpi-mini-hot .kpi-mini-value { color: #ef4444; }
.kpi-mini-hot .kpi-mini-label { color: #ef4444; }
.kpi-mini-amber {
    border-color: rgba(245,158,11,.35);
    background: rgba(245,158,11,.08);
}
.kpi-mini-amber .kpi-mini-value { color: #f59e0b; }
.kpi-mini-amber .kpi-mini-label { color: #f59e0b; }

/* Timeline cinematic override */
body[data-theme="cinematic"] .timeline-header {
    border-bottom: 1px solid var(--border);
}
body[data-theme="cinematic"] .timeline-header h1 {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--text);
}
body[data-theme="cinematic"] .timeline-header .subtitle {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}
body[data-theme="cinematic"] .timeline-events {
    border-left: 1px solid var(--border);
    padding-left: 24px;
}
body[data-theme="cinematic"] .tl-event::before {
    background: var(--bg-elevated);
    border: 2px solid var(--border-strong, var(--border));
}
body[data-theme="cinematic"] .tl-event.now::before {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 5px var(--accent-soft);
}
body[data-theme="cinematic"] .tl-time {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}
body[data-theme="cinematic"] .tl-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: none;
    transition: all 120ms ease;
}
body[data-theme="cinematic"] .tl-card:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
    box-shadow: none;
}
body[data-theme="cinematic"] .tl-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0;
}
body[data-theme="cinematic"] .tl-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}


/* ═══════════════════════════════════════════════════════════════════════
   PAGINE CRM SPECIFICHE · cinematic bp-* style
   ═══════════════════════════════════════════════════════════════════════ */

/* LEAD LIST (leads.php): tabella tipografica Bloomberg */
body[data-theme="cinematic"] .leads-table,
body[data-theme="cinematic"] .lead-table-row,
body[data-theme="cinematic"] table.lead-table {
    background: transparent;
}
body[data-theme="cinematic"] .lead-row {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
    transition: all 120ms;
}
body[data-theme="cinematic"] .lead-row:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}
body[data-theme="cinematic"] .lead-row-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
body[data-theme="cinematic"] .lead-row-meta {
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* LEAD VIEW (lead.php): hero + scheda */
body[data-theme="cinematic"] .lead-hero {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 16px;
}
body[data-theme="cinematic"] .lead-name-hero {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: var(--text);
}
body[data-theme="cinematic"] .lead-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 14px;
    box-shadow: none;
}
body[data-theme="cinematic"] .lead-section h3,
body[data-theme="cinematic"] .lead-section .section-title {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 12px;
}
body[data-theme="cinematic"] .field-value,
body[data-theme="cinematic"] .lead-field-value {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
}
body[data-theme="cinematic"] .field-label,
body[data-theme="cinematic"] .lead-field-label {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 2px;
}

/* ADMIN/DASHBOARD: stat tiles */
body[data-theme="cinematic"] .dashboard-stat,
body[data-theme="cinematic"] .stat-tile {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: none;
}
body[data-theme="cinematic"] .stat-tile-value,
body[data-theme="cinematic"] .dashboard-stat-value {
    font-size: 32px;
    font-weight: 300;
    letter-spacing: -1px;
    line-height: 1;
    color: var(--text);
    font-feature-settings: 'tnum';
}
body[data-theme="cinematic"] .stat-tile-label,
body[data-theme="cinematic"] .dashboard-stat-label {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 6px;
}

/* AGENTE.PHP (chat AI): messaggi */
body[data-theme="cinematic"] .chat-container,
body[data-theme="cinematic"] .agente-chat {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}
body[data-theme="cinematic"] .msg-user,
body[data-theme="cinematic"] .agente-msg-user {
    background: var(--accent-soft);
    border: 1px solid rgba(249,115,22,.3);
    color: var(--text);
    border-radius: 12px 12px 4px 12px;
    padding: 10px 14px;
}
body[data-theme="cinematic"] .msg-ai,
body[data-theme="cinematic"] .agente-msg-ai,
body[data-theme="cinematic"] .msg-assistant {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 12px 12px 12px 4px;
    padding: 10px 14px;
}
body[data-theme="cinematic"] .msg-time {
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    margin-top: 4px;
}

/* ANALYTICS.PHP */
body[data-theme="cinematic"] .analytics-card,
body[data-theme="cinematic"] .chart-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
}
body[data-theme="cinematic"] .analytics-num {
    font-size: 32px;
    font-weight: 300;
    color: var(--text);
    letter-spacing: -1px;
}

/* FOLLOWUP.PHP */
body[data-theme="cinematic"] .followup-step,
body[data-theme="cinematic"] .sequence-step,
body[data-theme="cinematic"] .enrollment-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
}

/* TASKS.PHP */
body[data-theme="cinematic"] .task-row,
body[data-theme="cinematic"] .task-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
}
body[data-theme="cinematic"] .task-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

/* CAMPAGNE.PHP */
body[data-theme="cinematic"] .campaign-card,
body[data-theme="cinematic"] .campagna-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
    transition: all 120ms;
}
body[data-theme="cinematic"] .campaign-card:hover,
body[data-theme="cinematic"] .campagna-card:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}

/* HEAT badges (lead heat 1-5): mantengono colore signal anche in cinematic */
body[data-theme="cinematic"] .heat-5,
body[data-theme="cinematic"] .badge.heat-5 {
    background: rgba(239,68,68,.15);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,.3);
}
body[data-theme="cinematic"] .heat-4,
body[data-theme="cinematic"] .badge.heat-4 {
    background: rgba(249,115,22,.15);
    color: #f97316;
    border: 1px solid rgba(249,115,22,.3);
}
body[data-theme="cinematic"] .heat-3,
body[data-theme="cinematic"] .badge.heat-3 {
    background: rgba(234,179,8,.15);
    color: #eab308;
    border: 1px solid rgba(234,179,8,.3);
}
body[data-theme="cinematic"] .heat-2,
body[data-theme="cinematic"] .badge.heat-2 {
    background: rgba(59,130,246,.15);
    color: #3b82f6;
    border: 1px solid rgba(59,130,246,.3);
}
body[data-theme="cinematic"] .heat-1,
body[data-theme="cinematic"] .badge.heat-1 {
    background: rgba(148,163,184,.15);
    color: #94a3b8;
    border: 1px solid rgba(148,163,184,.3);
}

/* Statuses generici */
body[data-theme="cinematic"] .status-active,
body[data-theme="cinematic"] .badge.status-active {
    background: rgba(16,185,129,.15);
    color: #10b981;
    border: 1px solid rgba(16,185,129,.3);
}
body[data-theme="cinematic"] .status-paused {
    background: rgba(245,158,11,.15);
    color: #f59e0b;
    border: 1px solid rgba(245,158,11,.3);
}
body[data-theme="cinematic"] .status-archived {
    background: rgba(148,163,184,.10);
    color: var(--text-muted);
    border: 1px solid var(--border);
}


/* ═══════════════════════════════════════════════════════════════════════
   CINEMATIC FIX TARGETED · classi PHP che usavano fallback Siena
   ═══════════════════════════════════════════════════════════════════════ */

/* --surface era non definita in cinematic (legacy clarity warm). Definita ora. */
body[data-theme="cinematic"] {
    --surface: var(--bg-elevated);
    --surface-hover: var(--bg-hover);
    --red: #ef4444;
    --red-muted: rgba(239,68,68,.12);
    --red-soft: rgba(239,68,68,.12);
    --amber: #f59e0b;
    --amber-soft: rgba(245,158,11,.12);
    --emerald: #10b981;
    --emerald-soft: rgba(16,185,129,.12);
    --blue: #3b82f6;
    --blue-soft: rgba(59,130,246,.12);
    --muted: var(--text-muted);
    --font-mono: 'JetBrains Mono', monospace;
    --font-display: 'Inter', -apple-system, sans-serif;
}

/* Home hero (admin dashboard greeting) */
body[data-theme="cinematic"] .home-hero {
    background: transparent;
    padding: 24px 0 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
body[data-theme="cinematic"] .home-hero h1 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 28px;
    letter-spacing: -0.5px;
    color: var(--text);
    margin: 0 0 6px;
}
body[data-theme="cinematic"] .home-hero p {
    color: var(--text-muted);
    font-size: 13px;
}
body[data-theme="cinematic"] .home-microstats {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 12px;
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}
body[data-theme="cinematic"] .home-microstats .divider {
    color: var(--border-strong, var(--border));
    opacity: 0.5;
}
body[data-theme="cinematic"] .home-microstats strong {
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 14px;
}

/* Campaign switcher (selector banda alta) */
body[data-theme="cinematic"] .campaign-switcher {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
}
body[data-theme="cinematic"] .campaign-switcher a {
    transition: all 120ms;
}

/* Home feed (lista lead recenti) */
body[data-theme="cinematic"] .home-feed-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* Lead feed row (Bentornato page lista NA Fabrizio 4/5) */
body[data-theme="cinematic"] .home-feed-row,
body[data-theme="cinematic"] .home-feed-item,
body[data-theme="cinematic"] .recent-lead {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
    color: var(--text);
}
body[data-theme="cinematic"] .home-feed-row:hover,
body[data-theme="cinematic"] .home-feed-item:hover,
body[data-theme="cinematic"] .recent-lead:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}

/* NUOVO LEAD CTA */
body[data-theme="cinematic"] .new-lead-cta,
body[data-theme="cinematic"] .home-empty {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
}


/* ═══════════════════════════════════════════════════════════════════════
   HERO BLOCK · pipeline.php style esteso a tutte le pagine timeline-like
   Numero gigante + chips colorati, no SaaS template
   ═══════════════════════════════════════════════════════════════════════ */
body[data-theme="cinematic"] .hero-block {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    flex-wrap: wrap;
}
body[data-theme="cinematic"] .hero-num {
    font-size: 56px;
    font-weight: 300;
    letter-spacing: -2px;
    line-height: 1;
    color: var(--text);
    font-feature-settings: 'tnum';
    display: flex;
    align-items: baseline;
    gap: 10px;
}
body[data-theme="cinematic"] .hero-num-unit {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
body[data-theme="cinematic"] .hero-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 6px;
}
body[data-theme="cinematic"] .hero-chip {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(249,115,22,.3);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    font-feature-settings: 'tnum';
}
body[data-theme="cinematic"] .hero-chip-hot {
    background: rgba(239,68,68,.12);
    color: #ef4444;
    border-color: rgba(239,68,68,.3);
}
body[data-theme="cinematic"] .hero-chip-amber {
    background: rgba(245,158,11,.12);
    color: #f59e0b;
    border-color: rgba(245,158,11,.3);
}

/* Sed pulizia: rimuovo i vecchi .kpi-mini orfani se ci sono (zero ora) */


/* Analytics widgets fix */
body[data-theme="cinematic"] .analytics-widget {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
}
body[data-theme="cinematic"] .analytics-widget .aw-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 16px;
}
body[data-theme="cinematic"] .analytics-widget .aw-value {
    color: var(--text);
    font-size: 32px;
    font-weight: 300;
    letter-spacing: -1px;
}
body[data-theme="cinematic"] .analytics-widget .aw-subtitle {
    color: var(--text-muted);
}
body[data-theme="cinematic"] .stats-grid > div {
    background: var(--bg-sunken);
    border: 1px solid var(--border);
    border-radius: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════
   DASHBOARD WIDGET GRID · Bloomberg style
   ═══════════════════════════════════════════════════════════════════════ */

/* KPI hero row · 4 cards */
.dash-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.dash-kpi {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 20px;
}
.dash-kpi-eyebrow {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 10px;
}
.dash-kpi-value {
    font-size: 36px;
    font-weight: 300;
    letter-spacing: -1.5px;
    line-height: 1;
    color: var(--text);
    font-feature-settings: 'tnum';
    margin-bottom: 8px;
}
.dash-kpi-cents {
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 2px;
}
.dash-kpi-sub {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}
.dash-kpi-hot {
    border-color: rgba(239,68,68,.3);
    background: rgba(239,68,68,.05);
}
.dash-kpi-hot .dash-kpi-value { color: #ef4444; }
.dash-kpi-accent {
    border-color: rgba(249,115,22,.3);
    background: rgba(249,115,22,.05);
}
.dash-kpi-accent .dash-kpi-value { color: var(--accent); }
.dash-kpi-success {
    border-color: rgba(16,185,129,.3);
    background: rgba(16,185,129,.05);
}
.dash-kpi-success .dash-kpi-value { color: #10b981; }

/* Widget grid 2 col */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.dash-widget {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.dash-widget-wide {
    grid-column: 1 / -1;
}
.dash-widget-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.dash-widget-title {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}
.dash-widget-link {
    font-size: 11px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 120ms;
}
.dash-widget-link:hover { opacity: 0.75; }
.dash-widget-empty {
    padding: 30px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    border: 1px dashed var(--border);
    border-radius: 8px;
}

/* Row item dentro widget · stile bp-tile compatto */
.dash-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-sunken);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: all 120ms;
}
.dash-row:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}
.dash-row-avatar {
    width: 32px; height: 32px;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
}
.dash-row-main {
    flex: 1;
    min-width: 0;
}
.dash-row-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-row-meta {
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    margin-top: 2px;
    display: flex;
    gap: 6px;
}
.dash-row-time {
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
}

/* Funnel bars */
.dash-funnel-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}
.dash-funnel-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}
.dash-funnel-count {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--text);
}
.dash-funnel-bar {
    height: 6px;
    background: var(--bg-sunken);
    border-radius: 3px;
    overflow: hidden;
}
.dash-funnel-bar-fill {
    height: 100%;
    background: var(--accent);
    transition: width 300ms ease;
}
.dash-funnel-bar-fill.dash-funnel-won { background: #10b981; }
.dash-funnel-bar-fill.dash-funnel-lost { background: #ef4444; }
.dash-funnel-bar-fill.dash-funnel-open { background: var(--accent); }


/* ═══════════════════════════════════════════════════════════════════════
   AGENDA · Google Calendar style (mese + settimana + giorno)
   ═══════════════════════════════════════════════════════════════════════ */

.cal-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.cal-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}
.cal-nav-btn {
    width: 32px; height: 32px;
    border-radius: 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    text-decoration: none;
    transition: all 120ms;
}
.cal-nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.cal-nav-today {
    padding: 6px 14px;
    border-radius: 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 12px; font-weight: 600;
    text-decoration: none;
}
.cal-nav-today:hover { border-color: var(--accent); }
.cal-title {
    font-size: 20px; font-weight: 600; letter-spacing: -0.3px;
    color: var(--text); margin: 0 0 0 6px;
}

.cal-view-switch {
    display: flex;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.cal-view-btn {
    padding: 7px 16px;
    font-size: 12px; font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-right: 1px solid var(--border);
    transition: all 120ms;
}
.cal-view-btn:last-child { border-right: none; }
.cal-view-btn:hover { background: var(--bg-hover); color: var(--text); }
.cal-view-btn.active { background: var(--accent); color: #fff; font-weight: 600; }

/* MONTH GRID */
.cal-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.cal-weekday {
    padding: 10px 12px;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: var(--bg-sunken);
    text-align: left;
}
.cal-cell {
    min-height: 110px;
    padding: 8px 8px 4px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: background 120ms;
    cursor: pointer;
}
.cal-cell:hover { background: var(--bg-hover); }
.cal-cell:nth-child(7n+7) { border-right: none; }
.cal-cell.is-other { opacity: 0.35; background: var(--bg-sunken); }
.cal-cell.is-today { background: rgba(249,115,22,.06); border-left: 2px solid var(--accent); }
.cal-cell.is-today .cal-cell-num {
    background: var(--accent);
    color: #fff;
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.cal-cell-num {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
}
.cal-cell-events {
    display: flex; flex-direction: column; gap: 2px;
}

/* EVENT pill (mese view) */
.cal-event {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    transition: opacity 120ms;
}
.cal-event:hover { opacity: 0.85; }
.cal-event-time {
    font-family: 'JetBrains Mono', monospace;
    opacity: 0.9;
    flex-shrink: 0;
}
.cal-event-title {
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Color variants */
.cal-event-call { background: rgba(249,115,22,.18); color: #fb923c; border-left: 2px solid #f97316; }
.cal-event-task { background: rgba(245,158,11,.18); color: #fbbf24; border-left: 2px solid #f59e0b; }
.cal-event-lead { background: rgba(59,130,246,.18); color: #60a5fa; border-left: 2px solid #3b82f6; }

.cal-event-more {
    font-size: 10px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 2px 6px;
    font-weight: 500;
}
.cal-event-more:hover { color: var(--accent); }

/* WEEK GRID */
.cal-week-grid {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.cal-week-times {
    display: flex; flex-direction: column;
    border-right: 1px solid var(--border);
    background: var(--bg-sunken);
}
.cal-week-hour {
    padding: 8px 6px;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    border-bottom: 1px dashed var(--border);
    min-height: 32px;
    display: flex;
    align-items: flex-start;
}
.cal-week-col {
    display: flex; flex-direction: column;
    border-right: 1px solid var(--border);
    min-height: 500px;
}
.cal-week-col:last-child { border-right: none; }
.cal-week-col.is-today { background: rgba(249,115,22,.04); }
.cal-week-header {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: var(--bg-sunken);
}
.cal-week-day-name {
    display: block;
    font-size: 9px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.cal-week-day-num {
    display: inline-block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
}
.cal-week-day-num.is-today {
    background: var(--accent);
    color: #fff;
    width: 28px; height: 28px;
    border-radius: 50%;
    line-height: 28px;
}
.cal-week-cell {
    padding: 6px;
    flex: 1;
    display: flex; flex-direction: column;
    gap: 3px;
}

/* DAY GRID · cronologico */
.cal-day-grid {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 20px;
}
.cal-day-head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.cal-day-name {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}
.cal-day-date {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.3px;
}
.cal-day-event {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--bg-sunken);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    text-decoration: none;
    color: var(--text);
    margin-bottom: 8px;
    transition: all 120ms;
}
.cal-day-event:hover { border-color: var(--accent); background: var(--bg-hover); }
.cal-day-event.cal-event-call { border-left-color: #f97316; }
.cal-day-event.cal-event-task { border-left-color: #f59e0b; }
.cal-day-event.cal-event-lead { border-left-color: #3b82f6; }
.cal-day-event-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 600;
    color: var(--accent);
}
.cal-day-event-title { font-size: 14px; font-weight: 600; color: var(--text); }
.cal-day-event-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.cal-day-event-type {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

/* LEGEND */
.cal-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 20px;
    padding: 14px;
    font-size: 11px;
    color: var(--text-muted);
}
.cal-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.cal-legend-dot {
    width: 10px; height: 10px;
    border-radius: 2px;
    display: inline-block;
}
.cal-legend-dot.cal-event-call { background: #f97316; }
.cal-legend-dot.cal-event-task { background: #f59e0b; }
.cal-legend-dot.cal-event-lead { background: #3b82f6; }


/* ═══════════════════════════════════════════════════════════════════════
   AGENDA · public booking banner + team availability grid
   ═══════════════════════════════════════════════════════════════════════ */

.cal-public-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 18px;
    background: rgba(249,115,22,.08);
    border: 1px solid rgba(249,115,22,.3);
    border-radius: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.cal-public-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.cal-public-eyebrow {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
}
.cal-public-url {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text);
    background: var(--bg-sunken);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    word-break: break-all;
}
.cal-public-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-public-stats { font-size: 11px; color: var(--text-muted); }
.cal-public-stats strong { color: var(--accent); font-weight: 600; }

/* Team availability grid */
.team-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.team-grid th {
    text-align: left;
    padding: 8px 10px;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    background: transparent;
}
.team-grid th.team-grid-day { text-align: center; min-width: 70px; }
.team-grid th.team-grid-action { text-align: right; }
.team-grid tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 120ms;
}
.team-grid tbody tr:hover { background: var(--bg-hover); }
.team-grid tbody tr.is-inactive { opacity: 0.5; }
.team-grid td { padding: 12px 10px; vertical-align: middle; }
.team-grid td.team-grid-name {
    display: flex;
    align-items: center;
    gap: 10px;
}
.team-op-avatar {
    width: 32px; height: 32px;
    border-radius: 6px;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
}
.team-op-name { font-size: 13px; font-weight: 600; color: var(--text); }
.team-op-meta { display: flex; gap: 8px; margin-top: 2px; align-items: center; }
.team-op-bookings {
    font-size: 10px;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}
.team-grid td.team-grid-day { text-align: center; min-width: 70px; }
.team-day-empty { color: var(--text-muted); font-size: 11px; }
.team-day-slot {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    background: var(--bg-sunken);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 2px;
    border: 1px solid var(--border);
}
.team-grid td.team-grid-action { text-align: right; }

