:root {
    /* ── Tipografía unificada (chrome del sitio + widgets DevExtreme) ────────── */
    --font-ui: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Tahoma, Geneva, Verdana, sans-serif;

    /* ── Escala tipográfica ─────────────────────────────────────────────────── */
    --fs-title: 18px;   /* títulos de sección (header y tarjetas) */
    --fs-base: 14px;    /* texto base y celdas de los grids */
    --fs-small: 13px;   /* notas, bandas de info y etiquetas */

    /* ── Texto: 3 roles de gris ─────────────────────────────────────────────── */
    --text-strong: #1f2d3d; /* valores destacados */
    --text: #34495e;        /* texto y títulos principales */
    --text-muted: #6b7785;  /* secundario: notas y etiquetas */
}

html, body {
    margin: 0;
    min-height: 100%;
    height: 100%;
    font-family: var(--font-ui);
    font-size: var(--fs-base);
    background: #eef2f7;
    color: var(--text);
}

/* DevExtreme hereda la misma familia que el resto del sitio
   (grids, toolbars, selects, botones) para que todo sea congruente. */
.dx-widget {
    font-family: var(--font-ui);
}

#app-side-nav-outer-toolbar {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.layout-header {
    flex: 0 0 auto;
    position: relative;
    z-index: 1505;
    border-bottom: 1px solid #d8dde6;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.layout-header .dx-toolbar {
    background: #ffffff;
}

.layout-header .header-title {
    font-size: var(--fs-title);
    font-weight: 700;
    color: var(--text);
}

.layout-header .topbar-right {
    font-size: var(--fs-small);
    color: var(--text-muted);
    display: flex;
    gap: 16px;
    align-items: center;
}

.layout-header .topbar-right strong {
    color: var(--text);
}

.layout-header .app-version-badge {
    color: #2f5d7c;
    font-weight: 700;
    white-space: nowrap;
}

.dx-toolbar .dx-toolbar-item.menu-button {
    width: 56px;
    text-align: center;
    padding: 0;
}

.with-footer > .dx-scrollable-wrapper > .dx-scrollable-container > .dx-scrollable-content {
    height: 100%;
}

.with-footer > .dx-scrollable-wrapper > .dx-scrollable-container > .dx-scrollable-content > .dx-scrollview-content {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.layout-body {
    background-color: #eef2f7;
    flex: 1;
    height: 100%;
    min-height: 0;
}

.layout-body .menu-container {
    height: 100%;
    width: 250px;
    background-color: #2c3b4e;
    color: #c8d2de;
    display: flex;
    flex-direction: column;
}

.layout-body .content {
    flex-grow: 1;
    min-height: 100%;
    line-height: 1.45;
    margin: 18px;
}

.layout-body .content-footer {
    display: block;
    color: var(--text-muted);
    border-top: 1px solid #d8dde6;
    padding-top: 14px;
    padding-bottom: 16px;
    margin: 0 18px;
    font-size: 12px;
}

.layout-body .content-footer #footer {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.layout-body .footer-version {
    color: #2f5d7c;
    font-weight: 700;
}

.layout-body-hidden {
    visibility: hidden;
}

#layout-drawer.dx-drawer-shrink .dx-drawer-panel-content {
    box-shadow: rgba(15, 23, 42, 0.1) 0 1px 3px;
}

.menu-container .dx-widget {
    font-size: 14px;
    font-weight: 600;
    line-height: 22px;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.menu-container .dx-treeview {
    white-space: nowrap;
    flex: 1 1 auto;
    min-height: 0;
}

.menu-container .menu-version {
    flex: 0 0 auto;
    border-top: 1px solid rgba(200, 210, 222, 0.18);
    color: #dce6f1;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
    padding: 10px 18px 14px;
}

.menu-container .dx-treeview .dx-treeview-node {
    padding: 0 !important;
}

.menu-container .dx-treeview .dx-treeview-item {
    padding: 0;
    min-height: 44px;
    border-radius: 0;
    color: #c8d2de;
}

.menu-container .dx-treeview .dx-treeview-item-content {
    padding: 11px 18px;
}

.menu-container .dx-treeview .dx-treeview-item .dx-icon {
    margin-right: 10px;
    color: #b7c4d3;
}

.menu-container .dx-treeview-item.dx-state-hover {
    background: #32465e;
}

.menu-container .dx-treeview-item.dx-state-selected {
    background: #1f8ef1;
    color: #ffffff;
}

.menu-container .dx-treeview-item.dx-state-selected .dx-icon {
    color: #ffffff;
}

.admin-card {
    background: #ffffff;
    border: 1px solid #d8dde6;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.admin-card-header {
    border-top: 3px solid #24b36b;
    border-bottom: 1px solid #e8edf3;
    padding: 10px 14px;
    font-size: var(--fs-title);
    font-weight: 700;
    color: var(--text);
    background: #ffffff;
}

.admin-card-body {
    padding: 14px;
}

.admin-page-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-page-copy {
    margin: 0;
    color: var(--text-muted);
    font-size: var(--fs-base);
}

.admin-card-note {
    font-size: var(--fs-small);
    color: var(--text-muted);
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.admin-stat-box {
    position: relative;
    overflow: hidden;
    min-height: 104px;
    border-radius: 4px;
    color: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.admin-stat-box__body {
    padding: 14px 16px;
}

.admin-stat-box__value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
}

.admin-stat-box__label {
    margin-top: 6px;
    font-size: var(--fs-small);
    font-weight: 600;
}

.admin-stat-box__icon {
    position: absolute;
    right: 10px;
    top: 12px;
    font-size: 42px;
    opacity: 0.18;
}

.admin-stat-box--green {
    background: linear-gradient(135deg, #00a65a 0%, #24b36b 100%);
}

.admin-stat-box--blue {
    background: linear-gradient(135deg, #0073b7 0%, #2f8ed6 100%);
}

.admin-stat-box--olive {
    background: linear-gradient(135deg, #7ea92d 0%, #9cc34b 100%);
}

.admin-stat-box--navy {
    background: linear-gradient(135deg, #4b5f7a 0%, #6f86a6 100%);
}

.admin-toolbar-host .dx-toolbar {
    background: #ffffff;
    border: 1px solid #d8dde6;
    border-radius: 4px;
}

.admin-grid-host .dx-datagrid {
    border: 1px solid #d8dde6;
    background: #ffffff;
}

/* Banda informativa unificada de los reportes (periodo, RFC, tiempo de carga y
   datos del contexto visualizado). Compartida por Resumen Sucursales, Resumen por
   Año y Detalle de facturas para que el encabezado luzca igual en todas. */
.summary-info-band {
    display: flex;
    gap: 18px;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #f5f7fa;
    border-left: 3px solid #0066cc;
    border-radius: 2px;
    font-size: var(--fs-small);
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
}

.summary-info-band__item {
    display: flex;
    gap: 6px;
    align-items: center;
    color: var(--text);
    flex: 0 0 auto;
    white-space: nowrap;
}

.summary-info-band__label {
    font-weight: 600;
    color: var(--text-muted);
}

.summary-info-band__value {
    color: var(--text-strong);
    font-weight: 500;
}

.admin-grid-host .dx-header-row td {
    background: #f4f6f9;
    color: var(--text);
    font-weight: 700;
    border-bottom: 1px solid #d8dde6;
}

.admin-grid-host .dx-datagrid-rowsview .dx-row-alt > td {
    background: #fafbfd;
}

.admin-grid-sticky-head .dx-datagrid-headers .dx-header-row > td {
    white-space: normal;
    line-height: 1.2;
    vertical-align: middle;
}

.admin-grid-sticky-head .dx-datagrid-headers {
    position: sticky;
    top: 0;
    z-index: 20;
}

.admin-grid-sticky-head .dx-datagrid-headers .dx-datagrid-table {
    background: #fff;
}

@media screen and (max-width: 1100px) {
    .admin-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 700px) {
    .layout-body .content {
        margin: 10px;
    }

    .layout-header .topbar-right {
        display: none;
    }

    .admin-stat-grid {
        grid-template-columns: 1fr;
    }
}
