/* Importar fuente moderna (Inter) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-body: #f8fafc; /* Slate 50 */
    --sidebar-bg: #0f172a; /* Slate 900 */
    --sidebar-hover: #1e293b; /* Slate 800 */
    --text-main: #0f172a;
    --text-muted: #64748b; /* Slate 500 */
    --border-color: #e2e8f0; /* Slate 200 */
    --primary: #0ea5e9; /* Sky 500 (más elegante que el azul rey) */
}

body {
    background-color: var(--bg-body);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   SIDEBAR MODERNA
   ========================================= */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar {
    min-width: 260px;
    max-width: 260px;
    background: var(--sidebar-bg);
    color: #f8fafc;
    min-height: 100vh;
    transition: all 0.3s ease;
    border-right: 1px solid #1e293b;
}

.sidebar-header {
    border-bottom: 1px solid #1e293b;
}

#sidebar ul.components {
    padding: 15px 10px;
}

#sidebar ul li a {
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    color: #94a3b8; /* Slate 400 */
    text-decoration: none;
    border-radius: 8px; /* Esquinas suaves para el hover */
    margin-bottom: 2px;
    transition: all 0.2s ease;
}

#sidebar ul li a:hover {
    color: #f8fafc;
    background: var(--sidebar-hover);
}

#sidebar ul li a.active {
    color: #f8fafc;
    background: var(--sidebar-hover);
    box-shadow: inset 3px 0 0 var(--primary); /* Indicador lateral sutil */
}

/* =========================================
   CONTENIDO PRINCIPAL Y TARJETAS
   ========================================= */
#content {
    width: 100%;
    padding: 24px 32px;
    min-height: 100vh;
}

.navbar {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05) !important;
}

/* Tarjetas Base (SaaS Style) */
.card {
    background: #ffffff;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025) !important;
}

.card-header {
    background-color: transparent !important;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

/* =========================================
   TABLAS MODERNAS
   ========================================= */
.table {
    margin-bottom: 0;
    color: var(--text-main);
}

.table thead th {
    border-bottom: 1px solid var(--border-color);
    border-top: none;
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 1rem;
    background: transparent !important;
}

.table tbody td {
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem;
    vertical-align: middle;
    font-size: 0.875rem;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Ocultar bordes verticales */
.table-bordered, .table-bordered th, .table-bordered td {
    border: none !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

/* =========================================
   BOTONES Y ETIQUETAS (BADGES)
   ========================================= */
.btn {
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover {
    background-color: #0284c7;
    border-color: #0284c7;
}

.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
    border-radius: 6px;
}

/* =========================================
   TARJETAS KPI (Estilo Minimalista)
   ========================================= */
.kpi-card {
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
}

.kpi-card.border-primary::before { background-color: #3b82f6; }
.kpi-card.border-success::before { background-color: #10b981; }
.kpi-card.border-danger::before { background-color: #ef4444; }
.kpi-card.border-secondary::before { background-color: #64748b; }

.kpi-icon-bg {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.bg-soft-primary { background-color: #eff6ff; color: #3b82f6; }
.bg-soft-success { background-color: #ecfdf5; color: #10b981; }
.bg-soft-warning { background-color: #fffbeb; color: #f59e0b; }
.bg-soft-danger  { background-color: #fef2f2; color: #ef4444; }
.bg-soft-info    { background-color: #f0f9ff; color: #0ea5e9; }
.bg-soft-secondary { background-color: #f1f5f9; color: #475569; }

/* Textos */
h1, h2, h3, h4, h5, h6 { font-weight: 600; color: var(--text-main); }
.text-muted { color: var(--text-muted) !important; }
/* =========================================
   ESTILOS ESPECÍFICOS PARA EL LOGIN
   ========================================= */
.input-group-text {
    background-color: #ffffff;
    border-color: #e2e8f0;
}
.input-group .form-control {
    border-color: #e2e8f0;
    box-shadow: none;
}
.input-group .form-control:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}
.input-group .form-control:focus + .input-group-text,
.input-group:focus-within .input-group-text {
    border-color: #0ea5e9;
}