/* Shop21 Corporate Panel - Variables */
:root {
    --shop-purple: #5D2A8C;  /* Shop21 Purple */
    --shop-orange: #FF7F27;  /* Shop21 Orange */
    --tepuy-blue: #0088CC;   /* Tepuy21 Blue */
    --shop-purple-dark: #4a2170; /* Darker purple for hover states */
    --shop-purple-light: #7a4ba0; /* Lighter purple */
    
    /* Updated color scheme based on Shop21 */
    --primary-color: var(--shop-purple);
    --secondary-color: var(--shop-purple-light);
    --accent-color: var(--shop-orange);
    --success-color: #10b981;
    --warning-color: var(--shop-orange);
    --danger-color: #ef4444;
    --dark-color: #1f2937;
    --light-color: #f8fafc;
    --sidebar-width: 280px;
}

body {
    font-family: "Cal Sans", -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--light-color);
    font-style: normal;
}

/* Sidebar Styles - Shop21 Theme */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(135deg, var(--shop-purple) 0%, var(--shop-purple-dark) 100%);
    color: white;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-y: auto;
    box-shadow: 4px 0 15px rgba(93, 42, 140, 0.15);
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.sidebar-brand::before {
    content: "🛍️";
    margin-right: 0.5rem;
    font-size: 1.8rem;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    margin: 0.25rem 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    background: linear-gradient(90deg, var(--shop-orange), rgba(255, 127, 39, 0.8));
    color: white;
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(255, 127, 39, 0.3);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--shop-orange);
}

.nav-link i {
    width: 20px;
    margin-right: 0.75rem;
    text-align: center;
    font-size: 1.1rem;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    transition: all 0.3s ease;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.main-content.expanded {
    margin-left: 70px;
}

/* Header - Shop21 Style */
.main-header {
    background: linear-gradient(135deg, white 0%, #f8fafc 100%);
    padding: 1rem 2rem;
    box-shadow: 0 4px 12px rgba(93, 42, 140, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--shop-orange);
}

.toggle-sidebar {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--shop-purple);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.toggle-sidebar:hover {
    background: rgba(93, 42, 140, 0.1);
    color: var(--shop-purple-dark);
}

/* Cards - Shop21 Enhanced */
.stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 25px rgba(93, 42, 140, 0.08);
    border: 1px solid rgba(93, 42, 140, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--shop-purple), var(--shop-orange));
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(93, 42, 140, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 1rem;
}

.stat-icon.primary { 
    background: linear-gradient(135deg, var(--shop-purple), var(--shop-purple-dark));
}
.stat-icon.success { 
    background: linear-gradient(135deg, var(--success-color), #059669);
}
.stat-icon.warning { 
    background: linear-gradient(135deg, var(--shop-orange), #ea580c);
}
.stat-icon.danger { 
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
}

/* Tables - Shop21 Style */
.table-container {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(93, 42, 140, 0.08);
    border: 1px solid rgba(93, 42, 140, 0.1);
}

.table thead th {
    background: linear-gradient(135deg, var(--shop-purple), var(--shop-purple-light));
    border: none;
    font-weight: 600;
    color: white;
    padding: 1rem;
    font-family: "Cal Sans", sans-serif;
}

.table tbody tr:hover {
    background-color: rgba(93, 42, 140, 0.05);
}

/* Badges - Shop21 Colors */
.badge-status {
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: "Cal Sans", sans-serif;
}

.badge-active { 
    background: linear-gradient(135deg, #dcfce7, #bbf7d0); 
    color: #166534; 
    border: 1px solid #22c55e;
}
.badge-inactive { 
    background: linear-gradient(135deg, #fee2e2, #fecaca); 
    color: #991b1b; 
    border: 1px solid #ef4444;
}
.badge-pending { 
    background: linear-gradient(135deg, #fff7ed, #fed7aa); 
    color: #92400e; 
    border: 1px solid var(--shop-orange);
}
.badge-paid { 
    background: linear-gradient(135deg, #ede9fe, #ddd6fe); 
    color: var(--shop-purple-dark); 
    border: 1px solid var(--shop-purple);
}

/* Buttons - Shop21 Style */
.btn-primary {
    background: linear-gradient(135deg, var(--shop-purple), var(--shop-purple-dark));
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-family: "Cal Sans", sans-serif;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--shop-purple-dark), #3d1a5c);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(93, 42, 140, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, var(--shop-orange), #ea580c);
    border: none;
    border-radius: 12px;
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .main-header {
        padding: 1rem;
    }
}

/* Login Page Styles - Shop21 Theme */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--shop-purple) 0%, var(--shop-purple-dark) 50%, var(--shop-orange) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 25px 50px rgba(93, 42, 140, 0.2);
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo i {
    font-size: 3rem;
    color: var(--shop-purple);
    margin-bottom: 1rem;
}

.login-logo h2 {
    color: var(--shop-purple);
    font-family: "Cal Sans", sans-serif;
    font-weight: 700;
    margin: 0;
}

/* Chart Container - Shop21 Style */
.chart-container {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 25px rgba(93, 42, 140, 0.08);
    border: 1px solid rgba(93, 42, 140, 0.1);
    position: relative;
    overflow: hidden;
    height: auto; /* Cambiado para permitir contenido dinámico */
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--shop-purple), var(--shop-orange));
}

/* Contenedores específicos para gráficos */
.chart-container canvas {
    max-height: 400px !important;
    width: 100% !important;
}

/* Contenedor específico para gráfico de pagos */
.payments-chart-container {
    height: 400px;
}

/* Contenedor específico para gráfico de estado */
.status-chart-container {
    height: 400px;
}

/* Contenedor específico para gráfico de planes */
.plan-chart-container {
    height: 300px;
}

/* Prevenir desbordamiento en tablas dentro de chart-container */
.chart-container .table-responsive {
    max-height: 300px;
    overflow-y: auto;
}

/* Asegurar que los canvas no se expandan infinitamente */
canvas {
    max-width: 100% !important;
    height: auto !important;
}

.text-shop {
    color: var(--shop-purple) !important;
}

.text-orange {
    color: var(--shop-orange) !important;
}

.bg-shop {
    background: linear-gradient(135deg, var(--shop-purple), var(--shop-purple-dark)) !important;
}

.bg-shop-light {
    background: rgba(93, 42, 140, 0.1) !important;
}

/* Page Title Styling */
.page-title {
    color: var(--shop-purple);
    font-family: "Cal Sans", sans-serif;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--shop-purple), var(--shop-orange));
    border-radius: 2px;
}

/* Enhanced Form Controls */
.form-control:focus {
    border-color: var(--shop-purple);
    box-shadow: 0 0 0 0.2rem rgba(93, 42, 140, 0.25);
}

.form-select:focus {
    border-color: var(--shop-purple);
    box-shadow: 0 0 0 0.2rem rgba(93, 42, 140, 0.25);
}

/* Loading Animation */
.loading-spinner {
    border: 3px solid rgba(93, 42, 140, 0.3);
    border-top: 3px solid var(--shop-purple);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Payment Status Badges */
.badge-paid {
    background-color: #28a745;
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-pending {
    background-color: #ffc107;
    color: #212529;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-reversed {
    background-color: #dc3545;
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}