/* ============================================================
   DEVISEUR v2 - Styles communs
   Palette : bleu #185FA5, beige #F1EFE8, anthracite #2C2C2A
   ============================================================ */

:root {
    /* Couleurs */
    --blue: #185FA5;
    --blue-dark: #0C447C;
    --blue-light: #E6F1FB;
    --blue-hover: #1471C6;
    --beige: #F1EFE8;
    --beige-dark: #D3D1C7;
    --anthracite: #2C2C2A;
    --gray-900: #444441;
    --gray-600: #6B6A63;
    --gray-500: #888780;
    --gray-300: #B8B6AC;
    --gray-200: #D3D1C7;
    --gray-100: #E8E6DD;
    --gray-50: #F7F5EF;
    --green: #085041;
    --green-light: #E1F5EE;
    --red: #791F1F;
    --red-light: #FCEBEB;
    --orange: #B85A00;
    --orange-light: #FAEEDA;
    --white: #FFFFFF;

    /* Typo */
    --font-body: 'Söhne', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'GT Sectra', Georgia, 'Times New Roman', serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

    /* Espacements */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Ombres */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
}

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

body {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--anthracite);
    background: var(--beige);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ---- Header ---- */
.header {
    background: var(--blue);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-bottom: 1px solid var(--blue-dark);
}
.header-logo {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.01em;
}
.header-title {
    flex: 1;
    font-size: 14px;
    font-weight: 400;
    opacity: 0.85;
}
.header-actions { display: flex; gap: 8px; }
.btn-header {
    background: rgba(255,255,255,0.12);
    color: white;
    border: 0.5px solid rgba(255,255,255,0.2);
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}
.btn-header:hover { background: rgba(255,255,255,0.22); }
.btn-header--danger { background: rgba(220,80,80,0.25); }
.btn-header--danger:hover { background: rgba(220,80,80,0.4); }

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

/* ---- Boutons ---- */
.btn-primary {
    background: var(--blue);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-primary:hover { background: var(--blue-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-save {
    background: var(--green-light);
    color: var(--green);
    border: 0.5px solid var(--green);
    padding: 5px 11px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-save:hover { background: var(--green); color: white; }

.btn-delete {
    background: var(--red-light);
    color: var(--red);
    border: 0.5px solid var(--red);
    padding: 5px 11px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-delete:hover { background: var(--red); color: white; }

.btn-add {
    background: var(--blue-light);
    color: var(--blue-dark);
    border: 0.5px dashed var(--blue);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    cursor: pointer;
    margin-top: 0.75rem;
    transition: background 0.15s;
}
.btn-add:hover { background: var(--blue); color: white; }

/* ---- Forms ---- */
.form-group { margin-bottom: 1rem; }
.form-group.inline { display: inline-block; margin-right: 1rem; margin-bottom: 0; }
.form-group label {
    display: block;
    font-size: 12px;
    color: var(--gray-600);
    margin-bottom: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 7px 10px;
    border: 0.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: white;
    color: var(--anthracite);
    transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(24,95,165,0.12);
}

/* ---- Tables ---- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.admin-table thead tr {
    background: var(--gray-50);
    border-bottom: 0.5px solid var(--gray-200);
}
.admin-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 500;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.admin-table td {
    padding: 8px 12px;
    border-bottom: 0.5px solid var(--gray-100);
    font-size: 13px;
    vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover { background: var(--gray-50); }
.admin-table input { padding: 5px 8px; font-size: 13px; }

/* ---- Alerts ---- */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 1rem;
    border: 0.5px solid;
}
.alert-info { background: var(--blue-light); color: var(--blue-dark); border-color: var(--blue); }
.alert-warn { background: var(--orange-light); color: var(--orange); border-color: var(--orange); }
.alert-error { background: var(--red-light); color: var(--red); border-color: var(--red); }
.alert-success { background: var(--green-light); color: var(--green); border-color: var(--green); }

/* ---- Login ---- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 0.5px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}
.login-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 4px;
}
.login-sub {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}
.error-msg {
    background: var(--red-light);
    color: var(--red);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 1rem;
    border: 0.5px solid var(--red);
}
.back-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    font-size: 13px;
    color: var(--gray-500);
    text-decoration: none;
}
.back-link:hover { color: var(--blue); }

/* ---- Toast ---- */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--anthracite);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s, transform 0.2s;
    z-index: 10000;
    box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }

/* ---- Hints ---- */
.hint-text {
    color: var(--gray-500);
    font-size: 13px;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 0.5px dashed var(--gray-300);
    text-align: center;
}
