alpinux-portail/web/assets/style.css
Alpinux 4921a0691c Admin : gestion groupes, services par groupes, badge admin
- admin/groups.php : liste/création/suppression des groupes Keycloak
  avec comptage des membres et services associés par groupe
- admin/services.php : remplace requires_adherent par sélection multi-groupes
- inc/services.php : modèle groups[], migration auto depuis requires_adherent,
  helper service_accessible() pour l'accès contextuel
- inc/keycloak.php : kc_list_groups, kc_create_group, kc_delete_group, kc_group_members
- profile.php : badge Admin visible dans la tuile Mon compte
- index.php : utilise service_accessible() avec les groupes de l'utilisateur

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 00:59:25 +02:00

351 lines
14 KiB
CSS

/* ── Reset & base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--bg: #f5f7fa;
--bg2: #ffffff;
--bg3: #eef0f5;
--border: #d5d9e8;
--primary: #3b5bdb;
--primary-h: #2f4ac4;
--success: #2b9e5e;
--warning: #d08a00;
--danger: #c0392b;
--text: #1a1d2e;
--text-muted:#6b7289;
--radius: 8px;
--shadow: 0 2px 16px rgba(0,0,0,.08);
}
body {
font-family: 'Segoe UI', system-ui, sans-serif;
background: var(--bg);
color: var(--text);
min-height: 100vh;
display: flex;
flex-direction: column;
line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-h); }
/* ── Header / Nav ─────────────────────────────────────────────────── */
header {
background: var(--bg2);
border-bottom: 1px solid var(--border);
padding: 0 2rem;
position: sticky; top: 0; z-index: 100;
}
nav {
max-width: 1100px;
margin: 0 auto;
display: flex;
align-items: center;
justify-content: space-between;
height: 60px;
}
.brand {
display: flex; align-items: center; gap: .6rem;
font-weight: 600; font-size: 1rem; color: var(--text);
}
.brand img { height: 28px; }
.nav-links { display: flex; align-items: center; gap: 1rem; }
.nav-links a { color: var(--text-muted); font-size: .9rem; }
.nav-links a:hover { color: var(--text); }
/* ── Buttons ──────────────────────────────────────────────────────── */
.btn-primary, .btn-outline, .btn-danger {
display: inline-block;
padding: .5rem 1.2rem;
border-radius: var(--radius);
font-size: .9rem;
font-weight: 500;
cursor: pointer;
border: none;
transition: opacity .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-full { width: 100%; text-align: center; padding: .7rem; }
.btn-sm { padding: .3rem .8rem; font-size: .8rem; }
.btn-primary:hover, .btn-danger:hover { opacity: .85; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
/* ── Main ─────────────────────────────────────────────────────────── */
main {
flex: 1;
max-width: 1100px;
width: 100%;
margin: 0 auto;
padding: 2rem;
}
/* ── Flash ────────────────────────────────────────────────────────── */
.flash {
padding: .8rem 1.2rem;
border-radius: var(--radius);
margin-bottom: 1.5rem;
font-size: .9rem;
}
.flash-success { background: #eaf7f0; border: 1px solid var(--success); color: var(--success); }
.flash-error { background: #fdecea; border: 1px solid var(--danger); color: var(--danger); }
/* ── Cards ────────────────────────────────────────────────────────── */
.card {
background: var(--bg2);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 2rem;
margin-bottom: 1.5rem;
max-width: 600px;
}
.card.center { text-align: center; }
.card h1, .card h2 { margin-bottom: 1rem; font-size: 1.3rem; }
/* ── Alerts ───────────────────────────────────────────────────────── */
.alert { padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9rem; }
.alert-error { background: #fdecea; border: 1px solid var(--danger); color: var(--danger); }
.alert-success { background: #eaf7f0; border: 1px solid var(--success); color: var(--success); }
.alert ul { margin: 0; padding-left: 1.2rem; }
/* ── Forms ────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.2rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label { display: block; font-size: .85rem; color: var(--text-muted); margin-bottom: .4rem; }
input[type=text], input[type=email], input[type=password], input[type=url] {
width: 100%;
background: var(--bg3);
border: 1px solid var(--border);
border-radius: var(--radius);
color: var(--text);
padding: .55rem .8rem;
font-size: .95rem;
transition: border-color .15s;
}
input:focus { outline: none; border-color: var(--primary); }
.form-footer { text-align: center; margin-top: 1rem; font-size: .85rem; color: var(--text-muted); }
.username-hint {
background: #eef1ff;
border: 1px solid var(--primary);
border-radius: var(--radius);
padding: .5rem .9rem;
font-size: .85rem;
color: var(--text);
margin-bottom: 1.2rem;
}
.subtitle { color: var(--text-muted); font-size: .9rem; margin-bottom: 1.5rem; }
/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
text-align: center;
padding: 4rem 1rem 3rem;
}
.hero h1 { font-size: 2rem; margin-bottom: .8rem; }
.hero p { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 2rem; }
.hero-actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
/* ── Home about ───────────────────────────────────────────────────── */
.home-about { margin: 0 0 2.5rem; }
.about-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
gap: 1rem;
}
.about-card {
background: var(--bg2);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 1.2rem 1.4rem;
}
.about-title { font-weight: 600; font-size: .9rem; margin-bottom: .5rem; }
.about-card p { font-size: .85rem; color: var(--text-muted); line-height: 1.6; }
/* ── Services grid ────────────────────────────────────────────────── */
.services-grid h2, .services-section h2 {
font-size: 1.2rem; margin-bottom: 1rem;
}
.grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
gap: 1rem;
}
.service-card {
background: var(--bg2);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 1.2rem;
}
.service-card.locked { opacity: .5; }
.service-card.adherent-only { border-color: var(--primary); }
.service-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.service-card p { font-size: .85rem; color: var(--text-muted); margin: .5rem 0; }
/* ── Badges ───────────────────────────────────────────────────────── */
.badge {
font-size: .7rem; font-weight: 600;
padding: .2rem .5rem;
border-radius: 4px;
background: #dde4ff;
color: var(--primary);
}
.badge-inscrit { background: var(--bg3); color: var(--text-muted); }
.badge-adherent { background: #d4f0e4; color: var(--success); }
.badge-admin { background: #fef3d0; color: var(--warning); }
/* ── Dashboard ────────────────────────────────────────────────────── */
.dashboard-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.dashboard-header h1 { font-size: 1.5rem; }
.badges { display: flex; gap: .5rem; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2rem; }
.dashboard-grid .card { max-width: none; }
.services-section { margin-top: 1rem; }
dl { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin-bottom: 1rem; }
dt { color: var(--text-muted); font-size: .85rem; }
dd { font-size: .9rem; }
/* ── Steps (inscription réussie) ──────────────────────────────────── */
.success-icon {
width: 60px; height: 60px;
background: #d4f0e4;
color: var(--success);
border-radius: 50%;
display: flex; align-items: center; justify-content: center;
font-size: 1.8rem;
margin: 0 auto 1.5rem;
}
.steps { text-align: left; margin: 1.5rem 0; display: flex; flex-direction: column; gap: 1.2rem; }
.step { display: flex; gap: 1rem; align-items: flex-start; }
.step-num {
width: 28px; height: 28px; flex-shrink: 0;
border-radius: 50%;
background: var(--bg3); border: 2px solid var(--border);
display: flex; align-items: center; justify-content: center;
font-size: .85rem; font-weight: 700;
}
.step.done .step-num { background: var(--success); border-color: var(--success); color: #fff; }
.step strong { display: block; margin-bottom: .2rem; }
.step p { font-size: .85rem; color: var(--text-muted); margin: .3rem 0; }
/* ── Admin ────────────────────────────────────────────────────────── */
.admin-page { max-width: 1000px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.4rem; }
.admin-nav { display: flex; gap: .5rem; }
.admin-nav a {
padding: .4rem .9rem; border-radius: var(--radius);
font-size: .85rem; color: var(--text-muted);
border: 1px solid transparent;
}
.admin-nav a.active, .admin-nav a:hover { border-color: var(--border); color: var(--text); }
.admin-page .card { max-width: none; }
.admin-page .card h2 { font-size: 1rem; margin-bottom: 1rem; color: var(--text-muted); }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th { text-align: left; padding: .5rem .7rem; color: var(--text-muted); border-bottom: 1px solid var(--border); }
td { padding: .6rem .7rem; border-bottom: 1px solid var(--border); }
td.center { text-align: center; }
.members-table tr:last-child td { border-bottom: none; }
.services-table input[type=text], .services-table input[type=url] {
padding: .3rem .5rem; font-size: .85rem;
}
.new-row td { background: #eef1ff; }
.group-checks { display: flex; flex-direction: column; gap: .2rem; }
.group-check-label { display: flex; align-items: center; gap: .4rem; font-size: .8rem; cursor: pointer; white-space: nowrap; }
/* ── Helpers ──────────────────────────────────────────────────────── */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.small { font-size: .8rem; }
/* ── Profile tuiles ───────────────────────────────────────────────── */
.profile-overview {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 1.2rem;
align-items: start;
}
.tile {
background: var(--bg2);
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
box-shadow: var(--shadow);
}
.tile-open { border-color: var(--primary); }
.tile-header {
display: flex;
align-items: center;
gap: .8rem;
padding: 1rem 1.2rem;
}
.tile-icon { font-size: 1.4rem; flex-shrink: 0; }
.tile-title { font-weight: 600; font-size: .95rem; }
.tile-sub { font-size: .8rem; color: var(--text-muted); margin-top: .1rem; }
.tile-action { margin-left: auto; flex-shrink: 0; }
.tile-body {
padding: 0 1.2rem 1.2rem;
border-top: 1px solid var(--border);
padding-top: .8rem;
}
/* ── History ──────────────────────────────────────────────────────── */
.history-page { max-width: 1100px; }
.history-page h1 { font-size: 1.4rem; }
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
gap: 1rem;
margin-bottom: 1.5rem;
}
.stat-card {
background: var(--bg2);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 1rem;
text-align: center;
}
.stat-warning { border-color: var(--danger); }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); line-height: 1.1; }
.stat-warning .stat-value { color: var(--danger); }
.stat-label { font-size: .75rem; color: var(--text-muted); margin-top: .3rem; }
.charts-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
gap: 1.2rem;
margin-bottom: 1.5rem;
}
.chart-card { max-width: none; }
.chart-card h2 { font-size: .9rem; color: var(--text-muted); margin-bottom: .8rem; }
.ip-bars { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
.ip-bar-row { display: flex; align-items: center; gap: .6rem; font-size: .8rem; }
.ip-label { width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.ip-bar-wrap { flex: 1; background: var(--bg3); border-radius: 4px; height: 10px; }
.ip-bar { background: var(--primary); height: 10px; border-radius: 4px; min-width: 4px; }
.ip-count { width: 24px; text-align: right; font-weight: 600; }
/* ── Footer ───────────────────────────────────────────────────────── */
footer {
text-align: center;
padding: 1.5rem;
font-size: .8rem;
color: var(--text-muted);
border-top: 1px solid var(--border);
margin-top: auto;
}
footer a { color: var(--text-muted); }
footer a:hover { color: var(--text); }
/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 700px) {
.dashboard-grid { grid-template-columns: 1fr; }
.form-row { grid-template-columns: 1fr; }
.page-header { flex-direction: column; align-items: flex-start; gap: .8rem; }
}