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

:root {
    --bg:        #0f0f13;
    --bg2:       #1a1a22;
    --bg3:       #23232e;
    --border:    #2e2e3e;
    --text:      #e2e0d8;
    --muted:     #888;
    --accent:    #c0392b;
    --accent2:   #e74c3c;
    --green:     #27ae60;
    --orange:    #e67e22;
    --radius:    8px;
    --font:      'Segoe UI', system-ui, sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ────────────────────────────────────────────────────────────── */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: .75rem 1.5rem;
}
.brand { font-size: 1.1rem; font-weight: 700; color: var(--accent2); }
.navbar nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.navbar nav a {
    color: var(--text);
    font-size: .9rem;
    padding: .3rem .7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: background .15s;
}
.navbar nav a:hover { background: var(--bg3); text-decoration: none; }
.user-info { font-size: .85rem; color: var(--muted); }

/* ── Main ──────────────────────────────────────────────────────────────── */
main { padding: 1.5rem; max-width: 1200px; margin: 0 auto; }

/* ── Login ─────────────────────────────────────────────────────────────── */
.page-login {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 30%, #1e0a0a 0%, #0f0f13 70%);
}
.login-box {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
    text-align: center;
}
.login-box h1 { font-size: 1.4rem; margin-bottom: 1.5rem; color: var(--accent2); }

/* ── Formulaires ───────────────────────────────────────────────────────── */
label {
    display: block;
    font-size: .85rem;
    color: var(--muted);
    margin-bottom: 1rem;
}
label input, label select, label textarea {
    display: block;
    width: 100%;
    margin-top: .3rem;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: .55rem .8rem;
    font-size: .95rem;
    outline: none;
    transition: border-color .15s;
}
label input:focus, label select:focus, label textarea:focus {
    border-color: var(--accent2);
}
label select option { background: var(--bg3); }
label small { display: block; margin-top: .25rem; font-size: .8rem; color: var(--muted); }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

button, .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: .6rem 1.2rem;
    font-size: .95rem;
    cursor: pointer;
    transition: background .15s;
}
button:hover, .btn-primary:hover { background: var(--accent2); }

.btn-secondary {
    background: var(--bg3);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .6rem 1.2rem;
    font-size: .95rem;
    cursor: pointer;
    transition: background .15s;
}
.btn-secondary:hover { background: var(--border); text-decoration: none; }

.form-wrap { max-width: 640px; }
.form-wrap h2 { margin-bottom: 1rem; font-size: 1.1rem; }
.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1.5rem;
}

/* ── Tableau armes ─────────────────────────────────────────────────────── */
.table-armes {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: .9rem;
}
.table-armes th {
    background: var(--bg3);
    border: 1px solid var(--border);
    padding: .6rem .9rem;
    text-align: left;
    font-weight: 600;
    font-size: .85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .03em;
}
.table-armes td {
    border: 1px solid var(--border);
    padding: .6rem .9rem;
    vertical-align: middle;
}
.table-armes tr:nth-child(even) td { background: var(--bg2); }
.table-armes tr:nth-child(odd)  td { background: var(--bg); }
.table-armes tr:hover td { background: var(--bg3); }

/* Ligne indisponible atténuée */
tr.statut-indisponible td { opacity: .55; }

/* Image miniature */
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); }
.no-img { color: var(--muted); }

/* Badges statut */
.badge { font-size: .8rem; font-weight: 600; border-radius: 20px; padding: .2rem .6rem; }
.badge-disponible   { background: #1a3d29; color: #4ade80; }
.badge-indisponible { background: #3d1a1a; color: #f87171; }

/* Boutons actions inline */
.actions { white-space: nowrap; }
.btn-edit, .btn-delete {
    display: inline-block;
    padding: .3rem .6rem;
    border-radius: var(--radius);
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid var(--border);
    background: var(--bg3);
    margin-right: .25rem;
    transition: background .15s;
}
.btn-edit:hover   { background: #1a3d29; }
.btn-delete:hover { background: #3d1a1a; }

/* ── Messages ──────────────────────────────────────────────────────────── */
.msg-succes {
    background: #1a3d29;
    color: #4ade80;
    border: 1px solid #2d6a47;
    border-radius: var(--radius);
    padding: .75rem 1rem;
    margin-bottom: 1rem;
}
.msg-erreur {
    background: #3d1a1a;
    color: #f87171;
    border: 1px solid #7a2e2e;
    border-radius: var(--radius);
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    list-style: disc inside;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .row-2 { grid-template-columns: 1fr; }
    .table-armes { font-size: .8rem; }
    .table-armes th, .table-armes td { padding: .4rem .5rem; }
    .thumb { width: 40px; height: 40px; }
}
