/* =================================================================
   GLOBAL STYLES
================================================================= */
body { 
    font-family: 'Inter', sans-serif; 
    background-color: #f8fafc; /* slate-50 */
    color: #1e293b; /* slate-800 */
}

::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #f8fafc; /* slate-50 */
}
::-webkit-scrollbar-thumb {
    background: #e2e8f0; /* slate-200 */
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1; /* slate-300 */
}

/* =================================================================
   LOGIN & LANDING PAGE STYLES
================================================================= */
.cta-button, .login-button {
    background: linear-gradient(90deg, #4f46e5, #6366f1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.cta-button:hover, .login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.25);
}
.login-button:disabled {
    background: #a5b4fc; /* indigo-300 */
    cursor: not-allowed;
}

.blob-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}
.blob-1 {
    width: 400px;
    height: 400px;
    top: -150px;
    left: -150px;
    background: #a78bfa; /* violet-400 */
    animation: move 20s infinite alternate;
}
.blob-2 {
    width: 300px;
    height: 300px;
    bottom: -100px;
    right: -100px;
    background: #60a5fa; /* blue-400 */
    animation: move 25s infinite alternate-reverse;
}

@keyframes move {
    from { transform: translate(0, 0) rotate(0deg) scale(1); }
    to { transform: translate(100px, 50px) rotate(180deg) scale(1.2); }
}

.form-input {
    background-color: #f1f5f9; /* slate-100 */
    border: 1px solid #e2e8f0; /* slate-200 */
    transition: all 0.2s ease-in-out;
}
.form-input:focus {
    background-color: white;
    border-color: #6366f1; /* indigo-500 */
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    outline: none;
}

.graphic-side {
    background: linear-gradient(135deg, #1e293b, #0f172a);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}


/* =================================================================
   DASHBOARD STYLES
================================================================= */
.sidebar-link { transition: all 0.2s ease-in-out; }
.sidebar-link.active {
    background-color: #f1f5f9; /* slate-100 */
    color: #0f172a; /* slate-900 */
}
.sidebar-link:not(.active):hover { background-color: #f8fafc; /* slate-50 */ }

.logout-btn { transition: background-color 0.2s ease-in-out; }
.logout-btn:hover { background-color: #fee2e2; /* red-100 */ }


/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}
.status-uncontacted { background-color: #e0f2fe; color: #0369a1; }
.status-contacted { background-color: #dbeafe; color: #1d4ed8; }
.status-follow-up { background-color: #fef3c7; color: #b45309; }
.status-converted { background-color: #dcfce7; color: #166534; }
.status-invoice-raised { background-color: #e5e7eb; color: #4b5563; }
.status-paid { background-color: #d1fae5; color: #065f46; }


/* Filter Controls */
.clear-all-btn {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4f46e5; /* indigo-600 */
    background-color: #eef2ff; /* indigo-50 */
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    transition: all 0.2s ease-in-out;
}
.clear-all-btn:hover {
    background-color: #e0e7ff; /* indigo-100 */
    color: #4338ca; /* indigo-700 */
}

.clear-filter-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: #64748b; /* slate-500 */
    background-color: #f1f5f9; /* slate-100 */
    border: 1px solid #e2e8f0; /* slate-200 */
    transition: all 0.15s ease-in-out;
    cursor: pointer;
}
.clear-filter-btn:hover {
    background-color: #e2e8f0; /* slate-200 */
    color: #334155; /* slate-700 */
}

.filter-active {
    border-color: #6366f1 !important; /* indigo-500 */
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background-color: #eef2ff; /* indigo-50 */
    color: #4338ca; /* indigo-700 */
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid #c7d2fe; /* indigo-200 */
}
.active-filter-tag button {
    color: #6366f1; /* indigo-500 */
    transition: color 0.2s ease-in-out;
    background: none; border: none; padding: 0; cursor: pointer; display: flex;
}
.active-filter-tag button:hover { color: #4338ca; /* indigo-700 */ }


/* =================================================================
   DRAWER STYLES
================================================================= */
#drawer { transform: translateX(100%); transition: transform 0.3s ease-in-out; }
#drawer-container:not(.hidden) #drawer { transform: translateX(0); }
#drawer-overlay { opacity: 0; transition: opacity 0.3s ease-in-out; }
#drawer-container:not(.hidden) #drawer-overlay { opacity: 1; }


/* Glowing Status Dot */
.status-glow-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.glow-uncontacted { background-color: #0ea5e9; box-shadow: 0 0 8px #0ea5e9; }
.glow-contacted { background-color: #6366f1; box-shadow: 0 0 8px #6366f1; }
.glow-follow-up { background-color: #facc15; box-shadow: 0 0 8px #facc15; }
.glow-converted { background-color: #22c55e; box-shadow: 0 0 8px #22c55e; }
.glow-invoice-raised { background-color: #6b7280; box-shadow: 0 0 8px #6b7280; }
.glow-paid { background-color: #10b981; box-shadow: 0 0 8px #10b981; }

/* Timeline */
.timeline-item::before {
    content: '';
    position: absolute;
    left: 1rem; /* 16px */
    top: 2.5rem; /* 40px */
    bottom: -1rem; /* -16px */
    width: 2px;
    background-color: #e2e8f0; /* slate-200 */
}
 .timeline-item:last-child::before {
    display: none;
}

/* --- NEW DRAWER TAB STYLES --- */
.drawer-tab {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b; /* slate-500 */
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
}

.drawer-tab:hover:not(:disabled) {
    color: #1e293b; /* slate-800 */
}

.drawer-tab.active {
    color: #4f46e5; /* indigo-600 */
    border-bottom-color: #4f46e5;
}

.drawer-tab:disabled {
    color: #94a3b8; /* slate-400 */
    cursor: not-allowed;
}

.drawer-tab .tab-count {
    margin-left: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: #eef2ff; /* indigo-50 */
    color: #4f46e5; /* indigo-600 */
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.drawer-tab.active .tab-count {
    background-color: #4f46e5;
    color: #fff;
}

.drawer-tab:disabled .tab-count {
    background-color: #f1f5f9; /* slate-100 */
    color: #94a3b8; /* slate-400 */
}

#drawer-tab-content {
    /* Ensures the content area is scrollable and fills the available space */
    height: calc(100% - 41px - 1.5rem); /* Adjust based on tab nav height and padding */
}

.tab-panel {
    height: 100%;
}

.detail-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155; /* slate-700 */
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0; /* slate-200 */
    margin-bottom: 1rem;
}
/* --- END NEW DRAWER TAB STYLES --- */

/* Custom select */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none;
}

/* Copy Button */
.copy-btn {
    opacity: 0.6;
    transition: all 0.2s ease-in-out;
}
.group:hover .copy-btn {
    opacity: 1;
    transform: scale(1.1);
}

/* Toast Notification */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: #0f172a; /* slate-900 */
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem; /* 12px */
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease-out;
}
.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* =================================================================
   GENERAL UI ENHANCEMENTS
================================================================= */

/* Pagination */
.pagination-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-weight: 500; padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0; border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
}
.pagination-btn:hover:not(:disabled) { background-color: #f1f5f9; }
.pagination-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Drawer Details labels */
.detail-label {
    font-size: 0.75rem; color: #64748b; font-weight: 600; text-transform: uppercase;
}
.detail-value { font-size: 0.875rem; color: #1e293b; font-weight: 500; }

/* Modals (e.g., Email, Logout) */
.modal-overlay {
    position: fixed; inset: 0; background-color: rgba(15,23,42,0.6);
    backdrop-filter: blur(4px); z-index: 50; display: flex; justify-content: center; align-items: center;
}
.modal-content {
    background-color: white; padding: 2rem; border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 400px; width: 100%;
}

/* Invoice UI */
.invoice-card {
    border: 1px solid #e2e8f0; /* slate-200 */
    border-radius: 0.5rem;
    background: #fff;
    transition: box-shadow 0.2s ease-in-out;
}
.invoice-card:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
.invoice-link {
    display: inline-flex; align-items: center; gap: 0.375rem;
    font-weight: 600; font-size: 0.875rem;
    color: #4f46e5; /* indigo-600 */
}
.invoice-link:hover { color: #4338ca; /* indigo-700 */ }

.invoice-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.15s ease-in-out;
}
.invoice-input:focus {
    outline: none;
    border-color: #6366f1; /* indigo-500 */
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* Button Classes */
.btn-primary {
    background-color: #4f46e5; color: #fff; font-weight: 600;
    border-radius: 0.375rem; padding: 0.5rem 0.875rem;
    transition: background-color 0.15s ease-in-out, transform 0.15s ease-in-out;
    display: inline-flex; align-items: center; justify-content: center;
}
.btn-primary:hover { background-color: #4338ca; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-ghost {
    background: #f1f5f9; color: #334155;
    border: 1px solid #e2e8f0; border-radius: 0.375rem;
    padding: 0.5rem 0.875rem; font-weight: 600;
    transition: all 0.15s ease-in-out;
    display: inline-flex; align-items: center; justify-content: center;
}
.btn-ghost:hover { background: #e2e8f0; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: #fff;
    color: #334155;
    transition: all 0.2s ease-in-out;
}
.btn-secondary:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

.icon-btn {
    width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 0.375rem; border: 1px solid #e2e8f0; background: #f8fafc; color: #475569;
    transition: all 0.15s ease-in-out;
}
.icon-btn:hover { background: #eef2f7; color: #0f172a; }
