/* CHACON ONE - Estilos principales */
:root {
    --primary: #1a56db;
    --primary-dark: #1e429f;
    --secondary: #6b7280;
    --success: #057a55;
    --danger: #e02424;
    --warning: #c27803;
    --bg: #f9fafb;
    --sidebar-bg: #1e2a3a;
    --sidebar-text: #d1d5db;
    --sidebar-active: #1a56db;
    --card-bg: #ffffff;
    --border: #e5e7eb;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; max-width: 100%; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; background: var(--bg); color: #111827; }

/* LAYOUT */
.app-wrapper { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: var(--sidebar-bg); color: var(--sidebar-text); flex-shrink: 0; display: flex; flex-direction: column; position: fixed; height: 100vh; overflow-y: auto; z-index: 100; }
.main-content { margin-left: 260px; flex: 1; padding: 0; max-width: 100%; }

/* SIDEBAR */
.sidebar-logo { padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-logo h1 { color: #fff; font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.sidebar-logo span { color: var(--primary); }
.sidebar-nav { padding: 16px 0; flex: 1; }
.sidebar-section { padding: 8px 20px 4px; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #6b7280; font-weight: 600; }
.sidebar-link { display: flex; align-items: center; gap: 12px; padding: 10px 20px; color: var(--sidebar-text); text-decoration: none; font-size: 14px; transition: all 0.2s; border-left: 3px solid transparent; }
.sidebar-link:hover, .sidebar-link.active { background: rgba(26,86,219,0.15); color: #fff; border-left-color: var(--primary); }
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-user { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 13px; }
.sidebar-user strong { color: #fff; display: block; }

/* TOP BAR */
.topbar { background: #fff; border-bottom: 1px solid var(--border); padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.topbar-title { font-size: 18px; font-weight: 600; color: #111827; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

/* CONTENT */
.page-content { padding: 24px; }

/* CARDS */
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.card-title { font-size: 16px; font-weight: 600; color: #111827; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: #111827; }
.stat-card .stat-label { font-size: 13px; color: #6b7280; margin-top: 4px; }
.stat-card .stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; border: none; text-decoration: none; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #f3f4f6; color: #374151; border: 1px solid var(--border); }
.btn-secondary:hover { background: #e5e7eb; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 6px; }
.form-control { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; color: #111827; background: #fff; transition: border-color 0.2s; outline: none; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,0.1); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

/* TABLES */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th { background: #f9fafb; padding: 10px 14px; text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: #6b7280; border-bottom: 1px solid var(--border); }
tbody td { padding: 12px 14px; border-bottom: 1px solid #f3f4f6; color: #374151; }
tbody tr:hover { background: #f9fafb; }

/* BADGES */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: #f3f4f6; color: #374151; }

/* ALERTS */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* LOGIN */
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e2a3a 0%, #1a56db 100%); }
.login-card { background: #fff; border-radius: 16px; padding: 40px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo h1 { font-size: 28px; font-weight: 800; color: #1e2a3a; }
.login-logo h1 span { color: var(--primary); }
.login-logo p { color: #6b7280; font-size: 14px; margin-top: 4px; }

/* SEARCH */
.search-bar { display: flex; gap: 8px; margin-bottom: 20px; }
.search-bar .form-control { flex: 1; }

/* PAGINATION */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 20px; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; color: #374151; text-decoration: none; }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Fix iconos sidebar */
.sidebar-link svg,
.sidebar-link svg path {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    min-height: 18px;
    max-width: 18px;
    max-height: 18px;
}
.stat-card .stat-icon svg { width: 20px !important; height: 20px !important; }
.card-title svg { width: 18px !important; height: 18px !important; }

/* RESPONSIVE - Tablet y móvil */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
}

@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .page-content { padding: 12px; }
    .card { padding: 14px; }
    .topbar { padding: 0 12px; }
    .topbar-title { font-size: 15px; }
    .form-row { grid-template-columns: 1fr; }
}