/* Garantiza que el atributo HTML "hidden" siempre gane, incluso en
   elementos cuya clase define display:flex/block (sin esto, ambas
   reglas quedan con la misma especificidad y la que se carga después
   -la nuestra- puede terminar ganando, dejando el elemento visible
   aunque JS le haya puesto hidden = true). */
[hidden] {
    display: none !important;
}

.mech-pw-wrap {
    max-width: 780px;
    margin: 0 auto;
    font-family: inherit;
}

.mech-pw-tech-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.mech-pw-tech-box {
    flex: 1;
    min-width: 220px;
}

.mech-pw-tech-box label,
.mech-pw-order-box label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 13px;
}

.mech-pw-tech-inline {
    display: flex;
    gap: 8px;
}

.mech-pw-tech-inline input[type="text"] {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    box-sizing: border-box;
}

.mech-pw-tech-box .mech-pw-msg {
    display: block;
    margin-top: 6px;
}

.mech-pw-order-box {
    flex: 1;
    min-width: 220px;
}

.mech-pw-order-box select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    box-sizing: border-box;
}

.mech-pw-login-notice {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 12px 16px;
    max-width: 780px;
    margin: 0 auto;
}

.mech-pw-existing-wrap {
    margin-bottom: 20px;
}

.mech-pw-existing-wrap h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #334155;
}

.mech-pw-table-readonly {
    background: #f8fafc;
}

.mech-pw-table-readonly thead th {
    background: #e2e8f0;
}

.mech-pw-value-cell {
    font-weight: 600;
    color: #166534;
}

.mech-pw-search-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 16px;
}

.mech-pw-search-box {
    position: relative;
    flex: 1;
}

.mech-pw-search-box label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 13px;
}

.mech-pw-search-box input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    box-sizing: border-box;
}

.mech-pw-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 20;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-top: none;
    max-height: 260px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
    box-shadow: 0 4px 10px rgba(0,0,0,.08);
}

.mech-pw-results li {
    padding: 8px 10px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f1;
    font-size: 13px;
}

.mech-pw-results li:hover,
.mech-pw-results li.active {
    background: #f0f6fc;
}

.mech-pw-results li small {
    display: block;
    color: #666;
}

.mech-pw-results .mech-pw-no-results {
    color: #888;
    cursor: default;
}

.mech-pw-icon-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1d4ed8;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 9px 14px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 13px;
}

.mech-pw-icon-btn:hover {
    background: #1e40af;
}

.mech-pw-plus {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.mech-pw-custom-panel {
    background: #f8fafc;
    border: 1px dashed #94a3b8;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
}

.mech-pw-custom-panel h4 {
    margin: 0 0 10px;
    font-size: 14px;
}

.mech-pw-custom-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 8px;
}

.mech-pw-custom-grid input {
    padding: 7px 8px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

.mech-pw-custom-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.mech-pw-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    font-size: 13px;
}

.mech-pw-table th,
.mech-pw-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
}

.mech-pw-table thead th {
    background: #f1f5f9;
    font-weight: 600;
}

.mech-pw-empty-row td {
    color: #888;
    text-align: center;
    font-style: italic;
}

.mech-pw-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.mech-pw-badge-catalog {
    background: #dcfce7;
    color: #166534;
}

.mech-pw-badge-custom {
    background: #fef3c7;
    color: #92400e;
}

.mech-pw-remove-btn {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 14px;
}

.mech-pw-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.mech-pw-footer-secondary {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}

.mech-pw-msg {
    font-size: 13px;
}

.mech-pw-msg.success { color: #166534; }
.mech-pw-msg.error { color: #dc2626; }

.mech-pw-btn-primary {
    background: #1d4ed8;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 13px;
}

.mech-pw-btn-primary:hover { background: #1e40af; }
.mech-pw-btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.mech-pw-btn-secondary {
    background: #e2e8f0;
    color: #334155;
    border: none;
    border-radius: 6px;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 13px;
}

.mech-pw-btn-secondary:hover { background: #cbd5e1; }

.mech-pw-btn-load-orders {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(37, 99, 235, .4);
}

.mech-pw-btn-load-orders:hover {
    background: #1d4ed8;
}

.mech-pw-btn-load-orders:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.mech-pw-total-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    font-size: 13px;
    color: #334155;
    margin-top: -8px;
    margin-bottom: 16px;
}

.mech-pw-total-row strong {
    font-size: 15px;
    color: #166534;
}

.mech-pw-total-row-highlight {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    margin-top: -10px;
}

/* Encabezado destacado con el nombre del técnico: ayuda a evitar
   errores al seleccionar el vehículo/orden equivocados. */
.mech-pw-tech-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #eff6ff;
    border: 2px solid #2563eb;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
}

.mech-pw-tech-banner-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #1d4ed8;
    background: #dbeafe;
    padding: 3px 8px;
    border-radius: 4px;
}

.mech-pw-tech-banner-name {
    font-size: 17px;
    font-weight: 700;
    color: #1e3a8a;
}

.mech-pw-btn-ready {
    background: #059669;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.mech-pw-btn-ready:hover {
    background: #047857;
}

.mech-pw-btn-ready:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.mech-pw-ready-notice {
    background: #fef9c3;
    border: 1px solid #fde047;
    color: #854d0e;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
}

@media (max-width: 640px) {
    .mech-pw-custom-grid {
        grid-template-columns: 1fr;
    }
    .mech-pw-search-row {
        flex-direction: column;
        align-items: stretch;
    }
    .mech-pw-tech-row {
        flex-direction: column;
        align-items: stretch;
    }
    .mech-pw-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .mech-pw-footer-secondary {
        justify-content: stretch;
    }
    .mech-pw-footer-secondary .mech-pw-btn-ready {
        width: 100%;
    }
}

/* Modal flotante: checklist de inspección de entrega antes de marcar
   el vehículo como listo. */
.mech-pw-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}

.mech-pw-modal {
    background: #fff;
    border-radius: 10px;
    padding: 28px 24px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .25);
}

.mech-pw-modal-icon {
    font-size: 34px;
    line-height: 1;
    margin-bottom: 10px;
}

.mech-pw-modal h3 {
    margin: 0 0 10px;
    font-size: 17px;
    color: #1e293b;
}

.mech-pw-modal p {
    margin: 0 0 20px;
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
}

.mech-pw-modal-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

@media (max-width: 480px) {
    .mech-pw-modal-actions {
        flex-direction: column;
    }
}
