/* ============================================
   Assistant Support IT - Styles (Mobile-First, Dark Theme)
   ============================================ */

/* Variables - Dark Theme */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-color: #f3f4f6;
    --text-muted: #9ca3af;
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --bg-tertiary: #374151;
    --border-color: #4b5563;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
    --radius: 0.5rem;
    --radius-lg: 1rem;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-secondary);
}

/* ============================================
   App Layout
   ============================================ */

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-primary);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   Header Minimal
   ============================================ */

.header-minimal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.header-logo {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
}

.logo-svg {
    color: var(--primary-color);
}

.header-title {
    display: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Bouton nouvelle demande */
.btn-new-demand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-new-demand .btn-text {
    display: none;
}

.btn-icon-only {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: background 0.2s;
}

.btn-icon-only:hover {
    background: var(--bg-primary);
}

/* Menu dropdown */
.menu-dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    z-index: 1000;
    animation: dropdownFade 0.2s ease;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-content a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-content a:hover {
    background: var(--bg-tertiary);
}

.dropdown-content a:first-child {
    border-radius: var(--radius) var(--radius) 0 0;
}

.dropdown-content a:last-child {
    border-radius: 0 0 var(--radius) var(--radius);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.25rem 0;
}

.dropdown-danger {
    color: var(--danger-color) !important;
}

.dropdown-danger:hover {
    background: rgba(239, 68, 68, 0.15) !important;
}

/* Desktop: show title */
@media (min-width: 480px) {
    .header-title {
        display: inline;
    }
    
    .header-minimal {
        //padding: 0.75rem 1.5rem;
    }
    
    .btn-new-demand .btn-text {
        display: inline;
    }
    
    .btn-new-demand .btn-icon {
        display: none;
    }
}

/* ============================================
   Zone Conversation
   ============================================ */

.conversation-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.zone-conversation {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ============================================
   Étape Démarrage (Welcome)
   ============================================ */

.etape-demarrage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1rem;
    flex: 1;
    min-height: 300px;
}

.welcome-logo {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.welcome-logo svg {
    width: 160px;
    height: 80px;
}

.etape-demarrage h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.welcome-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.input-probleme-container {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-probleme-container textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    resize: none;
    transition: border-color 0.2s;
    background: var(--bg-tertiary);
    color: var(--text-color);
}

.input-probleme-container textarea::placeholder {
    color: var(--text-muted);
}

.input-probleme-container textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Desktop */
@media (min-width: 480px) {
    .etape-demarrage h1 {
        font-size: 1.5rem;
    }
    
    .welcome-logo svg {
        width: 200px;
        height: 100px;
    }
}

/* ============================================
   Étapes de conversation
   ============================================ */

.etape {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 1rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.etape-resolution {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.25) 100%);
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.etape-escalade {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.25) 100%);
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.etape-clarification {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(139, 92, 246, 0.25) 100%);
    border: 1px solid rgba(139, 92, 246, 0.4);
}

.clarification-icon {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.75rem;
}

.badge-clarification {
    background: rgba(139, 92, 246, 0.3);
    color: #a78bfa;
}

.choix-btn-clarification {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(139, 92, 246, 0.3) 100%);
    border-color: rgba(139, 92, 246, 0.4);
}

.choix-btn-clarification:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(139, 92, 246, 0.4) 100%);
    border-color: rgba(139, 92, 246, 0.6);
}

.etape-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.etape-titre {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.etape-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.etape-actions button:hover {
    opacity: 1;
}

.etape-contenu {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.etape-contenu p {
    margin-bottom: 0.5rem;
}

.etape-contenu ul, .etape-contenu ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.etape-choix {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ============================================
   Boutons Options
   ============================================ */

.choix-btn {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
    color: var(--text-color);
    transition: all 0.2s;
}

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

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

.choix-btn.choix-passe {
    opacity: 0.6;
}

.choix-btn.choix-passe:hover {
    opacity: 1;
}

.choix-btn.choix-passe.selected {
    opacity: 1;
}

.choix-btn-special {
    background: transparent;
    border-style: dashed;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.choix-btn-special:hover {
    background: var(--bg-tertiary);
    color: var(--text-color);
    border-color: var(--text-muted);
}

/* Desktop: options en ligne si peu nombreuses */
@media (min-width: 480px) {
    .etape-choix {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .choix-btn {
        flex: 0 0 auto;
    }
}

/* ============================================
   Réponse Utilisateur
   ============================================ */

.reponse-utilisateur {
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    margin-left: 2rem;
    animation: slideIn 0.3s ease;
}

.reponse-utilisateur-label {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.reponse-utilisateur-contenu {
    font-size: 1rem;
}

/* Fiche identifiée */
.fiche-identifiee {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.fiche-identifiee .reponse-utilisateur-contenu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.fiche-identifiee-titre {
    font-weight: 600;
}

.btn-changer {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-changer:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   Chargement
   ============================================ */

.chargement-ia {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
}

.chargement-dots {
    display: flex;
    gap: 0.25rem;
}

.chargement-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.chargement-dots span:nth-child(1) { animation-delay: -0.32s; }
.chargement-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ============================================
   Badges
   ============================================ */

.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-valide {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.badge-non-valide {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

/* ============================================
   Zone Saisie (Footer)
   ============================================ */

.zone-saisie {
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.saisie-container {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.saisie-container textarea {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    resize: none;
    max-height: 120px;
    background: var(--bg-tertiary);
    color: var(--text-color);
}

.saisie-container textarea::placeholder {
    color: var(--text-muted);
}

.saisie-container textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.saisie-container .btn {
    padding: 0.75rem 1rem;
    flex-shrink: 0;
}

.btn-icon {
    font-size: 1.25rem;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-tertiary);
    color: var(--text-color);
}

.btn:hover {
    background: var(--border-color);
}

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

.btn-primary:hover {
    background: var(--primary-hover);
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

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

.btn-success:hover {
    background: #16a34a;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-color);
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.85rem;
}

.btn-large {
    padding: 0.875rem 1.5rem;
    font-size: 1.1rem;
}

/* ============================================
   Forms
   ============================================ */

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

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-color);
}

input[type="text"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
    background: var(--bg-tertiary);
    color: var(--text-color);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
}

select option {
    background: var(--bg-primary);
    color: var(--text-color);
}

/* ============================================
   Modals
   ============================================ */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
    border: 1px solid var(--border-color);
}

.modal-content.modal-large {
    max-width: 800px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-small {
    max-width: 400px;
}

.modal-large {
    max-width: 600px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
}

.btn-close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 1.25rem;
}

.modal-body p {
    color: var(--text-color);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   Fiche proposée (dans modal)
   ============================================ */

.fiche-proposee {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    font-weight: 600;
    text-align: center;
    color: var(--primary-color);
}

/* ============================================
   Edit sections
   ============================================ */

.edit-section {
    background-color: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.edit-section h4 {
    margin-bottom: 0.75rem;
    color: var(--text-color);
    font-size: 0.95rem;
}

.edit-statut {
    margin-bottom: 0.75rem;
}

.edit-origine {
    margin-top: 0.5rem;
}

.edit-choix-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.edit-choix-item input {
    flex: 1;
    min-width: 150px;
}

.edit-choix-item select {
    width: auto;
    min-width: 120px;
}

.edit-choix-item button {
    padding: 0.5rem;
    background-color: var(--danger-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

/* ============================================
   Toast Notifications
   ============================================ */

#toast-container {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    background: var(--bg-tertiary);
    color: var(--text-color);
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    border: 1px solid var(--border-color);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast.success {
    background: rgba(34, 197, 94, 0.2);
    border-color: var(--success-color);
    color: #4ade80;
}

.toast.error {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger-color);
    color: #f87171;
}

.toast.warning {
    background: rgba(245, 158, 11, 0.2);
    border-color: var(--warning-color);
    color: #fbbf24;
}

/* ============================================
   Utilities
   ============================================ */

.hidden {
    display: none !important;
}

.text-muted {
    color: var(--text-muted);
}

.mt-2 {
    //margin-top: 0.5rem;
}

/* ============================================
   Modération Conversations
   ============================================ */

.conv-etape {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.conv-etape-ia {
    border-left-color: var(--warning-color, orange);
    background: rgba(245, 158, 11, 0.1);
}

.conv-etape-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9em;
}

.conv-etape-contenu {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.conv-etape-reponse {
    color: var(--primary-color);
    font-size: 0.9em;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-color);
}

.conv-etape-actions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
}

.conv-etape-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border-color);
}

.conv-option {
    padding: 0.4rem 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.85em;
    color: var(--text-muted);
}

.conv-option-selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    font-weight: 500;
}

.conv-option-libre {
    background: #9333ea;
    border-color: #9333ea;
    color: white;
    font-weight: 500;
}

.btn-edit-etape {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.btn-edit-etape:hover {
    opacity: 1;
}

.badge-fiche {
    background: var(--bg-secondary);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.filters {
    display: flex;
    gap: 0.5rem;
}

.filters select {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-color);
    font-size: 0.9em;
}

/* ============================================
   Desktop Enhancements
   ============================================ */

@media (min-width: 768px) {
    .zone-conversation {
        padding: 1.5rem;
    }
    
    .etape {
        padding: 1.25rem;
    }
}

/* ============================================
   Dashboard Styles
   ============================================ */

.dashboard-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: var(--text-muted);
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
}

.dashboard-date {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.dash-card {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-primary) 100%);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: calc(var(--delay, 0) * 0.1s);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dash-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dash-card-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.1);
}

.dash-card-content {
    flex: 1;
}

.dash-card-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.dash-card-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Card colors */
.dash-card-blue { border-left: 4px solid #3b82f6; }
.dash-card-blue .dash-card-icon { background: rgba(59, 130, 246, 0.2); }
.dash-card-blue .dash-card-value { color: #60a5fa; }

.dash-card-purple { border-left: 4px solid #8b5cf6; }
.dash-card-purple .dash-card-icon { background: rgba(139, 92, 246, 0.2); }
.dash-card-purple .dash-card-value { color: #a78bfa; }

.dash-card-orange { border-left: 4px solid #f59e0b; }
.dash-card-orange .dash-card-icon { background: rgba(245, 158, 11, 0.2); }
.dash-card-orange .dash-card-value { color: #fbbf24; }

.dash-card-green { border-left: 4px solid #22c55e; }
.dash-card-green .dash-card-icon { background: rgba(34, 197, 94, 0.2); }
.dash-card-green .dash-card-value { color: #4ade80; }

/* Small cards */
.dash-card-small {
    padding: 1rem;
}

.dash-card-small .dash-card-icon {
    font-size: 1.75rem;
    width: 45px;
    height: 45px;
}

.dash-card-small .dash-card-value {
    font-size: 1.5rem;
}

.dash-card-success { border-left: 4px solid #22c55e; }
.dash-card-success .dash-card-value { color: #4ade80; }

.dash-card-warning { border-left: 4px solid #f59e0b; }
.dash-card-warning .dash-card-value { color: #fbbf24; }

.dash-card-danger { border-left: 4px solid #ef4444; }
.dash-card-danger .dash-card-value { color: #f87171; }

/* Section */
.dashboard-section {
    margin-bottom: 2rem;
}

.dashboard-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

/* Grid 2 colonnes */
.dashboard-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Panel */
.dash-panel {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: calc(var(--delay, 0) * 0.1s);
}

.dash-panel h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

/* Gauge */
.dash-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
}

.dash-gauge-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(
        var(--success-color) calc(var(--percent, 0) * 1%),
        var(--bg-tertiary) calc(var(--percent, 0) * 1%)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: gaugeAnimation 1s ease-out forwards;
}

@keyframes gaugeAnimation {
    from {
        background: conic-gradient(var(--success-color) 0%, var(--bg-tertiary) 0%);
    }
}

.dash-gauge-circle::before {
    content: '';
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--bg-primary);
}

.dash-gauge-value {
    position: relative;
    z-index: 1;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--success-color);
}

.dash-gauge-label {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
}

/* Activity */
.dash-activity {
    text-align: center;
    padding: 1rem;
}

.dash-activity-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    animation: countUp 0.5s ease-out;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.dash-activity-label {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.dash-activity-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.dash-activity-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    border-radius: 4px;
    width: 0;
    animation: fillBar 1s ease-out 0.5s forwards;
}

@keyframes fillBar {
    to {
        width: var(--width, 50%);
    }
}

/* Alert */
.dash-alert {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: calc(var(--delay, 0) * 0.1s);
}

.dash-alert-icon {
    font-size: 2rem;
}

.dash-alert-content {
    flex: 1;
}

.dash-alert-content strong {
    display: block;
    color: #fbbf24;
}

.dash-alert-content p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

/* Success state */
.dash-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.05) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: calc(var(--delay, 0) * 0.1s);
}

.dash-success .dash-alert-content strong {
    color: #4ade80;
}

/* Error state */
.dash-error {
    text-align: center;
    padding: 4rem 2rem;
}

.dash-error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.dash-error h3 {
    margin-bottom: 0.5rem;
}

.dash-error p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ============================================
   User Interface - Menu & Modals
   ============================================ */

/* Liste des demandes */
.demandes-filters {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.demandes-filters input[type="date"] {
    padding: 0.625rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 140px;
}

.demandes-filters input[type="date"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Fix pour le calendrier natif sur fond sombre */
.demandes-filters input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8);
    cursor: pointer;
}

.liste-demandes {
    max-height: 60vh;
    overflow-y: auto;
}

.demande-item {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.demande-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

.demande-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.demande-item-titre {
    font-weight: 500;
    color: var(--text-color);
}

.demande-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.demande-item-statut {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 500;
}

.statut-resolu {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.statut-escalade {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.statut-en_cours {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

/* Détail demande */
.detail-demande {
    padding: 0.5rem;
}

.detail-demande-info {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.detail-demande-historique {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-etape {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary-color);
}

.detail-etape-reponse {
    background: var(--primary-color);
    color: white;
    border-left: none;
    margin-left: 2rem;
}

/* Formulaire environnement */
.form-environnement {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.env-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.env-field label {
    font-size: 0.875rem;
    color: var(--text-color);
}

.env-field label small {
    color: var(--text-muted);
    font-weight: normal;
}

/* Form elements génériques */
.form-select {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-color);
    font-size: 1rem;
}

.form-textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-color);
    font-size: 1rem;
    resize: vertical;
    font-family: inherit;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.checkbox-label input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--primary-color);
}

/* Severity slider */
.severity-slider {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.severity-slider input[type="range"] {
    flex: 1;
    accent-color: var(--primary-color);
}

.severity-label {
    min-width: 100px;
    text-align: right;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Utilitaires */
.mb-1 {
    margin-bottom: 0.5rem;
}

.my-2 {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

hr {
    border: none;
    border-top: 1px solid var(--border-color);
}

.loading-placeholder {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Theme preferences */
body.theme-light {
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --bg-tertiary: #e5e7eb;
    --border-color: #d1d5db;
}

body.font-small {
    font-size: 14px;
}

body.font-large {
    font-size: 18px;
}

body.font-xlarge {
    font-size: 20px;
}

body.density-compact .etape,
body.density-compact .modal-body {
    padding: 0.75rem;
}

body.density-comfortable .etape,
body.density-comfortable .modal-body {
    padding: 1.5rem;
}

body.high-contrast {
    --primary-color: #60a5fa;
    --text-color: #ffffff;
    --border-color: #9ca3af;
}

body.reduce-motion * {
    animation: none !important;
    transition: none !important;
}

/* Section mot de passe dans Mon compte */
.section-password {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem 0;
    font-size: 0.95rem;
    text-align: left;
    width: 100%;
    transition: color 0.2s;
}

.btn-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

#section-password-fields {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

#section-password-fields .form-group:last-child {
    margin-bottom: 0;
}

/* ============================================
   PWA Installation
   ============================================ */

/* Bandeau d'installation */
.pwa-banner {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    padding: 0.75rem 1rem;
    position: relative;
    z-index: 100;
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.pwa-banner-icon {
    font-size: 1.25rem;
}

.pwa-banner-text {
    font-weight: 500;
}

.pwa-banner .btn {
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
}

.pwa-banner-close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    line-height: 1;
}

.pwa-banner-close:hover {
    opacity: 1;
}

/* Modal PWA */
.modal-pwa {
    max-width: 500px;
}

.pwa-benefits {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pwa-benefit {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.pwa-benefit-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.pwa-benefit strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.pwa-benefit p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Sections d'installation */
.pwa-install-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.pwa-instruction-title {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.pwa-instructions {
    margin: 0;
    padding-left: 1.5rem;
    color: var(--text-muted);
}

.pwa-instructions li {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.pwa-instructions strong {
    color: var(--text-color);
}

.pwa-ios-icon {
    display: inline-block;
    background: var(--bg-tertiary);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.btn-full {
    width: 100%;
}

/* Post-installation */
.pwa-success {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(34, 197, 94, 0.15);
    border-radius: var(--radius);
    color: #4ade80;
    margin-bottom: 1rem;
}

.pwa-success-icon {
    font-size: 1.5rem;
}

.pwa-tip {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.15);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary-color);
}

.pwa-tip-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.pwa-tip strong {
    color: var(--primary-color);
}

/* Section ouvrir dans l'app */
.pwa-info-box {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.pwa-info-box p {
    margin: 0.5rem 0;
}

.pwa-open-instructions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pwa-open-option {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary-color);
}

.pwa-open-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.pwa-open-option strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.pwa-open-option p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 480px) {
    .pwa-banner-content {
        font-size: 0.875rem;
    }
    
    .pwa-banner-text {
        flex: 1;
        text-align: center;
    }
    
    .pwa-banner-close {
        position: static;
        transform: none;
    }
}
