:root {
    /* Paleta oficial extraída del CSS real de congresogro.gob.mx (tema "egovt") */
    --brand: #39515e;
    --brand-light: #4d6a7a;
    --brand-dark: #202b5d;
    --brand-gray: #808080;
    --accent-gold: #ffc689;
    --bg: #f4f2f0;
    --card: #ffffff;
    --text: #435363;
    --muted: #62718d;
    --border: #e4e0dc;
}

body.app-body, body { font-family: 'Nunito Sans', Arial, sans-serif; }
.app-brand, h1, h2, h3, .gaceta-doc-title strong { font-family: 'Cabin', 'Nunito Sans', Arial, sans-serif; color: var(--brand-dark); }
.app-brand { color: #fff !important; }

* { box-sizing: border-box; }

body.app-body {
    background: var(--bg);
    font-family: 'Poppins', Arial, sans-serif;
    color: var(--text);
    margin: 0;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--brand);
    color: #fff;
    padding: 14px 28px;
}

.app-brand {
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    font-size: 18px;
}

.app-nav a {
    color: #dbe4ea;
    text-decoration: none;
    margin-left: 20px;
    font-size: 14px;
}

.app-nav a:hover { color: #fff; text-decoration: underline; }

.app-main {
    max-width: 1320px;
    margin: 30px auto;
    padding: 0 20px;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 18px;
}

.alert-ok {
    background: #e4f6e9;
    color: #1f7a3d;
    border: 1px solid #b7e4c4;
}

/* Filtros */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: var(--card);
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.filter-bar select,
.filter-bar input {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.filter-bar button {
    background: var(--brand);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
}

/* Tabla */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.data-table th, .data-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    white-space: nowrap;
}

.data-table td:nth-child(7) {
    white-space: normal;
    max-width: 280px;
}

.data-table th {
    background: #f8f6f4;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
}

.link-danger {
    background: none;
    border: none;
    color: #c0392b;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    margin-left: 10px;
    font-size: 13px;
}

.pagination {
    display: flex;
    gap: 6px;
    margin-top: 18px;
}

.pagination a {
    padding: 6px 12px;
    border-radius: 6px;
    background: var(--card);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
}

.pagination a.active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

/* Formulario de edición */
.edit-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--card);
    padding: 24px;
    border-radius: 10px;
    border: 1px solid var(--border);
    max-width: 720px;
}

.edit-form label {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-top: 10px;
}

.edit-form select,
.edit-form input,
.edit-form textarea {
    padding: 9px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 14px;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
}

.form-actions button {
    background: var(--brand);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-secondary {
    padding: 10px 22px;
    border-radius: 6px;
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
}

/* Calendario */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 20px;
}

.calendar-header h1 { margin: 0; font-size: 22px; }

.cal-nav {
    text-decoration: none;
    font-size: 20px;
    color: var(--brand);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.cal-weekday {
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    font-weight: 600;
    padding-bottom: 4px;
}

.cal-cell {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-height: 96px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cal-empty { background: transparent; border: none; }

.cal-day-number {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

.cal-cell.is-today {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(138,106,31,.18);
}

.cal-cell.has-gazette {
    background: #eef2f4;
}

.cal-gazette-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    max-height: 70px;
}

.cal-gazette-chip {
    background: var(--brand-light);
    color: #fff;
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 5px;
    text-decoration: none;
    line-height: 1.3;
}

.cal-gazette-chip:hover { background: var(--brand); }

@media (max-width: 720px) {
    .calendar-grid { grid-template-columns: repeat(7, minmax(36px, 1fr)); }
    .cal-cell { min-height: 70px; padding: 4px; }
    .cal-gazette-chip { font-size: 9px; }
}

/* Editor de texto ligero (contenteditable) */
.lite-editor-toolbar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    background: #f8f6f4;
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    padding: 6px;
}

.lite-editor-btn {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 9px;
    cursor: pointer;
    font-size: 13px;
}

.lite-editor-btn:hover { background: var(--brand-light); color: #fff; }

.lite-editor-area {
    border: 1px solid var(--border);
    border-radius: 0 0 6px 6px;
    padding: 12px;
    min-height: 180px;
    background: #fff;
    font-size: 14px;
    line-height: 1.5;
}

/* Búsqueda pública de leyes */
.law-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.law-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}

.law-card h3 { margin: 0 0 6px; font-size: 16px; }

/* ===== Agenda de diputados (rol burgess) — diseño MOBILE-FIRST =====
   Se define primero para pantallas pequeñas; @media (min-width) va ampliando. */
.agenda-mobile {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 4px 0 40px;
}

.agenda-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 6px rgba(0,0,0,.05);
}

.agenda-date {
    display: inline-block;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.agenda-card h3 {
    margin: 0 0 6px;
    font-size: 17px;
    line-height: 1.3;
}

.agenda-meta {
    color: var(--muted);
    font-size: 13px;
    margin: 0 0 12px;
}

.agenda-link {
    display: inline-block;
    background: var(--brand-light);
    color: #fff;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    width: 100%;
    text-align: center;
}

/* A partir de tablet/escritorio, la agenda pasa a grid de columnas */
@media (min-width: 640px) {
    .agenda-mobile {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .agenda-link { width: auto; }
}

@media (min-width: 1024px) {
    .agenda-mobile {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Directorio de diputados (mobile-first) */
.directory-group {
    margin-bottom: 24px;
}

.directory-group h2 {
    font-size: 15px;
    color: var(--brand);
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
    margin-bottom: 12px;
}

.directory-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.directory-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}

.directory-card img,
.directory-avatar-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 8px;
}

.directory-avatar-placeholder {
    background: var(--brand-light);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
}

.directory-name {
    font-size: 12px;
    display: block;
}

@media (min-width: 640px) {
    .directory-cards { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1024px) {
    .directory-cards { grid-template-columns: repeat(6, 1fr); }
}

/* Búsqueda pública mobile (diputados) */
.search-mobile-form {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.search-mobile-form input {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 14px;
}

.search-mobile-form button {
    background: var(--brand);
    color: #fff;
    border: none;
    padding: 0 18px;
    border-radius: 8px;
}

/* Hub de catálogos */
.hub-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.hub-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
}

.hub-card:hover { border-color: var(--brand); color: var(--brand); }

@media (min-width: 640px) {
    .hub-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .hub-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Toolbar de catálogos CRUD */
.crud-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.crud-toolbar h1 { margin: 0; font-size: 20px; }

.btn-primary {
    background: var(--brand);
    color: #fff;
    text-decoration: none;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 14px;
}

.btn-primary:hover { background: var(--brand-light); }

/* Previsualización inline del PDF al editar */
.pdf-preview {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin: 8px 0;
}

.pdf-preview iframe {
    width: 100%;
    height: 420px;
    border: none;
}

/* Toolbar del calendario (filtro legislatura + toggle vista semanal/mensual) */
.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.calendar-filter {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
}

.calendar-filter select {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* Vista semanal (timeline) */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.timeline-day {
    display: flex;
    gap: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
}

.timeline-day.is-today {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(138,106,31,.18);
}

.timeline-day-label {
    min-width: 70px;
    display: flex;
    flex-direction: column;
    font-size: 12px;
    color: var(--muted);
}

.timeline-day-label strong {
    color: var(--text);
    font-size: 13px;
}

.timeline-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.timeline-chip {
    background: var(--brand-light);
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 6px;
}

.timeline-chip:hover { background: var(--brand); }

.timeline-empty {
    color: var(--muted);
    font-size: 12px;
    font-style: italic;
}

@media (max-width: 640px) {
    .timeline-day { flex-direction: column; gap: 6px; }
    .timeline-day-label { flex-direction: row; gap: 6px; }
}

/* ==== Visor de la Gaceta (documento por fecha) ==== */
.gaceta-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    position: relative;
}

.gaceta-sumario-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.sidebar-toggle {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--brand);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    flex-shrink: 0;
}

.sidebar-toggle:hover { background: #eef2f4; }

/* Botón para volver a abrir la barra: pequeño, pegado a la orilla, no reserva espacio en el layout */
.sidebar-open {
    display: none;
    position: sticky;
    top: 20px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--brand);
    cursor: pointer;
    font-size: 13px;
    flex-shrink: 0;
    align-self: flex-start;
}

.sidebar-open:hover { background: #eef2f4; }

.gaceta-layout.sidebar-collapsed .gaceta-sidebar {
    display: none;
}

.gaceta-layout.sidebar-collapsed .sidebar-open {
    display: block;
}

.gaceta-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
}

.gaceta-main {
    flex: 1;
    min-width: 0;
}

/* Mini calendario */
.mini-cal {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 18px;
}

.mini-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
}

.mini-cal-nav {
    text-decoration: none;
    color: var(--brand);
    font-weight: 700;
    padding: 2px 6px;
}

.mini-cal-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.mini-cal-grid th {
    color: var(--muted);
    font-weight: 600;
    padding-bottom: 4px;
}

.mini-cal-grid td {
    text-align: center;
    padding: 2px 0;
}

.mini-cal-day {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    border-radius: 50%;
    color: var(--text);
    text-decoration: none;
}

.mini-cal-day.has-gazette {
    background: var(--brand-light);
    color: #fff;
    font-weight: 600;
}

.mini-cal-day.has-gazette:hover { background: var(--brand); }

.mini-cal-day.is-selected {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}

.mini-cal-full-link {
    display: block;
    text-align: center;
    margin-top: 8px;
    font-size: 12px;
    color: var(--brand);
    text-decoration: none;
}

/* Gacetas anteriores */
.recent-dates {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
}

.recent-dates h3 {
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
    margin: 0 0 10px;
}

.recent-dates ul {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 280px;
    overflow-y: auto;
}

.recent-dates li a {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 6px 4px;
    font-size: 12px;
    color: var(--text);
    text-decoration: none;
    border-radius: 5px;
}

.recent-dates li a strong { font-size: 12px; }
.recent-dates li a span { font-size: 11px; color: var(--muted); }

.recent-dates li a:hover { background: #eef2f4; }

.recent-dates li a.is-active {
    background: var(--brand);
    color: #fff;
}
.recent-dates li a.is-active span { color: #dbe4ea; }

.muted-note { color: var(--muted); font-size: 12px; }

/* Encabezado del documento */
.gaceta-doc-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: var(--brand);
    color: #fff;
    border-radius: 10px;
    padding: 14px 20px;
    margin-bottom: 16px;
    text-align: center;
}

.gaceta-doc-header .cal-nav {
    background: rgba(255,255,255,.15);
    color: #fff;
    border: none;
}

.gaceta-doc-header .cal-nav.is-disabled {
    opacity: .35;
    pointer-events: none;
}

.gaceta-doc-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gaceta-doc-title strong { font-size: 16px; }
.gaceta-doc-title span { font-size: 13px; opacity: .9; }

.gaceta-doc-meta {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 10px;
}

.gaceta-search {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
    font-size: 14px;
}

.empty-doc {
    background: var(--card);
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    color: var(--muted);
}

/* Sumario */
.gaceta-sumario {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 22px;
}

.gaceta-sumario h2 {
    font-size: 14px;
    letter-spacing: .5px;
    color: var(--brand);
    margin: 0 0 10px;
}

.gaceta-sumario ol {
    margin: 0;
    padding-left: 20px;
    columns: 2;
    column-gap: 30px;
}

.gaceta-sumario li {
    font-size: 13px;
    margin-bottom: 6px;
    break-inside: avoid;
}

.gaceta-sumario a {
    color: var(--text);
    text-decoration: none;
}

.gaceta-sumario a:hover { color: var(--brand); text-decoration: underline; }

.gaceta-sumario h3 {
    font-size: 13px;
    color: var(--brand);
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gaceta-sumario h3:first-of-type { margin-top: 0; }

.gaceta-sumario ul {
    margin: 0 0 4px;
    padding-left: 18px;
}

.sumario-presenter {
    font-size: 11px;
    color: var(--muted);
}

.orden-dia-title {
    text-align: center;
    font-size: 20px;
    letter-spacing: 1px;
    color: var(--brand);
    margin: 0 0 20px;
}

.gaceta-item-action {
    font-weight: 600;
    font-size: 14px;
    margin: 0 0 6px;
}

/* Contenido por sección */
.gaceta-section {
    margin-bottom: 26px;
    scroll-margin-top: 20px;
}

.gaceta-section h2 {
    background: #e8edf0;
    color: var(--brand);
    font-size: 14px;
    padding: 8px 14px;
    border-radius: 6px;
    margin: 0 0 12px;
}

.gaceta-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand-light);
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 10px;
}

.gaceta-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

.gaceta-item-file {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
}

.gaceta-item-body {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

@media (max-width: 900px) {
    .gaceta-layout { flex-direction: column; }
    .gaceta-sidebar { width: 100%; position: static; }
    .gaceta-sumario ol { columns: 1; }
}

/* Contador de documentos por sección en el ÍNDICE */
.section-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    background: #2c3e50;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    border-radius: 4px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section-counter.modern {
    background: transparent;
    color: #2c3e50;
    border: 2px solid #2c3e50;
    border-radius: 6px;
    font-weight: 700;
}

.section-counter.gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    min-width: 35px;
    padding: 0;
}

.section-counter.badge {
    background: #e74c3c;
    border-radius: 20px;
    padding: 0 12px;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Cambio masivo de nivel de acceso */
.bulk-auth-panel {
    background: linear-gradient(135deg, #fff 0%, #eef2f4 100%);
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand);
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
}

.bulk-auth-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    background: none;
    border: none;
    padding: 14px 18px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}

.bulk-auth-icon { font-size: 20px; }

.bulk-auth-toggle span:nth-child(2) {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bulk-auth-toggle strong {
    font-size: 14px;
    color: var(--text);
}

.bulk-auth-toggle small {
    font-size: 12px;
    color: var(--muted);
}

.bulk-auth-chevron {
    color: var(--brand);
    transition: transform .2s;
}

.bulk-auth-toggle.is-open .bulk-auth-chevron {
    transform: rotate(180deg);
}

.bulk-auth-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
}

.bulk-auth-body.is-open {
    max-height: 200px;
}

.bulk-auth-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    padding: 4px 18px 18px;
}

.bulk-auth-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bulk-auth-field label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: var(--muted);
}

.bulk-auth-field select {
    padding: 9px 12px;
    border-radius: 7px;
    border: 1px solid var(--border);
    min-width: 220px;
    font-size: 13px;
    background: #fff;
}

.bulk-auth-arrow {
    font-size: 20px;
    color: var(--brand-light);
    padding-bottom: 9px;
}

.bulk-auth-submit {
    background: var(--brand);
    color: #fff;
    border: none;
    padding: 10px 26px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

.bulk-auth-submit:hover { background: var(--brand-light); }

@media (max-width: 720px) {
    .bulk-auth-form { flex-direction: column; align-items: stretch; }
    .bulk-auth-field select { min-width: 0; width: 100%; }
    .bulk-auth-arrow { display: none; }
    .bulk-auth-body.is-open { max-height: 420px; }
}

/* Tabla de registros: scroll horizontal para las 13 columnas */
.table-scroll {
    overflow-x: auto;
    border-radius: 10px;
}

.link-file {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

/* ==== Accesibilidad ==== */
:root {
    --a11y-font-scale: 1;
}

/* El sitio usa tamaños de fuente en px fijos, así que escalamos con "zoom" en vez de
   font-size en :root (que no cascadearía a los px fijos). Zoom soportado en todos los
   navegadores modernos relevantes (Chrome/Edge/Safari/Firefox 126+). */
.app-main, .gaceta-doc-header {
    zoom: var(--a11y-font-scale);
}

.container-login100 {
    zoom: var(--a11y-font-scale);
}

/* Alto contraste: fondo oscuro, texto blanco, bordes marcados */
html.a11y-high-contrast body.app-body {
    background: #000;
    color: #fff;
}

html.a11y-high-contrast .app-header {
    background: #000;
    border-bottom: 2px solid #fff;
}

html.a11y-high-contrast .app-nav a { color: #ffe37a; }

html.a11y-high-contrast .gaceta-sidebar,
html.a11y-high-contrast .gaceta-sumario,
html.a11y-high-contrast .recent-dates,
html.a11y-high-contrast .mini-cal,
html.a11y-high-contrast .gaceta-item,
html.a11y-high-contrast .data-table,
html.a11y-high-contrast .card,
html.a11y-high-contrast .empty-doc {
    background: #111 !important;
    color: #fff !important;
    border: 1px solid #fff !important;
}

html.a11y-high-contrast .gaceta-section h2,
html.a11y-high-contrast .section-counter {
    background: #fff !important;
    color: #000 !important;
}

html.a11y-high-contrast a { color: #7ec8ff; }
html.a11y-high-contrast .btn-primary,
html.a11y-high-contrast .bulk-auth-submit,
html.a11y-high-contrast .gaceta-doc-header {
    background: #ffe37a !important;
    color: #000 !important;
    border: 1px solid #000 !important;
}

/* Subrayar todos los enlaces (ayuda a usuarios con dificultad para distinguir color) */
html.a11y-underline-links a {
    text-decoration: underline !important;
}

/* Fuente de lectura fácil: sans-serif ancha, buen espaciado entre letras/líneas */
html.a11y-readable-font body {
    font-family: Verdana, Tahoma, 'Trebuchet MS', sans-serif !important;
    letter-spacing: .015em;
    line-height: 1.6 !important;
}

/* Botón flotante */
#a11y-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--brand, #39515e);
    color: #fff;
    border: none;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,.25);
    z-index: 9999;
}

#a11y-fab:hover { background: var(--brand-light, #4d6a7a); }

#a11y-panel {
    position: fixed;
    bottom: 82px;
    right: 20px;
    width: 260px;
    background: #fff;
    color: #2b2b2b;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,.2);
    padding: 16px;
    z-index: 9999;
}

#a11y-panel h2 {
    font-size: 15px;
    margin: 0 0 12px;
    color: #39515e;
}

.a11y-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid #eee;
}

.a11y-row:last-of-type { border-bottom: none; }

.a11y-btn-group { display: flex; gap: 4px; }

.a11y-btn-group button {
    width: 28px;
    height: 28px;
    border-radius: 5px;
    border: 1px solid #ddd;
    background: #f8f6f4;
    cursor: pointer;
    font-size: 11px;
}

.a11y-btn-group button:hover { background: #eee; }

.a11y-switch-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.a11y-reset-btn {
    width: 100%;
    margin-top: 12px;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #f8f6f4;
    cursor: pointer;
    font-size: 12px;
}

.a11y-reset-btn:hover { background: #eee; }

@media (max-width: 480px) {
    #a11y-panel { width: calc(100vw - 40px); right: 20px; }
}
