:root {
    --bg: linear-gradient(145deg, #dbe8f8 0%, #aac4e6 48%, #7fa4d2 100%);
    --panel: #f5f8fc;
    --panel-soft: #f8fbff;
    --text-main: #11213a;
    --text-soft: #53657e;
    --text-muted: #7b889b;
    --accent: #173a7a;
    --accent-hover: #102d63;
    --border: #c4d4e8;
    --border-strong: #97aec8;
    --success-bg: #eef7f1;
    --success-border: #b7d9bf;
    --error-bg: #fff4f4;
    --error-border: #ebb7b7;
    --shadow: 0 18px 48px rgba(17, 39, 79, 0.16);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Aptos", "Segoe UI", Tahoma, sans-serif;
    font-size: 15px;
    background: var(--bg);
    color: var(--text-main);
}

.app-body {
    background: var(--panel);
}

body.modal-open {
    overflow: hidden;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(12, 26, 49, 0.38);
    backdrop-filter: blur(2px);
    z-index: 1200;
}

.loading-overlay[hidden] {
    display: none;
}

.loading-card {
    min-width: min(92vw, 380px);
    max-width: 420px;
    padding: 28px 24px;
    border-radius: 18px;
    background: rgba(244, 249, 255, 0.98);
    border: 1px solid rgba(151, 174, 200, 0.85);
    box-shadow: 0 24px 64px rgba(10, 28, 58, 0.28);
    text-align: center;
}

.loading-card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.02rem;
    letter-spacing: 0.04em;
}

.loading-card span {
    display: block;
    color: var(--text-soft);
    line-height: 1.45;
    font-size: 0.92rem;
}

.loading-spinner {
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    border-radius: 50%;
    border: 4px solid rgba(11, 91, 184, 0.18);
    border-top-color: var(--accent);
    animation: spin 0.85s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.page {
    width: 100%;
    min-height: 100vh;
    padding: 0;
}

.page-wide {
    padding: 0;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 18px;
    background:
        radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.34), transparent 26%),
        var(--bg);
}

.login-card {
    position: relative;
    width: min(100%, 460px);
    background: rgba(248, 251, 255, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 24px;
    padding: 38px 34px 34px;
    box-shadow: var(--shadow);
}

.login-brand {
    margin-bottom: 22px;
    text-align: center;
}

.login-eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(11, 91, 184, 0.1);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.login-brand h1 {
    margin: 0 0 10px;
    color: #17346f;
    font-size: 1.75rem;
    letter-spacing: -0.025em;
}

.login-brand p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.5;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-form button {
    margin-top: 10px;
    min-height: 46px;
}

.login-message {
    margin-top: 16px;
}

.card {
    width: 100%;
    max-width: none;
    background: transparent;
    border-radius: 0;
    padding: 0 24px 28px;
    box-shadow: none;
    border: 0;
    overflow: hidden;
}

.card-compact {
    max-width: none;
    margin: 0;
    min-height: auto;
}

.card-compact .contenido {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

.card-wide {
    min-height: 100vh;
}

.app-hero {
    margin: 0 -24px 24px;
    padding: 18px 24px;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 28%),
        linear-gradient(125deg, #102b63 0%, #1c3b7a 58%, #284993 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.app-hero-brand {
    min-width: 0;
}

.app-hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ff6670;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.app-hero-brand h1 {
    margin: 10px 0 0;
    color: #f5f8ff;
    text-align: left;
    font-size: clamp(1.8rem, 2.2vw, 2.45rem);
    letter-spacing: -0.025em;
    line-height: 1;
}

.app-session-panel {
    display: grid;
    grid-template-columns: repeat(3, max-content);
    grid-auto-flow: dense;
    justify-content: end;
    align-items: center;
    gap: 7px;
}

.app-session-card {
    padding: 9px 12px;
    border-radius: 12px;
    background: rgba(151, 180, 235, 0.16);
    border: 1px solid rgba(201, 216, 248, 0.18);
    width: fit-content;
    max-width: 100%;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: end;
}

.app-user-block {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 10px;
    align-items: start;
}

.app-user-block span {
    color: rgba(235, 241, 255, 0.88);
    font-size: 0.74rem;
    line-height: 1.2;
}

.app-user-block strong {
    font-size: 0.74rem;
    letter-spacing: 0.02em;
}

.boton-logout {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
}

.boton-log {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
}

.theme-toggle {
    grid-column: 2;
    grid-row: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: fit-content;
    min-height: 30px;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #f5f8ff;
    box-shadow: none;
    font-size: 0.78rem;
    line-height: 1;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.theme-icon {
    width: 16px;
    font-size: 1rem;
    line-height: 1;
}

.theme-toggle-login {
    position: fixed;
    top: 18px;
    right: 20px;
    color: var(--accent);
    background: rgba(23, 58, 122, 0.07);
    border-color: rgba(23, 58, 122, 0.12);
}

.theme-toggle-login:hover {
    background: rgba(23, 58, 122, 0.12);
}

.contenido {
    display: grid;
    grid-template-columns: minmax(420px, 0.92fr) minmax(520px, 1.08fr);
    gap: 22px;
    align-items: start;
}

.contenido-compacto {
    grid-template-columns: minmax(0, 1fr);
}

.contenido-compacto .columna-formulario {
    width: min(100%, 900px);
    margin: 8px 0 0;
}

.contenido-compacto .columna-resultados {
    display: none;
}

.similares-seccion {
    margin-top: 22px;
}

.similares-seccion-wide {
    margin-top: 18px;
}

.similares-seccion > .resultado {
    padding: 16px;
}

.columna {
    min-width: 0;
}

.formulario,
.editor-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font: inherit;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 1px 2px rgba(17, 39, 79, 0.03);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(23, 58, 122, 0.12);
}

textarea {
    resize: vertical;
    min-height: 176px;
}

button {
    margin-top: 8px;
    padding: 11px 16px;
    border: none;
    border-radius: 12px;
    background: var(--accent);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 5px 14px rgba(23, 58, 122, 0.14);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(23, 58, 122, 0.2);
}

.acciones-formulario {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.filtros-similares {
    margin-top: 6px;
    padding: 14px;
    border: 1px solid rgba(151, 174, 200, 0.65);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.36);
}

.filtros-similares-header {
    margin-bottom: 10px;
}

.filtros-similares-header strong,
.filtros-similares-header small {
    display: block;
}

.filtros-similares-header small {
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 0.84rem;
}

.filtros-similares-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.filtros-similares-inline {
    margin-bottom: 16px;
}

.similares-toggle-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.boton-toggle-similares {
    margin-top: 0;
    background: #0e4a90;
}

.boton-toggle-similares:hover {
    background: #0a3b73;
}

.similares-toggle-bar small {
    color: var(--text-soft);
    font-size: 0.9rem;
}

.similares-panel[hidden] {
    display: none;
}

.similares-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 14px;
    color: var(--text-soft);
}

.similares-loading[hidden] {
    display: none;
}

.loading-spinner-small {
    width: 24px;
    height: 24px;
    margin: 0;
    border-width: 3px;
}

.filtros-similares-grid-wide {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: end;
}

.filtro-tabla-form label {
    margin-bottom: 6px;
}

.filtro-accion {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.boton-actualizar {
    width: 100%;
    margin-top: 0;
    background: #1f8f4d;
}

.boton-actualizar:hover {
    background: #18723d;
}

.boton-secundario,
.boton-tabla {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 11px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.72);
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.2s ease;
    font-size: 0.82rem;
    width: fit-content;
}

.app-session-panel .boton-secundario {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.92);
    line-height: 1.1;
    box-shadow: 0 4px 12px rgba(5, 18, 47, 0.12);
}

.acciones-formulario .boton-secundario {
    line-height: 1.1;
}

.boton-secundario:hover,
.boton-tabla:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.boton-tabla {
    padding: 8px 12px;
    font-size: 0.92rem;
}

.boton-deshabilitado {
    opacity: 0.46;
    pointer-events: none;
    cursor: not-allowed;
}

.mensaje,
.resultado {
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid;
}

.mensaje {
    margin-top: 18px;
}

.mensaje-error {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: #8a1f1f;
}

.mensaje-ok {
    background: #eef8ef;
    border-color: #b7e0b7;
    color: #1f5c2b;
    margin-bottom: 18px;
}

.resultado {
    background: linear-gradient(135deg, #f4faf6 0%, #edf7f1 100%);
    border-color: var(--success-border);
    box-shadow: 0 5px 16px rgba(36, 93, 57, 0.05);
}

.resultado-grid {
    display: grid;
    gap: 14px;
}

.resultado-grid > .resultado {
    min-height: 76px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.resultado-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-soft);
    font-size: 0.95rem;
}

.resultado strong {
    font-size: 1rem;
}

.resultado-lista {
    margin: 0;
    padding-left: 18px;
}

.resultado-lista li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.resultado-lista-proveedores small {
    display: block;
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 0.88rem;
}

.proveedor-titulo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.estatus-proveedor {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    border: 1px solid transparent;
}

.estatus-proveedor-activo {
    background: #e7f7ec;
    color: #146c3a;
    border-color: #8ed0a7;
}

.estatus-proveedor-retiro {
    background: #fdeceb;
    color: #b42318;
    border-color: #f0a7a0;
}

.estatus-proveedor-neutro {
    background: #edf2f7;
    color: #475467;
    border-color: #cbd5e1;
}

.tabla-wrapper {
    overflow-x: auto;
    border: 1px solid rgba(151, 174, 200, 0.5);
    border-radius: 12px;
    background: rgba(250, 252, 255, 0.92);
    box-shadow: 0 6px 18px rgba(17, 39, 79, 0.05);
}

.tabla-similares {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.tabla-similares th,
.tabla-similares td {
    padding: 7px 10px;
    text-align: left;
    border-bottom: 1px solid #d6e4d6;
    vertical-align: top;
    line-height: 1.35;
}

.tabla-similares th {
    position: sticky;
    top: 0;
    background: #e5eef9;
    color: var(--text-soft);
    font-weight: 700;
    font-size: 0.8rem;
    z-index: 1;
}

.tabla-similares tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.28);
}

.tabla-similares td small {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.log-summary {
    display: grid;
    grid-template-columns: minmax(220px, 320px);
    gap: 14px;
    margin-bottom: 14px;
}

.log-toolbar {
    display: grid;
    grid-template-columns: minmax(180px, 260px) 1fr;
    align-items: end;
    gap: 14px;
    margin-bottom: 14px;
}

.log-filter-form {
    display: flex;
    justify-content: flex-end;
    align-items: end;
    gap: 9px;
    flex-wrap: wrap;
    padding: 10px;
    border: 1px solid rgba(151, 174, 200, 0.42);
    border-radius: 12px;
    background: rgba(250, 252, 255, 0.72);
}

.log-filter-form label {
    display: grid;
    gap: 4px;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 700;
}

.log-filter-form input {
    min-height: 34px;
    min-width: 150px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--panel-soft);
    color: var(--text-main);
    font: inherit;
    font-size: 0.84rem;
}

.log-filter-form .boton-secundario {
    min-height: 34px;
    padding: 7px 12px;
}

.boton-descargar {
    border-color: rgba(31, 143, 77, 0.28);
    background: #1f8f4d;
    color: #ffffff;
}

.boton-descargar:hover {
    background: #18723d;
    color: #ffffff;
}

.tabla-log-wrapper {
    max-height: calc(100vh - 190px);
    overflow: auto;
}

.tabla-log {
    width: max-content;
    min-width: 100%;
}

.tabla-log th,
.tabla-log td {
    padding: 6px 10px;
    font-size: 0.8rem;
    line-height: 1.28;
    white-space: nowrap;
}

.tabla-log td {
    max-width: none;
    word-break: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tabla-log th {
    white-space: nowrap;
}

.tabla-log tr {
    height: auto;
}

.app-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin: 0 -24px 22px;
    padding: 12px 24px;
    background: linear-gradient(125deg, #102b63 0%, #284993 100%);
    color: #ffffff;
}

.editor-hero {
    margin-bottom: 18px;
}

.app-toolbar .app-user-block {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-toolbar .app-user-block span {
    color: rgba(239, 245, 255, 0.78);
    font-size: 0.8rem;
}

.app-toolbar .boton-secundario {
    background: rgba(255, 255, 255, 0.94);
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-actions .theme-toggle {
    grid-column: auto;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.editor-header h1 {
    text-align: left;
    margin: 0 0 10px;
    color: #17346f;
    font-size: 1.9rem;
    letter-spacing: -0.025em;
}

.editor-subtitle {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.editor-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.editor-note {
    display: block;
    margin-bottom: 12px;
    color: var(--text-soft);
    font-size: 0.88rem;
}

.editor-actions-top {
    margin: 0 0 12px;
}

.editor-table {
    min-width: 1400px;
}

.editor-table input,
.editor-table select {
    min-width: 120px;
    padding: 8px 10px;
    font-size: 0.88rem;
}

.editor-table td {
    min-width: 120px;
}

.editor-tarifa-cell {
    min-width: 260px;
}

.boton-tarifario {
    width: 100%;
    margin-bottom: 6px;
}

.tarifario-resumen {
    display: block;
    color: var(--text-soft);
    font-size: 0.8rem;
    line-height: 1.3;
    white-space: normal;
}

.input-texto-material {
    min-width: 320px !important;
    width: 320px;
    transition: width 0.18s ease, min-width 0.18s ease, box-shadow 0.18s ease;
}

.input-texto-material:focus {
    min-width: 520px !important;
    width: 520px;
    position: relative;
    z-index: 4;
}

.cell-auto input {
    background: #fff7cf;
    border-color: #e3cf6b;
}

.cell-editable input {
    background: #e6f6df;
    border-color: #9fd08d;
}

.row-nota td {
    background: rgba(230, 246, 223, 0.32);
}

.editor-note-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: #ddeaf8;
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 700;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(8, 20, 40, 0.58);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.modal-card {
    width: min(96vw, 1500px);
    max-height: 92vh;
    background: #f6faff;
    border: 1px solid rgba(151, 174, 200, 0.8);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(10, 28, 58, 0.34);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.modal-table-wrapper {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.modal-table {
    min-width: 1100px;
}

html[data-theme="dark"] {
    --bg: linear-gradient(145deg, #07111f 0%, #0d1c31 48%, #142946 100%);
    --panel: #111d2e;
    --panel-soft: #162338;
    --text-main: #e7eef9;
    --text-soft: #a8b7cc;
    --text-muted: #8495ad;
    --accent: #5c8fe8;
    --accent-hover: #75a3ef;
    --border: #30445e;
    --border-strong: #49617f;
    --success-bg: #142b23;
    --success-border: #285c44;
    --error-bg: #351d22;
    --error-border: #743b45;
    --shadow: 0 18px 52px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .login-body,
html[data-theme="dark"] .login-page {
    background:
        radial-gradient(circle at 18% 10%, rgba(55, 98, 157, 0.22), transparent 28%),
        var(--bg);
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .login-card {
    border-color: #2b405b;
}

html[data-theme="dark"] .card {
    background: transparent;
}

html[data-theme="dark"] .login-card {
    background: rgba(16, 28, 45, 0.98);
}

html[data-theme="dark"] .app-body {
    background: #101b2c;
}

html[data-theme="dark"] .app-hero,
html[data-theme="dark"] .app-toolbar {
    background:
        radial-gradient(circle at top right, rgba(101, 146, 218, 0.12), transparent 30%),
        linear-gradient(125deg, #091a3c 0%, #112b5c 58%, #183873 100%);
}

html[data-theme="dark"] .login-brand h1,
html[data-theme="dark"] .editor-header h1 {
    color: #edf4ff;
}

html[data-theme="dark"] .login-eyebrow {
    color: #a8c8ff;
    background: rgba(83, 135, 219, 0.16);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    color: #e8eef8;
    background: #172538;
    border-color: #354b66;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #7f91a9;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
    background: #1a2a40;
    border-color: #6b9bec;
    box-shadow: 0 0 0 3px rgba(92, 143, 232, 0.2);
}

html[data-theme="dark"] .resultado {
    background: linear-gradient(135deg, #142a24 0%, #11241f 100%);
    border-color: #285840;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.16);
}

html[data-theme="dark"] .filtros-similares,
html[data-theme="dark"] .tabla-wrapper {
    background: rgba(17, 30, 48, 0.94);
    border-color: #30445e;
}

html[data-theme="dark"] .tabla-similares th {
    background: #1d304a;
    color: #bdcbe0;
}

html[data-theme="dark"] .tabla-similares th,
html[data-theme="dark"] .tabla-similares td {
    border-bottom-color: #2b4058;
}

html[data-theme="dark"] .tabla-similares tr:nth-child(even) td {
    background: rgba(67, 91, 121, 0.1);
}

html[data-theme="dark"] .boton-secundario,
html[data-theme="dark"] .boton-tabla {
    color: #e8eef8;
    background: #1b2c43;
    border-color: #3a516d;
}

html[data-theme="dark"] .log-filter-form {
    background: rgba(18, 32, 51, 0.88);
    border-color: #30445e;
}

html[data-theme="dark"] .boton-descargar {
    color: #ffffff;
    background: #1f8f4d;
    border-color: #2fa85f;
}

html[data-theme="dark"] .app-session-panel .boton-secundario,
html[data-theme="dark"] .app-toolbar .boton-secundario {
    color: #13213a;
    background: #eef4fc;
}

html[data-theme="dark"] .theme-toggle-login {
    color: #b8d2ff;
    background: rgba(92, 143, 232, 0.14);
    border-color: rgba(115, 160, 234, 0.22);
}

html[data-theme="dark"] .cell-auto input {
    color: #f5e8a8;
    background: #3a321a;
    border-color: #77652b;
}

html[data-theme="dark"] .cell-editable input {
    color: #d8f4dd;
    background: #183622;
    border-color: #376f48;
}

html[data-theme="dark"] .modal-card,
html[data-theme="dark"] .loading-card {
    color: var(--text-main);
    background: #132136;
    border-color: #3a506c;
}

html[data-theme="dark"] .mensaje-ok {
    color: #a9dfb5;
    background: #173020;
    border-color: #356a42;
}

html[data-theme="dark"] .mensaje-error {
    color: #f0b3b8;
    background: #351d22;
    border-color: #743b45;
}

@media (max-width: 1100px) {
    .contenido {
        grid-template-columns: 1fr;
    }

    .app-hero-top {
        flex-direction: column;
        align-items: stretch;
    }

    .app-session-panel {
        justify-content: start;
    }

    .editor-grid {
        grid-template-columns: 1fr;
    }

    .editor-header {
        flex-direction: column;
    }

    .filtros-similares-grid,
    .filtros-similares-grid-wide {
        grid-template-columns: 1fr;
    }

    .similares-toggle-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .log-toolbar {
        grid-template-columns: 1fr;
    }

    .log-filter-form {
        justify-content: stretch;
    }

    .log-filter-form label,
    .log-filter-form .boton-secundario {
        flex: 1 1 150px;
    }

    .log-filter-form input {
        width: 100%;
    }
}

@media (max-width: 720px) {
    .page,
    .page-wide {
        padding: 0;
    }

    .card {
        padding: 0 16px 20px;
        border-radius: 0;
    }

    .app-hero {
        margin: 0 -16px 18px;
        padding: 18px 16px;
    }

    .app-hero-brand h1 {
        font-size: 1.45rem;
    }

    .app-session-panel {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .app-session-card,
    .boton-log,
    .boton-logout,
    .theme-toggle {
        justify-self: stretch;
        width: 100%;
    }

    .theme-label {
        display: none;
    }

    .resultado-lista li,
    .acciones-formulario {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: flex-start;
    }
}
