/* Charte graphique NDIGITAL (2023) : couleurs primaires bleu #2C59A5 et orange #E87905,
   secondaires #3D71A9, #A3C8EB, #F6A461, #9D9D9D ; typographie Roboto pour les supports.
   Logo uniquement en version blanche sur fond de couleur (monochrome sur fond clair interdit). */
:root {
    --brand-blue: #2c59a5; --brand-orange: #e87905;
    --brand-blue-2: #3d71a9; --brand-blue-light: #a3c8eb; --brand-orange-light: #f6a461; --brand-grey: #9d9d9d;

    --bg: #f4f7fb; --card: #fff; --text: #1c2433; --muted: #5b6577;
    --accent: var(--brand-blue); --accent-hover: #234a8a; --accent-tint: #eaf2fb;
    --border: #d9e1ec; --danger: #b42318; --success: #067647;
    /* Orange de la charte, assombri pour le texte (contraste suffisant sur fond blanc). */
    --warning: #a85400; --star: var(--brand-orange);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Roboto, "Segoe UI", system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
h1 { font-size: 26px; font-weight: 500; margin: 0 0 16px; }
h2 { font-size: 19px; font-weight: 500; margin: 32px 0 12px; }

header { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; padding: 10px 24px; background: var(--brand-blue); color: #fff; border-bottom: 3px solid var(--brand-orange); }
header nav { display: flex; gap: 22px; align-items: center; }
header nav a { color: #fff; text-decoration: none; opacity: .85; padding: 4px 0; border-bottom: 2px solid transparent; }
header nav a:hover { opacity: 1; }
header nav a.current { opacity: 1; font-weight: 500; border-bottom-color: var(--brand-orange); }
header .brand { display: inline-flex; align-items: center; gap: 10px; opacity: 1; border: none; font-weight: 700; font-size: 17px; }
header .brand img { height: 34px; width: auto; display: block; }
header .user { color: #fff; opacity: .9; }
header .btn.link { color: #fff; opacity: .85; margin-left: 12px; }
header .btn.link:hover { opacity: 1; text-decoration: underline; }
header form { display: inline; }

/* Logo complet (symbole + NDIGITAL) : proportions de la charte, sur fond bleu. */
.lockup { display: flex; align-items: center; gap: 6px; }
.lockup .mark { height: 88px; width: auto; }
.lockup .word { height: 21px; width: auto; }
.card.login-card { padding: 0; overflow: hidden; }
.login-card .login-brand { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 32px 24px 24px; background: var(--brand-blue); color: #fff; border-bottom: 4px solid var(--brand-orange); }
.login-card .login-brand .product { font-size: 15px; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }
.login-card .login-body { padding: 24px; }
.login-card .btn { width: 100%; text-align: center; }

main { max-width: 1040px; margin: 32px auto; padding: 0 16px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 24px; }
.narrow { max-width: 440px; margin: 64px auto; }
.notice { margin-bottom: 24px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--danger); }

.btn { display: inline-block; padding: 9px 16px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; text-decoration: none; font-size: 15px; font-weight: 500; cursor: pointer; font-family: inherit; }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.secondary { background: transparent; color: var(--accent); }
.btn.secondary:hover { background: var(--accent-tint); }
.btn:focus-visible, .chip:focus-visible, .star:focus-visible, a:focus-visible { outline: 3px solid var(--brand-orange-light); outline-offset: 2px; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.link { border: none; background: none; color: var(--muted); padding: 0; }

.flash { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; border: 1px solid; }
.flash.success { background: #ecfdf3; border-color: #abefc6; color: var(--success); }
.flash.error { background: #fef3f2; border-color: #fecdca; color: var(--danger); }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.toolbar h1 { margin: 0; }
input[type=search] { min-width: 260px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip { border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: 5px 14px; cursor: pointer; font: inherit; font-size: 14px; color: var(--text); }
.chip.active { border-color: var(--accent); background: var(--accent-tint); color: var(--accent); font-weight: 500; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 18px; background: var(--card); border: 1px solid var(--border); border-top: 3px solid var(--brand-blue); border-radius: 8px; transition: box-shadow .15s, border-color .15s; }
.tile:not(.locked):hover { border-color: var(--brand-blue-light); border-top-color: var(--brand-blue); box-shadow: 0 2px 10px rgba(44, 89, 165, .12); }
.tile[hidden] { display: none; }
.tile.locked { background: #eef1f5; border-top-color: var(--brand-grey); }
.tile.locked strong, .tile.locked .icon { opacity: .55; }
.request-pending { color: var(--warning); font-weight: 600; }
.tile-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.tile-action { margin-top: auto; align-self: flex-start; }
.tile .tile-action { margin-top: 10px; }
.icon { display: inline-flex; width: 40px; height: 40px; border-radius: 8px; align-items: center; justify-content: center; background: var(--accent-tint); color: var(--accent); font-weight: 700; font-size: 18px; overflow: hidden; }
.icon img { width: 100%; height: 100%; object-fit: cover; }
.star { border: none; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: #c5cad3; padding: 2px; }
.star.on { color: var(--star); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.stat { padding: 16px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.stat-value { font-size: 32px; font-weight: 700; color: var(--brand-blue); }

table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 14px; }
th { background: var(--accent-tint); color: var(--brand-blue); font-weight: 500; }
tr:last-child td { border-bottom: none; }
td form { display: inline; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef0f3; color: var(--muted); }
.badge.ok { background: #ecfdf3; color: var(--success); }
.badge.warn { background: #fdeee0; color: var(--warning); }
.badge.off { background: #fef3f2; color: var(--danger); }

form.stack label { display: block; margin: 14px 0 4px; font-weight: 600; }
form.stack .hint { font-weight: normal; color: var(--muted); font-size: 13px; }
form.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
form.inline label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
input[type=text], input[type=email], input[type=url], input[type=search], input[type=date], select {
    padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font: inherit; font-size: 15px; background: #fff;
}
form.stack input[type=text], form.stack input[type=email], form.stack input[type=url] { width: 100%; }
.actions { display: flex; gap: 12px; align-items: center; margin-top: 20px; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 15px; padding: 12px; background: #f0f2f5; border-radius: 6px; word-break: break-all; user-select: all; }

@media (max-width: 640px) {
    header { padding: 12px 16px; }
    input[type=search] { min-width: 0; width: 100%; }
    table { display: block; overflow-x: auto; }
}
