/**
 * public/css/style.css
 * Estilos globales de AMIRA
 */

/* ==========================================
   VARIABLES CSS
   ========================================== */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --sidebar-color-start: #2C5A8F;
    --sidebar-color-end: #1E4470;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --texto-inactivo-color: #6c757d;
    --light-color: #f3f4f6;
    --dark-color: #1f2937;
    --border-color: #e5e7eb;
    --text-muted: #6b7280;
    
    --sidebar-width: 260px;
    --topbar-height: 70px;
    --transition: all 0.3s ease;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   RESET Y BASE
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    color: var(--dark-color);
    background-color: var(--light-color);
    line-height: 1.6;
}

/* ==========================================
   SIDEBAR
   ========================================== */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(135deg, var(--sidebar-color-start) 0%, var(--sidebar-color-end) 100%);
    color: white;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-header .logo h2 {
    font-size: 24px;
    margin-bottom: 5px;
    font-weight: 700;
}

.sidebar-header .logo .subtitle {
    font-size: 11px;
    opacity: 0.8;
    margin: 0;
}

.sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.user-info {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-left: 10px;
    margin-right: 10px;
}

.user-avatar {
    font-size: 36px;
    margin-right: 12px;
}

.user-details {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 12px;
    opacity: 0.8;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Menú */

.nav-menu {
    list-style: none;
}

.nav-category {
    padding: 10px 20px;
    margin-top: 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.7;
    letter-spacing: 0.5px;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
    cursor: pointer;
    border-left: 3px solid transparent;
}

.nav-link i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
    font-size: 16px;
}

.nav-link:hover {
    color: white;
    background: rgba(0, 0, 0, 0.2);
    border-left-color: white;
}

.nav-link.active {
    color: white;
    background: rgba(0, 0, 0, 0.3);
    border-left-color: white;
    font-weight: 600;
}

.nav-link.dropdown-toggle::after {
    margin-left: auto;
}

.nav-link[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Pestañas nav-pills en fondo claro (ej. Carga Masiva) — NO afecta el sidebar (usa .nav-menu, no .nav-pills) */
.nav-pills .nav-link {
    color: var(--texto-inactivo-color);
}

.nav-pills .nav-link:hover {
    color: var(--texto-inactivo-color);
    background: rgba(0, 0, 0, 0.06);
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.1);
}

.logout-btn {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.logout-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================
   TOPBAR
   ========================================== */

.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--primary-color);
}

.app-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-right .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--dark-color);
    cursor: pointer;
    transition: var(--transition);
}

.topbar-right .dropdown-toggle:hover {
    background: var(--light-color);
}

/* ==========================================
   MAIN CONTENT
   ========================================== */

.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 30px;
    min-height: calc(100vh - var(--topbar-height));
}

.top-bar {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 5px 0 0 0;
}

/* ==========================================
   STAT CARDS
   ========================================== */

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin: 5px 0 0 0;
}

.bg-primary { background-color: var(--primary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }
.bg-info { background-color: var(--info-color) !important; }

/* ==========================================
   CARDS
   ========================================== */

.card {
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: var(--light-color);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-color);
}

.card-body {
    padding: 20px;
}

/* ==========================================
   ACTIVITY FEED
   ========================================== */

.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 6px;
    background: var(--light-color);
    transition: var(--transition);
}

.activity-item:hover {
    background: #e5e7eb;
}

.activity-icon {
    font-size: 24px;
    min-width: 30px;
    text-align: center;
}

.activity-content {
    flex: 1;
}

.activity-text {
    margin-bottom: 5px;
    font-size: 14px;
}

/* ==========================================
   FOOTER
   ========================================== */

.footer {
    margin-left: var(--sidebar-width);
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* ==========================================
   BOTONES
   ========================================== */

.btn {
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    font-size: 14px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: #5568d3;
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
    border: none;
}

.btn-success:hover {
    background-color: #059669;
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ==========================================
   FORMS
   ========================================== */

.form-control {
    border-radius: 6px;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    font-size: 14px;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.1);
}

.form-label {
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--dark-color);
}

/* ==========================================
   TABLAS
   ========================================== */

.table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table thead {
    background: var(--light-color);
}

.table th {
    font-weight: 600;
    color: var(--dark-color);
    border: none;
    padding: 12px;
}

.table td {
    padding: 12px;
    border-color: var(--border-color);
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--light-color);
}

/* ==========================================
   ALERTAS
   ========================================== */

.alert {
    border-radius: 6px;
    border: none;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.alert-danger {
    background: #fee2e2;
    color: #7f1d1d;
}

.alert-warning {
    background: #fef3c7;
    color: #78350f;
}

.alert-info {
    background: #dbeafe;
    color: #0c2d6b;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: var(--transition);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .topbar {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .footer {
        margin-left: 0;
    }
    
    .page-title {
        font-size: 20px;
    }
}

/* ==========================================
   PRINT
   ========================================== */

@media print {
    .sidebar,
    .topbar,
    .footer,
    .no-print {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        margin-top: 0;
    }
}
