/* ============================================================
   Corporación REGIT — Gestiones CSS
   Usado en frontend /gestion/ y backend /gestion/admin/
   ============================================================ */

/* ── Variables locales (complementan variables.css del sitio) */
:root {
    --g-white:      #ffffff;
    --g-bg:         #f4f6f9;
    --g-border:     #d8dde6;
    --g-text:       #2c3e50;
    --g-muted:      #6b7280;
    --g-primary:    #004d95;
    --g-secondary:  #e8a020;
    --g-success:    #16a34a;
    --g-warning:    #ca8a04;
    --g-danger:     #dc2626;
    --g-info:       #2563eb;
    --g-radius:     8px;
    --g-shadow:     0 2px 8px rgba(0,0,0,0.10);
}

/* ── Reset básico ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body.gestion-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: var(--g-bg);
    color: var(--g-text);
    margin: 0;
    min-height: 100vh;
}

/* ── Layout contenedor ────────────────────────────────────── */
.g-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

.g-container--wide {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Header del módulo ────────────────────────────────────── */
.g-header {
    background: var(--g-primary);
    color: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.g-header__logo img { height: 40px; }

.g-header__title {
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.9;
}

.g-header__nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.9rem;
    margin-left: 16px;
}
.g-header__nav a:hover { color: #fff; }

/* ── Página de bienvenida / landing ──────────────────────── */
.g-hero {
    background: linear-gradient(160deg, #00305d 0%, #001428 55%, #004d95 100%);
    color: #fff;
    text-align: center;
    padding: 60px 20px 70px;
}
.g-hero h1 { font-size: 2rem; margin-bottom: 12px; }
.g-hero p  { font-size: 1.1rem; opacity: 0.88; max-width: 560px; margin: 0 auto 32px; }

.g-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    max-width: 640px;
    margin: 0 auto;
}

.g-card {
    background: var(--g-white);
    border-radius: var(--g-radius);
    padding: 32px 28px;
    text-align: center;
    text-decoration: none;
    color: var(--g-text);
    box-shadow: var(--g-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--g-border);
}
.g-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.14);
}
.g-card i {
    font-size: 2.4rem;
    color: var(--g-secondary);
    margin-bottom: 14px;
    display: block;
}
.g-card h3 { color: var(--g-primary); margin-bottom: 8px; font-size: 1.15rem; }
.g-card p  { font-size: 0.9rem; color: var(--g-muted); margin: 0; }

/* ── Formularios ──────────────────────────────────────────── */
.g-form-section {
    padding: 50px 0;
}

.g-form-box {
    background: var(--g-white);
    border-radius: var(--g-radius);
    border: 1px solid var(--g-border);
    box-shadow: var(--g-shadow);
    padding: 36px 40px;
    max-width: 600px;
    margin: 0 auto;
}

.g-form-box h2 {
    color: var(--g-primary);
    margin-bottom: 8px;
    font-size: 1.4rem;
}

.g-form-box .subtitle {
    color: var(--g-muted);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

.g-form-group {
    margin-bottom: 20px;
}

.g-form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 6px;
    color: var(--g-text);
}

.g-form-group input,
.g-form-group select,
.g-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--g-border);
    border-radius: var(--g-radius);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
    background: var(--g-white);
    color: var(--g-text);
}
.g-form-group input:focus,
.g-form-group select:focus,
.g-form-group textarea:focus {
    outline: none;
    border-color: var(--g-primary);
    box-shadow: 0 0 0 3px rgba(0,77,149,0.12);
}

/* ── Botones ──────────────────────────────────────────────── */
.g-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--g-radius);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s, transform 0.1s;
}
.g-btn:active { transform: scale(0.98); }
.g-btn--primary   { background: var(--g-primary);   color: #fff; }
.g-btn--secondary { background: var(--g-secondary); color: #fff; }
.g-btn--outline   { background: transparent; color: var(--g-primary); border: 2px solid var(--g-primary); }
.g-btn--danger    { background: var(--g-danger);    color: #fff; }
.g-btn--sm        { padding: 6px 14px; font-size: 0.85rem; }
.g-btn:hover      { opacity: 0.88; }

/* ── Badges de estado ─────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge--pendiente { background: #fef3c7; color: #92400e; }
.badge--entregado { background: #dbeafe; color: #1e40af; }
.badge--aprobado  { background: #dcfce7; color: #14532d; }
.badge--rechazado { background: #fee2e2; color: #7f1d1d; }
.badge--no_aplica { background: #e5e7eb; color: #4b5563; }
.badge--activa    { background: #dbeafe; color: #1e40af; }
.badge--completada{ background: #dcfce7; color: #14532d; }
.badge--archivada { background: #f3f4f6; color: #374151; }

/* ── Barra de progreso ────────────────────────────────────── */
.g-progress {
    background: #e5e7eb;
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}
.g-progress__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--g-primary), var(--g-secondary));
    border-radius: 999px;
    transition: width 0.5s ease;
}

/* ── Tabla admin ──────────────────────────────────────────── */
.g-table-wrap {
    overflow-x: auto;
    border-radius: var(--g-radius);
    border: 1px solid var(--g-border);
    background: var(--g-white);
}

.g-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.g-table th {
    background: var(--g-bg);
    text-align: left;
    padding: 12px 14px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--g-muted);
    border-bottom: 1px solid var(--g-border);
}
.g-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--g-border);
    vertical-align: middle;
}
.g-table tr:last-child td { border-bottom: none; }
.g-table tr:hover td { background: #f9fafb; }

/* ── Checklist items (detalle gestión) ───────────────────── */
.g-checklist { list-style: none; padding: 0; margin: 0; }

.g-checklist__item {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: start;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--g-border);
}
.g-checklist__item:last-child { border-bottom: none; }

.g-checklist__num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--g-bg);
    border: 1px solid var(--g-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--g-primary);
    flex-shrink: 0;
}

.g-checklist__text { font-size: 0.9rem; line-height: 1.5; }
.g-checklist__text .nota { font-size: 0.8rem; color: var(--g-muted); margin-top: 4px; }

/* ── Alertas / mensajes ───────────────────────────────────── */
.g-alert {
    padding: 12px 16px;
    border-radius: var(--g-radius);
    font-size: 0.9rem;
    margin-bottom: 20px;
    border-left: 4px solid;
}
.g-alert--success { background: #f0fdf4; border-color: var(--g-success); color: #14532d; }
.g-alert--error   { background: #fef2f2; border-color: var(--g-danger);  color: #7f1d1d; }
.g-alert--info    { background: #eff6ff; border-color: var(--g-info);    color: #1e3a5f; }

/* ── Sidebar admin ────────────────────────────────────────── */
.g-admin-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: calc(100vh - 60px);
}

.g-sidebar {
    background: #1a2535;
    padding: 24px 0;
}

.g-sidebar__section {
    padding: 0 16px;
    margin-bottom: 24px;
}

.g-sidebar__label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.35);
    padding: 0 12px;
    margin-bottom: 6px;
}

.g-sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.g-sidebar a:hover,
.g-sidebar a.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.g-sidebar a i { width: 18px; text-align: center; }

.g-main {
    padding: 28px;
    overflow-y: auto;
}

/* ── Página heading admin ─────────────────────────────────── */
.g-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.g-page-header h1 {
    font-size: 1.4rem;
    color: var(--g-primary);
    margin: 0;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .g-admin-layout { grid-template-columns: 1fr; }
    .g-sidebar { display: none; }
    .g-form-box { padding: 24px 20px; }
    .g-hero h1 { font-size: 1.6rem; }
    .g-checklist__item { grid-template-columns: 36px 1fr; }
    .g-checklist__item .badge { display: block; margin-top: 8px; }
}
