@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Rubik:wght@500;600;700&display=swap');

:root {
    --primary: #222222;
    --primary-hover: #000000;
    --primary-light: #f5f5f5;
    --bg: #f7f7f7;
    --surface: #ffffff;
    --surface-hover: #fafafa;
    --border: #e4e4e4;
    --success: #059669;
    --warning: #d97706;
    --danger: #e35252;
    --info: #0284c7;
    --stage-new: #555555;
    --stage-qualifying: #0891b2;
    --stage-proposal: #0d9488;
    --stage-negotiation: #d97706;
    --stage-won: #059669;
    --stage-lost: #999999;
    --text-primary: #222222;
    --text-secondary: #555555;
    --text-muted: #999999;
    --sidebar-width: 240px;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.page-title,
.sidebar-brand {
    font-family: 'Rubik', sans-serif;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--primary);
    color: #fff;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand img {
    height: 28px;
    width: auto;
}

.sidebar-brand .brand-text {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.7;
}

.sidebar-nav {
    padding: 0.5rem 0;
}

.sidebar-nav .nav-link {
    color: rgba(255,255,255,0.65);
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    font-weight: 400;
    border-radius: 0;
    transition: all 0.15s ease;
    letter-spacing: 0.01em;
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.12);
    font-weight: 600;
}

.sidebar-nav .nav-link .badge {
    font-size: 0.7rem;
}

.nav-divider {
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 0.5rem 0;
}

.nav-section-label {
    color: rgba(255,255,255,0.35);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.75rem 1rem 0.25rem;
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 0.5rem;
}

.sidebar-footer .nav-link {
    color: rgba(255,255,255,0.65);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
}

.sidebar-footer .nav-link:hover {
    color: #fff;
}

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    background: var(--bg);
    min-height: 100vh;
}

.top-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.content-area {
    padding: 1.5rem;
}

/* Cards */
.card {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.875rem;
}

/* Stats cards */
.stat-card {
    text-align: center;
    padding: 1.25rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Pipeline columns */
.pipeline-container {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.pipeline-column {
    min-width: 250px;
    flex: 1;
}

.pipeline-header {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem 0.375rem 0 0;
    color: #fff;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.deal-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    transition: box-shadow 0.15s ease;
}

.deal-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.deal-card .deal-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.deal-card .deal-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.deal-card .deal-value {
    font-weight: 700;
    color: var(--success);
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.25;
}

.empty-state h5 {
    color: var(--text-secondary);
    font-weight: 600;
}

.empty-state p {
    max-width: 400px;
    margin: 0 auto;
    font-size: 0.9rem;
}

/* Sentiment badges */
.badge-positive { background: var(--success); }
.badge-neutral { background: var(--text-muted); }
.badge-negative { background: var(--danger); }
.badge-mixed { background: var(--warning); }

/* Confidence dots */
.confidence-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.confidence-high { background: var(--success); }
.confidence-medium { background: var(--warning); }
.confidence-low { background: var(--danger); }

/* Login page */
.login-container {
    max-width: 380px;
    margin: 100px auto;
    padding: 0 1rem;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 2.5rem 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.login-card .login-logo {
    display: block;
    margin: 0 auto 1.5rem;
    height: 50px;
    width: auto;
}

.login-card h1 {
    font-family: 'Rubik', sans-serif;
    font-size: 1.25rem;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.75rem;
}

/* Buttons — CVXCA style */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Form controls */
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(34,34,34,0.1);
}

/* Table */
.table th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom-width: 1px;
}

.table td {
    font-size: 0.875rem;
    vertical-align: middle;
}

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: block !important;
    }
}

/* Activity type buttons */
.activity-type {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
}
.activity-type.active {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}

/* Follow-up overdue */
.border-warning {
    border-color: var(--warning) !important;
    border-width: 2px !important;
}

/* Pipeline value display */
.pipeline-header .pipeline-value {
    font-size: 0.7rem;
    opacity: 0.85;
}

/* Toast animation */
.toast {
    animation: slideIn 0.3s ease;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Search results dropdown */
#search-results {
    max-height: 300px;
    overflow-y: auto;
}
#search-results .dropdown-item:hover {
    background: var(--primary-light);
}

/* Bulk action checkbox */
.bulk-check {
    width: 16px;
    height: 16px;
}

/* Priority badges */
.badge.bg-danger { font-size: 0.7rem; }
.badge.bg-secondary { font-size: 0.7rem; }

/* Activity freshness dots */
.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.activity-green { background: var(--success); }
.activity-yellow { background: var(--warning); }
.activity-red { background: var(--danger); }
.activity-gray { background: var(--text-muted); }

/* Deal priority indicators */
.deal-priority-high {
    border-left: 3px solid var(--danger) !important;
}
.deal-priority-low {
    border-left: 3px solid var(--text-muted) !important;
}

/* Utilities */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
