/* admin/css/admin.css — Panel Administrativo SNPP */

:root {
    --rojo:       #C8102E;
    --rojo-dark:  #a00c23;
    --sidebar-bg: #1a1f2b;
    --sidebar-w:  248px;
    --topbar-h:   54px;
    --texto:      #1a1f2b;
    --texto-sec:  #5a6070;
    --borde:      #e0e3e8;
    --fondo:      #f2f4f7;
    --card:       #ffffff;
    --radius:     8px;
    --shadow:     0 2px 12px rgba(0,0,0,.08);
    --verde:      #16a34a;
    --naranja:    #ea580c;
    --azul:       #2563eb;
    --morado:     #7c3aed;
    --teal:       #0d9488;
}

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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--fondo);
    color: var(--texto);
    font-size: 13.5px;
    display: flex;
    min-height: 100vh;
}

/* ══════════════════════════════
   SIDEBAR
══════════════════════════════ */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: #c9d1e0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    overflow-y: auto;
    transition: transform .25s;
}

.sidebar-logo {
    padding: 16px 16px 14px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,.15);
}
.sidebar-logo-icon { flex-shrink: 0; }
.sidebar-snpp-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    background: var(--rojo);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .5px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(200,16,46,.5);
}
.sidebar-logo-txt { line-height: 1.3; }
.sidebar-titulo { font-size: 13px; font-weight: 800; color: #fff; }
.sidebar-sub    { font-size: 10.5px; color: rgba(255,255,255,.45); margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-grupo-label {
    font-size: 10.5px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .8px; color: rgba(255,255,255,.35);
    padding: 14px 18px 5px;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 18px; color: rgba(255,255,255,.7);
    text-decoration: none; font-size: 13px; font-weight: 500;
    transition: all .15s; border-left: 3px solid transparent;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.activo { color: #fff; background: rgba(200,16,46,.25); border-left-color: var(--rojo); font-weight: 700; }
.nav-item.sub { padding-left: 42px; font-size: 12.5px; }
.nav-icon { font-size: 16px; flex-shrink: 0; }

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-usuario { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--rojo); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 800; flex-shrink: 0;
}
.usuario-nombre { font-size: 12.5px; font-weight: 700; color: #fff; }
.usuario-rol    { font-size: 11px; color: rgba(255,255,255,.45); }
.btn-logout {
    display: block; text-align: center; padding: 8px;
    background: rgba(200,16,46,.2); color: #f87171;
    text-decoration: none; border-radius: 6px;
    font-size: 12.5px; font-weight: 600; transition: background .2s;
    border: 1px solid rgba(200,16,46,.3);
}
.btn-logout:hover { background: rgba(200,16,46,.4); color: #fff; }

/* ══════════════════════════════
   MAIN WRAP
══════════════════════════════ */
.main-wrap {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── TOP BAR ── */
.topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--borde);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.btn-toggle-sidebar {
    display: none; background: none; border: none;
    font-size: 20px; cursor: pointer; color: var(--texto-sec);
}
.topbar-titulo { font-size: 16px; font-weight: 700; flex: 1; }
.topbar-right  { font-size: 12.5px; color: var(--texto-sec); }

/* ── MAIN CONTENT ── */
.main-content { padding: 24px; flex: 1; }

/* ══════════════════════════════
   DASHBOARD STATS
══════════════════════════════ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card); border-radius: var(--radius);
    padding: 18px 16px; box-shadow: var(--shadow);
    border-top: 3px solid var(--borde);
    position: relative;
}
.stat-card.total     { border-top-color: #64748b; }
.stat-card.pendiente { border-top-color: var(--naranja); }
.stat-card.revision  { border-top-color: var(--azul); }
.stat-card.examen    { border-top-color: var(--morado); }
.stat-card.aprobado  { border-top-color: var(--verde); }
.stat-card.certificado { border-top-color: var(--teal); }
.stat-card.rechazado { border-top-color: var(--rojo); }

.stat-icono { font-size: 22px; margin-bottom: 6px; }
.stat-valor { font-size: 30px; font-weight: 900; color: var(--texto); line-height: 1; }
.stat-label { font-size: 11.5px; color: var(--texto-sec); margin-top: 4px; font-weight: 600; }
.stat-link  {
    font-size: 11px; color: var(--rojo); text-decoration: none;
    font-weight: 700; display: inline-block; margin-top: 6px;
}

/* ── CHARTS ── */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
.chart-card {
    background: var(--card); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow);
}
.chart-card.full-width { grid-column: 1 / -1; }
.chart-titulo { font-size: 13px; font-weight: 700; color: var(--texto); margin-bottom: 14px; }

/* ── BOTTOM ROW ── */
.bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ══════════════════════════════
   TABLAS
══════════════════════════════ */
.table-card {
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
}
.table-card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--borde);
    font-size: 13px; font-weight: 700;
    display: flex; justify-content: space-between; align-items: center;
}
.btn-ver-todas {
    font-size: 12px; color: var(--rojo); text-decoration: none; font-weight: 600;
}
.tabla-info { margin-bottom: 10px; font-size: 12.5px; color: var(--texto-sec); }

.admin-table {
    width: 100%; border-collapse: collapse;
    font-size: 13px;
}
.admin-table thead th {
    background: #f8f9fb; padding: 10px 14px;
    font-size: 11.5px; font-weight: 700; color: var(--texto-sec);
    text-transform: uppercase; letter-spacing: .4px;
    text-align: left; border-bottom: 1px solid var(--borde);
    white-space: nowrap;
}
.admin-table tbody td {
    padding: 10px 14px; border-bottom: 1px solid #f0f2f5;
    vertical-align: middle;
}
.admin-table tbody tr:hover { background: #fafbff; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table.main-table { min-width: 800px; }

.table-responsive { overflow-x: auto; }

.badge-estado {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px;
    color: #fff; font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.badge-estado.grande { padding: 6px 14px; font-size: 13px; }

.mini-bar { display: flex; align-items: center; gap: 6px; }
.mini-bar-fill { height: 6px; background: var(--rojo); border-radius: 3px; min-width: 2px; transition: width .3s; }
.mini-bar span { font-size: 11px; color: var(--texto-sec); white-space: nowrap; }

.mono { font-family: 'Courier New', monospace; font-size: 12.5px; font-weight: 700; color: var(--rojo); }
.text-center { text-align: center; }
.text-small  { font-size: 12px; }
.text-muted  { color: var(--texto-sec); }
.text-green  { color: var(--verde); font-weight: 700; }
.text-red    { color: var(--rojo); font-weight: 700; }
.text-orange { color: var(--naranja); font-weight: 700; }

/* ── ACCIONES ── */
.btn-accion {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 4px 10px; border-radius: 4px; font-size: 12px;
    font-weight: 600; text-decoration: none; cursor: pointer;
    border: none; font-family: inherit; transition: all .15s;
}
.btn-accion.ver     { background: #eef2ff; color: #3730a3; }
.btn-accion.ver:hover { background: #c7d2fe; }
.btn-accion.rechazar { background: #fee2e2; color: var(--rojo); }

/* ── FILTROS ── */
.filtros-bar {
    display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
    padding: 14px 18px; background: var(--card);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.filtros-bar input, .filtros-bar select {
    padding: 8px 12px; border: 1.5px solid var(--borde);
    border-radius: 6px; font-size: 13px; font-family: inherit;
    transition: border-color .2s;
}
.filtros-bar input:focus, .filtros-bar select:focus {
    outline: none; border-color: var(--rojo); box-shadow: 0 0 0 3px rgba(200,16,46,.1);
}
.filtro-busqueda input { min-width: 220px; }
.btn-filtrar, .btn-limpiar-filtro {
    padding: 8px 16px; border-radius: 6px; font-size: 13px;
    font-weight: 600; cursor: pointer; font-family: inherit; border: none;
    text-decoration: none; display: inline-flex; align-items: center; gap: 5px;
}
.btn-filtrar       { background: var(--rojo); color: #fff; }
.btn-filtrar:hover { background: var(--rojo-dark); }
.btn-limpiar-filtro { background: #f1f3f7; color: var(--texto-sec); }
.btn-limpiar-filtro:hover { background: #e2e6ed; }

/* ── EXPORTAR EXCEL ── */
.export-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.btn-exportar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    background: #1a7a3e;
    color: #fff;
    text-decoration: none;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 700;
    transition: background .2s, transform .15s;
    box-shadow: 0 2px 8px rgba(22,163,74,.3);
}
.btn-exportar:hover {
    background: #155e30;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22,163,74,.4);
}
.export-badge {
    background: rgba(255,255,255,.25);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.export-info {
    font-size: 12.5px;
    color: var(--texto-sec);
}

/* ── FILTROS DE FECHA ── */
.filtro-fechas {
    display: flex;
    align-items: center;
    gap: 6px;
}
.filtro-fechas input[type="date"] {
    padding: 8px 10px;
    border: 1.5px solid var(--borde);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: var(--texto);
    background: #fff;
    cursor: pointer;
}
.filtro-fechas input[type="date"]:focus {
    outline: none;
    border-color: var(--rojo);
    box-shadow: 0 0 0 3px rgba(200,16,46,.1);
}
.fecha-sep {
    font-size: 13px;
    color: var(--texto-sec);
    font-weight: 600;
}

/* ── PAGINACIÓN ── */
.paginacion { display: flex; gap: 4px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.pag-btn {
    padding: 6px 12px; border-radius: 6px; text-decoration: none;
    font-size: 13px; font-weight: 600; background: var(--card);
    color: var(--texto-sec); border: 1.5px solid var(--borde); transition: all .15s;
}
.pag-btn:hover { border-color: var(--rojo); color: var(--rojo); }
.pag-btn.activo { background: var(--rojo); color: #fff; border-color: var(--rojo); }

/* ══════════════════════════════
   DETALLE SOLICITUD
══════════════════════════════ */
.breadcrumb {
    font-size: 13px; color: var(--texto-sec); margin-bottom: 16px;
}
.breadcrumb a { color: var(--rojo); text-decoration: none; font-weight: 600; }

.detalle-grid {
    display: grid; grid-template-columns: 1fr 320px; gap: 20px;
}
.detalle-main, .detalle-side { display: flex; flex-direction: column; gap: 16px; }

.detalle-header {
    background: var(--card); border-radius: var(--radius); padding: 20px 24px;
    box-shadow: var(--shadow); display: flex; justify-content: space-between;
    align-items: flex-start; flex-wrap: wrap; gap: 12px;
    border-top: 4px solid var(--rojo);
}
.detalle-codigo { font-size: 22px; font-weight: 900; color: var(--rojo); font-family: 'Courier New', monospace; letter-spacing: 2px; }
.detalle-fecha  { font-size: 12px; color: var(--texto-sec); margin-top: 4px; }

.detalle-seccion {
    background: var(--card); border-radius: var(--radius);
    padding: 18px 20px; box-shadow: var(--shadow);
}
.detalle-sec-titulo {
    font-size: 12.5px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .5px; color: var(--rojo);
    margin-bottom: 14px; padding-bottom: 8px;
    border-bottom: 2px solid #fde8e8;
}
.detalle-campos {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.dc-item { display: flex; flex-direction: column; gap: 3px; }
.dc-item.full { grid-column: 1 / -1; }
.dc-item label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--texto-sec); }
.dc-item span  { font-size: 13.5px; color: var(--texto); }

.profs-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.prof-tag {
    background: #fdf0f2; color: #a00c23; border: 1px solid #f5c6cc;
    border-radius: 4px; padding: 3px 10px; font-size: 12px; font-weight: 600;
}
.btn-mapa {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 4px;
    color: var(--azul); text-decoration: none; font-size: 13px; font-weight: 600;
}
.btn-mapa:hover { text-decoration: underline; }

/* Side cards */
.side-card {
    background: var(--card); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow);
}
.side-card-titulo {
    font-size: 13px; font-weight: 800; color: var(--texto);
    margin-bottom: 14px; padding-bottom: 8px;
    border-bottom: 1px solid var(--borde);
}
.form-estado .fc-campo { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-estado .fc-campo label { font-size: 11.5px; font-weight: 700; color: var(--texto-sec); text-transform: uppercase; }
.form-estado select, .form-estado textarea {
    width: 100%; padding: 9px 12px; border: 1.5px solid var(--borde);
    border-radius: 6px; font-size: 13px; font-family: inherit;
    transition: border-color .2s;
}
.form-estado select:focus, .form-estado textarea:focus {
    outline: none; border-color: var(--rojo); box-shadow: 0 0 0 3px rgba(200,16,46,.1);
}
.btn-guardar-estado {
    width: 100%; padding: 11px; background: var(--rojo); color: #fff;
    border: none; border-radius: 6px; font-size: 14px; font-weight: 700;
    cursor: pointer; font-family: inherit; transition: background .2s;
}
.btn-guardar-estado:hover { background: var(--rojo-dark); }
.btn-cancelar {
    padding: 11px 16px; background: #f1f3f7; color: var(--texto-sec);
    border: 1.5px solid var(--borde); border-radius: 6px; font-size: 13px;
    cursor: pointer; font-family: inherit; text-decoration: none; display: inline-flex;
    align-items: center; transition: all .2s;
}

.historial-lista { display: flex; flex-direction: column; gap: 0; }
.h-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0f2f5; }
.h-item:last-child { border-bottom: none; }
.h-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.h-contenido { flex: 1; }
.h-estado { font-size: 13px; font-weight: 700; }
.h-meta   { font-size: 11px; color: var(--texto-sec); margin-top: 2px; }
.h-obs    { font-size: 12px; color: var(--texto-sec); margin-top: 4px; font-style: italic; }

/* ══════════════════════════════
   USUARIOS
══════════════════════════════ */
.usuarios-grid {
    display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start;
}
.form-usuario .fc-campo { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-usuario .fc-campo label { font-size: 11.5px; font-weight: 700; color: var(--texto-sec); text-transform: uppercase; }
.form-usuario input, .form-usuario select {
    width: 100%; padding: 9px 12px; border: 1.5px solid var(--borde);
    border-radius: 6px; font-size: 13px; font-family: inherit;
}
.form-usuario input:focus, .form-usuario select:focus {
    outline: none; border-color: var(--rojo); box-shadow: 0 0 0 3px rgba(200,16,46,.1);
}
.form-usuario input[readonly] { background: #f8f9fb; color: #888; cursor: not-allowed; }
.fc-check label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; cursor: pointer; }
.fc-check input[type="checkbox"] { accent-color: var(--rojo); width: 15px; height: 15px; }
.req { color: var(--rojo); }

.rol-badge {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    font-size: 11.5px; font-weight: 700; text-transform: uppercase;
}
.rol-admin      { background: #fee2e2; color: #991b1b; }
.rol-supervisor { background: #fef3c7; color: #92400e; }
.rol-operador   { background: #e0f2fe; color: #075985; }

.estado-mini { font-size: 12px; font-weight: 700; }
.estado-mini.activo  { color: var(--verde); }
.estado-mini.inactivo { color: #94a3b8; }
.row-inactivo td { opacity: .55; }

.roles-info { padding: 12px 14px; font-size: 12px; color: var(--texto-sec); background: #f8f9fb; }

/* ══════════════════════════════
   REPORTES
══════════════════════════════ */
.reportes-wrap { display: flex; flex-direction: column; gap: 24px; }
.rep-section {}
.rep-titulo { font-size: 15px; font-weight: 800; color: var(--texto); margin-bottom: 14px; }
.rep-dos-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ══════════════════════════════
   ALERTAS
══════════════════════════════ */
.alert-ok  { background: #dcfce7; color: #166534; border: 1px solid #a7f3d0; padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-weight: 600; font-size: 13.5px; }
.alert-err { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-weight: 600; font-size: 13.5px; }

/* ══════════════════════════════
   LOGIN
══════════════════════════════ */
.login-body {
    display: block;
    background: linear-gradient(135deg, #7e0919 0%, #C8102E 60%, #e8203c 100%);
    min-height: 100vh;
}
.login-wrap {
    max-width: 440px; margin: 0 auto; padding: 24px 16px 40px;
    display: flex; flex-direction: column; gap: 0;
}
.login-header { background: #fff; border-radius: 10px 10px 0 0; overflow: hidden; }
.login-banner { display: block; width: 100%; height: auto; }
.login-fallback {
    padding: 14px 20px; align-items: center; gap: 12px; background: #fff;
}
.lf-badge { background: var(--rojo); color: #fff; font-weight: 900; font-size: 22px; padding: 6px 14px; border-radius: 4px; }
.lf-title { font-size: 14px; font-weight: 800; color: var(--rojo); }
.lf-sub   { font-size: 11px; color: #666; }

.login-card {
    background: #fff; padding: 28px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-card-header { text-align: center; margin-bottom: 22px; }
.login-icon { font-size: 36px; margin-bottom: 8px; }
.login-card-header h1 { font-size: 20px; font-weight: 800; color: var(--texto); }
.login-card-header p  { font-size: 13px; color: var(--texto-sec); margin-top: 3px; }

.login-alert {
    padding: 10px 14px; border-radius: 6px; font-size: 13px;
    font-weight: 600; margin-bottom: 16px;
}
.login-alert.err  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.login-alert.warn { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.login-alert.ok   { background: #dcfce7; color: #166534; border: 1px solid #a7f3d0; }

.login-form .lf-campo { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.login-form .lf-campo label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--texto-sec); }
.login-form input {
    width: 100%; padding: 11px 14px; border: 1.5px solid var(--borde);
    border-radius: 7px; font-size: 14px; font-family: inherit;
    transition: border-color .2s;
}
.login-form input:focus { outline: none; border-color: var(--rojo); box-shadow: 0 0 0 3px rgba(200,16,46,.1); }
.lf-pass { position: relative; }
.lf-pass input { padding-right: 44px; }
.lf-eye {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; font-size: 16px; padding: 4px;
}
.btn-login {
    width: 100%; padding: 13px; background: var(--rojo); color: #fff;
    border: none; border-radius: 7px; font-size: 15px; font-weight: 800;
    cursor: pointer; font-family: inherit; transition: background .2s; margin-top: 6px;
    box-shadow: 0 4px 14px rgba(200,16,46,.35);
}
.btn-login:hover { background: var(--rojo-dark); }

.login-volver { text-align: center; margin-top: 16px; }
.login-volver a { color: var(--texto-sec); text-decoration: none; font-size: 13px; }
.login-volver a:hover { color: var(--rojo); }

.login-card { border-radius: 0; }

.login-footer {
    background: rgba(0,0,0,.2); color: rgba(255,255,255,.65);
    text-align: center; padding: 12px; font-size: 11.5px;
    border-radius: 0 0 10px 10px;
}

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-wrap { margin-left: 0; }
    .btn-toggle-sidebar { display: block; }
    .charts-row, .bottom-row, .detalle-grid, .usuarios-grid, .rep-dos-col { grid-template-columns: 1fr; }
    .detalle-campos { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .main-content { padding: 14px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
