/* Make modals wider */
#prospect-modal .modal-container,
#contact-modal .modal-container,
#company-modal .modal-container {
    max-width: 700px;
    width: 100%;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border: 1px solid #e1e8ef;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.stat-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.stat-primary .stat-icon {
    background: #3b82f6;
}

.stat-success .stat-icon {
    background: #10b981;
}

.stat-info .stat-icon {
    background: #8b5cf6;
}

.stat-warning .stat-icon {
    background: #f59e0b;
}

.stat-danger .stat-icon {
    background: #ef4444;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-change {
    font-size: 12px;
    color: #64748b;
}

.dashboard-card {
    background: white;
    border: 1px solid #e1e8ef;
    border-radius: 8px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e1e8ef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.card-body {
    padding: 20px;
}

.pipeline-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.pipeline-stage {
    text-align: center;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
}

.stage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.stage-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stage-count {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.stage-value {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}

.win-rate-container {
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
}

.progress-bar {
    height: 8px;
    background: #e1e8ef;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #e1e8ef;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
}

.activity-icon.type-call {
    background: #3b82f6;
}

.activity-icon.type-email {
    background: #8b5cf6;
}

.activity-icon.type-meeting {
    background: #10b981;
}

.activity-icon.type-note {
    background: #f59e0b;
}

.activity-details {
    flex: 1;
}

.activity-subject {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 2px;
}

.activity-meta {
    font-size: 12px;
    color: #64748b;
}

.action-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #e1e8ef;
}

.action-item:last-child {
    border-bottom: none;
}

.action-priority {
    flex-shrink: 0;
    width: 4px;
    border-radius: 2px;
}

.action-priority.overdue {
    background: #ef4444;
}

.action-priority.today {
    background: #f59e0b;
}

.action-priority.upcoming {
    background: #3b82f6;
}

.action-content {
    flex: 1;
}

.action-description {
    font-size: 14px;
    color: #0f172a;
    margin-bottom: 2px;
}

.action-contact {
    font-size: 12px;
    color: #64748b;
}

.quote-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.quote-stat {
    text-align: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.quote-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.quote-value {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.quick-actions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-actions-horizontal {
    flex-direction: row;
    gap: 16px;
}

.quick-action-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e1e8ef;
    border-radius: 6px;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.quick-action-item:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
    transform: translateY(-2px);
}

.quick-action-item.quick-action-primary {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
    font-weight: 600;
}

.quick-action-item.quick-action-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.quick-action-item i {
    font-size: 16px;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-container {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-container.modal-lg {
    max-width: 800px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e1e8ef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #0f172a;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e1e8ef;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.form-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 24px 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e1e8ef;
}

.form-section-title:first-child {
    margin-top: 0;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 6px;
}

.form-label.required::after {
    content: " *";
    color: #ef4444;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    color: #0f172a;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Autocomplete Styles */
.autocomplete-input {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #cbd5e1;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: none;
}

.autocomplete-results.active {
    display: block;
}

.autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: #f8fafc;
}

.autocomplete-item.create-new {
    background: #f0f9ff;
    color: #0369a1;
    font-weight: 500;
    border-top: 2px solid #e0f2fe;
}

.autocomplete-item.create-new:hover {
    background: #e0f2fe;
}

.autocomplete-item.create-new i {
    margin-right: 6px;
    color: #0ea5e9;
}

.autocomplete-no-results {
    padding: 12px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

.autocomplete-item-name {
    font-weight: 500;
    color: #0f172a;
}

.autocomplete-item-meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

/* File Upload Styles */
.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e1e8ef;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.file-item:hover {
    background: #f1f5f9;
}

.file-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.file-item-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e1e8ef;
    border-radius: 6px;
    color: #64748b;
    font-size: 18px;
}

.file-item-details {
    flex: 1;
    min-width: 0;
}

.file-item-name {
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item-size {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.file-item-remove {
    flex-shrink: 0;
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.file-item-remove:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Dashboard Charts Grid */
.dashboard-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.chart-wrapper-dashboard {
    position: relative;
    height: 280px;
}

@media (max-width: 768px) {
    .dashboard-charts-grid {
        grid-template-columns: 1fr;
    }
}

/* Section heading for grouped dashboard rows (e.g. Account Health) */
.dashboard-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 14px 0;
}
