﻿:root {
    --navy: #072146;
    --blue: #004481;
    --vivid: #1973B8;
    --sky: #5BC2E7;
    --bg: #F5F8FC;
    --text: #1F2937;
    --muted: #4A5568;
    --border: #DCE6F2;
    --white: #FFFFFF;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: var(--vivid);
    text-decoration: none;
}

.app-shell {
    display: grid;
    grid-template-columns: 264px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--navy);
    color: #DCE9F7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: sticky;
    top: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px 26px;
}

.brand img {
    width: 46px;
    height: 46px;
}

.brand-name {
    color: #fff;
    font-size: 22px;
    font-weight: 600;
}

.brand-sub {
    color: var(--sky);
    font-size: 11px;
    margin-top: 2px;
}

.nav {
    display: flex;
    flex-direction: column;
    padding: 0 10px;
}

.nav-section {
    color: #7FA6CC;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .08em;
    padding: 18px 14px 8px;
}

.nav-link {
    color: #DCE9F7;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    transition: background .15s ease;
}

.nav-link:hover,
.nav-link.active {
    background: #0B4F8A;
    color: #fff;
}

.sidebar-footer {
    margin-top: auto;
    padding: 18px 20px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: 11px;
    color: #B9D2EC;
}

.muted {
    color: #7FA6CC;
    margin-top: 4px;
}

main {
    min-width: 0;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 18px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 5;
}

.topbar-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--navy);
}

.topbar-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #E7F3FF;
    color: var(--blue);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2E7D32;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.content {
    padding: 28px 32px 40px;
}

.hero {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 18px;
}

.eyebrow {
    color: var(--vivid);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
}

.hero h1 {
    color: var(--navy);
    font-size: 38px;
    line-height: 1.12;
    margin: 12px 0 14px;
}

.hero p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
    max-width: 640px;
    margin: 0;
}

.hero-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.hero-logo {
    width: 220px;
    max-width: 28%;
}

.btn-primary,
.btn-secondary {
    border-radius: 9px;
    padding: 10px 16px;
    font-size: 13px;
    border: 1px solid transparent;
    font-family: inherit;
}

.btn-primary {
    background: var(--vivid);
    color: #fff;
}

.btn-secondary {
    background: #fff;
    color: var(--blue);
    border-color: var(--border);
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
}

.stat-value {
    color: var(--vivid);
    font-size: 24px;
    font-weight: 700;
}

.stat-label {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 18px;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.panel h2 {
    color: var(--navy);
    font-size: 18px;
    margin: 0 0 4px;
}

.panel p {
    color: var(--muted);
    font-size: 13px;
    margin: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.data-table th {
    text-align: left;
    color: var(--muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    padding: 10px 8px;
}

.data-table td {
    border-bottom: 1px solid #EEF3F9;
    padding: 10px 8px;
    vertical-align: top;
}

.data-table code {
    color: var(--blue);
    background: #F1F7FD;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 11.5px;
}

.badge {
    display: inline-block;
    background: #E7F3FF;
    color: var(--blue);
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 10.5px;
    font-weight: 600;
}

.note {
    border-left: 4px solid var(--sky);
}

.note code {
    background: #F1F7FD;
    color: var(--blue);
    padding: 1px 5px;
    border-radius: 4px;
}

@media (max-width: 1000px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        min-height: auto;
    }

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-logo {
        max-width: 180px;
    }
}


.logout {
    margin-top: 10px;
    background: transparent;
    border: 1px solid rgba(255,255,255,.25);
    color: #DCE9F7;
    border-radius: 7px;
    padding: 7px 10px;
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
}

.auth-card {
    max-width: 520px;
    margin: 40px auto;
}

.auth-brand {
    text-align: center;
    margin-bottom: 20px;
}

.auth-brand img {
    max-width: 260px;
}

.auth-card h1 {
    color: var(--navy);
    font-size: 26px;
    margin: 0 0 6px;
}

label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin: 14px 0 5px;
    font-weight: 600;
}

input, select, textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 11px;
    font-family: inherit;
    font-size: 13px;
    background: #fff;
    color: var(--text);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--vivid);
    box-shadow: 0 0 0 3px rgba(25, 115, 184, .12);
}

.btn-primary.full {
    width: 100%;
    margin-top: 20px;
    padding: 11px;
    cursor: pointer;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
}

.span-2 {
    grid-column: span 2;
}

.span-3 {
    grid-column: 1 / -1;
}

.module-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.toolbar {
    margin-bottom: 16px;
}

.toolbar input {
    max-width: 360px;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0 18px;
}

.module-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
}

.module-option input {
    width: auto;
    margin-top: 3px;
}

.module-option span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
}

.module-option small {
    color: var(--muted);
}

.summary {
    display: flex;
    gap: 28px;
    justify-content: flex-end;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    background: #E7F3FF;
    color: var(--blue);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 11.5px;
    font-weight: 600;
}

.small {
    padding: 6px 10px;
    font-size: 11px;
}

.small-code {
    font-size: 10px;
}

.action-box {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #F8FBFF;
}

.alert {
    border-radius: 8px;
    padding: 11px 13px;
    font-size: 12.5px;
    margin-top: 14px;
}

.alert.error {
    background: #FDECEC;
    color: #B42318;
    border: 1px solid #F5C2C0;
}

.alert.success {
    background: #ECFDF3;
    color: #067647;
    border: 1px solid #ABEFC6;
}

.form-card {
    background: #F8FBFF;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    margin: 16px 0;
}

.form-card h3 {
    margin: 0 0 14px;
    color: var(--navy);
    font-size: 18px;
}

.form-card h4 {
    margin: 20px 0 10px;
    color: var(--blue);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.contact-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    margin: 10px 0;
}

input::placeholder,
textarea::placeholder {
    color: #8A9AAE;
    opacity: 1;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.empty-cell {
    padding: 28px 16px !important;
    color: var(--muted);
    text-align: center;
    font-size: 12.5px;
}

.setup-list {
    margin: 12px 0;
    padding-left: 22px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.9;
}

.setup-list code {
    background: #F1F7FD;
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 2px 5px;
    color: var(--navy);
}

.empty-state {
    padding: 18px;
    border: 1px dashed #C9D9E9;
    border-radius: 10px;
    background: #F8FBFF;
    color: var(--muted);
    font-size: 12.5px;
    text-align: center;
}

.empty-state.small {
    padding: 12px;
    font-size: 12px;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 12px;
}

.wizard-card {
    background: #fff;
}

.wizard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.wizard-header h3 {
    margin-bottom: 4px;
}

.wizard-counter {
    color: var(--vivid);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.wizard-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 18px 0 24px;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #F8FBFF;
    color: var(--muted);
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.wizard-step.active {
    border-color: var(--vivid);
    background: #EAF5FD;
    color: var(--navy);
}

.wizard-step.done {
    border-color: #ABEFC6;
    background: #F0FDF5;
    color: #067647;
}

.wizard-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #DCE9F7;
    color: var(--blue);
    font-size: 11px;
    font-weight: 700;
}

.wizard-step.active .wizard-number {
    background: var(--vivid);
    color: #fff;
}

.wizard-step strong,
.wizard-step small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wizard-step strong {
    font-size: 11.5px;
}

.wizard-step small {
    margin-top: 2px;
    font-size: 10px;
    color: #71859B;
}

.wizard-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.billing-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 9px;
    background: #F1F7FD;
    border: 1px solid var(--border);
}

.billing-summary span,
.billing-summary strong {
    display: block;
}

.billing-summary span {
    color: var(--muted);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.billing-summary strong {
    margin-top: 3px;
    color: var(--navy);
    font-size: 12.5px;
}

.admin-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #F8FBFF;
}

.topbar-user {
    color: var(--muted);
    font-size: 11.5px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-link {
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}

.avatar-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(7, 33, 70, .22);
}

.admin-identity .avatar {
    flex: 0 0 38px;
}

.admin-identity strong,
.admin-identity small {
    display: block;
}

.admin-identity strong {
    color: var(--navy);
    font-size: 14px;
}

.admin-identity small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.admin-loading {
    padding-top: 4px;
}

.skeleton-line {
    border-radius: 6px;
    background: linear-gradient(90deg, #EDF3F9 25%, #F8FBFF 37%, #EDF3F9 63%);
    background-size: 400% 100%;
    animation: skeleton-shimmer 1.25s ease infinite;
}

.skeleton-line.wide { width: 180px; height: 16px; }
.skeleton-line.short { width: 110px; height: 11px; margin-top: 8px; }
.skeleton-line.label { width: 90px; height: 10px; }
.skeleton-line.input { width: 100%; height: 38px; margin-top: 8px; }
.skeleton-line.button { width: 150px; height: 40px; margin-top: 20px; }
.skeleton-avatar { background: #E7EEF6 !important; }

.skeleton-field {
    min-height: 58px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

@media (max-width: 820px) {
    .wizard-steps {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 520px) {
    .wizard-steps,
    .billing-summary {
        grid-template-columns: 1fr;
    }
}

.field-help {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1000;
    max-width: 520px;
    background: #FDECEC;
    color: #B42318;
    border: 1px solid #F5C2C0;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 8px 24px rgba(7, 33, 70, .18);
    font-size: 12px;
}

#blazor-error-ui .reload,
#blazor-error-ui .dismiss {
    color: #B42318;
    font-weight: 600;
    margin-left: 8px;
    cursor: pointer;
}

.app-loading {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
    background: var(--bg);
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #DCE6F2;
    border-top-color: var(--vivid);
    border-radius: 50%;
    animation: loading-spin .8s linear infinite;
}

@keyframes loading-spin {
    to { transform: rotate(360deg); }
}

.login-layout {
    min-height: 100vh;
    background: #EEF2F6;
}

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

.login-card {
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
    width: min(1040px, 100%);
    min-width: 0;
    min-height: min(520px, calc(100vh - 64px));
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(7, 33, 70, .16);
}

.login-brand-panel {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px 34px 26px;
    color: #fff;
    background: linear-gradient(160deg, #0B4079 0%, #083469 55%, #062B58 100%);
}

.login-brand-panel::before,
.login-brand-panel::after {
    content: "";
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    transform: rotate(-7deg);
}

.login-brand-panel::before {
    width: 760px;
    height: 300px;
    left: -150px;
    bottom: -215px;
    background: rgba(104, 76, 98, .55);
}

.login-brand-panel::after {
    width: 820px;
    height: 250px;
    left: -110px;
    bottom: -195px;
    background: rgba(91, 194, 231, .13);
}

.login-brand-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .08em;
    white-space: nowrap;
}

.login-brand-top img {
    width: 24px;
    height: 24px;
    padding: 2px;
    box-sizing: border-box;
    border-radius: 6px;
    background: #fff;
}

.login-brand-copy {
    position: relative;
    z-index: 1;
    margin-top: 24px;
}

.login-brand-copy h1 {
    margin: 0;
    font-size: clamp(24px, 2.5vw, 31px);
    line-height: 1.18;
    letter-spacing: .01em;
    font-weight: 700;
}

.login-brand-copy h1 span {
    color: #5BC2E7;
}

.login-brand-copy p {
    max-width: 330px;
    margin: 12px 0 0;
    color: #C9DDF1;
    font-size: 11.5px;
    line-height: 1.65;
}

.login-features {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 22px 0 0;
    padding: 16px 0 0;
    border-top: 1px solid rgba(255, 255, 255, .18);
    list-style: none;
}

.login-features li {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    min-width: 0;
}

.login-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .10);
}

.login-feature-icon svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: #EAF3FB;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-feature-copy strong {
    display: block;
    font-size: 9.5px;
    font-weight: 600;
    line-height: 1.3;
}

.login-feature-copy small {
    display: block;
    margin-top: 2px;
    color: #AFC9E3;
    font-size: 8.5px;
    line-height: 1.4;
}

.login-panel {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 30px 44px;
    border-left: 1px solid #E2E9F1;
    background: #fff;
}

.login-panel-inner {
    width: 100%;
    min-width: 0;
    max-width: 330px;
}

.login-logo {
    display: block;
    height: 58px;
    width: auto;
    max-width: 100%;
    margin: 0 auto 12px;
    object-fit: contain;
}

.login-system-title {
    text-align: center;
    color: var(--navy);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -.01em;
}

.login-welcome {
    margin: 14px 0 14px;
    text-align: center;
    color: #5A6B7F;
    font-size: 10.5px;
}

.login-welcome-tight {
    margin: 18px 0 4px;
}

.login-title {
    margin: 22px 0 6px;
    text-align: center;
    color: var(--navy);
    font-size: 15px;
    font-weight: 700;
}

.login-instruction {
    margin: 0 0 14px;
    text-align: center;
    color: #5A6B7F;
    font-size: 10.5px;
    line-height: 1.6;
}

.recovery-spacer,
.recovery-success-spacer,
.reset-actions-spacer {
    display: none;
}

/* Mantiene los botones de recuperación a la misma altura que INICIAR SESIÓN. */
@media (min-width: 981px) {
    .recovery-spacer {
        display: block;
        height: 69px;
    }

    .recovery-success-spacer {
        display: block;
        height: 128px;
    }

    .reset-actions-spacer {
        display: block;
        height: 10px;
    }
}

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

.login-form label {
    margin: 8px 0 4px;
    color: var(--text);
    font-size: 10.5px;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    box-sizing: border-box;
    height: 34px;
    padding: 6px 10px;
    border: 1px solid #D5DEE8;
    border-radius: 5px;
    background: #fff;
    font: inherit;
    font-size: 11.5px;
    color: var(--text);
}

.login-form input:focus {
    outline: none;
    border-color: var(--vivid);
    box-shadow: 0 0 0 3px rgba(25, 115, 184, .12);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 36px;
}

.password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #8A9AAB;
    cursor: pointer;
}

.password-toggle:hover {
    color: var(--blue);
    background: #F1F6FB;
}

.password-toggle svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.forgot-row {
    margin: 6px 0 0;
    text-align: right;
}

.forgot-row a {
    color: #0B5DA8;
    font-size: 10px;
    font-weight: 600;
}

.forgot-row a:hover {
    text-decoration: underline;
}

.login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
    height: 38px;
    min-height: 38px;
    box-sizing: border-box;
    border: 0;
    border-radius: 5px;
    background: #06356B;
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-decoration: none;
    cursor: pointer;
}

.login-submit:hover {
    background: #0A4485;
    color: #fff;
}

.login-submit:disabled {
    opacity: .65;
    cursor: default;
}

.login-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.login-submit-inline {
    flex: 1;
    margin-top: 0;
    padding: 0 12px;
}

.login-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 16px;
    box-sizing: border-box;
    border: 1px solid #C9D6E4;
    border-radius: 5px;
    color: #33506F;
    background: #fff;
    font-size: 10.5px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.login-cancel:hover {
    background: #F1F6FB;
    border-color: #9FB6CD;
    color: #06356B;
}

.recovery-message {
    margin: 4px 0 4px;
    padding: 12px 14px;
    border: 1px solid #CFE0F1;
    border-radius: 6px;
    background: #F1F7FD;
    color: #33506F;
    font-size: 10.5px;
    line-height: 1.6;
}

.recovery-message-error {
    border-color: #F5C2C0;
    background: #FDECEC;
    color: #B42318;
}

.recovery-message-success {
    border-color: #B7E4C7;
    background: #E8F7EE;
    color: #1B7A43;
    font-weight: 600;
    text-align: center;
}

.login-protected {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid #E4EAF1;
    color: #7B8CA0;
    font-size: 9.5px;
    text-align: center;
}

.lock-icon {
    display: inline-flex;
}

.lock-icon svg {
    width: 11px;
    height: 11px;
    fill: none;
    stroke: var(--vivid);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-mfa-help {
    margin: 0 0 12px;
    text-align: center;
    color: #5A6B7F;
    font-size: 10.5px;
    line-height: 1.6;
}

.login-panel .qr-code {
    width: 168px;
    height: 168px;
    padding: 8px;
    border-radius: 8px;
}

.login-panel .secret-box {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 6px;
}

.login-panel .secret-box code {
    font-size: 11px;
}

.login-panel .otp-uri {
    font-size: 8px;
}

.login-card-single {
    grid-template-columns: 1fr;
    max-width: 420px;
    min-height: 0;
}

.login-card-single .login-panel {
    padding: 40px;
}

@media (max-width: 980px) {
    .login-page {
        padding: 20px 16px;
    }

    .login-card {
        grid-template-columns: 1fr;
        max-width: 430px;
        min-height: 0;
    }

    .login-brand-panel {
        display: none;
    }

    .login-panel {
        padding: 32px 28px;
        border-left: 0;
    }

    .login-panel-inner {
        max-width: 340px;
    }
}

@media (max-width: 420px) {
    .login-page {
        padding: 0;
    }

    .login-card {
        max-width: none;
        min-height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }

    .login-panel {
        padding: 32px 22px;
    }
}

.secret-box {
    background: #F1F7FD;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    margin-top: 14px;
    word-break: break-all;
}

.secret-box code {
    color: var(--navy);
    font-size: 13px;
}

.otp-uri {
    font-size: 9px;
    color: var(--muted);
    word-break: break-all;
    margin-top: 8px;
}

@media (max-width: 900px) {
    .form-grid, .module-grid, .detail-grid {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }
}

h1:focus { outline: none; }



.qr-wrap {
    text-align: center;
    margin: 8px 0 16px;
}

.qr-code {
    width: 220px;
    height: 220px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
}


.topbar-link {
    color: var(--blue);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    padding: 7px 10px;
    border-radius: 8px;
}

.topbar-link:hover {
    background: #E7F3FF;
}

/* =========================================================
   Ajustes de gestión: filtros, formularios y esqueletos
   ========================================================= */
.panel-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.panel-actions .search-input {
    width: 270px;
    max-width: 100%;
}

.panel-actions select {
    width: auto;
    min-width: 130px;
}

.license-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 16px;
}

.license-form-grid .span-2 {
    grid-column: span 2;
}

.section-title {
    margin: 28px 0 10px;
    color: var(--navy);
    font-size: 15px;
    font-weight: 700;
}

.module-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.skeleton-table {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 0 12px;
}

.skeleton-table-row {
    display: grid;
    gap: 18px;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #F1F5F9;
}

.skeleton-table-row:last-child {
    border-bottom: 0;
}

.skeleton-cell {
    width: 100%;
    height: 13px;
}

.skeleton-cell-header {
    height: 10px;
    opacity: .75;
}

.stat-skeleton {
    width: 64px;
    height: 28px;
}

.email-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

.email-composer,
.email-preview {
    height: 100%;
}

.email-preview {
    position: static;
}

.email-preview-frame {
    width: 100%;
    height: 640px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #F5F8FC;
}

.editor-label {
    display: block;
    margin: 16px 0 6px;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px;
    padding: 6px;
    border: 1px solid #D5DEE8;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    background: #F7FAFD;
}

.editor-button {
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text);
    padding: 6px 9px;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.editor-button:hover {
    background: #E7F3FF;
    color: var(--blue);
}

.editor-separator {
    width: 1px;
    height: 18px;
    margin: 0 4px;
    background: var(--border);
}

.editor-color {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 5px;
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
}

.editor-color:hover {
    background: #E7F3FF;
}

.editor-color input[type="color"] {
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.email-editor {
    min-height: 270px;
    padding: 14px;
    border: 1px solid #D5DEE8;
    border-radius: 0 0 8px 8px;
    background: #fff;
    font-size: 13px;
    line-height: 1.65;
    outline: none;
    overflow-y: auto;
}

.email-editor:focus {
    border-color: var(--vivid);
    box-shadow: 0 0 0 3px rgba(25, 115, 184, .12);
}

.email-settings {
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #F8FBFE;
}

.email-settings-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.email-settings-head h3 {
    margin: 0 0 4px;
    color: var(--navy);
    font-size: 14px;
}

.email-settings-head p {
    margin: 0;
    font-size: 12px;
}

.email-settings-state {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

@media (max-width: 1250px) {
    .module-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1150px) {
    .license-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .license-form-grid .span-2 {
        grid-column: span 2;
    }
}

@media (max-width: 1180px) {
    .email-layout {
        grid-template-columns: 1fr;
    }

    .email-preview {
        position: static;
    }
}

@media (max-width: 950px) {
    .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .panel-header {
        flex-direction: column;
    }

    .panel-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .panel-actions .search-input {
        width: 100%;
    }
}

@media (max-width: 700px) {
    .license-form-grid {
        grid-template-columns: 1fr;
    }

    .license-form-grid .span-2 {
        grid-column: span 1;
    }

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

    .email-preview-frame {
        height: 520px;
    }
}

.panel-header-stacked {
    flex-direction: column;
    align-items: stretch;
}

.panel-header-stacked .panel-actions {
    justify-content: flex-start;
}

.email-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.email-page-header h2 {
    margin: 0 0 4px;
    color: var(--navy);
    font-size: 18px;
}

.email-page-header p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.email-editor {
    min-height: 180px;
    max-height: 300px;
}

@media (max-width: 700px) {
    .email-page-header {
        flex-direction: column;
    }
}

.dependency-list {
    max-height: 230px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 12px;
    background: #FBFDFF;
}

.dependency-option {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 0;
    padding: 6px;
    border-radius: 6px;
    font-size: 11.5px;
    color: var(--text);
    cursor: pointer;
}

.dependency-option:hover {
    background: #EAF4FE;
}

.dependency-option input {
    width: auto;
    flex: 0 0 auto;
    margin-top: 2px;
}

.dependency-option span {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.dependency-option small {
    color: var(--muted);
    font-size: 10px;
}

@media (max-width: 700px) {
    .dependency-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1100px) {
    .module-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .module-form-grid {
        grid-template-columns: 1fr;
    }
}
