/* Stratara Portal. Navy, green and slate from the Stratara mark; light ground, one accent per screen. */
:root {
  --navy: #1C2B42; --green: #2F7D50; --slate: #9AA8B4; --bg: #F3F5F8; --surface: #FFFFFF; --ink: #17212F;
  --muted: #5A6573; --line: #DCE2E9; --err: #B0281F; --err-bg: #FBE9E7; --ok-bg: #E4F1E8; --warn-bg: #FFF2CC;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0E141C; --surface: #161F2A; --ink: #E4E9EF; --muted: #A2ADB9; --line: #2A3542; --err-bg: #3A1714; --ok-bg: #17301F; --warn-bg: #3A2E10; --green: #5CC98A; color-scheme: dark; }
  .logo { background: #FFFFFF; border-radius: 6px; padding: 4px 8px; }
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--green); }
button, .button { font: inherit; cursor: pointer; border: 0; border-radius: 6px; background: var(--navy); color: #fff; padding: 10px 16px; font-weight: 600; text-decoration: none; display: inline-block; }
@media (prefers-color-scheme: dark) { button, .button { background: #2F4A70; } }
button:hover, .button:hover { filter: brightness(1.12); }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
input, select { font: inherit; color: inherit; width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 5px; }
.muted { color: var(--muted); }
.msg { padding: 9px 12px; border-radius: 6px; margin: 12px 0; }
.msg.err { background: var(--err-bg); color: var(--err); }
.msg.ok { background: var(--ok-bg); }
.msg.warn { background: var(--warn-bg); }

/* sign-in screens */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; gap: 18px; }
.auth-brand { text-align: center; }
.auth-brand .logo { width: min(420px, 82vw); height: auto; }
.beta { margin: 18px 0 0; font: 700 clamp(28px, 6vw, 44px)/1 var(--font); letter-spacing: .28em; color: var(--green); padding-left: .28em; }
.card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--navy); border-radius: 10px; padding: 22px 24px 20px; box-shadow: 0 8px 30px rgba(20, 30, 45, .08); }
.card h1 { margin: 0 0 6px; font: 600 22px/1.2 var(--serif); }
.card p { margin: 6px 0; }
.card button, .card .button { width: 100%; margin-top: 18px; text-align: center; }
.card .code { font-size: 22px; letter-spacing: .3em; text-align: center; }
.links { font-size: 13px; color: var(--muted); margin-top: 14px !important; }
.fine { font-size: 12px; color: var(--muted); margin: 0; }
.steps { padding-left: 20px; margin: 12px 0; }
.steps li { margin: 8px 0; }
.qr { display: flex; justify-content: center; padding: 12px; margin: 10px auto; background: #FFFFFF; border-radius: 8px; width: fit-content; }
.key { font: 600 15px/1.4 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .05em; word-break: break-all; }
details summary { cursor: pointer; font-size: 13px; color: var(--green); }
.codes { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.codes li { font: 600 15px ui-monospace, Menlo, Consolas, monospace; text-align: center; padding: 8px; border: 1px dashed var(--line); border-radius: 6px; }

/* portal */
.top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.top .brand .logo { height: 40px; width: auto; display: block; }
.chip { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: #fff; background: var(--green); padding: 3px 8px; border-radius: 4px; }
.crumb { font-weight: 600; }
.who { margin-left: auto; color: var(--muted); font-size: 14px; }
.logout { margin: 0; }
.logout button { padding: 7px 12px; font-size: 13px; }
.home, .users { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }
.home h1, .users h1 { font: 600 28px/1.2 var(--serif); margin: 0 0 6px; }
.lead { color: var(--muted); margin: 0 0 22px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; color: var(--ink); text-decoration: none; min-height: 170px; transition: border-color .15s, transform .15s; }
a.tile:hover { border-color: var(--green); transform: translateY(-2px); }
.tile h2 { font-size: 17px; margin: 0 0 6px; }
.tile p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.tile .go { margin-top: 14px; font-weight: 600; color: var(--green); }
.tile.soon { opacity: .7; }
.tile .tag { margin-top: 14px; align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; }
.tile.admin { border-style: dashed; }
.toolbar { display: flex; gap: 18px; padding: 8px 20px; font-size: 14px; background: var(--bg); border-bottom: 1px solid var(--line); }
body.tool { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
iframe.app { flex: 1; width: 100%; border: 0; background: #fff; }
.back { margin: 0 0 8px; font-size: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-top: 18px; }
.panel h2 { font-size: 17px; margin: 0 0 8px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.grid-form .full { grid-column: 1 / -1; margin-top: 16px; }
.copy { font: 13px ui-monospace, Menlo, Consolas, monospace; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); padding: 7px 8px; }
td { border-bottom: 1px solid var(--line); padding: 8px; vertical-align: middle; }
td.actions { display: flex; gap: 6px; flex-wrap: wrap; }
td.actions form { margin: 0; }
button.small, .button.small { padding: 5px 9px; font-size: 12.5px; font-weight: 600; background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.small.danger { color: var(--err); }
@media (max-width: 600px) { .who { display: none; } .top .brand .logo { height: 30px; } }

.button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.row-buttons { display: flex; gap: 10px; align-items: center; }
.panel.edit { border-color: var(--green); }
.inline-form p { margin: 14px 0 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Per-user tool access checkboxes on the Add/Edit user forms */
.label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 5px; }
.toolsel { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 2px; }
.toolsel .tool { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-weight: 400; font-size: 14px; cursor: pointer; }
.toolsel .tool input { width: auto; padding: 0; margin: 0; }

/* Tool page actions (presentation: download and print) */
.toolbar { align-items: center; flex-wrap: wrap; row-gap: 8px; }
.toolbar-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar .tb-btn { display: inline-block; padding: 5px 12px; font-size: 13px; font-weight: 600; line-height: 1.4; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; cursor: pointer; }
.toolbar .tb-btn:hover { border-color: var(--navy); filter: none; }
.toolbar button.tb-btn { background: var(--navy); border-color: var(--navy); color: #fff; }
@media (prefers-color-scheme: dark) { .toolbar button.tb-btn { background: #2F4A70; border-color: #2F4A70; } }

/* Administrators: change the order of the tools on the home screen */
[hidden] { display: none !important; }
.reorder-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -6px 0 18px; }
.reorder-bar button, .reorder-bar .button { padding: 7px 12px; font-size: 13px; }
.reorder-help { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.tiles.reordering .tile[data-tool] { border-style: dashed; border-color: var(--green); cursor: grab; user-select: none; -webkit-user-select: none; }
.tiles.reordering .tile[data-tool]:hover { transform: none; }
.tiles.reordering .tile .go { display: none; }
.tile.dragging { opacity: .6; cursor: grabbing; box-shadow: 0 10px 30px rgba(20, 30, 45, .18); }
.reorder-ctl { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.reorder-ctl .grip { font-size: 20px; line-height: 1; padding: 4px 8px; color: var(--muted); touch-action: none; cursor: grab; }
.reorder-ctl button { padding: 4px 10px; font-size: 14px; background: transparent; color: var(--ink); border: 1px solid var(--line); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
