/* ============================================
   First Generation Holdings - LP CRM
   ============================================
   Clean, minimalist design with professional
   styling built on Bootstrap 5.
   ============================================ */

/* --- Brand Colors --- */
:root {
    --fgh-navy: #1e3a5f;
    --fgh-navy-dark: #152a45;
    --fgh-navy-light: #2a4a73;
    --fgh-gray-50: #f8fafc;
    --fgh-gray-100: #f1f5f9;
    --fgh-gray-200: #e2e8f0;
    --fgh-gray-300: #cbd5e1;
    --fgh-gray-400: #94a3b8;
    --fgh-gray-500: #64748b;
    --fgh-gray-600: #475569;
    --fgh-gray-700: #334155;
}

/* --- Base Typography --- */
body {
    font-size: 0.875rem;
    color: var(--fgh-gray-700);
    background-color: var(--fgh-gray-50);
}

/* --- Override Bootstrap primary color --- */
.btn-primary {
    background-color: var(--fgh-navy);
    border-color: var(--fgh-navy);
    font-weight: 500;
    font-size: 0.8125rem;
}

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

.btn-outline-primary {
    color: var(--fgh-navy);
    border-color: var(--fgh-navy);
    font-size: 0.8125rem;
}

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

.btn-outline-secondary {
    font-size: 0.8125rem;
    color: var(--fgh-gray-600);
    border-color: var(--fgh-gray-300);
}

.btn-outline-secondary:hover {
    background-color: var(--fgh-gray-100);
    border-color: var(--fgh-gray-300);
    color: var(--fgh-gray-700);
}

.btn-link {
    font-size: 0.8125rem;
    color: var(--fgh-navy);
    text-decoration: none;
}

.btn-link:hover {
    color: var(--fgh-navy-dark);
}

/* --- Navbar --- */
.navbar {
    background-color: var(--fgh-navy) !important;
    padding: 0.5rem 1rem;
}

.navbar-brand img {
    height: 26px;
    width: auto;
}

.navbar .form-control {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 0.8125rem;
}

.navbar .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.navbar .form-control:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: none;
    color: #fff;
}

/* --- Sidebar --- */
#sidebar {
    background-color: #fff;
    border-right: 1px solid var(--fgh-gray-200);
    z-index: 1020;
}

#sidebar .nav-link {
    color: var(--fgh-gray-600);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

#sidebar .nav-link:hover {
    background-color: var(--fgh-gray-100);
    color: var(--fgh-navy);
}

#sidebar .nav-link.active {
    background-color: var(--fgh-navy);
    color: #fff !important;
}

#sidebar .nav-link i {
    font-size: 1rem;
    opacity: 0.8;
}

#sidebar hr {
    border-color: var(--fgh-gray-200);
    margin: 0.75rem 0;
}

/* --- Main content area --- */
main {
    min-width: 0;
    background-color: var(--fgh-gray-50);
}

/* --- Cards --- */
.card {
    border: 1px solid var(--fgh-gray-200);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    background-color: #fff;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid var(--fgh-gray-100);
    padding: 0.875rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- Stat Cards --- */
.stat-card {
    border: 1px solid var(--fgh-gray-200);
    transition: box-shadow 0.2s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-card-alert {
    border-color: #fecaca;
    background-color: #fef2f2;
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.stat-icon-primary {
    background-color: rgba(30, 58, 95, 0.1);
    color: var(--fgh-navy);
}

.stat-icon-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.stat-icon-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.stat-icon-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.stat-icon-muted {
    background-color: var(--fgh-gray-100);
    color: var(--fgh-gray-400);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--fgh-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--fgh-gray-700);
    line-height: 1.2;
}

/* --- Quick Actions --- */
.quick-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-actions-divider {
    width: 1px;
    height: 20px;
    background-color: var(--fgh-gray-300);
    margin: 0 0.5rem;
}

.quick-action-link {
    font-size: 0.8125rem;
    color: var(--fgh-gray-500);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
}

.quick-action-link:hover {
    color: var(--fgh-navy);
}

/* --- Section Headers --- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--fgh-gray-700);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

/* --- Pipeline Legend --- */
.pipeline-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pipeline-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.pipeline-item:hover {
    background-color: var(--fgh-gray-100);
}

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

.pipeline-dot-prospect { background-color: #6b7280; }
.pipeline-dot-contacted { background-color: #06b6d4; }
.pipeline-dot-in_discussion { background-color: #eab308; }
.pipeline-dot-due_diligence { background-color: #f97316; }
.pipeline-dot-committed { background-color: #22c55e; }
.pipeline-dot-current_lp { background-color: var(--fgh-navy); }
.pipeline-dot-dormant { background-color: #9ca3af; }
.pipeline-dot-declined { background-color: #ef4444; }

.pipeline-label {
    font-size: 0.75rem;
    color: var(--fgh-gray-600);
}

.pipeline-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--fgh-gray-500);
}

/* --- Pipeline Progress Bar Colors --- */
.bg-pipeline-prospect { background-color: #6b7280 !important; }
.bg-pipeline-contacted { background-color: #06b6d4 !important; }
.bg-pipeline-in_discussion { background-color: #eab308 !important; }
.bg-pipeline-due_diligence { background-color: #f97316 !important; }
.bg-pipeline-committed { background-color: #22c55e !important; }
.bg-pipeline-current_lp { background-color: var(--fgh-navy) !important; }
.bg-pipeline-dormant { background-color: #9ca3af !important; }
.bg-pipeline-declined { background-color: #ef4444 !important; }

/* --- Pipeline Stage Badges (for other pages) --- */
.badge-prospect { background-color: #6b7280; }
.badge-contacted { background-color: #06b6d4; }
.badge-in_discussion { background-color: #eab308; color: #000; }
.badge-due_diligence { background-color: #f97316; }
.badge-committed { background-color: #22c55e; }
.badge-current_lp { background-color: var(--fgh-navy); }
.badge-dormant { background-color: #9ca3af; }
.badge-declined { background-color: #ef4444; }

/* --- Activity List --- */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-item {
    display: flex;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--fgh-gray-100);
}

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

.activity-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
    background-color: var(--fgh-gray-100);
    color: var(--fgh-gray-500);
}

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

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

.activity-contact {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--fgh-gray-700);
    text-decoration: none;
}

.activity-contact:hover {
    color: var(--fgh-navy);
}

.activity-date {
    font-size: 0.75rem;
    color: var(--fgh-gray-400);
}

.activity-subject {
    font-size: 0.8125rem;
    color: var(--fgh-gray-500);
}

/* --- Tables --- */
.table {
    font-size: 0.8125rem;
}

.table th {
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fgh-gray-500);
    border-bottom: 1px solid var(--fgh-gray-200);
    padding: 0.625rem 1rem;
    background-color: var(--fgh-gray-50);
}

.table td {
    padding: 0.625rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--fgh-gray-100);
    color: var(--fgh-gray-600);
}

.table-hover tbody tr:hover {
    background-color: var(--fgh-gray-50);
}

/* Allow dropdown menus to overflow table-responsive containers */
.table-responsive {
    overflow: visible;
}

/* Row action menu styling */
.table .dropdown-toggle::after {
    display: none; /* Hide the default caret */
}

.table .btn-link {
    line-height: 1;
}

/* --- Empty States --- */
.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--fgh-gray-400);
}

/* Large icon above the message - but NOT icons inside buttons */
.empty-state > i {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    display: block;
}

.empty-state p {
    font-size: 0.8125rem;
    margin: 0;
}

/* Ensure buttons in empty-state look consistent with other pages */
.empty-state .btn {
    margin-top: 1rem;
}

.empty-state .btn i {
    display: inline-block;
    font-size: inherit;
    margin-bottom: 0;
}

/* --- Links --- */
a {
    color: var(--fgh-navy);
}

a:hover {
    color: var(--fgh-navy-dark);
}

/* --- Priority badges --- */
.badge-low { background-color: var(--fgh-gray-400); }
.badge-medium { background-color: #06b6d4; }
.badge-high { background-color: #f97316; }
.badge-urgent { background-color: #ef4444; }

/* --- Login page styling --- */
.login-card {
    max-width: 380px;
    margin: 0 auto;
}

.login-logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 1.25rem;
}

/* --- Form focus states --- */
.form-control, .form-select {
    font-size: 0.875rem;
    border-color: var(--fgh-gray-300);
}

.form-control:focus, .form-select:focus {
    border-color: var(--fgh-navy);
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.1);
}

/* --- Dropdown menus --- */
.dropdown-item {
    font-size: 0.8125rem;
}

.dropdown-item.active, .dropdown-item:active {
    background-color: var(--fgh-navy);
}

/* --- Pagination --- */
.page-link {
    font-size: 0.8125rem;
    color: var(--fgh-navy);
}

.page-item.active .page-link {
    background-color: var(--fgh-navy);
    border-color: var(--fgh-navy);
}

/* --- Alerts --- */
.alert {
    font-size: 0.8125rem;
    border-radius: 6px;
}

/* --- Contact tag pills --- */
.tag-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 500;
    color: #fff;
    margin: 1px 2px;
    background-color: var(--fgh-navy-light);
}

/* --- Timeline styling (for touchpoints) --- */
.timeline-item {
    position: relative;
    padding-left: 24px;
    padding-bottom: 1rem;
    border-left: 2px solid var(--fgh-gray-200);
}

.timeline-item:last-child {
    border-left: 2px solid transparent;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--fgh-navy);
    border: 2px solid #fff;
}

/* --- Badges --- */
.badge {
    font-weight: 500;
    font-size: 0.6875rem;
    padding: 0.25rem 0.5rem;
}

.bg-success-subtle {
    background-color: rgba(34, 197, 94, 0.1) !important;
}

/* --- Print styles --- */
@media print {
    #sidebar, .navbar, .btn, .quick-actions {
        display: none !important;
    }
    main {
        margin-left: 0 !important;
    }
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
