/* iprs1 look, the same as the Tasks module (services/tasks/web/src/styles.css): white cards on light grey,
   orange accent, yellow second color, the graphite top bar. Loaded after app.css. */
:root {
    --brand: #E8520E; --brand-soft: #FFEADF; --brand-ink: #B53A06;
    --pop: #FFC93C; --pop-soft: #FFF4D6; --pop-ink: #7A5600;
    --bg: #F3F4F6; --tile: #E9EBEF; --card: #FFFFFF; --text: #1B1B1F; --muted: #62666F; --line: #E2E4E8;
    --side: #1B1B1F;
}
body.iprs1 { margin: 0; background: var(--bg); color: var(--text); font-family: "Figtree", system-ui, sans-serif; font-size: 15px; }
body.iprs1 a { color: var(--brand-ink); }

/* ---------- logo: IPR S1 with the big dot behind S1 ---------- */
.logo { font-family: Anton, sans-serif; font-size: 1.6rem; letter-spacing: .4px; line-height: 1; color: #fff; display: inline-flex;
    align-items: center; isolation: isolate; text-decoration: none; padding: 0 10px 0 2px; }
body.iprs1 a.logo, body.iprs1 a.logo:hover { color: #fff; }
.logo .dot { position: relative; z-index: 0; }
.logo .dot::before { content: ""; position: absolute; z-index: -1; width: 1.3em; height: 1.3em; border-radius: 50%;
    background: var(--brand); left: 50%; top: 50%; transform: translate(-50%, -50%); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 60px;
    padding: 8px 20px; background: var(--side); color: #fff; }
.tb-sep { color: rgba(255,255,255,.3); font-size: 1.4rem; font-weight: 300; margin-left: 6px; }
.tb-module { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.02rem; padding: 6px 4px; }
.tb-module .bi { color: var(--brand); }
.tb-nav { display: flex; align-items: center; gap: 4px; margin-left: 18px; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.tb-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 10px;
    background: none; color: #C9CDD4; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
body.iprs1 .tb-btn { color: #C9CDD4; }
body.iprs1 .tb-btn:hover, body.iprs1 .tb-btn.on, body.iprs1 .tb-btn[aria-expanded="true"] { background: rgba(255,255,255,.09); color: #fff; }
.tb-btn:focus-visible, .tb-item:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tb-btn .bi-chevron-down { font-size: .75rem; }
.tb-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center;
    font-weight: 800; font-size: .9rem; }
.tb-drop.dropdown-menu { min-width: 240px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 14px 40px rgba(14,22,38,.18); padding: 6px; margin-top: 6px !important; }
.tb-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; text-decoration: none; font-weight: 600; }
body.iprs1 .tb-item { color: var(--text); }
.tb-item .bi { color: var(--muted); font-size: 1.05rem; }
body.iprs1 .tb-item:hover { background: var(--tile); color: var(--text); }
body.iprs1 .tb-item.on { background: var(--brand-soft); color: var(--brand-ink); }
.tb-item.on .bi { color: var(--brand); }
.tb-here { margin-left: auto; font-size: .75rem; font-weight: 700; color: var(--brand-ink); }
.tb-who { display: flex; flex-direction: column; padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: .9rem; }
.tb-who span { color: var(--muted); font-size: .82rem; }

/* ---------- page ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 36px 24px 64px; }
.page-title { font-family: Anton, sans-serif; font-weight: 400; text-transform: uppercase; letter-spacing: .4px; line-height: 1.1;
    font-size: 2.3rem; margin: 0 0 6px; }
.page-title span { color: var(--brand); }
.page-lead { color: var(--muted); font-size: 1.05rem; margin: 0 0 28px; }
.flash { border-radius: 12px; }

/* ---------- home: module cards ---------- */
.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.module { position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 210px; padding: 22px; background: var(--card);
    border: 1px solid var(--line); border-radius: 16px; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
body.iprs1 .module { color: var(--text); }
body.iprs1 .module:hover { border-color: var(--brand); box-shadow: 0 10px 28px rgba(232,82,14,.12); transform: translateY(-1px); color: var(--text); }
.module .ico { width: 50px; height: 50px; border-radius: 12px; display: grid; place-items: center; font-size: 1.45rem; }
.module .ico.orange { background: var(--brand-soft); color: var(--brand-ink); }
.module .ico.yellow { background: var(--pop-soft); color: var(--pop-ink); }
.module .ico.grey { background: var(--tile); color: var(--text); }
.module h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; margin: 4px 0 0; }
.module p { margin: 0; color: var(--muted); }
.module .open { margin-top: auto; font-weight: 700; color: var(--brand-ink); display: inline-flex; align-items: center; gap: 6px; }
body.iprs1 .module:hover .open { color: var(--brand); }
.module .tag { position: absolute; top: 22px; right: 22px; font-size: .75rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
    background: var(--pop); color: var(--text); padding: 3px 9px; border-radius: 999px; }

.section-title { font-size: .8rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 40px 0 12px; }
.account { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 18px 20px; background: var(--card); border: 1px solid var(--line);
    border-radius: 16px; }
.account .avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center;
    font-weight: 800; font-size: 1.2rem; flex: none; }
.account .who { flex: 1 1 200px; min-width: 0; }
.account .who b { display: block; font-size: 1.05rem; }
.account .who span { color: var(--muted); font-size: .9rem; }
.btn-iprs1 { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 9px 16px; border-radius: 10px; font-weight: 700;
    text-decoration: none; border: 1px solid var(--line); background: #fff; }
body.iprs1 .btn-iprs1 { color: var(--text); }
body.iprs1 .btn-iprs1:hover { border-color: var(--text); color: var(--text); }
body.iprs1 .btn-iprs1.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
body.iprs1 .btn-iprs1.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }

@media (max-width: 700px) {
    .topbar { padding: 8px 12px; gap: 6px; }
    .tb-label, .tb-sep { display: none; }
    .tb-nav { margin-left: 4px; }
    .page { padding: 24px 16px 48px; }
    .page-title { font-size: 1.9rem; }
}

/* ---------- the ds-* pages (users, profile) in the Tasks module's look ---------- */
body.iprs1 .ds-wrap { max-width: none; }
body.iprs1 .ds-form { max-width: 640px; margin: 0; }
body.iprs1 .ds-head { margin-bottom: 22px; align-items: center; }
body.iprs1 .ds-head h3 { font-family: Anton, sans-serif; font-weight: 400; text-transform: uppercase; letter-spacing: .4px; line-height: 1.1;
    font-size: 2.3rem; color: var(--text); margin: 0 0 4px; }
body.iprs1 .ds-sub { color: var(--muted); font-size: .95rem; }

/* buttons: the Tasks module's pill buttons */
body.iprs1 .ds-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border: 0; border-radius: 999px;
    padding: 9px 18px; font-size: .95rem; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .12s, filter .12s; }
body.iprs1 .ds-btn:hover { transform: translateY(-1px); }
body.iprs1 .ds-btn-dark { background: var(--brand); color: #fff; }
body.iprs1 .ds-btn-dark:hover { filter: brightness(1.06); color: #fff; background: var(--brand); }
body.iprs1 .ds-btn-ghost { background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
body.iprs1 .ds-btn-ghost:hover { box-shadow: inset 0 0 0 1.5px #C9CDD4; background: var(--card); color: var(--text); }
body.iprs1 .ds-btn-danger { background: var(--card); color: #B3261E; box-shadow: inset 0 0 0 1.5px #F3C3BE; }
body.iprs1 .ds-btn-danger:hover { background: #FCE8E6; color: #B3261E; }
body.iprs1 .ds-btn-sm { min-height: 34px; padding: 6px 14px; font-size: .88rem; }

/* stat tiles: like the Tasks module's (solid color, white text) */
body.iprs1 .ds-stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 22px; }
body.iprs1 .ds-stat { --c: var(--brand); position: relative; overflow: hidden; border: 0; border-radius: 20px; padding: 18px 20px; background: var(--c); color: #fff;
    box-shadow: 0 12px 28px color-mix(in srgb, var(--c) 28%, transparent); }
body.iprs1 .ds-stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.13); }
body.iprs1 .ds-stat .ico { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.22); color: #fff; }
body.iprs1 .ds-stat .num { color: #fff; font-size: 2.2rem; font-weight: 800; }
body.iprs1 .ds-stat .lbl { color: rgba(255,255,255,.9); letter-spacing: .05em; }
body.iprs1 .ds-navy { --c: #E8520E; }
body.iprs1 .ds-blue { --c: #7C4DDB; }
body.iprs1 .ds-teal { --c: #1E9E5A; }

/* cards and rows */
body.iprs1 .ds-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: none; }
body.iprs1 .ds-form .ds-card { padding: 22px 24px; }
body.iprs1 .ds-row { padding: 14px 18px; gap: 14px; border-bottom: 1px solid var(--line); }
body.iprs1 .ds-row:hover { background: #FAFAFB; }
body.iprs1 .ds-name { font-weight: 800; font-size: 1rem; color: var(--text); }
body.iprs1 .ds-meta { color: var(--muted); font-size: .85rem; }
body.iprs1 .ds-avatar { width: 40px; height: 40px; font-weight: 800; }
body.iprs1 .ds-icon-btn { width: 36px; height: 36px; border-radius: 999px; border: 0; background: none; color: var(--muted); }
body.iprs1 .ds-icon-btn:hover { background: var(--tile); color: var(--text); }
body.iprs1 .ds-icon-btn.danger:hover { background: #FCE8E6; color: #B3261E; }
body.iprs1 .chip { border-radius: 999px; font-size: .75rem; font-weight: 800; padding: 3px 10px; }
body.iprs1 .chip-admin { background: var(--pop); color: var(--text); }
body.iprs1 .chip-neutral { background: var(--tile); color: var(--muted); }

/* form fields: like the Tasks module's */
body.iprs1 .form-label { font-weight: 700; font-size: .88rem; color: var(--text); }
body.iprs1 .form-control, body.iprs1 .form-select { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; }
body.iprs1 .form-control:focus, body.iprs1 .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
body.iprs1 .input-group > .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
body.iprs1 .input-group > .btn:last-of-type { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }
body.iprs1 .input-group > .btn { border: 1.5px solid var(--line); color: var(--text); background: var(--card); font-weight: 600; }
body.iprs1 .input-group > .btn:hover { background: var(--tile); }
body.iprs1 .form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
body.iprs1 .form-check-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
body.iprs1 dl dt { font-weight: 600; }

/* users list: role and actions in fixed columns, so every row lines up */
body.iprs1 .ds-role { flex: 0 0 112px; display: flex; justify-content: center; }
body.iprs1 .ds-role-inline { display: none; margin-left: 6px; }
body.iprs1 .ds-actions { flex: 0 0 auto; display: flex; gap: 4px; }
body.iprs1 .ds-actions form { display: contents; }
body.iprs1 .ds-icon-btn.ph { visibility: hidden; }
body.iprs1 .ds-stat { display: flex; align-items: center; gap: 14px; }


@media (max-width: 700px) {
    .topbar { flex-wrap: nowrap; }
    .tb-module { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    body.iprs1 .ds-head { flex-wrap: wrap; }
    body.iprs1 .ds-head h3 { font-size: 1.9rem; }
    body.iprs1 .ds-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    body.iprs1 .ds-stat { padding: 12px 14px; border-radius: 16px; }
    body.iprs1 .ds-stat .ico, body.iprs1 .ds-stat::after { display: none; }
    body.iprs1 .ds-stat .num { font-size: 1.6rem; }
    body.iprs1 .ds-stat .lbl { font-size: .62rem; }
    body.iprs1 .ds-row { padding: 12px 12px; gap: 10px; }
    body.iprs1 .ds-role { display: none; }
    body.iprs1 .ds-role-inline { display: inline-flex; }
    body.iprs1 .ds-icon-btn { width: 32px; height: 32px; }
}

/* stat tiles: exactly the Tasks module's size */
body.iprs1 .ds-stat { padding: 16px 18px; gap: 14px; }
body.iprs1 .ds-stat .num { font-size: 2rem; line-height: 1.05; }
body.iprs1 .ds-stat .lbl { font-size: .72rem; letter-spacing: .05em; }
body.iprs1 .ds-stat > span:last-child { line-height: 1.2; }
body.iprs1 .ds-stat .lbl { display: block; line-height: 1.2; margin-top: 2px; }
body.iprs1 .ds-stat .lbl { line-height: 14px; margin-top: 0; }
body.iprs1 .ds-stat .num { line-height: 34px; }

/* home: module cards with an illustration as background (generated, see static/img/module-*.webp);
   the art fills the card, the text sits bottom-left on the art's empty corner */
.module.has-art { min-height: 300px; justify-content: flex-end; background: #FBF8F5 var(--art) right top / cover no-repeat; overflow: hidden; }
.module.has-art::before { content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(to top, rgba(251,248,245,.96) 0%, rgba(251,248,245,.85) 34%, rgba(251,248,245,0) 62%); }
.module.has-art > * { position: relative; }
.module.has-art h2 { margin-top: 0; }
.module.has-art p { max-width: 34ch; }
.module.has-art .open { margin-top: 4px; }
.module.has-art .tag { position: absolute; top: 18px; left: 18px; right: auto; }
