/* WAY Modal System - Dark Theme */

/* ВАЖНО: Не используем класс .way-modal для position/display,
   так как Bootstrap модалки используют свою структуру */

/* ВАЖНО: Не используем класс .way-modal для position/display,
   так как Bootstrap модалки используют свою структуру */

/* Backdrop для кастомных модалок (не Bootstrap) */
.way-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

/* Container для кастомных модалок (не Bootstrap) */

.way-modal-container {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    background: #1a1a1a;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.way-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.way-modal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.way-modal-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.way-modal-title-group {
    flex: 1;
    min-width: 0;
}

.way-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.way-modal-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2px;
}

.way-modal-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.way-modal-status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Quick Actions */
.way-modal-quick-actions {
    display: flex;
    gap: 8px;
}

.way-modal-quick-action {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.way-modal-quick-action:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.way-modal-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.way-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Tabs */
.way-modal-tabs {
    background: #2d2d2d;
    border-bottom: 1px solid #3d3d3d;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.way-modal-tab {
    padding: 14px 20px;
    background: none;
    border: none;
    color: #888;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.way-modal-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.way-modal-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

/* Body */
.way-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #1a1a1a;
    color: #fff;
}

.way-modal-body::-webkit-scrollbar {
    width: 8px;
}

.way-modal-body::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.way-modal-body::-webkit-scrollbar-thumb {
    background: #3d3d3d;
    border-radius: 4px;
}

.way-modal-body::-webkit-scrollbar-thumb:hover {
    background: #4d4d4d;
}

/* Tab Content Styles */
.way-modal-body h3 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.way-modal-body p {
    color: #ccc;
    line-height: 1.6;
}

.way-modal-body .info-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #2d2d2d;
}

.way-modal-body .info-label {
    color: #888;
    min-width: 120px;
    font-size: 0.9rem;
}

.way-modal-body .info-value {
    color: #fff;
    font-size: 0.9rem;
}

.way-modal-body .info-value a {
    color: #667eea;
    text-decoration: none;
}

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

/* Loading */
.way-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #888;
}

.way-modal-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #3d3d3d;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile */
@media (max-width: 768px) {
    .way-modal-container {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .way-modal-header {
        padding: 16px;
    }
    
    .way-modal-title {
        font-size: 1.1rem;
    }
    
    .way-modal-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .way-modal-quick-actions {
        gap: 4px;
    }
    
    .way-modal-quick-action {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .way-modal-tabs {
        overflow-x: auto;
    }
    
    .way-modal-tab {
        padding: 12px 16px;
        font-size: 0.85rem;
    }
    
    .way-modal-body {
        padding: 16px;
    }
    
    .way-modal-body .info-row {
        flex-direction: column;
        gap: 4px;
    }
    
    .way-modal-body .info-label {
        min-width: auto;
        font-weight: 600;
    }
}

/* Bootstrap Modal Dark Theme Override */
.modal-content {
    background: linear-gradient(135deg, #2d2d2d 0%, #252525 100%);
    border: 1px solid #3d3d3d;
    color: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    border-bottom: 1px solid #3d3d3d;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 24px;
    position: relative;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
}

.modal-title {
    color: #fff;
    font-weight: 700;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-title .entity-icon {
    font-size: 1.5rem;
}

.modal-title .entity-id {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 500;
}

.modal-title-container {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.entity-status {
    display: flex;
    align-items: center;
}

.entity-status .badge {
    padding: 6px 14px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.modal-body {
    background: #1a1a1a;
    color: #fff;
    padding: 0;
}

.modal-footer {
    border-top: 1px solid #3d3d3d;
    background: #2d2d2d;
    padding: 16px 24px;
}

.btn-close {
    filter: invert(1) brightness(100);
    opacity: 0.8;
    transition: all 0.2s;
}

.btn-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Quick Actions in Header */
.quick-actions-header {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.quick-action-btn {
    padding: 10px 18px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.quick-action-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.3s;
}

.quick-action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.quick-action-btn:hover::before {
    opacity: 1;
}

.quick-action-btn:active {
    transform: translateY(-1px);
}

.quick-action-btn span:first-child {
    font-size: 1.2rem;
    position: relative;
    z-index: 1;
}

.quick-action-btn span:last-child {
    position: relative;
    z-index: 1;
}

/* Цветные варианты кнопок */
.quick-action-btn.btn-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(5, 150, 105, 0.3));
    border-color: rgba(16, 185, 129, 0.5);
}

.quick-action-btn.btn-success:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.5), rgba(5, 150, 105, 0.5));
    border-color: rgba(16, 185, 129, 0.7);
}

.quick-action-btn.btn-primary {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(37, 99, 235, 0.3));
    border-color: rgba(59, 130, 246, 0.5);
}

.quick-action-btn.btn-primary:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.5), rgba(37, 99, 235, 0.5));
    border-color: rgba(59, 130, 246, 0.7);
}

.quick-action-btn.btn-info {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.3), rgba(8, 145, 178, 0.3));
    border-color: rgba(6, 182, 212, 0.5);
}

.quick-action-btn.btn-info:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.5), rgba(8, 145, 178, 0.5));
    border-color: rgba(6, 182, 212, 0.7);
}

.quick-action-btn.btn-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.3));
    border-color: rgba(245, 158, 11, 0.5);
}

.quick-action-btn.btn-warning:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.5), rgba(217, 119, 6, 0.5));
    border-color: rgba(245, 158, 11, 0.7);
}

/* Modal Tabs Navigation - Segmented Control Style */
.modal-tabs-nav {
    background: #1a1a1a;
    border-bottom: none;
    padding: 16px 24px;
    display: flex;
    justify-content: center;
}

.modal-tabs-nav .nav-tabs {
    border-bottom: none;
    background: #2d2d2d;
    border-radius: 14px;
    padding: 4px;
    display: inline-flex;
    gap: 0;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid #3d3d3d;
    position: relative;
}

.modal-tabs-nav .nav-link {
    color: #888;
    border: none;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border-radius: 10px;
    position: relative;
    z-index: 1;
    min-width: 140px;
    justify-content: center;
}

.modal-tabs-nav .nav-link:hover {
    color: #fff;
}

.modal-tabs-nav .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.modal-tabs-nav .nav-link i {
    font-size: 1.1rem;
    transition: transform 0.3s;
}

.modal-tabs-nav .nav-link.active i {
    transform: scale(1.1);
}

/* Tab Content */
.tab-content {
    padding: 24px;
    min-height: 300px;
    background: #1a1a1a;
}

.tab-pane {
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .modal-tabs-nav {
        padding: 12px 16px;
    }
    
    .modal-tabs-nav .nav-tabs {
        width: 100%;
        display: flex;
        padding: 3px;
    }
    
    .modal-tabs-nav .nav-link {
        flex: 1;
        min-width: 0;
        padding: 10px 12px;
        font-size: 0.8rem;
    }
    
    .modal-tabs-nav .nav-link span {
        display: none;
    }
    
    .modal-tabs-nav .nav-link i {
        font-size: 1.3rem;
        margin: 0;
    }
}
.modal .form-control,
.modal .form-select {
    background: #1a1a1a;
    border-color: #3d3d3d;
    color: #fff;
}

.modal .form-control:focus,
.modal .form-select:focus {
    background: #1a1a1a;
    border-color: #667eea;
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.modal .form-control::placeholder {
    color: #666;
}

.modal .form-label {
    color: #aaa;
    font-weight: 500;
}

.modal .form-select option {
    background: #1a1a1a;
    color: #fff;
}

/* Tabs in modals */
.modal .nav-tabs {
    border-bottom: 1px solid #3d3d3d;
    background: #1a1a1a;
}

.modal .nav-tabs .nav-link {
    color: #888;
    border: none;
    border-bottom: 2px solid transparent;
}

.modal .nav-tabs .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.modal .nav-tabs .nav-link.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    border-bottom-color: #667eea;
}

/* Tables in modals */
.modal .table {
    color: #ddd;
}

.modal .table thead th {
    background: #1a1a1a;
    border-bottom: 2px solid #3d3d3d;
    color: #aaa;
}

.modal .table tbody tr {
    background: #2d2d2d;
}

.modal .table tbody tr:hover {
    background: #3d3d3d;
}

.modal .table tbody td {
    border-bottom: 1px solid #3d3d3d;
    color: #ddd;
}

/* Cards in modals */
.modal .card {
    background: #1a1a1a;
    border-color: #3d3d3d;
    color: #fff;
}

.modal .card-body {
    background: #1a1a1a;
}

/* Badges in modals */
.modal .badge {
    font-weight: 600;
}

/* Alerts in modals */
.modal .alert {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    color: #fff;
}

.modal .alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.modal .alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

.modal .alert-warning {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
}

/* Text colors */
.modal .text-muted {
    color: #aaa !important;
}

/* Links */
.modal a {
    color: #667eea;
}

.modal a:hover {
    color: #7c8ef5;
}

/* Buttons */
.modal .btn-primary {
    background: #667eea;
    border-color: #667eea;
}

.modal .btn-primary:hover {
    background: #5568d3;
    border-color: #4c5fc7;
}

.modal .btn-secondary {
    background: #3d3d3d;
    border-color: #3d3d3d;
    color: #fff;
}

.modal .btn-secondary:hover {
    background: #4d4d4d;
    border-color: #4d4d4d;
}

.modal .btn-success {
    background: #22c55e;
    border-color: #22c55e;
}

.modal .btn-success:hover {
    background: #16a34a;
    border-color: #15803d;
}

.modal .btn-danger {
    background: #ef4444;
    border-color: #ef4444;
}

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

.modal .btn-warning {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #000;
}

.modal .btn-warning:hover {
    background: #d97706;
    border-color: #b45309;
}

.modal .btn-info {
    background: #3b82f6;
    border-color: #3b82f6;
}

.modal .btn-info:hover {
    background: #2563eb;
    border-color: #1d4ed8;
}

.modal .btn-outline-primary {
    color: #667eea;
    border-color: #667eea;
}

.modal .btn-outline-primary:hover {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

.modal .btn-outline-secondary {
    color: #aaa;
    border-color: #3d3d3d;
}

.modal .btn-outline-secondary:hover {
    background: #3d3d3d;
    border-color: #3d3d3d;
    color: #fff;
}

/* Spinner */
.modal .spinner-border {
    color: #667eea;
}

/* Scrollbar for modal body */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #3d3d3d;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #667eea;
}

/* Lead Info Container */
.lead-info-container h6 {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lead-info-container .table {
    background: transparent;
    margin-bottom: 0;
}

.lead-info-container .table td {
    padding: 12px 8px;
    border-bottom: 1px solid #3d3d3d;
    vertical-align: middle;
}

.lead-info-container .table td:first-child {
    color: #888;
    font-weight: 600;
}

.lead-info-container .table td:last-child {
    color: #fff;
}

.lead-info-container .card {
    background: #2d2d2d;
    border: 1px solid #3d3d3d;
    border-radius: 12px;
}

.lead-info-container .card-body {
    padding: 16px;
    color: #ccc;
}

.lead-info-container .badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
}

.lead-info-container .btn {
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 600;
}

/* Tasks List */
.tasks-list .card {
    background: #2d2d2d;
    border: 1px solid #3d3d3d;
    border-radius: 12px;
    transition: all 0.2s;
}

.tasks-list .card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.tasks-list .card-body {
    padding: 16px;
}

.tasks-list h6 {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.tasks-list small {
    color: #888;
    font-size: 0.8rem;
}

.tasks-list .badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
}

/* Comments Section */
#lead-comments-container {
    min-height: 200px;
}

.comment-item {
    background: #2d2d2d;
    border: 1px solid #3d3d3d;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.comment-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

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

.comment-author {
    font-weight: 700;
    color: #fff;
    font-size: 0.95rem;
}

.comment-date {
    color: #888;
    font-size: 0.8rem;
}

.comment-text {
    color: #ccc;
    line-height: 1.6;
    font-size: 0.9rem;
}

.comment-form {
    background: #2d2d2d;
    border: 1px solid #3d3d3d;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

.comment-form textarea {
    background: #1a1a1a;
    border: 2px solid #3d3d3d;
    border-radius: 10px;
    color: #fff;
    padding: 12px;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 100px;
    transition: all 0.2s;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.comment-form textarea::placeholder {
    color: #666;
}

.comment-form .btn {
    margin-top: 12px;
}

/* History Timeline */
.history-timeline {
    position: relative;
    padding-left: 40px;
}

.history-timeline::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

.history-item {
    position: relative;
    padding-bottom: 24px;
}

.history-item:last-child {
    padding-bottom: 0;
}

.history-icon {
    position: absolute;
    left: -32px;
    top: 0;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.history-item strong {
    color: #fff;
    font-weight: 600;
}

.history-item p {
    color: #ccc;
    margin-top: 4px;
    font-size: 0.9rem;
}

.history-item small {
    color: #888;
    font-size: 0.8rem;
}

/* Empty States */
.text-center.py-5 {
    padding: 60px 20px !important;
}

.text-center.py-5 i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 16px;
}

.text-center.py-5 p {
    color: #888;
    font-size: 1rem;
    margin-bottom: 16px;
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1.5rem;
    height: 1.5rem;
    border-width: 0.2em;
}

/* Mobile Optimization for Modal */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100%;
    }
    
    .modal-content {
        height: 100%;
        border-radius: 0;
    }
    
    .modal-header {
        padding: 16px;
        flex-wrap: wrap;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-title .entity-icon {
        font-size: 1.2rem;
    }
    
    .modal-title .entity-id {
        font-size: 0.8rem;
    }
    
    .modal-title-container {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .quick-actions-header {
        width: 100%;
        margin-top: 12px;
        gap: 6px;
    }
    
    .quick-action-btn {
        flex: 1;
        min-width: 0;
        padding: 10px 12px;
        font-size: 0.8rem;
        justify-content: center;
    }
    
    .quick-action-btn span:last-child {
        display: none;
    }
    
    .quick-action-btn span:first-child {
        font-size: 1.3rem;
    }
    
    .modal-tabs-nav .nav-link {
        padding: 14px 16px;
        font-size: 0.85rem;
    }
    
    .tab-content {
        padding: 16px;
    }
    
    .lead-info-container .row {
        margin: 0;
    }
    
    .lead-info-container .col-md-6 {
        padding: 0;
        margin-bottom: 24px;
    }
    
    .lead-info-container .table td {
        padding: 10px 4px;
        font-size: 0.85rem;
    }
    
    .lead-info-container .table td:first-child {
        width: 100px;
    }
    
    .lead-info-container .btn {
        font-size: 0.8rem;
        padding: 8px 12px;
    }
    
    .history-timeline {
        padding-left: 32px;
    }
    
    .history-icon {
        left: -28px;
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .modal-footer {
        padding: 12px 16px;
    }
    
    .modal-footer .btn {
        flex: 1;
    }
}

/* iOS Specific Fixes */
@supports (-webkit-touch-callout: none) {
    .modal-content {
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-body {
        -webkit-overflow-scrolling: touch;
    }
    
    .comment-form textarea,
    .modal input,
    .modal select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Landscape Mode on Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-header {
        padding: 12px 16px;
    }
    
    .quick-actions-header {
        margin-top: 8px;
    }
    
    .modal-tabs-nav .nav-link {
        padding: 10px 14px;
    }
    
    .tab-content {
        padding: 12px;
    }
}

/* Quick Action Buttons in Lead Info */
.lead-info-container .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    filter: brightness(1.2);
}

.lead-info-container .btn:active {
    transform: translateY(0);
}

/* Edit Button Hover Effect */
.lead-info-container .btn-lg:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
}

.lead-info-container .btn-lg:active {
    transform: translateY(-1px);
}

/* Edit Modal Footer Buttons */
#editLeadModal .modal-footer .btn:hover {
    transform: translateY(-2px);
}

#editLeadModal .modal-footer .btn:active {
    transform: translateY(0);
}

#editLeadModal .modal-footer .btn-secondary:hover {
    background: #4d4d4d !important;
    border-color: #5d5d5d !important;
}

#editLeadModal .modal-footer .btn-primary:hover {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5) !important;
    filter: brightness(1.1);
}

/* Edit Modal Tabs Hover */
#editLeadModal .nav-link:hover {
    filter: brightness(1.2);
}
