/* ==========================================================================
   Kramer • Certificados — Sistema de Diseño Administrativo
   Estética unificada basada en Bootstrap 5.3.3 + Font Awesome 6.5.2 + Inter
   ========================================================================== */

:root {
    --bg-canvas: #f4f6f9;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-soft: rgba(0, 0, 0, 0.06);
    --primary-blue: #0d6efd;
    --primary-blue-bg: #eff6ff;
    --cyan-accent: #0284c7;
    --cyan-accent-bg: #e0f2fe;
    --green-accent: #16a34a;
    --green-accent-bg: #f0fdf4;
    --teal-accent: #0d9488;
    --teal-accent-bg: #f0fdfa;
    --indigo-accent: #4f46e5;
    --indigo-accent-bg: #eef2ff;
    --amber-accent: #d97706;
    --amber-accent-bg: #fffbeb;
    --navy-dark: #0f172a;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-canvas);
    color: var(--text-main);
    min-height: 100vh;
}

/* ==========================================================================
   Barra de Navegación Flotante Unificada
   ========================================================================== */
.internal-navbar-wrapper {
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
    padding: 0.6rem 0.95rem;
    margin-bottom: 1.5rem;
}

.brand-pill {
    font-weight: 800;
    color: var(--navy-dark);
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.72rem;
    border-radius: 9px;
    text-decoration: none;
    background-color: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.brand-pill:hover {
    color: var(--primary-blue);
    border-color: rgba(13, 110, 253, 0.2);
}

.brand-icon-sq {
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #0d6efd, #0284c7);
    color: #ffffff;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.25);
}

.brand-subtitle {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 0.1rem;
}

.nav-pill-link {
    font-size: 0.83rem;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    padding: 0.44rem 0.72rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
}

.nav-pill-link:hover {
    color: var(--primary-blue);
    background-color: #f1f5f9;
}

.nav-pill-link.active {
    background-color: var(--primary-blue);
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3);
}

.nav-pill-link.active i {
    color: #ffffff !important;
}

.nav-items-scroll {
    display: flex;
    align-items: center;
    gap: 0.28rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-items-scroll::-webkit-scrollbar {
    display: none;
}

.admin-chip {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    padding: 0.28rem 0.75rem;
    font-size: 0.79rem;
    font-weight: 600;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    white-space: nowrap;
}

.dot-online {
    width: 7px;
    height: 7px;
    background-color: #22c55e;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

/* ==========================================================================
   Tarjetas, Encabezados y Contenedores
   ========================================================================== */
.dashboard-card {
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.035);
}

.toolbar-wrapper {
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
    padding: 1rem 1.2rem;
}

.card-modern {
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.card-header-primary {
    background: linear-gradient(135deg, #0d6efd, #0284c7);
    color: #ffffff;
    padding: 1rem 1.35rem;
    border-bottom: none;
}

.card-header-success {
    background: linear-gradient(135deg, #16a34a, #0d9488);
    color: #ffffff;
    padding: 1rem 1.35rem;
    border-bottom: none;
}

.card-header-navy {
    background: linear-gradient(135deg, #0f172a, #1e3a5f);
    color: #ffffff;
    padding: 1.05rem 1.35rem;
    border-bottom: none;
}

.section-heading {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

/* Hero Banner (Dashboard) */
.hero-banner {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--border-soft);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.035);
    padding: 2rem 2rem;
    margin-bottom: 1.75rem;
    position: relative;
    overflow: hidden;
}

.hero-banner::after {
    content: "";
    position: absolute;
    top: -40px;
    right: -40px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(13, 110, 253, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.kpi-card {
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 1.25rem 1.35rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.kpi-icon-box {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.quick-module-card {
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 1.35rem;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.quick-module-card:hover {
    transform: translateY(-3px);
    border-color: rgba(13, 110, 253, 0.28);
    box-shadow: 0 10px 26px rgba(13, 110, 253, 0.08);
    color: var(--text-main);
}

/* ==========================================================================
   Tablas Modernas Compactas
   ========================================================================== */
.table-modern {
    font-size: 0.82rem;
    margin-bottom: 0;
    vertical-align: middle;
    table-layout: auto;
    width: 100%;
}

.table-modern thead th {
    background: var(--navy-dark);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.65rem 0.65rem;
    border-bottom: none;
    white-space: nowrap;
    vertical-align: middle;
}

.table-modern tbody td {
    padding: 0.55rem 0.65rem;
    border-color: #f1f5f9;
    vertical-align: middle;
    line-height: 1.3;
}

.table-modern tbody tr {
    transition: background-color 0.15s ease-in-out;
}

.table-modern tbody tr:hover {
    background-color: #f8fafc;
}

.table-responsive {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
    -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar {
    height: 5px;
    width: 5px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 9999px;
}

.mono-cell {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 600;
    color: var(--navy-dark);
    font-size: 0.81rem;
}

.col-email-cell {
    max-width: 210px;
    min-width: 135px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #334155;
    font-size: 0.8rem;
}

.col-nombre-cell {
    min-width: 100px;
    max-width: 155px;
    font-weight: 500;
    white-space: normal;
}

/* Badges sutiles */
.badge-subtle {
    font-size: 0.73rem;
    font-weight: 600;
    padding: 0.25em 0.65em;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.badge-cargo {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.badge-sueldo {
    background-color: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.badge-pass-ok {
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.badge-pass-no {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* Botones de acción compactos */
.btn-action-compact {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    font-size: 0.8rem;
}

/* Modales */
.modal-header-custom {
    background: linear-gradient(135deg, #0d6efd, #0284c7);
    color: #ffffff;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
    padding: 1.1rem 1.45rem;
}

.modal-header-danger-custom {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #ffffff;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
    padding: 1.05rem 1.4rem;
}

.modal-section-badge {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #0d6efd;
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 7px;
    padding: 0.25rem 0.65rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
}

.modal-section-badge-teal {
    color: #0d9488;
    background-color: #f0fdfa;
    border-color: #99f6e4;
}

/* Bloque informativo CSV */
.csv-info-box {
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 1rem 1.15rem;
    color: #0c4a6e;
}

.csv-columns-code {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
    color: #0f172a;
}

/* ==========================================================================
   Página de Login y Formularios Públicos
   ========================================================================== */
.auth-page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: radial-gradient(circle at top right, rgba(13, 110, 253, 0.08), transparent 45%),
                radial-gradient(circle at bottom left, rgba(2, 132, 199, 0.07), transparent 45%),
                var(--bg-canvas);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}
