/* Document Tracker Styles */

.driver-row {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.driver-row-header {
    display: flex;
    align-items: center;
    padding: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.driver-row-header:hover {
    background-color: #f9fafb;
}

.driver-row-left {
    flex: 1;
    min-width: 0;
}

.driver-name {
    font-weight: 600;
    font-size: 15px;
    color: #111827;
    margin-bottom: 4px;
}

.driver-email {
    font-size: 13px;
    color: #6b7280;
}

.driver-row-middle {
    display: flex;
    gap: 8px;
    margin: 0 16px;
    flex-shrink: 0;
}

.status-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-pill.grey {
    background-color: #f3f4f6;
    color: #6b7280;
}

.status-pill.green {
    background-color: #d1fae5;
    color: #065f46;
}

.status-pill.amber {
    background-color: #fef3c7;
    color: #92400e;
}

.status-pill.red {
    background-color: #fee2e2;
    color: #991b1b;
}

.driver-row-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.completeness {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.chevron {
    transition: transform 0.2s ease;
    color: #6b7280;
}

.driver-details-panel {
    border-top: 1px solid #e5e7eb;
    padding: 20px;
    background-color: #f9fafb;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.details-column {
    min-width: 0;
}

.details-column h3 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
}

.detail-item {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
}

.detail-label {
    font-weight: 500;
    color: #6b7280;
    min-width: 100px;
    flex-shrink: 0;
}

.detail-value {
    color: #111827;
    word-break: break-word;
}

.details-empty {
    padding: 20px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

.view-image-link {
    display: inline-block;
    margin-bottom: 4px;
    font-size: 12px;
    color: #2563eb;
    text-decoration: none;
}
.view-image-link:hover {
    text-decoration: underline;
}
.view-images-cell {
    margin-top: 8px;
}
.view-images-cell .doc-thumb {
    display: block;
    max-width: 120px;
    max-height: 90px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    margin-top: 4px;
    margin-bottom: 12px;
}
.view-images-cell .doc-thumb + .doc-thumb {
    margin-top: 8px;
}

.history-container {
    font-size: 13px;
    color: #374151;
}
.history-doc-type {
    margin-bottom: 16px;
}
.history-doc-type h4 {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.history-version {
    padding: 6px 0;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.history-date {
    font-weight: 500;
    min-width: 90px;
}
.history-none,
.history-error {
    color: #6b7280;
    font-size: 12px;
    margin: 0;
}
.history-error {
    color: #991b1b;
}

@media (max-width: 1024px) {
    .details-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* CE Override modal */
.ce-override-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.ce-override-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}
.ce-override-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 24px;
    width: 100%;
    max-width: 380px;
}
.ce-override-modal-title {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}
.ce-override-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ce-override-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}
.ce-override-field input {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    box-sizing: border-box;
}
.ce-override-field input:focus {
    outline: none;
    border-color: #2563eb;
}
.ce-override-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}
.ce-override-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    border: none;
}
.ce-override-btn-primary {
    background: #2563eb;
    color: #fff;
}
.ce-override-btn-primary:hover {
    background: #1d4ed8;
}
.ce-override-btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}
.ce-override-btn-secondary {
    background: #f3f4f6;
    color: #374151;
}
.ce-override-btn-secondary:hover {
    background: #e5e7eb;
}
.ce-override-message {
    margin: 12px 0 0 0;
    font-size: 13px;
}
.ce-override-message.error {
    color: #991b1b;
}
.ce-override-message.success {
    color: #065f46;
}
.manual-badge {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
    margin-left: 4px;
}
.detail-item-with-edit {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 13px;
}
.detail-item-with-edit .detail-label { margin-bottom: 0; }
.detail-item-with-edit .detail-value { flex: 1; }
.ce-edit-pencil {
    flex-shrink: 0;
    cursor: pointer;
    padding: 2px;
    color: #6b7280;
    background: none;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ce-edit-pencil:hover,
.manual-edit-pencil:hover {
    color: #2563eb;
}
.manual-edit-pencil {
    flex-shrink: 0;
    cursor: pointer;
    padding: 2px;
    color: #6b7280;
    background: none;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
