/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff;
}

/* Variables couleurs - Charte Workeez Noir & Blanc */
:root {
    --primary-black: #000000;
    --secondary-gray: #333333;
    --black: #000000;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --border-gray: #dee2e6;
    --text-gray: #6c757d;
    --dark-gray: #666666;
}

/* Header */
.header {
    background-color: var(--white);
    border-bottom: 3px solid var(--primary-black);
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo img {
    width: 40px;
    height: 40px;
}

.logo h1 {
    color: var(--primary-black);
    font-size: 1.8rem;
    font-weight: bold;
}

.user-info {
    color: var(--black);
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Navigation */
.navbar {
    background-color: var(--light-gray);
    border-bottom: 1px solid var(--border-gray);
    padding: 0.5rem 0;
    position: relative;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--black);
    cursor: pointer;
    padding: 0.5rem;
}

.navbar ul {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.navbar a {
    text-decoration: none;
    color: var(--black);
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
}

.navbar a:hover,
.navbar a.active {
    background-color: var(--primary-black);
    color: var(--white);
}

/* Responsive navbar */
@media (max-width: 1024px) {
    .navbar ul {
        gap: 0.3rem;
    }
    
    .navbar a {
        padding: 0.4rem 0.5rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .navbar-toggle {
        display: block;
    }
    
    .navbar ul {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--light-gray);
        border-top: 1px solid var(--border-gray);
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 1rem;
        display: none;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        z-index: 1000;
    }
    
    .navbar ul.show {
        display: flex;
    }
    
    .navbar a {
        display: block;
        padding: 0.8rem 0.5rem;
        border-bottom: 1px solid var(--border-gray);
        margin: 0;
        white-space: normal;
    }
    
    .navbar li:last-child a {
        border-bottom: none;
    }
}

@media (max-width: 480px) {
    .navbar a {
        font-size: 0.8rem;
        padding: 0.3rem 0.4rem;
    }
}

/* Responsive header */
@media (max-width: 768px) {
    .header {
        padding: 0.8rem 0;
    }
    
    .header-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .user-info {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0.5rem 0;
    }
    
    .logo {
        gap: 10px;
    }
    
    .logo img {
        width: 32px;
        height: 32px;
    }
    
    .logo h1 {
        font-size: 1.3rem;
    }
    
    .user-info {
        font-size: 0.8rem;
    }
    
    .user-info .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Container principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Cartes */
.card {
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-header {
    border-bottom: 2px solid var(--primary-black);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-title {
    color: var(--black);
    font-size: 1.5rem;
    font-weight: bold;
}

/* Stats dashboard - Design compact */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-left: 3px solid var(--primary-black);
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card:hover {
    border-left-color: var(--primary-black);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.stat-card.stat-success {
    border-left-color: #28a745;
}

.stat-card.stat-info {
    border-left-color: #17a2b8;
}

.stat-card.stat-warning {
    border-left-color: #ffc107;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-black);
    margin-bottom: 0.3rem;
    line-height: 1;
}

.stat-card.stat-success .stat-number {
    color: #28a745;
}

.stat-card.stat-info .stat-number {
    color: #17a2b8;
}

.stat-card.stat-warning .stat-number {
    color: #ffc107;
}

.stat-label {
    color: var(--text-gray);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.stat-description {
    color: var(--text-gray);
    font-size: 0.7rem;
    margin-top: 0.2rem;
    opacity: 0.8;
}

/* Quotas compacts */
.quota-stat {
    border-left-color: #6f42c1;
}

.quota-stat .stat-number {
    color: #6f42c1;
}

/* Animations pour les nombres */


/* Responsive pour les stats */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.8rem;
    }
    
    .stat-card {
        padding: 0.8rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    .stat-description {
        font-size: 0.65rem;
    }
}

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

/* Formulaires */
.form {
    background: var(--white);
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--black);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control, 
input[type="text"], 
input[type="email"], 
input[type="password"], 
textarea, 
select {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-gray);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background-color: var(--white);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus, 
input[type="text"]:focus, 
input[type="email"]:focus, 
input[type="password"]:focus, 
textarea:focus, 
select:focus {
    outline: none;
    border-color: var(--primary-black);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
    background-color: #fafafa;
}

.form-control:hover, 
input[type="text"]:hover, 
input[type="email"]:hover, 
input[type="password"]:hover, 
textarea:hover, 
select:hover {
    border-color: #ccc;
}

.form-control.error {
    border-color: var(--primary-black);
    background-color: #fef2f2;
}

.form-control-static {
    padding: 1rem 0;
    min-height: 1.5rem;
    line-height: 1.5;
    font-weight: 500;
}

/* Actions de formulaire */
.form-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-gray);
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
}

/* Textarea spécifique */
textarea {
    resize: vertical;
    min-height: 100px;
}

/* Petits textes d'aide */
.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-gray);
    font-size: 0.85rem;
    font-style: italic;
}

/* Checkboxes et radios */
input[type="checkbox"], 
input[type="radio"] {
    width: auto;
    margin-right: 0.5rem;
    transform: scale(1.2);
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
    margin-bottom: 0.8rem;
    padding: 0.8rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.checkbox-group label:hover {
    background-color: var(--light-gray);
}

.checkbox-group input[type="checkbox"] {
    margin-right: 0.8rem;
    margin-left: 0;
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

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

.btn-primary:hover {
    background-color: var(--secondary-gray);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--text-gray);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #dc3545;
    color: var(--white);
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-info {
    background-color: #17a2b8;
    color: var(--white);
}

.btn-info:hover {
    background-color: #138496;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-success {
    background-color: #28a745;
    color: var(--white);
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-xs {
    padding: 0.5rem;
    font-size: 0.875rem;
    min-width: 32px;
    width: 32px;
    height: 32px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-xs i {
    color: inherit;
    font-size: 0.875rem;
}

.btn-group-compact {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    align-items: center;
}

.btn-group-compact .btn {
    margin: 0;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-gray);
}

.table th {
    background-color: var(--light-gray);
    font-weight: 600;
    color: var(--black);
}

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

/* Messages d'alerte */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-success {
    background-color: #d1edff;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Login form */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-gray);
}

.login-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

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

.login-logo img {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
}

.login-title {
    color: var(--primary-black);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 12px;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.badge-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.badge {
    background-color: var(--light-gray);
    color: var(--black);
    border: 1px solid var(--border-gray);
}

/* Checkbox group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.checkbox-label:hover {
    background-color: var(--light-gray);
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
}

/* Erreurs de champ */
.field-error {
    color: var(--primary-black);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    min-width: 300px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

/* Admin indicators */
.admin-indicator {
    background-color: var(--primary-black);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

/* Entity stats */
.entity-stats {
    display: flex;
    gap: 15px;
    margin: 10px 0;
}

.entity-stat {
    text-align: center;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    min-width: 80px;
}

.entity-stat .number {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-black);
}

.entity-stat .label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

/* User entity badges */
.user-entities {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* Responsive entity stats */
@media (max-width: 768px) {
    .entity-stats {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .entity-stat {
        min-width: 60px;
        padding: 8px;
    }
    
    /* Formulaires responsive */
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .form-actions .btn {
        width: 100%;
        text-align: center;
    }
}

/* Utilitaires */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-gray { color: var(--text-gray); }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }

/* Styles pour les boutons d'actions */
.action-buttons {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 14px;
    color: white;
}

.btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Fallback pour les icônes si Font Awesome ne charge pas */
.btn-action i {
    font-size: 14px;
}

/* Symboles de fallback en cas d'échec du chargement des icônes */
.btn-action .fa-user-cog:empty::before {
    content: "⚙";
    font-family: Arial, sans-serif;
    font-weight: bold;
}

.btn-action .fa-eye:empty::before {
    content: "👁";
    font-family: Arial, sans-serif;
}

.btn-action .fa-edit:empty::before {
    content: "✏";
    font-family: Arial, sans-serif;
}

.btn-action .fa-pause:empty::before {
    content: "⏸";
    font-family: Arial, sans-serif;
}

.btn-action .fa-play:empty::before {
    content: "▶";
    font-family: Arial, sans-serif;
}

.btn-action .fa-trash:empty::before {
    content: "🗑";
    font-family: Arial, sans-serif;
}

.btn-action .fa-user-shield:empty::before {
    content: "🛡";
    font-family: Arial, sans-serif;
}

.btn-action .fa-user-minus:empty::before {
    content: "👤";
    font-family: Arial, sans-serif;
}

/* Templates de signature */
.signature-templates {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: 6px;
    border: 1px solid var(--border-gray);
}

.signature-templates .btn {
    font-size: 0.85rem;
    padding: 0.5rem 0.8rem;
    white-space: nowrap;
}

.signature-templates .btn i {
    margin-right: 0.3rem;
}

@media (max-width: 768px) {
    .signature-templates {
        flex-direction: column;
    }
    
    .signature-templates .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Templates de newsletter */
.newsletter-templates {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: 6px;
    border: 1px solid var(--border-gray);
}

.newsletter-templates .btn {
    font-size: 0.8rem;
    padding: 0.5rem 0.8rem;
}

.newsletter-templates .btn i {
    margin-right: 0.3rem;
}

@media (max-width: 768px) {
    .newsletter-templates {
        flex-direction: column;
    }
    
    .newsletter-templates .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Styles pour les quotas */
.quota-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.quota-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.quota-header {
    font-weight: bold;
    color: #000;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quota-bar {
    background: #e9ecef;
    height: 8px;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.quota-progress {
    height: 100%;
    background: var(--primary-black);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.quota-text {
    font-size: 0.8rem;
    color: #6c757d;
    text-align: center;
}

.quota-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.quota-status.ok {
    background: #d4edda;
    color: #155724;
}

.quota-status.warning {
    background: #fff3cd;
    color: #856404;
}

.quota-status.danger {
    background: #f8d7da;
    color: #721c24;
}

/* Logs du cron */
.cron-logs {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
}

.cron-logs pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.log-line {
    margin-bottom: 0.25rem;
    padding: 0.25rem;
    border-radius: 3px;
}

.log-line.error {
    background: #f8d7da;
    color: #721c24;
}

.log-line.success {
    background: #d4edda;
    color: #155724;
}

.log-line.info {
    background: #d1ecf1;
    color: #0c5460;
}

@media (max-width: 768px) {
    .quota-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .quota-item {
        padding: 0.75rem;
    }
}

/* Barre d'impersonnification */
.impersonation-banner {
    background: linear-gradient(135deg, #ffc107, #ff8800);
    color: #000;
    padding: 0.75rem 0;
    border-bottom: 2px solid #e0a800;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.impersonation-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.impersonation-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.impersonation-info i {
    font-size: 1.2rem;
    color: #000;
}

.impersonation-info small {
    color: #6c5500;
    font-style: italic;
}

.impersonation-banner .btn {
    background: rgba(0,0,0,0.8);
    color: #fff;
    border: none;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
}

.impersonation-banner .btn:hover {
    background: rgba(0,0,0,1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
    .impersonation-container {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .impersonation-info {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* Lien d'impersonnification sous le nom d'utilisateur */
.impersonate-link {
    color: #17a2b8;
    text-decoration: underline;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
    text-underline-offset: 2px;
}

.impersonate-link:hover {
    color: #138496;
    text-decoration: underline;
    text-decoration-color: #138496;
    text-decoration-thickness: 2px;
}

.impersonate-link i {
    font-size: 0.75rem;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .impersonate-link {
        font-size: 0.75rem;
        gap: 0.25rem;
    }
    
    .impersonate-link i {
        font-size: 0.7rem;
    }
} 