/* ==========================================
   ZAB.Реклама — Design System
   Premium Dark Theme with Glassmorphism
   ========================================== */

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

/* ==========================================
   CSS Variables (Design Tokens)
   ========================================== */
:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a28;
    --bg-card: rgba(26, 26, 40, 0.7);
    --bg-glass: rgba(26, 26, 40, 0.4);

    /* Accent colors */
    --accent-primary: #6c5ce7;
    --accent-primary-rgb: 108, 92, 231;
    --accent-secondary: #a29bfe;
    --accent-gradient: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    --accent-glow: 0 0 20px rgba(108, 92, 231, 0.3);

    /* Status colors */
    --success: #00cec9;
    --success-rgb: 0, 206, 201;
    --warning: #fdcb6e;
    --warning-rgb: 253, 203, 110;
    --danger: #ff6b6b;
    --danger-rgb: 255, 107, 107;
    --info: #74b9ff;
    --info-rgb: 116, 185, 255;

    /* Pipeline colors */
    --stage-new: #74b9ff;
    --stage-contact: #a29bfe;
    --stage-proposal: #fdcb6e;
    --stage-negotiation: #ffa502;
    --stage-deal: #00cec9;
    --stage-lost: #ff6b6b;

    /* Text */
    --text-primary: #e8e8f0;
    --text-secondary: #9090a8;
    --text-muted: #5a5a72;
    --text-accent: var(--accent-secondary);

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    /* Sizing */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --header-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(108, 92, 231, 0.15);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Background gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 10% 20%, rgba(108, 92, 231, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 80%, rgba(0, 206, 201, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(162, 155, 254, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

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

/* ==========================================
   App Layout
   ========================================== */
.app {
    display: flex;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* ==========================================
   Sidebar
   ========================================== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    transition: width var(--transition-slow);
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--header-height);
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-brand h1 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    line-height: 1.2;
}

.sidebar-brand span {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    font-size: 14px;
    font-weight: 500;
    user-select: none;
}

.nav-item:hover {
    background: rgba(108, 92, 231, 0.08);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-secondary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 0 4px 4px 0;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.nav-badge {
    margin-left: auto;
    background: var(--accent-primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.user-details {
    overflow: hidden;
}

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

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ==========================================
   Main Content Area
   ========================================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.main-header {
    height: var(--header-height);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all var(--transition-fast);
}

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

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    min-width: 240px;
    transition: all var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.1);
}

.search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-primary);
    width: 100%;
}

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

.search-icon {
    color: var(--text-muted);
    font-size: 16px;
    flex-shrink: 0;
}

/* Content body */
.content-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    scroll-behavior: smooth;
}

.content-body::-webkit-scrollbar {
    width: 6px;
}

.content-body::-webkit-scrollbar-track {
    background: transparent;
}

.content-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

.content-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ==========================================
   Module Pages (show/hide)
   ========================================== */
.module-page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.module-page.active {
    display: block;
}

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

/* ==========================================
   Cards
   ========================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}

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

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Glass Card */
.card-glass {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Stat cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: 0.06;
    transform: translate(20px, -20px);
}

.stat-card.purple::after { background: var(--accent-primary); }
.stat-card.green::after { background: var(--success); }
.stat-card.orange::after { background: var(--warning); }
.stat-card.blue::after { background: var(--info); }
.stat-card.red::after { background: var(--danger); }

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 14px;
}

.stat-icon.purple { background: rgba(var(--accent-primary-rgb), 0.15); color: var(--accent-secondary); }
.stat-icon.green { background: rgba(var(--success-rgb), 0.15); color: var(--success); }
.stat-icon.orange { background: rgba(var(--warning-rgb), 0.15); color: var(--warning); }
.stat-icon.blue { background: rgba(var(--info-rgb), 0.15); color: var(--info); }
.stat-icon.red { background: rgba(var(--danger-rgb), 0.15); color: var(--danger); }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-change {
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
}

.stat-change.up {
    color: var(--success);
    background: rgba(var(--success-rgb), 0.1);
}

.stat-change.down {
    color: var(--danger);
    background: rgba(var(--danger-rgb), 0.1);
}

/* ==========================================
   Grids
   ========================================== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    user-select: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(var(--accent-primary-rgb), 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--accent-primary-rgb), 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(108, 92, 231, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
}

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

.btn-danger {
    background: rgba(var(--danger-rgb), 0.15);
    color: var(--danger);
}

.btn-danger:hover {
    background: rgba(var(--danger-rgb), 0.25);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* ==========================================
   Form Elements
   ========================================== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239090a8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* ==========================================
   Tables
   ========================================== */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-tertiary);
}

th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(108, 92, 231, 0.03);
}

/* ==========================================
   Tags & Badges
   ========================================== */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    gap: 4px;
}

.tag-purple { background: rgba(var(--accent-primary-rgb), 0.15); color: var(--accent-secondary); }
.tag-green { background: rgba(var(--success-rgb), 0.15); color: var(--success); }
.tag-orange { background: rgba(var(--warning-rgb), 0.15); color: var(--warning); }
.tag-blue { background: rgba(var(--info-rgb), 0.15); color: var(--info); }
.tag-red { background: rgba(var(--danger-rgb), 0.15); color: var(--danger); }

/* Score badge */
.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 28px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
}

.score-high { background: rgba(var(--success-rgb), 0.15); color: var(--success); }
.score-medium { background: rgba(var(--warning-rgb), 0.15); color: var(--warning); }
.score-low { background: rgba(var(--danger-rgb), 0.15); color: var(--danger); }

/* ==========================================
   Pipeline / Kanban
   ========================================== */
.pipeline-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    min-height: calc(100vh - 200px);
}

.pipeline-board::-webkit-scrollbar {
    height: 6px;
}

.pipeline-board::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

.pipeline-column {
    min-width: 280px;
    max-width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.pipeline-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    position: sticky;
    top: 0;
    z-index: 5;
}

.pipeline-column-title {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pipeline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.pipeline-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 10px;
}

.pipeline-column-body {
    flex: 1;
    background: rgba(18, 18, 26, 0.5);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 200px;
}

.pipeline-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: grab;
    transition: all var(--transition-fast);
}

.pipeline-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.pipeline-card:active {
    cursor: grabbing;
    transform: scale(0.98);
    opacity: 0.8;
}

.pipeline-card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.pipeline-card-company {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.pipeline-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pipeline-card-amount {
    font-size: 14px;
    font-weight: 700;
    color: var(--success);
}

.pipeline-card-date {
    font-size: 11px;
    color: var(--text-muted);
}

/* ==========================================
   AI Chat
   ========================================== */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - 48px);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: messageIn 0.3s ease;
}

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

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.chat-message.ai .chat-avatar {
    background: var(--accent-gradient);
    color: white;
}

.chat-message.user .chat-avatar {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.chat-bubble {
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    line-height: 1.6;
}

.chat-message.ai .chat-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top-left-radius: 4px;
}

.chat-message.user .chat-bubble {
    background: rgba(var(--accent-primary-rgb), 0.2);
    border: 1px solid rgba(var(--accent-primary-rgb), 0.3);
    border-top-right-radius: 4px;
}

.chat-input-area {
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 14px;
    resize: none;
    outline: none;
    min-height: 48px;
    max-height: 120px;
    transition: border-color var(--transition-fast);
}

.chat-input:focus {
    border-color: var(--accent-primary);
}

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

.chat-send-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--accent-glow);
}

/* Quick suggestion chips */
.chat-suggestions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.suggestion-chip {
    padding: 8px 14px;
    border-radius: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.suggestion-chip:hover {
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
    background: rgba(var(--accent-primary-rgb), 0.08);
}

/* ==========================================
   KP Generator
   ========================================== */
.kp-builder {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    height: calc(100vh - var(--header-height) - 48px);
}

.kp-form-panel {
    overflow-y: auto;
    padding-right: 8px;
}

.kp-preview-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow-y: auto;
    padding: 32px;
}

.kp-preview-panel h1 {
    font-size: 24px;
    margin-bottom: 16px;
}

.kp-preview-panel h2 {
    font-size: 18px;
    margin: 20px 0 10px;
    color: var(--accent-secondary);
}

.kp-preview-panel p {
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.kp-preview-panel ul {
    padding-left: 20px;
    margin-bottom: 12px;
}

.kp-preview-panel li {
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.5;
}

.kp-price-block {
    background: rgba(var(--accent-primary-rgb), 0.08);
    border: 1px solid rgba(var(--accent-primary-rgb), 0.2);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.kp-price {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent-secondary);
}

/* ==========================================
   Analytics Charts (placeholder containers)
   ========================================== */
.chart-container {
    width: 100%;
    height: 300px;
    position: relative;
}

/* Simple bar chart CSS */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 200px;
    padding: 0 10px;
}

.bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.bar {
    width: 100%;
    max-width: 40px;
    border-radius: 4px 4px 0 0;
    transition: height 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    cursor: pointer;
}

.bar:hover {
    filter: brightness(1.2);
}

.bar::after {
    content: attr(data-value);
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.bar:hover::after {
    opacity: 1;
}

.bar-label {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
}

/* Donut chart CSS */
.donut-chart {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    position: relative;
    margin: 0 auto;
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100px;
    height: 100px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.donut-value {
    font-size: 24px;
    font-weight: 700;
}

.donut-label {
    font-size: 11px;
    color: var(--text-muted);
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* ==========================================
   Empty States
   ========================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
    margin-bottom: 20px;
}

/* ==========================================
   Prospecting - Client Cards
   ========================================== */
.client-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.client-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.client-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.client-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.client-card-name {
    font-size: 16px;
    font-weight: 600;
}

.client-card-category {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.client-card-body {
    margin-bottom: 14px;
}

.client-card-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.client-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.client-card-actions {
    display: flex;
    gap: 6px;
}

/* ==========================================
   Modal
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* ==========================================
   Toast / Notification
   ========================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast-icon {
    font-size: 18px;
}

.toast-message {
    font-size: 13px;
    font-weight: 500;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info { border-left: 3px solid var(--info); }

/* ==========================================
   Loading & Skeleton
   ========================================== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, rgba(255,255,255,0.05) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    border-top-left-radius: 4px;
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 1024px) {
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .grid-2-1 { grid-template-columns: 1fr; }
    .kp-builder { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 200;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .mobile-only { display: flex !important; }
    .stats-grid { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .client-grid { grid-template-columns: 1fr; }
}
@media (min-width: 769px) {
    .mobile-only { display: none !important; }
}

/* ==========================================
   Activity Feed (Dashboard)
   ========================================== */
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.activity-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
}

.activity-text strong {
    font-weight: 600;
}

.activity-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ==========================================
   Task Items (Dashboard)
   ========================================== */
.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.task-item:last-child {
    border-bottom: none;
}

.task-check {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.task-item label {
    flex: 1;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-primary);
}

.task-item .tag {
    flex-shrink: 0;
}

/* ==========================================
   Checkbox Labels (KP Generator)
   ========================================== */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.checkbox-label:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--accent-primary);
    width: 14px;
    height: 14px;
}

.checkbox-label:has(input:checked) {
    background: rgba(var(--accent-primary-rgb), 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
}

/* ==========================================
   Template List (KP Generator)
   ========================================== */
.template-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.template-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.template-item:hover {
    border-color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.06);
}

.template-item span:first-child {
    font-size: 20px;
}

.template-item div {
    display: flex;
    flex-direction: column;
}

.template-item strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ==========================================
   Period Buttons (Analytics)
   ========================================== */
.period-btn.active {
    background: rgba(var(--accent-primary-rgb), 0.15) !important;
    border-color: var(--accent-primary) !important;
    color: var(--accent-secondary) !important;
}

/* ==========================================
   Channel Tabs (Pricelist)
   ========================================== */
.channel-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.channel-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    min-width: 180px;
}

.channel-tab:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.channel-tab.active {
    border-color: var(--tab-color, var(--accent-primary));
    background: rgba(108, 92, 231, 0.08);
    box-shadow: 0 0 12px rgba(108, 92, 231, 0.1);
}

.channel-tab.active::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--tab-color, var(--accent-primary));
    margin-left: auto;
}

/* ==========================================
   Price Items Grid
   ========================================== */
.price-items-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
}

.price-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.price-item:last-child {
    border-bottom: none;
}

.price-item:hover {
    background: rgba(108, 92, 231, 0.04);
}

.price-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 8px;
}

.price-item-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.price-item-price {
    font-weight: 700;
    font-size: 14px;
    color: var(--success);
    white-space: nowrap;
    text-align: right;
}

.price-item-details {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.price-detail-tag {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 3px 8px;
    border-radius: 6px;
}

.price-item-actions {
    display: flex;
    gap: 6px;
}

/* ==========================================
   Mediaplan Totals
   ========================================== */
.mediaplan-totals .card {
    animation: fadeIn 0.3s ease;
}

/* ==========================================
   KP Price Block
   ========================================== */
.kp-price-block {
    padding: 16px;
    background: rgba(0, 206, 201, 0.06);
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 206, 201, 0.15);
    margin-top: 16px;
}

.kp-price {
    color: var(--success);
}

/* ==========================================
   Responsive (mobile)
   ========================================== */
@media (max-width: 768px) {
    .channel-tabs {
        flex-direction: column;
    }
    .channel-tab {
        min-width: auto;
    }
    .price-item-header {
        flex-direction: column;
        gap: 4px;
    }
    .price-item-price {
        text-align: left;
    }
}
