:root {
    /* Colores ERP Profesionales - Modern Theme */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #475569;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --accent: #8b5cf6;

    /* Grises Profesionales */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Sidebar Light Theme */
    --sidebar-text: #475569;
    --sidebar-text-active: #1e293b;
    --sidebar-hover-bg: #f1f5f9;
    --sidebar-active-bg: rgba(99, 102, 241, 0.08);
    --sidebar-active-border: #6366f1;
    --sidebar-divider: #e2e8f0;

    /* Diseño */
    --border-radius: 10px;
    --border-radius-lg: 14px;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Montserrat', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f0f2f5 0%, #e8ecf1 50%, #f0f2f5 100%);
    min-height: 100vh;
    color: var(--gray-900);
    line-height: 1.6;
    font-size: 14px;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}



.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.login-header {
    text-align: center;
    margin-bottom: 0;
}

.login-logo {
    width: 300px;
    height: auto;
    margin-bottom: -15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}


.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--gray-700);
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(0);
    opacity: 0.8;
}

.btn-block {
    width: 100%;
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid var(--danger);
}

.success-message {
    background: #d1fae5;
    color: #065f46;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid var(--success);
}

.login-footer {
    margin-top: 30px;
    text-align: center;
    color: var(--gray-500);
    font-size: 12px;
}

.demo-credentials {
    margin-top: 16px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--border-radius);
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
    background: var(--gray-50);
}

.sidebar {
    width: 270px;
    background: #ffffff;
    box-shadow: 1px 0 15px rgba(0, 0, 0, 0.06);
    padding: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid var(--sidebar-divider);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.sidebar.collapsed {
    transform: translateX(-100%);
    width: 270px;
}

.sidebar-toggle-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--gray-400);
    padding: 6px;
    border-radius: 8px;
    transition: var(--transition);
}

.sidebar-toggle-btn:hover {
    background: var(--sidebar-hover-bg);
    color: var(--gray-700);
}

.sidebar-header {
    padding: 28px 20px 20px;
    border-bottom: 1px solid var(--sidebar-divider);
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: 80px;
    position: relative;
    text-align: center;
}

.sidebar-toggle-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--gray-400);
    padding: 6px;
    border-radius: 8px;
    z-index: 10;
    transition: var(--transition);
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 0;
}

.sidebar.collapsed .header-content {
    display: none;
}

.sidebar-logo {
    display: block;
    max-width: 140px;
    height: auto;
    margin: 0 auto 8px;
    object-fit: contain;
}

.sidebar-header h2 {
    font-size: 18px;
    color: var(--gray-900);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-header p {
    font-size: 13px;
    color: var(--primary);
    margin-top: 4px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 14px;
}

.menu-item {
    margin-bottom: 0;
}

.menu-item a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
    border-radius: 0;
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    gap: 2px;
}

.sidebar.collapsed .menu-item a span:not(.menu-item-icon) {
    display: none;
}

.sidebar.collapsed .menu-item a {
    justify-content: center;
    padding: 12px 0;
}

.sidebar.collapsed .menu-item-icon {
    margin-right: 0;
}

.main-content {
    margin-left: 270px;
    flex: 1;
    padding: 30px;
    width: calc(100% - 270px);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content.expanded {
    margin-left: 0;
    width: 100%;
}

.menu-item a:hover {
    background: var(--sidebar-hover-bg);
    color: var(--primary);
    border-left-color: rgba(99, 102, 241, 0.3);
}

.menu-item.active a {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-text-active);
    font-weight: 600;
    border-left-color: var(--sidebar-active-border);

}

.menu-item-icon {
    margin-right: 12px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.menu-item-icon svg {
    width: 20px;
    height: 20px;
}

/* Clean menu */
.menu-item .menu-item-icon {
    color: var(--gray-400);
}

.menu-item a:hover {
    background: var(--sidebar-hover-bg);
    color: var(--primary);
}

.menu-item a:hover .menu-item-icon {
    color: var(--primary);
}

.menu-item.active a {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-text-active);
    font-weight: 600;
    border-left-color: var(--sidebar-active-border);
}

.menu-item.active .menu-item-icon {
    color: var(--primary);
}

.menu-item.logout-item a {
    color: #ef4444;
}

.menu-item.logout-item .menu-item-icon {
    color: #ef4444;
}

.menu-item.logout-item a:hover {
    background: rgba(239, 68, 68, 0.08);
}

.main-content {
    margin-left: 270px;
    flex: 1;
    padding: 30px;
    width: calc(100% - 270px);
}

.page-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h1 {
    font-size: 28px;
    color: var(--gray-900);
}

.card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
}

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

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: var(--gray-50);
}

.table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 14px;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background: #dbeafe;
    color: #1e40af;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #e0f2fe;
    color: #075985;
}

/* Badge Notification — Premium pill */
.badge-notification {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.3px;
    color: #fff;
    position: absolute;
    top: 4px;
    right: 6px;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    animation: badge-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both,
               badge-pulse 2.8s ease-in-out 0.4s infinite;
    /* Default: rojo — rechazado / alertas */
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.55);
}

/* Amarillo — en revisión / pendiente */
.badge-notification[style*="#f59e0b"],
.badge-notification.badge-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%) !important;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.55) !important;
}

/* Verde — aprobado */
.badge-notification[style*="#10b981"],
.badge-notification.badge-success {
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%) !important;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.55) !important;
}

@keyframes badge-pop {
    from {
        opacity: 0;
        transform: scale(0.4);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes badge-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 3px 10px rgba(239, 68, 68, 0.55);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 4px 16px rgba(239, 68, 68, 0.7);
    }
}


/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: white;
    border-radius: var(--border-radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

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

.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-900);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

/* Grid */
.grid {
    display: grid;
    gap: 24px;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--gray-600);
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.top-bar {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: none;
    margin-bottom: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.6);
    gap: 15px;
    position: relative;
    height: 70px;
    overflow: visible;
    z-index: 1000;
}

.top-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4, #10b981);
    opacity: 0.8;
    border-radius: 0 0 16px 16px;
}

.brand-title {
    position: absolute;
    left: 40%;
    transform: translateX(-50%);
    text-align: center;
    width: auto;
}

.brand-title span {
    font-weight: 800;
    font-size: 22px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.global-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: none;
    transition: var(--transition);
    margin-bottom: 0;
    position: absolute;
    left: 20px;
    color: var(--primary);
}

.global-menu-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-dark);
    transform: scale(1.05);
}

/* Responsive Layout & Sidebar Drawer */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 2000;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
    }

    .sidebar:not(.collapsed) {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding-top: 0 !important;
    }

    .top-bar {
        padding: 0 10px;
        height: 50px;
        margin-bottom: 15px;
        border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
    }

    .brand-title {
        display: none;
        /* Hide brand text on mobile to save space */
    }

    .top-actions {
        position: relative;
        right: 0;
        top: 0;
        transform: none;
        padding: 0;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        gap: 5px;
    }

    .notification-btn {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .btn-sm {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Table Responsiveness Hack */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
    }

    table {
        min-width: 600px;
        /* Force scroll on small screens */
    }
}

/* Notification Center */
/* Global Top Actions Container */
.top-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;

    /* Glass Effect Container */
    background: rgba(255, 255, 255, 0.3) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 8px 16px;
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.glass-button-container {
    background: rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 6px 14px;
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.5);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}


/* Notification Center */
.notification-wrapper {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    z-index: 100;
}

.notification-btn {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    font-size: 20px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.notification-btn:hover {
    background: var(--gray-50);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.notification-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    width: 320px;
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    animation: slideIn 0.2s ease;
    z-index: 9999;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

.dropdown-header {
    padding: 12px 16px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}

.close-dropdown {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--gray-500);
}

.dropdown-content {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    gap: 12px;
    align-items: start;
    transition: background 0.2s;
    cursor: pointer;
}

.notification-item:hover {
    background: var(--gray-50);
}

.notify-danger .notify-text strong {
    color: var(--danger);
}

.notify-warning .notify-text strong {
    color: var(--warning);
}

.notify-info .notify-text strong {
    color: var(--info);
}

.notify-success .notify-text strong {
    color: var(--success);
}

.notify-icon {
    font-size: 18px;
}

.notify-text p {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.4;
}

/* Chat / Bitácora Styles */
.order-tabs {
    display: flex;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--primary);
    background: var(--gray-50);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.chat-section {
    display: flex;
    flex-direction: column;
    height: 400px;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    background: #f9fafb;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-loading,
.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--gray-500);
    gap: 10px;
}

.chat-message {
    display: flex;
    gap: 12px;
    max-width: 85%;
}

.chat-message.own-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    background: var(--gray-300);
    color: var(--gray-700);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.chat-message.own-message .message-avatar {
    background: var(--primary);
    color: white;
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    border-top-left-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-200);
}

.chat-message.own-message .message-content {
    background: #eff6ff;
    border-color: #dbeafe;
    border-top-left-radius: 12px;
    border-top-right-radius: 2px;
}

.message-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 5px;
    font-size: 12px;
}

.message-user {
    font-weight: 700;
    color: var(--gray-800);
}

.message-time {
    color: var(--gray-400);
}

.message-text {
    color: var(--gray-700);
    line-height: 1.5;
    white-space: pre-wrap;
}

.chat-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 10px;
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
}

.chat-input-area input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input-area input:focus {
    border-color: var(--primary);
}

.btn-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-send:hover {
    background: var(--primary-dark);
}

.btn-send:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
}

.dropdown-footer {
    padding: 10px;
    text-align: center;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

.dropdown-footer a {
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.no-alerts {
    padding: 20px;
    text-align: center;
    color: var(--gray-500);
    font-size: 13px;
}

.filter-group {
    display: flex;
    gap: 10px;
}

.btn-borrar-notif {
    background: transparent;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-borrar-notif:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.notification-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.2s;
    cursor: pointer;
}

.notification-item:hover {
    background: var(--gray-50);
}

.notification-item .notify-text {
    flex: 1;
}

/* Glassmorphism Buttons */
.btn-glass-success {
    background: rgba(16, 185, 129, 0.1) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(16, 185, 129, 0.2) !important;
    color: #059669 !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-radius: 10px;
}

.btn-glass-success:hover {
    background: rgba(16, 185, 129, 0.18) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4) !important;
}

.btn-glass-primary {
    background: rgba(99, 102, 241, 0.1) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(99, 102, 241, 0.2) !important;
    color: #6366f1 !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-radius: 10px;
}

.btn-glass-primary:hover {
    background: rgba(99, 102, 241, 0.18) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4) !important;
}

/* Kanban Board Styles */
.kanban-board {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 10px 5px 20px;
    min-height: calc(100vh - 250px);
    align-items: flex-start;
}

.kanban-column {
    flex: 0 0 320px;
    background: #f8fafc;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 250px);
}

.kanban-column-header {
    padding: 16px;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.kanban-column-title {
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    color: var(--gray-700);
    letter-spacing: 0.5px;
}

.kanban-column-count {
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.kanban-cards {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
}

.kanban-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.kanban-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.kanban-card-priority {
    width: 4px;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
}

.priority-urgente .kanban-card-priority { background: var(--danger); }
.priority-alta .kanban-card-priority { background: var(--warning); }
.priority-normal .kanban-card-priority { background: var(--primary); }
.priority-baja .kanban-card-priority { background: var(--gray-400); }

.kanban-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.kanban-card-order {
    font-weight: 700;
    font-size: 13px;
    color: var(--gray-900);
}

.kanban-card-client {
    font-size: 11px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kanban-card-desc {
    font-size: 13px;
    color: var(--gray-700);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kanban-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--gray-100);
}

.kanban-card-date {
    font-size: 11px;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    gap: 4px;
}

.process-locked {
    opacity: 0.7;
    background: #f1f5f9;
}

.locked-overlay {
    position: absolute;
    inset: 0;
    background: rgba(241, 245, 249, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    flex-direction: column;
    gap: 8px;
    color: var(--gray-500);
    backdrop-filter: blur(1px);
}

.locked-icon {
    font-size: 20px;
}

.locked-text {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Premium Modal Footer Buttons (.btn-tool) */
.btn-tool {
    padding: 10px 18px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    z-index: 1;
}

.btn-tool::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: -1;
}

.btn-tool:hover::before {
    transform: translateY(0);
}

.btn-tool:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.3);
}

.btn-tool:active {
    transform: translateY(0);
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.2);
}

.btn-tool-accent {
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
    color: white;
    box-shadow: 0 4px 14px -4px rgba(139, 92, 246, 0.5);
}

.btn-tool-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 4px 14px -4px rgba(99, 102, 241, 0.5);
}

.btn-tool-secondary {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    color: white;
    box-shadow: 0 4px 14px -4px rgba(71, 85, 105, 0.5);
}

.btn-tool .icon {
    font-size: 16px;
    font-style: normal;
}

/* ===== VISTA DEMO CORREO INTERNO ===== */
.correo-demo-container { display: flex; height: calc(100vh - 80px); background: #f8fafc; font-family: 'Inter', sans-serif; overflow: hidden; }
.mail-sidebar { width: 260px; background: #ffffff; border-right: 1px solid #e2e8f0; display: flex; flex-direction: column; padding: 20px 0; }
.compose-btn-wrapper { padding: 0 20px 20px; border-bottom: 1px solid #f1f5f9; }
.compose-btn { width: 100%; padding: 12px 20px; background: linear-gradient(135deg, #2563eb, #1d4ed8); color: white; border: none; border-radius: 12px; font-weight: 600; font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 4px 12px rgba(37,99,235,0.25); transition: all 0.2s ease; }
.compose-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(37,99,235,0.35); }
.mail-folders { list-style: none; padding: 15px 10px; margin: 0; flex: 1; }
.mail-folders li { padding: 12px 15px; margin-bottom: 5px; border-radius: 8px; color: #475569; font-size: 14px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 12px; transition: all 0.2s ease; }
.mail-folders li:hover { background: #f1f5f9; color: #1e293b; }
.mail-folders li.active { background: #eff6ff; color: #2563eb; font-weight: 600; }
.mail-folders li .badge { margin-left: auto; background: #2563eb; color: white; padding: 2px 8px; border-radius: 12px; font-size: 11px; }

.mail-list { width: 380px; background: #ffffff; border-right: 1px solid #e2e8f0; display: flex; flex-direction: column; }
.mail-search { padding: 16px; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.mail-search input { width: 100%; padding: 10px 15px; border-radius: 20px; border: 1px solid #cbd5e1; background: #ffffff; font-size: 13px; outline: none; transition: border-color 0.2s ease; }
.mail-search input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.mail-items-container { flex: 1; overflow-y: auto; }
.mail-item { padding: 16px; border-bottom: 1px solid #f1f5f9; cursor: pointer; transition: all 0.2s ease; position: relative; }
.mail-item:hover { background: #f8fafc; }
.mail-item.active { background: #eff6ff; border-left: 3px solid #2563eb; }
.mail-item.unread .mail-sender, .mail-item.unread .mail-subject { font-weight: 700; color: #0f172a; }
.mail-item-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.mail-sender { font-size: 14px; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.mail-time { font-size: 12px; color: #64748b; }
.mail-subject { font-size: 13px; color: #475569; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-snippet { font-size: 13px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mail-view { flex: 1; background: #ffffff; display: flex; flex-direction: column; overflow: hidden; height: 100%; }
.mail-view-header { padding: 25px 30px; border-bottom: 1px solid #e2e8f0; }
.mail-view-subject { font-size: 22px; font-weight: 700; color: #0f172a; margin: 0 0 20px 0; }
.mail-meta { display: flex; align-items: center; gap: 15px; }
.sender-avatar { width: 45px; height: 45px; background: linear-gradient(135deg, #38bdf8, #0284c7); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: bold; box-shadow: 0 2px 8px rgba(2,132,199,0.25); }
.sender-info-block { flex: 1; }
.sender-name { font-weight: 600; color: #1e293b; font-size: 15px; }
.sender-email { color: #64748b; font-size: 13px; margin-left: 5px; }
.mail-date { font-size: 13px; color: #94a3b8; margin-top: 2px; }
.mail-view-actions button { background: none; border: none; font-size: 18px; cursor: pointer; color: #64748b; margin-left: 10px; transition: color 0.2s; }
.mail-view-actions button:hover { color: #0f172a; }

.mail-body-content { padding: 30px; font-size: 15px; color: #334155; line-height: 1.6; }
.mail-body-content p { margin-top: 0; margin-bottom: 15px; }

.mail-attachments { margin-top: 25px; padding-top: 20px; border-top: 1px dashed #cbd5e1; display: flex; gap: 15px; flex-wrap: wrap; }
.attachment-card { border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 15px; display: flex; align-items: center; gap: 10px; background: #f8fafc; cursor: pointer; transition: all 0.2s ease; }
.attachment-card:hover { border-color: #2563eb; background: #eff6ff; }
.attachment-icon { font-size: 24px; color: #ef4444; }
.attachment-details { display: flex; flex-direction: column; }
.attachment-name { font-size: 13px; font-weight: 600; color: #1e293b; }
.attachment-size { font-size: 11px; color: #64748b; }

.mail-reply-box { margin: 30px; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; }
.reply-textarea { width: 100%; border: none; padding: 15px; font-size: 14px; min-height: 100px; resize: none; font-family: inherit; outline: none; }
.reply-actions { padding: 12px 15px; background: #f8fafc; border-top: 1px solid #e2e8f0; display: flex; justify-content: flex-end; }
.btn-send { background: #2563eb; color: white; border: none; padding: 8px 20px; border-radius: 6px; font-weight: 500; cursor: pointer; transition: background 0.2s; }
.btn-send:hover { background: #1d4ed8; }