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

:root {
    /* --- Premium Fintech Palette (Plus Jakarta & Outfit ready) --- */
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --secondary-color: #0EA5E9;
    --accent-color: #8B5CF6;

    /* Status Colors */
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --info-color: #3B82F6;

    --bg-body: #F8FAFC;
    --bg-surface: #FFFFFF;
    --bg-subtle: #F1F5F9;

    --text-primary: #0F172A;
    --text-secondary: #334155;
    --text-muted: #64748B;
    --text-light: #94A3B8;

    --border-color: #E2E8F0;

    /* --- Luxury Shadows (Indigo Tinted) --- */
    --shadow-sm: 0 1px 3px 0 rgba(79, 70, 229, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(79, 70, 229, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(79, 70, 229, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(79, 70, 229, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);

    /* --- Radius (Balanced) --- */
    --radius-sm: 0.6rem;
    --radius-md: 1rem;
    --radius-lg: 1.25rem;
    --radius-xl: 1.75rem;

    /* --- Glassmorphism --- */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-blur: blur(12px);

    /* --- Sidebar Dimensions --- */
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-body: #0F172A;
    /* Slate 900 */
    --bg-surface: #1E293B;
    /* Slate 800 */
    --bg-subtle: #334155;
    /* Slate 700 */

    --text-primary: #F8FAFC;
    /* Slate 50 */
    --text-secondary: #CBD5E1;
    /* Slate 300 */
    --text-muted: #94A3B8;
    /* Slate 400 */
    --text-light: #64748B;
    /* Slate 500 */

    --border-color: #334155;
    /* Slate 700 */

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);

    /* Adapt hardcoded Bootstrap utilities for dark mode */
    --bg-white-themed: var(--bg-surface);
    --bg-light-themed: var(--bg-subtle);
    --text-dark-themed: var(--text-primary);
}

/* --- Theme-Aware Overrides --- */
[data-theme="dark"] .bg-white {
    background-color: var(--bg-surface) !important;
}

[data-theme="dark"] .bg-light {
    background-color: var(--bg-subtle) !important;
}

[data-theme="dark"] .text-dark,
[data-theme="dark"] .text-black {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .input-group-text.bg-white {
    background-color: var(--bg-subtle) !important;
    border-color: var(--border-color) !important;
    color: var(--text-muted) !important;
}

[data-theme="dark"] .card-header.bg-white {
    background-color: var(--bg-surface) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .dropdown-menu {
    background-color: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: var(--bg-subtle) !important;
    color: var(--primary-color) !important;
}

[data-theme="dark"] .btn-light {
    background-color: var(--bg-subtle) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .btn-light .text-primary {
    color: var(--text-primary) !important;
    /* Force legibility on light buttons in dark mode */
}

/* --- Global Reset & Typography --- */
body {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: all 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* --- Layout --- */
.main-wrapper {
    min-height: 85vh;
    padding-bottom: 4rem;
}

.container-fluid {
    max-width: 1800px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.container {
    margin-left: auto;
    margin-right: auto;
}

/* --- Glassmorphism --- */
.glass-effect {
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.navbar-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.8) !important;
    border-bottom: 1px solid rgba(79, 70, 229, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .navbar-sticky {
    background: rgba(15, 23, 42, 0.85);
    border-bottom: 1px solid rgba(51, 65, 85, 0.6);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
    letter-spacing: -0.03em;
}

.nav-link {
    font-weight: 600;
    color: var(--text-secondary) !important;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--primary-color) !important;
    background-color: rgba(79, 70, 229, 0.05);
}

.nav-link.active {
    color: var(--primary-color) !important;
    background-color: rgba(79, 70, 229, 0.1);
}

/* --- Cards (Floating) --- */
.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    /* min-width: 280px removed to prevent overlapping 'ensimadas' */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    height: auto;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(79, 70, 229, 0.3);
    /* Slight primary tint on hover */
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
    flex: 1 1 auto;
    overflow-x: auto;
    /* Prevent horizontal overflow on small devices */
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

.hover-lift {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg) !important;
}

/* --- Buttons (Pill & Gradient) --- */
.btn {
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    /* Softer corners */
    border: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.4);
}

.btn-outline-primary {
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

.rounded-pill {
    border-radius: 9999px !important;
}

/* --- Forms (Clean & Spacious) --- */
.form-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    background-color: var(--bg-surface);
    color: var(--text-primary);
    transition: all 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
    /* Primary ring */
    outline: none;
}

/* --- Tables (Modern) --- */
.table-responsive {
    border-radius: var(--radius-lg);
    overflow-x: auto;
    width: 100%;
}

.table-scroll-vertical {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background-color: var(--bg-surface);
    font-size: 0.85rem;
    overflow-y: auto;
    overflow-x: auto;
}

.table-scroll-vertical .form-control,
.table-scroll-vertical .form-select,
.table-scroll-vertical .btn-sm {
    font-size: 0.825rem;
    padding: 0.35rem 0.6rem;
}

/* --- Informe Ley 73: Presentación en dos columnas --- */
.informe-ley73-page .card {
    margin-bottom: 1rem;
}

.informe-ley73-page .card-body {
    padding: 1rem 1.25rem !important;
}

.informe-ley73-page .card-body.p-4,
.informe-ley73-page .card .p-4 {
    padding: 1rem 1.25rem !important;
}

.informe-ley73-page .card-header {
    padding: 0.75rem 1.25rem !important;
}

.informe-ley73-page .pension-main-amount {
    font-size: clamp(2.4rem, 3vw + 0.5rem, 3.2rem);
}

.informe-ley73-page .pension-main-card .card-body {
    padding: 1.5rem 1.5rem !important;
}

.informe-ley73-page .table th,
.informe-ley73-page .table td {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem;
}

.informe-ley73-page .detail-item {
    margin-bottom: 0.5rem !important;
    padding: 0.5rem 0 !important;
}

/* Separación visual entre columnas en desktop */
@media (min-width: 992px) {
    .informe-ley73-page .informe-cards-row .col-lg-4 {
        padding-right: 1.25rem;
        border-right: 1px solid var(--border-color);
    }
    .informe-ley73-page .informe-cards-row .col-lg-8 {
        padding-left: 1.25rem;
    }
}

@media (max-width: 1200px) {
    .informe-ley73-page .pension-main-amount {
        font-size: 2.3rem;
    }
}

@media (max-width: 991px) {
    .informe-ley73-page .informe-cards-row .col-lg-4 {
        border-right: none;
    }
    .informe-ley73-page .pension-main-card .card-body {
        padding: 1.25rem 1rem !important;
    }
}

/* --- Global Premium Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #334155;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
    border: 2px solid var(--bg-body);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #334155;
    border: 2px solid var(--bg-body);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

.table-scroll-vertical thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    background-color: #f8fafc !important;
    box-shadow: inset 0 -1px 0 var(--border-color);
    white-space: nowrap;
}

.table-scroll-vertical table {
    min-width: 900px;
}

[data-theme="dark"] .table-scroll-vertical thead th {
    background-color: #1e293b !important;
}

[data-theme="dark"] .table-scroll-vertical::-webkit-scrollbar-thumb {
    background: #334155;
}

.table {
    margin-bottom: 0;
    width: 100%;
}

.table thead th {
    background-color: var(--bg-subtle);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.table tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-surface);
}

.table-hover tbody tr:hover td {
    background-color: rgba(241, 245, 249, 0.5);
    /* Very subtle hover */
}

/* --- Badges --- */
.badge {
    padding: 0.4em 0.8em;
    font-weight: 600;
    border-radius: 9999px;
    letter-spacing: 0.025em;
}

/* --- Strong Backgrounds & Contrast --- */
.bg-success {
    background-color: var(--success-color) !important;
    color: #fff !important;
}

.bg-warning {
    background-color: var(--warning-color) !important;
    color: #0f172a !important;
    /* Dark text for yellow */
}

.bg-danger {
    background-color: var(--danger-color) !important;
    color: #fff !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

.bg-info {
    background-color: var(--info-color) !important;
    color: #fff !important;
}

.bg-dark {
    background-color: #0f172a !important;
    color: #fff !important;
}

/* Gradients with High Contrast Text */
.bg-gradient-primary,
.card-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%) !important;
    color: #fff !important;
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #065f46 100%) !important;
    color: #fff !important;
}

.bg-gradient-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #991b1b 100%) !important;
    color: #fff !important;
}

.bg-gradient-dark {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    color: #fff !important;
}

/* Background opacity utilities should not force a specific text color, allowing text-{color} to work */

/* Soft Badges */
.bg-opacity-10 {
    --bs-bg-opacity: 0.1;
}

.opacity-10 {
    opacity: 0.1 !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-success-dark {
    color: #064e3b !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-warning-dark {
    color: #92400e !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-primary-dark {
    color: #312e81 !important;
}

.text-info {
    color: var(--info-color) !important;
}

.text-info-dark {
    color: #1e3a8a !important;
}

.text-danger-dark {
    color: #991b1b !important;
}

/* --- High Contrast Utilities --- */
.text-darken-1 {
    filter: brightness(0.8);
}

.text-darken-2 {
    filter: brightness(0.6);
}

.text-darken-3 {
    filter: brightness(0.4);
}

/* --- Soft Backgrounds (Premium) --- */
.bg-soft-primary {
    background-color: rgba(79, 70, 229, 0.1) !important;
}

.bg-soft-success {
    background-color: rgba(16, 185, 129, 0.1) !important;
}

.bg-soft-warning {
    background-color: rgba(245, 158, 11, 0.1) !important;
}

.bg-soft-danger {
    background-color: rgba(239, 68, 68, 0.1) !important;
}

.bg-soft-info {
    background-color: rgba(14, 165, 233, 0.1) !important;
}

/* Dark mode adjustments for soft backgrounds */
[data-theme="dark"] .bg-soft-primary {
    background-color: rgba(79, 70, 229, 0.2) !important;
}

[data-theme="dark"] .bg-soft-success {
    background-color: rgba(16, 185, 129, 0.2) !important;
}

[data-theme="dark"] .bg-soft-warning {
    background-color: rgba(245, 158, 11, 0.2) !important;
}

[data-theme="dark"] .bg-soft-danger {
    background-color: rgba(239, 68, 68, 0.2) !important;
}

[data-theme="dark"] .bg-soft-info {
    background-color: rgba(59, 130, 246, 0.2) !important;
}

/* --- Avatars --- */
.avatar {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
}

.avatar-sm {
    width: 36px;
    height: 36px;
    font-size: 0.875rem;
}

/* --- Footer --- */
footer {
    background-color: #1E293B !important;
    /* Always dark for footer */
    color: #94A3B8;
    padding: 3rem 0;
    margin-top: auto;
}

footer h6 {
    color: white;
}

/* --- Animations --- */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.staggered-entry>* {
    opacity: 0;
    animation: slideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.staggered-entry>*:nth-child(1) {
    animation-delay: 0.1s;
}

.staggered-entry>*:nth-child(2) {
    animation-delay: 0.2s;
}

.staggered-entry>*:nth-child(3) {
    animation-delay: 0.3s;
}

.staggered-entry>*:nth-child(4) {
    animation-delay: 0.4s;
}

.staggered-entry>*:nth-child(5) {
    animation-delay: 0.5s;
}

/* Text Gradient Premium */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--primary-color);
    display: inline-block;
    font-weight: 800;
}

/* --- Color Utilities --- */
.bg-soft-primary {
    background-color: rgba(79, 70, 229, 0.1) !important;
}

.bg-soft-success {
    background-color: rgba(16, 185, 129, 0.1) !important;
}

.bg-soft-info {
    background-color: rgba(14, 165, 233, 0.1) !important;
}

.bg-soft-warning {
    background-color: rgba(245, 158, 11, 0.1) !important;
}

.bg-soft-danger {
    background-color: rgba(239, 68, 68, 0.1) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

/* --- Modern Form Elements --- */
.input-group-modern {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    overflow: hidden;
}

.input-group-modern:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.input-group-modern .input-group-text {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding-left: 1rem;
}

.input-group-modern .form-control {
    border: none;
    padding: 0.75rem 1rem;
    font-weight: 500;
}

.input-group-modern .form-control:focus {
    box-shadow: none;
}

.form-check-modern {
    display: block;
    padding: 1.25rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    height: 100%;
    position: relative;
}

.form-check-modern:hover {
    border-color: var(--primary-color);
    background: var(--bg-subtle);
    transform: translateY(-2px);
}

.form-check-modern.selected {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.form-check-modern .form-check-input {
    float: none;
    margin: 0;
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
}

.extra-small {
    font-size: 0.7rem;
}

.letter-spacing-1 {
    letter-spacing: 1px;
}

/* --- Sidebar Layout --- */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    overflow-x: hidden;
}

#sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1060;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

[data-theme="dark"] #sidebar {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
}

.content-page {
    flex: 1;
    min-width: 0;
    margin-left: 0;
    padding-top: 70px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

/* Solo aplicar margen si el sidebar está presente y en desktop */
@media (min-width: 993px) {
    .has-sidebar .content-page {
        margin-left: var(--sidebar-width);
    }
}

/* Header/TopBar Fijo */
.top-header {
    height: 70px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    width: 100%;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 993px) {
    .has-sidebar .top-header {
        left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
    }
}

.top-header>.container-fluid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

[data-theme="dark"] .top-header {
    background: rgba(15, 23, 42, 0.8);
}

/* Sidebar Navigation Items */
.sidebar-nav {
    padding: 1.5rem 1rem;
    flex-grow: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.25rem;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.sidebar-link i {
    width: 24px;
    font-size: 1.15rem;
    margin-right: 1rem;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    background: var(--bg-subtle);
    color: var(--primary-color);
    transform: translateX(4px);
}

.sidebar-link.active {
    background: var(--primary-color);
    color: white !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.sidebar-link.active i {
    color: white;
}

/* Sidebar Branding */
.sidebar-brand {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

/* Mobile Sidebar */
@media (max-width: 992px) {
    #sidebar {
        left: calc(-1 * var(--sidebar-width));
    }

    #sidebar.show {
        left: 0;
        box-shadow: var(--shadow-xl);
    }

    .content-page {
        margin-left: 0;
    }
}

/* Responsive adjustment for existing main container */
.main-wrapper {
    padding-top: 2rem;
    padding-bottom: 3rem;
    min-height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
}

/* Hide original navbar on big screens if needed, but we'll remove it from base.html */
@media print {
    body {
        padding-top: 0;
        background: white !important;
    }

    .navbar-sticky,
    .btn,
    footer,
    .d-print-none {
        display: none !important;
    }

    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        break-inside: avoid;
    }
}

/* --- Dashboard Specific --- */
.stat-card .avatar {
    margin-right: 1rem;
}

/* Text Gradient */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Input group fix */
.input-group-text {
    border-color: var(--border-color);
    background-color: var(--bg-subtle);
    color: var(--text-muted);
}

/* ============ FOLDER EXPLORER DESIGN ============ */
/* (Consolidated from folders.css) */

/* Folder Container */
.folders-container {
    padding: 0;
}

/* Individual Folder Item */
.folder-item {
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
    background: white;
    position: relative;
}

.folder-item:hover {
    background-color: #f8f9fa;
}

.folder-item:last-child {
    border-bottom: none;
}

/* Folder Header (Always Visible) */
.folder-header {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 1rem;
}

.folder-header:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Folder Icon */
.folder-icon {
    flex-shrink: 0;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.folder-item:hover .folder-icon {
    transform: scale(1.1);
}

/* Folder Info */
.folder-info {
    flex-grow: 1;
    min-width: 0;
}

.folder-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.folder-chevron {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
    color: #6c757d;
}

.folder-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* Folder Actions */
.folder-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.folder-actions .btn {
    transition: all 0.2s ease;
}

.folder-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Folder Content (Expandible) */
.folder-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.folder-content-inner {
    padding: 1.5rem;
    background: linear-gradient(to bottom, #f8f9fa 0%, white 100%);
    border-top: 2px solid #e9ecef;
}

/* Expanded State */
.folder-item.folder-expanded {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #007bff;
}

.folder-item.folder-expanded.folder-warning {
    border-left-color: #ffc107;
}

.folder-item.folder-expanded.folder-success {
    border-left-color: #28a745;
}

/* Info Sections */
.info-section {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    height: 100%;
}

.info-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

/* Info Grid */
.info-grid {
    display: grid;
    gap: 0.75rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.info-item:hover {
    background: #e9ecef;
}

.info-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.95rem;
}

/* Badges Container */
.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
}

.badges-container .badge {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
}

/* Folder Color Variants */
.folder-warning .folder-icon i {
    color: #ffc107 !important;
}

.folder-success .folder-icon i {
    color: #28a745 !important;
}

/* Folder Explorer Card */
.folder-explorer .card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.folder-explorer .card-header {
    background: linear-gradient(135deg, #003366 0%, #336699 100%);
    color: white;
    border: none;
    padding: 1.25rem 1.5rem;
}

.folder-explorer .card-header h5 {
    color: white;
    margin: 0;
}

.folder-explorer .card-header .badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Responsive Design for Folders */
@media (max-width: 768px) {
    .folder-header {
        flex-wrap: wrap;
        padding: 1rem;
    }

    .folder-icon {
        width: 40px;
    }

    .folder-icon i {
        font-size: 1.5rem !important;
    }

    .folder-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.5rem;
    }

    .folder-meta {
        font-size: 0.85rem;
    }

    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* Animation for folder opening */
@keyframes folderOpen {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.folder-item.folder-expanded .folder-content-inner {
    animation: folderOpen 0.3s ease-out;
}

/* Hover effect for folder items */
.folder-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(to right, rgba(0, 123, 255, 0.1), transparent);
    transition: width 0.3s ease;
    z-index: 0;
}

.folder-item:hover::before {
    width: 100%;
}

/* Ensure content is above the hover effect */
.folder-header,
.folder-content {
    position: relative;
    z-index: 1;
}

/* Empty state for folders */
.folder-explorer .empty-state-icon {
    animation: bounceIn 0.6s ease-out;
}

/* --- Column Width Utilities --- */
.col-w-60 {
    width: 60px !important;
}

.col-w-80 {
    width: 80px !important;
}

.col-w-100 {
    width: 100px !important;
}

.col-w-120 {
    width: 120px !important;
}

.col-w-140 {
    width: 140px !important;
}

.col-w-160 {
    width: 160px !important;
}

.col-w-180 {
    width: 180px !important;
}

.hover-translate-x {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hover-translate-x:hover {
    transform: translateX(10px);
}

.hover-lift-lg {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hover-lift-lg:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2) !important;
}

.text-info {
    color: #0ea5e9 !important;
}

.fa-11x {
    font-size: 11em;
}

/* --- Mejoras Globales de Impresión --- */
@media print {
    /* Resetear layouts que causan la página en blanco (flexbox rotos, heights fijos, backgrounds ocultos) */
    html, body {
        height: unset !important;
        min-height: auto !important;
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Rompe flexboxes o wrappers forzados que asfixian los saltos de página del navegador */
    .app-container, .main-wrapper, .content-page {
        height: unset !important;
        min-height: auto !important;
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Ocultar elementos visuales/interfaz innecesarios */
    #sidebar, .top-header, footer, .d-print-none, .navbar, .btn {
        display: none !important;
    }

    /* Reducir márgenes o paddings gigantes que hunden el layout en hoja 1 */
    .py-5, .pt-5 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
    
    .mt-5 {
        margin-top: 1.5rem !important;
    }

    /* Forzar que sí se impriman colores de tarjetas informativas */
    .card, .glass-effect {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
        page-break-inside: avoid;
    }
    
    .text-white {
        color: #000 !important; /* Salvar contraste en impresiones oscuras fallidas */
    }

    .bg-primary, .bg-gradient-primary, .card-gradient-primary, .bg-soft-info, .bg-soft-warning {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* --- Landing Page Specific Styles --- */
.hero-section {
    min-height: 85vh;
    background: radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.15) 0, transparent 50%), 
                radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.1) 0, transparent 50%), 
                #fff;
}

.icon-circle {
    width: 54px;
    height: 54px;
}

.gradient-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.credit-card {
    background: linear-gradient(145deg, #0d47a1 0%, #1565c0 100%);
    border-radius: 12px;
    max-width: 350px;
}

.credit-card-title {
    font-size: 0.7rem;
    letter-spacing: 1px;
}

.credit-card-titular {
    font-size: 0.65rem;
}

.feature-badge {
    font-size: 0.65rem;
    letter-spacing: 1px;
}

/* Estilos adicionales para landing.html */
.hero-section-style {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.05em;
}

.gradient-overlay {
    pointer-events: none;
}

.bg-dark-custom {
    background: #1e293b;
}

.credit-card-premium {
    background: linear-gradient(135deg, #334155 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
}

.font-monospace {
    font-family: 'Courier New', monospace;
}