* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --navy: #0D1B2A;
    --navy-mid: #1A2F45;
    --navy-light: #253D57;
    --gold: #B8963E;
    --gold-light: #F5E6C0;
    --gold-mid: #D4B06A;
    --bg: #F7F5F0;
    --bg2: #EFECE4;
    --bg3: #E8E3D8;
    --text: #1A1208;
    --text2: #4A3F2F;
    --text3: #8A7D6A;
    --red: #C0392B;
    --green: #1D6A3A;
    --r: 12px;
    --shadow: 0 2px 12px rgba(13,27,42,0.08);
}
body {
    font-family: 'DM Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}
h1, h2, h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
}

/* LOGIN */
.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}
.login-card {
    background: white;
    border-radius: var(--r);
    box-shadow: var(--shadow);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}
.login-card h1 {
    color: var(--navy);
    font-size: 28px;
    margin-bottom: 8px;
}
.login-card .subtitle {
    color: var(--text3);
    font-size: 14px;
    margin-bottom: 30px;
}
.login-card .logo-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}
.form-group {
    text-align: left;
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text2);
    margin-bottom: 5px;
}
.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--bg3);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
}
.form-group input:focus {
    outline: none;
    border-color: var(--gold);
}
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
    background: var(--navy);
    color: white;
    width: 100%;
    margin-top: 8px;
}
.btn-primary:hover { background: var(--navy-mid); }
.btn-gold {
    background: var(--gold);
    color: white;
}
.btn-gold:hover { background: var(--gold-mid); }
.btn-danger {
    background: var(--red);
    color: white;
    font-size: 13px;
    padding: 6px 14px;
}
.btn-small {
    font-size: 13px;
    padding: 6px 14px;
}
.error-msg {
    background: #fdecea;
    color: var(--red);
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 15px;
}
.success-msg {
    background: #e8f5ee;
    color: var(--green);
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 15px;
}

/* HEADER */
.header {
    background: var(--navy);
    color: white;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 16px rgba(0,0,0,0.15);
}
.header h1 { font-size: 22px; color: white; }
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}
.header-right a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.2s;
}
.header-right a:hover { color: white; }
.header-user {
    color: var(--gold-light);
    font-weight: 600;
}

/* PORTAIL */
.portal {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}
.portal h2 {
    font-size: 26px;
    color: var(--navy);
    margin-bottom: 8px;
}
.portal .portal-sub {
    color: var(--text3);
    margin-bottom: 30px;
    font-size: 15px;
}
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.tool-card {
    background: white;
    border-radius: var(--r);
    box-shadow: var(--shadow);
    padding: 24px;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.15s, box-shadow 0.15s;
    display: block;
    border: 2px solid transparent;
}
.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(13,27,42,0.12);
    border-color: var(--gold-light);
}
.tool-icon {
    font-size: 36px;
    margin-bottom: 12px;
    display: block;
}
.tool-card h3 {
    font-size: 18px;
    color: var(--navy);
    margin-bottom: 6px;
}
.tool-card p {
    color: var(--text3);
    font-size: 14px;
    line-height: 1.5;
}

/* ADMIN */
.admin-wrap {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 20px;
}
.admin-wrap h2 {
    font-size: 24px;
    color: var(--navy);
    margin-bottom: 20px;
}
.admin-card {
    background: white;
    border-radius: var(--r);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}
.admin-card h3 {
    font-size: 18px;
    color: var(--navy);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--bg2);
}
table.users-table {
    width: 100%;
    border-collapse: collapse;
}
.users-table th, .users-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--bg2);
    font-size: 14px;
}
.users-table th {
    font-weight: 600;
    color: var(--text2);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.role-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.role-admin { background: var(--gold-light); color: var(--gold); }
.role-user { background: var(--bg2); color: var(--text2); }
.add-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.add-form .form-group { margin-bottom: 0; flex: 1; min-width: 150px; }
.add-form .form-group input, .add-form .form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--bg3);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

@media (max-width: 600px) {
    .header { flex-direction: column; gap: 10px; text-align: center; }
    .tools-grid { grid-template-columns: 1fr; }
    .add-form { flex-direction: column; }
}
