:root {
    --tms-bg: #F0F4FA;
    --tms-rail-bg: #ffffff;
    --tms-panel-bg: #ffffff;
    --tms-surface: #ffffff;
    --tms-primary: #2a5298;
    --tms-primary-glow: rgba(42, 82, 152, 0.15);
    --tms-accent: #2a5298;
    --tms-accent-muted: rgba(42, 82, 152, 0.08);
    --tms-panel-border: rgba(42, 82, 152, 0.15);
    --tms-text: #0f1c33;
    --tms-text-muted: #64748b;
    --tms-text-dim: #a0aec0;
    --tms-font: 'Space Grotesk', 'Inter', 'Segoe UI', sans-serif;
    --tms-mono: 'Space Mono', 'Consolas', 'SFMono-Regular', monospace;
    --tms-rail-w: 76px;
    --tms-panel-w: 228px;
    --tms-radius: 8px;
    --tms-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
    height: 100%;
    background: var(--tms-bg);
    font-family: var(--tms-font);
    color: var(--tms-text);
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
    white-space: pre-line;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ── App loading splash ──────────────────────────────────── */
.tms-splash {
    position: fixed;
    inset: 0;
    background: #F0F4FA;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

.tms-splash-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.tms-splash-logo {
    width: 60px;
    height: 60px;
    background: #2a5298;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
    box-shadow: 0 4px 24px rgba(42, 82, 152, 0.3);
    animation: tms-logo-pulse 2.2s ease-in-out infinite;
}

@keyframes tms-logo-pulse {
    0%,  100% { transform: scale(1);    box-shadow: 0 4px 24px rgba(42, 82, 152, 0.30); }
    50%        { transform: scale(1.06); box-shadow: 0 8px 32px rgba(42, 82, 152, 0.48); }
}

.tms-splash-title {
    font-size: 30px;
    font-weight: 700;
    color: #0f1c33;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.tms-splash-sub {
    font-size: 13px;
    color: #64748b;
    font-weight: 400;
    letter-spacing: 0.01em;
    margin-bottom: 36px;
}

.tms-splash-track {
    width: 220px;
    height: 3px;
    background: rgba(42, 82, 152, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}

.tms-splash-fill {
    height: 100%;
    width: var(--blazor-load-percentage, 0%);
    background: linear-gradient(90deg, #2a5298 0%, #4f8ef7 100%);
    border-radius: 2px;
    transition: width 0.12s ease-out;
}

.tms-splash-pct {
    font-size: 11px;
    color: #a0aec0;
    font-family: 'Consolas', 'SFMono-Regular', monospace;
    letter-spacing: 0.06em;
    height: 16px;
    min-width: 90px;
    text-align: center;
}

code {
    color: #c02d76;
}

/* ── Catálogos / grids CRUD ─────────────────────────────── */
.catalog-page {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.catalog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.9rem;
    margin-bottom: 0.1rem;
}

.catalog-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--tms-text);
    letter-spacing: -0.02em;
    margin: 0 0 2px;
    font-family: var(--tms-font);
}

.catalog-sub {
    font-size: 12px;
    color: var(--tms-text-muted);
    margin: 0;
    font-family: var(--tms-font);
}

.catalog-btn-new {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--tms-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    min-height: 34px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--tms-font);
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(42, 82, 152, 0.22);
    transition: all var(--tms-transition);
}

.catalog-btn-new:hover {
    background: #3a6bcc;
    box-shadow: 0 4px 12px rgba(42, 82, 152, 0.22);
    transform: translateY(-1px);
}

.catalog-btn-new:active {
    transform: translateY(0);
}

.catalog-btn-new svg {
    flex-shrink: 0;
}

.catalog-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.catalog-stats > * {
    flex: 0 1 220px;
}

.catalog-stats > .date-range-filter {
    flex: 0 1 auto;
}

.date-range-filter {
    position: relative;
}

@keyframes dateRangeDropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.date-range-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--tms-surface);
    border: 1.5px solid var(--tms-panel-border);
    border-radius: 10px;
    font-family: var(--tms-font);
    cursor: pointer;
    transition: border-color var(--tms-transition), box-shadow var(--tms-transition);
}

.date-range-trigger:hover {
    border-color: rgba(42, 82, 152, 0.32);
}

.date-range-trigger:focus-visible {
    outline: none;
    border-color: var(--tms-primary);
    box-shadow: 0 0 0 3px var(--tms-primary-glow);
}

.date-range-trigger.is-open {
    border-color: var(--tms-primary);
    box-shadow: 0 0 0 3px var(--tms-primary-glow);
}

.date-range-trigger-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}

.date-range-trigger-label {
    font-family: var(--tms-mono);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--tms-text);
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.date-range-trigger-preset {
    font-size: 11px;
    color: var(--tms-text-muted);
    white-space: nowrap;
}

.date-range-chevron {
    transition: transform 200ms;
    flex-shrink: 0;
}

.date-range-chevron.is-open {
    transform: rotate(180deg);
}

.date-range-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
}

.date-range-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 50;
    display: flex;
    background: var(--tms-surface);
    border: 1.5px solid rgba(42, 82, 152, 0.15);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(42, 82, 152, 0.18);
    overflow: hidden;
    width: 660px;
    max-width: calc(100vw - 32px);
    animation: dateRangeDropIn 140ms cubic-bezier(0.4, 0, 0.2, 1);
}

.date-range-presets {
    width: 300px;
    padding: 12px;
    border-right: 1px solid rgba(42, 82, 152, 0.1);
    max-height: 400px;
    overflow-y: auto;
}

.date-range-preset-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 10px;
    margin-bottom: 1px;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    text-align: left;
    font-family: var(--tms-font);
    font-size: 13px;
    background: transparent;
    color: var(--tms-text);
    font-weight: 400;
    transition: background var(--tms-transition), color var(--tms-transition);
}

.date-range-preset-item:hover {
    background: rgba(42, 82, 152, 0.06);
}

.date-range-preset-item:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--tms-primary-glow);
}

.date-range-preset-item.is-active {
    background: rgba(42, 82, 152, 0.1);
    color: var(--tms-primary);
    font-weight: 600;
}

.date-range-preset-item-label {
    display: flex;
    align-items: center;
    gap: 11px;
}

.date-range-preset-item-label span {
    white-space: nowrap;
}

.date-range-preset-divider {
    height: 1px;
    background: rgba(42, 82, 152, 0.1);
    margin: 6px 4px;
}

.date-range-custom {
    width: 330px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.date-range-custom-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--tms-text);
}

.date-range-custom-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.date-range-custom-field label {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--tms-text-muted);
}

.date-range-custom-field input[type="date"] {
    padding: 9px 10px;
    border-radius: 8px;
    border: 1.5px solid rgba(42, 82, 152, 0.18);
    font-size: 13px;
    font-family: var(--tms-font);
    color: var(--tms-text);
    background: var(--tms-surface);
    outline: none;
    transition: border-color var(--tms-transition), box-shadow var(--tms-transition);
}

.date-range-custom-field input[type="date"]:hover {
    border-color: rgba(42, 82, 152, 0.3);
}

.date-range-custom-field input[type="date"]:focus-visible {
    border-color: var(--tms-primary);
    box-shadow: 0 0 0 3px var(--tms-primary-glow);
}

.date-range-error {
    font-size: 11.5px;
    color: #dc2626;
}

.date-range-custom-spacer {
    flex: 1;
}

.date-range-custom-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid rgba(42, 82, 152, 0.1);
}

.date-range-btn-cancel {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1.5px solid rgba(42, 82, 152, 0.18);
    background: var(--tms-surface);
    color: var(--tms-text-muted);
    font-size: 12.5px;
    font-weight: 600;
    font-family: var(--tms-font);
    cursor: pointer;
    transition: border-color var(--tms-transition), color var(--tms-transition);
}

.date-range-btn-cancel:hover {
    border-color: rgba(42, 82, 152, 0.32);
    color: var(--tms-text);
}

.date-range-btn-cancel:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--tms-primary-glow);
}

.date-range-btn-apply {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    background: var(--tms-primary);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    font-family: var(--tms-font);
    cursor: pointer;
    transition: background var(--tms-transition);
}

.date-range-btn-apply:hover:not(:disabled) {
    background: #1e3f78;
}

.date-range-btn-apply:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--tms-primary-glow);
}

.date-range-btn-apply:disabled {
    background: rgba(42, 82, 152, 0.4);
    cursor: not-allowed;
}

@media (max-width: 720px) {
    .date-range-popover {
        flex-direction: column;
        width: 320px;
    }

    .date-range-presets,
    .date-range-custom {
        width: 100%;
        border-right: none;
    }

    .date-range-presets {
        border-bottom: 1px solid rgba(42, 82, 152, 0.1);
    }
}

/* ── Año/Semana filter (calendario semanal, ej. dashboard de combustible) ─── */
.anio-semana-filter {
    position: relative;
}

.anio-semana-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    background: var(--tms-surface);
    border: 1.5px solid rgba(42, 82, 152, 0.15);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(42, 82, 152, 0.18);
    overflow: hidden;
    width: 340px;
    max-width: calc(100vw - 32px);
    animation: dateRangeDropIn 140ms cubic-bezier(0.4, 0, 0.2, 1);
}

.anio-semana-columns {
    display: flex;
}

.anio-semana-column {
    width: 50%;
    padding: 12px;
}

.anio-semana-column:first-child {
    border-right: 1px solid rgba(42, 82, 152, 0.1);
}

.anio-semana-column-title {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--tms-text-muted);
    padding: 0 6px 8px;
}

.anio-semana-list {
    max-height: 220px;
    overflow-y: auto;
}

.anio-semana-footer {
    padding: 12px;
}

@media (max-width: 480px) {
    .anio-semana-popover {
        width: 300px;
    }
}

.notif-bell {
    position: relative;
}

.notif-bell-trigger {
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(42, 82, 152, 0.14);
    border-radius: 8px;
    background: var(--tms-bg);
    color: var(--tms-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all var(--tms-transition);
}

.notif-bell-trigger:hover {
    background: var(--tms-accent-muted);
    border-color: rgba(42, 82, 152, 0.3);
    color: var(--tms-accent);
}

.notif-bell-trigger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--tms-primary-glow);
}

.notif-bell-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: #fff;
    border-radius: 999px;
    border: 1.5px solid var(--tms-surface);
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1;
}

.notif-bell-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
}

.notif-bell-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 50;
    width: 340px;
    max-width: calc(100vw - 32px);
    max-height: 420px;
    display: flex;
    flex-direction: column;
    background: var(--tms-surface);
    border: 1.5px solid rgba(42, 82, 152, 0.15);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(42, 82, 152, 0.18);
    overflow: hidden;
    animation: dateRangeDropIn 140ms cubic-bezier(0.4, 0, 0.2, 1);
}

.notif-bell-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(42, 82, 152, 0.1);
}

.notif-bell-header strong {
    font-size: 13px;
    color: var(--tms-text);
}

.notif-bell-mark-all {
    border: none;
    background: transparent;
    color: var(--tms-primary);
    font-size: 11px;
    font-weight: 600;
    font-family: var(--tms-font);
    cursor: pointer;
    padding: 2px 4px;
}

.notif-bell-mark-all:hover {
    text-decoration: underline;
}

.notif-bell-list {
    overflow-y: auto;
}

.notif-bell-empty {
    padding: 24px 14px;
    text-align: center;
    color: var(--tms-text-muted);
    font-size: 12.5px;
}

.notif-bell-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 10px 14px;
    border: none;
    border-bottom: 1px solid rgba(42, 82, 152, 0.06);
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background var(--tms-transition);
}

.notif-bell-item:hover {
    background: rgba(42, 82, 152, 0.05);
}

.notif-bell-item:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--tms-primary-glow);
}

.notif-bell-item.is-unread {
    background: rgba(42, 82, 152, 0.04);
}

.notif-bell-item.is-unread .notif-bell-item-message {
    font-weight: 600;
}

.notif-bell-item-message {
    font-size: 12.5px;
    color: var(--tms-text);
    line-height: 1.35;
}

.notif-bell-item-date {
    font-size: 10.5px;
    color: var(--tms-text-muted);
}

/* ── User profile menu (header user-chip + avatar upload popover) ─── */
.user-menu {
    position: relative;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.24rem 0.6rem 0.24rem 0.24rem;
    background: var(--tms-bg);
    border: 1px solid rgba(42, 82, 152, 0.12);
    border-radius: 999px;
    cursor: pointer;
    font-family: var(--tms-font);
    transition: all var(--tms-transition);
}

.user-chip:hover {
    border-color: rgba(42, 82, 152, 0.3);
}

.user-chip:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--tms-primary-glow);
}

.user-avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #2a5298, #4f8ef7);
    color: #fff;
    font-weight: 700;
    font-size: 0.68rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar-photo {
    object-fit: cover;
}

.user-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    text-align: left;
}

.user-role {
    font-size: 0.6rem;
    color: var(--tms-text-muted);
}

.user-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--tms-text);
}

.user-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
}

.user-menu-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 50;
    width: 280px;
    max-width: calc(100vw - 32px);
    display: flex;
    flex-direction: column;
    background: var(--tms-surface);
    border: 1.5px solid rgba(42, 82, 152, 0.15);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(42, 82, 152, 0.18);
    overflow: hidden;
    animation: dateRangeDropIn 140ms cubic-bezier(0.4, 0, 0.2, 1);
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 14px;
    border-bottom: 1px solid rgba(42, 82, 152, 0.1);
}

.user-menu-avatar-lg {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #2a5298, #4f8ef7);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-menu-identity {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.user-menu-identity strong {
    font-size: 12.5px;
    color: var(--tms-text);
}

.user-menu-identity span {
    font-size: 11px;
    color: var(--tms-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 14px;
}

.user-menu-actions {
    display: flex;
    gap: 0.5rem;
}

.user-menu-error {
    font-size: 11.5px;
    color: #ef4444;
}

@media (max-width: 640px) {
    .user-text { display: none; }
}

/* ── Dashboard document layout (shared by any module dashboard) ─── */
.dashboard-filter-panel,
.dashboard-panel {
    background: var(--tms-surface);
    border: 1px solid rgba(42, 82, 152, 0.12);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(24, 50, 88, 0.05);
}

.dashboard-filter-panel {
    padding: 1rem;
}

.dashboard-filter-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(140px, 1fr));
    gap: 0.85rem;
}

.dashboard-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 0.9rem;
}

.dashboard-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.7rem;
}

.dashboard-section-heading.compact {
    margin: 0;
    padding: 1rem 1rem 0.8rem;
    border-bottom: 1px solid rgba(42, 82, 152, 0.1);
}

.dashboard-section-heading h2 {
    margin: 0;
    color: var(--tms-text);
    font-size: 1rem;
    font-weight: 700;
}

.dashboard-section-heading p {
    margin: 0.18rem 0 0;
    color: var(--tms-text-muted);
    font-size: 0.76rem;
}

.dashboard-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #edf3fc;
    color: var(--tms-primary);
    font-weight: 800;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(150px, 1fr));
    gap: 0.75rem;
}

.dashboard-kpi-grid.financial {
    grid-template-columns: repeat(5, minmax(175px, 1fr));
}

.dashboard-kpi {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 116px;
    padding: 0.9rem 1rem;
    overflow: hidden;
    border: 1px solid rgba(42, 82, 152, 0.14);
    border-radius: 11px;
    background: #fff;
    color: var(--tms-text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 2px 9px rgba(24, 50, 88, 0.05);
    transition: transform var(--tms-transition),
        border-color var(--tms-transition),
        box-shadow var(--tms-transition);
}

.dashboard-kpi::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--tms-primary);
    content: "";
}

.dashboard-kpi:hover {
    border-color: rgba(42, 82, 152, 0.4);
    box-shadow: 0 7px 18px rgba(24, 50, 88, 0.11);
    transform: translateY(-2px);
}

.dashboard-kpi:focus-visible,
.dashboard-task:focus-visible {
    outline: 3px solid rgba(42, 82, 152, 0.25);
    outline-offset: 2px;
}

.dashboard-kpi.is-warning::before {
    background: #d49318;
}

.dashboard-kpi.is-danger::before {
    background: #cf3e4f;
}

.dashboard-kpi.is-info::before {
    background: #2588ad;
}

.dashboard-kpi.is-success::before {
    background: #25875f;
}

.dashboard-kpi-label {
    color: var(--tms-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.dashboard-kpi strong {
    margin-top: auto;
    color: #204f96;
    font-family: var(--tms-mono);
    font-size: 1.7rem;
    line-height: 1.1;
}

.dashboard-kpi strong.dashboard-money {
    font-size: 1.12rem;
}

.dashboard-kpi small {
    margin-top: 0.25rem;
    color: var(--tms-text-muted);
    font-size: 0.72rem;
}

.dashboard-columns {
    display: grid;
    grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
    gap: 1rem;
}

.dashboard-flow {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem;
}

.dashboard-flow-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.35rem;
    color: #40536e;
    font-size: 0.78rem;
}

.dashboard-flow-meta strong {
    color: var(--tms-text);
    font-family: var(--tms-mono);
}

.dashboard-flow-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #eaf0f7;
}

.dashboard-flow-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #24549a, #4e80d0);
}

.dashboard-task-list {
    display: flex;
    flex-direction: column;
    max-height: 300px;
    overflow-y: auto;
}

.dashboard-task {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.78rem 1rem;
    border: 0;
    border-bottom: 1px solid rgba(42, 82, 152, 0.09);
    background: #fff;
    color: var(--tms-text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color var(--tms-transition);
}

.dashboard-task:last-child {
    border-bottom: 0;
}

.dashboard-task:hover {
    background: #f5f8fc;
}

.dashboard-task > span:first-child {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dashboard-task strong {
    color: var(--tms-primary);
    font-family: var(--tms-mono);
    font-size: 0.78rem;
}

.dashboard-task small {
    overflow: hidden;
    color: var(--tms-text-muted);
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-task-action {
    flex-shrink: 0;
    padding: 0.26rem 0.5rem;
    border-radius: 999px;
    background: #edf3fc;
    color: var(--tms-primary);
    font-size: 0.7rem;
    font-weight: 700;
}

.dashboard-empty {
    padding: 2rem 1rem;
    color: var(--tms-text-muted);
    font-size: 0.8rem;
    text-align: center;
}

.dashboard-aging {
    display: grid;
    grid-template-columns: repeat(5, minmax(155px, 1fr));
    gap: 0.7rem;
    padding: 1rem;
}

.dashboard-aging-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.75rem;
    border: 1px solid #dce5f1;
    border-radius: 9px;
    background: #f8fafd;
}

.dashboard-aging-row div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.dashboard-aging-row strong {
    color: var(--tms-text);
    font-size: 0.76rem;
}

.dashboard-aging-row small {
    color: var(--tms-text-muted);
    font-size: 0.68rem;
}

.dashboard-aging-row > span {
    color: #385678;
    font-family: var(--tms-mono);
    font-size: 0.74rem;
    font-weight: 700;
    text-align: right;
}

.taller-alert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
}

.taller-alert-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.85rem;
    border: 1px solid rgba(42, 82, 152, 0.14);
    border-radius: 10px;
    background: #fff;
}

.taller-alert-card-head {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.taller-alert-card-head strong {
    color: var(--tms-text);
    font-family: var(--tms-mono);
    font-size: 0.95rem;
}

.taller-alert-card-head span {
    color: var(--tms-text-muted);
    font-size: 0.74rem;
}

.taller-alert-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.taller-alert-card-body div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.74rem;
    color: var(--tms-text-muted);
}

.taller-alert-card-body strong {
    color: var(--tms-text);
    font-family: var(--tms-mono);
    font-size: 0.78rem;
}

@media (max-width: 1500px) {
    .dashboard-filter-grid {
        grid-template-columns: repeat(4, minmax(155px, 1fr));
    }

    .dashboard-kpi-grid {
        grid-template-columns: repeat(3, minmax(175px, 1fr));
    }

    .dashboard-kpi-grid.financial {
        grid-template-columns: repeat(3, minmax(175px, 1fr));
    }
}

@media (max-width: 900px) {
    .dashboard-filter-grid,
    .dashboard-kpi-grid,
    .dashboard-kpi-grid.financial,
    .dashboard-aging {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
    }

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

@media (max-width: 560px) {
    .dashboard-filter-grid,
    .dashboard-kpi-grid,
    .dashboard-kpi-grid.financial,
    .dashboard-aging {
        grid-template-columns: 1fr;
    }

    .dashboard-filter-actions {
        justify-content: stretch;
    }

    .dashboard-filter-actions button {
        flex: 1;
    }
}

.purchase-state-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin: 0 0 1rem;
}

.purchase-state-tab {
    padding: .65rem .9rem;
    border: 1px solid #d7e0ed;
    border-radius: 9px;
    background: #fff;
    color: #53657f;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.purchase-state-tab:hover {
    border-color: #9fb3cf;
    color: #24549a;
}

.purchase-state-tab:focus-visible {
    outline: none;
    border-color: #24549a;
    box-shadow: 0 0 0 3px rgba(36, 84, 154, .18);
}

.purchase-state-tab:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.purchase-state-tab span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    margin-left: .35rem;
    padding: .08rem .35rem;
    border-radius: 999px;
    background: #edf2f8;
}

.purchase-state-tab.is-active {
    border-color: #24549a;
    background: #24549a;
    color: #fff;
}

.purchase-state-tab.is-active span {
    background: rgba(255, 255, 255, .2);
}

.app-file-picker {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    min-height: 46px;
    padding: .35rem;
    overflow: hidden;
    border: 1px solid #cad6e7;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.app-file-picker:hover {
    border-color: #9fb3cf;
    background: #fff;
}

.app-file-picker:focus-within {
    border-color: #24549a;
    box-shadow: 0 0 0 3px rgba(36, 84, 154, .18);
}

.app-file-picker input[type="file"] {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.app-file-picker-button {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: .5rem .85rem;
    border-radius: 6px;
    background: var(--tms-primary);
    color: #fff;
    font-size: .84rem;
    font-weight: 700;
}

.app-file-picker-name {
    min-width: 0;
    overflow: hidden;
    color: #637795;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-card {
    background: var(--tms-surface);
    border: 1px solid rgba(42, 82, 152, 0.14);
    border-radius: var(--tms-radius);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 6px rgba(42, 82, 152, 0.05);
}

.stat-num {
    font-size: 24px;
    font-weight: 700;
    font-family: var(--tms-mono);
    letter-spacing: -0.03em;
    line-height: 1;
}

.stat-lbl {
    font-size: 11px;
    color: var(--tms-text-muted);
    font-family: var(--tms-font);
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.catalog-grid-wrap {
    background: var(--tms-surface);
    border-radius: var(--tms-radius);
    overflow: hidden;
}

.cell-key,
.cell-id {
    font-family: var(--tms-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--tms-accent);
}

.report-fault-folio {
    font-family: var(--tms-mono);
    font-size: 20px;
    font-weight: 700;
    color: var(--tms-primary);
    margin: 0.5rem 0 1.25rem;
}

.cell-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Acción canónica para botones y enlaces dentro de grids. */
.purchase-order-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    min-height: 32px;
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(42, 82, 152, 0.3);
    border-radius: 7px;
    background: #fff;
    color: var(--tms-primary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--tms-transition),
        border-color var(--tms-transition),
        color var(--tms-transition),
        box-shadow var(--tms-transition),
        transform var(--tms-transition);
}

.purchase-order-action:hover {
    border-color: var(--tms-primary);
    background: var(--tms-primary);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.purchase-order-action:focus-visible {
    outline: 3px solid rgba(42, 82, 152, 0.25);
    outline-offset: 2px;
}

.purchase-order-action:disabled,
.purchase-order-action[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* Reportes del módulo de Compras. */
.purchase-reports-page {
    gap: 1rem;
}

.purchase-report-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.purchase-report-tab {
    min-height: 38px;
    padding: 0.55rem 0.9rem;
    border: 1px solid #d7e0ed;
    border-radius: 9px;
    background: #fff;
    color: #53657f;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color var(--tms-transition),
        border-color var(--tms-transition),
        color var(--tms-transition),
        box-shadow var(--tms-transition);
}

.purchase-report-tab:hover {
    border-color: var(--tms-primary);
    color: var(--tms-primary);
}

.purchase-report-tab:focus-visible {
    outline: 3px solid rgba(42, 82, 152, 0.25);
    outline-offset: 2px;
}

.purchase-report-tab.is-active {
    border-color: var(--tms-primary);
    background: var(--tms-primary);
    color: #fff;
    box-shadow: 0 3px 9px rgba(42, 82, 152, 0.18);
}

.purchase-report-result {
    overflow: hidden;
    border: 1px solid rgba(42, 82, 152, 0.12);
    border-radius: 12px;
    background: var(--tms-surface);
    box-shadow: 0 2px 10px rgba(24, 50, 88, 0.05);
}

.purchase-report-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(42, 82, 152, 0.1);
}

.purchase-report-heading span,
.purchase-report-summary span {
    color: var(--tms-text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.purchase-report-heading h2 {
    margin: 0.1rem 0 0;
    color: var(--tms-text);
    font-size: 1rem;
}

.purchase-report-heading p {
    margin: 0.15rem 0 0;
    color: var(--tms-text-muted);
    font-size: 0.72rem;
}

.purchase-report-export-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.purchase-report-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 220px));
    gap: 0.65rem;
    padding: 0.8rem 1rem;
    background: #f7f9fc;
}

.purchase-report-summary > div {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid #dde6f2;
    border-radius: 8px;
    background: #fff;
}

.purchase-report-summary strong {
    color: var(--tms-primary);
    font-family: var(--tms-mono);
    font-size: 1rem;
}

@media (max-width: 680px) {
    .purchase-report-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .purchase-report-summary {
        grid-template-columns: 1fr;
    }
}

.catalog-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 0.35rem;
}

.catalog-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.catalog-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--tms-text);
}

.catalog-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.catalog-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--tms-text);
    cursor: pointer;
    user-select: none;
    padding: 2px 0;
}

.catalog-check input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--tms-accent, #2563eb);
    outline-offset: 2px;
}

.btn-cancel,
.btn-save,
.btn-delete {
    border: none;
    border-radius: var(--tms-radius);
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-cancel {
    background: #e2e8f0;
    color: #334155;
}

.btn-save {
    background: var(--tms-primary);
    color: #fff;
}

.btn-delete {
    background: #dc2626;
    color: #fff;
}

.btn-save:disabled {
    opacity: .75;
    cursor: not-allowed;
}

/* ── Almacén ───────────────────────────────────────────── */
.warehouse-form-scroll { max-height: 67vh; overflow-y: auto; padding: 0 5px 4px 1px; }
.warehouse-section-title { margin: 16px 0 9px; font-size: 13px; color: var(--tms-primary); border-bottom: 1px solid rgba(42,82,152,.12); padding-bottom: 6px; }
.warehouse-form-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.warehouse-form-grid .span-2 { grid-column: span 2; }
.warehouse-section-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.catalog-btn-new.compact { min-height:28px; padding:5px 10px; font-size:11px; }
.warehouse-empty { padding:22px; text-align:center; color:var(--tms-text-muted); background:#f8fafc; border:1px dashed #cbd5e1; border-radius:8px; }
.warehouse-inventory-table { overflow-x:auto; border:1px solid #e2e8f0; border-radius:8px; }
.warehouse-inventory-table table { width:100%; border-collapse:collapse; min-width:850px; }
.warehouse-inventory-table th { background:#f8fafc; color:var(--tms-text-muted); font-size:11px; text-align:left; padding:8px; }
.warehouse-inventory-table td { border-top:1px solid #e2e8f0; padding:7px; }
.warehouse-inventory-table td:first-child { min-width:190px; }
.product-detail-grid { overflow:hidden; border:1px solid #e2e8f0; border-radius:8px; }
.product-check-field { display:flex; align-items:center; gap:10px; min-height:54px; padding:9px 11px; border:1px solid #cbd5e1; border-radius:7px; background:#f8fafc; cursor:pointer; }
.product-check-field input { width:17px; height:17px; accent-color:var(--tms-primary); }
.product-check-field span,.product-check-field strong,.product-check-field small { display:block; }
.product-check-field strong { color:var(--tms-text); font-size:12px; }
.product-check-field small { margin-top:2px; color:var(--tms-text-muted); font-size:10px; }
.product-kit-action-field { display:flex; flex-direction:column; justify-content:center; gap:4px; min-height:54px; }
.product-kit-action-field small { color:var(--tms-text-muted); font-size:10px; }
.product-kit-action { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:34px; padding:7px 10px; border:1px solid rgba(42,82,152,.3); border-radius:7px; background:#eff6ff; color:var(--tms-primary); font:600 11px var(--tms-font); cursor:pointer; }
.product-kit-action span { display:inline-flex; align-items:center; justify-content:center; min-width:22px; padding:2px 6px; border-radius:999px; background:var(--tms-primary); color:#fff; font:700 10px var(--tms-mono); }
.product-kit-action:disabled { opacity:.5; cursor:not-allowed; }
.product-kit-dialog-head { margin-bottom:10px; }
.product-kit-dialog-head strong,.product-kit-dialog-head small { display:block; }
.product-kit-dialog-head strong { color:var(--tms-text); font-size:13px; }
.product-kit-dialog-head small { margin-top:2px; color:var(--tms-text-muted); font-size:10px; }
.product-kit-validation { margin-bottom:10px; }
.inventory-lock { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; color:#94a3b8; font-size:10px; cursor:not-allowed; }
.inventory-remove { border:0; background:#fee2e2; color:#b91c1c; border-radius:6px; width:28px; height:28px; cursor:pointer; font-size:18px; }
.inventory-remove:disabled { opacity:.45; cursor:not-allowed; }
.grid-photo-btn { border:0; background:#e0f2fe; color:#0369a1; border-radius:6px; width:28px; height:28px; cursor:pointer; }
.product-photo-upload { display:flex; align-items:center; gap:12px; padding:10px 0 16px; }
.product-photo-upload input[type=file] { display:none; }
.product-photo-gallery { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; max-height:58vh; overflow-y:auto; }
.product-photo-card { border:1px solid #e2e8f0; border-radius:9px; padding:9px; display:flex; flex-direction:column; gap:8px; }
.product-photo-card.is-main { border-color:var(--tms-accent); box-shadow:0 0 0 2px rgba(42,82,152,.1); }
.product-photo-card img { width:100%; height:165px; object-fit:contain; background:#f8fafc; border-radius:6px; }
.product-photo-card strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.photo-main-badge { display:inline-block; margin-top:4px; padding:2px 6px; background:#dcfce7; color:#166534; border-radius:10px; font-size:10px; }
.photo-action { border:0; background:#e0f2fe; color:#0369a1; border-radius:5px; padding:5px 7px; font-size:11px; cursor:pointer; }
.photo-action.danger { background:#fee2e2; color:#b91c1c; }
.evidencia-upload-form {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.evidencia-upload-form .catalog-field {
    min-width: 220px;
    flex: 0 1 auto;
}

.evidencia-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.evidencia-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #fff;
}

.evidencia-card-type {
    align-self: flex-start;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(42, 82, 152, 0.08);
    color: var(--tms-primary);
    font-size: 11px;
    font-weight: 600;
}

.evidencia-card-name {
    font-size: 12px;
    color: var(--tms-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.evidencia-card-thumb {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 6px;
    background: #f1f5f9;
}

.category-children { margin-top:6px; padding-top:14px; border-top:1px solid #e2e8f0; }
.category-children-head { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-bottom:10px; }
.category-children-head strong { display:block; font-size:13px; color:var(--tms-text); }
.category-children-head span { display:block; margin-top:2px; font-size:10px; color:var(--tms-text-muted); }
.category-children-head .catalog-btn-new { padding:7px 11px; }
.category-children-grid { overflow:hidden; border:1px solid #e2e8f0; border-radius:8px; }
.provider-tabs { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; padding:4px; background:#f1f5f9; border-radius:9px; }
.provider-tab { display:flex; align-items:center; justify-content:center; gap:7px; border:0; border-radius:7px; padding:9px 10px; background:transparent; color:var(--tms-text-muted); font:600 12px var(--tms-font); cursor:pointer; transition:all var(--tms-transition); }
.provider-tab:hover { color:var(--tms-text); background:rgba(255,255,255,.65); }
.provider-tab.is-active { color:var(--tms-primary); background:#fff; box-shadow:0 1px 5px rgba(15,23,42,.1); }
.provider-tab-number { display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px; border-radius:50%; background:#e2e8f0; font:700 10px var(--tms-mono); }
.provider-tab.is-active .provider-tab-number { color:#fff; background:var(--tms-primary); }
.provider-tab-content { min-height:330px; padding:16px 3px 4px; }
.provider-tab-heading { margin-bottom:14px; }
.provider-tab-heading h3 { margin:0; color:var(--tms-text); font-size:15px; }
.provider-tab-heading p { margin:3px 0 0; color:var(--tms-text-muted); font-size:11px; }
.provider-form-actions { margin-top:8px; padding-top:12px; border-top:1px solid #e2e8f0; }
.provider-filter-bar, .product-filter-bar { display:grid; grid-template-columns:220px minmax(220px,280px) minmax(220px,280px) auto; align-items:stretch; gap:10px; }
.provider-filter-card, .product-filter-card { display:flex; flex-direction:column; justify-content:center; gap:5px; padding:10px 13px; background:var(--tms-surface); border:1px solid rgba(42,82,152,.14); border-radius:var(--tms-radius); box-shadow:0 1px 6px rgba(42,82,152,.05); }
.provider-filter-card label, .product-filter-card label { color:var(--tms-text-muted); font-size:10px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; }
.provider-filter-card select, .product-filter-card select { min-height:34px; padding:6px 30px 6px 9px; border:1px solid #cbd5e1; border-radius:6px; background:#fff; color:var(--tms-text); font:12px var(--tms-font); cursor:pointer; }
.provider-filter-card select:focus, .product-filter-card select:focus { outline:2px solid rgba(42,82,152,.18); border-color:var(--tms-primary); }
.inventory-capture-select { min-height:36px; padding:7px 30px 7px 10px; border:1px solid #cbd5e1; border-radius:6px; background:#fff; color:var(--tms-text); font:13px var(--tms-font); cursor:pointer; }
.inventory-capture-select:hover { border-color:#94a3b8; }
.inventory-capture-select:focus-visible { outline:2px solid rgba(42,82,152,.18); border-color:var(--tms-primary); }
.inventory-capture-select:disabled { cursor:not-allowed; opacity:.6; }
.inventory-capture-help { display:block; margin-top:5px; color:var(--tms-text-muted); font-size:11px; line-height:1.35; }
.inventory-availability-warning { color:#b45309; }
.inventory-capture-header { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:12px; padding:12px; margin-bottom:16px; border:1px solid #e2e8f0; border-radius:8px; background:#f8fafc; }
.inventory-capture-launcher { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:16px; }
.inventory-capture-launcher-card { min-height:156px; padding:18px; border:1px solid #dbe3ec; background:linear-gradient(145deg, #ffffff 0%, #f8fafc 100%); box-shadow:0 8px 18px rgba(15, 23, 42, .05); }
.inventory-capture-option-heading { display:flex; align-items:flex-start; gap:12px; }
.inventory-capture-option-heading h3 { margin:2px 0 5px; color:var(--tms-text); font-size:16px; }
.inventory-capture-option-heading p { margin:0; color:var(--tms-text-muted); font-size:12px; line-height:1.45; }
.inventory-capture-card-icon { display:inline-flex; flex:0 0 38px; align-items:center; justify-content:center; width:38px; height:38px; border-radius:10px; color:#fff; font-size:11px; font-weight:800; letter-spacing:.04em; }
.inventory-capture-card-icon.is-initial { background:linear-gradient(135deg, #2563eb, #2a5298); }
.inventory-capture-card-icon.is-adjustment { background:linear-gradient(135deg, #0f766e, #0d9488); }
.inventory-capture-option-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:22px; color:var(--tms-text-muted); font-size:11px; font-weight:700; }
@media (max-width: 760px) { .inventory-capture-launcher { grid-template-columns:1fr; } }
.inventory-recent-adjustments { margin-top:16px; }
.inventory-recent-adjustments > .inventory-capture-grid-header { padding:14px 16px 0; }
.inventory-history-hint { color:var(--tms-text-muted); font-size:11px; white-space:nowrap; }
.inventory-capture-grid-header { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:4px 0 9px; }
.inventory-capture-grid-header h4 { margin:0; color:var(--tms-text); font-size:14px; }
.inventory-capture-grid-header p { margin:3px 0 0; color:var(--tms-text-muted); font-size:11px; }
.inventory-capture-grid-wrap { overflow-x:auto; border:1px solid #e2e8f0; border-radius:8px; }
.inventory-capture-grid { width:100%; min-width:790px; border-collapse:collapse; background:#fff; }
.inventory-capture-grid th { padding:9px 10px; border-bottom:1px solid #dbe3ec; background:#f8fafc; color:var(--tms-text-muted); font-size:11px; font-weight:700; text-align:left; }
.inventory-capture-grid td { padding:8px 10px; border-bottom:1px solid #edf1f5; vertical-align:middle; }
.inventory-capture-grid tr:last-child td { border-bottom:0; }
.inventory-capture-grid th.numeric, .inventory-capture-grid td.numeric { text-align:right; }
.inventory-capture-grid th.action, .inventory-capture-grid td.action { width:72px; text-align:center; }
.inventory-capture-grid .e-control-wrapper { width:100%; }
.inventory-detail-action { min-width:52px; padding:5px 9px; font-size:11px; }
.inventory-detail-summary { display:flex; flex-wrap:wrap; gap:8px 18px; margin-bottom:12px; color:var(--tms-text-muted); font-size:12px; }
.inventory-detail-summary strong { color:var(--tms-text); }
.inventory-detail-grid { margin:0; }
.inventory-detail-observations { margin-top:12px; padding:10px 12px; border:1px solid #e2e8f0; border-radius:7px; color:var(--tms-text-muted); font-size:12px; white-space:pre-line; }
.inventory-detail-observations strong { color:var(--tms-text); }
.inventory-status-badge { display:inline-flex; align-items:center; gap:4px; margin:2px 4px 2px 0; padding:3px 8px; border:1px solid #cbd5e1; border-radius:999px; background:#f8fafc; color:var(--tms-text-muted); font-size:10px; font-weight:700; white-space:nowrap; }
.inventory-status-badge.is-success { border-color:#86efac; background:#f0fdf4; color:#166534; }
.inventory-status-badge.is-warning { border-color:#fcd34d; background:#fffbeb; color:#92400e; }
.inventory-status-badge.is-info { border-color:#93c5fd; background:#eff6ff; color:#1d4ed8; }
.inventory-status-badge.is-primary { border-color:#a5b4fc; background:#eef2ff; color:#4338ca; }
.inventory-status-badge.is-danger { border-color:#fca5a5; background:#fef2f2; color:#991b1b; }
.purchase-order-action.is-danger { border-color:#fecaca; color:#b91c1c; }
.purchase-order-action.is-danger:hover { background:#b91c1c; color:#fff; }
.inventory-history-title { margin:18px 0 8px; color:var(--tms-text); font-size:14px; }
.inventory-history-list { display:flex; flex-direction:column; gap:6px; max-height:210px; overflow:auto; padding:8px 10px; border:1px solid #e2e8f0; border-radius:8px; background:#f8fafc; }
.inventory-history-item { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:6px 0; border-bottom:1px solid #e5e7eb; color:var(--tms-text-muted); font-size:11px; }
.inventory-history-item:last-child { border-bottom:0; }
.counting-help { margin-top: 14px; padding: 12px 14px; border: 1px solid #cfe0f5; border-radius: 9px; background: #f4f8fd; color: var(--tms-text-muted); font-size: 12px; }
.counting-help-title { margin-bottom: 4px; color: var(--tms-text); font-weight: 800; }
.counting-help p { margin: 0 0 9px; line-height: 1.4; }
.counting-help-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 10px; }
.counting-help-grid span { padding: 5px 7px; border-radius: 6px; background: #fff; border: 1px solid #dce8f5; }
.counting-help-grid strong { color: var(--tms-primary); }
.counting-status-help { margin-top: 12px; padding: 10px 12px; border-radius: 7px; background: #fff8e8; border: 1px solid #f1d69a; color: #805d1c; font-size: 12px; }
@media (max-width: 700px) {
    .counting-help-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.form-help { margin:0 0 12px; color:var(--tms-text-muted); font-size:12px; line-height:1.45; }
.inventory-transfer-help { display:flex; flex-direction:column; gap:5px; margin:0 0 12px; padding:10px 12px; border:1px solid #fcd34d; border-radius:8px; background:#fffbeb; color:#78350f; font-size:11px; line-height:1.45; }
.inventory-transfer-help strong { color:#92400e; }
.inventory-transfer-help b { color:#451a03; }
.inventory-action-panel { display:flex; align-items:end; flex-wrap:wrap; gap:10px; margin:14px 0; padding:12px; border:1px solid #dbe3ec; border-radius:8px; background:#f8fafc; }
.inventory-action-panel label { display:flex; flex-direction:column; gap:5px; min-width:220px; color:var(--tms-text-muted); font-size:11px; font-weight:700; }
.inventory-action-panel .e-control-wrapper { min-width:220px; }
.text-muted { color:var(--tms-text-muted); font-size:12px; }
.kit-production-preview { margin-top:14px; padding:12px 14px; border:1px solid rgba(42,82,152,.14); border-radius:8px; background:#f8fafc; }
.kit-production-preview-heading { margin-bottom:8px; color:var(--tms-text); font-size:12px; font-weight:700; }
.kit-production-preview-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:6px 0; border-top:1px solid #e2e8f0; color:var(--tms-text-muted); font-size:12px; }
.kit-production-preview-row strong { color:var(--tms-text); font:700 12px var(--tms-mono); }
.provider-filter-result, .product-filter-result { display:flex; align-items:center; gap:7px; padding:10px 13px; color:var(--tms-text-muted); font-size:11px; }
.provider-filter-result strong, .product-filter-result strong { color:var(--tms-primary); font:700 20px var(--tms-mono); }
.provider-filter-result button, .product-filter-result button { margin-left:6px; border:0; background:transparent; color:var(--tms-primary); font-size:11px; font-weight:600; cursor:pointer; text-decoration:underline; }
@media(max-width:800px){.warehouse-form-grid{grid-template-columns:1fr 1fr}.product-photo-gallery{grid-template-columns:1fr 1fr}}
@media(max-width:1050px){.provider-filter-bar,.product-filter-bar{grid-template-columns:repeat(3,minmax(0,1fr))}.provider-filter-result,.product-filter-result{grid-column:1/-1;padding:2px 4px}}

/* ── DocumentosDialog ─────────────────────────────────────────────────── */
.edocs-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 75vh;
    overflow-y: auto;
    padding-right: 4px;
}

.edocs-form {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
    border: 1px solid rgba(42, 82, 152, 0.12);
    border-radius: 8px;
    padding: 14px;
    background: #fbfdff;
}

.edocs-col-2 { grid-column: span 2; }
.edocs-col-4 { grid-column: span 4; }
.edocs-col-5 { grid-column: 1 / -1; }

.edocs-form-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.edocs-validation-msg {
    color: #b91c1c;
    font-size: 12px;
    font-weight: 600;
}

.edocs-file-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
}

.edocs-file-button {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(42, 82, 152, 0.28);
    border-radius: 6px;
    background: #f8fafc;
    color: var(--tms-primary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 5px 10px;
    white-space: nowrap;
}

.edocs-file-button input[type="file"] {
    display: none;
}

.edocs-file-name {
    color: var(--tms-text-muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.edocs-list-wrap {
    border: 1px solid rgba(42, 82, 152, 0.12);
    border-radius: 8px;
    overflow: hidden;
}

.edocs-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid rgba(42, 82, 152, 0.12);
}

.edocs-list-head strong {
    color: var(--tms-text);
    font-size: 13px;
    font-weight: 700;
}

.edocs-list-head span {
    border-radius: 999px;
    background: rgba(42, 82, 152, 0.1);
    color: var(--tms-primary);
    font-size: 12px;
    font-weight: 700;
    min-width: 26px;
    padding: 3px 8px;
    text-align: center;
}

.edocs-list {
    display: flex;
    flex-direction: column;
    max-height: 280px;
    overflow-y: auto;
    padding: 8px;
    gap: 6px;
}

.edocs-empty {
    color: var(--tms-text-muted);
    font-size: 13px;
    padding: 14px;
    text-align: center;
}

.edocs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(42, 82, 152, 0.1);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
}

.edocs-row.is-expired {
    border-color: rgba(220, 38, 38, 0.25);
    background: #fff8f8;
}

.edocs-row-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.edocs-row-info strong {
    color: var(--tms-text);
    font-size: 13px;
    font-weight: 700;
}

.edocs-row-info span {
    color: var(--tms-text-muted);
    font-size: 12px;
}

.edocs-obs {
    color: var(--tms-text-muted);
    font-size: 11px;
    font-style: italic;
}

.edocs-vence {
    font-weight: 600;
}

.edocs-vence.is-expired {
    color: #dc2626;
}

.edocs-vence.is-warning {
    color: #d97706;
}

.edocs-link-btn {
    border: 0;
    background: transparent;
    color: var(--tms-primary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 4px;
}

.edocs-link-btn.is-danger {
    color: #dc2626;
}

.edocs-footer {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid rgba(42, 82, 152, 0.1);
    padding-top: 12px;
}

@media (max-width: 700px) {
    .edocs-form {
        grid-template-columns: 1fr;
    }
    .edocs-col-2, .edocs-col-4, .edocs-col-5 {
        grid-column: auto;
    }
}
/* ─────────────────────────────────────────────────────────────────────── */

.btn-selector-pick {
    border: 1px solid var(--tms-primary);
    border-radius: var(--tms-radius);
    background: transparent;
    color: var(--tms-primary);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    cursor: pointer;
    transition: background var(--tms-transition), color var(--tms-transition);
    white-space: nowrap;
}

.btn-selector-pick:hover {
    background: var(--tms-primary);
    color: #fff;
}

.catalog-delete-content {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: var(--tms-text);
}

.catalog-delete-content p {
    margin: 0;
}

.catalog-delete-content span {
    color: var(--tms-text-muted);
    font-size: 12px;
}

.e-grid .e-toolbar .e-search-wrapper {
    margin-left: auto;
}

.e-toast-container .e-toast.toast-card,
.e-toast-container.toast-card .e-toast {
    position: relative;
    border-radius: 14px !important;
    padding: 14px 16px 14px 60px !important;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.10) !important;
    backdrop-filter: blur(4px);
    overflow: hidden;
    transform-origin: top right;
}

.e-toast-container .e-toast.toast-card::before,
.e-toast-container.toast-card .e-toast::before {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.e-toast-container .e-toast.toast-card::after,
.e-toast-container.toast-card .e-toast::after {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 0 999px 999px 0;
}

.e-toast-container .e-toast.toast-success,
.e-toast-container.toast-success .e-toast {
    background: #ecfdf3;
    border: 1px solid #b7ebc6;
    color: #14532d;
}

.e-toast-container .e-toast.toast-success::before,
.e-toast-container.toast-success .e-toast::before {
    content: "✔";
    background: #d1fae5;
    color: #166534;
}

.e-toast-container .e-toast.toast-success::after,
.e-toast-container.toast-success .e-toast::after {
    background: #4ade80;
}

.e-toast-container .e-toast.toast-error,
.e-toast-container.toast-error .e-toast {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #7f1d1d;
}

.e-toast-container .e-toast.toast-error::before,
.e-toast-container.toast-error .e-toast::before {
    content: "⨯";
    background: #fee2e2;
    color: #b91c1c;
}

.e-toast-container .e-toast.toast-error::after,
.e-toast-container.toast-error .e-toast::after {
    background: #f87171;
}

.e-toast-container .e-toast.toast-info,
.e-toast-container.toast-info .e-toast {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
}

.e-toast-container .e-toast.toast-info::before,
.e-toast-container.toast-info .e-toast::before {
    content: "ℹ";
    background: #dbeafe;
    color: #2563eb;
}

.e-toast-container .e-toast.toast-info::after,
.e-toast-container.toast-info .e-toast::after {
    background: #60a5fa;
}

/* El popup de unidades en el mapa usa un encabezado azul a todo lo ancho;
   el boton de cerrar por defecto de Mapbox queda pegado a la esquina y su
   "x" oscura se pierde contra ese fondo. Se reposiciona y se le da contraste. */
.mapboxgl-popup-close-button {
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(15, 28, 51, 0.35);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    z-index: 10;
}

.mapboxgl-popup-close-button:hover {
    background: rgba(15, 28, 51, 0.55);
    color: #fff;
}

.e-toast-container .e-toast.toast-warning,
.e-toast-container.toast-warning .e-toast {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #78350f;
}

.e-toast-container .e-toast.toast-warning::before,
.e-toast-container.toast-warning .e-toast::before {
    content: "⚠";
    background: #fef3c7;
    color: #d97706;
}

.e-toast-container .e-toast.toast-warning::after,
.e-toast-container.toast-warning .e-toast::after {
    background: #fbbf24;
}

.e-toast-container .e-toast.toast-success .e-toast-title,
.e-toast-container .e-toast.toast-success .e-toast-message,
.e-toast-container.toast-success .e-toast .e-toast-title,
.e-toast-container.toast-success .e-toast .e-toast-message,
.e-toast-container .e-toast.toast-error .e-toast-title,
.e-toast-container .e-toast.toast-error .e-toast-message,
.e-toast-container.toast-error .e-toast .e-toast-title,
.e-toast-container.toast-error .e-toast .e-toast-message,
.e-toast-container .e-toast.toast-info .e-toast-title,
.e-toast-container .e-toast.toast-info .e-toast-message,
.e-toast-container.toast-info .e-toast .e-toast-title,
.e-toast-container.toast-info .e-toast .e-toast-message,
.e-toast-container .e-toast.toast-warning .e-toast-title,
.e-toast-container .e-toast.toast-warning .e-toast-message,
.e-toast-container.toast-warning .e-toast .e-toast-title,
.e-toast-container.toast-warning .e-toast .e-toast-message {
    color: inherit !important;
}

.e-toast-container .e-toast.toast-card .e-toast-title,
.e-toast-container.toast-card .e-toast .e-toast-title {
    font-size: 12.5px !important;
    font-weight: 700 !important;
    margin-bottom: 4px !important;
    letter-spacing: 0.01em;
}

.e-toast-container .e-toast.toast-card .e-toast-message,
.e-toast-container.toast-card .e-toast .e-toast-message {
    font-size: 12.5px !important;
    line-height: 1.45 !important;
    opacity: 0.96;
}

.e-toast-container .e-toast.toast-card .e-toast-content,
.e-toast-container.toast-card .e-toast .e-toast-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 32px;
    padding-right: 8px;
}

.e-toast-container .e-toast.toast-success .e-toast-close-icon,
.e-toast-container .e-toast.toast-error .e-toast-close-icon,
.e-toast-container .e-toast.toast-info .e-toast-close-icon,
.e-toast-container .e-toast.toast-warning .e-toast-close-icon,
.e-toast-container.toast-success .e-toast .e-toast-close-icon,
.e-toast-container.toast-error .e-toast .e-toast-close-icon,
.e-toast-container.toast-info .e-toast .e-toast-close-icon,
.e-toast-container.toast-warning .e-toast .e-toast-close-icon {
    color: inherit !important;
    opacity: 0.8;
}

.e-toast-container .e-toast.toast-card .e-toast-close-icon:hover,
.e-toast-container.toast-card .e-toast .e-toast-close-icon:hover {
    opacity: 1;
}


@media (max-width: 600px) {
    .catalog-header {
        flex-direction: column;
    }
}

/* ── Dialogs / forms / toasts ──────────────────────────── */
.e-dialog {
    border: 1px solid rgba(42, 82, 152, 0.14) !important;
    border-radius: 10px !important;
    box-shadow: 0 12px 36px rgba(42, 82, 152, 0.14) !important;
    overflow: hidden !important;
    font-family: var(--tms-font) !important;
}

.e-dialog .e-dlg-header-content {
    background: #f8faff !important;
    border-bottom: 1px solid rgba(42, 82, 152, 0.1) !important;
    padding: 12px 16px !important;
}

.e-dialog .e-dlg-header {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--tms-text) !important;
    font-family: var(--tms-font) !important;
    letter-spacing: 0.01em !important;
}

.e-dialog .e-dlg-content {
    padding: 16px !important;
    background: #fff !important;
    color: var(--tms-text) !important;
    font-family: var(--tms-font) !important;
}

.e-dialog .e-dlg-closeicon-btn {
    border-radius: 6px !important;
}

.e-dialog .e-dlg-closeicon-btn:hover {
    background: rgba(42, 82, 152, 0.08) !important;
}

.catalog-form {
    gap: 0.85rem;
    padding-top: 0.15rem;
}

.catalog-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--tms-text);
}

.catalog-field .e-input-group,
.catalog-field .e-control-wrapper {
    border: 1px solid rgba(42, 82, 152, 0.16) !important;
    border-radius: 8px !important;
    background: #f8fbff !important;
    min-height: 34px !important;
    box-shadow: none !important;
}

.catalog-field .e-input-group:hover,
.catalog-field .e-control-wrapper:hover {
    border-color: rgba(42, 82, 152, 0.24) !important;
}

.catalog-field .e-input-group.e-input-focus,
.catalog-field .e-control-wrapper.e-input-focus,
.catalog-field .e-input-group:focus-within,
.catalog-field .e-control-wrapper:focus-within {
    border-color: rgba(42, 82, 152, 0.3) !important;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.08) !important;
    background: #fff !important;
}

.catalog-field .e-input,
.catalog-field input.e-input,
.catalog-field textarea.e-input {
    font-family: var(--tms-font) !important;
    font-size: 12px !important;
    color: var(--tms-text) !important;
    background: transparent !important;
    padding: 7px 10px !important;
}

.catalog-field .e-float-text,
.catalog-field .e-input-group-icon,
.catalog-field .e-ddl-icon,
.catalog-field .e-spin-up,
.catalog-field .e-spin-down {
    color: var(--tms-text-dim) !important;
}

.catalog-form-actions {
    gap: 0.6rem;
    margin-top: 1rem;
}

.btn-cancel,
.btn-save,
.btn-delete {
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    min-height: 34px;
}

.btn-cancel {
    border: 1px solid rgba(42, 82, 152, 0.12);
}

.btn-save {
    box-shadow: 0 2px 8px rgba(42, 82, 152, 0.18);
}

.e-toast-container .e-toast {
    border-radius: 10px !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14) !important;
    padding: 10px 12px !important;
    font-family: var(--tms-font) !important;
}

.e-toast-container .e-toast .e-toast-title {
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em !important;
}

.e-toast-container .e-toast .e-toast-message {
    font-size: 12px !important;
    line-height: 1.35 !important;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
.e-grid .e-res-toolbar {
    min-height: 38px !important;
}

/* Document edit page layout (Órdenes de compra, Órdenes de servicio, y otros "documentos" con estado) */
.purchase-edit-page { padding: 1rem 1.25rem 2rem; }
.purchase-card { background: #fff; border: 1px solid #dce4ef; border-radius: 12px; padding: 1rem; margin-bottom: 1rem; }
.purchase-detail-tabs { display: flex; gap: .45rem; margin: 0 0 1rem; border-bottom: 1px solid #d7e0ed; }
.purchase-detail-tab { display: flex; align-items: center; gap: .45rem; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #64748b; padding: .7rem .9rem; font-weight: 700; cursor: pointer; }
.purchase-detail-tab span { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; padding: .05rem .35rem; border-radius: 999px; background: #e9eff7; font-size: .78rem; }
.purchase-detail-tab.is-active { color: #24549a; border-bottom-color: #24549a; }
.purchase-detail-tab.is-active span { background: #24549a; color: #fff; }
.purchase-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.purchase-form-grid .span-2, .purchase-detail-form .span-2 { grid-column: span 2; }
.purchase-form-grid .span-4 { grid-column: span 4; }
.purchase-readonly, .purchase-status { min-height: 38px; display: flex; align-items: center; padding: .5rem .7rem; background: #f4f7fb; border: 1px solid #d8e1ed; border-radius: 6px; font-size: 12px; font-weight: 500; }
.purchase-status { color: #24549a; font-weight: 700; }
.purchase-section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: 1.25rem 0 .65rem; }
.purchase-section-head h3 { margin: 0; color: #173255; }
.purchase-section-head span { display: block; color: #708198; font-size: .88rem; margin-top: .2rem; }
.purchase-detail-wrap { margin-bottom: 1rem; }
.purchase-totals { width: min(470px, 100%); margin-left: auto; background: #fff; border: 1px solid #dce4ef; border-radius: 10px; padding: .7rem 1rem; }
.purchase-totals > div { display: flex; justify-content: space-between; padding: .35rem 0; color: #52657d; }
.purchase-totals .total { border-top: 1px solid #dce4ef; margin-top: .35rem; padding-top: .7rem; color: #173255; font-size: 1.15rem; }
.purchase-actions { display: flex; justify-content: flex-end; gap: .65rem; flex-wrap: wrap; margin-top: 1.25rem; }
.btn-approve, .btn-return, .btn-print-order { border-radius: 8px; padding: .65rem 1rem; font-weight: 700; }
.btn-approve { border: 0; background: #24549a; color: #fff; }
.btn-return { background: #fff0d9; color: #925700; border: 1px solid #f0ca8e; }
.btn-print-order { display: inline-flex; align-items: center; background: #173255; color: #fff; border: 1px solid #173255; text-decoration: none; }
.btn-print-order:hover { background: #0f2340; color: #fff; }
.purchase-detail-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.purchase-log-card { background: #fff; border: 1px solid #dce4ef; border-radius: 12px; padding: 0 1rem 1rem; min-height: 240px; }
.purchase-log { display: grid; gap: .6rem; }
.purchase-log article { background: #fff; border: 1px solid #dce4ef; border-left: 4px solid #24549a; border-radius: 8px; padding: .7rem .9rem; }
.purchase-log-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.purchase-log-user { display: inline-flex; align-items: center; gap: .45rem; }
.purchase-log span { color: #708198; font-size: .85rem; }
.purchase-log p { margin: .5rem 0 0; color: #52657d; }
.purchase-log-empty { display: flex; align-items: center; justify-content: center; min-height: 150px; color: #708198; background: #f8fafc; border: 1px dashed #d7e0ed; border-radius: 8px; }

.bitacora-avatar {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.bitacora-avatar-initials {
    background: linear-gradient(135deg, #2a5298, #4f8ef7);
    color: #fff;
    font-weight: 700;
    font-size: .62rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.purchase-order-action { min-width: 58px; min-height: 30px; padding: .3rem .7rem; border: 1px solid rgba(42, 82, 152, .3); border-radius: 7px; background: #fff; color: var(--tms-primary); font-size: .82rem; font-weight: 700; cursor: pointer; }
.purchase-order-action:hover { background: var(--tms-primary); color: #fff; }
.purchase-reverse-action { border-color: #d99a9a; color: #a12626; }
.purchase-reverse-action:hover { border-color: #a12626; background: #a12626; color: #fff; }

/* Compact read-only reference panel (e.g. datos de la unidad en Orden de Servicio) */
.unit-reference-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem 1.5rem; background: #f4f7fb; border: 1px solid #d8e1ed; border-radius: 8px; padding: .6rem .85rem; margin: -.25rem 0 .25rem; }
.unit-reference-panel > div { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; padding: .15rem 0; }
.unit-reference-panel span { color: #708198; font-size: .78rem; }
.unit-reference-panel strong { color: #40536c; font-size: .82rem; font-weight: 700; text-align: right; }

@media (max-width: 900px) {
    .purchase-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .purchase-form-grid .span-4 { grid-column: span 2; }
}

@media (max-width: 620px) {
    .purchase-form-grid, .purchase-detail-form { grid-template-columns: 1fr; }
    .purchase-form-grid .span-2, .purchase-form-grid .span-4, .purchase-detail-form .span-2 { grid-column: span 1; }
    .purchase-log-head { display: block; }
    .purchase-detail-tabs { overflow-x: auto; }
}
