/* ── Container Master Styles ── */
.cm-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 12px;
    width: fit-content;
    border: 1px solid #e2e8f0;
}

.cm-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cm-tab-btn:hover {
    color: var(--lc-secondary);
}

.cm-tab-btn.active {
    background: #ffffff;
    color: #4f46e5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.cm-container {
    padding: 24px 32px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #1e293b;
    background: #f8fafc;
    min-height: calc(100vh - 120px);
    display: flex;
    gap: 24px;
}

.cm-sidebar {
    width: 380px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.cm-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(180deg, #ffffff 0%, #faf5ff 100%);
    border-radius: 16px 16px 0 0;
}

.cm-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--lc-secondary);
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cm-search-wrapper {
    position: relative;
}

.cm-search-input {
    width: 100%;
    height: 40px;
    padding: 0 12px 0 36px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s;
    background: #fff;
}
.cm-search-input:focus { 
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.cm-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 16px;
}

.cm-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cm-list-item {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1.5px solid #f1f5f9;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
}

.cm-list-item:hover {
    background: #fff;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.cm-list-item.active {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #3b82f6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.08);
}

.cm-list-item-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.cm-list-item-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cm-list-item-info { flex: 1; }
.cm-list-item-name { font-size: 0.925rem; font-weight: 750; color: #1e293b; margin: 0; }
.cm-list-item-desc { font-size: 0.775rem; color: #64748b; margin: 3px 0 0 0; font-weight: 500; }

.tube-visual {
    width: 32px;
    height: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}
.tube-cap {
    width: 12px;
    height: 5px;
    border-radius: 2px 2px 0 0;
    background: #94a3b8;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.4);
}
.tube-body {
    width: 8px;
    height: 16px;
    border-radius: 0 0 4px 4px;
    border: 1.2px solid #cbd5e1;
    border-top: none;
    background: rgba(241, 245, 249, 0.6);
    position: relative;
    overflow: hidden;
}
.tube-liquid {
    position: absolute;
    bottom: 0.5px;
    left: 0.5px;
    right: 0.5px;
    height: 8px;
    border-radius: 0 0 3px 3px;
    background: rgba(99, 102, 241, 0.15);
}

.cm-main {
    flex: 1;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
}

.cm-main-header {
    padding: 24px 32px;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cm-main-title {
    font-size: 1.25rem;
    font-weight: 855;
    color: var(--lc-secondary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cm-actions {
    display: flex;
    gap: 12px;
}

.cm-btn {
    height: 40px;
    padding: 0 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.cm-btn-primary { 
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%); 
    color: white; 
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}
.cm-btn-primary:hover { 
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%); 
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}
.cm-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cm-btn-danger { 
    background: #ef4444; 
    color: white; 
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}
.cm-btn-danger:hover { 
    background: #dc2626; 
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}

.cm-btn-outline { 
    background: white; 
    border: 1.5px solid #e2e8f0; 
    color: #475569; 
    box-shadow: none;
}
.cm-btn-outline:hover { 
    background: #f8fafc; 
    border-color: #cbd5e1; 
    color: var(--lc-secondary);
}

.cm-form-content {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

.cm-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.cm-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cm-form-group.full { grid-column: span 2; }

.cm-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cm-input, .cm-select, .cm-textarea {
    padding: 11px 14px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    background: #f8fafc;
    width: 100%;
    outline: none;
    transition: all 0.2s;
}

.cm-input:focus, .cm-select:focus, .cm-textarea:focus {
    border-color: #4f46e5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.cm-textarea { resize: vertical; min-height: 80px; }

.cm-image-upload {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px;
    border: 2px dashed #cbd5e1;
    border-radius: 14px;
    background: #fafbfc;
    transition: all 0.2s ease;
}
.cm-image-upload:hover {
    border-color: #4f46e5;
    background: #fdfdfd;
}

.cm-preview {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    flex-shrink: 0;
}

.cm-preview img { width: 100%; height: 100%; object-fit: contain; }

.cm-upload-info { flex: 1; }

.cm-upload-btn-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.cm-upload-btn-label:hover {
    background: #e2e8f0;
    color: var(--lc-secondary);
}

.cm-tests-section {
    margin-top: 32px;
    border-top: 1.5px solid #f1f5f9;
    padding-top: 28px;
}

.autocomplete-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    z-index: 100;
    max-height: 240px;
    overflow-y: auto;
    animation: slideDownFade 0.2s ease-out;
}

.autocomplete-item {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.15s ease;
}
.autocomplete-item:hover {
    background: #f8fafc;
    padding-left: 20px;
}
.autocomplete-item:last-child {
    border-bottom: none;
}

.test-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 9999px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 0.775rem;
    font-weight: 700;
    border: 1.5px solid #dbeafe;
    transition: all 0.2s;
}
.test-tag:hover {
    background: #e0e7ff;
    transform: translateY(-0.5px);
}
.test-tag-remove {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #cbd5e1;
    color: #475569;
    border: none;
    cursor: pointer;
    font-size: 10px;
    padding: 0;
    transition: all 0.2s;
}
.test-tag-remove:hover {
    background: #ef4444;
    color: white;
}

.test-tag.active-tag {
    background: #e0e7ff;
    border-color: #6366f1;
    color: #4338ca;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.cm-test-details-panel {
    width: 320px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    animation: slideLeftFade 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

@keyframes slideLeftFade {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hover-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.04);
    border-color: #cbd5e1 !important;
}

@keyframes slideDownFade {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
