/* Admin Panel Custom Styles - Premium Design */

:root {
    /* Color Palette */
    --primary-color: #4f46e5;
    /* Indigo 600 */
    --primary-hover: #4338ca;
    /* Indigo 700 */
    --secondary-color: #64748b;
    /* Slate 500 */
    --success-color: #10b981;
    /* Emerald 500 */
    --danger-color: #ef4444;
    /* Red 500 */
    --warning-color: #f59e0b;
    /* Amber 500 */
    --info-color: #3b82f6;
    /* Blue 500 */

    /* Backgrounds */
    --bg-body: #f8fafc;
    /* Slate 50 */
    --bg-surface: #ffffff;
    --bg-sidebar: #1e293b;
    /* Slate 800 */
    --bg-sidebar-hover: #334155;
    /* Slate 700 */

    /* Text */
    --text-main: #0f172a;
    /* Slate 900 */
    --text-muted: #64748b;
    /* Slate 500 */
    --text-light: #f1f5f9;
    /* Slate 100 */

    /* Borders & Shadows */
    --border-color: #e2e8f0;
    /* Slate 200 */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
}

/* Wrapper Layout */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    align-items: stretch;
}

/* Sidebar */
.sidebar {
    min-width: 260px;
    max-width: 260px;
    height: 100vh;
    position: sticky;
    top: 0;
    background: var(--bg-sidebar);
    color: var(--text-light);
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    overflow-y: auto;
}

.sidebar.active {
    margin-left: -260px;
}

.sidebar-header {
    padding: 20px 24px;
    background: var(--sidebar-dark);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
}

.sidebar-header h3 {
    color: #fff;
    font-size: 1.1rem;
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.2;
}

.sidebar-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.sidebar ul.components {
    padding: 16px 0;
    flex-grow: 1;
}

.sidebar ul li {
    padding: 4px 16px;
}

.sidebar .nav-link {
    font-size: 1.05rem;
    font-weight: 500;
    color: #94a3b8;
    /* Slate 400 */
    padding: 12px 18px;
    text-decoration: none;
    display: flex;
    align-items: center;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.sidebar .nav-link:hover {
    color: #fff;
    background-color: var(--bg-sidebar-hover);
    transform: translateX(4px);
}

.sidebar .nav-link.active {
    color: #fff;
    background-color: var(--primary-color);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.sidebar .nav-link i {
    margin-right: 12px;
    font-size: 1.35rem;
    width: 28px;
    text-align: center;
}

.sidebar-footer {
    padding: 24px;
    background: rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: var(--text-light);
}

.sidebar-footer .user-info i {
    font-size: 2rem;
    color: var(--text-muted);
}

/* Content Area */
.content {
    width: 100%;
    min-height: 100vh;
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    background-color: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

#sidebarCollapse {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    padding: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
    border-radius: 6px;
}

#sidebarCollapse:hover {
    color: var(--primary-color);
    background-color: #eff6ff;
}

.navbar-text strong {
    color: var(--text-main);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* Main Content */
main {
    padding: 2rem;
    flex-grow: 1;
}

/* Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    transition: var(--transition-fast);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 1.5rem;
}

/* Tables */
.table {
    margin-bottom: 0;
    color: var(--text-main);
    vertical-align: middle;
}

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

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Buttons */
.btn {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

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

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-sm {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

/* Badges */
.badge {
    font-weight: 600;
    padding: 0.35em 0.8em;
    border-radius: 6px;
}

/* Alerts */
.floating-alerts-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    width: 350px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    /* Allow clicking through the container */
}

.alert {
    pointer-events: auto;
    /* Re-enable pointer events for the alerts themselves */
    border: none;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    padding-bottom: 1rem;
    margin-bottom: 0;
    /* Container handles gap */
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 4px solid transparent;
    /* Reset default border */
    position: relative;
    overflow: visible;
    min-width: 280px;
}

/* Progress bar using ::after pseudo-element */
.alert::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, currentColor 0%, currentColor 100%);
    opacity: 0.3;
    border-radius: 0 0 12px 12px;
    animation: alertProgressAnimation 5s linear forwards;
}

@keyframes alertProgressAnimation {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

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

.alert-info {
    background-color: rgba(239, 246, 255, 0.95);
    /* #eff6ff with opacity */
    color: #1e40af;
    border-left-color: var(--info-color);
}

.alert-info::after {
    background: linear-gradient(90deg, var(--info-color) 0%, #60a5fa 100%);
    opacity: 0.5;
}

.alert-success {
    background-color: rgba(236, 253, 245, 0.95);
    /* #ecfdf5 with opacity */
    color: #065f46;
    border-left-color: var(--success-color);
}

.alert-success::after {
    background: linear-gradient(90deg, var(--success-color) 0%, #34d399 100%);
    opacity: 0.5;
}

.alert-danger {
    background-color: rgba(254, 242, 242, 0.95);
    /* #fef2f2 with opacity */
    color: #991b1b;
    border-left-color: var(--danger-color);
}

.alert-danger::after {
    background: linear-gradient(90deg, var(--danger-color) 0%, #f87171 100%);
    opacity: 0.5;
}

.alert-warning {
    background-color: rgba(255, 251, 235, 0.95);
    /* #fffbeb with opacity */
    color: #92400e;
    border-left-color: var(--warning-color);
}

.alert-warning::after {
    background: linear-gradient(90deg, var(--warning-color) 0%, #fbbf24 100%);
    opacity: 0.5;
}

/* Alert message content */
.alert > span,
.alert > div:first-child {
    flex: 1;
    min-width: 0;
}

/* Close button styling for alerts - Tapestry uses .close class */
.alert .close,
.alert .btn-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    font-size: 1.2rem;
    line-height: 1;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
}

.alert .close:hover,
.alert .btn-close:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        margin-left: -260px;
        position: fixed;
        height: 100%;
    }

    .sidebar.active {
        margin-left: 0;
    }

    .content {
        width: 100%;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar.active+.sidebar-overlay {
        display: block;
    }
}

/* Utilities */
.text-muted {
    color: var(--text-muted) !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow {
    box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

/* ============================================
   DATATABLES MODERN STYLING
   ============================================ */

/* === Table Container === */
.dataTables_wrapper {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* === Table Base Styling === */
.dataTable {
    border-collapse: separate !important;
    border-spacing: 0;
    width: 100% !important;
}

.dataTable thead th {
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem 1rem !important;
    background-color: #f8fafc;
    border-top: none;
    white-space: nowrap;
    vertical-align: middle;
}

.dataTable tbody td {
    padding: 0.875rem 1rem !important;
    border-bottom: 1px solid #e2e8f0;
    color: var(--text-main);
    vertical-align: middle;
    transition: background-color 0.2s ease;
}

/* Remove top border from first row */
.dataTable tbody tr:first-child td {
    border-top: none;
}

/* Hover effect for rows */
.dataTable tbody tr:hover td {
    background-color: #f8fafc;
}

/* === Sorting Icons === */
.dataTable thead th.sorting,
.dataTable thead th.sorting_asc,
.dataTable thead th.sorting_desc {
    cursor: pointer !important;
    position: relative;
    padding-right: 2rem !important;
    user-select: none;
    -webkit-user-select: none;
}

.dataTable thead th.sorting:before,
.dataTable thead th.sorting_asc:before,
.dataTable thead th.sorting_desc:before,
.dataTable thead th.sorting:after,
.dataTable thead th.sorting_asc:after,
.dataTable thead th.sorting_desc:after {
    opacity: 0.3;
    transition: opacity 0.2s ease;
}

.dataTable thead th.sorting:hover:before,
.dataTable thead th.sorting:hover:after {
    opacity: 0.6;
}

.dataTable thead th.sorting_asc:before,
.dataTable thead th.sorting_desc:after {
    opacity: 1 !important;
    color: var(--primary-color);
}

/* === Length Select === */
.dataTables_length {
    margin-bottom: 1rem;
}

.dataTables_length label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dataTables_length select {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-main);
    background-color: var(--bg-surface);
    transition: var(--transition-fast);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 16px 12px;
}

.dataTables_length select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* === Search Filter === */
.dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_filter label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dataTables_filter input {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--text-main);
    background-color: var(--bg-surface);
    transition: var(--transition-fast);
    margin-left: 0.5rem;
    min-width: 250px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%2364748b' d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 16px;
}

.dataTables_filter input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* === Info Text === */
.dataTables_info {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.75rem 0;
}

/* === Pagination === */
.dataTables_paginate {
    padding: 0.75rem 0;
}

.dataTables_paginate .paginate_button {
    padding: 0.5rem 0.75rem;
    margin: 0 0.125rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-main) !important;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.dataTables_paginate .paginate_button:hover {
    background-color: #f1f5f9 !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
    box-shadow: none !important;
}

.dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    color: white !important;
    border: 1px solid var(--primary-color) !important;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2) !important;
}

.dataTables_paginate .paginate_button.current:hover {
    background: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: white !important;
}

.dataTables_paginate .paginate_button.disabled {
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none;
}

.dataTables_paginate .paginate_button.disabled:hover {
    background-color: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
    color: var(--text-main) !important;
}

/* === Processing Indicator === */
.dataTables_processing {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    color: var(--text-main);
    font-weight: 500;
    z-index: 1000;
}

/* === Empty State === */
.dataTables_empty {
    padding: 3rem 1.5rem !important;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* === Responsive Controls === */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin-top: 0;
}

/* === Badge Enhancements === */
.dataTable .badge {
    font-weight: 600;
    padding: 0.35em 0.8em;
    border-radius: 6px;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* === Button Group in Table === */
.dataTable .btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.dataTable .btn-group-sm .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* === Responsive Adjustments === */
@media (max-width: 768px) {

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        text-align: center;
        margin-bottom: 1rem;
    }

    .dataTables_filter input {
        min-width: 100%;
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: center;
    }
}


/* Header Redesign */
.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 900;
}

/* Breadcrumbs */
.breadcrumb {
    background-color: #f3f4f6;
    /* Light gray background */
    padding: 0.5rem 1rem;
    border-radius: 8px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    /* Ensure vertical alignment */
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: 1rem;
    /* Increased font size */
}

.breadcrumb-item a {
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
}

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

.breadcrumb-item.active {
    color: var(--text-main);
    font-weight: 600;
    display: flex;
    align-items: center;
}

.breadcrumb-item+.breadcrumb-item::before {
    color: var(--text-muted);
    content: "/";
    padding-top: 1px;
    /* Slight adjustment for separator alignment */
}

/* Nav Icon Buttons */
.nav-icon-btn {
    color: var(--text-muted);
    font-size: 1.25rem;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon-btn:hover {
    color: var(--primary-color);
    background-color: #eff6ff;
}

/* RAG Sync Panel */
.rag-sync-panel {
    position: fixed;
    top: 70px;
    /* Below navbar */
    right: 20px;
    width: 320px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.rag-sync-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.rag-sync-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rag-sync-header h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.rag-sync-body {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.btn-close {
    font-size: 0.8rem;
}

/* RAG Sync Panel - Contenido Dinámico */

.rag-sync-content {
    font-size: 0.875rem;
}

/* Sincronización Actual */
.current-sync-section {
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.sync-progress-card {
    background: white;
    border-radius: 6px;
    padding: 10px;
    margin-top: 8px;
}

.sync-info-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.8rem;
}

.sync-info-row .label {
    color: #64748b;
    font-weight: 500;
}

.sync-info-row .value {
    color: #1e293b;
    font-weight: 600;
}

/* Animación spinning para el icono de refresh */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spinning {
    display: inline-block;
    animation: spin 2s linear infinite;
}

/* No Sync Section */
.no-sync-section {
    opacity: 0.7;
}

/* Sync Action Section */
.sync-action-section .btn {
    transition: all 0.2s ease;
}

.sync-action-section .btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.sync-action-section .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Historial de Sincronizaciones */
.sync-history-section h6 {
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sync-history-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Custom scrollbar para el historial */
.sync-history-list::-webkit-scrollbar {
    width: 6px;
}

.sync-history-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.sync-history-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.sync-history-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Item de historial */
.sync-history-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.sync-history-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateX(2px);
}

.sync-history-item:last-child {
    margin-bottom: 0;
}

.sync-history-item .badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sync-item-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.75rem;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #475569;
}

.detail-row i {
    color: #94a3b8;
    font-size: 0.7rem;
}

/* Alert pequeño para errores */
.alert-sm {
    font-size: 0.75rem;
    padding: 6px 10px;
    margin-top: 8px;
}

/* Badges de estado */
.badge.bg-primary {
    background-color: #3b82f6 !important;
}

.badge.bg-success {
    background-color: #10b981 !important;
}

.badge.bg-danger {
    background-color: #ef4444 !important;
}

.badge.bg-secondary {
    background-color: #6b7280 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .rag-sync-panel {
        width: 100%;
        right: 0;
        left: 0;
        border-radius: 0;
        top: 60px;
    }

    .sync-item-details {
        grid-template-columns: 1fr;
    }
}