:root {
    --primary-color: #0e124f;
}

* { margin: 0; padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 16px;
}
    ol, ul { list-style: none; }

*, *::before, *::after { box-sizing: border-box; }

a {text-decoration: none; color: inherit;}

html {
    height: 100%;
}

body{
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: var(--primary-color);
    background-color: #f5f5f5;
}

header {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    padding: 1rem;
}

section {
    margin-top: 1rem;
    width: 85%;
}
input[type="range"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #d5d5d5;
    outline: none;
    height: 8px;
    border-radius: 8px;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--primary-color);
    cursor: pointer;
    margin-top: -4px;
}
input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--primary-color);
    cursor: pointer;
    margin-top: -4px;
}
input[type="range"]::-ms-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--primary-color);
    cursor: pointer;
    margin-top: -4px;
}
input[type="range"]::-webkit-slider-runnable-track {
    height: 8px;
}
input[type="range"]::-moz-range-track {
    height: 8px;
}
input[type="range"]::-ms-track {
    appearance: none;
    height: 8px;
    border: none;
    color: transparent;
}
input[type="range"]:active::-webkit-slider-thumb {
    background-color: white;
    border: 3px solid var(--primary-color);
}
#range-value {
    width: 5%;
    padding: .5rem 0;
    background-color: var(--primary-color);
    color: white;
    border-radius: 4px;
    text-align: center;
}

.sidebar {
    z-index: 2;
    background-color: white;
    width: max-content;
    max-height: 88vh;
    border-radius: 10px;
    padding: .5rem .25rem;
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
    overflow-y: auto;
    overflow-x: hidden;
}
.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-track {
    background-color: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background-color: #dcdcdc;
    border-radius: 10px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: #c0c0c0;
}
.sidebar::-webkit-scrollbar-thumb:active {
    background-color: var(--primary-color);
}
.sidebar:hover .sidebar-element {
    grid-template-columns: 40px 1fr;
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.sidebar-element {
    padding: .8rem 1.3rem;
    display: grid;
    grid-template-columns: 40px 0fr;
    border-radius: 3px;
    transition: grid-template-columns .25s;
    text-wrap: nowrap;
    text-align: left;
    user-select: none;

    color: var(--primary-color);
    fill: var(--primary-color);
}
.sidebar-element:not(:has(.sidebar-icon-logo)):hover {
    background-color: var(--primary-color);
    color: white;
    fill: white;
    cursor: pointer;
}
.sidebar-element:has(.sidebar-icon-logo) {
    margin-bottom: 1rem;
    user-select: none;
}
.sidebar-icon {
    width: 24px;
    overflow: hidden;
    justify-self: center;
}
.sidebar-icon-logo {
    max-width: 30px;
}
.sidebar-icon-avatar {
    width: 40px;
    aspect-ratio: 1/1;
    object-fit: cover;
    object-position: top;
    border-radius: 50%;
}
.sidebar-logo, .sidebar-text {
    padding-left: 1.3rem;
}
.sidebar-hide {
    overflow: hidden;
}
.sidebar-element-avatar {
    margin-top: auto;
}
.sidebar-title, .sidebar-info {
    padding-left: 1.3rem;
}
.dropdown-menu {
    display: none;
    flex-direction: column;
    list-style: none;
    margin-top: 0.2rem;
    gap: 0.2rem;
}
.dropdown-menu.show {
    display: flex;
}
.sidebar:not(:hover) .dropdown-menu.show {
    display: none;
}
.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    margin-left: 10px;
}
.dropdown-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}
.dropdown-toggle div {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
}
    
.sub-element {
    padding: 0.6rem 1rem;
    grid-template-columns: 0fr; 
}
.sidebar:hover .sub-element {
    grid-template-columns: 1fr;
}
.dropdown-menu .sidebar-element.active {
    background-color: var(--primary-color);
    color: white;
    fill: white;
}

.container {
    display: flex;
    align-items: center;
    flex-direction: column;
    flex: 1;
    padding: 0 1rem;
}

.full-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    flex: 1;
    width: 100%;
    height: 100%;
}

.option-header-buttons{
    display: flex;
    gap: 1rem;
}
.option-header-buttons li a {
    display: flex;
    gap: .5rem;
    justify-items: center;
}

.search-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.search-element {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding-top: 4vh;
    padding-bottom: 2rem;
}
.search-container h1, .login-container h1{
    font-weight: 600;
    font-size: 3rem;
    text-align: center;
    user-select: none;
}

.form-container {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    gap: 2rem;
    width: 100%;
}

.form-navegator{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    width: 100%;
    max-width: 600px;
}
.form-navegator h1 {
    margin-bottom: 1rem;
}
.advanced-navegator{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    width: 100%;
    opacity: 1;
    transition: all .25s allow-discrete;
    flex: 1;

    @starting-style{
        opacity: 0;
        transform: translateY(-50px);
    }
}
.advanced-navegator-hidden {
    display: none;
    opacity: 0;
    transform: translateY(-50px);
    transition: all .25s;
}

#prompt-container {
    align-items: normal;
}
.navegator-item, .animated-navegator-item {
    width: 100%;
    max-width: inherit;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: .5rem;
    position: relative;
}
.animated-navegator-item {
    opacity: 1;
    transition: all .25s allow-discrete;
    flex: 1;

    @starting-style{
        opacity: 0;
        transform: translateY(-50px);
    }
}
.animated-navegator-hidden {
    display: none;
    opacity: 0;
    transform: translateY(-50px);
    transition: all .25s;
}
.advanced-navegator-item {
    display: flex;
}
.search-bar{
    padding: .5rem 1rem;
    width: 100%;
    max-width: inherit;
    border: 1px solid grey;
    border-radius: 2rem;
    
}
.search-bar:focus-visible {
    outline: none;
}
.search-button, .absolute-button {
    position: absolute;
    height: 100%;
    right: 0;
}
.absolute-button {
    padding: 0 .75rem;
    color: gray;
    border: 1px solid gray;
    border-radius: 2rem;
    cursor: pointer;
    transition: background-color .15s ease;
    user-select: none;
}

.submit-button, .search-button {
    padding: 0 1rem;
    background-color: var(--primary-color);
    color: white;
    border: 0 solid;
    border-radius: 2rem;
    cursor: pointer;
    font-weight: 600;
    transition: background-color .15s ease;
}
.submit-button {
    padding: .5rem 1rem;
}

.submit-button:hover, .search-button:hover {
    background-color: #2a318f;
}
.submit-button:active, .advanced-button:active, .search-button:active, .absolute-button:active {
    color: var(--primary-color);
    background-color: white;
}
.submit-button-secondary {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}
.submit-button-secondary:hover {
    background-color: rgba(14, 18, 79, .08);
}
.submit-button-secondary:active {
    color: #fff;
    background-color: var(--primary-color);
}
.flex-row {
    display: flex;
    flex-direction: row;
    position: relative;
}
.advanced-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: transparent;
    width: 8rem;
}
.advanced-select:disabled {
    cursor: default;
}
.advanced-select, .advanced-button {
    padding: .25rem 1rem;
    color: gray;
    border: 1px solid gray;
    border-radius: 2rem;
    cursor: pointer;
    transition: background-color .15s ease;
    user-select: none;
}
.advanced-button:hover, .absolute-button:hover {
    background-color: white;
}

.multiselect-container {
    display: block;
}
.multiselect-container-hidden {
    display: none;
}
.multiselect {
    display: flex;
    flex-direction: column;
}
.multiselect-open ~ .multiselect-list {
    display: flex;
    flex-direction: column;
}
.multiselect-list {
    display: none;
    position: absolute;
    max-width: fit-content;
    width: 100%;
    margin-top: .5rem;
    border-radius: .5rem;
    padding: .5rem;
    background-color: white;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
    max-height: 300px;
    overflow: auto;
}
.multiselect-element {
    display: flex;
}
.checkbox {
    display: flex;
    align-items: center;
    position: relative;
    padding: .5rem 1.5rem;
    user-select: none;
    margin-left: 1rem;
    margin-bottom: .5rem;
    cursor: pointer;
    width: 100%;
}
.checkbox input {
    position: absolute;
    width: 0;
    height: 0;
    cursor: pointer;
}
.check {
    position: absolute;
    height: 1rem;
    width: 1rem;
    border: 2px solid #e7e7e7;
    border-radius: 50%;
    left: 0;
}
.checkbox:hover input ~ .check{
    border-color: transparent;
    background-color: #ededed;
}
.checkbox input:checked ~ .check{
    border-color: transparent;
    background-color: var(--primary-color);
}
.check::after {
    content: "";
    position: absolute;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    left: 4px;
    transform: rotate(45deg);
}
.normal-checkbox {
    display: flex;
    align-items: center;
    position: relative;
    padding: .5rem 1.25rem;
    margin-left: 1rem;
    user-select: none;
    margin-bottom: .5rem;
    cursor: pointer;
}
.normal-checkbox input {
    position: absolute;
    width: 0;
    height: 0;
    cursor: pointer;
}

.normal-checkbox:hover input ~ .check{
    border-color: transparent;
    background-color: #ededed;
}
.normal-checkbox input:checked ~ .check{
    border-color: transparent;
    background-color: var(--primary-color);
}

.results-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}
.results-container .results-element:last-child {
    margin-bottom: 4rem;
}
.results-container h2 {
    font-size: 1.2rem;
    text-align: left;
    text-align: center;
}
.results-element {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    flex-direction: row;
    gap: 2rem 4vw;
    max-width: 950px;
}
.results-title {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    border-radius: 1rem 1rem 0 0;
}
.results-title h3 {
    text-align: center;
    font-size: 1.25rem;
}
.results-info-container {
    display: flex;
    flex-direction: row;
    padding: 1.27rem;
    max-width: 800px;
    gap: 2rem;
    align-items: center;
}
.results-info {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.results-card {
    display: flex;
    position: relative;
    justify-content: center;
    flex-direction: column;
    gap: .5rem;
    background-color: white;
    border-radius: 1rem;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
}
.result-image {
    height: 120px;
}
.database-card {
    display: flex;
    justify-content: center;
    flex-direction: column;
    gap: .5rem;
    background-color: white;
    border-radius: 1rem;
    padding: 1.27rem;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
}
.database-card .date {
    text-align: center;
    font-size: .9rem;
}
.results-card-list {
    height: 100%;
}
.results-card-list p, .results-card-list b{
    font-size: 1.2rem;
}

.results-element-gemini {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.gemini-card {
    max-width: 720px;
}
.results-element-news {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.results-element-datalists {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}
.news-list, .list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.news-link {
    user-select: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .5rem;
    border-radius: .5rem;
    background-color: white;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
    max-width: 400px;
    height: max-content;
}
.news-link img {
    border-radius: .5rem 0 0 .5rem;
    -webkit-user-drag: none;
    width: 100%;
    max-width: 70px;
    height: 65px;
    max-height: 65px;
    flex: 1 1 100%;
    object-fit: cover;
    background-color: white;
}
.news-link p {
    padding: .5rem 0;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}
.news-link:hover {
    color: white;
    background-color: var(--primary-color);
}

.login-container {
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 1rem;
    padding: 2rem;
    gap: 1.5rem;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
    width: 450px;
}
.login-container .checkbox {
    margin: 0;
    padding: 0 1.5rem;
}

/* Formularios dinámicos: relleno de campos en grid */
.login-container.form-fill {
    width: 720px;
    max-width: 100%;
    padding-bottom: 6rem;
}
.form-grid,
.linked-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    align-items: start;
}
.form-grid .col-span-1,
.linked-fields .col-span-1 {
    grid-column: span 1;
}
.form-grid .col-span-2,
.linked-fields .col-span-2 {
    grid-column: span 2;
}
@media (max-width: 640px) {
    .form-grid,
    .linked-fields {
        grid-template-columns: 1fr;
    }
    .form-grid .col-span-1,
    .form-grid .col-span-2,
    .linked-fields .col-span-1,
    .linked-fields .col-span-2 {
        grid-column: span 1;
    }
}

.url-text {
    color: #2a318f;
    text-decoration: underline;
}

.lang-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    margin-bottom: 1.5rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #1e2a78 0%, #19004C 100%);
    box-shadow: 0 4px 14px rgba(25, 0, 76, .30), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.lang-toggle form {
    flex: 1 1 0;
    display: flex;
    margin: 0;
}
.lang-toggle-option {
    width: 100%;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .08em;
    line-height: 1;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .78);
    padding: .55rem 1.6rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background .3s ease, color .3s ease, box-shadow .3s ease, transform .1s ease;
}
.lang-toggle-option:hover {
    color: #ffffff;
}
.lang-toggle-option:active {
    transform: scale(.96);
}
.lang-toggle-option.is-active {
    background: #ffffff;
    color: #0e124f;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.lang-toggle-option:focus-visible {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

.message {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 3rem;
    background-color: gray;
    color: white;
    width: max-content;
    max-width: calc(100% - 2rem);
    border-radius: .5rem;
    box-shadow: rgba(0, 0, 0, .15) 0 4px 12px;
    text-align: center;
    z-index: 999;
}
.message.hidden {
    display: none;
}
.message li {
    font-size: 1.25rem;
}
.message.error {
    background-color: #ffcccc;
    color: red;
}
.message.ok {
    background-color: #cfffcc;
    color: green;
}
.message.warning {
    background-color: #ffe7b8;
    color: #8a5a00;
}
.message.setup-msg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    max-width: min(90vw, 460px);
    margin: 0;
    padding: .9rem 1.5rem;
    border-radius: .75rem;
    border: 1px solid rgba(0, 0, 0, .08);
    font-weight: 500;
    font-size: .95rem;
    line-height: 1.35;
    box-shadow: rgba(0, 0, 0, .2) 0 8px 24px;
    opacity: 1;
    transition: opacity .35s ease, transform .35s ease;
    pointer-events: none;
}
.message.setup-msg li {
    font-size: .95rem;
}
.message.setup-msg.fading {
    opacity: 0;
    transform: translate(-50%, -55%);
}

/* Módulo exclusivo /setup (usuario fijo adminconf) */
.setup-card.login-container {
    width: 640px;
    max-width: 100%;
}
.setup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.setup-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}
.setup-logout {
    border: none;
    background: transparent;
    padding: 0;
    font-size: .9rem;
    cursor: pointer;
}
.setup-saved {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #f4f4f9;
    border-radius: .5rem;
    padding: .75rem 1rem;
    font-size: .9rem;
}
.setup-install-form {
    margin: 0;
}
.setup-install {
    padding: .45rem .9rem;
    font-size: .85rem;
    white-space: nowrap;
}
.setup-warn {
    background: #fff7e6;
    border: 1px solid #ffd591;
    color: #8a5a00;
    border-radius: .5rem;
    padding: .65rem .9rem;
    font-size: .85rem;
    margin-bottom: 1rem;
}
.status-badge {
    padding: .25rem .75rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    color: #ffffff;
    background: #6b7280;
}
.status-connected {
    background: #16a34a;
}
.status-migration_ready {
    background: #2563eb;
}
.status-saved {
    background: #6b7280;
}
.status-driver_missing {
    background: #f59e0b;
}
.status-unreachable {
    background: #ef4444;
}
.setup-card label {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    margin: 1rem 0 .25rem;
}
.setup-card .form-grid {
    margin-top: .5rem;
}
.setup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.75rem;
}
.setup-options {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1.5rem;
    margin-top: 1.25rem;
    padding: .75rem 1rem;
    background: #f4f4f9;
    border-radius: .5rem;
}
.setup-checkbox {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0 !important;
    font-weight: 500 !important;
    font-size: .9rem !important;
    cursor: pointer;
}
.setup-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
}
.setup-test-result {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: 1rem;
    padding: .75rem 1rem;
    border-radius: .5rem;
    font-size: .9rem;
    font-weight: 600;
}
.setup-test-result.ok {
    background: #e6f4ea;
    color: #166534;
}
.setup-test-result.error {
    background: #fde8e8;
    color: #991b1b;
}
.setup-test-detail {
    font-weight: 500;
    opacity: .75;
}

.manage-users-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}
.manage-users-container h1 {
    font-size: 2rem;
    font-weight: bold;
}
.table {
    display: table;
    background-color: transparent;
    table-layout: fixed;
    margin: 1rem 0rem;
    min-width: 85%;
    border-collapse: separate; 
    border-spacing: 0 .5rem;
}
.row {
    display: table-row;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
}
.table-header {
    display: table-header-group;
    background-color: #0e124f;
}
.table-body {
    display: table-row-group;
}
.table-header .column {
    color: white;
    margin: 0;
    font-weight: bold;
}
.big-header {
    width: 300px;
}
.column {
    display: table-cell;
    padding: .5rem 1rem;
    text-align: left;
    vertical-align: middle;
}
.results-column {
    width: 400px;
}
.column p, .column a {
    font-size: 1rem;
}
.column .flex-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}
.table .row .column{
    background-color: #fefdfd;
}

.hidden {
    display: none;
}

.results-element-comments {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
}
.comments-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    max-width: 800px;
}
.comment-card {
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
}
.close-btn {
      position: absolute;
      top: 10px;
      right: 10px;
      background-color: #f0f0f0;
      color: #0e124f;
      border: none;
      border-radius: 50%;
      width: 24px;
      height: 24px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 16px;
      font-weight: bold;
    }

    .close-btn:hover {
      background-color: #e3e3e3;
    }

    .modal {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.5);
      align-items: center;
      justify-content: center;
      z-index: 2;
    }
    .modal-openAtStart {
      display: flex;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.5);
      align-items: center;
      justify-content: center;
      z-index: 2;
    }
    .update-content {
        display: flex;
        flex-direction: column;
        gap: .5rem;
        background-color: #fff;
        border: 1px solid #ccc;
        padding: 20px;
        border-radius: 8px;
        width: 80%;
        max-width: 500px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
    .update-content li {
        list-style: disc;
        margin-left: 1rem;
    }
    .update-content h2 {
        text-align: center;
        font-size: 1.5rem;
    }
    .update-content .submit-btn {
        margin-top: 1rem;
        align-self: center;
    }

    .modal-content {
      background-color: #fff;
      border: 1px solid #ccc;
      padding: 20px;
      border-radius: 8px;
      width: 300px;
      text-align: center;
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
    .modal-content-user {
        display: flex;
        gap: 1rem;
        flex-direction: column;
        background-color: #fff;
        border: 1px solid #ccc;
        padding: 20px;
        border-radius: 8px;
        width: 300px;
        text-align: center;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
    .modal-content-user input, .modal-content-item input {
        width: 100%;
        height: 40px;
        border: 1px solid #ccc;
        border-radius: 8px;
        padding: 10px;
        font-size: 16px;
        background-color: #f0f0f0;
        color: #333;
      }
    .modal-content-item {
        display: flex;
        flex-direction: column;
        text-align: left;
        gap: .5rem;
    }
    .modal-content-item p {
        font-weight: bold;
        padding-left: 10px;
    }

    textarea {
      width: 100%;
      height: 80px;
      border: 1px solid #ccc;
      border-radius: 8px;
      padding: 10px;
      font-size: 16px;
      background-color: #f0f0f0;
      color: #333;
    }

    .submit-btn {
      margin-top: 10px;
      padding: 10px 20px;
      font-size: 16px;
      background-color: #252b88;
      color: white;
      border: none;
      border-radius: 8px;
      cursor: pointer;
    }

    .submit-btn:hover {
      background-color: #0e124f;
    }

    .cancel-btn {
      margin-top: 10px;
      margin-left: 10px;
      padding: 10px 20px;
      font-size: 16px;
      background-color: #ff4d4d;
      color: white;
      border: none;
      border-radius: 8px;
      cursor: pointer;
    }

    .cancel-btn:hover {
      background-color: #ff1b1b;
    }

.faq-question {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    width: 70%;
    padding: 1.5rem;
    background-color: white;
    border-radius: 1rem;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;

}
.faq-question h2, .user-container h2 {
    font-size: 1.5rem;
}
.faq-question p, .user-container p {
    font-size: 1rem;
}

.user-container {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    width: 40%;
    padding: 1.5rem;
    background-color: white;
    border-radius: 1rem;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
}

.user-container button {
    margin-top: 1rem;
}
.user-container .flex-row {
    display: flex;
    width: 100%;
    padding: 0 2rem;
    align-items: baseline;
    justify-content: center;
    gap: 1rem;
}
.flex-row .range-input {
    width: 100%;
}
.flex-row #range-value {
    width: auto;
    min-width: 40px;
}

.api-token-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: white;
    border-radius: 1rem;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
}
.api-token-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}

.list {
    padding: 0 1.5rem;
}

.list li {
    list-style: disc;
}
.text-center {
    text-align: center;
}

#pdf-preview-container {
    display: none;
    position: absolute;
    border: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
}

#pdf-canvas {
    width: 450px;
    height: auto;
}

#country-flag {
    width: 48px;
    height: 32px;
    object-fit: cover;
    border: 1px solid #ccc;
    border-radius: 4px;
    position: absolute;
    right: 20%;
    top: 10%;
    pointer-events: none;
}
.alert-bg {
    background-color: #ffeb3b; /* amarillo base por defecto */
    color: #000;
    transition: background-color .15s ease, color .15s ease;
}
.table .row.alert-bg:nth-child(even) .column {
    background-color: #ffee50;
    color: #000;
}
.table .row.alert-bg:nth-child(odd) .column {
    background-color: #f3e354;
    color: #000;
}
/* Contenedor principal de la paginación (el <ul>) */
.pagination {
    display: flex; /* Alinea los elementos horizontalmente */
    padding-left: 0;
    list-style: none; /* Quita los puntos de la lista */
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    justify-content: center; /* Centra la paginación */
    gap: 0.35rem; /* Espacio entre botones */
    flex-wrap: wrap; /* Evita desbordes en pantallas pequeñas */
}

/* Cada "cajita" (el <li>) */
.page-item {
    margin: 0;
}

/* Estilo de los enlaces (<a>) y spans (<span>) dentro de las cajitas */
.page-link {
    display: inline-flex; /* Centra el texto vertical y horizontalmente */
    align-items: center;
    justify-content: center;
    min-width: 2.5rem; /* Botones cuadrados de tamaño uniforme */
    height: 2.5rem;
    padding: 0 0.75rem;
    color: var(--primary-color); /* Color del texto (azul) */
    font-weight: 500;
    text-decoration: none; /* Quita el subrayado */
    background-color: #fff; /* Fondo blanco */
    border: 1px solid #e3e6ef; /* Borde suave */
    border-radius: 0.75rem; /* Bordes redondeados acordes al tema */
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04); /* Sombra sutil */
    transition: all 0.2s ease-in-out;
}

/* Estilo al pasar el mouse (hover) sobre los enlaces */
.page-link:hover {
    z-index: 2;
    color: var(--primary-color);
    background-color: #f0f2ff; /* Tinte azul claro */
    border-color: #cdd2f0;
    box-shadow: 0 4px 10px rgba(14, 18, 79, 0.12);
    transform: translateY(-1px); /* Efecto de elevación */
}

/* Estilo del ítem activo (página actual) */
.page-item.active .page-link {
    z-index: 3;
    color: #fff; /* Texto blanco */
    background-color: var(--primary-color); /* Fondo azul */
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(14, 18, 79, 0.35);
    cursor: default;
    transform: none;
}

/* Estilo de los ítems deshabilitados (ej. "Anterior" en la pág 1) */
.page-item.disabled .page-link {
    color: #9aa3b5; /* Texto gris */
    pointer-events: none; /* Evita que se pueda hacer clic */
    background-color: #fff;
    border-color: #eef0f5;
    box-shadow: none;
}

.table-header-filter {
    position: relative;
    width: 100%;
    user-select: none;
}
.table-header-filter select {
    appearance: none;
    color: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: transparent;
    border: none;
    width: 100%;
    font-weight: bold;
    padding-right: 1.5rem;
    cursor: pointer;
    text-wrap: wrap;
    text-align: center;
}
.table-header-filter select option {
    color: var(--primary-color);
}
.filter-icon {
    position: absolute;
    fill: white;
    justify-self: center;
    overflow: hidden;
    right: 0;
    pointer-events: none;
    cursor: pointer;
}

#loginForm {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
#resetForm {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.module-row {
    display: flex;
    flex-wrap: nowrap;
    padding-top: 1rem;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    flex: 1 0 auto;
}
.module-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    gap: 1rem;
}
.module-item:hover {
    transform: scale(1.05);
}
.module-item svg {
    display: block;
    width: 9rem;
    height: 9rem;
}
.module-item p {
    font-size: 1.5rem;
}
.last-login {
    margin: 0 0 1rem;
    color: var(--primary-color, #0e124f);
    font-size: 1rem;
    opacity: 0.85;
}
.last-login-ip {
    font-weight: 600;
}

footer {
    flex-shrink: 0;
    padding: 3rem;
}

/* Dynamic Forms */
.builder-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}
.builder-container h1 {
    font-size: 2rem;
    font-weight: bold;
}
.builder-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background-color: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
    width: 100%;
}
.builder-card h2 {
    font-size: 1.25rem;
    font-weight: bold;
}
.submission-author {
    font-size: 0.9rem;
    font-weight: normal;
    color: #6b7280;
    margin-left: 0.5rem;
}
.builder-field {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    background-color: #fafafa;
    border: 1px solid #e7e7e7;
    border-radius: .75rem;
    padding: 1rem;
}
.builder-field-row {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}
.builder-field-row .search-bar {
    max-width: none;
    flex: 1;
}
.builder-field-tools {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
    padding-top: .5rem;
    margin-top: .5rem;
    border-top: 1px dashed #e0e0e0;
}
.builder-options {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding-left: 1rem;
    border-left: 3px solid #e7e7e7;
}
.builder-options[hidden],
.builder-linked[hidden] {
    display: none;
}
.builder-option-row {
    display: flex;
    gap: .5rem;
    align-items: center;
}
.builder-option-row .search-bar {
    flex: 1;
}
.builder-label {
    font-weight: 600;
    font-size: .9rem;
}
.builder-check {
    display: flex;
    align-items: center;
    gap: .5rem;
    user-select: none;
    cursor: pointer;
}
.builder-check input {
    accent-color: var(--primary-color);
}
.builder-remove {
    padding: .25rem .75rem;
    border: 1px solid #dc3545;
    border-radius: 2rem;
    background-color: white;
    color: #dc3545;
    cursor: pointer;
    font-weight: 600;
}
.builder-remove:hover {
    background-color: #dc3545;
    color: white;
}
.builder-move {
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid #c8c8c8;
    border-radius: .5rem;
    background-color: white;
    color: #555;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}
.builder-move:hover:not(:disabled) {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}
.builder-move:disabled {
    opacity: .35;
    cursor: not-allowed;
}
.builder-add {
    padding: .4rem 1rem;
    border: 1px solid var(--primary-color);
    border-radius: 2rem;
    background-color: white;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 600;
}
.builder-add:hover {
    background-color: var(--primary-color);
    color: white;
}
.builder-actions {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    flex-wrap: wrap;
}
.builder-inline-form {
    display: inline;
}

/* Filas repetibles (formularios enlazados repetibles y segmentos de matriz) */
.linked-repeatable {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.linked-instance {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    background-color: #fafafa;
    border: 1px solid #e7e7e7;
    border-radius: .75rem;
    padding: .75rem;
}
.linked-instance-tools {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    padding-top: .5rem;
    border-top: 1px dashed #e0e0e0;
}
.repeatable-wrapper {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.repeatable-row {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.repeatable-row .search-bar {
    flex: 1;
}

/* Celdas editables de la tabla de segmentos de la matriz */
.segment-row .column {
    width: auto;
}
.segment-row .segment-input {
    border-radius: .5rem;
    padding: .3rem .6rem;
    font-size: .95rem;
}
.segment-row form {
    display: contents;
}

/* Form dropdowns */
.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
    cursor: pointer;
}
.multiselect-wrapper {
    position: relative;
}
.multiselect-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    text-align: left;
}
.multiselect-trigger.open ~ .multiselect-list {
    display: flex;
}
.multiselect-arrow {
    transition: transform .15s ease;
}
.multiselect-trigger.open .multiselect-arrow {
    transform: rotate(180deg);
}
.multiselect-list {
    display: none;
    flex-direction: column;
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    margin-top: .5rem;
    border-radius: .75rem;
    padding: .5rem;
    background-color: white;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
    max-height: 250px;
    max-width: none;
    overflow: auto;
}
.multiselect-list .checkbox {
    margin-left: 0;
}
.multiselect-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Selects con búsqueda (reemplazan visualmente al select nativo) */
.searchable-wrapper {
    position: relative;
}
.searchable-native {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}
.searchable-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    text-align: left;
    width: 100%;
}
.searchable-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.searchable-arrow {
    transition: transform .15s ease;
    flex: none;
}
.searchable-trigger.open .searchable-arrow {
    transform: rotate(180deg);
}
.searchable-dropdown {
    display: none;
    flex-direction: column;
    gap: .5rem;
    position: absolute;
    z-index: 21;
    left: 0;
    right: 0;
    margin-top: .5rem;
    border-radius: .75rem;
    padding: .5rem;
    background-color: white;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
}
.searchable-trigger.open + .searchable-dropdown {
    display: flex;
}
.searchable-input {
    width: 100%;
}
.searchable-options {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    max-height: 220px;
    overflow: auto;
}
.searchable-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: .5rem .6rem;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    cursor: pointer;
    font: inherit;
    color: inherit;
}
.searchable-option:hover,
.searchable-option:focus-visible,
.searchable-option.active {
    background: #f1f5f9;
}
.searchable-option.selected {
    font-weight: 600;
}
.searchable-option.empty {
    color: #94a3b8;
    font-style: italic;
}
.searchable-empty {
    margin: 0;
    padding: .4rem .6rem;
    color: #94a3b8;
    font-size: .9rem;
}
.multiselect-search {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: white;
    margin-bottom: .5rem;
    width: 100%;
    max-width: none;
}

/* Evaluación de riesgo: un factor por fila y errores inline */
.assessment-factors {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
}
.assessment-factor-row {
    gap: .75rem;
    padding: 1rem;
}
.assessment-error {
    color: #dc3545;
    font-size: .85rem;
    margin-top: .25rem;
}
.assessment-limit-hint {
    font-size: .85rem;
    color: #64748b;
    margin: .25rem 0 0;
}
.assessment-counter {
    font-weight: 600;
}
.assessment-counter.warn {
    color: #dc3545;
}
.assessment-summary {
    padding: .75rem 1rem;
    margin-bottom: .5rem;
    background-color: #ffcccc;
    color: #b02a37;
    border-radius: .5rem;
    font-weight: 600;
}
.assessment-summary[hidden] {
    display: none;
}
.assessment-summary-context {
    margin: .25rem 0 0;
    font-weight: 400;
    opacity: .8;
}
.assessment-summary-details {
    margin: .25rem 0 0;
    padding-left: 1.25rem;
    font-weight: 400;
}
.assessment-summary-details li {
    margin-bottom: .15rem;
}
.assessment-result {
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    background-color: #cfffcc;
    color: #1e7d32;
    border-radius: .5rem;
    font-weight: 600;
}
.assessment-detail {
    margin-top: .25rem;
}
.assessment-detail-toggle {
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: .5rem;
    user-select: none;
}
.assessment-detail .table {
    min-width: 100%;
}
.assessment-detail .column:first-child {
    width: 45%;
}
.assessment-detail .column:nth-child(2) {
    width: 8%;
}
.assessment-detail .column:nth-child(3) {
    width: 27%;
}
.assessment-detail .column:nth-child(4) {
    width: 10%;
}
.assessment-detail .column:nth-child(5) {
    width: 10%;
}
.ai-analysis p {
    margin: 0 0 .5rem;
    line-height: 1.5;
}
.ai-analysis p:last-child {
    margin-bottom: 0;
}
.ai-analysis hr {
    border: 0;
    border-top: 1px solid #cccccc;
    margin: .6rem 0;
}
.assessment-download-btn {
    display: block;
    text-align: center;
    margin-top: .4rem;
    padding: .35rem .9rem;
    background-color: #1e7d32;
    color: #fff;
    border-radius: 2rem;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .15s ease;
}
.assessment-download-btn:hover {
    background-color: #15632a;
}

/* Dashboards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    width: 100%;
    margin-bottom: 1rem;
}
.kpi-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    background-color: #19004C;
    color: #ffffff;
    border-radius: 1rem;
    padding: 1.25rem 1rem;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
}
.kpi-value {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
}
.kpi-label {
    font-size: .95rem;
    opacity: .85;
}
.chart-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
    margin-bottom: 1rem;
}
.chart-card--span-2 { grid-column: span 2; }
.chart-card--span-3 { grid-column: span 3; }
.chart-card--span-6 { grid-column: span 6; }
@media (max-width: 1100px) {
    .chart-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .chart-card--span-2, .chart-card--span-3 { grid-column: span 2; }
    .chart-card--span-6 { grid-column: span 4; }
}
@media (max-width: 720px) {
    .chart-grid { grid-template-columns: minmax(0, 1fr); }
    .chart-card--span-2, .chart-card--span-3, .chart-card--span-6 { grid-column: span 1; }
}
.chart-canvas {
    position: relative;
    height: 260px;
    width: 100%;
}
.chart-card--span-6 .chart-canvas {
    height: 340px;
}
.chart-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
    margin-top: 1rem;
}
.chart-editor-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem 1rem;
    margin-bottom: .5rem;
}
.chart-editor-filters {
    margin-bottom: .5rem;
}
.chart-editor-colors {
    margin-bottom: .5rem;
}
.chart-color-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .25rem;
}
.chart-color-input {
    width: 48px;
    height: 32px;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
}
.chart-color-hex {
    font-size: .85rem;
    color: #19004C;
    min-width: 72px;
}
.chart-color-remove {
    border: none;
    background: transparent;
    color: #EF4444;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: .1rem .35rem;
}
.chart-color-chip {
    margin: .25rem .25rem 0 0;
}
.chart-editor-preview h3 {
    margin: 0 0 .25rem;
}
.chart-preview-empty {
    color: #19004C;
    opacity: .8;
}
#chart-preview-holder .chart-canvas {
    height: 300px;
}
@media (max-width: 900px) {
    .chart-editor {
        grid-template-columns: minmax(0, 1fr);
    }
}
.dashboard-links p {
    font-size: 1rem;
}
.bucket-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}
.bucket-btn {
    padding: .5rem 1rem;
    border: 1px solid #19004C;
    border-radius: 999px;
    background: #fff;
    color: #19004C;
    cursor: pointer;
    font-weight: 600;
    transition: background-color .15s ease, color .15s ease;
}
.bucket-btn:hover {
    background: #ece6ff;
}
.bucket-btn.is-active {
    background: #19004C;
    color: #fff;
}
.builder-field.protected-field {
    border-left: 3px solid #19004C;
    padding-left: .5rem;
}
.protected-badge {
    background: #19004C;
    color: #fff;
    font-size: .75rem;
    padding: .15rem .5rem;
    border-radius: 999px;
    margin-right: .5rem;
}

/* ============================================================
   Profile panel (/profile)
   ============================================================ */
.profile-page {
    width: 100%;
    max-width: 900px;
    margin: 2rem auto 4rem;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.profile-title {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}
.profile-flash {
    padding: .75rem 1.25rem;
    border-radius: .5rem;
    font-weight: 500;
}
.profile-flash-ok {
    background-color: #cfffcc;
    color: #1e6e1e;
}
.profile-flash-error {
    background-color: #ffcccc;
    color: #a00;
}
.profile-flash-warn {
    background-color: #fff3cd;
    color: #7a5b00;
    border: 1px solid #f0d98a;
}
.profile-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.profile-card {
    background-color: white;
    border-radius: 10px;
    padding: 1.5rem 2rem;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.profile-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: .25rem;
}
.profile-photo-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.profile-photo-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #f0f0f0;
    flex-shrink: 0;
    border: 2px solid #e5e5e5;
}
.profile-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.profile-photo-actions {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    align-items: flex-start;
}
.profile-photo-upload {
    display: inline-block;
    padding: .5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 2rem;
    cursor: pointer;
    font-weight: 600;
    transition: background-color .15s ease;
    user-select: none;
}
.profile-photo-upload:hover {
    background-color: #2a318f;
}
.profile-photo-upload input[type="file"] {
    display: none;
}
.profile-photo-remove {
    padding: .4rem 1rem;
    background-color: transparent;
    color: #a00;
    border: 1px solid #a00;
    border-radius: 2rem;
    cursor: pointer;
    font-weight: 600;
    transition: background-color .15s ease;
}
.profile-photo-remove:hover {
    background-color: #a00;
    color: white;
}
.profile-photo-hint {
    font-size: .85rem;
    color: #666;
    margin-top: .25rem;
}
.profile-photo-loading {
    color: var(--primary-color);
    font-weight: 500;
    font-size: .9rem;
}
.profile-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.5rem;
}
.profile-field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.profile-field label {
    font-weight: 600;
    font-size: .9rem;
    color: var(--primary-color);
}
.profile-field-readonly input:disabled {
    background-color: #f5f5f5;
    color: #555;
    cursor: not-allowed;
}
.profile-field-full {
    grid-column: 1 / -1;
}
.profile-error {
    color: #a00;
    font-size: .85rem;
}
.profile-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    margin-top: .5rem;
}
@media (max-width: 640px) {
    .profile-fields {
        grid-template-columns: 1fr;
    }
    .profile-actions {
        justify-content: stretch;
    }
    .profile-actions .submit-button {
        width: 100%;
    }
    .profile-photo-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .profile-photo-actions {
        align-items: center;
    }
}

/* ============================================================
   FAQ page
   ============================================================ */
.faq-page {
    width: 100%;
    max-width: 800px;
    margin: 2rem auto 4rem;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.faq-title {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1rem;
}
.faq-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    width: 100%;
}
.faq-page .faq-question {
    width: 100%;
}
.faq-question summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    user-select: none;
}
.faq-question summary::-webkit-details-marker { display: none; }
.faq-question summary::marker { display: none; }
.faq-question summary::after {
    content: '▼';
    font-size: .85rem;
    color: var(--primary-color);
    flex-shrink: 0;
    transition: transform .15s ease;
}
.faq-question[open] summary::after {
    transform: rotate(180deg);
}
.faq-question[open] {
    padding-bottom: 1rem;
}
.faq-question p {
    margin-top: .5rem;
}
.faq-empty {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 2rem;
    background-color: white;
    border-radius: 1rem;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
}

/* Texto largo: que envuelva, no que desborde */
.builder-field,
.assessment-factor-row,
.assessment-factor-row label,
.developer-preview,
.developer-subtotal {
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
}

.column p,
.column a,
.column div,
.searchable-trigger,
.searchable-option,
.searchable-label {
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.searchable-label {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}

.searchable-trigger {
    flex-wrap: wrap;
    align-items: flex-start;
    height: auto;
    min-height: 2.5rem;
}

.searchable-options .searchable-option {
    white-space: normal;
    word-break: break-word;
}

select,
input[type="text"],
input[type="search"],
textarea {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Editor de assessments enviados */
.edit-assessment-form {
    width: 820px;
    max-width: 100%;
}
.edit-assessment-header {
    padding: .85rem 1rem;
    margin: 0;
    background-color: #cfffcc;
    color: #1e7d32;
    border-radius: .75rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.edit-assessment-header p {
    margin: 0;
}
.edit-assessment-hint {
    color: #475569;
    font-size: .9rem;
    margin: 0;
}
.edit-assessment-form .assessment-factors {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
.edit-assessment-form .form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: .5rem;
}
.edit-assessment-form .assessment-factor-row {
    background-color: #f8fafc;
}
.edit-assessment-form .multiselect-list {
    max-width: none;
    width: 100%;
}

/* ============================================================
   Barra de búsqueda con botón dentro
   ============================================================ */
.search-filters {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    width: 100%;
    max-width: 48rem;
    margin-bottom: 1rem;
}
.search-inline {
    position: relative;
    display: flex;
    align-items: center;
}
.search-inline .search-bar {
    padding-right: 7rem;
    background-color: white;
}
.search-inline .absolute-button {
    height: 100%;
    padding: 0 1.25rem;
    color: var(--primary-color);
    font-weight: 600;
    background-color: transparent;
    border: 0;
    border-radius: 2rem;
}
.search-inline .absolute-button:hover {
    background-color: rgba(14, 18, 79, .08);
}
.search-inline .absolute-button:active {
    color: var(--primary-color);
    background-color: rgba(14, 18, 79, .08);
}
.search-clear {
    align-self: flex-end;
    font-size: .9rem;
}
.clients-widget > .search-filters {
    margin-inline: auto;
}
.client-page .bucket-filters {
    justify-content: center;
}
.client-page .table {
    width: 100%;
    min-width: 0;
    max-width: 1100px;
}
.client-page .search-inline .absolute-button:disabled,
.client-page .search-inline .absolute-button:disabled:hover,
.client-page .search-inline .absolute-button:disabled:active {
    color: #b9bccb;
    background-color: transparent;
    cursor: default;
}

/* ---- Vista previa de PDF en modal ---- */
.pdf-preview {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}
.pdf-preview.is-open {
    display: flex;
}
.pdf-preview-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, .55);
}
.pdf-preview-box {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(92vw, 1100px);
    height: min(88vh, 850px);
    background-color: #fff;
    border-radius: .75rem;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .35);
    overflow: hidden;
}
.pdf-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem 1.25rem;
    border-bottom: 1px solid #e7e7e7;
    background-color: #fefdfd;
}
.pdf-preview-title {
    font-weight: 600;
    color: var(--primary-color, #0e124f);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pdf-preview-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}
.pdf-preview-actions .submit-button {
    margin-top: 0;
    padding: .5rem 1.25rem;
    font-size: .9rem;
}
.pdf-preview-actions .pdf-preview-close {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}
.pdf-preview-actions .pdf-preview-close:hover {
    background-color: rgba(14, 18, 79, .08);
}
.pdf-preview-actions .pdf-preview-close:active {
    color: #fff;
    background-color: var(--primary-color);
}
.pdf-preview-box iframe {
    flex: 1;
    width: 100%;
    border: none;
    background-color: #fff;
}
.pdf-preview-locked {
    overflow: hidden;
}

/* ---- Autenticacion de dos factores (2FA) ---- */
.twofa-setup {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    margin: 1rem 0;
}
.twofa-setup img {
    display: block;
    padding: .6rem;
    border: 1px solid #e4e4ec;
    border-radius: .75rem;
    background-color: #fff;
}
.twofa-manual {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    max-width: 260px;
}
.twofa-secret {
    font-family: var(--font-family-text, sans-serif);
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--primary-color, #0e124f);
    background-color: #f2f2f8;
    border-radius: .5rem;
    padding: .6rem .8rem;
    word-break: break-all;
}
.twofa-recovery-codes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: .6rem;
    margin: 1rem 0;
}
.twofa-recovery-codes code {
    font-family: var(--font-family-text, sans-serif);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--primary-color, #0e124f);
    background-color: #f2f2f8;
    border-radius: .5rem;
    padding: .6rem .8rem;
    text-align: center;
}
.twofa-badge {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: #fff;
    background-color: #0e124f;
    border-radius: 999px;
    padding: .3rem .7rem;
    text-decoration: none;
    white-space: nowrap;
}
.twofa-badge:hover {
    background-color: #2a2f7a;
    color: #fff;
}
.twofa-inactive {
    font-size: .85rem;
    color: #9a9cab;
}

/* ============================================================
   Buscador y filtros de la gestión de usuarios (centrado)
   ============================================================ */
.users-search {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    margin-bottom: 1rem;
}
.users-search-form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    max-width: 52rem;
}
.users-search-form .search-bar {
    background-color: #fff;
}
.users-search-form select.search-bar {
    width: auto;
    min-width: 9rem;
}
.users-search .search-clear {
    align-self: center;
}
.results-count {
    color: #6b6e85;
    font-size: .9rem;
    margin: 0 0 .75rem;
}

/* ---- Widgets de dashboard: modo edición ---- */
.dashboard-widgets {
    width: 100%;
}
.widget-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1rem;
}
.widget-add-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1rem;
    padding: .6rem .8rem;
    border: 1px dashed #c3cbd6;
    border-radius: .5rem;
    background: #f7f9fc;
}
.widget-add-title {
    font-weight: 600;
    margin-right: .25rem;
}
.widget-add-item {
    border: 1px solid #cfd8e3;
    background: #fff;
    padding: .25rem .6rem;
    border-radius: .3rem;
    cursor: pointer;
    font-size: .9rem;
}
.widget-add-item:disabled {
    cursor: not-allowed;
}
.widget-add-none {
    color: #888;
    font-style: italic;
}
.chart-edit-controls {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    padding: .35rem .5rem;
    margin: -.75rem -.75rem .5rem;
    background: #f3f5f9;
    border-bottom: 1px solid #e5e9f0;
    border-radius: .75rem .75rem 0 0;
}
#dashboard-widgets.editing .chart-edit-controls {
    display: flex;
}
.chart-drag-handle {
    cursor: move;
    font-size: 1.1rem;
    line-height: 1;
    user-select: none;
    color: #6b7280;
}
.chart-card .chart-edit-controls select {
    background-color: #fff;
    font-size: .85rem;
    padding: .15rem .35rem;
    border-radius: .3rem;
    border: 1px solid #cfd8e3;
}
.chart-card .chart-edit-controls .builder-check {
    font-size: .85rem;
}
.chart-remove-btn {
    margin-left: auto;
    border: none;
    background: transparent;
    color: #c0392b;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 .25rem;
}
.chart-remove-btn:hover {
    color: #922b21;
}
#dashboard-widgets.editing .chart-card {
    padding-top: 1rem;
}