/**
 * Limpieza - Core styles (toolbar, tabla, sidebar, layout)
 */

.limpieza-page ::-webkit-scrollbar { width: 5px; height: 5px; }
.limpieza-page ::-webkit-scrollbar-track { background: #0a0a0f; }
.limpieza-page ::-webkit-scrollbar-thumb { background: #252532; border-radius: 3px; }
.limpieza-page ::-webkit-scrollbar-thumb:hover { background: #353548; }

/* Toolbar */
.lz-toolbar {
    background: #0d0d14;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    flex-shrink: 0;
    height: 36px;
}
.lz-toolbar .sep { width: 1px; height: 20px; background: rgba(255,255,255,0.08); margin: 0 2px; }
.lz-toolbar input[type="text"] {
    background: #16161f;
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 3px;
    outline: none;
}
.lz-toolbar input[type="text"]:focus { border-color: #6366f1; }

/* Tabs */
.lz-tabs {
    display: flex;
    background: #0a0a0f;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
    height: 30px;
}
.lz-tab {
    padding: 0 14px;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
    white-space: nowrap;
}
.lz-tab:hover { color: rgba(255,255,255,0.7); }
.lz-tab.active {
    color: #fff;
    border-bottom-color: #6366f1;
}
.lz-tab svg { width: 13px; height: 13px; }
/* Tooltip en tabs */
.lz-tab[data-tip] {
    position: relative;
}
.lz-tab[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    background: #1e1e2e;
    color: rgba(255,255,255,0.85);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(99,102,241,0.3);
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    white-space: normal;
    width: 280px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0s ease-out 0s;
}
.lz-tab[data-tip]:hover::after {
    opacity: 1;
    transition: opacity 0.2s ease-out 2s;
}

/* Main layout */
.lz-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar opciones */
.lz-sidebar {
    width: 220px;
    background: #0d0d14;
    border-right: 1px solid rgba(255,255,255,0.06);
    overflow-y: auto;
    flex-shrink: 0;
    padding: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(99,102,241,0.4) transparent;
}
.lz-sidebar::-webkit-scrollbar { width: 6px; }
.lz-sidebar::-webkit-scrollbar-track { background: transparent; }
.lz-sidebar::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.4); border-radius: 3px; }
.lz-sidebar::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.6); }
.lz-sidebar-section {
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 4px;
}
.lz-sidebar-section:last-child {
    border-bottom: none;
}
.lz-sidebar-title {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #818cf8;
    padding: 4px 6px 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 3px;
    user-select: none;
}
.lz-sidebar-title:hover {
    background: rgba(99,102,241,0.1);
}
.lz-sidebar-title::after {
    content: '';
    border: 4px solid transparent;
    border-top: 5px solid #818cf8;
    margin-top: 2px;
    flex-shrink: 0;
    transition: transform 0.2s;
}
.lz-sidebar-section.collapsed .lz-sidebar-title::after {
    transform: rotate(-90deg);
    margin-top: 0;
}
.lz-sidebar-section.collapsed .lz-sidebar-body {
    display: none;
}
.lz-sidebar label {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 2px 6px;
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.1s;
    position: relative;
}
.lz-sidebar label:hover { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.85); }
/* Tooltip sidebar */
.lz-sidebar .lz-sidebar-title[data-tip] {
    cursor: help;
}
#lzTooltip {
    position: fixed;
    background: #1e1e2e;
    color: rgba(255,255,255,0.85);
    font-size: 11px;
    line-height: 1.4;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(99,102,241,0.3);
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    white-space: normal;
    width: 260px;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease-out;
}
#lzTooltip.visible {
    opacity: 1;
}
.lz-sidebar input[type="checkbox"] { width: 12px; height: 12px; accent-color: #6366f1; }
.lz-sidebar select {
    width: 100%;
    background: #16161f;
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 3px;
    margin: 2px 6px;
}
.lz-sidebar-field {
    padding: 2px 6px;
}
.lz-sidebar-field label {
    display: block;
    font-size: 9px;
    color: rgba(255,255,255,0.35);
    margin-bottom: 1px;
    padding: 0;
}
.lz-sidebar-field label:hover {
    background: none;
}
.lz-sidebar-field select {
    margin: 0;
}
.lz-input-sm {
    width: 100%;
    background: #16161f;
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    font-size: 11px;
    padding: 3px 5px;
    border-radius: 3px;
    margin-top: 1px;
}
.lz-input-sm:focus {
    outline: none;
    border-color: #6366f1;
}
.lz-sidebar-field input[type="number"] {
    background: #16161f;
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 3px;
}

/* Folder Browser Modal */
.lz-folder-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.lz-folder-dialog {
    background: #12121a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    width: 480px;
    max-width: 90vw;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lz-folder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 13px;
    font-weight: 600;
}
.lz-folder-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.lz-folder-path {
    flex: 1;
    background: #0a0a0f;
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 3px;
    font-family: monospace;
}
.lz-folder-path:focus {
    outline: none;
    border-color: #6366f1;
}
.lz-folder-list {
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
    max-height: 400px;
    padding: 4px;
}
.lz-folder-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    border-radius: 4px;
}
.lz-folder-item:hover {
    background: rgba(99,102,241,0.15);
    color: #fff;
}
.lz-folder-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* Content area */
.lz-content { flex: 1; overflow: auto; background: #0a0a0f; }

/* Tabla principal */
.lz-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}
.lz-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #1c1c2e;
}
.lz-table th {
    padding: 6px 6px;
    text-align: left;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.85);
    border-bottom: 2px solid rgba(99,102,241,0.4);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}
.lz-table th:hover { color: #fff; }
.lz-table td {
    padding: 3px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    max-width: 350px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(255,255,255,0.8);
}
.lz-table tbody tr { transition: background 0.1s; }
.lz-table tbody tr:hover { background: rgba(255,255,255,0.06); }
.lz-table tbody tr.sel { background: rgba(99,102,241,0.15); }
.lz-table tbody tr.no-chg { opacity: 0.35; }
.lz-table tbody tr.done { border-left: 2px solid #22c55e; opacity: 0.5; }
.lz-table tbody tr.err { border-left: 2px solid #ef4444; }
.lz-table tbody tr.bad { background: rgba(239,68,68,0.08); border-left: 3px solid #ef4444; }
.lz-table tbody tr.bad td { color: rgba(239,68,68,0.7); }
.lz-table input[type="checkbox"] { width: 12px; height: 12px; accent-color: #6366f1; cursor: pointer; }

/* Diff */
.d-old { color: #f87171; text-decoration: line-through; font-size: 10px; }
.d-new { color: #4ade80; }
.d-same { color: rgba(255,255,255,0.7); }
.d-empty { color: rgba(255,255,255,0.25); font-style: italic; }

/* Meta row expandida */
.lz-table tr.meta-row { background: rgba(0,0,0,0.25); }
.lz-table tr.meta-row td {
    padding: 1px 5px 2px 28px;
    font-size: 10px;
    color: rgba(255,255,255,0.35);
}
.meta-lbl { color: rgba(255,255,255,0.2); font-size: 9px; margin-right: 3px; }

/* Editable inline */
.edt { cursor: text; padding: 0 2px; border-radius: 2px; }
.edt:hover { background: rgba(255,255,255,0.05); }
.edt input {
    background: #16161f;
    border: 1px solid #6366f1;
    color: #fff;
    font-size: 11px;
    padding: 0 3px;
    border-radius: 2px;
    width: 100%;
    outline: none;
}

/* Botones */
.btn-s {
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 500;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.btn-s svg { width: 12px; height: 12px; }
.btn-p { background: #6366f1; color: #fff; }
.btn-p:hover { background: #4f46e5; }
.btn-p:disabled { background: #333; color: #555; cursor: not-allowed; }
.btn-g { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.6); }
.btn-g:hover { background: rgba(255,255,255,0.12); color: #fff; }
.btn-danger { background: rgba(239,68,68,0.15); color: #ef4444; }
.btn-danger:hover { background: rgba(239,68,68,0.25); }

/* Action bar inferior */
.lz-actionbar {
    background: #0d0d14;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 3px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    height: 30px;
    font-size: 11px;
}
.lz-actionbar .info { color: rgba(255,255,255,0.35); font-size: 10px; }
.lz-actionbar .info b { color: rgba(255,255,255,0.6); }

/* Stats badges */
.st { padding: 1px 5px; border-radius: 2px; font-size: 9px; font-weight: 600; background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.4); }
.st.hi { background: rgba(99,102,241,0.15); color: #818cf8; }
.st.ok { background: rgba(34,197,94,0.15); color: #22c55e; }
.st.er { background: rgba(239,68,68,0.15); color: #ef4444; }

/* Spinner */
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(255,255,255,0.1); border-top-color: #6366f1; border-radius: 50%; animation: sp 0.5s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* Empty state */
.lz-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255,255,255,0.5);
    gap: 10px;
    font-size: 15px;
    font-weight: 500;
}
.lz-empty svg { width: 48px; height: 48px; opacity: 0.4; }

/* Tab panels */
.lz-panel { display: none; flex: 1; overflow: hidden; flex-direction: column; }
.lz-panel.active { display: flex; }
