/* ============================================================
   Middleware BASCS - RDS Cube - azul sobre blanco.
   La identidad se ajusta cambiando solo los tokens de :root.
   ============================================================ */
:root {
    --primary: #0b5cab;          /* naranja Blum (tomado del logo) */
    --primary-dark: #084b8c;
    --accent-text: #0b5cab;      /* naranja legible como texto sobre blanco */
    --text-main: #1a1a1a;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --radius: .5rem;
}

html, body {
    font-family: 'Manrope', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #fff;
    color: var(--text-main);
}

.material-symbols-outlined { font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; vertical-align: middle; }

a, .btn-link { color: var(--accent-text); }

.btn-primary { color: #fff; background-color: var(--primary); border-color: var(--primary); font-weight: 700; min-height: 2.35rem; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary:disabled {
    color: #fff; background-color: var(--primary-dark); border-color: var(--primary-dark);
}
.btn-outline-secondary { border-color: var(--border); color: var(--text-main); }
.btn-outline-secondary:hover { background: #fff; border-color: var(--primary); color: var(--accent-text); }
.btn-outline-danger { background: #fff; }

h1, h2, h3 { color: var(--text-main); }
h1 { font-size: 1.8rem; margin-bottom: 1rem; }
h1:focus { outline: none; }

.public-shell { min-height: 100vh; display: flex; flex-direction: column; }

.btn:focus, .btn:active:focus, .form-control:focus, .form-select:focus, .form-check-input:focus {
    box-shadow: 0 0 0 .2rem rgba(11, 92, 171, .25);
}
.form-control:focus, .form-select:focus { border-color: var(--primary); }
.form-check-input:checked, input[type=checkbox]:checked { background-color: var(--primary); border-color: var(--primary); }
input[type=checkbox] { accent-color: var(--primary); }

.blazor-error-boundary { background: #b32121; padding: 1rem 1rem 1rem 3.7rem; color: white; }
.blazor-error-boundary::after { content: "Ha ocurrido un error."; }

@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; animation: spin 1s linear infinite; }

/* ── Módulos ── */
.module-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.module-header-icon { width: 44px; height: 44px; border-radius: var(--radius); background: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.module-header-icon .material-symbols-outlined { font-size: 1.5rem; color: #fff; line-height: 1; }
.module-title { font-size: 1.3rem; font-weight: 800; margin: 0 0 .1rem; }
.module-sub { font-size: .78rem; color: var(--text-muted); margin: 0; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.card-panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }

/* ── Bienvenida ── */
.dash-welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; text-align: center; color: var(--text-muted); }
.dash-welcome-icon { width: 64px; height: 64px; border-radius: var(--radius); margin-bottom: 1.25rem; background: var(--primary); display: flex; align-items: center; justify-content: center; }
.dash-welcome-icon .material-symbols-outlined { font-size: 2rem; color: #fff; line-height: 1; }
.dash-welcome-title { font-size: 1.4rem; font-weight: 800; color: var(--text-main); margin: 0 0 .5rem; }
.dash-welcome-sub { font-size: .95rem; max-width: 360px; }

/* ── Not found / acceso denegado ── */
.nf-page { flex: 1; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; padding: 1rem; text-align: center; background: #fff; }
.nf-icon { font-size: 3.5rem; color: var(--primary); }
.nf-title { font-weight: 800; }
.nf-text { color: var(--text-muted); margin-bottom: 1rem; }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-shell { display: flex; height: 100vh; overflow: hidden; background: #fff; }
.app-sidebar { width: 250px; min-height: 100vh; flex-shrink: 0; overflow: hidden; transition: width .25s ease; background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.app-shell.sidebar-collapsed .app-sidebar { width: 64px; }
.app-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; background: #fff; }
.app-topbar { height: 52px; display: flex; align-items: center; padding: 0 1.25rem; flex-shrink: 0; background: #fff; border-bottom: 1px solid var(--border); }
.app-content { flex: 1; overflow-y: auto; padding: 2rem; }
.app-footer, .public-footer { flex-shrink: 0; padding: .45rem 1.5rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: #fff; border-top: 1px solid var(--border); font-size: .72rem; color: #9ca3af; }

.app-sidebar .sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 1.1rem .85rem; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; }
.app-sidebar .sidebar-brand-icon { font-size: 1.4rem; color: #fff; background: var(--primary); border-radius: .4rem; flex-shrink: 0; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; line-height: 1; }
.app-sidebar .sidebar-brand-name { color: var(--text-main); font-weight: 800; font-size: .95rem; transition: opacity .15s; overflow: hidden; }
.app-shell.sidebar-collapsed .sidebar-brand-name { opacity: 0; width: 0; }

.app-sidebar .sidebar-user { display: flex; align-items: center; gap: .65rem; padding: .85rem; min-height: 62px; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; }
.app-shell.sidebar-collapsed .sidebar-user { justify-content: center; padding: .85rem 0; }
.app-sidebar .sidebar-user-avatar { font-size: 1.75rem; color: var(--primary); flex-shrink: 0; width: 34px; line-height: 1; }
.app-sidebar .sidebar-user-info { display: flex; flex-direction: column; overflow: hidden; }
.app-sidebar .sidebar-user-name { color: var(--text-main) !important; font-weight: 700; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; }
.app-sidebar .sidebar-user-categ { color: var(--text-muted) !important; font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }

.app-sidebar .sidebar-nav { flex: 1; padding: .65rem 0; overflow-y: auto; overflow-x: hidden; }
.app-sidebar .nav-section { margin-bottom: .25rem; }
.app-sidebar .nav-section-label { display: block; color: var(--text-muted) !important; font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; padding: .6rem 1rem .3rem; white-space: nowrap; transition: opacity .15s; }
.app-shell.sidebar-collapsed .nav-section-label { opacity: 0; }
.app-sidebar .nav-section-toggle { display: flex; align-items: center; width: 100%; background: none; border: none; padding: 0; cursor: pointer; user-select: none; }
.app-shell.sidebar-collapsed .nav-section-toggle { cursor: default; pointer-events: none; }
.app-sidebar .nav-section-chevron { font-size: .85rem; color: var(--text-muted); margin-left: auto; margin-right: .75rem; flex-shrink: 0; transition: transform .2s ease, opacity .15s; }
.app-sidebar .nav-section-collapsed .nav-section-chevron { transform: rotate(-90deg); }
.app-shell.sidebar-collapsed .nav-section-chevron { opacity: 0; width: 0; margin-right: 0; overflow: hidden; }
.app-sidebar .nav-section-items { overflow: hidden; max-height: 600px; transition: max-height .25s ease; }
.app-sidebar .nav-section-collapsed .nav-section-items { max-height: 0; }
.app-shell.sidebar-collapsed .nav-section-items { max-height: 600px; }

.app-sidebar .nav-item, .app-sidebar a.nav-item, .app-sidebar .nav-item:visited, .app-sidebar .nav-item:hover, .app-sidebar .nav-item:focus {
    display: flex !important; align-items: center; gap: .7rem; padding: .58rem .85rem; color: #374151 !important; text-decoration: none !important;
    white-space: nowrap; overflow: hidden; transition: color .15s; cursor: pointer; background: none !important; border: none; border-left: 3px solid transparent;
    width: 100%; font-family: "Manrope", sans-serif; font-size: .875rem; text-align: left; border-radius: 0;
}
.app-shell.sidebar-collapsed .nav-item { justify-content: center; padding: .65rem 0; }
.app-sidebar .nav-item:hover, .app-sidebar a.nav-item:hover { color: var(--accent-text) !important; }
.app-sidebar .nav-item.active, .app-sidebar a.nav-item.active { color: var(--accent-text) !important; font-weight: 700; border-left-color: var(--primary); }
.app-sidebar .nav-item .material-symbols-outlined { font-size: 1.2rem; flex-shrink: 0; width: 28px; display: flex; align-items: center; justify-content: center; line-height: 1; color: #9ca3af !important; }
.app-sidebar .nav-item:hover .material-symbols-outlined, .app-sidebar .nav-item.active .material-symbols-outlined { color: var(--primary) !important; }
.app-sidebar .nav-item-label { transition: opacity .15s; overflow: hidden; color: inherit; }
.app-shell.sidebar-collapsed .nav-item-label { opacity: 0; width: 0; overflow: hidden; }

.app-sidebar .sidebar-footer { padding: .5rem 0; border-top: 1px solid var(--border); }
.app-sidebar .nav-logout:hover { color: #b91c1c !important; }
.app-sidebar .nav-logout:hover .material-symbols-outlined { color: #b91c1c !important; }

.topbar-toggle { background: none; border: none; cursor: pointer; color: var(--text-muted); display: flex; align-items: center; justify-content: center; padding: .35rem; border-radius: 6px; line-height: 1; }
.topbar-toggle:hover { color: var(--primary); }

/* Diálogo de confirmación */
.logout-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.logout-dialog { background: #fff; border-radius: .75rem; padding: 2rem 2rem 1.5rem; width: 100%; max-width: 340px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.logout-dialog-icon { width: 52px; height: 52px; border-radius: var(--radius); background: var(--primary); display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.logout-dialog-icon .material-symbols-outlined { font-size: 1.6rem; color: #fff; line-height: 1; }
.logout-dialog-title { font-size: 1.05rem; font-weight: 800; margin: 0 0 .4rem; }
.logout-dialog-msg { font-size: .875rem; color: var(--text-muted); margin: 0 0 1.5rem; }
.logout-dialog-actions { display: flex; gap: .75rem; }
.logout-btn-no { flex: 1; background: #fff; color: var(--text-main); border: 1px solid var(--border); border-radius: var(--radius); font-weight: 600; font-size: .875rem; padding: .6rem 1rem; }
.logout-btn-no:hover { border-color: var(--text-main); }
.logout-btn-yes { flex: 1; background: var(--primary); color: #fff !important; border: none; border-radius: var(--radius); font-weight: 700; font-size: .875rem; padding: .6rem 1rem; display: flex; align-items: center; justify-content: center; gap: .35rem; text-decoration: none !important; }
.logout-btn-yes:hover { background: var(--primary-dark); }
.logout-btn-yes .material-symbols-outlined { font-size: 1rem; line-height: 1; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-page { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; background: #fff; }
.login-card { width: 100%; max-width: 380px; }

.login-title { font-size: 1.4rem; font-weight: 800; text-align: center; margin: 0 0 .25rem; }
.login-sub { color: var(--text-muted); font-size: .9rem; text-align: center; margin-bottom: 1.75rem; }
.login-label { font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); display: block; margin-bottom: .35rem; }
.login-input-wrap { position: relative; }
.login-input-icon { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: #9ca3af; font-size: 1.1rem; line-height: 1; pointer-events: none; z-index: 2; }
.login-input { height: 2.7rem; padding-left: 2.6rem; border-radius: var(--radius); }
.login-submit { height: 2.8rem; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: .5rem; border-radius: var(--radius); }
.login-alert { background: #fff; border: 1px solid #fca5a5; color: #b91c1c; border-radius: var(--radius); font-size: .88rem; padding: .6rem .85rem; margin-bottom: 1rem; }
.demo-hint { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .8rem; text-align: center; }
.demo-hint code { color: var(--accent-text); }
.login-footer { display: flex; align-items: center; gap: .4rem; justify-content: center; color: #9ca3af; font-size: .75rem; margin-top: 1rem; }

/* ============================================================
   MÓDULOS: tabs, toolbar, tablas, badges, formularios
   ============================================================ */
.tabs-bar { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.tab-btn { background: none; border: none; padding: .6rem 1.1rem; font-weight: 700; font-size: .9rem; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tab-btn:hover { color: var(--text-main); }
.tab-btn.active { color: var(--accent-text); border-bottom-color: var(--primary); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .85rem; }
.toolbar .btn { display: inline-flex; align-items: center; gap: .35rem; }
.toolbar .btn .material-symbols-outlined { font-size: 1.15rem; }
.toolbar-search { max-width: 380px; }
.toolbar-count { color: var(--text-muted); font-size: .85rem; font-weight: 600; }
.toolbar-spacer { flex: 1; }
.check { display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; font-weight: 600; cursor: pointer; margin: 0; }

.table-wrap { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; max-height: calc(100vh - 340px); }
.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.data-table th { position: sticky; top: 0; background: #fff; text-align: left; padding: .55rem .75rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); border-bottom: 2px solid var(--primary); white-space: nowrap; z-index: 1; }
.data-table td { padding: .5rem .75rem; border-bottom: 1px solid #f1f2f4; vertical-align: middle; }
.data-table tbody tr:hover { background: #fafafa; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .muted, .muted { color: var(--text-muted); font-size: .8rem; }
.data-table.inner th { position: static; }
.row-detail > td { background: #fff; }

.badge-estado { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .7rem; font-weight: 700; white-space: nowrap; background: #fff; border: 1px solid currentColor; }
.badge-estado.ok { color: #15803d; }
.badge-estado.warn { color: var(--accent-text); }
.badge-estado.err { color: #b91c1c; }

.icon-btn { background: none; border: none; padding: .15rem; border-radius: 6px; cursor: pointer; color: var(--text-muted); line-height: 1; }
.icon-btn:hover { color: var(--primary); }

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem 1rem; }
.form-grid label { display: flex; flex-direction: column; gap: .25rem; font-size: .75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.form-grid label.check { flex-direction: row; text-transform: none; font-size: .9rem; color: var(--text-main); }
.form-grid .span-3 { grid-column: span 3; }
.prog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .5rem 1rem; }
@media (max-width: 800px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-3 { grid-column: auto; } }

/* Botón flotante de instalación PWA */
.pwa-install { position: fixed; right: 1rem; bottom: 3rem; z-index: 9000; display: inline-flex; align-items: center; gap: .4rem; background: var(--primary); color: #fff; border: none; border-radius: 999px; padding: .55rem 1rem; font-weight: 800; font-size: .85rem; cursor: pointer; }
.pwa-install[hidden] { display: none; }

/* Login de dos columnas (texto a la izquierda, formulario a la derecha) — sobre blanco */
.lp-hero { flex: 1; display: flex; align-items: center; background: #fff; }
.lp-hero-inner { width: min(1100px, calc(100% - 3rem)); margin-inline: auto; display: grid; grid-template-columns: 1fr 400px; gap: 4rem; align-items: center; padding: 3rem 0; }
.lp-logo { height: 46px; display: block; margin-bottom: 2rem; border-radius: .4rem; }
.lp-chip { display: inline-flex; align-items: center; gap: .5rem; border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; padding: .3rem .75rem; font-weight: 800; margin-bottom: 1rem; }
.lp-chip-dot { width: .4rem; height: .4rem; border-radius: 999px; background: var(--primary); }
.lp-headline { font-size: clamp(2.2rem, 4.5vw, 3.4rem); font-weight: 900; line-height: 1.08; margin: 0 0 1.75rem; color: var(--text-main); }
.lp-headline span { color: var(--primary); }
.lp-companies { display: flex; flex-direction: column; gap: .75rem; max-width: 460px; }
.lp-company { display: flex; align-items: center; gap: .85rem; border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; }
.lp-company-icon { flex-shrink: 0; width: 2.3rem; height: 2.3rem; border: 1px solid var(--border); border-radius: .4rem; display: flex; align-items: center; justify-content: center; color: var(--primary); }
.lp-company > div:last-child { display: flex; flex-direction: column; gap: .1rem; }
.lp-company strong { font-size: .95rem; }
.lp-company span { color: var(--text-muted); font-size: .82rem; }
.lp-form-wrap { display: flex; justify-content: center; }
.lp-form-card { width: 100%; border: 1px solid var(--border); border-radius: .75rem; padding: 2.25rem; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.06); }
.lp-form-title { font-size: 1.4rem; font-weight: 800; margin: 0 0 .25rem; }
.lp-form-sub { color: var(--text-muted); font-size: .9rem; margin-bottom: 1.5rem; }
.lp-form-card .demo-hint { margin-top: 1.25rem; }
@media (max-width: 900px) { .lp-hero-inner { grid-template-columns: 1fr; gap: 2rem; } }
.log-pre { margin: 0; max-height: 220px; overflow: auto; font-size: .75rem; white-space: pre-wrap; word-break: break-word; color: var(--text-main); }
.form-control.is-invalid { background-image: none; }

/* ============================================================
   MIDDLEWARE BASCS - RDS CUBE
   ============================================================ */
:root {
    --ok: #15803d; --warn: #b45309; --err: #b91c1c; --info: #0b5cab;
    --ok-bg: #ecfdf3; --warn-bg: #fff7e6; --err-bg: #fef2f2; --info-bg: #eef5fc; --muted-bg: #f3f4f6;
}
body { font-size: .95rem; }
.badge-estado.info { color: var(--info); }
.badge-estado.muted { color: var(--text-muted); }
.muted { color: var(--text-muted); }
.section-title { font-size: 1rem; font-weight: 800; margin: 1.5rem 0 .6rem; }
.section-title.first { margin-top: 0; }
code { color: #0b3d75; background: #eef2f7; padding: .05rem .3rem; border-radius: .25rem; font-size: .82em; }

/* Barra superior */
.app-topbar { gap: .75rem; }
.demo-pill { background: var(--warn-bg); color: var(--warn); border: 1px solid #f3d9a4; border-radius: 999px; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: .15rem .65rem; }
.sys-chip { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 700; border: 1px solid var(--border); border-radius: 999px; padding: .15rem .7rem; }
.nav-count { margin-left: auto; margin-right: .4rem; background: var(--err); color: #fff; border-radius: 999px; font-size: .68rem; font-weight: 800; padding: .02rem .45rem; }
.app-shell.sidebar-collapsed .nav-count { display: none; }

/* Semáforos */
.dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; background: #9ca3af; flex-shrink: 0; }
.dot.big { width: .95rem; height: .95rem; }
.dot.ok { background: #22a35a; box-shadow: 0 0 0 3px rgba(34,163,90,.18); }
.dot.warn { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.22); }
.dot.err { background: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.2); }

/* Diagrama de flujo del panel */
.flow-diagram { display: grid; grid-template-columns: 200px 1fr 200px; gap: 1rem; align-items: stretch; margin-bottom: 1.25rem; }
.sys-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .2rem; justify-content: center; }
.sys-name { font-weight: 800; font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; }
.sys-state { font-size: .8rem; margin-top: .35rem; }
.flow-arrows { display: flex; flex-direction: column; gap: .5rem; justify-content: center; }
.flow-line { display: flex; align-items: center; gap: .5rem; color: var(--text-muted); font-size: .82rem; font-weight: 600; border-bottom: 1px dashed var(--border); padding-bottom: .4rem; }
.flow-line:last-child { border-bottom: none; padding-bottom: 0; border-top: 1px dashed var(--border); padding-top: .4rem; }
.flow-line .material-symbols-outlined { color: var(--primary); }
.flow-mid { display: flex; align-items: center; justify-content: center; gap: .6rem; flex-wrap: wrap; text-align: center; }
.flow-mid .material-symbols-outlined { color: var(--primary); }
@media (max-width: 900px) { .flow-diagram { grid-template-columns: 1fr; } }

/* Indicadores */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: .5rem; }
.kpi { border: 1px solid var(--border); border-left: 4px solid var(--info); border-radius: var(--radius); padding: .7rem .9rem; display: flex; flex-direction: column; }
.kpi.ok { border-left-color: #22a35a; } .kpi.warn { border-left-color: #f59e0b; } .kpi.err { border-left-color: #dc2626; } .kpi.muted { border-left-color: #9ca3af; }
.kpi-n { font-size: 1.7rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-l { font-size: .75rem; color: var(--text-muted); font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }
.table-wrap.short { max-height: 340px; }
.data-table td.wrap { white-space: normal; max-width: 340px; }
.data-table.selectable tbody tr { cursor: pointer; }
.data-table.selectable tbody tr.selected { background: var(--info-bg); }
.data-table tr.row-current { background: var(--info-bg); font-weight: 700; }
.data-table tr.row-diff { background: var(--err-bg); }

/* Bitácora */
.log-list { border: 1px solid var(--border); border-radius: var(--radius); padding: .35rem .6rem; margin-bottom: .5rem; max-height: 330px; overflow: auto; }
.log-row { display: flex; gap: .6rem; align-items: baseline; padding: .22rem 0; border-bottom: 1px solid #f1f2f4; font-size: .8rem; }
.log-row:last-child { border-bottom: none; }
.log-time { color: var(--text-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.log-src { font-weight: 700; flex-shrink: 0; min-width: 5.5rem; }
.log-row.ok .log-src { color: var(--ok); } .log-row.warn .log-src { color: var(--warn); } .log-row.err .log-src { color: var(--err); }
.log-row.muted { color: var(--text-muted); }
.log-row.alert { align-items: center; } .log-row.alert .material-symbols-outlined { font-size: 1rem; color: var(--warn); }

/* Detalle de transacción */
.detail-wrap { margin-top: 1rem; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .75rem; }
.detail-title { font-weight: 800; font-size: 1.05rem; }
.advice { display: flex; gap: .4rem; align-items: flex-start; margin-top: .4rem; font-size: .85rem; color: #4b2f0a; }
.advice .material-symbols-outlined { font-size: 1.1rem; color: var(--warn); }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .6rem 1.25rem; margin-bottom: .75rem; }
.kv > div { display: flex; flex-direction: column; font-size: .88rem; }
.kv > div > span { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 700; }
.kv-row { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.kv-row label { font-weight: 700; font-size: .85rem; }
.json-edit { font-family: ui-monospace, Consolas, monospace; font-size: .78rem; }
.log-pre { background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .8rem; max-height: 340px; }
.toolbar-select { max-width: 260px; }
.empty-ok { display: flex; gap: .9rem; align-items: center; }
.empty-ok .material-symbols-outlined { color: #22a35a; font-size: 2rem; }
.btn-sm .material-symbols-outlined { font-size: 1.05rem; }

/* Pedidos y trazabilidad */
.pedido { margin-bottom: .85rem; padding: 1rem 1.25rem; }
.pedido-head { display: flex; align-items: center; gap: .6rem; cursor: pointer; }
.orden { border-top: 1px solid var(--border); margin-top: .9rem; padding-top: .8rem; }
.orden-head { display: flex; justify-content: space-between; margin-bottom: .6rem; font-size: .9rem; }
.orden-links { display: flex; gap: 1.25rem; margin-top: .35rem; font-size: .78rem; }
.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; margin-bottom: .75rem; }
.step { display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; font-size: .72rem; font-weight: 700; color: #9ca3af; position: relative; }
.step::before { content: ""; position: absolute; top: .85rem; left: -50%; width: 100%; height: 2px; background: var(--border); z-index: 0; }
.step:first-child::before { display: none; }
.step-dot { position: relative; z-index: 1; width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 2px solid var(--border); background: #fff; display: flex; align-items: center; justify-content: center; font-size: .72rem; }
.step.done { color: var(--ok); } .step.done .step-dot { background: #22a35a; border-color: #22a35a; color: #fff; } .step.done::before { background: #22a35a; }
.step.current { color: var(--info); } .step.current .step-dot { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px rgba(11,92,171,.15); } .step.current::before { background: #22a35a; }
.step.skip { opacity: .4; }

/* Simulador */
.sim-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 1100px) { .sim-grid { grid-template-columns: 1fr; } }
.sim-col { display: flex; flex-direction: column; gap: 1.25rem; }
.sim-card { padding: 1.1rem 1.25rem; }
.sim-group { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; }
.sim-group h3 { flex-basis: 100%; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: .25rem 0 .1rem; font-weight: 800; }
.sim-group .btn { font-size: .8rem; padding: .3rem .65rem; }
.sim-group select { flex-basis: 100%; }
.sim-msg { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.card-panel.detail { padding: 1.1rem 1.25rem; }
.alert-info { background: var(--info-bg); border-color: #c9ddf3; color: #0b3d75; }
