/* =====================================================================
   FEINT Campus Virtual — ZONA D
   Estilos específicos de administración y certificación.
   (Los componentes base viven en app.css; aquí solo lo particular.)
   ===================================================================== */

/* ---------------------------------------------------------------------
   Utilidades del panel administrativo
   --------------------------------------------------------------------- */
.icon-btn-danger { color: var(--danger); }
.icon-btn-danger:hover { background: var(--danger-bg); color: var(--danger); }
.icon-btn-success { color: var(--success); }
.icon-btn-success:hover { background: var(--success-bg); color: var(--success); }
.icon-btn-sm { width: 34px; height: 34px; border-radius: 9px; }
.icon-btn-sm .icon { width: 17px; height: 17px; }

.stats-grid-compact { margin-bottom: 18px; }
.stats-grid-compact .stat-card { padding: 16px 18px; gap: 11px; }
.stats-grid-compact .stat-value { font-size: 24px; }

/* Panel con cinco métricas en una fila (pantallas de escritorio) */
.stats-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stats-grid-5 .stat-card { padding: 16px 18px; gap: 11px; }
.stats-grid-5 .stat-value { font-size: 26px; }
.stats-grid-5 .stat-foot { flex-wrap: wrap; gap: 4px 6px; }
.stats-grid-5 .stat-label { font-size: 12px; }
.stats-grid-5 .badge { font-size: 10.5px; padding: 3px 8px; }
@media (max-width: 1400px) {
    .stats-grid-5 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
}
@media (max-width: 760px) {
    .stats-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
    .stats-grid-5 { grid-template-columns: 1fr; }
}

.filter-result { font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.filter-bar-flat { margin-bottom: 0; border: 0; padding: 0; background: transparent; }

.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.table-foot .pagination { margin-top: 0; }
.table-total td { background: #F8FAFD; border-top: 1px solid var(--line); }

.cell-strong { display: block; font-weight: 650; color: var(--ink); font-size: 13.8px; }
.cell-sub { display: block; color: var(--muted); font-size: 12px; }
.status-inline { display: flex; flex-direction: column; gap: 3px; }
.status-inline small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.date-stack { display: flex; flex-direction: column; line-height: 1.35; }
.date-stack small { font-size: 11.5px; color: var(--muted); }
.date-stack small.text-success { color: var(--success); }

.code-chip {
    display: inline-block;
    font-family: 'Cascadia Code', Consolas, 'Courier New', monospace;
    font-size: 12px;
    letter-spacing: .02em;
    background: #F1F6FB;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 2px 7px;
    color: var(--brand-900);
    white-space: nowrap;
}
.code-chip-strong { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-800); font-weight: 700; }

/* Punto de color/icono de curso */
.course-dot {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--cover-color, #0D78A6), color-mix(in srgb, var(--cover-color, #0D78A6) 45%, #0B1B2B));
}
.course-dot .icon { width: 18px; height: 18px; }
.course-dot-md { width: 40px; height: 40px; border-radius: 12px; }
.course-dot-md .icon { width: 20px; height: 20px; }

.progress-line-sm .progress { height: 6px; }
.progress-line-sm .progress-value { min-width: 34px; font-size: 12px; }

.empty-state-sm { padding: 32px 18px; }
.empty-state-sm .empty-icon { width: 48px; height: 48px; border-radius: 14px; }
.empty-state-sm .empty-icon .icon { width: 22px; height: 22px; }
.empty-state-sm h3 { font-size: 15px; }

.list-item-side { flex: 0 0 auto; }

/* ---------------------------------------------------------------------
   Gráfico de matrículas (SVG puro)
   --------------------------------------------------------------------- */
.chart-wrap { width: 100%; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-grid { stroke: #E8EEF5; stroke-width: 1; stroke-dasharray: 4 5; }
.chart-axis {
    font-family: var(--font-sans);
    font-size: 10.5px;
    font-weight: 650;
    fill: #8A99A9;
}
.chart-bar { fill: url(#feintChartBar); }
.chart-bar:hover { fill: var(--brand-800); }
.chart-bar-value { font-family: var(--font-sans); font-size: 11px; font-weight: 750; fill: var(--brand-900); }
.chart-label { font-family: var(--font-sans); font-size: 11.5px; font-weight: 650; fill: var(--muted); }
.chart-line-path { fill: none; stroke: #F59E0B; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart-line-dot { fill: #fff; stroke: #F59E0B; stroke-width: 2.2; }
.chart-legend {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 12.5px;
    color: var(--muted);
    font-weight: 600;
}
.chart-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend-dot-bar { background: linear-gradient(135deg, #3BB7E6, #0D78A6); }
.legend-dot-line { border-radius: 50%; background: #F59E0B; }
.chart-legend-total { margin-left: auto; }
.chart-legend-total strong { color: var(--brand-800); }

/* ---------------------------------------------------------------------
   Formularios específicos
   --------------------------------------------------------------------- */
.form-inline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    align-items: end;
}
.form-inline-grid .form-group { margin: 0; }
.form-inline-grid .btn { width: 100%; }

.color-field { display: flex; align-items: center; gap: 12px; }
.color-field input[type="color"] {
    width: 54px;
    height: 46px;
    min-height: 46px;
    padding: 4px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    background: #fff;
    cursor: pointer;
}
.color-preview {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 8px 14px;
    border-radius: 11px;
    color: #fff;
    font-size: 12.5px;
    font-weight: 650;
    background: linear-gradient(135deg, var(--cover-color, #0D78A6), color-mix(in srgb, var(--cover-color, #0D78A6) 45%, #0B1B2B));
}
.color-preview .icon { width: 19px; height: 19px; }

.icon-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 8px;
}
.icon-option { position: relative; display: block; cursor: pointer; }
.icon-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.icon-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    border-radius: 11px;
    border: 1px solid var(--line-strong);
    background: #fff;
    color: #7B8A9A;
    transition: border-color .16s, background .16s, color .16s, box-shadow .16s;
}
.icon-option span .icon { width: 20px; height: 20px; }
.icon-option:hover span { border-color: var(--brand-300); color: var(--brand-700); }
.icon-option input:checked + span {
    border-color: var(--brand-500);
    background: var(--brand-50);
    color: var(--brand-800);
    box-shadow: 0 0 0 3px rgba(18, 173, 229, .12);
}
.icon-option input:focus-visible + span { outline: 2px solid var(--brand-500); outline-offset: 2px; }

.course-cover-preview { height: 124px; border-radius: var(--radius); }
.course-cover-preview .icon { width: 38px; height: 38px; }

.inline-select-form { display: inline-flex; align-items: center; gap: 4px; }
.select-sm {
    height: 34px;
    min-height: 34px;
    font-size: 12.5px;
    padding: 4px 28px 4px 9px;
    border-radius: 9px;
    background-position: right 7px center;
    background-size: 16px;
}
.inline-select-form .select-sm { width: auto; min-width: 112px; }

.account-head { display: flex; align-items: center; gap: 14px; }
.account-head strong { display: block; font-size: 15px; color: var(--ink); }
.account-head small { display: block; font-size: 12.5px; color: var(--muted); }
.account-badges { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }

.tabs-inline { border-bottom: 0; }
.tabs-inline .tab-btn { border-radius: 9px; padding: 8px 14px; }
.tabs-inline .tab-btn.active { background: var(--brand-50); border-bottom-color: transparent; color: var(--brand-800); }

/* ---------------------------------------------------------------------
   Mensajes de contacto
   --------------------------------------------------------------------- */
.message-list { display: flex; flex-direction: column; gap: 14px; }
.message-card { border-left: 3px solid transparent; }
.message-card.is-new { border-left-color: var(--brand-500); }
.message-head { display: flex; align-items: center; gap: 12px; }
.message-text { font-size: 14px; color: var(--text); line-height: 1.65; white-space: pre-line; }
.message-meta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.message-meta-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--brand-700); }
.message-meta-item .icon { width: 16px; height: 16px; }

/* ---------------------------------------------------------------------
   Auditoría
   --------------------------------------------------------------------- */
.meta-details summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: var(--brand-700);
    list-style: none;
}
.meta-details summary::-webkit-details-marker { display: none; }
.meta-details summary::before { content: '▸ '; }
.meta-details[open] summary::before { content: '▾ '; }
.meta-pre {
    margin: 8px 0 0;
    max-width: 320px;
    max-height: 180px;
    overflow: auto;
    padding: 10px 12px;
    border-radius: 9px;
    background: #0F1E2E;
    color: #D8E6F2;
    font-size: 11.5px;
    line-height: 1.5;
}

/* ---------------------------------------------------------------------
   Reportes
   --------------------------------------------------------------------- */
.report-notes {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.report-notes .text-sm { display: inline-flex; align-items: center; gap: 7px; }
.report-notes .text-sm .icon { width: 15px; height: 15px; }

/* ---------------------------------------------------------------------
   Panel de certificación
   --------------------------------------------------------------------- */
.cert-panel-filters { padding-bottom: 0; }
.cert-code-cell { display: flex; align-items: center; gap: 4px; }
.issue-widget .widget-head { align-items: flex-start; }
.issue-widget .stat-icon { width: 38px; height: 38px; border-radius: 11px; }
.issue-widget .stat-icon .icon { width: 19px; height: 19px; }

/* ---------------------------------------------------------------------
   Verificación pública
   --------------------------------------------------------------------- */
.verify-page { padding: 40px 0 72px; background: var(--bg); }
.verify-hero {
    position: relative;
    overflow: hidden;
    background: var(--grad-navy);
    color: #fff;
    border-radius: var(--radius-xl);
    padding: 54px 56px 46px;
    box-shadow: var(--shadow-md);
    margin-bottom: 26px;
}
.verify-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(700px 320px at 85% -15%, rgba(18, 173, 229, .38), transparent 62%),
        radial-gradient(520px 300px at 5% 115%, rgba(18, 173, 229, .2), transparent 60%),
        linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: auto, auto, 46px 46px, 46px 46px;
    pointer-events: none;
}
.verify-hero > * { position: relative; z-index: 2; }
.verify-hero h1 { color: #fff; font-size: clamp(28px, 3.2vw, 40px); font-weight: 800; letter-spacing: -.025em; margin: 16px 0 12px; }
.verify-hero > p { color: rgba(219, 239, 250, .82); font-size: 15.5px; max-width: 640px; }
.verify-form {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
    max-width: 700px;
}
.verify-form .input-icon { flex: 1; }
.verify-form .input-icon > .icon { color: var(--brand-600); }
.input-icon-lg input {
    height: 58px;
    min-height: 58px;
    font-size: 15.5px;
    border-radius: 14px;
    padding-left: 48px;
    border: 0;
    box-shadow: 0 10px 30px -18px rgba(11, 27, 43, .5);
}
.input-icon-lg > .icon { width: 23px; height: 23px; left: 17px; color: var(--brand-700); }
.verify-hero .btn-lg { height: 58px; border-radius: 14px; background: #fff; color: var(--brand-800); box-shadow: var(--shadow-sm); }
.verify-hero .btn-lg:hover { background: var(--brand-50); color: var(--brand-900); }
.verify-hero-hint {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    font-size: 12.5px;
    color: rgba(203, 231, 245, .78);
}
.verify-hero-hint .icon { width: 16px; height: 16px; }

.verify-result-card { padding: 26px; border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); }
.verify-result-card .verify-status { margin-bottom: 20px; }
.verify-status strong { font-size: 16px; }
.verify-result-card .certificate-details { margin-bottom: 20px; }
.verify-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.verify-help { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 13.5px; }
.verify-help .icon { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.verify-help code { font-size: 12px; }

.verify-info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 26px; }
.verify-info-card { padding: 24px; }
.verify-info-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    background: var(--brand-50);
    color: var(--brand-700);
}
.verify-info-icon .icon { width: 22px; height: 22px; }
.verify-info-icon.is-cyan { background: #E6F8FE; color: #0D8FBF; }
.verify-info-icon.is-green { background: var(--success-bg); color: var(--success); }
.verify-info-icon.is-amber { background: var(--warning-bg); color: var(--warning); }
.verify-info-card h3 { font-size: 15.5px; margin-bottom: 7px; }
.verify-info-card p { font-size: 13px; color: var(--muted); line-height: 1.6; }
.verify-note { margin-top: 24px; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------------
   Certificado imprimible (diploma)
   --------------------------------------------------------------------- */
.certificate-page { padding: 22px 0 56px; background: var(--bg); }
.certificate-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 18px;
    margin-bottom: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}
.certificate-toolbar-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.certificate-toolbar-code { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.certificate-page .certificate-sheet-wrap { padding: 10px 0 26px; }

.certificate-sheet { border-radius: 8px; }
.certificate-inner { padding: 5.6% 6.4%; }

/* Cabecera del diploma */
.certificate-top { align-items: flex-start; }
.certificate-top .certificate-brand { flex: 1 1 0; min-width: 0; }
.certificate-top .certificate-code { flex: 1 1 0; min-width: 0; }
.certificate-brand img { height: 78px; }
.certificate-brand small { font-size: 9.5px; letter-spacing: .05em; text-transform: uppercase; font-weight: 650; }

/* Sello institucional */
.certificate-seal { position: relative; width: 92px; height: 92px; flex: 0 0 auto; color: var(--brand-700); }
.cert-seal-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.seal-ring-outer { fill: none; stroke: currentColor; stroke-width: 1.8; }
.seal-ring-inner { fill: none; stroke: currentColor; stroke-width: .7; opacity: .5; }
.seal-micro {
    font-family: var(--font-sans);
    font-size: 7.1px;
    font-weight: 800;
    letter-spacing: .055em;
    fill: currentColor;
}
.cert-seal-core {
    position: absolute;
    inset: 15px;
    border-radius: 50%;
    background: linear-gradient(160deg, #F4FBFE 0%, #E4F5FC 100%);
    border: 1px solid var(--brand-200);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    text-align: center;
    line-height: 1;
}
.cert-seal-icon { width: 22px; height: 22px; color: var(--brand-700); margin-bottom: 1px; }
.cert-seal-core strong { font-family: var(--font-display); font-size: 11.5px; letter-spacing: .12em; color: var(--brand-900); font-weight: 800; }
.cert-seal-core small { font-size: 6px; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-700); font-weight: 700; line-height: 1.25; }

/* Bloque de código del diploma */
.certificate-code { font-size: 9.5px; letter-spacing: .04em; }
.certificate-code span { display: block; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.certificate-code strong { font-size: 14px; margin: 2px 0 4px; }

/* Cuerpo del diploma */
.certificate-kicker { margin-top: 1.6%; }
.certificate-title { margin: 10px 0 1.6%; }
.certificate-name { margin: 10px 0 2px; }
.certificate-text { font-size: 13.5px; }
.certificate-hours { margin-top: 14px; font-size: 12px; }
.certificate-hours .icon { width: 16px; height: 16px; }
.certificate-hours-sep { opacity: .5; padding: 0 2px; }
.certificate-issued { margin-top: 12px; font-size: 10.5px; color: var(--muted); letter-spacing: .02em; }

/* Pie con firmas y QR */
.certificate-foot { gap: 18px; }
.cert-signature { max-width: 250px; }
.cert-signature-img { display: block; max-width: 190px; max-height: 50px; object-fit: contain; margin: 0 auto 4px; }
.cert-signature-line { background: #C3CFDB; }
.cert-signature strong { font-size: 12px; }
.cert-signature small { font-size: 10px; }
.cert-qr-box {
    width: 100px;
    height: 100px;
    padding: 5px;
    border-radius: 8px;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}
.cert-qr-box img,
.cert-qr-box canvas { display: block; max-width: 100%; height: auto; }
.cert-qr small { font-size: 8.5px; letter-spacing: .04em; text-transform: uppercase; font-weight: 650; }

/* Marca de agua y estado revocado */
.cert-watermark { right: -34px; bottom: -54px; width: 240px; }
.certificate-sheet.is-revoked .cert-watermark { opacity: .05; }
.cert-revoked-watermark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-16deg);
    font-family: var(--font-display);
    font-size: clamp(64px, 8vw, 116px);
    font-weight: 900;
    letter-spacing: .18em;
    color: rgba(185, 28, 28, .12);
    border: 0;
    pointer-events: none;
    user-select: none;
}

/* Nota al pie fuera del diploma */
.certificate-doc-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 2px 0;
}
.certificate-doc-note { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); max-width: 620px; }
.certificate-doc-note .icon { width: 16px; height: 16px; flex: 0 0 auto; }
.certificate-doc-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.certificate-doc-code { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 1180px) {
    .verify-info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
    .verify-hero { padding: 40px 32px 36px; }
    .certificate-seal { width: 74px; height: 74px; }
    .cert-seal-core { inset: 12px; }
    .certificate-brand img { height: 62px; }
}

@media (max-width: 760px) {
    .verify-page { padding: 24px 0 48px; }
    .verify-hero { padding: 30px 22px 26px; border-radius: var(--radius-lg); }
    .verify-form { flex-direction: column; align-items: stretch; }
    .verify-form .btn { width: 100%; }
    .verify-result-card { padding: 18px; }
    .certificate-toolbar { flex-direction: column; align-items: flex-start; }
    .certificate-actions { width: 100%; }
    .certificate-sheet { border-radius: 6px; }
    .certificate-seal { display: none; }
    .certificate-doc-foot { padding-bottom: 8px; }
    .form-inline-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------
   Impresión del diploma
   --------------------------------------------------------------------- */
@media print {
    .certificate-page { padding: 0 !important; background: #fff !important; }
    .certificate-toolbar,
    .certificate-doc-foot,
    .certificate-actions,
    .no-print { display: none !important; }
    /* La hoja debe ocupar exactamente el A4 horizontal sin márgenes del contenedor */
    .container.certificate-sheet-wrap {
        max-width: none !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .certificate-sheet .certificate-inner { padding: 13mm 17mm; }
    .certificate-sheet .certificate-frame { inset: 7mm; }
    .certificate-sheet .certificate-brand img { height: 74px; }
    .certificate-sheet .certificate-title { font-size: 38px !important; }
    .certificate-sheet .certificate-title span { font-size: 13px !important; margin-top: 6px; }
    .certificate-sheet .certificate-name { font-size: 40px !important; }
    .certificate-sheet .certificate-text { font-size: 12.5px !important; }
    .certificate-sheet .certificate-seal { width: 84px; height: 84px; }
    .certificate-sheet .certificate-code strong { font-size: 13px; }
    .certificate-sheet .cert-qr-box { width: 27mm; height: 27mm; }
    .certificate-sheet .cert-signature { max-width: 70mm; }
    .certificate-sheet .cert-signature strong { font-size: 12px; }
    .certificate-sheet .cert-signature small { font-size: 10px; }
    .certificate-sheet .cert-watermark { display: none; }
    .cert-revoked-watermark { color: rgba(185, 28, 28, .14) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
