/* ==========================================================================
   REPORTES.CSS - Diseño Ejecutivo para Catalux Track
   ========================================================================== */

:root {
    --bg-dark: #0b0f19;
    --sidebar-bg: #111827;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --text-light: #f3f4f6;
    --accent-green: #00e676;
    --accent-hover: #00c853;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --warning: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: #f3f4f6;
    color: var(--text-main);
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.brand-logo {
    background: var(--accent-green);
    color: var(--bg-dark);
    font-weight: bold;
    font-size: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 600;
}

.brand-name span {
    color: var(--accent-green);
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #9ca3af;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-link svg {
    width: 20px;
    height: 20px;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(0, 230, 118, 0.1);
    color: var(--accent-green);
}

.sidebar-footer {
    padding: 24px 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.logout:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* --- MAIN CONTENT --- */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    max-width: 1400px;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.header-title h2 {
    font-size: 1.8rem;
    color: var(--text-main);
    margin-bottom: 4px;
}

.header-title p {
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* --- BOTONES Y FORMAS --- */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--accent-green);
    color: var(--bg-dark);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

.btn-secondary {
    background-color: #1f2937;
    color: white;
}

.btn-secondary:hover {
    background-color: #374151;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: #f9fafb;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    background-color: white;
}

/* --- FILTROS --- */
.filters-section {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 24px;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.filter-actions {
    display: flex;
    gap: 10px;
}

/* --- KPIs GRID --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.kpi-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--border-color);
    transition: transform 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.kpi-value .unit {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.kpi-value.highlight { color: var(--accent-hover); }
.kpi-value.success { color: var(--accent-hover); }
.kpi-value.warning { color: var(--warning); }

/* --- TABLA --- */
.table-section {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.table-header h3 {
    font-size: 1.1rem;
    color: var(--text-main);
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    white-space: nowrap;
}

th {
    background-color: #f9fafb;
    padding: 12px 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-main);
}

tbody tr:hover {
    background-color: #f9fafb;
}

.badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge.yes { background-color: rgba(0, 230, 118, 0.1); color: #00c853; }
.badge.no { background-color: rgba(245, 158, 11, 0.1); color: #d97706; }

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .sidebar { width: 80px; }
    .brand-name { display: none; }
    .nav-link { justify-content: center; padding: 12px; }
    .nav-link svg { margin: 0; }
    .nav-link[aria-label] { font-size: 0; }
    .main-content { margin-left: 80px; padding: 20px; }
}

@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; flex-direction: row; justify-content: space-between; align-items: center; padding: 10px; }
    .sidebar-nav { flex-direction: row; padding: 0; }
    .sidebar-footer { padding: 0; border: none; }
    .brand { border: none; padding: 0 10px; }
    .main-content { margin-left: 0; padding: 15px; }
    .top-header { flex-direction: column; align-items: flex-start; gap: 15px; }
}

/* --- IMPRESIÓN --- */
@media print {
    .sidebar, .no-print { display: none !important; }
    .main-content { margin: 0; padding: 0; max-width: 100%; }
    .app-container { display: block; }
    body { background-color: white; }
    .kpi-card, .table-section { box-shadow: none; border: 1px solid var(--border-color); }
    .kpi-card { break-inside: avoid; }
    @page { margin: 1cm; }
}
.logo {
  width: 180px;
  height: auto;
  display: block;
}
/* MENÚ LATERAL IGUAL AL RESTO DE CATALUX TRACK */

.sidebar {
    width: 260px;
    height: 100vh;
    background-color: #0b0f19;
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header a {
    text-decoration: none;
}

.sidebar-logo {
    width: 180px;
    max-width: 100%;
    height: auto;
    display: block;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav li {
    margin: 0;
    padding: 0;
}

.sidebar-nav li a {
    display: block;
    padding: 14px 24px;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border-left: 4px solid transparent;
    transition: background-color 0.2s ease;
}

.sidebar-nav li a:visited {
    color: #e5e7eb;
}

.sidebar-nav li a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.06);
}

.sidebar-nav li.active a {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
    border-left-color: #39ff14;
    font-weight: 700;
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer a {
    color: #9ca3af;
    text-decoration: none;
}

.sidebar-footer a:hover {
    color: #ffffff;
}

/* CATALUX DARK THEME — solo presentación visual */
:root { --card-bg:#111720; --text-main:#f1f5f9; --text-muted:#aeb8c6; --border-color:#34404d; }
body,.main-content { background:#070a0f; color:var(--text-main); }
.filters-section,.kpi-card,.table-section { background:#111720; border:1px solid #34404d; box-shadow:0 8px 24px rgba(0,0,0,.28); }
.header-title h2,.kpi-value,.table-header h3,td { color:#f1f5f9; }
.form-control { background:#0b1119; color:#f1f5f9; border-color:#465463; color-scheme:dark; }
th { background:#171f2a; color:#c0c8d2; }
td,.table-header { border-color:#34404d; }
tbody tr:hover,.btn-outline:hover { background:#17212c; }
.btn-outline { color:#d7dee7; border-color:#536170; }
@media screen and (max-width:768px) {
  .sidebar { display:flex; flex-direction:column; align-items:stretch; padding:0; overflow:hidden; }
  .brand { width:100%; justify-content:flex-start; padding:14px 16px; }
  .brand-logo { width:36px; height:36px; min-width:36px; flex:0 0 36px; }
  .brand-name { display:block; max-width:calc(100vw - 84px); overflow:hidden; }
  .sidebar-nav { width:100%; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; padding:8px; overflow:visible; }
  .sidebar-nav .nav-link { min-width:0; justify-content:center; padding:10px 4px; font-size:0; }
  .sidebar-nav .nav-link svg { width:22px; height:22px; min-width:22px; }
  .sidebar-footer { width:100%; padding:6px 8px 10px; border-top:1px solid rgba(255,255,255,.1); }
  .sidebar-footer .nav-link { justify-content:center; padding:9px; font-size:13px; }
  .main-content { width:100%; max-width:100%; overflow-x:hidden; }
  .top-header,.header-actions,.filter-actions { width:100%; }
  .header-actions,.filter-actions { flex-wrap:wrap; }
  .logo,.sidebar-logo,img { max-width:100%; height:auto; }
}
