/* ===================================
   GESTOR EDITORIAL LEXENLACE
   Colores Jurídicos Premium
   Azul Marino + Dorado
   =================================== */

:root {
    /* === COLORES PRIMARIOS - AZUL MARINO === */
    /* Autoridad, Confianza, Profesionalismo */
    --primary: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;

    /* === COLORES SECUNDARIOS - DORADO === */
    /* Prestigio, Excelencia, Distinción */
    --secondary: #d97706;
    --secondary-dark: #b45309;
    --secondary-light: #f59e0b;

    /* === NEUTROS === */
    --dark: #0f172a;
    --gray-900: #1e293b;
    --gray-700: #334155;
    --gray-500: #64748b;
    --gray-300: #cbd5e1;
    --gray-100: #f1f5f9;
    --white: #ffffff;

    /* === TEMA CLARO === */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #1e293b;

    /* === SOMBRAS === */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);

    /* === TRANSICIONES === */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
}

/* === RESET Y BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === TIPOGRAFÍA PREMIUM === */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);

    /* Font Smoothing para mejor renderizado */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1;
    min-height: 100vh;
    /* Keep min-height from original body */
}

/* Headings con letter-spacing optimizado */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

h2 {
    font-size: 1.875rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

h4 {
    font-size: 1.25rem;
    font-weight: 500;
}

h5 {
    font-size: 1.125rem;
    font-weight: 500;
}

h6 {
    font-size: 1rem;
    font-weight: 500;
}

/* === NAVBAR === */
/* === NAVBAR === */
.navbar {
    background: rgba(45, 55, 72, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(74, 85, 104, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .navbar {
    background: rgba(30, 41, 59, 0.8);
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
}

[data-theme="dark"] .navbar {
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
    transition: var(--transition);
}

.navbar-brand:hover {
    color: var(--secondary);
}

.navbar-brand .logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    transition: var(--transition);
}

.navbar-brand:hover .logo {
    transform: scale(1.05);
}

.brand-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-menu {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.75rem 1.25rem;
    color: #64748b !important;
    /* Color visible en modo claro */
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(217, 119, 6, 0.1) !important;
    color: #d97706 !important;
}

.nav-link.active {
    background: rgba(217, 119, 6, 0.15) !important;
    color: #d97706 !important;
}

/* Modo Oscuro - mismo estilo */
[data-theme="dark"] .nav-link {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .nav-link:hover {
    background: #334155 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .nav-link.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    color: #f8fafc !important;
}

/* === USER DROPDOWN === */
.navbar-user {
    position: relative;
}

.user-dropdown {
    position: relative;
}

.user-button {
    background: transparent !important;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius-sm);
    color: #e2e8f0 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.user-button:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .user-button {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .user-button:hover {
    background: #334155 !important;
    color: #f8fafc !important;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1000;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.dropdown-item.text-danger {
    color: var(--danger);
}

.dropdown-item.text-danger:hover {
    background: var(--danger);
    color: white;
}

.dropdown-divider {
    height: 1px;
    background: var(--bg-tertiary);
    margin: 0.5rem 0;
}

/* === BUTTONS === */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%);
    color: white;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* === FORMS === */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

/* === CARDS === */
.card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.card-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bg-tertiary);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* === TABLES === */
.table-container {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    overflow-x: auto;
}

table.dataTable {
    width: 100%;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

table.dataTable thead th {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem;
    font-weight: 600;
}

table.dataTable tbody tr {
    border-bottom: 1px solid var(--bg-tertiary);
}

table.dataTable tbody tr:hover {
    background: var(--bg-tertiary);
}

table.dataTable tbody td {
    padding: 1rem;
}

/* === ALERTS === */
.flash-messages {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-success {
    background: linear-gradient(135deg, var(--success) 0%, #047857 100%);
    color: white;
}

.alert-error {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%);
    color: white;
}

.alert-warning {
    background: linear-gradient(135deg, var(--warning) 0%, var(--secondary-dark) 100%);
    color: white;
}

.alert-info {
    background: linear-gradient(135deg, var(--info) 0%, #0369a1 100%);
    color: white;
}

.alert .close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.25rem;
    margin-left: auto;
}

/* === FOOTER === */
.footer {
    background: var(--bg-secondary);
    margin-top: 4rem;
    padding: 3rem 0 1rem;
    border-top: 2px solid var(--bg-tertiary);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.footer-section a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--secondary);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 50%;
    transition: var(--transition);
}

.social-links a:hover {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--bg-tertiary);
    color: var(--text-muted);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .navbar-menu {
        width: 100%;
        flex-direction: column;
    }

    .nav-link {
        text-align: center;
    }
}

/* === MAIN CONTENT === */
.main-content {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    min-height: calc(100vh - 400px);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* === STATS CARDS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 3px solid var(--secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    color: white;
}

.stat-info h3 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* === MODAL === */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--bg-tertiary);
}

.modal-header h3 {
    color: var(--text-primary);
    margin: 0;
}

.modal-header .close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.modal-header .close:hover {
    color: var(--text-primary);
}

.modal-content form {
    padding: 1.5rem;
}

textarea.form-control {
    resize: vertical;
    font-family: inherit;
}
/* ===================================
   USER DROPDOWN STYLES
   =================================== */
.user-dropdown {
    position: relative;
}

.user-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.user-button:hover {
    background: rgba(59, 130, 246, 0.1);
}

.user-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    min-width: 200px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-dropdown .dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
}

.dropdown-item.text-danger {
    color: #ef4444;
}

.dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}
