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

:root {
    /* UI/UX Pro Max Design System Tokens */
    --primary: #10b981;          /* Vibrant Emerald */
    --primary-hover: #059669;
    --primary-dark: #047857;
    --primary-light: #ecfdf5;
    --primary-rgb: 16, 185, 129;
    --primary-glow: rgba(16, 185, 129, 0.25);

    --secondary: #0f172a;        /* Slate Dark */
    --secondary-hover: #1e293b;
    --secondary-light: #f8fafc;
    --secondary-rgb: 15, 23, 42;

    --accent: #3b82f6;           /* Sapphire Accent */
    --accent-light: #eff6ff;

    --bg-body: #f8fafc;          /* Modern subtle slate background */
    --bg-card: #ffffff;          /* Pure white card background */
    --bg-glass: rgba(255, 255, 255, 0.85);
    --bg-subtle: #f1f5f9;

    --text-dark: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;

    --border-color: #e2e8f0;     /* Ultra crisp border */
    --border-hover: #cbd5e1;
    --border-focus: #10b981;

    /* Multi-layered Premium Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 14px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
    --shadow-lg: 0 10px 25px -4px rgba(15, 23, 42, 0.08), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 30px -8px rgba(15, 23, 42, 0.12), 0 8px 16px -4px rgba(15, 23, 42, 0.06);
    --shadow-glow: 0 0 20px -3px var(--primary-glow);

    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;

    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-body);
    background-color: var(--bg-body);
    background-image: 
        radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.03) 0px, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    margin: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-dark);
    font-weight: 800;
    letter-spacing: -0.025em;
}

/* ==========================================================================
   NAVBAR GLASSMORPHIC & ELEVATED
   ========================================================================== */
.mantis-nav {
    background: var(--bg-glass) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.mantis-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-dark) !important;
    text-decoration: none;
    transition: var(--transition);
}

.mantis-brand:hover {
    transform: translateY(-1px);
}

.mantis-logo-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--secondary) 0%, #1e293b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    transition: var(--transition);
}

.mantis-brand:hover .mantis-logo-icon {
    box-shadow: 0 4px 16px var(--primary-glow);
}

.nav-link-custom {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.55rem 0.95rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.nav-link-custom:hover {
    color: var(--text-dark);
    background-color: rgba(241, 245, 249, 0.8);
    transform: translateY(-1px);
}

.nav-link-custom.active {
    color: var(--primary-dark) !important;
    background-color: var(--primary-light);
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
}

/* PERFIL DE USUARIO EN HEADER */
.user-header-profile {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.user-header-profile:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.user-avatar-circle {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary) 0%, #334155 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   CARDS, BENTO-GRID & SECCIONES
   ========================================================================== */
.stat-card-modern {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.35rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stat-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    opacity: 0;
    transition: var(--transition);
}

.stat-card-modern:hover {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transform: translateY(-3px);
}

.stat-card-modern:hover::before {
    opacity: 1;
}

.form-section-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.75rem;
    transition: var(--transition);
}

.form-section-card:hover {
    box-shadow: var(--shadow-lg);
}

.form-card-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.35rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.85rem;
}

/* ==========================================================================
   FORMULARIOS MODERNOS & INTERACTIVOS
   ========================================================================== */
.form-control, .form-select {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 0.65rem 0.95rem;
    background-color: #ffffff;
    font-size: 0.925rem;
    color: var(--text-dark);
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    outline: none;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

/* ==========================================================================
   BOTONES PREMIUM CON MICRO-INTERACCIONES
   ========================================================================== */
.btn-mantis-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #ffffff;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.65rem 1.35rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
    transition: var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-mantis-primary:hover, .btn-mantis-primary:focus {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.btn-mantis-primary:active {
    transform: translateY(0);
}

.btn-mantis-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-hover) 100%);
    color: #ffffff;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.65rem 1.35rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-mantis-secondary:hover {
    background: linear-gradient(135deg, var(--secondary-hover) 0%, #020617 100%);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25);
    transform: translateY(-2px);
}

.btn-mantis-outline {
    background: var(--bg-card);
    color: var(--secondary);
    font-weight: 700;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.6rem 1.25rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-mantis-outline:hover {
    background: var(--bg-subtle);
    border-color: var(--border-hover);
    color: var(--secondary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   BADGES Y PILLS ELEVADOS CON PULSO DE ESTADO
   ========================================================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35em 0.85em;
    border-radius: 9999px;
    font-size: 0.775rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: var(--shadow-sm);
}

.status-badge::before {
    content: '';
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    display: inline-block;
}

.status-badge-approved {
    background-color: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}
.status-badge-approved::before {
    background-color: #10b981;
    box-shadow: 0 0 6px #10b981;
}

.status-badge-pending {
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}
.status-badge-pending::before {
    background-color: #f59e0b;
    box-shadow: 0 0 6px #f59e0b;
}

.status-badge-rejected {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.status-badge-rejected::before {
    background-color: #ef4444;
    box-shadow: 0 0 6px #ef4444;
}

.role-badge-admin {
    background-color: #f1f5f9;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    font-weight: 700;
    padding: 0.35em 0.75em;
    border-radius: 9999px;
    font-size: 0.75rem;
}

.role-badge-leader {
    background-color: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
    font-weight: 700;
    padding: 0.35em 0.75em;
    border-radius: 9999px;
    font-size: 0.75rem;
}

.role-badge-subleader {
    background-color: #f0faf8;
    color: #0d9488;
    border: 1px solid #99f6e4;
    font-weight: 700;
    padding: 0.35em 0.75em;
    border-radius: 9999px;
    font-size: 0.75rem;
}

.role-badge-user {
    background-color: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    font-weight: 600;
    padding: 0.35em 0.75em;
    border-radius: 9999px;
    font-size: 0.75rem;
}

/* ==========================================================================
   TABLAS PROFESIONALES CON SUAVE HOVER HIGHLIGHT
   ========================================================================== */
.mantis-table-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    background: var(--bg-card);
    transition: var(--transition);
}

.mantis-table-card:hover {
    box-shadow: var(--shadow-lg);
}

.mantis-table th {
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.95rem 1.15rem;
    border-bottom: 1px solid var(--border-color);
    background-color: #f8fafc;
}

.mantis-table td {
    padding: 0.95rem 1.15rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-card);
    vertical-align: middle;
    transition: var(--transition);
}

.mantis-table tbody tr:hover td {
    background-color: #f1f5f9 !important;
}

/* ==========================================================================
   ADAPTACIÓN RESPONSIVA Y MÓVIL (MOBILE FIRST & BREAKPOINTS)
   ========================================================================== */
@media (max-width: 767.98px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .form-section-card {
        padding: 1.25rem;
        border-radius: var(--radius-lg);
    }
    
    .user-header-profile {
        padding: 0.3rem 0.6rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-mantis-primary, .btn-mantis-secondary, .btn-mantis-outline {
        width: 100%;
        margin-bottom: 0.45rem;
        text-align: center;
        justify-content: center;
    }
    
    .row.g-2 > [class*="col-"], .row.g-3 > [class*="col-"] {
        margin-bottom: 0.5rem;
    }

    .mantis-table th, .mantis-table td {
        padding: 0.75rem 0.85rem;
        font-size: 0.825rem;
        white-space: nowrap;
    }
    
    .stat-card-modern {
        padding: 1.15rem;
    }
}
