@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* =========================================
   1. VARIABLES Y TEMA
   ========================================= */
:root {
    --bg-body: #000000;
    --bg-sidebar: #18181b;
    --bg-card: #111111;
    --bg-row: #18181b;
    --bg-input: #111111;
    --text-white: #ffffff;
    --text-muted: #888888;
    --border-color: #333333;
    --accent-blue: #0d6efd;
    --navbar-bg: rgba(0, 0, 0, 0.95);
    --badge-border: #444;
}

body.light-mode {
    --bg-body: #f4f6f9;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-row: #f8f9fa;
    --bg-input: #f1f3f5;
    --text-white: #333333;
    --text-muted: #666666;
    --border-color: #e0e0e0;
    --navbar-bg: rgba(255, 255, 255, 0.95);
    --badge-border: #ccc;
}

* { box-sizing: border-box; }

body { 
    background-color: var(--bg-body) !important; 
    color: var(--text-white) !important;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    margin: 0;
    overflow: hidden; 
}

#wrapper { display: flex; width: 100%; height: 100vh; padding: 10px; gap: 10px; box-sizing: border-box; }

/* =========================================
   2. SIDEBAR
   ========================================= */
#sidebar-wrapper {
    width: 260px; flex-shrink: 0; background-color: var(--bg-sidebar);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); border: none; border-radius: 20px;
    display: flex; flex-direction: column; padding-top: 20px; height: 100%;
}

.sidebar-brand { padding: 0 25px 20px; display: flex; align-items: center; }
.logo { max-width: 160px; height: auto; display: block; }
.logo-light { display: none; }
body.light-mode .logo-dark { display: none; }
body.light-mode .logo-light { display: block; }

.list-group-item { padding: 12px 25px; color: var(--text-muted); text-decoration: none; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-weight: 500; font-size: 0.9rem; }
.list-group-item:hover { color: var(--text-white); background: rgba(125,125,125,0.1); }
.list-group-item.active-menu { color: var(--text-white); position: relative; }
.list-group-item.active-menu::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; background: var(--accent-blue); border-radius: 0 4px 4px 0; }

.submenu { display: flex; flex-direction: column; margin-left: 37px; padding-left: 0; position: relative; margin-bottom: 10px; }
.submenu::before { content: ''; position: absolute; top: 0; bottom: 20px; left: 0; width: 1px; background-color: var(--border-color); }
.submenu a { position: relative; display: block; padding: 10px 10px 10px 25px; color: var(--text-muted); text-decoration: none; font-size: 0.85rem; transition: 0.2s; }
.submenu a::before { content: ''; position: absolute; top: 0; left: 0; width: 15px; height: 50%; border-bottom: 1px solid var(--border-color); border-left: 1px solid var(--border-color); border-bottom-left-radius: 12px; }
.submenu a.active { color: var(--accent-blue); font-weight: 600; }
.submenu a.active::before { border-color: var(--accent-blue); border-width: 2px; }

.sidebar-footer { margin-top: auto; padding: 20px 25px; display: flex; gap: 20px; align-items: center; }
.footer-icon { color: var(--text-muted); font-size: 1.1rem; cursor: pointer; }
.footer-icon:hover { color: var(--text-white); }

/* =========================================
   3. NAVBAR
   ========================================= */
#page-content-wrapper { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }
#menu-toggle { display: none !important; }

.navbar-fixed { flex-shrink: 0; height: 60px; padding: 0 25px; background-color: var(--navbar-bg); backdrop-filter: blur(10px); border-bottom: none; display: flex; align-items: center; justify-content: space-between; z-index: 50; }
.search-input { background: var(--bg-input) !important; border: 1px solid var(--border-color) !important; color: var(--text-white) !important; padding: 6px 15px; border-radius: 6px; width: 280px; outline: none; font-size: 0.9rem; }
.content-scroll { flex-grow: 1; overflow-y: auto; padding: 20px 25px 50px; }

/* =========================================
   4. OTROS COMPONENTES
   ========================================= */
.stat-card { background: var(--bg-card); border-radius: 10px; padding: 20px; display: flex; align-items: center; height: 100%; }
.stat-card h6 { margin: 0; color: var(--text-white) !important; font-weight: 600; font-size: 0.95rem; }

/* =========================================
   5. PESTAÑAS (CHROME TABS)
   ========================================= */
.tabs-header {
    display: flex; justify-content: space-between; align-items: flex-end;
    border-bottom: 1px solid var(--border-color); padding: 0 5px;
    margin-bottom: 20px; /* Separación con la nueva tarjeta */
}
.tabs-nav { display: flex; gap: 6px; margin-bottom: -1px; position: relative; z-index: 10; }
.tab-link { 
    padding: 10px 20px; border-top-left-radius: 12px; border-top-right-radius: 12px; border-bottom-left-radius: 0; border-bottom-right-radius: 0;
    text-decoration: none; color: var(--text-muted); border: 1px solid transparent; border-bottom: none;
    display: flex; align-items: center; gap: 8px; font-size: 0.9rem; transition: 0.2s; font-weight: 500;
}
.tab-link:hover { color: var(--text-white); background-color: rgba(255, 255, 255, 0.05); }
.tab-link.active { background-color: #27272a; border: 1px solid var(--border-color); border-bottom: 1px solid #27272a; color: var(--text-white); z-index: 20; }
.badge-num { background: #3f3f46; padding: 2px 7px; border-radius: 6px; font-size: 0.75rem; color: #fff; }
.btn-location { background-color: #f97316; border: none; border-radius: 6px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; color: white; cursor: pointer; margin-bottom: 8px; }
.btn-location:hover { background-color: #ea580c; }

/* =========================================
   6. CAJA DE FILTROS E INFO (NUEVA)
   ========================================= */
.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px; /* Separación con la tabla */
}

/* Fila de botones de filtro */
.filters-row {
    display: flex; gap: 10px; flex-wrap: wrap;
    padding-bottom: 15px; 
    border-bottom: 1px solid var(--border-color); /* Línea divisoria interna */
    margin-bottom: 15px;
}

.btn-filter-tag {
    background-color: transparent; 
    border: 1px solid #3f3f46; 
    color: #a1a1aa;
    padding: 6px 14px; 
    border-radius: 8px; 
    font-size: 0.85rem; 
    font-weight: 500;
    text-decoration: none; 
    display: flex; align-items: center; gap: 5px; 
    transition: all 0.2s;
}
.btn-filter-tag:hover { border-color: #71717a; color: #fff; background-color: rgba(255, 255, 255, 0.05); }
.btn-filter-tag.active { background-color: #27272a; border-color: #d4d4d8; color: #fff; }

/* Fila de Info (Cantidad y Tiempo) */
.info-footer-row {
    display: flex; justify-content: space-between; align-items: center;
}
.info-text { font-size: 0.9rem; color: var(--text-white); }

/* =========================================
   7. CAJA DE LA TABLA (SEPARADA)
   ========================================= */
.table-container { 
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; 
    padding: 20px; overflow-x: auto; margin-top: 0; 
}

.custom-table { width: 100%; border-collapse: separate !important; border-spacing: 0 5px !important; table-layout: fixed !important; }
.custom-table th { background: transparent; color: var(--text-muted); padding: 8px 12px; text-align: left; font-size: 0.7rem; text-transform: uppercase; border: none; white-space: nowrap; letter-spacing: 0.5px; }
.custom-table td { background-color: var(--bg-row); border-top: 1px solid #2a2a2a; border-bottom: 1px solid #2a2a2a; color: var(--text-white) !important; vertical-align: middle; font-size: 0.85rem; padding: 10px 12px !important; white-space: normal; word-break: break-word; }
.custom-table td:first-child { border-left: 1px solid #2a2a2a; border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.custom-table td:last-child { border-right: 1px solid #2a2a2a; border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
.custom-table tbody tr:hover td { filter: brightness(95%); }

/* ANCHOS */
.custom-table th:nth-child(1), .custom-table td:nth-child(1) { width: 80px; white-space: nowrap; }
.custom-table th:nth-child(2), .custom-table td:nth-child(2) { width: 90px; }
.custom-table th:nth-child(3), .custom-table td:nth-child(3) { width: 140px; text-align: left; }
.custom-table th:nth-child(4), .custom-table td:nth-child(4) { width: auto; text-align: left; } /* Flexible */
.custom-table th:nth-child(5), .custom-table td:nth-child(5) { width: 170px; white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; }
.custom-table td:nth-child(6) i, .custom-table td:nth-child(6) svg { display: none !important; }
.custom-table th:nth-child(6), .custom-table td:nth-child(6) { width: 110px; }
.custom-table th:nth-child(7), .custom-table td:nth-child(7) { width: 90px; font-weight: 600; }
.custom-table th:nth-child(8), .custom-table td:nth-child(8) { width: 120px; text-align: right; }

/* BADGES */
.badge-status { background: var(--bg-input); border: 1px solid var(--badge-border); color: var(--text-white); padding: 3px 10px; border-radius: 20px; font-size: 0.7rem; display: inline-block; width: auto; max-width: 100%; white-space: normal; line-height: 1.2; text-align: center; }
.badge-prio { padding: 3px 8px; border-radius: 20px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; display: inline-block; border: 1px solid transparent; text-align: center; min-width: 60px; }
.prio-baja { background: rgba(13, 202, 240, 0.1); color: #0dcaf0; border-color: rgba(13, 202, 240, 0.3); }
.prio-normal { background: rgba(125, 125, 125, 0.15); color: var(--text-muted); border-color: var(--border-color); }
.prio-alta { background: rgba(255, 193, 7, 0.1); color: #ffc107; border-color: rgba(255, 193, 7, 0.3); }
.prio-urgente { background: rgba(220, 53, 69, 0.15); color: #ff6b6b; border-color: rgba(220, 53, 69, 0.4); }

.btn-action { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 1px solid var(--border-color); color: var(--text-muted); border-radius: 5px; cursor: pointer; margin-left: 3px; font-size: 0.9rem; }
.btn-action:hover { border-color: #666; color: var(--text-white); background: rgba(125,125,125,0.2); }

/* TOOLBAR Y TITULO TABLA */
.table-toolbar { padding: 0 0 15px 0; border-bottom: none; display: flex; justify-content: space-between; align-items: center; background-color: transparent; min-height: auto; gap: 15px; }
.table-title { margin: 0; font-size: 1.1rem; font-weight: 600; color: var(--text-white); } /* Nuevo estilo para el título */

.search-tabla-gestioo { background-color: var(--bg-input) !important; border: 1px solid var(--border-color) !important; color: var(--text-white) !important; padding: 5px 12px; border-radius: 6px; width: 240px; height: 32px; outline: none; transition: border-color 0.2s; font-size: 0.85rem; }
.search-tabla-gestioo:focus { border-color: var(--accent-blue) !important; }

/* MÓVIL */
@media (max-width: 768px) {
    #menu-toggle { display: flex !important; align-items: center; justify-content: center; width: 40px; height: 40px; background: transparent; border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-white); margin-right: 15px; cursor: pointer; }
    #sidebar-wrapper { position: fixed; left: -290px; top: 0; height: 100vh; width: 280px; z-index: 2000; border-right: none; border-radius: 0; box-shadow: 5px 0 20px rgba(0,0,0,0.5); }
    body.sidebar-open #sidebar-wrapper { left: 0; }
    .search-input { display: none; }
    .navbar-fixed span { display: none; } 
    .table-container { overflow-x: auto; }
    .custom-table { min-width: 800px; }
}

/* PAGINACIÓN */
.pagination-container { display: flex; justify-content: flex-end; gap: 5px; padding-top: 15px; }
.page-btn { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; background-color: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-muted); border-radius: 6px; text-decoration: none; font-size: 0.8rem; transition: 0.2s; }
.page-btn:hover { background-color: var(--bg-input); color: var(--text-white); border-color: #666; }
.page-btn.active { background-color: var(--accent-blue); border-color: var(--accent-blue); color: #fff; font-weight: 600; }

/* SCROLLBAR */
::-webkit-scrollbar{width:8px;height:8px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:#444;border-radius:10px}
body.light-mode ::-webkit-scrollbar-thumb{background:#8a8a8a}