/* ═══════════════════════════════════════════════════════════════
   MCM SyJ — Estilos Vivid (Front-End Design)
   Inspirado en densidad de datos tradicional + Estética Moderna
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* Paleta Vivid: Púrpuras, Azules Eléctricos y Turquesas */
    --syj-primary: #5a189a;
    --syj-secondary: #7b2cbf;
    --syj-accent: #00b4d8;
    --syj-grad: linear-gradient(135deg, #5a189a 0%, #7b2cbf 50%, #9d4edd 100%);
    --syj-grad-hover: linear-gradient(135deg, #7b2cbf 0%, #9d4edd 50%, #c77dff 100%);
    --syj-bg: #f4f4f9;
    --syj-surface: rgba(255, 255, 255, 0.95);
    --syj-border: #e0e0eb;
    --syj-text: #2b2d42;
    --syj-muted: #6c757d;
    --syj-success: #06d6a0;
    --syj-danger: #ef476f;
    --syj-warning: #ffd166;
    --syj-info: #118ab2;

    /* Variables de Control de Densidad (Compact "Holistor Mode") */
    --syj-cell-pad: 6px 10px;
    --syj-text-sm: 12px;
}

/* Layout base */
.syj-app-layout {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--syj-text);
    background: var(--syj-bg);
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.syj-app-layout * {
    box-sizing: border-box;
}

/* ── Header ──────────────────────────────────────────────────── */
.syj-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    margin-bottom: 24px;
    border-left: 5px solid var(--syj-primary);
}

.syj-page-header h1 {
    font-size: 24px;
    font-weight: 800;
    background: var(--syj-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.syj-header-badge {
    font-size: 11px;
    font-weight: 700;
    background: var(--syj-grad);
    -webkit-text-fill-color: white;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(90, 24, 154, 0.3);
}

.syj-header-sub {
    font-size: 13px;
    color: var(--syj-muted);
    margin: 4px 0 0;
    font-weight: 500;
}

.syj-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ── Nav Tabs (Estilo Pestañas de Ficha) ─────────────────────── */
.syj-nav-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--syj-primary);
    overflow-x: auto;
    scrollbar-width: none;
}

.syj-nav-tabs::-webkit-scrollbar {
    display: none;
}

.syj-nav-tab {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--syj-muted);
    background: #eaeaf1;
    text-decoration: none;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    top: 2px;
}

.syj-nav-tab:hover {
    background: #e0e0eb;
    color: var(--syj-primary);
}

.syj-nav-tab.active {
    background: var(--syj-primary);
    color: white;
    top: 0;
    padding-bottom: 12px;
    box-shadow: 0 -4px 10px rgba(90, 24, 154, 0.1);
}

/* ── Botones ─────────────────────────────────────────────────── */
.syj-btn {
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    outline: none;
}

.syj-btn-primary {
    background: var(--syj-grad);
    color: white;
    box-shadow: 0 4px 15px rgba(123, 44, 191, 0.3);
}

.syj-btn-primary:hover {
    background: var(--syj-grad-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(123, 44, 191, 0.4);
    color: white;
}

.syj-btn-secondary {
    background: white;
    border: 1px solid var(--syj-border);
    color: var(--syj-text);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.syj-btn-secondary:hover {
    border-color: var(--syj-accent);
    color: var(--syj-accent);
    background: #f0fbff;
}

/* ── Cards (Glassmorphism) ──────────────────────────────────── */
.syj-content-card {
    background: var(--syj-surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin-bottom: 24px;
}

.syj-card-inset {
    background: rgba(244, 244, 249, 0.6);
    border: 1px solid var(--syj-border);
    border-radius: 12px;
    padding: 20px;
}

/* ── Section Header ──────────────────────────────────────────── */
.syj-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.syj-section-icon {
    font-size: 20px;
    color: white;
    background: var(--syj-accent);
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 180, 216, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.syj-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--syj-text);
}

/* ── KPI Cards Dashboard Vivid ───────────────────────────────── */
.syj-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.syj-kpi-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--syj-border);
    position: relative;
    overflow: hidden;
}

.syj-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--syj-grad);
}

.syj-kpi-card:hover {
    box-shadow: 0 10px 25px rgba(90, 24, 154, 0.15);
    transform: translateY(-4px) scale(1.02);
}

.syj-kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--syj-primary);
    background: rgba(90, 24, 154, 0.1);
}

.syj-kpi-body {
    flex: 1;
}

.syj-kpi-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--syj-text);
    line-height: 1;
}

.syj-kpi-label {
    font-size: 12px;
    color: var(--syj-muted);
    font-weight: 600;
    margin-top: 6px;
}

/* ── Tablas de Alta Densidad (Tipo Holistor) ─────────────────── */
.syj-table-responsive {
    overflow-x: auto;
    border: 1px solid var(--syj-border);
    border-radius: 8px;
    margin-top: 10px;
    background: white;
}

.syj-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--syj-text-sm);
    /* Letra chica para mucha info */
}

.syj-table th {
    background: var(--syj-bg);
    color: var(--syj-text);
    padding: var(--syj-cell-pad);
    text-align: left;
    font-weight: 700;
    border-bottom: 2px solid var(--syj-border);
    white-space: nowrap;
}

.syj-table td {
    padding: var(--syj-cell-pad);
    border-bottom: 1px solid #f0f0f5;
    vertical-align: middle;
}

.syj-table tr:hover td {
    background: #f8fbff;
}

.syj-table input[type="number"],
.syj-table input[type="text"] {
    padding: 4px 6px;
    font-size: var(--syj-text-sm);
    border: 1px solid var(--syj-border);
    border-radius: 4px;
    width: 80px;
}

.syj-row-muted td {
    opacity: 0.6;
}

/* ── Formularios Compactos Modulares ─────────────────────────── */
.syj-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.syj-col-span-2 {
    grid-column: span 2;
}

.syj-form-group {
    display: flex;
    flex-direction: column;
}

.syj-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--syj-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.syj-input,
.syj-select,
.syj-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--syj-border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--syj-text);
    background: #ffffff;
    transition: all 0.2s;
    font-family: inherit;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02);
}

.syj-input:focus,
.syj-select:focus,
.syj-textarea:focus {
    border-color: var(--syj-primary);
    box-shadow: 0 0 0 3px rgba(90, 24, 154, 0.15);
    outline: none;
}

.syj-input-money {
    text-align: right;
    font-weight: 700;
    color: var(--syj-primary);
}

/* ── Badges Vibrantes ────────────────────────────────────────── */
.syj-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.syj-badge-purple {
    background: rgba(123, 44, 191, 0.15);
    color: var(--syj-secondary);
}

.syj-badge-blue {
    background: rgba(0, 180, 216, 0.15);
    color: var(--syj-accent);
}

.syj-badge-green {
    background: rgba(6, 214, 160, 0.15);
    color: #02a076;
}

.syj-badge-red {
    background: rgba(239, 71, 111, 0.15);
    color: var(--syj-danger);
}

.syj-badge-warning {
    background: rgba(255, 209, 102, 0.25);
    color: #b78a00;
}

/* ── Alertas (Notices) ───────────────────────────────────────── */
.syj-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    border-left: 5px solid;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.syj-alert i {
    font-size: 20px;
    flex-shrink: 0;
}

.syj-alert-info {
    border-color: var(--syj-info);
    color: #0b5e78;
}

.syj-alert-warning {
    border-color: var(--syj-warning);
    color: #8a6600;
}

.syj-alert-error {
    border-color: var(--syj-danger);
    color: #a31636;
}

.syj-alert-success {
    border-color: var(--syj-success);
    color: #02825c;
}

/* ── Icon actions ────────────────────────────────────────────── */
.syj-icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: var(--syj-muted);
    background: #f4f4f9;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
}

.syj-icon-action:hover {
    background: var(--syj-primary);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(90, 24, 154, 0.3);
}

.syj-icon-action.delete:hover {
    background: var(--syj-danger);
    box-shadow: 0 2px 8px rgba(239, 71, 111, 0.3);
}

/* ── Utilidades Generales ────────────────────────────────────── */
.syj-card-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.syj-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--syj-muted);
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 2px dashed var(--syj-border);
}

.syj-empty-state i {
    font-size: 54px;
    color: var(--syj-border);
    margin-bottom: 16px;
}

@keyframes syjFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.syj-fade-in {
    animation: syjFadeIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@media (max-width: 900px) {
    .syj-form-grid {
        grid-template-columns: 1fr;
    }

    .syj-col-span-2 {
        grid-column: span 1;
    }

    .syj-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}