/* ============================================
   STYLES GLOBAUX DU PANEL SAAS
   (Anciennement "CSS collé")
   ============================================ */

.admin-saas-container {
    padding: 20px;
    max-width: 100%;
    background: #f9fafb;
    border-radius: 8px;
}

.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.admin-header h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
}

.admin-header .admin-info {
    opacity: 0.9;
    font-size: 14px;
}

.admin-header .admin-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.admin-tabs button {
    padding: 12px 24px;
    background: white;
    color: #4b5563;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-tabs button:hover {
    background: #f3f4f6;
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.admin-tabs button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.admin-tab {
    display: none;
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.admin-tab.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.admin-tab h2 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #1f2937;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

/* Tableaux */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 14px;
}

.admin-table thead {
    background: #f9fafb;
}

.admin-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.admin-table tbody tr:hover {
    background: #f9fafb;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-trial { background: #fef3c7; color: #92400e; }
.badge-paid { background: #d1fae5; color: #065f46; }
.badge-expired { background: #fee2e2; color: #991b1b; }
.badge-none { background: #e5e7eb; color: #6b7280; }
.badge-admin { background: #dbeafe; color: #1e40af; }
.badge-user { background: #f3e8ff; color: #6b21a8; }

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-card.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-card.orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-card.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.stat-card h3 {
    margin: 0 0 5px 0;
    font-size: 14px;
    opacity: 0.9;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    margin: 5px 0;
}

.stat-card .subtitle {
    font-size: 12px;
    opacity: 0.8;
}

/* Formulaires */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}

.form-group input,
.form-group select {
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Boutons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Messages */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.3s;
}

.pagination a:hover {
    background: #f3f4f6;
    border-color: #667eea;
    color: #667eea;
}

.pagination .current {
    background: #667eea;
    color: white;
    border-color: #667eea;
    font-weight: 600;
}

/* ============================================
   LAYOUT PRINCIPAL HARMONISÉ
   ============================================ */

/* Conteneur principal */
.ollie-layout-container {
    display: flex;
    min-height: 100vh;
    background-color: #f9fafb; /* .admin-saas-container bg */
    font-family: sans-serif;
}

/* Sidebar */
.ollie-sidebar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 16rem;
}

/* Logo dans la sidebar */
.ollie-sidebar-logo a {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    text-align: center;
    display: block;
    letter-spacing: 0.025em;
    color: white;
    text-decoration: none;
}

/* Navigation principale */
.ollie-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.ollie-sidebar-nav a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    font-weight: 700;
    transition: background-color 0.2s ease-in-out;
    color: white;
    text-decoration: none;
}

.ollie-sidebar-nav a:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* Lien de déconnexion */
.ollie-sidebar-logout a {
    display: block;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #fecaca; /* red-300 */
    transition: all 0.2s ease-in-out;
    text-decoration: none;
}

.ollie-sidebar-logout a:hover {
    background-color: #dc2626; /* red-600 */
    color: white;
}

/* Zone de contenu principale */
.ollie-main-content {
    flex: 1;
    padding: 2.5rem;
    overflow-y: auto;
}

.ollie-main-content-wrapper {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* ============================================
   RÉGLAGES RESPONSIVES
   ============================================ */

@media (max-width: 768px) {
    /* Layout principal */
    .ollie-layout-container {
        flex-direction: column;
    }
    .ollie-sidebar {
        width: 100%;
    }
    .ollie-main-content {
        padding: 1.5rem;
    }

    /* Panel Admin */
    .admin-tabs {
        flex-direction: column;
    }
    
    .admin-tabs button {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-table {
        display: block;
        overflow-x: auto;
    }
}