:root {
    --primary: #0284c7;
    --primary-dark: #0369a1;
    --success: #10b981;
    --warning: #d97706;
    --danger: #ef4444;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-100: #f1f5f9;
    --bg-app: #f8fafc;
    --border: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
}

* {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-app);
    color: var(--text-main);
    margin: 0;
    padding: 20px;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--slate-100);
    padding-bottom: 15px;
    margin-bottom: 30px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand img {
    height: 40px;
    width: auto;
}

h1, h2, h3 {
    margin: 0;
    color: var(--slate-900);
}

.btn {
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    display: inline-block;
    cursor: pointer;
    border: none;
    font-weight: 600;
    transition: background 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-blue { background: var(--primary); color: #fff; }
.btn-blue:hover { background: var(--primary-dark); }
.btn-red { background: var(--danger); color: #fff; }
.btn-red:hover { background: #dc2626; }
.btn-green { background: var(--success); color: #fff; }
.btn-green:hover { background: #059669; }
.btn-grey { background: var(--text-muted); color: #fff; }
.btn-grey:hover { background: #475569; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #b45309; }

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.card {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
    border: 1px solid var(--border);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

/* --- CLASSES UTILITAIRES (Anti-styles en ligne) --- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mb-25 { margin-bottom: 25px; }
.my-40-auto { max-width: 600px; margin: 40px auto; }
.w-full { width: 100%; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-10 { gap: 10px; }
.gap-15 { gap: 15px; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.fs-16 { font-size: 16px; }
.fs-40 { font-size: 40px; }
.fs-50 { font-size: 50px; }
.fw-600 { font-weight: 600; }
.font-mono { font-family: monospace; }
.controls-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
    align-items: center;
}
.archive-list {
    background: #f8fafc;
    padding: 15px 15px 15px 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: #475569;
    margin-bottom: 25px;
}
.output-box {
    background: #0f172a;
    color: #38bdf8;
    padding: 15px;
    border-radius: 8px;
    max-height: 250px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.6;
    margin-top: 10px;
    word-break: break-all;
    white-space: pre-wrap;
}

/* --- Navigation Header Pro --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-link {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-secondary, #64748b);
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: #f1f5f9;
    color: var(--text-primary, #0f172a);
    border-color: #cbd5e1;
}

.nav-link.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

.nav-logout {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.nav-logout:hover {
    background: #fecaca;
    color: #7f1d1d;
    border-color: #fca5a5;
}

/* --- Global Auth Screen Pro --- */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.auth-card {
    background: #ffffff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.auth-card h2 {
    margin: 0 0 8px 0;
    font-size: 22px;
    color: #0f172a;
    font-weight: 700;
}

.auth-card p {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 25px;
}

.auth-card input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.auth-card input[type="password"]:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.auth-card button {
    width: 100%;
    padding: 12px;
    background: #0284c7;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-card button:hover {
    background: #0369a1;
}

/* --- Composant Éditeur de Code Unifié (IDE Style) --- */
.code-editor-wrapper {
    background: #0f172a;
    border-radius: 12px;
    border: 1px solid #334155;
    overflow: hidden;
    margin-bottom: 25px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
}

.editor-toolbar {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    align-items: center;
    flex-wrap: wrap;
}

.editor-toolbar-bottom {
    border-top: 1px solid #334155;
    border-bottom: none;
}

.code-editor {
    width: 100%;
    height: 480px;
    background: #0f172a;
    color: #38bdf8;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13.5px;
    line-height: 1.6;
    padding: 20px;
    border: none;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
    tab-size: 4;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
}

