:root{--bg:#080c14;--surface-1:#0f1623;--surface-2:#151e2e;--surface-3:#1c2840;--border:#6393ff1f;--border-hover:#6393ff4d;--text-1:#f0f4ff;--text-2:#8ba3cc;--text-3:#4a6080;--accent:#3b82f6;--accent-glow:#3b82f640;--green:#22c55e;--green-bg:#22c55e1a;--red:#ef4444;--red-bg:#ef44441a;--yellow:#f59e0b;--yellow-bg:#f59e0b1a;--purple:#a78bfa;--purple-bg:#a78bfa1a;--radius:12px;--radius-sm:8px}*,:before,:after{box-sizing:border-box;margin:0;padding:0}html{scroll-behavior:smooth}body{background-color:var(--bg);color:var(--text-1);-webkit-font-smoothing:antialiased;min-height:100vh;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:14px;line-height:1.5}.layout{min-height:100vh;display:flex}.sidebar{background:var(--surface-1);border-right:1px solid var(--border);flex-direction:column;flex-shrink:0;width:240px;height:100vh;padding:1.5rem 1rem;display:flex;position:sticky;top:0;overflow-y:auto}.sidebar-logo{align-items:center;gap:10px;margin-bottom:2rem;padding:0 .5rem;display:flex}.sidebar-logo .logo-icon{background:linear-gradient(135deg,#3b82f6,#8b5cf6);border-radius:10px;justify-content:center;align-items:center;width:36px;height:36px;font-size:18px;display:flex}.sidebar-logo span{letter-spacing:-.02em;background:linear-gradient(90deg,#60a5fa,#a78bfa);-webkit-text-fill-color:transparent;-webkit-background-clip:text;font-size:1.1rem;font-weight:700}.sidebar-nav{flex-direction:column;flex:1;gap:2px;display:flex}.nav-link{border-radius:var(--radius-sm);color:var(--text-2);align-items:center;gap:10px;padding:.6rem .75rem;font-size:.875rem;font-weight:500;text-decoration:none;transition:all .15s;display:flex}.nav-link:hover,.nav-link.active{background:var(--surface-3);color:var(--text-1)}.nav-link.active{background:var(--accent-glow);color:#60a5fa}.nav-icon{text-align:center;flex:0 0 20px;width:20px;font-size:16px}.nav-section-title{text-transform:uppercase;letter-spacing:.08em;color:var(--text-3);padding:.75rem .75rem .25rem;font-size:.7rem;font-weight:600}.main-content{flex:1;width:100%;padding:2rem;overflow-x:hidden}.page-header{justify-content:space-between;align-items:flex-start;margin-bottom:2rem;display:flex}.page-title{letter-spacing:-.02em;font-size:1.5rem;font-weight:700}.page-subtitle{color:var(--text-2);margin-top:2px;font-size:.875rem}.stats-grid{grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:1rem;margin-bottom:1.5rem;display:grid}.stat-card{background:var(--surface-1);border:1px solid var(--border);border-radius:var(--radius);padding:1.25rem;transition:border-color .2s,box-shadow .2s}.stat-card:hover{border-color:var(--border-hover);box-shadow:0 0 20px var(--accent-glow)}.stat-label{color:var(--text-2);text-transform:uppercase;letter-spacing:.05em;margin-bottom:.5rem;font-size:.75rem;font-weight:600}.stat-value{letter-spacing:-.03em;font-size:2rem;font-weight:700}.stat-value.green{color:var(--green)}.stat-value.red{color:var(--red)}.stat-value.yellow{color:var(--yellow)}.stat-value.blue{color:var(--accent)}.card{background:var(--surface-1);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}.card-header{border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;padding:1rem 1.25rem;display:flex}.card-title{font-size:.9rem;font-weight:600}.table-wrap{overflow-x:auto}table{border-collapse:collapse;width:100%}thead th{text-align:left;text-transform:uppercase;letter-spacing:.06em;color:var(--text-3);border-bottom:1px solid var(--border);white-space:nowrap;padding:.75rem 1rem;font-size:.7rem;font-weight:600}tbody td{border-bottom:1px solid var(--border);color:var(--text-2);vertical-align:middle;padding:.875rem 1rem;font-size:.8rem}tbody tr:hover td{background:var(--surface-2)}tbody tr:last-child td{border-bottom:none}.td-name{color:var(--text-1);font-weight:500}.td-mono{color:var(--text-2);font-family:JetBrains Mono,monospace;font-size:.75rem}.badge{text-transform:uppercase;letter-spacing:.04em;white-space:nowrap;border-radius:999px;align-items:center;gap:5px;padding:3px 10px;font-size:.7rem;font-weight:600;display:inline-flex}.badge:before{content:"";background:currentColor;border-radius:50%;flex-shrink:0;width:5px;height:5px}.badge.sent{background:var(--green-bg);color:var(--green)}.badge.pending{background:var(--yellow-bg);color:var(--yellow)}.badge.ignored{background:var(--purple-bg);color:var(--purple)}.badge.error{background:var(--red-bg);color:var(--red)}.btn{border-radius:var(--radius-sm);cursor:pointer;white-space:nowrap;border:none;align-items:center;gap:6px;padding:.45rem 1rem;font-size:.8rem;font-weight:600;text-decoration:none;transition:all .15s;display:inline-flex}.btn-primary{background:var(--accent);color:#fff}.btn-primary:hover{box-shadow:0 0 12px var(--accent-glow);background:#2563eb}.btn-ghost{color:var(--text-2);border:1px solid var(--border);background:0 0}.btn-ghost:hover{background:var(--surface-2);color:var(--text-1);border-color:var(--border-hover)}.btn-danger{background:var(--red-bg);color:var(--red);border:1px solid #ef444433}.btn-danger:hover{background:#ef444433}.btn-success{background:var(--green-bg);color:var(--green);border:1px solid #22c55e33}.btn-success:hover{background:#22c55e33}.empty-state{color:var(--text-3);text-align:center;flex-direction:column;justify-content:center;align-items:center;gap:.75rem;padding:4rem 2rem;display:flex}.empty-state .empty-icon{opacity:.3;font-size:3rem}.empty-state .empty-icon svg{width:32px;height:32px}.empty-state p{font-size:.875rem}.webhook-url{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-sm);align-items:center;gap:.75rem;margin-bottom:1rem;padding:.75rem 1rem;display:flex}.webhook-url code{color:#60a5fa;word-break:break-all;flex:1;font-family:JetBrains Mono,monospace;font-size:.8rem}.status-msg{color:var(--text-3);white-space:nowrap;text-overflow:ellipsis;max-width:240px;font-size:.75rem;overflow:hidden}.info-pill{background:var(--surface-3);color:var(--text-2);border-radius:999px;align-items:center;gap:4px;padding:2px 8px;font-size:.7rem;display:inline-flex}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--surface-3);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--text-3)}.crm-page{flex-direction:column;gap:1.25rem;display:flex}.crm-page-header{align-items:flex-end;gap:1rem;margin-bottom:0}.crm-back-link{color:var(--text-2);align-items:center;gap:8px;margin-bottom:.75rem;font-size:.875rem;text-decoration:none;display:inline-flex}.crm-back-link:hover{color:var(--text-1)}.crm-sync-control{flex-direction:column;align-items:flex-end;gap:6px;min-width:220px;display:flex}.crm-sync-button{min-height:40px}.crm-inline-note,.crm-table-caption{color:var(--text-2);font-size:.8rem}.crm-error{color:#ff8e8e;font-size:.85rem}.crm-sync-error{background:var(--red-bg);border-radius:var(--radius-sm);border:1px solid #ef444433;padding:.75rem 1rem}.crm-spin{animation:1s linear infinite crm-spin}@keyframes crm-spin{to{transform:rotate(360deg)}}.crm-summary{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;display:grid}.crm-summary>div{background:var(--surface-1);border:1px solid var(--border);border-radius:var(--radius-sm);flex-direction:column;gap:5px;min-height:76px;padding:14px 16px;display:flex}.crm-summary-label{color:var(--text-2);font-size:.8rem}.crm-summary strong{font-size:1rem;font-weight:600}.crm-sync-status.completed{color:var(--green)}.crm-sync-status.running{color:var(--yellow)}.crm-sync-status.failed{color:var(--red)}.crm-filter-card{padding:18px}.crm-filters{grid-template-columns:minmax(220px,2fr) repeat(4,minmax(140px,1fr));align-items:end;gap:14px 12px;display:grid}.crm-filters label,.crm-custom-dates label{flex-direction:column;gap:6px;min-width:0;display:flex}.crm-filters label>span:first-child,.crm-custom-dates label>span{color:var(--text-2);font-size:.8rem;font-weight:500}.crm-filters input,.crm-filters select,.crm-custom-dates input{width:100%;min-width:0;height:40px;color:var(--text-1);background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-sm);font:inherit;padding:0 10px}.crm-filters input:focus-visible,.crm-filters select:focus-visible,.crm-custom-dates input:focus-visible{outline-offset:2px;outline:2px solid #60a5fa}.crm-input-wrap{height:40px;color:var(--text-2);background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-sm);align-items:center;gap:8px;padding:0 10px;display:flex}.crm-input-wrap:focus-within{outline-offset:2px;outline:2px solid #60a5fa}.crm-input-wrap input{background:0 0;border:0;outline:0;height:38px;padding:0}.crm-custom-dates{grid-column:span 2;grid-template-columns:1fr 1fr;gap:10px;display:grid}.crm-filter-actions{align-items:center;gap:8px;display:flex}.crm-filter-actions .btn{min-height:40px}.crm-date-note{color:var(--text-2);align-items:flex-start;gap:8px;margin-top:14px;font-size:.8rem;display:flex}.crm-date-note svg{flex:none;margin-top:1px}.crm-table-card .card-header{align-items:flex-start}.crm-table-caption{margin-top:4px}.crm-table{min-width:960px}.crm-table thead th{letter-spacing:0;text-transform:none;color:var(--text-2);font-size:.75rem}.crm-table tbody td{min-height:48px;color:var(--text-1);font-size:.85rem}.crm-id,.crm-ns,.crm-deal-title,.crm-person-name,.crm-cell-secondary{display:block}.crm-id,.crm-ns{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.78rem}.crm-ns,.crm-person-name,.crm-cell-secondary{color:var(--text-2);margin-top:4px;font-size:.78rem}.crm-deal-title{font-weight:500}.crm-deal-status{background:var(--surface-3);min-height:24px;color:var(--text-2);white-space:nowrap;border-radius:999px;align-items:center;padding:2px 9px;font-size:.78rem;display:inline-flex}.crm-deal-status.status-1{color:var(--green);background:var(--green-bg)}.crm-deal-status.status-2{color:#ff8e8e;background:var(--red-bg)}.crm-empty-state{text-align:center;flex-direction:column;align-items:center;gap:8px;padding:44px 20px;display:flex}.crm-empty-state h3{color:var(--text-1);font-size:1rem;font-weight:600}.crm-empty-state p{max-width:520px;color:var(--text-2)}.crm-pagination{color:var(--text-2);justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;font-size:.82rem;display:flex}.crm-pagination>div{gap:8px;display:flex}.crm-pagination .btn{align-items:center;min-height:40px}.crm-selection-toolbar{border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;display:flex}.crm-selection-toolbar>div:first-child{flex-direction:column;gap:4px;display:flex}.crm-selection-toolbar strong{font-size:.9rem}.crm-selection-toolbar span{color:var(--text-2);font-size:.8rem}.crm-selection-actions{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.crm-selection-actions .btn{min-height:40px}.crm-selection-cell{width:48px;min-width:48px;text-align:center!important}.crm-selection-cell input,.crm-owner-picker input{width:18px;height:18px;accent-color:var(--accent);cursor:pointer}.crm-distribution-preview{border-bottom:1px solid var(--border);background:var(--surface-1);flex-direction:column;gap:14px;padding:18px 16px;display:flex}.crm-preview-heading{justify-content:space-between;align-items:flex-start;gap:12px;display:flex}.crm-preview-heading h3{font-size:1rem;font-weight:600}.crm-preview-heading p,.crm-preview-warning{color:var(--text-2);font-size:.82rem}.crm-readonly-badge{border:1px solid var(--border);color:var(--text-2);border-radius:999px;flex:none;padding:4px 9px;font-size:.75rem}.crm-owner-picker{border:0;flex-wrap:wrap;gap:8px 14px;padding:0;display:flex}.crm-owner-picker legend{width:100%;color:var(--text-2);margin-bottom:8px;font-size:.82rem}.crm-owner-picker label{border:1px solid var(--border);border-radius:var(--radius-sm);align-items:center;gap:8px;min-height:40px;padding:7px 10px;display:inline-flex}.crm-owner-picker p{color:var(--text-2);font-size:.82rem}.crm-assignment-counts{flex-wrap:wrap;gap:8px;display:flex}.crm-assignment-counts>div{border:1px solid var(--border);border-radius:var(--radius-sm);align-items:center;gap:10px;padding:9px 12px;display:flex}.crm-assignment-counts span{color:var(--text-2);font-size:.82rem}.crm-preview-table-wrap{overflow-x:auto}.crm-preview-table{border-collapse:collapse;width:100%;min-width:520px}.crm-preview-table th,.crm-preview-table td{border-bottom:1px solid var(--border);text-align:left;padding:9px 10px;font-size:.82rem}.crm-preview-table th{color:var(--text-2);font-weight:500}.crm-preview-warning{border-radius:var(--radius-sm);background:var(--surface-2);padding:10px 12px}.crm-confirm-actions{flex-wrap:wrap;align-items:center;gap:10px;display:flex}.crm-confirm-actions>span{color:var(--text-2);font-size:.8rem}.crm-confirm-panel{border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface-2);flex-direction:column;gap:12px;padding:14px;display:flex}.crm-confirm-panel p{font-size:.9rem}.crm-confirm-panel>div{flex-wrap:wrap;justify-content:flex-end;gap:8px;display:flex}.crm-distribution-results{flex-direction:column;gap:8px;display:flex}.crm-distribution-results ul{flex-direction:column;gap:6px;max-height:240px;display:flex;overflow-y:auto}.crm-distribution-results li{border:1px solid var(--border);border-radius:var(--radius-sm);grid-template-columns:90px 80px minmax(0,1fr);align-items:start;gap:8px;padding:8px 10px;font-size:.78rem;display:grid}.crm-result-status{font-weight:600}.crm-result-status.updated{color:var(--green)}.crm-result-status.failed,.crm-result-status.conflict,.crm-result-status.unknown{color:var(--red)}.crm-result-status.skipped{color:var(--text-2)}.crm-result-status.accepted,.crm-result-status.delivered{color:var(--green)}.crm-audit-table{min-width:860px}.crm-audit-table tbody td{vertical-align:top;font-size:.82rem}.crm-audit-operation{color:var(--text-2);margin-top:3px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.72rem;display:block}.crm-audit-status{background:var(--surface-3);border-radius:999px;padding:3px 8px;font-size:.74rem;display:inline-flex}.crm-audit-status.updated{color:var(--green);background:var(--green-bg)}.crm-audit-status.conflict,.crm-audit-status.failed,.crm-audit-status.unknown{color:var(--red);background:var(--red-bg)}.crm-audit-status.started{color:var(--yellow)}.crm-audit-status.skipped{color:var(--text-2)}.crm-audit-empty{color:var(--text-2);padding:22px 16px}.crm-audit-status.not_started{color:var(--text-2)}.crm-campaign-form{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;display:grid}.crm-campaign-form label{flex-direction:column;gap:6px;min-width:0;display:flex}.crm-campaign-form label>span{color:var(--text-2);font-size:.8rem}.crm-campaign-form input,.crm-campaign-form select{width:100%;min-width:0;height:40px;color:var(--text-1);background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-sm);font:inherit;padding:0 10px}.crm-consent-confirm{border:1px solid var(--border);border-radius:var(--radius-sm);align-items:flex-start;gap:10px;padding:12px;font-size:.85rem;display:flex}.crm-consent-confirm input{width:18px;height:18px;accent-color:var(--accent);flex:none;margin-top:2px}.crm-success{color:var(--green);background:var(--green-bg);border:1px solid var(--border);border-radius:var(--radius-sm);padding:10px 12px;font-size:.85rem}.crm-campaign-card{flex-direction:column;gap:14px;padding:18px;display:flex}.crm-campaign-header{justify-content:space-between;align-items:flex-start;gap:12px;display:flex}.crm-campaign-header h2{font-size:1rem;font-weight:600}.crm-campaign-header p,.crm-campaign-meta,.crm-campaign-footer{color:var(--text-2);font-size:.8rem}.crm-campaign-status{background:var(--surface-3);border-radius:999px;flex:none;padding:4px 9px;font-size:.75rem}.crm-campaign-status.completed{color:var(--green);background:var(--green-bg)}.crm-campaign-status.partial,.crm-campaign-status.cancelled{color:var(--red);background:var(--red-bg)}.crm-campaign-status.running{color:var(--yellow)}.crm-campaign-status.scheduled{color:var(--accent)}.crm-campaign-meta{flex-wrap:wrap;gap:8px 16px;display:flex}.crm-campaign-meta>span{align-items:center;gap:5px;display:inline-flex}.crm-campaign-footer{justify-content:space-between;align-items:center;gap:12px;display:flex}.crm-campaign-cancel{flex-direction:column;align-items:flex-end;gap:4px;display:flex}.crm-campaigns-empty{align-items:center}.btn:focus-visible,a:focus-visible{outline-offset:2px;outline:2px solid #60a5fa}@media (max-width:1100px){.crm-filters{grid-template-columns:repeat(3,minmax(0,1fr))}.crm-search-field{grid-column:span 2}}@media (max-width:760px){.main-content{padding:1.25rem}.sidebar{width:68px;padding:1rem .5rem}.sidebar-logo{justify-content:center;padding:0}.sidebar-logo>span,.nav-section-title{display:none}.nav-link:not(:has(svg)){display:none}.nav-link{justify-content:center;padding:.7rem .25rem;font-size:0}.nav-icon{flex-basis:auto}.crm-page-header{flex-direction:column;align-items:stretch}.crm-sync-control{align-items:flex-start}.crm-summary,.crm-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.crm-search-field{grid-column:span 2}}@media (max-width:480px){.main-content{padding:1rem}.crm-summary{grid-template-columns:1fr 1fr;gap:8px}.crm-summary>div{padding:11px}.crm-filters{flex-direction:column;align-items:stretch;display:flex}.crm-custom-dates,.crm-filter-actions{width:100%}.crm-filter-actions .btn{flex:1;justify-content:center}.crm-pagination{flex-direction:column;align-items:flex-start}.crm-selection-toolbar{flex-direction:column;align-items:stretch}.crm-selection-actions{width:100%}.crm-selection-actions .btn{flex:1;justify-content:center}.crm-preview-heading{flex-direction:column}.crm-confirm-panel>div{flex-direction:column-reverse}.crm-confirm-panel .btn{justify-content:center}.crm-distribution-results li{grid-template-columns:1fr auto}.crm-distribution-results li span:last-child{grid-column:1/-1}.crm-campaign-form{grid-template-columns:1fr}.crm-campaign-header,.crm-campaign-footer{flex-direction:column;align-items:flex-start}.crm-campaign-cancel{align-items:stretch;width:100%}}@media (prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important}}
