:root {
    --primary: #0F5A63;
    --secondary: #2F6EA6;
    --text: #002B30;
    --bg: #F7FAFB;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { overflow-x: hidden; width: 100%; margin: 0; font-family: 'Montserrat', sans-serif; background: var(--bg); color: var(--text); }

.app-container { display: flex; min-height: 100vh; width: 100%; }

/* --- HEADER MOBILE --- */
.mobile-header {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 60px;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    z-index: 1000;
    padding: 0 15px;
    align-items: center;
}

.mobile-logo-container { flex-grow: 1; text-align: center; margin-right: 40px; }
.mobile-logo { height: 32px; display: block; margin: 0 auto; }

.burger-btn {
    background: var(--primary);
    border: none;
    width: 40px; height: 40px;
    border-radius: 6px;
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
    cursor: pointer;
}
.burger-btn span { display: block; width: 20px; height: 2px; background: #fff; }

/* --- SIDEBAR --- */
.sidebar {
    width: 280px;
    background: #fff;
    border-right: 1px solid rgba(0,0,0,0.05);
    padding: 30px 20px;
    display: flex; flex-direction: column;
    position: fixed; height: 100vh;
    left: 0; top: 0;
    z-index: 3000; /* Toujours au-dessus de tout */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo { width: 160px; }
.header-flex { display: flex; align-items: center; justify-content: space-between; }
.close-sidebar { display: none; background: none; border: none; font-size: 2.5rem; color: var(--primary); cursor: pointer; line-height: 1; }
.sidebar h1 { font-size: 0.9rem; color: var(--primary); margin: 10px 0 30px; }

.sidebar-nav { flex-grow: 1; }
.nav-link {
    display: block; padding: 12px 15px; text-decoration: none; color: var(--text);
    border-radius: 8px; margin-bottom: 8px; font-weight: 600; transition: 0.2s;
}
.nav-link:hover, .nav-link.active { background: var(--primary); color: #fff; }

.sidebar-footer { padding-top: 20px; border-top: 1px solid #eee; font-size: 0.75rem; }
.sidebar-footer a { color: var(--primary); font-weight: bold; text-decoration: none; }

/* Overlay */
.sidebar-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 2000; /* Entre le contenu et le menu */
    backdrop-filter: blur(2px);
}

/* --- CONTENU --- */
.main-content { margin-left: 280px; padding: 40px; width: 100%; }
.tool-section { display: none; }
.tool-section.active { display: block; animation: fadeIn 0.3s; }

.card { background: #fff; padding: 25px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.04); }
h2 { color: var(--primary); margin: 0 0 25px; font-size: 1.4rem; }

.options-container { background: #fafafa; padding: 15px; border-radius: 10px; margin-bottom: 20px; border: 1px solid #eee; }
.checkbox-group-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.checkbox-group-grid label { font-size: 0.85rem; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 15px; margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 0.8rem; }
.input-text { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 6px; font-family: inherit; }

textarea { width: 100%; padding: 12px; border: 1px solid #eee; border-radius: 8px; background: #fdfdfd; font-family: monospace; font-size: 0.9rem; margin-bottom: 15px; resize: vertical; }
.actions { display: flex; gap: 10px; }
.btn-primary { background: var(--primary); color: #fff; border: none; padding: 12px; border-radius: 6px; cursor: pointer; font-weight: bold; flex: 1; }
.btn-secondary { background: var(--secondary); color: #fff; border: none; padding: 12px; border-radius: 6px; cursor: pointer; flex: 1; }

.copy-box { display: flex; gap: 5px; margin-top: 5px; }
.copy-box input { flex-grow: 1; padding: 8px; border: 1px solid #eee; border-radius: 4px; font-family: monospace; font-size: 0.8rem; background: #f8f8f8; }
.copy-box button { background: #7FCED6; border: none; padding: 5px 12px; border-radius: 4px; cursor: pointer; font-size: 0.75rem; font-weight: bold; }

/* --- RESPONSIVE --- */
@media (max-width: 992px) {
    .mobile-header { display: flex; }
    .sidebar { transform: translateX(-100%); width: 280px; box-shadow: none; }
    .sidebar.open { transform: translateX(0); box-shadow: 10px 0 30px rgba(0,0,0,0.2); }
    .sidebar.open + .sidebar-overlay { display: block; }
    .close-sidebar { display: block; }
    .main-content { margin-left: 0; padding: 80px 15px 30px; }
    .actions { flex-direction: column; }
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.pulse-success { animation: pulse 0.5s ease-out; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(15, 90, 99, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(15, 90, 99, 0); } 100% { box-shadow: 0 0 0 0 rgba(15, 90, 99, 0); } }