/* Dialog Overlay */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.dialog-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

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

/* Common Dialog Styles */
.dialog-header {
    padding: 20px 25px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dialog-header .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.dialog-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.dialog-header .header-content {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

.dialog-header .header-content i {
    font-size: 2rem;
    transition: all 0.2s ease;
}

.dialog-header .header-content i:active {
    color: rgba(255, 255, 255, 0.7);
    transform: scale(0.95);
}

.dialog-header .header-text h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.dialog-header .header-text span {
    font-size: 0.9rem;
    opacity: 0.9;
}

.field-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.field-input:focus {
    outline: none;
    border-color: #673AB7;
}

.btn-cancel {
    background: #f1f3f5;
    color: #495057;
    border: none;
    border-radius: 8px;
    padding: 10px 25px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-submit {
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 25px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* RadiologyDialog Styles */
.radiology-dialog {
    width: 1100px;
    height: 90vh;
}

.radiology-dialog .dialog-header {
    background: linear-gradient(135deg, #673AB7 0%, #9575CD 100%);
}

.radiology-dialog .dialog-body {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: calc(90vh - 160px);
    overflow: hidden;
}

.radiology-dialog .studies-panel {
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.radiology-dialog .search-box {
    padding: 15px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 10px;
}

.radiology-dialog .search-box i {
    color: #adb5bd;
}

.radiology-dialog .search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: #2c3e50;
}

.radiology-dialog .search-box input::placeholder {
    color: #adb5bd;
}

.radiology-dialog .studies-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.radiology-dialog .study-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 5px;
    background: white;
    border: 2px solid transparent;
}

.radiology-dialog .study-item:hover {
    background: #f1f3f5;
}

.radiology-dialog .study-item.selected {
    background: rgba(103, 58, 183, 0.1);
    border-color: #673AB7;
}

.radiology-dialog .study-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.radiology-dialog .study-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.radiology-dialog .study-info strong {
    font-size: 0.95rem;
    color: #2c3e50;
}

.radiology-dialog .study-info span {
    font-size: 0.8rem;
    color: #6c757d;
}

.radiology-dialog .selected-panel {
    padding: 20px;
    overflow-y: auto;
    background: #fafbfc;
}

.radiology-dialog .procedures-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.radiology-dialog .procedures-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #2c3e50;
}

.radiology-dialog .procedures-header .header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.radiology-dialog .contrast-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.radiology-dialog .contrast-toggle:hover {
    background: #e9ecef;
}

.radiology-dialog .contrast-toggle input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #673AB7;
}

.radiology-dialog .contrast-toggle span {
    font-size: 0.95rem;
    color: #2c3e50;
    font-weight: 500;
}

.radiology-dialog .procedures-header .selected-count {
    font-size: 0.95rem;
    color: #673AB7;
    font-weight: 600;
}

.radiology-dialog .procedures-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.radiology-dialog .procedure-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radiology-dialog .procedure-card:hover {
    border-color: #673AB7;
    background: rgba(103, 58, 183, 0.02);
}

.radiology-dialog .procedure-card.selected {
    background: rgba(103, 58, 183, 0.1);
    border-color: #673AB7;
}

.radiology-dialog .procedure-checkbox {
    font-size: 1.3rem;
    color: #adb5bd;
}

.radiology-dialog .procedure-card.selected .procedure-checkbox {
    color: #673AB7;
}

.radiology-dialog .procedure-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.radiology-dialog .procedure-info strong {
    font-size: 0.95rem;
    color: #2c3e50;
}

.radiology-dialog .procedure-price {
    font-size: 0.85rem;
    color: #673AB7;
    font-weight: 600;
}

.radiology-dialog .empty-state {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
}

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

.radiology-dialog .selected-study-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.radiology-dialog .study-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

.radiology-dialog .study-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.radiology-dialog .study-icon-mini {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
}

.radiology-dialog .btn-delete {
    background: none;
    border: none;
    color: #e53935;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.radiology-dialog .btn-delete:hover {
    background: rgba(229, 57, 53, 0.1);
}

.radiology-dialog .study-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radiology-dialog .field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.radiology-dialog .field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.radiology-dialog .field label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #6c757d;
}

.radiology-dialog .field-checkbox {
    margin-top: 5px;
}

.radiology-dialog .dialog-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.radiology-dialog .studies-count {
    font-size: 0.95rem;
    color: #6c757d;
}

.radiology-dialog .studies-count strong {
    color: #673AB7;
    font-size: 1.2rem;
}

.radiology-dialog .footer-actions {
    display: flex;
    gap: 12px;
}

.radiology-dialog .btn-submit {
    background: linear-gradient(135deg, #673AB7 0%, #9575CD 100%);
}

.radiology-dialog .btn-submit:hover {
    box-shadow: 0 4px 15px rgba(103, 58, 183, 0.4);
}

/* LaboratoryDialog Styles */
.laboratory-dialog {
    width: 1200px;
    height: 90vh;
}

.laboratory-dialog .dialog-header {
    background: linear-gradient(135deg, #009688 0%, #4DB6AC 100%);
}

.laboratory-dialog .dialog-body {
    display: flex;
    flex-direction: column;
    height: calc(90vh - 160px);
    overflow: hidden;
}

.laboratory-dialog .search-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 25px;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

.laboratory-dialog .search-input {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.laboratory-dialog .search-input i {
    color: #adb5bd;
}

.laboratory-dialog .search-input input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.95rem;
}

.laboratory-dialog .category-filter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.laboratory-dialog .category-filter label {
    font-size: 0.9rem;
    color: #6c757d;
}

.laboratory-dialog .test-count {
    font-size: 0.9rem;
    color: #6c757d;
    white-space: nowrap;
}

.laboratory-dialog .tests-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 25px 30px 25px;
    background: #fafbfc;
}

.laboratory-dialog .category-section {
    margin-bottom: 25px;
}

.laboratory-dialog .category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.laboratory-dialog .category-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.laboratory-dialog .category-header strong {
    font-size: 1rem;
    color: #2c3e50;
}

.laboratory-dialog .category-count {
    margin-left: auto;
    font-size: 0.85rem;
    color: #adb5bd;
}

.laboratory-dialog .tests-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.laboratory-dialog .test-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.laboratory-dialog .test-item:hover {
    background: #f1f3f5;
}

.laboratory-dialog .test-item:active {
    transform: scale(0.98);
    background: #e9ecef;
}

.laboratory-dialog .test-item.selected {
    background: rgba(0, 150, 136, 0.1);
    border-color: #009688;
}

.laboratory-dialog .test-item.selected:hover {
    background: rgba(0, 150, 136, 0.15);
}

.laboratory-dialog .test-item.selected:active {
    background: rgba(0, 150, 136, 0.2);
}

.laboratory-dialog .test-radio {
    color: #adb5bd;
    font-size: 1.1rem;
    margin-top: 2px;
}

.laboratory-dialog .test-item.selected .test-radio {
    color: #009688;
}

.laboratory-dialog .test-info {
    display: flex;
    flex-direction: column;
}

.laboratory-dialog .test-info strong {
    font-size: 0.9rem;
    color: #2c3e50;
    line-height: 1.3;
}

.laboratory-dialog .test-info span {
    font-size: 0.8rem;
    color: #adb5bd;
}

.laboratory-dialog .dialog-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.laboratory-dialog .footer-left {
    display: flex;
    align-items: center;
    gap: 25px;
}

.laboratory-dialog .selected-count {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.laboratory-dialog .selected-count label {
    font-size: 0.8rem;
    color: #6c757d;
}

.laboratory-dialog .selected-count strong {
    font-size: 1.3rem;
    color: #009688;
}

.laboratory-dialog .footer-actions {
    display: flex;
    gap: 12px;
}

.laboratory-dialog .btn-clear {
    background: white;
    color: #6c757d;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.laboratory-dialog .btn-clear:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
}

.laboratory-dialog .btn-clear:active {
    background: #e9ecef;
    transform: scale(0.98);
}

.laboratory-dialog .btn-clear:focus {
    outline: 2px solid #009688;
    outline-offset: 2px;
}

.laboratory-dialog .field-input:focus {
    border-color: #009688;
    outline: 2px solid rgba(0, 150, 136, 0.2);
    outline-offset: 0;
}

.laboratory-dialog .btn-submit {
    background: linear-gradient(135deg, #009688 0%, #4DB6AC 100%);
}

.laboratory-dialog .btn-submit:hover {
    box-shadow: 0 4px 15px rgba(0, 150, 136, 0.4);
    transform: translateY(-1px);
}

.laboratory-dialog .btn-submit:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 150, 136, 0.3);
}

.laboratory-dialog .btn-submit:focus {
    outline: 2px solid #4DB6AC;
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 900px) {
    .dialog-container {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .radiology-dialog,
    .laboratory-dialog {
        width: 100%;
        height: 90vh;
    }
    
    .radiology-dialog .dialog-body {
        grid-template-columns: 1fr;
    }
    
    .laboratory-dialog .tests-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
