/* ===================================================================
   PROFESSIONAL DESIGN SYSTEM - Enterprise Grade UI
   Created: 2025 | Modern Web Application
   ================================================================= */

:root {
    /* === CORPORATE BRAND COLORS === */
    /* Paleta Negros + Slates (TECO) */
    --primary: #0f172a;          /* slate-900 — negro con tinte azulado sutil */
    --primary-50:  #f8fafc;      /* slate-50  */
    --primary-100: #f1f5f9;      /* slate-100 */
    --primary-200: #e2e8f0;      /* slate-200 */
    --primary-300: #cbd5e1;      /* slate-300 */
    --primary-400: #475569;      /* slate-600 */
    --primary-500: #0f172a;      /* = --primary */
    --primary-600: #0a0f1e;      /* casi negro */
    --primary-700: #050811;
    --primary-800: #020306;
    --primary-900: #000000;      /* negro puro */

    --secondary: #64748b;        /* slate-500 — gris pizarra medio */
    --secondary-50:  #f8fafc;
    --secondary-100: #f1f5f9;
    --secondary-200: #e2e8f0;
    --secondary-300: #cbd5e1;
    --secondary-400: #94a3b8;
    --secondary-500: #64748b;    /* = --secondary */
    --secondary-600: #475569;
    --secondary-700: #334155;
    --secondary-800: #1e293b;
    --secondary-900: #0f172a;

    /* === ACCENT COLORS === */
    --accent: #64748b;
    --accent-50: #f8fafc;
    --accent-100: #f1f5f9;
    --accent-500: #64748b;
    --accent-600: #475569;

    /* === STATUS COLORS === */
    --success: #10b981;
    --success-50: #ecfdf5;
    --success-100: #d1fae5;
    --success-500: #10b981;
    --success-600: #059669;
    --success-700: #047857;

    --warning: #f59e0b;
    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    --warning-700: #b45309;

    --error: #ef4444;
    --error-50: #fef2f2;
    --error-100: #fee2e2;
    --error-500: #ef4444;
    --error-600: #dc2626;
    --error-700: #b91c1c;

    --info: #3b82f6;
    --info-50: #eff6ff;
    --info-100: #dbeafe;
    --info-500: #3b82f6;
    --info-600: #2563eb;
    --info-700: #1d4ed8;

    /* === NEUTRAL COLORS - Professional Palette === */
    --white: #ffffff;
    --black: #000000;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --gray-950: #030712;

    /* === SEMANTIC COLORS === */
    --text-primary: #1e293b;          /* Slate 800 - profesional neutral */
    --text-secondary: #475569;        /* Slate 600 */
    --text-tertiary: #94a3b8;         /* Slate 400 */
    --text-disabled: var(--gray-400);
    --text-inverse: var(--white);
    --text-link: #0f172a;             /* Primary slate-900 (alto contraste) */
    --text-link-hover: #000000;       /* Negro puro al pasar */

    --bg-primary: #ffffff;            /* Blanco limpio */
    --bg-secondary: #f8fafc;          /* Slate-50 */
    --bg-tertiary: #f1f5f9;           /* Slate-100 */
    --bg-hover: #e2e8f0;              /* Slate-200 */
    --bg-active: #f1f5f9;             /* Active sutil (slate-100) */
    --bg-overlay: rgba(15, 23, 42, 0.6);  /* slate-900 alpha */

    --border-primary: #e2e8f0;        /* slate-200 sutil */
    --border-secondary: #64748b;      /* slate-500 (antes sky blue) */
    --border-focus: #0f172a;          /* slate-900 (focus fuerte) */

    /* === PREMIUM GRADIENTS - Negros + Slates === */
    --gradient-primary:      linear-gradient(135deg, #0f172a 0%, #334155 100%);
    --gradient-secondary:    linear-gradient(135deg, #64748b 0%, #94a3b8 100%);
    --gradient-gold-intense: linear-gradient(135deg, #000000 0%, #334155 50%, #0f172a 100%);
    --gradient-warm:         linear-gradient(135deg, #0f172a 0%, #64748b 100%);
    --gradient-soft:         linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --gradient-text:         linear-gradient(90deg,  #0f172a 0%, #000000 50%, #0f172a 100%);
    --gradient-sidebar:      linear-gradient(135deg, #000000 0%, #0f172a 100%);
    --gradient-overlay:      linear-gradient(135deg, rgba(15,23,42,0.9) 0%, rgba(0,0,0,0.95) 100%);

    /* Success gradient (se mantiene verde) */
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);

    /* === SHADOWS (disabled) === */
    --shadow-xs: none;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    --shadow-xl: none;
    --shadow-2xl: none;
    --shadow-inner: none;

    /* === COLORED SHADOWS (disabled) === */
    --shadow-primary: none;
    --shadow-secondary: none;
    --shadow-success: none;
    --shadow-error: none;

    /* === BORDER RADIUS === */
    --radius-none: 0;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.625rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1.25rem;
    --radius-3xl: 1.5rem;
    --radius-full: 9999px;

    /* === SPACING SYSTEM === */
    --space-0: 0;
    --space-px: 1px;
    --space-0-5: 0.125rem;
    --space-1: 0.25rem;
    --space-1-5: 0.375rem;
    --space-2: 0.5rem;
    --space-2-5: 0.625rem;
    --space-3: 0.75rem;
    --space-3-5: 0.875rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-7: 1.75rem;
    --space-8: 2rem;
    --space-9: 2.25rem;
    --space-10: 2.5rem;
    --space-11: 2.75rem;
    --space-12: 3rem;
    --space-14: 3.5rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;

    /* === TYPOGRAPHY SYSTEM === */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Droid Sans Mono', 'Source Code Pro', monospace;

    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;

    --font-thin: 100;
    --font-extralight: 200;
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
    --font-black: 900;

    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;

    --tracking-tighter: -0.05em;
    --tracking-tight: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;
    --tracking-wider: 0.05em;
    --tracking-widest: 0.1em;

    /* === TRANSITIONS & ANIMATIONS === */
    --transition-base: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);

    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

    /* === Z-INDEX SCALE === */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;

    /* === MISC === */
    --blur-sm: 4px;
    --blur-md: 8px;
    --blur-lg: 16px;
    --blur-xl: 24px;
}

/* ===================================================================
   RESET & BASE STYLES
   ================================================================= */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-secondary);
    min-height: 100vh;
    color: var(--text-primary) !important;
    line-height: var(--leading-normal);
    font-size: 0.875rem;
    font-weight: var(--font-normal);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(15, 23, 42, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(100, 116, 139, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-600);
}

.nav-brand i {
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--gray-500);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-600);
    background: rgba(15, 23, 42, 0.1);
}

/* Main Content */
.main-content {
    padding: 2rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.section-header p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: none;
    transition: transform 0.3s ease;
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: none;
    margin-bottom: 2rem;
    overflow: hidden;
}

.card-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2,
.card-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-content {
    padding: 2rem;
}

/* ===================================================================
   BUTTONS - Corporativos con Gradientes Dorados
   ================================================================= */
.btn {
    padding: var(--space-2) var(--space-4);
    border: none;
    border-radius: var(--radius-xl);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: var(--transition-base);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    position: relative;
    overflow: hidden;
    letter-spacing: var(--tracking-wide);
}

.btn::before {
    display: none;
}

/* Botón Primario - Gradiente Dorado Corporativo */
.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow-primary);
    border: 1px solid rgba(15, 23, 42, 0.2);
}

.btn-primary:hover {
    box-shadow: none;
}

.btn-primary:active {
    transform: translateY(-1px);
}

/* Botón Secundario - Outline Dorado */
.btn-secondary,
.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-secondary);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover,
.btn-outline:hover {
    background: var(--gradient-soft);
    color: var(--text-primary);
    border-color: var(--primary-600);
    box-shadow: var(--shadow-secondary);
}

/* Botón Success */
.btn-success {
    background: var(--gradient-success);
    color: var(--white);
    box-shadow: var(--shadow-success);
}

.btn-success:hover {
    box-shadow: none;
}

/* Botón Warning - Dorado Intenso */
.btn-warning {
    background: var(--gradient-gold-intense);
    color: var(--white);
    box-shadow: var(--shadow-secondary);
}

.btn-warning:hover {
    box-shadow: none;
}

/* Botón Danger */
.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: var(--white);
    box-shadow: var(--shadow-error);
}

.btn-danger:hover {
    box-shadow: none;
}

/* Tamaños de botones */
.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
    border-radius: var(--radius-lg);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
    border-radius: var(--radius-2xl);
}

.btn-block {
    width: 100%;
}

/* Icon buttons */
.btn-icon {
    padding: var(--space-2-5);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.audit-table th,
.audit-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.audit-table th {
    background: rgba(15, 23, 42, 0.08);
    font-weight: 600;
    color: var(--gray-800);
}

.audit-table tr:hover {
    background: rgba(15, 23, 42, 0.04);
}

.score-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.8rem;
}

.score-excellent {
    background: #d4edda;
    color: #155724;
}

.score-good {
    background: #d1ecf1;
    color: #0c5460;
}

.score-average {
    background: #fff3cd;
    color: #856404;
}

.score-poor {
    background: #f8d7da;
    color: #721c24;
}

/* Filters */
.filters-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: none;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    color: var(--gray-800);
    font-size: 0.9rem;
}

.filter-group input,
.filter-group select {
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary-600);
    box-shadow: none;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
}

/* Agents Grid */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.agent-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: none;
    transition: transform 0.3s ease;
}

.agent-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.agent-avatar {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
}

.agent-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.agent-info p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.agent-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.agent-stat {
    text-align: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.08);
    border-radius: 8px;
}

.agent-stat h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-600);
    margin-bottom: 0.25rem;
}

.agent-stat p {
    color: var(--gray-500);
    font-size: 0.8rem;
}

/* Reports Grid */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: none;
}

.modal-header {
    padding: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
}

.close {
    color: var(--gray-400);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--gray-800);
}

.modal-body {
    padding: 2rem;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 500;
    color: var(--gray-800);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-600);
    box-shadow: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Audit Details */
.audit-details {
    display: grid;
    gap: 2rem;
}

.detail-section {
    background: var(--gray-50);
    padding: 1.5rem;
    border-radius: 8px;
}

.detail-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

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

.detail-label {
    font-weight: 500;
    color: var(--gray-500);
}

.detail-value {
    font-weight: 600;
    color: var(--gray-800);
}

.comment-section {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--primary-600);
}

.comment-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.comment-section p {
    color: var(--gray-500);
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .container {
        padding: 0 1rem;
    }

    .section-header h1 {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 1.5rem;
    }

    .card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        justify-content: stretch;
    }

    .filter-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .agents-grid {
        grid-template-columns: 1fr;
    }

    .reports-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 2% auto;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .audit-table {
        font-size: 0.8rem;
    }

    .audit-table th,
    .audit-table td {
        padding: 0.5rem;
    }
}

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(15, 23, 42, 0.1);
    border-left: 4px solid var(--primary-600);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.35);
}

/* === ENHANCED TYPOGRAPHY SYSTEM === */

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

h1 {
    font-size: 2.25rem;     /* 36px */
    font-weight: 700;
    letter-spacing: -0.05em;
}

h2 {
    font-size: 1.875rem;    /* 30px */
    font-weight: 700;
}

h3 {
    font-size: 1.5rem;      /* 24px */
    font-weight: 600;
}

h4 {
    font-size: 1.25rem;     /* 20px */
    font-weight: 600;
}

h5 {
    font-size: 1.125rem;    /* 18px */
    font-weight: 500;
}

h6 {
    font-size: 1rem;        /* 16px */
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1 {
        font-size: 1.875rem;    /* 30px */
    }
    
    h2 {
        font-size: 1.5rem;      /* 24px */
    }
    
    h3 {
        font-size: 1.25rem;     /* 20px */
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;      /* 24px */
        line-height: 1.375;
    }
    
    h2 {
        font-size: 1.25rem;     /* 20px */
    }
    
    h3 {
        font-size: 1.125rem;    /* 18px */
    }
    
    body {
        font-size: 0.875rem;   /* 14px */
    }
}

/* Text Utilities */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }

/* Font Weights */
.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

/* Line Heights */
.leading-tight { line-height: 1.25; }
.leading-snug { line-height: 1.375; }
.leading-normal { line-height: 1.5; }
.leading-relaxed { line-height: 1.625; }
.leading-loose { line-height: 2; }

/* Letter Spacing */
.tracking-tighter { letter-spacing: -0.05em; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-normal { letter-spacing: 0; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-wider { letter-spacing: 0.05em; }

/* Text Colors */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-light); }
.text-inverse { color: var(--white); }
.text-muted { color: var(--gray-500); }

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

/* Text Transform */
.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }
.normal-case { text-transform: none; }

/* Paragraphs and Content */
p {
    margin: 0 0 1rem 0;
    line-height: 1.625;
}

.lead {
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.625;
    color: var(--text-secondary);
}

.small {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Content Flow */
.prose {
    max-width: 65ch;
    line-height: 1.625;
}

.prose > * + * {
    margin-top: 1rem;
}

.prose h1 + *,
.prose h2 + *,
.prose h3 + * {
    margin-top: 0.5rem;
}

.prose * + h1,
.prose * + h2,
.prose * + h3 {
    margin-top: 2rem;
}

/* Lists */
ul, ol {
    margin: 0 0 1rem 0;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.25rem;
    line-height: 1.625;
}

/* Links */
a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.15s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

a:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Prevenir subrayado en todos los botones y enlaces */
.btn,
.btn:hover,
.btn:focus,
.btn:active,
button,
button:hover,
button:focus,
button:active,
a.btn,
a.btn:hover,
a.btn:focus,
a.btn:active {
    text-decoration: none !important;
}

/* Code */
code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875em;
    background: var(--gray-100);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    color: var(--text-primary);
}

pre {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: var(--gray-900);
    color: var(--gray-100);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1rem 0;
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Blockquotes */
blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--primary);
    background: var(--primary-50);
    font-style: italic;
    font-size: 1.125rem;
    line-height: 1.625;
}

/* Spacing Utilities */
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

/* Reading Optimizations */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .prose p, .prose .lead {
        max-width: 65ch; /* Optimal reading width - only inside .prose */
    }
}

/* Agent & Client names - always capitalized */
.agent-name,
.client-name {
    text-transform: capitalize;
}

/* Enhanced font rendering */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Focus within for better accessibility */
.focus-within:focus-within {
    box-shadow: none;
}


/* Sombras de texto sutiles (utilidades neutras, sin decoración) */
.text-shadow-sm { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.text-shadow    { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.text-shadow-lg { text-shadow: 0 4px 8px rgba(0, 0, 0, 0.12); }

/* ------------------------------------------------------------------
   Retirado: utilidades decorativas heredadas del tema anterior
   (.typewriter, .gradient-text, .gradient-title, .icon-gold,
   .bg-gradient-*, .border-gradient, .shadow-gold*, .text-gold*,
   .hover-gradient, .divider-gradient, .glow-gold*, .text-shine,
   .overlay-gradient, .text-corporate).
   Ninguna se usaba en ninguna página, y el brillo dorado y los textos
   con degradado son justo lo contrario del registro sobrio que busca
   la aplicación. Los TOKENS de degradado se conservan: --gradient-primary
   y --gradient-sidebar sí son estructurales (botones y barra lateral).
   ------------------------------------------------------------------ */
