/* Configuraci?n general de la p?gina */
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f4f6f8;
    color: #1f2937;
}

/* Barra superior */
header {
    height: 64px;
    background-color: #ffffff;
    border-bottom: 1px solid #d9dee5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

/* T?tulo principal */
.app-title {
    font-size: 22px;
    font-weight: bold;
}

/* Contenedor de botones superiores */
.top-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Botones del encabezado */
.top-actions button,
.top-actions a {
    border: 1px solid #cfd6df;
    background-color: #ffffff;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #1f2937;
    cursor: pointer;
    font-size: 14px;
}

/* Contenedor principal: panel izquierdo + contenido */
.layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

/* Panel lateral */
.sidebar {
    width: 310px;
    background-color: #ffffff;
    border-right: 1px solid #d9dee5;
    padding: 20px;
}

/* T?tulo del panel lateral */
.sidebar h2 {
    margin-top: 0;
    font-size: 20px;
}

/* Campo de b?squeda */
.search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #cfd6df;
    border-radius: 8px;
    margin-bottom: 18px;
    box-sizing: border-box;
}

.panel-title-row,
.table-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.panel-title-row h3 {
    margin: 0;
}

.table-action-row {
    justify-content: flex-end;
    margin: 12px 0;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.panel-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) minmax(180px, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

.panel-toolbar.audit-toolbar {
    grid-template-columns: minmax(220px, 2fr) minmax(160px, 1fr) minmax(140px, 1fr) auto;
}

.compact-filter-input {
    margin: 0;
}

.sort-order-button {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    border: 2px solid #111827;
    background: #ffffff;
    color: #111827;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 0;
    cursor: pointer;
    font-weight: 800;
    line-height: 1;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sort-order-button:hover {
    background: #e8f0ff;
    border-color: #2563eb;
    color: #1d4ed8;
}

.sort-order-icon {
    font-size: 20px;
    line-height: 1;
    margin-top: -2px;
}

.sort-order-lines {
    font-size: 18px;
    line-height: 1;
    transform: translateY(-1px);
}

#documentsSortButton {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-width: 1.5px;
    transform: translateY(-3px);
}

#documentsSortButton .sort-order-icon {
    font-size: 17px;
}

#documentsSortButton .sort-order-lines {
    font-size: 15px;
}

body.dark-mode .sort-order-button {
    background: #111827;
    border-color: #cbd5e1;
    color: #f8fafc;
}

body.dark-mode .sort-order-button:hover {
    background: #1d4ed8;
    border-color: #93c5fd;
    color: #ffffff;
}

/* Lista de hojas de c?lculo */
.hc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.documents-list-pager {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e1e5eb;
}

.documents-list-count {
    font-size: 12px;
    color: #64748b;
}

.documents-list-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.compact-list-button {
    width: 100%;
    padding: 8px;
    margin: 0;
    font-size: 12px;
}
/* Tarjeta de cada hoja de c?lculo */
.hc-item {
    padding: 12px;
    border: 1px solid #e1e5eb;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    background-color: #f9fafb;
}

/* Efecto al pasar el mouse sobre una HC */
.hc-item:hover {
    background-color: #eef2f7;
}

/* C?digo de la HC */
.hc-code {
    font-weight: bold;
    display: block;
}

/* Nombre de la HC */
.hc-name {
    font-size: 13px;
    color: #5b6472;
}

/* Bot?n principal del panel lateral */
.primary-button {
    width: 100%;
    border: none;
    background-color: #1f4f8b;
    color: white;
    padding: 11px;
    border-radius: 8px;
    margin-top: 18px;
    cursor: pointer;
    font-weight: bold;
}

/* ?rea central de contenido */
.content {
    flex: 1;
    padding: 24px;
}

/* Tarjetas principales */
.card {
    background-color: #ffffff;
    border: 1px solid #d9dee5;
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 20px;
}

/* T?tulos dentro de tarjetas */
.card h2,
.card h3 {
    margin-top: 0;
}

/* Etiqueta visual del estado */
.status {
    display: inline-block;
    background-color: #dcfce7;
    color: #166534;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: bold;
}

/* Bot?n para solicitar descarga */
.download-button {
    border: none;
    background-color: #15803d;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

/* Tabla de versiones */
table {
    width: 100%;
    border-collapse: collapse;
}

/* Celdas de tabla */
th,
td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
}

/* Encabezado de tabla */
th {
    background-color: #f9fafb;
}

/* Caja de comentarios */
textarea {
    width: 100%;
    min-height: 90px;
    padding: 10px;
    border: 1px solid #cfd6df;
    border-radius: 8px;
    resize: vertical;
    box-sizing: border-box;
}

/* Fondo general en modo oscuro */
body.dark-mode {
    background-color: #111827;
    color: #e5e7eb;
}

/* Barra superior en modo oscuro */
body.dark-mode header {
    background-color: #1f2937;
    border-bottom: 1px solid #374151;
}

/* Panel lateral en modo oscuro */
body.dark-mode .sidebar {
    background-color: #1f2937;
    border-right: 1px solid #374151;
}

/* Tarjetas en modo oscuro */
body.dark-mode .card {
    background-color: #1f2937;
    border: 1px solid #374151;
}

/* Elementos de la lista en modo oscuro */
body.dark-mode .hc-item {
    background-color: #273449;
    border: 1px solid #374151;
}

body.dark-mode .documents-list-pager {
    border-top-color: #374151;
}

body.dark-mode .documents-list-count {
    color: #cbd5e1;
}

/* Efecto hover en modo oscuro */
body.dark-mode .hc-item:hover {
    background-color: #334155;
}

/* Texto secundario en modo oscuro */
body.dark-mode .hc-name {
    color: #cbd5e1;
}

/* Inputs y textarea en modo oscuro */
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background-color: #111827;
    color: #e5e7eb;
    border: 1px solid #4b5563;
}

body.dark-mode input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.7);
    opacity: 0.9;
    cursor: pointer;
}

/* Botones superiores en modo oscuro */
body.dark-mode .top-actions button,
body.dark-mode .top-actions a {
    background-color: #273449;
    color: #e5e7eb;
    border: 1px solid #4b5563;
}

/* Encabezado de tabla en modo oscuro */
body.dark-mode th {
    background-color: #273449;
}

/* Bordes de tabla en modo oscuro */
body.dark-mode td,
body.dark-mode th {
    border-bottom: 1px solid #374151;
}

/* HC seleccionada en el listado */
.hc-item.active {
    background-color: #dbeafe;
    border-color: #1f4f8b;
}

/* HC seleccionada en modo oscuro */
body.dark-mode .hc-item.active {
    background-color: #1e3a5f;
    border-color: #60a5fa;
}

/* Lista de comentarios */
#commentsList {
    padding-left: 20px;
    margin-top: 0;
}

#commentsList li {
    margin-bottom: 8px;
}

/* Fondo oscuro detr?s del modal */
.modal {
    position: fixed;
    inset: 0;
    background-color: rgba(17, 24, 39, 0.55);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    z-index: 1000;
}

/* Oculta elementos cuando no se necesitan */
.hidden {
    display: none;
}

/* Caja principal del modal */
.modal-content {
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 40px);
    background-color: #ffffff;
    border-radius: 14px;
    padding: 24px;
    border: 1px solid #d9dee5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: auto 0;
}

.modal-content.large-modal {
    max-width: 920px;
    padding: 0;
}

.modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid #e5e7eb;
    background-color: #ffffff;
}

.modal-header h3 {
    margin: 0;
}

.modal-close-button {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border: 1px solid #cfd6df;
    border-radius: 8px;
    background-color: #ffffff;
    color: #111827;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.modal-body {
    padding: 20px 24px 24px;
    overflow-y: auto;
    min-height: 0;
}

/* Informaci?n de la HC dentro del modal */
.modal-info {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 16px;
}

/* Etiqueta del campo de justificaci?n */
.modal-content label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
}

/* Botones inferiores del modal */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.modal-body > .modal-actions {
    margin: 18px 0 0;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
    background-color: #ffffff;
}

/* Bot?n secundario para cancelar */
.secondary-button {
    border: 1px solid #cfd6df;
    background-color: #ffffff;
    color: #1f2937;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

/* Mensaje de confirmaci?n de solicitud */
.request-feedback {
    font-weight: bold;
    color: #15803d;
    min-height: 20px;
}

/* Modal en modo oscuro */
body.dark-mode .modal-content {
    background-color: #1f2937;
    border: 1px solid #374151;
}

body.dark-mode .modal-header,
body.dark-mode .modal-body > .modal-actions {
    background-color: #1f2937;
    border-color: #374151;
}

body.dark-mode .modal-close-button {
    background-color: #111827;
    border-color: #374151;
    color: #f9fafb;
}

/* Informaci?n del modal en modo oscuro */
body.dark-mode .modal-info {
    background-color: #111827;
    border: 1px solid #374151;
}

/* Bot?n secundario en modo oscuro */
body.dark-mode .secondary-button {
    background-color: #273449;
    color: #e5e7eb;
    border: 1px solid #4b5563;
}

/* Modal peque?o para mensajes de confirmaci?n */
.confirmation-content {
    max-width: 420px;
}

/* Estado pendiente en la tabla de solicitudes */
.request-status {
    display: inline-block;
    background-color: #fef3c7;
    color: #92400e;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: bold;
}

/* Estado pendiente en modo oscuro */
body.dark-mode .request-status {
    background-color: #78350f;
    color: #fde68a;
}

/* Mensaje cuando no hay solicitudes */
#emptyRequestsMessage {
    color: #6b7280;
}

/* Mensaje sin solicitudes en modo oscuro */
body.dark-mode #emptyRequestsMessage {
    color: #cbd5e1;
}

/* Usuario autenticado */
.user-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.current-user-display {
    color: #1f2937;
    font-weight: 700;
    white-space: nowrap;
}

/* Men? de m?dulos */
.module-nav {
    height: 48px;
    background-color: #ffffff;
    border-bottom: 1px solid #d9dee5;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 24px;
}

/* Botones del men? */
.nav-button {
    border: 1px solid #cfd6df;
    background-color: #ffffff;
    color: #1f2937;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

/* Efecto visual del men? */
.nav-button:hover {
    background-color: #eef2f7;
}

/* Men? en modo oscuro */
body.dark-mode .module-nav {
    background-color: #1f2937;
    border-bottom: 1px solid #374151;
}

/* Botones del men? en modo oscuro */
body.dark-mode .nav-button {
    background-color: #273449;
    color: #e5e7eb;
    border: 1px solid #4b5563;
}

body.dark-mode .current-user-display {
    color: #e5e7eb;
}

/* Secci?n general de cada m?dulo */
.module-section {
    width: 100%;
}

/* Contenido de m?dulos que no tienen panel lateral */
.full-content {
    min-height: calc(100vh - 112px);
}

/* Ajuste de altura cuando existe men? superior */
.layout {
    min-height: calc(100vh - 112px);
}

/* Bot?n activo del men? */
.nav-button.active-nav {
    background-color: #1f4f8b;
    color: #ffffff;
    border-color: #1f4f8b;
}

/* Bot?n activo del men? en modo oscuro */
body.dark-mode .nav-button.active-nav {
    background-color: #2563eb;
    color: #ffffff;
    border-color: #60a5fa;
}

/* Etiquetas de formularios */
label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
}

/* Estado aprobado */
.request-status.approved {
    background-color: #dcfce7;
    color: #166534;
}

/* Estado rechazado */
.request-status.rejected {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Botones peque?os dentro de tablas */
.table-action-button {
    border: none;
    padding: 7px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    margin-right: 6px;
}

/* Bot?n aprobar */
.approve-button {
    background-color: #15803d;
    color: white;
}

/* Bot?n rechazar */
.reject-button {
    background-color: #dc2626;
    color: white;
}

/* Botones en modo oscuro */
body.dark-mode .request-status.approved {
    background-color: #14532d;
    color: #bbf7d0;
}

body.dark-mode .request-status.rejected {
    background-color: #7f1d1d;
    color: #fecaca;
}

/* Estado vencido */
.request-status.expired {
    background-color: #e5e7eb;
    color: #374151;
}

/* Estado vencido en modo oscuro */
body.dark-mode .request-status.expired {
    background-color: #374151;
    color: #d1d5db;
}



/* Bot?n de descarga en modo oscuro */
body.dark-mode .temporary-download-button {
    background-color: #2563eb;
}

/* Texto cuando la descarga no est? disponible */
.unavailable-download {
    color: #6b7280;
    font-size: 13px;
}

/* Texto no disponible en modo oscuro */
body.dark-mode .unavailable-download {
    color: #cbd5e1;
}

/* Texto de ayuda debajo de campos */
.help-text {
    font-size: 13px;
    color: #6b7280;
    margin-top: -10px;
    margin-bottom: 16px;
}

#uploadHcForm #newDocumentProjectGroup .search-input,
#uploadHcForm #existingDocumentSelector .search-input {
    margin-bottom: 2px;
}

#newDocumentProjectSelect {
    margin-bottom: 4px;
}

#newDocumentProjectHelpText {
    display: block;
    line-height: 1.35;
    margin-top: -8px;
    margin-bottom: 24px;
    color: #94a3b8;
}

#uploadHcForm #newDocumentProjectGroup .help-text,
#uploadHcForm #existingDocumentSelector .help-text {
    line-height: 1.35;
    margin-top: 0;
    margin-bottom: 24px;
}

/* Texto de ayuda en modo oscuro */
body.dark-mode .help-text {
    color: #cbd5e1;
}

body.dark-mode #newDocumentProjectHelpText {
    color: #cbd5e1;
}

/* Texto peque?o para detalles del Audit Trail */
.audit-detail {
    font-size: 13px;
    color: #4b5563;
}

/* Texto peque?o en modo oscuro */
body.dark-mode .audit-detail {
    color: #cbd5e1;
}

/* Acci?n destacada del Audit Trail */
.audit-action {
    font-weight: bold;
}

/* Etiqueta visual para tipo documental */
.document-type-tag {
    display: inline-block;
    background-color: #e0f2fe;
    color: #075985;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    margin-top: 6px;
}

/* Etiqueta de tipo documental en modo oscuro */
body.dark-mode .document-type-tag {
    background-color: #0c4a6e;
    color: #bae6fd;
}

/* Estado de c?digo documental reservado */
.code-status {
    display: inline-block;
    background-color: #fef3c7;
    color: #92400e;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: bold;
}

/* Estado de c?digo documental en modo oscuro */
body.dark-mode .code-status {
    background-color: #78350f;
    color: #fde68a;
}

/* Contenedor de resultados del buscador de categor?as */
.category-results {
    border: 1px solid #cfd6df;
    border-radius: 10px;
    background-color: #ffffff;
    margin-top: -10px;
    margin-bottom: 16px;
    max-height: 240px;
    overflow-y: auto;
}

/* Cada resultado del buscador de categor?a */
.category-result-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #e5e7eb;
}

/* Ultimo resultado sin borde inferior */
.category-result-item:last-child {
    border-bottom: none;
}

/* Efecto al pasar el mouse */
.category-result-item:hover {
    background-color: #eef2f7;
}

/* Nombre del tipo documental */
.category-result-name {
    display: block;
    font-weight: bold;
}

/* ID categor?a */
.category-result-id {
    display: block;
    font-size: 13px;
    color: #6b7280;
}

/* Resultados en modo oscuro */
body.dark-mode .category-results {
    background-color: #1f2937;
    border: 1px solid #374151;
}

body.dark-mode .category-result-item {
    border-bottom: 1px solid #374151;
}

body.dark-mode .category-result-item:hover {
    background-color: #334155;
}

body.dark-mode .category-result-id {
    color: #cbd5e1;
}

/* Tarjetas resumen del maestro documental */
.master-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    margin: 20px 0;
}

@media (max-width: 1100px) {
    .master-summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 700px) {
    .master-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* Tarjeta individual del resumen */
.summary-card {
    background-color: #ffffff;
    border: 1px solid #d9dee5;
    border-radius: 14px;
    padding: 18px;
}

/* Texto descriptivo de la tarjeta */
.summary-label {
    display: block;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

/* N?mero principal de la tarjeta */
.summary-card strong {
    font-size: 26px;
}

/* Distribuci?n de filtros */
.filter-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
}

/* Estado reservado */
.code-status.reserved {
    background-color: #fef3c7;
    color: #92400e;
}

/* Estado asignado */
.code-status.assigned {
    background-color: #dcfce7;
    color: #166534;
}

/* Estado anulado */
.code-status.annulled {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Bot?n para anular c?digo */
.annul-code-button {
    border: none;
    background-color: #dc2626;
    color: white;
    padding: 7px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

/* Texto cuando no hay acci?n disponible */
.no-action-text {
    color: #6b7280;
    font-size: 13px;
}

/* Modo oscuro para tarjetas resumen */
body.dark-mode .summary-card {
    background-color: #1f2937;
    border: 1px solid #374151;
}

/* Modo oscuro para texto secundario */
body.dark-mode .summary-label,
body.dark-mode .no-action-text {
    color: #cbd5e1;
}

/* Modo oscuro para estados */
body.dark-mode .code-status.reserved {
    background-color: #78350f;
    color: #fde68a;
}

body.dark-mode .code-status.assigned {
    background-color: #14532d;
    color: #bbf7d0;
}

body.dark-mode .code-status.annulled {
    background-color: #7f1d1d;
    color: #fecaca;
}

/* Bot?n para usar un c?digo reservado en carga documental */
.use-code-button {
    border: none;
    background-color: #1f4f8b;
    color: white;
    padding: 7px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    margin-right: 6px;
}

/* Bot?n usar c?digo en modo oscuro */
body.dark-mode .use-code-button {
    background-color: #2563eb;
}

/* Comentario individual */
.comment-item {
    background-color: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
}

/* Texto principal del comentario */
.comment-text {
    display: block;
    margin-bottom: 6px;
}

/* Metadatos del comentario */
.comment-meta {
    font-size: 12px;
    color: #6b7280;
}

/* Comentarios en modo oscuro */
body.dark-mode .comment-item {
    background-color: #273449;
    border: 1px solid #374151;
}

body.dark-mode .comment-meta {
    color: #cbd5e1;
}

/* Selector visual de subm?dulos dentro de Cargar documento */
.upload-mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 18px 0 24px 0;
}

/* Tarjeta de opci?n de carga */
.upload-mode-card {
    text-align: left;
    border: 1px solid #d9dee5;
    background-color: #ffffff;
    border-radius: 14px;
    padding: 18px;
    cursor: pointer;
    transition: 0.2s ease;
}

/* T?tulo de la tarjeta */
.upload-mode-card strong {
    display: block;
    font-size: 16px;
    margin-bottom: 8px;
}

/* Descripci?n de la tarjeta */
.upload-mode-card span {
    display: block;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

/* Tarjeta activa */
.active-upload-mode {
    border: 2px solid #1f4f8b;
    background-color: #eef6ff;
}

/* Modo oscuro */
body.dark-mode .upload-mode-card {
    background-color: #1f2937;
    border: 1px solid #374151;
    color: #f9fafb;
}

body.dark-mode .upload-mode-card span {
    color: #cbd5e1;
}

body.dark-mode .active-upload-mode {
    border: 2px solid #60a5fa;
    background-color: #1e3a5f;
}

/* Estado pendiente de aprobaci?n */
.upload-guidance-box,
.upload-selected-summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid #cfd6df;
    background-color: #f8fafc;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
}

.upload-guidance-box strong,
.upload-selected-summary strong {
    color: #1f2937;
}

.upload-guidance-box span,
.upload-selected-summary span {
    color: #4b5563;
    font-size: 13px;
    line-height: 1.4;
}

body.dark-mode .upload-guidance-box,
body.dark-mode .upload-selected-summary {
    background-color: #111827;
    border-color: #374151;
}

body.dark-mode .upload-guidance-box strong,
body.dark-mode .upload-selected-summary strong {
    color: #f9fafb;
}

body.dark-mode .upload-guidance-box span,
body.dark-mode .upload-selected-summary span {
    color: #cbd5e1;
}

.code-status.pending {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Estado rechazado */
.code-status.rejected {
    background-color: #fee2e2;
    color: #991b1b;
}

body.dark-mode .code-status.pending {
    background-color: #1e3a8a;
    color: #bfdbfe;
}

body.dark-mode .code-status.rejected {
    background-color: #7f1d1d;
    color: #fecaca;
}

/* Resumen del Maestro de proyectos */
#maestroProyectosModule .master-summary-grid {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 900px) {
    #maestroProyectosModule .master-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    #maestroProyectosModule .master-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* Estados del Maestro de proyectos */
.project-status {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
}

/* Proyecto activo */
.project-status.active {
    background-color: #dcfce7;
    color: #166534;
}

/* Proyecto pendiente de cierre */
.project-status.pending-close {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Proyecto cerrado */
.project-status.closed {
    background-color: #e5e7eb;
    color: #374151;
}

/* Modo oscuro */
body.dark-mode .project-status.active {
    background-color: #14532d;
    color: #bbf7d0;
}

body.dark-mode .project-status.pending-close {
    background-color: #1e3a8a;
    color: #bfdbfe;
}

body.dark-mode .project-status.closed {
    background-color: #374151;
    color: #e5e7eb;
}

.approval-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.approval-action-button {
    border: none;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    color: white;
    min-width: 85px;
}

.approval-approve-button {
    background-color: #16a34a;
}

.approval-reject-button {
    background-color: #dc2626;
}

.approval-action-button:hover {
    opacity: 0.85;
}

/* Bot?n de descarga temporal en Mis solicitudes */
button.temporary-download-button {
    appearance: none !important;
    border: none !important;
    border-radius: 8px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: auto !important;
    min-width: 155px !important;
    height: 34px !important;
    padding: 8px 14px !important;

    background-color: #2563eb !important;
    color: #ffffff !important;

    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    text-align: center !important;
    text-indent: 0 !important;
    white-space: nowrap !important;

    overflow: visible !important;
    cursor: pointer !important;
}

button.temporary-download-button:hover {
    opacity: 0.85 !important;
}

.notification-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 6px;

    border-radius: 999px;
    background-color: #dc2626;
    color: white;

    font-size: 12px;
    font-weight: 700;
}

.notification-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.notification-status.unread {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.notification-status.read {
    background-color: #dcfce7;
    color: #15803d;
}

.notification-priority {
    font-weight: 700;
}

.notification-action-button {
    border: none;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    background-color: #2563eb;
    color: white;
}

.notification-action-button:hover {
    opacity: 0.85;
}

/* ===============================
   PANEL DESPLEGABLE DE NOTIFICACIONES
   =============================== */

.notification-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.notifications-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;

    width: 420px;
    max-height: 520px;

    background-color: #1f2937;
    border: 1px solid #334155;
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);

    z-index: 9999;

    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    pointer-events: none;

    transition:
            opacity 180ms ease,
            transform 180ms ease;
}

body:not(.dark-mode) .notifications-dropdown {
    background-color: #ffffff;
    border-color: #d9dee5;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}

.notifications-dropdown.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.notifications-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    padding: 16px;
    border-bottom: 1px solid #334155;
}

body:not(.dark-mode) .notifications-dropdown-header {
    border-bottom-color: #d9dee5;
}

.notifications-dropdown-header h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 18px;
}

body:not(.dark-mode) .notifications-dropdown-header h3 {
    color: #111827;
}

.notifications-dropdown-header p {
    margin: 4px 0 0;
    color: #94a3b8;
    font-size: 13px;
}

body:not(.dark-mode) .notifications-dropdown-header p {
    color: #64748b;
}

.close-notifications-button {
    border: none;
    background-color: transparent;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 16px;
}

body:not(.dark-mode) .close-notifications-button {
    color: #475569;
}

.close-notifications-button:hover {
    color: #ffffff;
}

body:not(.dark-mode) .close-notifications-button:hover {
    color: #111827;
}

.notifications-dropdown-summary {
    display: flex;
    justify-content: space-between;
    gap: 10px;

    padding: 10px 16px;
    background-color: #111827;
    color: #cbd5e1;
    font-size: 13px;
}

body:not(.dark-mode) .notifications-dropdown-summary {
    background-color: #f8fafc;
    color: #334155;
}

.notifications-view-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 16px;
    background-color: #111827;
    border-bottom: 1px solid #334155;
}

body:not(.dark-mode) .notifications-view-tabs {
    background-color: #ffffff;
    border-bottom-color: #d9dee5;
}

.notifications-view-tab {
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 7px 10px;
    background-color: transparent;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.notifications-view-tab.active {
    background-color: #2563eb;
    border-color: #60a5fa;
    color: #ffffff;
}

body:not(.dark-mode) .notifications-view-tab {
    border-color: #cbd5e1;
    color: #334155;
}

body:not(.dark-mode) .notifications-view-tab.active {
    background-color: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.notifications-dropdown-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid #334155;
    background-color: #111827;
}

body:not(.dark-mode) .notifications-dropdown-actions {
    background-color: #ffffff;
    border-bottom-color: #d9dee5;
}

.notifications-dropdown-actions .notification-action-button {
    width: 100%;
}

.secondary-notification-action {
    background-color: #334155;
}

body:not(.dark-mode) .secondary-notification-action {
    background-color: #e2e8f0;
    color: #1f2937;
}

.notifications-dropdown-actions .notification-action-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.notifications-dropdown-body {
    max-height: 380px;
    overflow-y: auto;
    padding: 10px;
}

.notification-item {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #334155;
    background-color: #111827;
    margin-bottom: 10px;
}

body:not(.dark-mode) .notification-item {
    border-color: #d9dee5;
    background-color: #ffffff;
}

.notification-item.unread {
    border-color: #2563eb;
    background-color: #172554;
}

body:not(.dark-mode) .notification-item.unread {
    border-color: #2563eb;
    background-color: #eff6ff;
}

.notification-item-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.notification-item-title {
    color: #f8fafc;
    font-weight: 700;
    font-size: 14px;
}

body:not(.dark-mode) .notification-item-title {
    color: #111827;
}

.notification-item-date {
    color: #94a3b8;
    font-size: 12px;
    white-space: nowrap;
}

body:not(.dark-mode) .notification-item-date {
    color: #64748b;
}

.notification-item-message {
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 8px;
}

body:not(.dark-mode) .notification-item-message {
    color: #334155;
}

.notification-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.notification-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.notification-status.unread {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.notification-status.read {
    background-color: #dcfce7;
    color: #15803d;
}

.notification-status.archived {
    background-color: #e2e8f0;
    color: #475569;
}

.notification-action-button {
    border: none;
    border-radius: 8px;
    padding: 6px 10px;

    background-color: #2563eb;
    color: white;

    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.notification-action-button:hover {
    opacity: 0.85;
}

.empty-notifications-message {
    padding: 20px;
    color: #94a3b8;
    text-align: center;
    font-size: 14px;
}


.project-observation-summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.12);
}

.project-observations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 18px;
}

.project-observation-item {
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
}

.project-observation-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.project-observation-item p {
    margin: 0;
    line-height: 1.5;
}

.project-detail-card {
    padding: 16px;
    border-radius: 14px;
    background: rgba(148, 163, 184, 0.12);
    margin-bottom: 18px;
}

.project-detail-card h4 {
    margin-top: 0;
    margin-bottom: 14px;
}

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

.project-detail-grid div {
    min-width: 0;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
}

.project-detail-grid span {
    display: block;
    font-size: 0.78rem;
    opacity: 0.75;
    margin-bottom: 4px;
}

.project-detail-grid strong {
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

.project-detail-extra {
    margin-top: 14px;
    line-height: 1.5;
}

.project-detail-section {
    margin-top: 18px;
}

.project-detail-section h4 {
    margin-bottom: 10px;
}

.project-detail-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
}

.project-detail-list-item {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(255, 255, 255, 0.04);
}

.project-detail-list-item p {
    margin: 6px 0;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.project-detail-list-item small {
    display: block;
    opacity: 0.75;
}

.document-management-modal {
    max-width: 1080px;
}

.document-management-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    margin-bottom: 18px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.12);
}

.document-management-kicker {
    display: block;
    margin-bottom: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #2563eb;
}

.document-management-hero h4 {
    margin: 0;
    font-size: 1.15rem;
    overflow-wrap: anywhere;
}

.document-management-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.document-management-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 26px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1e40af;
    font-size: 0.78rem;
    font-weight: 700;
}

.document-management-badge.success {
    background: #dcfce7;
    color: #166534;
}

.document-management-badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.document-management-badge.danger {
    background: #fee2e2;
    color: #991b1b;
}

.document-management-badge.muted {
    background: rgba(148, 163, 184, 0.18);
    color: #475569;
}

.document-management-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: start;
}

.document-management-main,
.document-management-side-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.08);
}

.document-management-section-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.document-management-section-header h4,
.document-management-side-card h4 {
    margin: 0 0 6px;
}

.document-management-section-header p,
.document-management-side-card p {
    margin: 0;
    line-height: 1.45;
    color: #64748b;
    overflow-wrap: anywhere;
}

.document-management-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.document-management-side-card dl {
    margin: 0;
}

.document-management-side-card dl div {
    padding: 10px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.document-management-side-card dl div:last-child {
    border-bottom: 0;
}

.document-management-side-card dt {
    margin-bottom: 4px;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
}

.document-management-side-card dd {
    margin: 0;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.document-management-side-card > strong {
    display: block;
    margin-bottom: 6px;
    overflow-wrap: anywhere;
}

.compact-action-button {
    width: 100%;
    margin-top: 12px;
}

.document-management-actions {
    flex-wrap: wrap;
}

.document-version-timeline {
    max-height: 430px;
}

body.dark-mode .document-management-hero {
    background: rgba(37, 99, 235, 0.18);
}

body.dark-mode .document-management-kicker {
    color: #93c5fd;
}

body.dark-mode .document-management-main,
body.dark-mode .document-management-side-card {
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.38);
}

body.dark-mode .document-management-section-header p,
body.dark-mode .document-management-side-card p,
body.dark-mode .document-management-side-card dt {
    color: #cbd5e1;
}

body.dark-mode .document-management-badge.muted {
    background: rgba(148, 163, 184, 0.22);
    color: #e2e8f0;
}

#documentCommentsList {
    max-height: 300px;
    overflow-y: auto;
}

#documentDetailVersionsList,
#documentDetailCommentsList,
#documentVersionsList {
    max-height: 260px;
    overflow-y: auto;
}

#newDocumentCommentText {
    width: 100%;
    resize: vertical;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.admin-tab {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    color: inherit;
}

.admin-tab.active {
    font-weight: 700;
}

.admin-tab:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.admin-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.admin-panel.hidden {
    display: none;
}

.form-card,
.table-card {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 8px;
    padding: 20px;
    background: rgba(15, 23, 42, 0.18);
}

.form-card h3,
.table-card h3 {
    margin-top: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px 24px;
    align-items: start;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.form-group label {
    line-height: 1.2;
}

.form-group input,
.form-group select {
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid rgba(148, 163, 184, 0.38);
    border-radius: 6px;
    box-sizing: border-box;
}

.form-group small {
    color: #94a3b8;
    line-height: 1.35;
}

.form-actions {
    margin-top: 14px;
}

.permission-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    min-width: 220px;
}

.permission-checks label {
    align-items: center;
    display: inline-flex;
    gap: 5px;
    white-space: nowrap;
}

.permission-checks input {
    margin: 0;
}

.filter-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: flex-end;
}

.filter-actions .primary-button,
.filter-actions .secondary-button {
    width: auto;
    margin-top: 0;
}

.form-message {
    min-height: 20px;
    margin-top: 10px;
}

.success-message {
    color: #15803d;
}

.error-message {
    color: #dc2626;
}

.account-warning {
    margin-top: 14px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.16);
    border: 1px solid rgba(245, 158, 11, 0.45);
    color: #fbbf24;
    font-weight: 700;
}

.password-rules-box {
    margin: 14px 0;
    padding: 12px;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.password-rules-box ul {
    margin: 8px 0 0 18px;
    padding: 0;
}

.password-rules-box li {
    margin-bottom: 4px;
}

.account-settings-content {
    width: min(920px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
}

.account-settings-content .modal-body {
    padding: 20px 24px 28px;
}

.account-settings-content .project-detail-card,
.account-password-card {
    box-sizing: border-box;
    width: 100%;
}

.account-settings-content .modal-close-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
}

.account-password-card {
    overflow: hidden;
    margin-bottom: 0;
}

.account-password-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.account-password-grid .form-group {
    min-width: 0;
}

.account-password-grid input {
    box-sizing: border-box;
}

.account-password-grid small {
    display: block;
    line-height: 1.35;
    margin-top: 2px;
}

.account-modal-actions {
    align-items: stretch;
    gap: 10px;
    margin-bottom: 0;
}

.account-modal-actions .primary-button {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    margin-top: 0;
}

.account-modal-actions .secondary-button {
    flex: 0 0 auto;
}

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

.table-select {
    min-width: 130px;
    padding: 7px 9px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.85);
    color: #e5e7eb;
    font-size: 0.85rem;
}

body.light-mode .table-select {
    background: #ffffff;
    color: #111827;
}

.table-wrapper {
    overflow-x: auto;
}

.security-event-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.14);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #93c5fd;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

body:not(.dark-mode) .security-event-badge {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, 0.25);
}

.security-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0 16px;
}

.security-summary-card {
    padding: 12px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.32);
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.security-summary-card span {
    display: block;
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 700;
}

.security-summary-card strong {
    display: block;
    margin-top: 4px;
    font-size: 1.35rem;
}

.security-critical-alert {
    margin: 12px 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(220, 38, 38, 0.16);
    border: 1px solid rgba(248, 113, 113, 0.45);
    color: #fecaca;
    font-weight: 800;
}

.graph-secret-card {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.graph-secret-card > div {
    padding: 14px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.32);
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.graph-secret-label {
    display: block;
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.graph-secret-card strong {
    display: block;
    font-size: 1.05rem;
}

.graph-secret-card.ok > div {
    border-color: rgba(34, 197, 94, 0.35);
}

.graph-secret-card.warning > div,
.graph-secret-card.not-configured > div {
    border-color: rgba(245, 158, 11, 0.45);
}

.graph-secret-card.critical > div,
.graph-secret-card.expired > div,
.graph-secret-card.error > div {
    border-color: rgba(248, 113, 113, 0.5);
}

.graph-secret-alert {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    font-weight: 800;
}

.graph-secret-alert.warning,
.graph-secret-alert.not-configured {
    background: rgba(245, 158, 11, 0.16);
    border: 1px solid rgba(251, 191, 36, 0.45);
    color: #fde68a;
}

.graph-secret-alert.critical,
.graph-secret-alert.expired,
.graph-secret-alert.error {
    background: rgba(220, 38, 38, 0.16);
    border: 1px solid rgba(248, 113, 113, 0.45);
    color: #fecaca;
}

.security-event-row-critical {
    background: rgba(220, 38, 38, 0.08);
}

.security-event-row-warning {
    background: rgba(245, 158, 11, 0.08);
}

.security-event-badge.critical {
    background: rgba(220, 38, 38, 0.16);
    border-color: rgba(248, 113, 113, 0.45);
    color: #fecaca;
}

.security-event-badge.warning {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(251, 191, 36, 0.45);
    color: #fde68a;
}

body:not(.dark-mode) .security-summary-card {
    background: #ffffff;
    border-color: #d1d5db;
}

body:not(.dark-mode) .security-critical-alert {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

body:not(.dark-mode) .graph-secret-card > div {
    background: #ffffff;
    border-color: #d1d5db;
}

body:not(.dark-mode) .graph-secret-alert.warning,
body:not(.dark-mode) .graph-secret-alert.not-configured {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

body:not(.dark-mode) .graph-secret-alert.critical,
body:not(.dark-mode) .graph-secret-alert.expired,
body:not(.dark-mode) .graph-secret-alert.error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

body:not(.dark-mode) .security-event-badge.critical {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

body:not(.dark-mode) .security-event-badge.warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

/* ===============================
   LOGIN
   =============================== */

.login-page {
    min-height: 100vh;
    background:
            radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 34%),
            #f4f6f8;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border: 1px solid #d9dee5;
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
}

.login-brand h1 {
    margin: 0;
    color: #0f172a;
    font-size: 28px;
}

.login-brand p {
    margin: 8px 0 22px;
    color: #64748b;
}

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

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

.login-form label {
    color: #111827;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cfd6df;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 15px;
}

.login-submit-button {
    width: 100%;
    border: none;
    background: #1f4f8b;
    color: #ffffff;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
}

.login-submit-button:hover {
    background: #2563eb;
}

.login-message {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 18px;
    padding: 12px;
    border-radius: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.login-message.success {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #166534;
}

.login-message span,
.login-message small {
    line-height: 1.35;
}

.login-message small {
    color: inherit;
    opacity: 0.86;
}

@media (max-width: 768px) {
    .account-password-grid {
        grid-template-columns: 1fr;
    }

    .account-modal-actions {
        flex-direction: column;
    }

    .account-modal-actions .primary-button,
    .account-modal-actions .secondary-button {
        width: 100%;
    }

    .project-detail-grid {
        grid-template-columns: 1fr;
    }

    .document-management-hero {
        flex-direction: column;
    }

    .document-management-badges {
        justify-content: flex-start;
    }

    .document-management-layout {
        grid-template-columns: 1fr;
    }

    .panel-toolbar,
    .panel-toolbar.audit-toolbar {
        grid-template-columns: 1fr auto;
    }

    .panel-toolbar.audit-toolbar select {
        grid-column: span 2;
    }
}
