:root {
    --primary: #2d4459;
    --primary-dark: #1e2f3d;
    --primary-light: #3d5a75;
    --success: #22c55e;
    --info: #3b82f6;
    --warning: #eab308;
    --orange: #f97316;
    --danger: #ef4444;
    --purple: #a855f7;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-800: #1f2937;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px 0;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.header nav a {
    color: white;
    text-decoration: none;
    margin-left: 25px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.header nav a:hover {
    opacity: 0.8;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 25px;
    margin-bottom: 25px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--gray-200);
}

.card-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--gray-800);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

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

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

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

.btn-success:hover {
    background-color: #16a34a;
}

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

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-secondary {
    background-color: var(--gray-200);
    color: var(--gray-800);
}

.btn-secondary:hover {
    background-color: var(--gray-300);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--gray-600);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 68, 89, 0.15);
}

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

select.form-control {
    cursor: pointer;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background-color: var(--gray-100);
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-stage-1 { background-color: rgba(34, 197, 94, 0.15); color: #15803d; }
.status-stage-2 { background-color: rgba(59, 130, 246, 0.15); color: #1d4ed8; }
.status-stage-3 { background-color: rgba(234, 179, 8, 0.15); color: #a16207; }
.status-stage-4 { background-color: rgba(249, 115, 22, 0.15); color: #c2410c; }
.status-stage-5 { background-color: rgba(239, 68, 68, 0.15); color: #b91c1c; }
.status-stage-6 { background-color: rgba(168, 85, 247, 0.15); color: #7c3aed; }

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

.filters .form-control {
    width: auto;
    min-width: 200px;
}

/* Client detail sections */
.client-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 0.85rem;
    color: var(--gray-600);
    font-weight: 500;
}

.info-value {
    font-size: 1rem;
    color: var(--gray-800);
}

.info-value a {
    color: var(--primary);
    text-decoration: none;
}

.info-value a:hover {
    text-decoration: underline;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--gray-200);
}

.timeline-item {
    position: relative;
    padding-bottom: 25px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--primary);
}

.timeline-item.phone::before {
    background-color: var(--success);
}

.timeline-item.email::before {
    background-color: var(--info);
}

.timeline-date {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 5px;
}

.timeline-content {
    background: var(--gray-100);
    padding: 15px;
    border-radius: 8px;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-600);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.15);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.15);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--gray-600);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 25px;
}

.tab {
    padding: 12px 25px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-weight: 500;
    color: var(--gray-600);
    transition: all 0.2s;
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Action buttons group */
.action-buttons {
    display: flex;
    gap: 8px;
}

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

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .filters .form-control {
        width: 100%;
    }
    
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .header nav {
        display: flex;
        gap: 15px;
    }
    
    .header nav a {
        margin-left: 0;
    }
}

/* WYSIWYG Editor Styles */
.editor-toolbar {
    display: flex;
    gap: 5px;
    padding: 10px;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    flex-wrap: wrap;
}

.editor-toolbar button {
    padding: 8px 12px;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.editor-toolbar button:hover {
    background: var(--gray-200);
}

.editor-content {
    min-height: 200px;
    padding: 15px;
    border: 1px solid var(--gray-300);
    border-radius: 0 0 8px 8px;
    background: white;
}

.editor-content:focus {
    outline: none;
    border-color: var(--primary);
}
