/* ============================================================
   XSolutions — Portal de Asociados | Brand Identity CSS (Modern UI)
   Palette: Navy #1a2d5a · White #ffffff · Soft Blue #f4f7fe
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --xs-navy:      #1a2d5a;
    --xs-navy-mid:  #1e3a6e;
    --xs-navy-lite: #2d4f8e;
    --xs-navy-ultra: #0a1733;
    
    --xs-bg-app:    #f4f7fe; /* Fondo suave para que floten las tarjetas */
    --xs-surface:   #ffffff;
    --xs-card:      #ffffff;
    --xs-border:    #eef2f6; /* Borde muy sutil */
    
    --xs-silver:    #64748b;
    --xs-silver2:   #94a3b8;
    --xs-white:     #0f172a; /* Texto principal oscuro */
    --xs-accent:    #3b82f6; /* Azul brillante como acento secundario */

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    
    --shadow-sm: 0 4px 10px rgba(26, 45, 90, 0.03);
    --shadow-md: 0 10px 30px rgba(26, 45, 90, 0.06);
    --shadow-lg: 0 20px 40px rgba(26, 45, 90, 0.08);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--xs-bg-app);
    color: var(--xs-white);
    height: 100vh;
    overflow: hidden; /* Controlado por .app-layout */
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* ── Elementos Decorativos de Fondo (para Glassmorphism) ── */
.bg-shape-1 {
    position: absolute; top: -150px; right: -150px;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(45, 79, 142, 0.05) 0%, transparent 70%);
    border-radius: 50%; pointer-events: none; z-index: -1;
}
.bg-shape-2 {
    position: absolute; bottom: -200px; left: -100px;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.04) 0%, transparent 70%);
    border-radius: 50%; pointer-events: none; z-index: -1;
}

/* ── App Layout (Dashboard) ── */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ── Sidebar ── */
.sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    box-shadow: 4px 0 24px rgba(26, 45, 90, 0.02);
    z-index: 10;
}
.sidebar-logo {
    display: flex; align-items: center; gap: 12px;
    padding: 0 10px 40px;
}
.sidebar-logo img { height: 38px; }
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.nav-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    color: var(--xs-silver);
    font-weight: 600; font-size: 14px;
    text-decoration: none; transition: all 0.2s;
}
.nav-item:hover {
    background: rgba(26, 45, 90, 0.03);
    color: var(--xs-navy);
}
.nav-item.active {
    background: var(--xs-navy);
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(26, 45, 90, 0.2);
}

/* ── Main Content Area ── */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Header ── */
.app-header {
    height: 80px;
    padding: 0 40px;
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(244, 247, 254, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 5;
}
.header-title {
    font-size: 20px; font-weight: 700; color: var(--xs-navy);
}

/* ── Content Scroll ── */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 40px 60px;
}

/* ── Scrollbar (light) ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ── Cards ── */
.xs-card {
    background: var(--xs-surface);
    border: 1px solid var(--xs-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.xs-card:hover {
    box-shadow: var(--shadow-lg);
}

/* ── Stat Cards ── */
.stat-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--xs-border);
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.stat-icon {
    width: 60px; height: 60px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    background: rgba(26, 45, 90, 0.05);
    color: var(--xs-navy);
}
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--xs-white); line-height: 1.1; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--xs-silver2); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Hero / Summary Top Card ── */
.hero-glass {
    background: linear-gradient(135deg, var(--xs-navy) 0%, var(--xs-navy-lite) 100%);
    border-radius: var(--radius-lg);
    padding: 32px 40px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 16px 32px rgba(26, 45, 90, 0.25);
    color: white;
    position: relative;
    overflow: hidden;
    margin-bottom: 30px;
}
.hero-glass::before {
    content: ''; position: absolute; right: -50px; top: -50px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    border-radius: 50%;
}

/* ── Badges ── */
.badge {
    display: inline-flex; align-items: center;
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 11px; font-weight: 700;
    letter-spacing: .5px;
}
.badge-pending { background: #fffbeb; color: #d97706; }
.badge-paid    { background: #f0fdf4; color: #16a34a; }
.badge-overdue { background: #fef2f2; color: #dc2626; }

/* ── Table ── */
.table-wrap { overflow-x: auto; margin-top: 10px; }
.xs-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.xs-table thead th {
    padding: 10px 20px;
    font-size: 11px; font-weight: 600;
    color: var(--xs-silver2); text-transform: uppercase; letter-spacing: 1px;
    text-align: left; border: none; background: transparent;
}
.xs-table thead th.r { text-align: right; }
.xs-table tbody tr {
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}
.xs-table tbody tr:hover { transform: scale(1.005); box-shadow: var(--shadow-md); z-index: 2; position: relative; }
.xs-table tbody td {
    padding: 16px 20px; font-size: 14px; color: var(--xs-white);
    border: none;
    border-top: 1px solid var(--xs-border);
    border-bottom: 1px solid var(--xs-border);
}
.xs-table tbody td:first-child { border-left: 1px solid var(--xs-border); border-top-left-radius: var(--radius-md); border-bottom-left-radius: var(--radius-md); }
.xs-table tbody td:last-child { border-right: 1px solid var(--xs-border); border-top-right-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md); }

/* ── Buttons ── */
.btn-xs {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 22px;
    font-size: 12px; font-weight: 700;
    border: none; cursor: pointer; border-radius: var(--radius-md);
    transition: all .2s ease; text-decoration: none;
}
.btn-navy { background: var(--xs-navy); color: #fff; box-shadow: 0 4px 12px rgba(26, 45, 90, 0.2); }
.btn-navy:hover { background: var(--xs-navy-lite); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(26, 45, 90, 0.3); }
.btn-ghost { background: #f1f5f9; color: var(--xs-silver); }
.btn-ghost:hover { background: #e2e8f0; color: var(--xs-white); }
.btn-filter {
    background: transparent; color: var(--xs-silver);
    padding: 8px 16px; border-radius: var(--radius-md); font-weight: 600;
    border: none; cursor: pointer; transition: 0.2s;
}
.btn-filter.active { background: #eef2f6; color: var(--xs-navy); }

/* ── Section Title ── */
.section-title {
    font-size: 16px; font-weight: 700; color: var(--xs-navy);
    display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
}
.section-title::before {
    content: ''; width: 4px; height: 18px;
    background: var(--xs-navy); border-radius: 4px;
}

/* ── Service Chips ── */
.svc-chip {
    display: inline-flex; align-items: center; gap: 10px;
    background: #ffffff; border: 1px solid var(--xs-border);
    border-radius: var(--radius-lg); padding: 12px 20px;
    font-size: 13px; font-weight: 600; color: var(--xs-white);
    box-shadow: var(--shadow-sm);
}
.svc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--xs-navy); }

/* ── Animations ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .5s cubic-bezier(0.16, 1, 0.3, 1) both; }
.fade-up-1 { animation-delay: .05s; }
.fade-up-2 { animation-delay: .15s; }
.fade-up-3 { animation-delay: .25s; }

/* ── Spinner ── */
.spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(26, 45, 90, 0.1);
    border-top-color: var(--xs-navy);
    border-radius: 50%;
    animation: spin .8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
    .app-layout { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; padding: 10px 20px; height: auto; border-right: none; border-bottom: 1px solid rgba(0,0,0,0.05); }
    .sidebar-logo { padding: 0; }
    .sidebar-nav { flex-direction: row; gap: 10px; overflow-x: auto; margin-left: 20px; }
    .nav-item { padding: 8px 16px; white-space: nowrap; }
    .hero-glass { flex-direction: column; gap: 20px; text-align: center; }
    .main-content { padding: 10px 20px 40px; }
}

