/* Botones, tarjetas, campos, formularios, mensajes, estados, tablas y diálogos.
Las pantallas consumen estas clases; su distribución vive en vehiculos.css. */
button,a,input,select,textarea {
    touch-action: manipulation;
}
button,[role=button] {
    cursor: pointer;
}
.panel {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--ui-card-radius);
    box-shadow: 0 2px 4px #142f3b04;
    padding: var(--ui-panel-padding);
    margin: 0;
    min-width: 0;
}
.panel h2 {
    font-size: 16px;
    margin: 5px 0 18px;
    letter-spacing: -.2px;
}
.panel h3 {
    font-size: 14px;
}
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 18px;
}
.section-heading h2 {
    margin: 0;
}
.section-heading a {
    font-size: 12px;
    font-weight: 650;
}
.section-heading select {
    max-width: 180px;
}
.muted-text,.field-help {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
}
.message:empty {
    display: none;
}
.message {
    margin: 0 0 16px;
    white-space: pre-wrap;
}
.message.error {
    color: #a12536;
    background: #fff0f1;
    padding: 12px;
    border-radius: var(--ui-control-radius);
}
.message.success {
    color: #066b5b;
    background: #e5f5ed;
    padding: 12px;
    border-radius: var(--ui-control-radius);
}
.kpi {
    border: 1px solid var(--line);
    border-radius: var(--ui-card-radius);
    background: var(--paper);
    padding: 23px 21px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.kpi>span {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}
.kpi>strong {
    font-size: 38px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -1.5px;
}
.kpi small {
    font-size: 11px;
    color: var(--muted);
}
.kpi.green {
    background: #eaf5f1;
    border-color: #cbe7dd;
}
.kpi.green>strong {
    color: #08745f;
}
.kpi.amber>strong {
    color: #ba6120;
}
.empty-state {
    text-align: center;
    padding: 40px 15px;
    color: var(--muted);
}
.empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--soft);
    border-radius: 50%;
    color: var(--accent);
    font-size: 24px;
}
.empty-state h3 {
    color: var(--ink);
    margin: 14px 0 8px;
}
.empty-state p {
    font-size: 12px;
}
.editor-panel form {
    display: block;
}
label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin: 14px 0 6px;
    color: var(--ink);
}
input,select,textarea {
    width: 100%;
    min-width: 0;
    min-height: var(--ui-control-height);
    padding: 9px 11px;
    border: 1px solid #cddade;
    border-radius: var(--ui-control-radius);
    background: var(--paper);
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    box-shadow: none;
}
textarea {
    resize: vertical;
    min-height: 80px;
}
input:focus,select:focus,textarea:focus {
    outline: 2px solid #51ac9950;
    border-color: #288b77;
}
input:disabled,select:disabled {
    background: var(--page);
    color: var(--muted);
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 0 14px;
}
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0 10px;
}
button,.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    min-height: var(--ui-control-height);
    border: 1px solid var(--accent);
    border-radius: var(--ui-control-radius);
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: none;
}
button:hover,.btn-primary:hover {
    background: #076a5e;
}
button:disabled {
    opacity: .5;
    cursor: default;
}
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 35px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--ui-control-radius);
    background: var(--paper);
    color: var(--ink);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}
.btn-secondary:hover {
    background: var(--soft);
}
form>button[type=submit],form>div>button[type=submit] {
    margin-top: 18px;
}
.check {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 400;
    line-height: 1.5;
}
.check input {
    width: 16px;
    height: 16px;
    min-height: 0;
    margin: 0;
    flex-shrink: 0;
}
.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}
.filters>input {
    flex: 1;
}
.filters>select {
    max-width: 200px;
}
.filters label {
    margin: 0;
}
.table-scroll {
    overflow: auto;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
}
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--paper);
    font-size: 12px;
}
th {
    text-align: left;
    background: #f5f8f9;
    color: #5f757d;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .4px;
    padding: 13px 12px;
    white-space: nowrap;
    border-bottom: 1px solid var(--line);
}
td {
    padding: 15px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
td strong {
    display: block;
    font-size: 12px;
}
td small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
    margin-top: 5px;
}
tr:last-child td {
    border-bottom: 0;
}
tbody tr:hover {
    background: #f7faf9;
}
.plate {
    font-family: Consolas,monospace!important;
    letter-spacing: .5px;
    font-size: 13px!important;
    color: #24464e;
}
.numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.row-actions {
    min-width: 120px;
}
.table-action {
    display: inline-flex;
    font-size: 10px;
    padding: 5px 7px;
    min-height: 28px;
    margin: 2px;
    border: 1px solid #d5e4e1;
    border-radius: var(--ui-badge-radius);
    color: var(--accent);
    background: #f1f8f5;
}
.table-action:hover {
    background: #e2f0ea;
}
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    font-size: 11px;
    color: var(--muted);
}
.status {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    border-radius: var(--ui-badge-radius);
    padding: 5px 8px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
}
.status.good {
    background: #e4f4eb;
    color: #237150;
}
.status.bad {
    background: #fce9eb;
    color: #a22f40;
}
.status.warn {
    background: #fff3dc;
    color: #986320;
}
.status.muted {
    background: #eef2f4;
    color: #566c75;
}
.empty {
    text-align: center;
    color: var(--muted);
    padding: 38px 15px;
}
details {
    margin: 15px 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--ui-control-radius);
}
summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}
dialog {
    width: min(94vw,520px);
    max-height: 90vh;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--ui-card-radius);
    padding: 24px;
    background: var(--paper);
    color: var(--ink);
}
dialog.wide-dialog {
    width: min(94vw,780px);
}
dialog::backdrop {
    background: #102d3a80;
    backdrop-filter: blur(3px);
}
.dialog-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}
.dialog-heading h2 {
    font-size: 17px;
    margin: 0;
}
.dialog-heading button {
    font-size: 22px;
    min-width: 36px;
    padding: 2px 8px;
}
.preserve {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
html[data-theme=oscuro] .kpi.green {
    background: #163a33;
    border-color: #275647;
}
html[data-theme=oscuro] .kpi.green strong {
    color: #75d4b1;
}
html[data-theme=oscuro] .kpi.amber strong {
    color: #efb76c;
}
html[data-theme=oscuro] th {
    background: #203943;
    color: #bdd0d7;
}
html[data-theme=oscuro] tbody tr:hover {
    background: #1d3540;
}
html[data-theme=oscuro] .plate {
    color: #9dd3c7;
}
html[data-theme=oscuro] .table-action {
    background: #1a3f3a;
    border-color: #355b53;
    color: #8fd4c0;
}
html[data-theme=oscuro] input,html[data-theme=oscuro] select,html[data-theme=oscuro] textarea {
    background: var(--paper);
    color: var(--ink);
    border-color: var(--line);
}
@media(max-width:1250px) {
    .editor-panel .form-grid {
        grid-template-columns: repeat(4,minmax(0,1fr));
    }
    .editor-panel form>label,.editor-panel form>input,.editor-panel form>select,.editor-panel form>textarea {
        max-width: 100%;
    }
    .kpi {
        padding: 18px 14px;
    }
    .kpi>span {
        min-height: 30px;
    }

}
@media(max-width:900px) {
    .kpi>span {
        min-height: 0;
    }
    .editor-panel .form-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }

}
@media(max-width:700px) {
    .panel {
        padding: var(--ui-panel-padding-mobile);
    }
    .filters {
        flex-wrap: wrap;
    }
    .filters>select {
        max-width: none;
    }
    .section-heading {
        flex-wrap: wrap;
    }
    .kpi strong {
        font-size: 32px;
    }
    .kpi small {
        line-height: 1.4;
    }
    .form-grid {
        gap: 0 10px;
    }

}
