:root {
    --bg-dark: #0a0a0c;
    --bg-panel: rgba(21, 21, 26, 0.7);
    --bg-panel-hover: rgba(30, 30, 38, 0.8);
    --border-color: rgba(255, 255, 255, 0.08);
    --primary-gradient: linear-gradient(135deg, #a855f7, #ec4899);
    --text-main: #ffffff;
    --text-muted: #8b8b93;
    --success: #10b981;
    --error: #ef4444;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    /* Un subtil effet d'éclairage d'arrière plan */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(168, 85, 247, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.08), transparent 25%);
}

/* --- GLASSMORPHISM UTILS --- */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* --- TYPOGRAPHY --- */
h1, h2, h3 { font-weight: 600; }
h1 { font-size: 2rem; margin-bottom: 0.5rem; }
p { color: var(--text-muted); }

/* --- BUTTONS & INPUTS --- */
input {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}
input:focus {
    border-color: #a855f7;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
}
.btn-primary:active {
    transform: translateY(0);
}

/* --- LOGO --- */
.f-logo {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    font-size: 4rem;
    line-height: 1;
    display: inline-block;
    filter: drop-shadow(0px 2px 10px rgba(168, 85, 247, 0.4));
}
.f-logo.small {
    font-size: 2rem;
}

/* --- LOGIN OVERLAY --- */
.overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(10, 10, 12, 0.9);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}
.overlay.active {
    opacity: 1;
    pointer-events: all;
}

.login-panel {
    padding: 3rem;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.5s ease;
}
.overlay.active .login-panel {
    transform: translateY(0);
}

.error-msg {
    color: var(--error);
    font-size: 0.9rem;
    min-height: 1.2rem;
}

/* --- LAYOUT --- */
.app-container {
    display: flex;
    height: 100vh;
    padding: 1rem;
    gap: 1rem;
    opacity: 1;
    transition: opacity 0.5s ease;
}
.app-container.hidden {
    opacity: 0;
    pointer-events: none;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 250px;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 2rem;
}
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}
nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}
.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}
.nav-btn svg { width: 20px; height: 20px; }
.nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}
.nav-btn.active {
    background: rgba(168, 85, 247, 0.15);
    color: white;
    border-left: 3px solid #a855f7;
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}
.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.dot {
    width: 8px; height: 8px;
    border-radius: 50%;
}
.dot.green {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

/* --- MAIN CONTENT --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
}

.view {
    display: none;
    padding: 2rem;
    flex-direction: column;
    gap: 2rem;
    animation: fadeIn 0.4s ease;
}
.view.active {
    display: flex;
}

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

.action-panel {
    padding: 2rem;
}
.input-group {
    display: flex;
    gap: 1rem;
}
.input-group input {
    flex: 1;
}

.status-board {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-container {
    flex: 1;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.status-placeholder {
    color: var(--text-muted);
    text-align: center;
    margin-top: 2rem;
    font-style: italic;
}

/* Status Cards */
.status-card {
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--border-color);
    background: rgba(255,255,255,0.03);
    animation: slideIn 0.3s ease;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.status-card.fetching, .status-card.sending, .status-card.waiting {
    border-color: #a855f7;
}
.status-card.approved {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}
.status-card.declined, .status-card.error {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.status-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.status-email {
    font-weight: 600;
    color: white;
}
.status-time {
    font-size: 0.8rem;
}
.status-msg {
    font-size: 0.95rem;
}

.entropy-badge {
    display: inline-block;
    background: var(--primary-gradient);
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.2rem;
    margin-top: 8px;
}

/* --- BULK CHECK --- */
.bulk-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2.5rem;
    border: 2px dashed rgba(168, 85, 247, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}
.bulk-upload-area:hover,
.bulk-upload-area.dragover {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.05);
}
.bulk-upload-area svg {
    color: var(--text-muted);
    opacity: 0.6;
}
.text-muted { color: var(--text-muted); font-size: 0.9rem; }

.btn-secondary {
    background: rgba(255,255,255,0.08);
    color: white;
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.12);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}
.btn-danger:disabled, .btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.bulk-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

/* Progress Bar */
.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.progress-bar-bg {
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 5px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-gradient);
    border-radius: 5px;
    transition: width 0.4s ease;
}
