/* ═══════════════════════════════════════════════════════════════════════════
   Ortho Guru Labs – Frontend Styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Cases List Table ── */
.og-labs-cases-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}
.og-labs-cases-table th,
.og-labs-cases-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}
.og-labs-cases-table th {
    font-weight: 600;
    background: #f8f8f8;
}

/* ── Status Badges ── */
.og-labs-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}
.og-labs-status--design-pending  { background: #fff3cd; color: #856404; }
.og-labs-status--scans-received  { background: #d1ecf1; color: #0c5460; }
.og-labs-status--in-design       { background: #cce5ff; color: #004085; }
.og-labs-status--review-ready    { background: #d4edda; color: #155724; }
.og-labs-status--approved        { background: #d4edda; color: #155724; }
.og-labs-status--in-manufacturing { background: #e2e3e5; color: #383d41; }
.og-labs-status--completed       { background: #c3e6cb; color: #155724; }
.og-labs-status--cancelled       { background: #f5c6cb; color: #721c24; }

/* ── Timeline ── */
.og-labs-timeline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin: 30px 0;
    padding: 0 10px;
    position: relative;
}
.og-labs-timeline::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 30px;
    right: 30px;
    height: 3px;
    background: #e0e0e0;
    z-index: 0;
}
.og-labs-timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
    text-align: center;
}
.og-labs-timeline-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e0e0e0;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #e0e0e0;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}
.og-labs-timeline-step span {
    font-size: 12px;
    color: #999;
    max-width: 80px;
}
.og-labs-timeline-step--done .og-labs-timeline-dot {
    background: #28a745;
    box-shadow: 0 0 0 2px #28a745;
}
.og-labs-timeline-step--done span {
    color: #28a745;
    font-weight: 500;
}
.og-labs-timeline-step--active .og-labs-timeline-dot {
    background: #007bff;
    box-shadow: 0 0 0 2px #007bff, 0 0 0 6px rgba(0,123,255,0.2);
}
.og-labs-timeline-step--active span {
    color: #007bff;
    font-weight: 600;
}

/* ── Sections ── */
.og-labs-section {
    margin: 25px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
}
.og-labs-section h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

/* ── Status Message ── */
.og-labs-status-message {
    margin: 15px 0;
    padding: 15px 20px;
    background: #f0f7ff;
    border-left: 4px solid #007bff;
    border-radius: 4px;
}

/* ── Upload Form ── */
.og-labs-upload input[type="file"] {
    display: block;
    margin: 10px 0;
    padding: 10px;
    border: 2px dashed #ccc;
    border-radius: 6px;
    width: 100%;
    cursor: pointer;
    background: #fff;
}
.og-labs-upload input[type="file"]:hover {
    border-color: #007bff;
}
.og-labs-upload-progress {
    margin-top: 10px;
}
.og-labs-progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}
.og-labs-progress-fill {
    height: 100%;
    background: #007bff;
    border-radius: 4px;
    width: 0;
    transition: width 0.3s ease;
}
.og-labs-progress-text {
    font-size: 13px;
    color: #666;
}

/* ── File List ── */
.og-labs-file-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.og-labs-file-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}
.og-labs-file-list li:last-child {
    border-bottom: none;
}
.og-labs-filesize {
    color: #999;
    font-size: 13px;
}

/* ── 3D Preview ── */
.og-labs-webview-iframe {
    width: 100%;
    height: 500px;
    border: none;
    border-radius: 6px;
    background: #f0f0f0;
}

/* ── Actions (Approve/Revision) ── */
.og-labs-actions {
    display: flex;
    gap: 12px;
    margin: 20px 0;
}
.og-labs-approve-btn {
    background: #28a745 !important;
    color: #fff !important;
    border-color: #28a745 !important;
}
.og-labs-approve-btn:hover {
    background: #218838 !important;
}

/* ── Comments ── */
.og-labs-comment-thread {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 15px;
}
.og-labs-comment {
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    max-width: 85%;
}
.og-labs-comment--customer {
    background: #e3f2fd;
    margin-left: auto;
}
.og-labs-comment--admin {
    background: #f5f5f5;
    margin-right: auto;
}
.og-labs-comment-meta {
    font-size: 12px;
    color: #777;
    margin-bottom: 4px;
}
.og-labs-comment-body {
    font-size: 14px;
    line-height: 1.5;
}
.og-labs-no-comments {
    color: #999;
    font-style: italic;
}
.og-labs-comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.og-labs-comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    resize: vertical;
    font-family: inherit;
}
.og-labs-comment-form button {
    align-self: flex-end;
}

/* ── Downloads ── */
.og-labs-downloads .og-labs-file-list a.button {
    display: inline-block;
    text-decoration: none;
}

/* ── Manufacturing Status ── */
.og-labs-manufacturing {
    border-left: 4px solid #6f42c1;
    background: #f8f5ff;
}
.og-labs-manufacturing h3 {
    color: #6f42c1;
}
.og-labs-manufacturing-estimate {
    color: #666;
    font-size: 13px;
    font-style: italic;
    margin-top: 10px;
}
.og-labs-manufacturing a {
    color: #6f42c1;
    font-weight: 500;
}
.og-labs-manufacturing a:hover {
    color: #563d7c;
}

/* ── Order Manufacturing Button ── */
.og-labs-order-manufacturing .og-labs-mfg-order-details {
    margin-bottom: 15px;
}
.og-labs-order-manufacturing .og-labs-mfg-order-details p {
    margin: 4px 0;
}
.og-labs-order-unicad-btn {
    background: #6f42c1 !important;
    color: #fff !important;
    border-color: #6f42c1 !important;
    padding: 10px 24px !important;
    font-size: 15px !important;
}
.og-labs-order-unicad-btn:hover {
    background: #5a32a3 !important;
    border-color: #5a32a3 !important;
}
.og-labs-order-unicad-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
.og-labs-mfg-error {
    margin-top: 12px;
    padding: 10px 14px;
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    border-radius: 4px;
    font-size: 13px;
    color: #856404;
}
.og-labs-mfg-self {
    padding: 10px 14px;
    background: #e8f5e9;
    border-left: 3px solid #4caf50;
    border-radius: 4px;
    font-size: 13px;
    color: #2e7d32;
}

/* ── Manufacturing Accordion Rows ── */
.og-labs-mfg-rows {
    max-width: 650px;
}
.og-labs-mfg-row {
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    margin-bottom: 12px;
    background: #fff;
    overflow: hidden;
}
.og-labs-mfg-row-header {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    cursor: pointer;
    background: #f9f9f9;
    border-bottom: 1px solid transparent;
    user-select: none;
    transition: background 0.15s ease;
}
.og-labs-mfg-row-header:hover {
    background: #f0f0f0;
}
.og-labs-mfg-row.is-expanded .og-labs-mfg-row-header {
    border-bottom-color: #e5e5e5;
}
.og-labs-mfg-row-name {
    font-weight: 600;
    font-size: 15px;
    flex: 1;
}
.og-labs-mfg-row-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 12px;
}
.og-labs-mfg-row-badge--connected {
    background: #d4edda;
    color: #155724;
}
.og-labs-mfg-row-badge--disconnected {
    background: #f5c6cb;
    color: #721c24;
}
.og-labs-mfg-row-chevron {
    font-size: 22px;
    line-height: 1;
    color: #999;
    transition: transform 0.25s ease;
    transform: rotate(0deg);
}
.og-labs-mfg-row.is-expanded .og-labs-mfg-row-chevron {
    transform: rotate(90deg);
}
.og-labs-mfg-row-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.og-labs-mfg-row.is-expanded .og-labs-mfg-row-body {
    max-height: 800px;
}
.og-labs-mfg-row-body > .og-labs-mfg-settings {
    padding: 20px 18px;
}

/* ── Manufacturing Settings Form ── */
.og-labs-mfg-settings {
    max-width: 600px;
}
.og-labs-mfg-description {
    color: #666;
    margin-bottom: 20px;
}
.og-labs-mfg-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.og-labs-mfg-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.og-labs-mfg-field label {
    font-weight: 600;
    font-size: 14px;
}
.og-labs-mfg-field input[type="text"],
.og-labs-mfg-field input[type="password"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}
.og-labs-mfg-field input:focus {
    border-color: #6f42c1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(111, 66, 193, 0.15);
}
.og-labs-field-hint {
    font-size: 12px;
    color: #999;
    margin: 2px 0 0;
}
.og-labs-mfg-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}
.og-labs-mfg-status {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}
.og-labs-mfg-status--connected {
    background: #d4edda;
    color: #155724;
}
.og-labs-mfg-status--disconnected {
    background: #f5c6cb;
    color: #721c24;
}
.og-labs-mfg-status-icon {
    font-weight: bold;
}
.og-labs-mfg-message {
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 14px;
}
.og-labs-mfg-message--success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.og-labs-mfg-message--error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.og-labs-mfg-info {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e5e5e5;
    font-size: 13px;
    color: #666;
}
.og-labs-mfg-info a {
    color: #6f42c1;
}
.og-labs-mfg-info a:hover {
    color: #563d7c;
}

/* ── Product Page: Scan Upload & Notes ── */

.og-labs-product-fields {
    margin: 20px 0;
    padding: 0;
}
.og-labs-product-section {
    margin-bottom: 20px;
}
.og-labs-product-section h4 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
}
.og-labs-product-hint {
    font-size: 13px;
    color: #666;
    margin: 0 0 10px;
}
.og-labs-dropzone {
    min-height: 120px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    background: #fafafa;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.og-labs-dropzone:hover,
.og-labs-dropzone.dz-drag-hover {
    border-color: #007bff;
    background: #f0f7ff;
}
.og-labs-dropzone .dz-message {
    margin: 20px 0;
    font-size: 14px;
    color: #888;
}
.og-labs-dropzone .dz-preview {
    margin: 8px;
}
.og-labs-dropzone .dz-preview .dz-details {
    font-size: 12px;
}
.og-labs-dropzone .dz-preview .dz-remove {
    font-size: 12px;
    color: #dc3545;
    margin-top: 4px;
    display: inline-block;
}
.og-labs-dropzone .dz-preview .dz-remove:hover {
    color: #a71d2a;
    text-decoration: underline;
}
.og-labs-product-notes {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
}
.og-labs-product-notes:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .og-labs-timeline {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .og-labs-timeline::before {
        top: 0;
        bottom: 0;
        left: 22px;
        right: auto;
        width: 3px;
        height: auto;
    }
    .og-labs-timeline-step {
        flex-direction: row;
        gap: 10px;
    }
    .og-labs-timeline-step span {
        max-width: none;
    }
    .og-labs-comment {
        max-width: 100%;
    }
    .og-labs-actions {
        flex-direction: column;
    }
    .og-labs-mfg-actions {
        flex-direction: column;
    }
    .og-labs-mfg-row-header {
        padding: 12px 14px;
    }
    .og-labs-mfg-row-body > .og-labs-mfg-settings {
        padding: 16px 14px;
    }
}
