/**
 * Compass CRM - Lean & Fast Stylesheet
 * Streamlined design optimized for speed
 */

:root {
    --primary-color: #6C5CE7;
    --secondary-color: #45E3CF;
    --dark-bg: #1a1a2e;
    --light-bg: #f5f5f5;
    --text-dark: #2d3748;
    --text-light: #718096;
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #f56565;
    --border-color: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-dark);
    background: var(--light-bg);
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--dark-bg) 100%);
}

.login-container {
    width: 100%;
    max-width: 380px;
    padding: 15px;
}

.login-box {
    background: #000000;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-header h1 {
    color: white;
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
}

.tagline {
    color: var(--secondary-color);
    font-size: 13px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.login-footer p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

/* Main Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: var(--dark-bg);
    color: white;
    padding: 15px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 0 15px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand .logo {
    width: 32px;
    height: 32px;
}

.sidebar-brand h2 {
    color: var(--secondary-color);
    font-size: 18px;
    font-weight: 700;
}

.sidebar-brand p {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 2px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(108, 92, 231, 0.2);
    color: var(--secondary-color);
    border-left: 3px solid var(--secondary-color);
}

.sidebar-menu .icon {
    margin-right: 10px;
    font-size: 16px;
}

/* Menu Groups with Submenus */
.menu-group {
    margin-bottom: 2px;
}

.menu-group-toggle {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
    cursor: pointer;
    position: relative;
}

.menu-group-toggle:hover {
    background: rgba(108, 92, 231, 0.15);
    color: var(--secondary-color);
}

.menu-group.open > .menu-group-toggle {
    background: rgba(108, 92, 231, 0.1);
    color: var(--secondary-color);
}

.menu-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.menu-group.open .menu-arrow {
    transform: rotate(180deg);
}

/* Submenu */
.submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
}

.menu-group.open .submenu {
    max-height: 500px;
}

.submenu li {
    margin-bottom: 0;
}

.submenu a {
    padding: 8px 15px 8px 42px;
    font-size: 13px;
    border-left: none !important;
}

.submenu a:hover,
.submenu a.active {
    background: rgba(108, 92, 231, 0.25);
    border-left: none !important;
}

.submenu a.active {
    color: var(--secondary-color);
    background: rgba(108, 92, 231, 0.3);
}

.submenu .icon {
    font-size: 12px;
    opacity: 0.7;
}

/* Menu Spacer */
.menu-spacer {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 15px 10px;
}

.main-content {
    flex: 1;
    margin-left: 220px;
    margin-right: 0;
    padding: 15px;
    width: auto;
    max-width: 100%;
}

/* Content */
.content {
    width: 100%;
    max-width: none;
    margin: 0;
}

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

.content-header h1 {
    font-size: 22px;
    color: var(--text-dark);
}

.actions {
    display: flex;
    gap: 10px;
}

/* Cards */
.card {
    background: white;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 15px;
}

.card-header {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.card-header h3 {
    font-size: 16px;
    color: var(--text-dark);
}

.card-body {
    padding: 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.stat-card h3 {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 6px;
}

.stat-card .number {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-dark);
}

/* Help System - Tooltips */
.help-icon {
    color: var(--primary-color);
    font-size: 14px;
    margin-left: 5px;
    cursor: help;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.help-icon:hover {
    opacity: 1;
}

.tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.tooltip-text {
    visibility: hidden;
    width: 250px;
    background-color: #2d3748;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -125px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #2d3748 transparent transparent transparent;
}

.tooltip-wrapper:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.form-actions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

small {
    font-size: 12px;
    color: var(--text-light);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #5b4bc4;
}

.btn-secondary {
    background: var(--text-light);
    color: white;
}

.btn-secondary:hover {
    background: #5a6a7d;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 13px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th {
    text-align: left;
    padding: 10px;
    background: var(--light-bg);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-light);
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}

.table tr:hover {
    background: var(--light-bg);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
}

.badge-primary {
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary-color);
}

.badge-secondary {
    background: rgba(113, 128, 150, 0.1);
    color: var(--text-light);
}

.badge-success {
    background: rgba(72, 187, 120, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(237, 137, 54, 0.1);
    color: var(--warning);
}

.badge-danger {
    background: rgba(245, 101, 101, 0.1);
    color: var(--danger);
}

/* Alerts */
.alert {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
}

.alert-success {
    background: rgba(72, 187, 120, 0.1);
    color: var(--success);
    border-left: 3px solid var(--success);
}

.alert-error,
.alert-danger {
    background: rgba(245, 101, 101, 0.1);
    color: var(--danger);
    border-left: 3px solid var(--danger);
}

.alert-info {
    background: rgba(66, 153, 225, 0.1);
    color: #2c5282;
    border-left: 3px solid #4299e1;
}

/* Search Bar */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-bar input {
    flex: 1;
}

/* Filters */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.filters select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

/* Info Tables - for prospect/contact detail views */
.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table tr {
    border-bottom: 1px solid var(--border-color);
}

.info-table tr:last-child {
    border-bottom: none;
}

.info-table th {
    text-align: left;
    padding: 10px 15px 10px 0;
    font-weight: 600;
    color: var(--text-light);
    font-size: 13px;
    width: 140px;
    vertical-align: top;
}

.info-table td {
    text-align: left;
    padding: 10px 0;
    color: var(--text-dark);
    font-size: 14px;
}

/* Grid layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

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

/* Data tables - for list views with sortable columns */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    text-align: left;
    padding: 12px;
    background: var(--light-bg);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-light);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.data-table tr:hover {
    background: var(--light-bg);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.text-muted {
    color: var(--text-light);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.mt-1 { margin-top: 10px; }
.mb-1 { margin-bottom: 10px; }
.mt-2 { margin-top: 20px; }
.mb-2 { margin-bottom: 20px; }

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }

    .sidebar-brand h2,
    .sidebar-brand p,
    .sidebar-menu span:not(.icon) {
        display: none;
    }

    .main-content {
        margin-left: 60px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   LEAD NOTIFICATION SYSTEM
   ===================================================== */

.notification-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.notification-bell {
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text-light);
    font-size: 18px;
    transition: all 0.2s ease;
}

.notification-bell:hover {
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary-color);
}

.notification-bell.has-notifications {
    color: var(--primary-color);
}

/* Bell ring animation */
.notification-bell.ring {
    animation: ring 0.5s ease-in-out;
}

@keyframes ring {
    0%, 100% { transform: rotate(0); }
    10%, 30%, 50%, 70%, 90% { transform: rotate(-10deg); }
    20%, 40%, 60%, 80% { transform: rotate(10deg); }
}

/* Badge */
.notification-badge {
    position: absolute;
    top: 2px;
    right: 6px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Mute button */
.notification-mute {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    color: var(--text-light);
    font-size: 14px;
    transition: all 0.2s ease;
}

.notification-mute:hover {
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary-color);
}

.notification-mute.muted {
    color: var(--danger);
}

/* Dropdown */
.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.notification-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

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

.notification-header strong {
    color: var(--text-dark);
    font-size: 14px;
}

.mark-read-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.mark-read-btn:hover {
    background: rgba(108, 92, 231, 0.1);
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-empty {
    padding: 30px 16px;
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.notification-item:hover {
    background: var(--light-bg);
}

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

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

.notification-icon.hot {
    background: rgba(245, 101, 101, 0.15);
    color: var(--danger);
}

.notification-icon.warm {
    background: rgba(237, 137, 54, 0.15);
    color: var(--warning);
}

.notification-icon.cold {
    background: rgba(72, 187, 120, 0.15);
    color: var(--success);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 2px;
}

.lead-score {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

.lead-score.hot {
    background: rgba(245, 101, 101, 0.15);
    color: var(--danger);
}

.lead-score.warm {
    background: rgba(237, 137, 54, 0.15);
    color: var(--warning);
}

.lead-score.cold {
    background: rgba(72, 187, 120, 0.15);
    color: var(--success);
}

.notification-meta .source {
    font-size: 11px;
    color: var(--text-light);
}

.notification-time {
    font-size: 11px;
    color: var(--text-light);
}

.notification-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.notification-footer a {
    color: var(--primary-color);
    font-size: 12px;
    text-decoration: none;
}

.notification-footer a:hover {
    text-decoration: underline;
}

/* Mobile adjustments for notifications */
@media (max-width: 768px) {
    .notification-dropdown {
        width: 280px;
        right: -10px;
    }
}
