﻿body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}

h2, h3, legend {
    color: #1e3a5f;
}

form {
    max-width: 1400px;
    margin: 20px auto;
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.08);
}

fieldset {
    border: 1px solid #dbe3ea;
    border-radius: 10px;
    padding: 16px;
    background: #fafbfd;
}

legend {
    font-weight: 600;
    padding: 0 8px;
}

label {
    display: inline-block;
    min-width: 140px;
    font-weight: 600;
    margin-bottom: 8px;
}

input, select, textarea, button {
    font-family: inherit;
    font-size: 14px;
}

input, select, textarea {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 10px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

    input:focus, select:focus, textarea:focus {
        outline: none;
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
    }

button {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
}

    button:hover {
        background: #1d4ed8;
    }

    button[type="button"] {
        background: #475569;
    }

        button[type="button"]:hover {
            background: #334155;
        }

table {
    border-collapse: collapse;
    width: 100%;
    background: white;
    overflow: hidden;
    border-radius: 10px;
}

    table thead {
        background: #1e3a5f;
        color: white;
    }

    table th, table td {
        border: 1px solid #dbe3ea;
        padding: 10px;
        text-align: left;
        vertical-align: middle;
    }

    table tbody tr:nth-child(even) {
        background: #f8fafc;
    }

#tablaPiezas input {
    width: 100%;
    box-sizing: border-box;
}

#tablaPiezas select {
    width: 100%;
}

#tablaPiezas th,
#tablaPiezas td {
    text-align: center;
}

    #tablaPiezas td:first-child,
    #tablaPiezas th:first-child {
        text-align: left;
    }

img {
    border-radius: 10px;
}

a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

    a:hover {
        text-decoration: underline;
    }

.resumen-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.acciones {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.boton-eliminar {
    background: #dc2626 !important;
}

    .boton-eliminar:hover {
        background: #b91c1c !important;
    }

.page-corte {
    max-width: 1400px;
    margin: 20px auto;
}

.secciones-superiores {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.panel {
    background: #fff;
    border: 1px solid #dbe3ea;
    border-radius: 10px;
    padding: 18px;
}

.panel-ancho {
    grid-column: 1 / -1;
}

.panel h3,
.panel legend {
    margin-top: 0;
    color: #1e3a5f;
    font-weight: 600;
}

.campos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 24px;
}

.campo {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .campo label {
        width: 120px;
        min-width: 120px;
        margin: 0;
        font-weight: 600;
    }

    .campo input,
    .campo select,
    .campo textarea {
        flex: 1;
        margin: 0;
    }

.campo-textarea {
    grid-column: 1 / -1;
    align-items: flex-start;
}

    .campo-textarea textarea {
        min-height: 90px;
        resize: vertical;
    }

.triple-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.mini-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

    .mini-grid .campo {
        display: flex;
        align-items: center;
        gap: 10px;
    }

        .mini-grid .campo label {
            width: 120px;
            min-width: 120px;
        }

.tabla-piezas-wrap {
    overflow-x: auto;
}

#tablaPiezas {
    width: 100%;
    border-collapse: collapse;
}

    #tablaPiezas th,
    #tablaPiezas td {
        border: 1px solid #dbe3ea;
        padding: 8px;
    }

    #tablaPiezas thead {
        background: #1e3a5f;
        color: white;
    }

    #tablaPiezas input,
    #tablaPiezas select {
        width: 100%;
        box-sizing: border-box;
    }

.acciones {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

@media (max-width: 1000px) {
    .secciones-superiores,
    .triple-grid,
    .campos-grid {
        grid-template-columns: 1fr;
    }

    .campo {
        flex-direction: column;
        align-items: stretch;
    }

        .campo label {
            width: auto;
            min-width: auto;
        }
}