/* ==============================================================================
 * EMIPISA ENTERPRISE - MÓDULO TI, SERVIDORES & CUMPLIMIENTO LEGAL (LEY 29571)
 * Diseño Ejecutivo Corporativo B2B Armonizado con Ventas & Administración
 * Paleta: Slate-50 (#f8fafc), White (#ffffff), Slate-900 (#0f172a), Sky/Blue (#0284c7)
 * ============================================================================== */

/* ------------------------------------------------------------------------------
 * 1. LAYOUT GRID & SIDEBAR CORPORATIVO
 * ------------------------------------------------------------------------------ */
#view-ti-backup {
    background: #f8fafc !important;
    color: #0f172a !important;
}

.ti-layout-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: calc(100vh - 41px);
    background: #f8fafc !important;
    transition: grid-template-columns 0.25s ease;
}

.ti-workspace {
    background: #f8fafc !important;
    color: #0f172a !important;
}

.ti-subview {
    width: 100%;
    min-height: 450px;
    box-sizing: border-box;
    display: block;
}

#ti-subview-backup,
#ti-subview-audit,
#ti-subview-smtp,
#ti-subview-claims,
#ti-subview-health,
#ti-subview-cookies,
#ti-subview-subdomains {
    background: #f8fafc !important;
    color: #0f172a !important;
}

.ti-layout-grid.sidebar-collapsed {
    grid-template-columns: 0px 1fr;
}

.ti-layout-grid.sidebar-collapsed .ti-sidebar {
    display: none !important;
}

.ti-sidebar {
    background: #091322;
    color: #e2e8f0;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 42px;
    height: calc(100vh - 42px);
    max-height: calc(100vh - 42px);
    align-self: start;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 950;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.ti-sidebar .ti-user-badge,
.ti-sidebar .studio-user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ti-sidebar .avatar-icon-box {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #0284c7;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.ti-sidebar .ti-sidebar-back-btn,
.ti-sidebar .btn-sidebar-tower {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(2, 132, 199, 0.12);
    border: 1px solid rgba(2, 132, 199, 0.28);
    color: #38bdf8;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.ti-sidebar .ti-sidebar-back-btn:hover,
.ti-sidebar .btn-sidebar-tower:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

.ti-sidebar .ti-menu-section,
.ti-sidebar .studio-menu-section {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ti-sidebar .ti-menu-title,
.ti-sidebar .studio-menu-title {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #64748b;
    text-transform: uppercase;
    padding: 6px 10px 4px 10px;
}

.ti-sidebar .ti-menu-item,
.ti-sidebar .studio-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 6px;
    color: #cbd5e1;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.18s;
}

.ti-sidebar .ti-menu-item:hover,
.ti-sidebar .studio-menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #38bdf8;
}

.ti-sidebar .ti-menu-item.active,
.ti-sidebar .studio-menu-item.active {
    background: linear-gradient(90deg, rgba(2, 132, 199, 0.22), rgba(2, 132, 199, 0.06)) !important;
    border-left: 3px solid #0284c7 !important;
    color: #ffffff !important;
    font-weight: 700;
}

.ti-item-badge {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
}

/* ------------------------------------------------------------------------------
 * 2. WORKSPACE CANVAS & CORPORATE HEADER
 * ------------------------------------------------------------------------------ */
.ti-workspace {
    background: #f8fafc;
    color: #0f172a;
    min-height: calc(100vh - 42px);
    padding: 22px 28px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Section Panel Headers */
.ti-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 14px;
}

.ti-panel-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ti-panel-title .icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    color: #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.ti-panel-title h2 {
    font-size: 1.22rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ti-panel-title p {
    font-size: 0.78rem;
    color: #64748b;
    margin: 3px 0 0 0;
}

/* Action Buttons */
.btn-ti-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-ti-action.global-zip {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

.btn-ti-action.global-zip:hover {
    background: #0369a1;
    border-color: #0369a1;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.btn-ti-action.sync-all {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
}

.btn-ti-action.sync-all:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.btn-ti-action.cleanup {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #475569;
}

.btn-ti-action.cleanup:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

/* ------------------------------------------------------------------------------
 * 3. SERVIDORES DE CORREO (SMTP) - CARDS & GRID
 * ------------------------------------------------------------------------------ */
.ti-smtp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.ti-smtp-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 22px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.ti-smtp-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
    transform: translateY(-2px);
}

.ti-smtp-card-top,
.ti-smtp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.ti-smtp-card h3,
.ti-smtp-card-header h3,
.ti-smtp-card strong.account-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a !important;
    margin: 0 0 4px 0;
}

.ti-smtp-email {
    font-size: 0.74rem;
    color: #64748b;
    font-family: monospace;
    display: block;
    margin-bottom: 14px;
}

.ti-smtp-param-row,
.ti-smtp-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.78rem;
}

.ti-smtp-param-row:last-child,
.ti-smtp-detail-row:last-child {
    border-bottom: none;
}

.param-label {
    color: #64748b;
    font-weight: 600;
    font-size: 0.76rem;
}

.param-value {
    color: #0f172a;
    font-weight: 600;
    font-size: 0.8rem;
    font-family: monospace;
    text-align: right;
}

.ti-crypto-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #7c3aed;
    background: #faf5ff;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid #e9d5ff;
}

.ti-badge-status,
.ti-smtp-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 9999px;
}

.ti-badge-status.online,
.ti-smtp-status-badge.active {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.ti-badge-status.offline,
.ti-smtp-status-badge.inactive {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.ti-smtp-actions,
.ti-smtp-card-footer {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 16px;
}

.btn-ti-smtp-test {
    flex: 1;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-ti-smtp-test:hover {
    background: linear-gradient(135deg, #0369a1, #075985);
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

.btn-ti-smtp-edit {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #cbd5e1;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-ti-smtp-edit:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

/* ------------------------------------------------------------------------------
 * 4. SECTION BOXES (CRIPTO & SEGURIDAD)
 * ------------------------------------------------------------------------------ */
.ti-section-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ti-section-box h3 {
    font-size: 0.98rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ti-section-box p {
    color: #475569;
    font-size: 0.8rem;
    line-height: 1.6;
    margin: 0;
}

/* ------------------------------------------------------------------------------
 * 5. HEALTH CHECK & TELEMETRÍA EN TIEMPO REAL
 * ------------------------------------------------------------------------------ */
.ti-health-summary-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.ti-health-metric-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ti-health-metric-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.ti-health-metric-icon.blue { background: #eff6ff; color: #0284c7; border: 1px solid #bfdbfe; }
.ti-health-metric-icon.green { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.ti-health-metric-icon.purple { background: #faf5ff; color: #7c3aed; border: 1px solid #e9d5ff; }
.ti-health-metric-icon.amber { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }

.ti-health-metric-info strong {
    display: block;
    font-size: 1.25rem;
    color: #0f172a;
    font-family: monospace;
    font-weight: 800;
}

.ti-health-metric-info span {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ti-health-sections-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 22px;
}

@media (max-width: 1024px) {
    .ti-health-sections-split {
        grid-template-columns: 1fr;
    }
}

.ti-db-latency-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ti-db-latency-row,
.ti-db-latency-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.18s;
}

.ti-db-latency-row:hover,
.ti-db-latency-item:hover {
    background: #f1f5f9;
}

.ti-db-info,
.ti-db-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ti-db-info strong,
.ti-db-meta .name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
}

.ti-db-info span,
.ti-db-meta .file {
    font-size: 0.72rem;
    color: #64748b;
    font-family: monospace;
}

.ti-db-size-pill {
    font-size: 0.72rem;
    color: #475569;
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.ti-latency-pill {
    font-size: 0.74rem;
    font-family: monospace;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
}

.ti-latency-pill.fast {
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.ti-service-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #0f172a;
}

.ti-service-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
    margin-right: 8px;
}

/* ------------------------------------------------------------------------------
 * 6. LIBRO DE RECLAMACIONES & TABLAS LEGALES (LEY 29571)
 * ------------------------------------------------------------------------------ */
.ti-legal-stats-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.ti-legal-stat-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ti-legal-stat-box strong {
    font-size: 1.3rem;
    color: #0f172a;
    font-family: monospace;
    font-weight: 800;
    display: block;
}

.ti-legal-stat-box span {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
}

.ti-claims-table-card,
.audit-table-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow-x: auto;
}

.ti-claims-table,
.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    text-align: left;
}

.ti-claims-table th,
.audit-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    padding: 12px 14px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.ti-claims-table td,
.audit-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}

.ti-claims-table tr:hover td,
.audit-table tr:hover td {
    background: #f8fafc;
}

.btn-claim-action {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #cbd5e1;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.btn-claim-action:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.btn-claim-action.resolve {
    background: #ecfdf5;
    color: #059669;
    border-color: #a7f3d0;
    font-weight: 700;
}

.btn-claim-action.resolve:hover {
    background: #059669;
    color: #ffffff;
}

/* Statutory Badges */
.badge-dias-urgent {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-dias-warn {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-dias-ok {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ------------------------------------------------------------------------------
 * 7. BITÁCORA DE AUDITORÍA & FILTROS
 * ------------------------------------------------------------------------------ */
.audit-workspace-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.audit-top-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.audit-title-box h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.audit-title-box p {
    margin: 3px 0 0 0;
    font-size: 0.78rem;
    color: #64748b;
}

.audit-filters-bar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.audit-filter-input {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    font-size: 0.8rem;
    border-radius: 6px;
    padding: 7px 12px;
    outline: none;
    transition: border-color 0.2s;
}

.audit-filter-input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.audit-module-tag {
    font-size: 0.68rem;
    font-weight: 700;
    background: #e0f2fe;
    color: #0284c7;
    border: 1px solid #bae6fd;
    padding: 2px 7px;
    border-radius: 4px;
}

/* ------------------------------------------------------------------------------
 * 8. PARÁMETROS TÉCNICOS & BACKUP (8 MODULE CARDS)
 * ------------------------------------------------------------------------------ */
.ti-modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 20px;
}

.ti-module-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all 0.2s ease;
}

.ti-module-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
    transform: translateY(-2px);
}

.ti-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
}

.ti-card-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ti-card-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.ti-card-titles h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
}

.ti-card-titles span {
    font-size: 0.72rem;
    color: #64748b;
}

.ti-card-reg-badge {
    font-size: 0.7rem;
    font-weight: 800;
    background: #eff6ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
    padding: 2px 8px;
    border-radius: 9999px;
}

.ti-card-block-title {
    font-size: 0.68rem;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ti-table-pill {
    display: inline-block;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 4px;
    margin: 2px 4px 2px 0;
}

.ti-storage-path-item {
    font-size: 0.7rem;
    font-family: monospace;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 3px 8px;
    border-radius: 4px;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ti-concat-tag {
    display: inline-block;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    color: #0284c7;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    margin: 2px 4px 2px 0;
}

.ti-card-footer {
    display: flex;
    gap: 6px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.btn-card-export {
    flex: 1;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s;
}

.btn-card-export:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.btn-card-sync {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #0284c7;
    width: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-card-sync:hover {
    background: #0284c7;
    color: #ffffff;
}

/* ------------------------------------------------------------------------------
 * 9. MODALES & TERMINAL SIMULATOR
 * ------------------------------------------------------------------------------ */
.ti-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.ti-modal-window {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    width: 100%;
    max-width: 640px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalPop 0.2s ease-out;
}

.ti-modal-window.large {
    max-width: 820px;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.ti-modal-header {
    background: #f8fafc;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ti-modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ti-modal-body {
    padding: 22px 24px;
    max-height: 80vh;
    overflow-y: auto;
    background: #ffffff;
}

.ti-form-group {
    margin-bottom: 16px;
}

.ti-form-group label {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ti-form-control {
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 9px 12px;
    color: #0f172a;
    font-size: 0.82rem;
    box-sizing: border-box;
    outline: none;
    transition: all 0.2s;
}

.ti-form-control:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.ti-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* Terminal Console View for SMTP Tests (Auténtico Dark Console) */
.ti-terminal-screen {
    background: #020617;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 14px 16px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.76rem;
    color: #38bdf8;
    min-height: 140px;
    max-height: 240px;
    overflow-y: auto;
    line-height: 1.5;
    white-space: pre-wrap;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.ti-terminal-screen .term-green { color: #10b981; }
.ti-terminal-screen .term-yellow { color: #f59e0b; }
.ti-terminal-screen .term-gray { color: #94a3b8; }
.ti-terminal-screen .term-cyan { color: #38bdf8; }
.ti-terminal-screen .term-red { color: #ef4444; }
.ti-terminal-screen .term-white { color: #f8fafc; font-weight: bold; }

.ti-modal-footer {
    background: #f8fafc;
    padding: 14px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ------------------------------------------------------------------------------
 * 10. SUB-TABS CORPORATIVAS EN WORKSPACE (TI NAV TABS)
 * ------------------------------------------------------------------------------ */
.ti-nav-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
}

.ti-nav-tabs .btn-solcot-tab {
    padding: 6px 12px;
    font-size: 0.78rem;
    border-radius: 6px;
    font-weight: 700;
    color: #64748b;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.18s;
}

.ti-nav-tabs .btn-solcot-tab:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.ti-nav-tabs .btn-solcot-tab.active {
    color: #0284c7;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    font-weight: 800;
}

/* ------------------------------------------------------------------------------
 * 11. SELECTOR DE MODO: TARJETAS VS ORGANIGRAMA VS GUÍA DE DESCARGAS
 * ------------------------------------------------------------------------------ */
.ti-view-mode-bar {
    background: #ffffff !important;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-ti-mode {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 7px 14px;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.18s ease;
}

.btn-ti-mode:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.btn-ti-mode.active {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.28);
}

.btn-ti-mode.active i {
    color: #ffffff !important;
}

/* ------------------------------------------------------------------------------
 * 12. ORGANIGRAMA & ESQUEMÁTICO VISUAL DE BASE DE DATOS (DIAGRAMA ER CORPORATIVO)
 * ------------------------------------------------------------------------------ */
.ti-organigram-wrapper {
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: transparent;
}

/* Top Filter / Search Bar for Organigram */
.ti-org-control-bar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ti-org-filters-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-org-filter {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 5px 11px;
    border-radius: 6px;
    font-size: 0.73rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.btn-org-filter:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

.btn-org-filter.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

.ti-org-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 5px 12px;
}

.ti-org-search-box input {
    border: none;
    background: transparent;
    font-size: 0.78rem;
    outline: none;
    color: #0f172a;
    width: 200px;
}

/* Central Database Engine Hub Banner */
.ti-db-core-hub {
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
    border: 2px solid #bae6fd;
    border-radius: 12px;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.08);
    position: relative;
    overflow: hidden;
}

.ti-db-hub-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ti-db-hub-icon {
    width: 52px;
    height: 52px;
    background: #0284c7;
    color: #ffffff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.28);
}

.ti-db-hub-titles h3 {
    margin: 0 0 4px 0;
    font-size: 1.18rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ti-db-hub-titles p {
    margin: 0;
    font-size: 0.78rem;
    color: #475569;
}

.ti-db-hub-pills {
    display: flex;
    gap: 10px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.ti-hub-pill {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 5px;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ti-db-hub-metrics {
    display: flex;
    gap: 20px;
    align-items: center;
}

.ti-hub-metric-item {
    text-align: right;
}

.ti-hub-metric-label {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #64748b;
}

.ti-hub-metric-val {
    font-size: 1.45rem;
    font-weight: 900;
    color: #0284c7;
    line-height: 1.1;
}

/* Grid of Organigram Relational Nodes */
.ti-organigram-nodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 18px;
}

.ti-org-node-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all 0.22s ease;
    cursor: pointer;
    position: relative;
    border-top: 4px solid #0284c7;
}

.ti-org-node-card:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: #cbd5e1;
}

.ti-org-node-card.selected {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.35), 0 8px 20px rgba(2, 132, 199, 0.12);
}

.ti-org-node-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 10px;
}

.ti-org-node-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ti-org-node-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.ti-org-node-titles h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
}

.ti-org-node-titles span {
    font-size: 0.72rem;
    color: #64748b;
    display: block;
    margin-top: 2px;
}

.ti-org-node-badge {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.ti-org-section-title {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ti-org-tables-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ti-org-table-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 10px;
}

.ti-org-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.76rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: #0284c7;
    font-weight: 700;
}

.ti-org-table-fields {
    font-size: 0.71rem;
    color: #475569;
    margin-top: 4px;
    line-height: 1.4;
}

.ti-org-relations-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ti-org-relation-chip {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ti-org-relation-chip i {
    color: #0284c7;
}

.ti-org-storage-line {
    font-size: 0.71rem;
    color: #64748b;
    background: #f8fafc;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ti-org-storage-line strong {
    color: #0f172a;
    font-family: ui-monospace, monospace;
}

/* ------------------------------------------------------------------------------
 * 13. GUÍA DE DESCARGAS & RESPALDO A LARGO PLAZO
 * ------------------------------------------------------------------------------ */
.ti-guide-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ti-guide-intro-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 22px 26px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ti-guide-intro-card h3 {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ti-guide-intro-card p {
    margin: 0;
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.6;
}

.ti-formats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.ti-format-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.ti-format-card:hover {
    border-color: #0284c7;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.ti-format-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ti-format-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 900;
}

.ti-format-titles h4 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 800;
    color: #0f172a;
}

.ti-format-titles span {
    font-size: 0.72rem;
    color: #64748b;
}

.ti-format-body {
    font-size: 0.78rem;
    color: #475569;
    line-height: 1.5;
}

.ti-format-feature-list {
    margin: 8px 0 0 0;
    padding-left: 18px;
    font-size: 0.74rem;
    color: #334155;
    line-height: 1.6;
}

.ti-format-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
}

/* Comparison Table */
.ti-table-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ti-table-header-strip {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ti-table-header-strip h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ti-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.ti-comparison-table th {
    background: #f8fafc;
    padding: 12px 16px;
    font-weight: 800;
    color: #334155;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.ti-comparison-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.ti-comparison-table tr:hover td {
    background: #f8fafc;
}

/* ==============================================================================
   ESTILOS DE CONMUTACIÓN DE MODO Y ORGANIGRAMA RELACIONAL BDD
   ============================================================================== */
.ti-view-mode-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-ti-mode {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s ease;
}

.btn-ti-mode:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-ti-mode.active {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
    border-color: #0284c7;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.btn-ti-fltr {
    background: #ffffff;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 5px 11px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-ti-fltr:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #94a3b8;
}

.btn-ti-fltr.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
}

.ti-org-node-card {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    position: relative;
}

.ti-org-node-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08) !important;
}

.ti-org-node-card.rel-selected {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25), 0 8px 24px rgba(2, 132, 199, 0.15) !important;
}

.ti-org-node-card.rel-dependent {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3) !important;
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%) !important;
}

.ti-org-node-card.rel-dimmed {
    opacity: 0.45;
    filter: grayscale(40%);
}

/* Integrity Banner Styles */
.ti-integrity-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 18px 22px;
    color: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.ti-integrity-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ti-integrity-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.ti-integrity-titles h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ti-integrity-titles p {
    margin: 4px 0 0 0;
    font-size: 0.74rem;
    color: #94a3b8;
}

.ti-integrity-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-integrity-audit {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 7px;
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-integrity-audit:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-integrity-backup {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 14px;
    border-radius: 7px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s ease;
}

.btn-integrity-backup:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.35);
}

.fk-badge-pk {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid #bae6fd;
    text-transform: uppercase;
}

.fk-badge-fk {
    background: #fef3c7;
    color: #b45309;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid #fde68a;
    text-transform: uppercase;
}



