/* Apex Portal - same dark look as ARFlow v2 / AutoReport */
:root { --bg:#0F1035; --panel:#171A47; --line:#272B5E; --text:#FFFFFF; --muted:#A6ABCF; --accent:#66BB72; --accent-dark:#3E9A4D; --blue:#6FA8FF; --ok:#66BB72; --bad:#FF6B6B; --warn:#F5B942; }
* { box-sizing:border-box; }
body { margin:0; background:radial-gradient(1200px 600px at 80% -10%, #1E2466 0%, var(--bg) 60%) fixed, var(--bg); color:var(--text); font:15px/1.5 system-ui, Segoe UI, Roboto, sans-serif; }
a { color:var(--blue); text-decoration:none; }
.top { display:flex; align-items:center; gap:28px; padding:12px 24px; background:#0C0D2E; border-bottom:1px solid var(--line); }
.top .brand { display:flex; align-items:center; gap:10px; font-weight:700; color:var(--accent); font-size:18px; letter-spacing:1px; text-transform:uppercase; line-height:1; }
.top .logo { height:18px; width:auto; display:block; }
.loginlogo { text-align:center; margin-bottom:6px; } .loginlogo img { height:33px; }
.top nav a { margin-right:16px; color:var(--muted); } .top nav a:hover { color:var(--text); }
.top .who { margin-left:auto; color:var(--muted); font-size:13px; }
.wrap { max-width:1100px; margin:0 auto; padding:24px 16px; }
h1 { font-size:24px; margin:0 0 12px; } h2.sub { font-size:17px; margin:28px 0 8px; color:var(--muted); }
.muted { color:var(--muted); } .err { color:var(--bad); }
.card { background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:18px; margin-bottom:16px; }
.card.tool { display:block; color:var(--text); } .card.tool:hover { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent); }
.card.tool { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; min-height:150px; text-align:center; }
.card.tool h2 { margin:0; font-size:16px; } .card.tool .tool-icon { width:44px; height:44px; color:var(--accent); } .card.tool .tool-icon svg { width:100%; height:100%; }
.grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(180px,1fr)); gap:14px; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; } .grid2 button { grid-column:1/-1; justify-self:start; }
.login { max-width:380px; margin:10vh auto; } .login h1 { text-align:center; } .login button { width:100%; margin-top:14px; }
label { display:block; margin:10px 0; color:var(--muted); font-size:13px; }
label.inline { display:inline-block; margin:0 10px 0 0; }
input, select, textarea { display:block; font-family:inherit; width:100%; margin-top:4px; padding:9px 10px; background:var(--bg); color:var(--text); border:1px solid var(--line); border-radius:6px; font-size:14px; }
input[type=checkbox] { display:inline; width:auto !important; min-width:0 !important; margin:0 4px 0 0; vertical-align:middle; }
button, .btn { display:inline-block; padding:9px 18px; background:var(--accent); color:#0F1035; font-weight:600; border:0; border-radius:999px; font-size:14px; cursor:pointer; margin-top:8px; }
button:hover { background:#79CC84; } button.danger { background:var(--bad); color:#fff; }
button.small { padding:5px 12px; font-size:13px; margin:0; } td.actions { display:flex; gap:8px; } td.actions form { margin:0; } .btn.ghost { background:transparent; color:var(--text); border:1px solid var(--muted); width:100%; text-align:center; }
.or { text-align:center; color:var(--muted); margin:14px 0 6px; }
.row { display:flex; gap:10px; align-items:end; flex-wrap:wrap; } .row input, .row select { width:auto; min-width:160px; }
.userrow { display:flex; gap:10px; align-items:center; flex-wrap:wrap; } .userrow .userhead { flex-basis:100%; display:flex; justify-content:space-between; }
.userrow input, .userrow select { width:auto; min-width:150px; margin:0; } .userrow .perms { flex-basis:100%; display:flex; flex-direction:column; gap:4px; }
.permrow b { display:inline-block; min-width:120px; font-weight:600; margin-right:10px; }
table { width:100%; border-collapse:collapse; background:var(--panel); border:1px solid var(--line); border-radius:10px; overflow:hidden; font-size:14px; }
th, td { padding:9px 12px; text-align:left; border-bottom:1px solid var(--line); } th { color:var(--muted); font-weight:600; }
td.detail { max-width:480px; word-break:break-all; font-family:ui-monospace, Consolas, monospace; font-size:12px; }
.pill { display:inline-block; padding:1px 8px; border-radius:999px; font-size:12px; background:var(--line); }
.pill.done { background:#1B4A2A; color:#8FE39A; } .pill.failed { background:#4A1D1D; color:var(--bad); }
.pill.running { background:#1E3A6B; color:var(--blue); } .pill.queued { background:#4A3A14; color:var(--warn); }
.bar { height:8px; background:var(--line); border-radius:4px; overflow:hidden; margin:10px 0; } .bar div { height:100%; background:var(--accent); transition:width .4s; }
.result { margin-top:14px; } .result dl { display:grid; grid-template-columns:max-content 1fr; gap:4px 16px; margin:10px 0 0; font-size:14px; }
.result dt { color:var(--muted); text-transform:capitalize; } .result dd { margin:0; }
.log { background:#0A0B26; border:1px solid var(--line); border-radius:8px; padding:12px; min-height:200px; max-height:60vh; overflow:auto; font:13px/1.45 ui-monospace, Consolas, monospace; white-space:pre-wrap; }

/* account scope chips on the Users page */
.chips { display:inline-flex; flex-wrap:wrap; gap:6px; margin-left:14px; vertical-align:middle; }
.chip { display:inline-flex; align-items:center; cursor:pointer; margin:0; }
.chip input { position:absolute; opacity:0; width:0; height:0; }
.chip span { padding:2px 10px; border-radius:999px; border:1px solid var(--line); color:var(--muted); font-size:12px; transition:all .15s; }
.chip:hover span { border-color:var(--accent); }
.chip input:checked + span { background:rgba(102,187,114,.18); border-color:var(--accent); color:var(--text); }
.chip.all input:checked + span { background:var(--accent); color:#0B0C2A; font-weight:600; }
/* Credentials page tabs */
.ctabs { display:flex; gap:6px; border-bottom:1px solid var(--line); margin:4px 0 18px; }
.ctabs a { padding:10px 16px; color:var(--muted); border-bottom:2px solid transparent; cursor:pointer; text-decoration:none; }
.ctabs a .n { font-size:11px; color:var(--muted); margin-left:6px; background:var(--line); border-radius:999px; padding:1px 7px; }
.ctabs a.on { color:var(--text); border-color:var(--accent); }
section[data-tab][hidden] { display:none !important; }
.nowrap { white-space:nowrap; }
.mbox { white-space:normal; margin:6px 0; } .mbox + .mbox { border-top:1px solid var(--line); padding-top:6px; } .mbox .pill { margin:0 4px; }
.mbox .sub { font-size:12px; color:var(--muted); } .mbox .sub a { margin-left:6px; font-size:12px; }
button.linkbtn { background:none; border:0; padding:0; margin:0 0 0 6px; font-size:12px; cursor:pointer; color:var(--accent); width:auto; } button.linkbtn.danger-text { color:#F08F8F; }
h3.sub { margin:18px 0 8px; font-size:14px; color:var(--muted); font-weight:500; }
.grid2 label[hidden] { display:none !important; }
.ok { color:var(--good, #1f9d55); }
.pwform { display:grid; gap:12px; max-width:420px; }
.pwform label { display:grid; gap:4px; }
.who a + a { margin-left:12px; }
/* Users list + user page (2026-11-02) */
.uhead { display:flex; align-items:center; justify-content:space-between; } .uhead h1 { margin:0; } .uhead .btn { margin:0; }
.uhead2 { display:flex; align-items:baseline; gap:14px; margin:8px 0 14px; } .uhead2 h1 { margin:0; } .grow { flex:1; } .r { text-align:right; }
.ubar { display:flex; gap:10px; align-items:center; margin:16px 0 14px; flex-wrap:wrap; } .ubar input { width:auto; min-width:280px; margin:0; }
.seg { display:inline-flex; border:1px solid var(--line); border-radius:999px; overflow:hidden; } .seg span { padding:6px 14px; font-size:13px; color:var(--muted); cursor:pointer; } .seg span.on { background:var(--line); color:#fff; }
.ulist .nm { font-weight:600; } .ulist .em { color:var(--muted); font-size:12px; } .ulist tr[data-href] { cursor:pointer; } .ulist tr[data-href]:hover td { background:#1C2056; }
.tl { display:flex; gap:4px; flex-wrap:wrap; } .tl i { font-style:normal; font-size:11px; padding:1px 7px; border-radius:999px; background:#202462; color:#C8CCF0; }
.st { font-size:12px; padding:1px 8px; border-radius:999px; } .st.on { background:#1B4A2A; color:#8FE39A; } .st.off { background:#3A2030; color:#FF9B9B; }
.role { font-size:12px; padding:1px 8px; border-radius:999px; background:#272B5E; } .role.r-superadmin { background:#3A2A62; color:#CDB8FF; } .role.r-admin { background:#1E3A6B; color:#9CC3FF; }
.ulist tr[hidden], .uacc[hidden], .adminall[hidden], section[hidden] { display:none !important; }
.ug4 { display:grid; grid-template-columns:2fr 1fr 1fr 2fr; gap:12px; align-items:end; } .ug4 label { margin:0; } .ug4 .ufoot { grid-column:1/-1; }
.ufoot { display:flex; gap:10px; justify-content:flex-end; margin-top:14px; } .ufoot .btn, .ufoot button { margin:0; } .btn.ghost { background:transparent; color:var(--text); border:1px solid var(--muted); }
.okmsg { color:var(--ok); }
.uacc td, .uacc th { vertical-align:top; padding:12px; } .uacc .tn { font-weight:600; white-space:nowrap; } .uacc .tn small { display:block; color:var(--muted); font-weight:400; font-size:12px; white-space:normal; }
.pp { display:flex; gap:6px; flex-wrap:wrap; } .pp label { margin:0; display:inline-flex; align-items:center; gap:4px; padding:4px 10px; border:1px solid var(--line); border-radius:999px; font-size:13px; color:#C8CCF0; cursor:pointer; }
.pp label:has(input:checked) { background:#1B4A2A; border-color:#2F6B40; color:#BFF5C6; } .pp input, .ac .chip input { display:none; }
.pp label:has(input:checked)::before { content:"\2713"; }
.ac .sum { font-size:13px; margin-bottom:6px; } .ac .sum b { color:#fff; } .ac .grp { margin-top:6px; font-size:12px; color:var(--muted); display:flex; flex-wrap:wrap; gap:5px; align-items:center; } .ac .gl { min-width:58px; }
.ac .chip { margin:0; display:inline-block; font-size:12px; padding:2px 9px; border-radius:999px; border:1px solid var(--line); color:#C8CCF0; cursor:pointer; }
.ac .chip:has(input:checked) { background:#1E3A6B; border-color:#2E5596; color:#CFE0FF; } .ac .chip.all { border-style:dashed; }
.ac .note { font-size:12px; color:var(--warn); margin-top:6px; } .ac .noacc { display:none; }
tr.utool.off .tn, tr.utool.off .pp label { opacity:.55; } tr.utool.off .ac > :not(.noacc) { display:none; } tr.utool.off .ac .noacc { display:inline; }
@media (max-width:800px) { .ug4 { grid-template-columns:1fr; } .uacc th:nth-child(3) { width:auto; } }
.ufoot .btn.ghost { width:auto; padding:9px 18px; }
.crumb { margin:0 0 6px; font-size:13px; color:var(--muted); } .crumb a { color:var(--muted); } .crumb a:hover { color:var(--accent); }
.mailacts { display:flex; gap:8px; flex-wrap:wrap; align-items:center; } .mailacts form { margin:0; } .mailacts .btn.ghost { width:auto; padding:5px 12px; font-size:13px; }
/* Phones (2026-11-30): one safety net for every page that loads app.css. Tool CSS loads after this file,
   so these rules use "body ." to win; tools keep their own look above 640px. */
@media (max-width:640px) {
  body .top { gap:10px 14px; padding:10px 14px; flex-wrap:wrap; }
  body .top nav { display:flex; gap:12px; flex-wrap:wrap; } body .top nav a { margin-right:0; }
  body .top .who { margin-left:auto; display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
  body .top .who .pill { display:none; } body .who a + a { margin-left:0; }
  body .wrap { padding:14px 12px; }
  body h1 { font-size:21px; }
  /* tool title row: tabs drop under the title and scroll sideways */
  body h1 .tabs, body .tabs { flex-wrap:nowrap; overflow-x:auto; max-width:100%; margin-left:0; padding-bottom:4px; scrollbar-width:none; }
  body .tabs::-webkit-scrollbar { display:none; } body .tabs a { white-space:nowrap; flex:0 0 auto; }
  body h1:has(> .tabs) { flex-wrap:wrap; gap:8px 16px; } body h1 > .tabs { flex-basis:100%; }
  /* tables scroll inside their box instead of widening the page */
  body table { display:block; overflow-x:auto !important; max-width:100% !important; width:100%; -webkit-overflow-scrolling:touch; }
  body table thead, body table tbody, body table tr { width:max-content; min-width:100%; }
  body th, body td { padding:8px 10px; }
  /* nothing wider than the screen */
  body .card, body .row, body form, body main > * { max-width:100%; min-width:0; }
  body input, body select, body textarea, body button, body .btn, body img, body svg, body canvas { max-width:100%; }
  body .grid { grid-template-columns:1fr 1fr; gap:10px; } body .card.tool { min-height:110px; padding:14px; }
  body .ubar input { min-width:0; width:100%; }
  body .ctabs { overflow-x:auto; flex-wrap:nowrap; scrollbar-width:none; } body .ctabs a { white-space:nowrap; flex:0 0 auto; }
  body .row input, body .row select, body .userrow input, body .userrow select { min-width:0; }
}
