/* Devgiri Export — Tools Portal
   Palette intentionally mirrors the StockFlow tool so the portal and the tools
   read as one product. */

:root {
  --brand-dark: #048c54;
  --brand: #1a9464;
  --accent: #4faa86;
  --mint: #77c0a4;
  --tint: #cfe7dd;

  --ink: #0d2b21;
  --ink-soft: #3f5c51;
  --ink-faint: #7c968b;
  --surface: #ffffff;
  --bg: #f2f8f5;
  --border: #dbe9e2;

  --danger: #c0432f;
  --danger-tint: #fbe6e1;
  --ok: #167a53;
  --ok-tint: #dff2e8;
  --warn: #8a6410;
  --warn-tint: #faf1dd;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(4, 25, 18, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(4, 25, 18, 0.18);
  --shadow-lg: 0 24px 60px -20px rgba(4, 25, 18, 0.35);

  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-dark); }
::selection { background: var(--mint); color: #04241a; }

button, input, select, textarea { font-family: inherit; font-size: 14px; }
button { cursor: pointer; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px;
  border: 1px solid transparent; border-radius: 9px;
  background: var(--brand); color: #fff;
  font-size: 13.5px; font-weight: 600; letter-spacing: 0.1px;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--brand-dark); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(79, 170, 134, 0.4); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.btn-block { width: 100%; }
.btn-lg { padding: 12px 18px; font-size: 15px; }

.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--border); }
.btn-ghost:hover { background: #fff; color: var(--ink); border-color: var(--accent); }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #a3341f; }

.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 7px; }

/* ---------------------------------------------------------- fields */

.field { margin-bottom: 15px; }
.field label {
  display: block; margin-bottom: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
}
.field .hint { margin-top: 5px; font-size: 11.5px; color: var(--ink-faint); }

.input, select.input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 170, 134, 0.22); }

.checkline { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.checkline input { margin-top: 3px; flex-shrink: 0; }
.checkline label { font-size: 13px; color: var(--ink-soft); font-weight: 500; margin: 0; }

/* ---------------------------------------------------------- alerts */

.alert {
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 16px;
  border-left: 3px solid transparent;
}
.alert-error { background: var(--danger-tint); color: #7d2a1b; border-left-color: var(--danger); }
.alert-ok { background: var(--ok-tint); color: #0f5b3d; border-left-color: var(--ok); }
.alert-warn { background: var(--warn-tint); color: var(--warn); border-left-color: var(--warn); }

/* ---------------------------------------------------------- sign in
 *
 * The one page anybody outside the team ever sees, and the first thing the
 * team sees every morning.
 *
 * Every effect here is CSS. The page's policy allows no CDN and no outside
 * images, which is a constraint worth having: a sign-in page that waits on a
 * font server is one that is sometimes slow for reasons nobody can see, and
 * this way the whole thing arrives in one request.
 */

.auth-wrap { display: flex; min-height: 100vh; }

/* --- the brand half --------------------------------------------------- */

.auth-aside {
  position: relative; overflow: hidden;
  width: 47%; max-width: 600px;
  /* Deep rather than mid-green. On a dark ground a light reads as light; on a
     bright one the same light reads as a smudge. */
  background:
    radial-gradient(100% 80% at 18% 6%, rgba(28, 200, 126, 0.30) 0%, rgba(28, 200, 126, 0) 58%),
    radial-gradient(70% 60% at 92% 96%, rgba(6, 148, 92, 0.42) 0%, rgba(6, 148, 92, 0) 62%),
    linear-gradient(158deg, #05593a 0%, #023324 62%, #01271c 100%);
  color: #eafff4;
  padding: 52px 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  isolation: isolate;
}

/* A ruled grid, so the panel has a surface rather than being a slab of colour.
   Masked so it never runs under the text, where it would only be noise. */
.auth-aside::before {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(130% 90% at 26% -6%, #000 0%, transparent 70%);
  mask-image: radial-gradient(130% 90% at 26% -6%, #000 0%, transparent 70%);
}

/* One slow light, long enough that nobody ever catches it moving. The panel
   just looks alive rather than printed. */
.auth-aside::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 620px; height: 620px; right: -220px; bottom: -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120, 255, 198, 0.18) 0%, rgba(120, 255, 198, 0) 66%);
  animation: auth-drift 26s ease-in-out infinite;
}
@keyframes auth-drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(-5%, -7%, 0) scale(1.14); }
}

.auth-aside > * { position: relative; }

.auth-aside h2 {
  font-size: clamp(30px, 3vw, 40px); line-height: 1.12; font-weight: 680;
  margin: 0 0 18px; letter-spacing: -1px;
}
.auth-aside h2 em {
  font-style: normal;
  background: linear-gradient(94deg, #c6ffe3 0%, #6fe0b4 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-aside p {
  color: rgba(206, 240, 224, 0.78); font-size: 15px;
  max-width: 42ch; margin: 0; line-height: 1.65;
}

/* A hairline above the list, fading out westward: a rule that does not shout. */
.auth-points {
  list-style: none; padding: 26px 0 0; margin: 30px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  -webkit-mask-image: linear-gradient(90deg, #000 60%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 60%, transparent 100%);
}
.auth-points li {
  display: flex; gap: 13px; align-items: center;
  font-size: 13.5px; color: rgba(226, 250, 240, 0.9); margin-bottom: 15px;
}
.auth-points li:last-child { margin-bottom: 0; }
.auth-points .tick {
  width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #8ff0c4;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.05));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.10);
}
.auth-points svg { width: 14px; height: 14px; }

.auth-aside-foot {
  display: flex; align-items: center; gap: 9px;
  font-size: 12px; color: rgba(206, 240, 224, 0.55);
}
.auth-aside-foot svg { width: 13px; height: 13px; flex-shrink: 0; }

/* --- the form half ----------------------------------------------------- */

.auth-main {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
  background:
    radial-gradient(90% 55% at 50% -10%, #ffffff 0%, rgba(255, 255, 255, 0) 72%),
    var(--bg);
}

.auth-card {
  position: relative;
  width: 100%; max-width: 404px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 38px 32px;
  /* Three layers rather than one: a contact shadow, a lift, and a soft ambient
     spread. One blur at one opacity is what makes a card look pasted on. */
  box-shadow:
    0 1px 2px rgba(4, 30, 20, 0.05),
    0 6px 14px -8px rgba(4, 30, 20, 0.10),
    0 32px 60px -32px rgba(4, 30, 20, 0.30);
}
/* A hairline of brand colour on the top edge, fading at both ends. */
.auth-card::before {
  content: ""; position: absolute; left: 28px; right: 28px; top: -1px; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--brand) 22%, var(--mint) 50%, var(--brand) 78%, transparent);
  opacity: 0.75;
}

/* Shown only when the brand panel is not, so a phone still knows whose this is. */
.auth-card .brand { display: none; margin-bottom: 26px; }

.auth-card h1 {
  font-size: 26px; font-weight: 680; margin: 0 0 7px; letter-spacing: -0.5px;
}
.auth-card .lede { color: var(--ink-faint); font-size: 13.5px; margin: 0 0 28px; }

.auth-field { position: relative; margin-bottom: 17px; }
.auth-field label {
  display: block; margin-bottom: 7px;
  font-size: 12px; font-weight: 650; color: var(--ink-soft); letter-spacing: 0.2px;
}
.auth-field .icon {
  position: absolute; left: 14px; bottom: 16px;
  width: 16px; height: 16px; color: #9fb5ab; pointer-events: none;
  transition: color 0.18s ease;
}
.auth-field .input {
  height: 48px; padding-left: 41px; border-radius: 12px;
  background: #fbfdfc;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.auth-field .input:hover { background: #fff; border-color: #c8ddd3; }
.auth-field .input:focus {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(26, 148, 100, 0.13);
}
.auth-field .input:focus ~ .icon { color: var(--brand); }
.auth-field .input::placeholder { color: #adc2b8; }

/* Reading your own password back is the difference between one attempt and
   three, and three is what starts the lockout. */
.pw-toggle {
  position: absolute; right: 7px; bottom: 9px;
  width: 34px; height: 34px; padding: 0;
  display: none; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 9px;
  color: #9fb5ab; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.pw-toggle:hover { background: #eef5f1; color: var(--ink-soft); }
.pw-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(26, 148, 100, 0.25); }
.pw-toggle svg { width: 17px; height: 17px; }
.pw-toggle .eye-off { display: none; }
.pw-toggle[aria-pressed="true"] .eye-on { display: none; }
.pw-toggle[aria-pressed="true"] .eye-off { display: block; }
/* Revealed by the script that drives it, so it is never a button doing nothing. */
.js .pw-toggle { display: flex; }
.js .auth-field .input#password { padding-right: 46px; }

/* The eye on an ordinary form, rather than on the sign-in page.
 *
 * The wrapper exists so the button is placed against the input and nothing
 * else. Hanging it off .field the way the sign-in page hangs it off
 * .auth-field would measure from the bottom of the whole field — and a field
 * with a hint under it, like "At least 8 characters", would put the eye
 * somewhere down beside the hint. Centring on the wrapper also means the
 * button stays put whatever height the input happens to be. */
.pw-wrap { position: relative; display: block; }
.js .pw-wrap .input { padding-right: 42px; }
.pw-wrap .pw-toggle {
  top: 50%; bottom: auto; right: 5px;
  transform: translateY(-50%);
  width: 30px; height: 30px;
}

.caps-hint {
  display: none; align-items: center; gap: 6px;
  margin-top: 8px; font-size: 11.5px; font-weight: 600; color: var(--warn);
}
.caps-hint.on { display: flex; }
.caps-hint svg { width: 13px; height: 13px; flex-shrink: 0; }

.btn-signin {
  width: 100%; height: 48px; margin-top: 10px;
  border-radius: 12px; font-size: 15px; font-weight: 650; letter-spacing: 0.1px;
  background: linear-gradient(180deg, #1fa774 0%, var(--brand-dark) 100%);
  /* The inset highlight is what stops a gradient button reading as a flat
     rectangle with a gradient painted on it. */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 1px 2px rgba(3, 60, 40, 0.22),
    0 10px 22px -12px rgba(4, 140, 84, 0.85);
  transition: transform 0.12s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
/* Directly under the sign-in button, where somebody who has just failed to
   sign in is already looking. In the footnote below the card it read as a
   remark rather than as the thing to press. */
.auth-forgot { margin: 14px 0 0; text-align: center; font-size: 13.5px; }
.auth-forgot a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--border); padding-bottom: 1px; }
.auth-forgot a:hover { color: var(--brand-dark); border-bottom-color: var(--brand); }

.btn-signin:hover {
  filter: brightness(1.07);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 2px 5px rgba(3, 60, 40, 0.24),
    0 16px 30px -14px rgba(4, 140, 84, 0.95);
}
.btn-signin:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 2px rgba(2, 45, 30, 0.35), 0 1px 2px rgba(3, 60, 40, 0.2);
}
.btn-signin:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(26, 148, 100, 0.3); }

.auth-foot {
  margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--ink-faint); line-height: 1.6;
}

@media (max-width: 940px) {
  .auth-aside { display: none; }
  .auth-main { background: var(--bg); }
  .auth-card {
    border: none; box-shadow: none; background: transparent;
    padding: 0; max-width: 368px;
  }
  .auth-card::before { display: none; }
  .auth-card .brand { display: inline-flex; }
}

/* The mark, given the same care as everything else on the page. Scoped to the
   sign-in screen so the topbar's smaller one is left as it is. */
.auth-aside .brand-mark,
.auth-card .brand-mark {
  width: 40px; height: 40px; border-radius: 12px; font-size: 15px;
  letter-spacing: 0.5px;
}
.auth-aside .brand-mark {
  background: linear-gradient(150deg, #a8f0cd 0%, #5cc79a 55%, #3aa87c 100%);
  color: #03301f;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    0 6px 16px -6px rgba(0, 0, 0, 0.5);
}
.auth-aside .brand-text b { font-size: 17px; letter-spacing: -0.2px; }
.auth-aside .brand-text span { letter-spacing: 1.8px; font-size: 9.5px; }

.auth-card .brand-mark {
  background: linear-gradient(150deg, var(--mint) 0%, var(--brand) 100%);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 4px 12px -5px rgba(4, 140, 84, 0.6);
}

@media (prefers-reduced-motion: reduce) {
  .auth-aside::after { animation: none; }
  .btn-signin, .auth-field .input, .auth-field .icon, .pw-toggle { transition: none; }
}


/* ---------------------------------------------------------- brand */

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--mint), var(--tint));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 14px;
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 16px; font-weight: 600; letter-spacing: 0.2px; }
.brand-text span {
  font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--ink-faint); opacity: 0.9;
}
/* On the dark green surfaces the muted grey would be unreadable. */
.auth-aside .brand-text span,
.topbar .brand-text span { color: var(--tint); opacity: 0.85; }
.auth-aside .brand-text b,
.topbar .brand-text b { color: #fff; }

/* ---------------------------------------------------------- shell */

.shell { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 26px;
  background: linear-gradient(185deg, var(--brand-dark) 0%, #036844 100%);
  color: #eafff4;
}
.topbar .brand-text b { color: #fff; }
.topbar .brand-mark { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }

.topnav { display: flex; gap: 3px; margin-left: 10px; }
.topnav a {
  padding: 7px 12px; border-radius: 8px;
  color: #cfe7dd; text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.topnav a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.topnav a.active { background: rgba(255, 255, 255, 0.17); color: #fff; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who { text-align: right; line-height: 1.25; }
.who b { display: block; font-size: 13px; font-weight: 600; color: #fff; }
.who span { font-size: 11px; color: var(--tint); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.linkout {
  background: rgba(255, 255, 255, 0.12); border: none; color: #eafff4;
  padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 600;
}
.linkout:hover { background: rgba(255, 255, 255, 0.22); color: #fff; }

.page { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 30px 26px 70px; }
.page-narrow { max-width: 620px; }

.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 24px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.2px; }
.page-head p { margin: 0; color: var(--ink-faint); font-size: 13.5px; }
.page-head .row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head .row .spacer { margin-left: auto; }

.foot {
  padding: 18px 26px; border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--ink-faint); text-align: center;
}

/* ---------------------------------------------------------- cards */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 18px; }
.card h2 { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.card .card-sub { color: var(--ink-faint); font-size: 12.5px; margin: 0 0 18px; }

.section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.1px;
  color: var(--ink-faint); margin: 30px 0 12px;
}
.section-title:first-child { margin-top: 0; }

/* ------------------------------------------------- dashboard strip --
 *
 * Four numbers across the top, and each one is a link. A figure nobody can
 * act on is decoration; every one of these has a page behind it that answers
 * whatever the number makes you want to ask next.
 */

.stat-strip {
  display: grid; gap: 12px; margin-bottom: 22px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.stat-tile {
  display: flex; flex-direction: column; gap: 1px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: 13px 16px;
  text-decoration: none; color: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.stat-tile:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.stat-tile:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(79, 170, 134, 0.4); }
.stat-tile .k {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.9px;
  text-transform: uppercase; color: var(--ink-faint);
}
.stat-tile .v {
  font-size: 25px; font-weight: 600; color: var(--brand-dark);
  font-variant-numeric: tabular-nums; line-height: 1.15;
}
.stat-tile .n { font-size: 11.5px; color: var(--ink-faint); }

/* --------------------------------------------------- activity feed -- */

.panel-head { display: flex; align-items: baseline; gap: 12px; }
.panel-head .section-title { flex: 1; }
.panel-more {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-faint);
  text-decoration: none; transition: color 0.16s ease;
}
.panel-more:hover { color: var(--brand-dark); }
.panel-more svg { width: 13px; height: 13px; }

/* A list rather than a table: five lines of "who did what" do not need column
   headings, and a table of them on a landing page reads as a report nobody
   asked for. */
.feed {
  list-style: none; margin: 0; padding: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.feed-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.feed-row:last-child { border-bottom: none; }

.feed-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent);
}
.feed-dot.bad { background: var(--danger); }

.feed-who { font-weight: 600; white-space: nowrap; }
.feed-what {
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--ink-soft); white-space: nowrap;
}
/* Takes the slack, and gives it up first when the row runs out of room. */
.feed-detail {
  flex: 1; min-width: 0; color: var(--ink-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.feed-when { color: var(--ink-faint); font-size: 11.5px; white-space: nowrap; }

/* On a phone the five parts become two lines rather than five ellipses. */
@media (max-width: 620px) {
  .feed-row { flex-wrap: wrap; gap: 4px 8px; }
  .feed-detail { flex-basis: 100%; white-space: normal; }
  .feed-when { margin-left: auto; }
}

/* ------------------------------------------------------ tool grid --
 *
 * A row of cards, not a column of them.
 *
 * The page used to draw one grid per category, which with one tool in each
 * meant three grids of a single card: nothing could ever sit beside anything,
 * and the dashboard was a tall stack of boxes however wide the window was.
 * There is one grid now, and the category is a chip on the card.
 *
 * Inside the card the icon sits beside the name rather than above it. That is
 * two lines of height saved on every card, and it is what lets a card be short
 * enough that three of them read as a row rather than as three posters.
 */

.tool-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  align-items: stretch;
}

.tool-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 17px 18px 14px;
  text-decoration: none; color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.tool-card:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(79, 170, 134, 0.4); }

/* Icon and name, side by side. */
.tool-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.tool-card-title { min-width: 0; }

.tool-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 14.5px;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.tool-card h3 {
  font-size: 15.5px; font-weight: 600; margin: 0;
  /* A long tool name shortens rather than pushing the icon out of line. */
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tool-card .tool-tagline {
  font-size: 10.5px; letter-spacing: 0.9px; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Clamped to two lines, so one tool with a long description cannot make every
   card in the row as tall as itself. */
.tool-card p {
  margin: 0; font-size: 12.75px; color: var(--ink-soft); line-height: 1.5;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
}

/* Pushed to the bottom by the margin-top:auto, so the footers of a row line up
   even when one description runs to two lines and another to one. */
.tool-card-foot {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: auto; padding-top: 13px;
  border-top: 1px solid var(--border);
}
.tool-card-foot .spacer { flex: 1; }

.tool-chip {
  padding: 2px 8px; border-radius: 6px;
  background: var(--bg); border: 1px solid var(--border); color: var(--ink-faint);
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  white-space: nowrap;
}
/* A tool that is not finished says so on the card itself, rather than only in
   whatever people were told when it appeared. */
.tool-chip-status {
  background: var(--warn-tint, #faf1dd); color: var(--warn, #8a6100);
  border-color: rgba(184, 134, 11, 0.28);
}

.tool-open {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-faint);
  transition: color 0.16s ease;
}
.tool-card:hover .tool-open { color: var(--brand-dark); }
.tool-open svg { width: 13px; height: 13px; transition: transform 0.16s ease; }
.tool-card:hover .tool-open svg { transform: translateX(3px); }

/* Nothing above should animate for somebody who has asked the system not to. */
@media (prefers-reduced-motion: reduce) {
  .tool-card, .tool-open, .tool-open svg { transition: none; }
  .tool-card:hover { transform: none; }
  .tool-card:hover .tool-open svg { transform: none; }
}

/* The shared table's own rules — sortable headings and the strip under a
   list — live in public/css/table.css, which every page carrying one loads
   alongside this. They are not here because there is no version of them that
   belongs to one stylesheet.
 */

/* ------------------------------------------------------- empty */

.empty {
  border: 1px dashed var(--border); border-radius: var(--radius);
  background: var(--surface);
  padding: 46px 28px; text-align: center;
}
.empty svg { width: 34px; height: 34px; color: var(--ink-faint); opacity: 0.6; margin-bottom: 12px; }
.empty h3 { font-size: 16px; font-weight: 600; margin: 0 0 6px; }
.empty p { margin: 0 auto; color: var(--ink-faint); font-size: 13.5px; max-width: 46ch; }

/* ------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }

table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; padding: 11px 14px;
  background: #eef6f2; color: var(--ink-soft);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #f7fbf9; }
table.data td.mono, table.data td .mono { font-family: var(--font-mono); font-size: 12px; }

.pill {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
}
.pill-admin { background: var(--brand-dark); color: #fff; }
.pill-user { background: var(--tint); color: #0f5b3d; }
.pill-off { background: #ecebe9; color: #6b6b6b; }
.pill-lock { background: var(--danger-tint); color: #7d2a1b; }

.rowactions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ------------------------------------------- inline user editor */

tr.editor-row > td { background: #f7fbf9; padding: 0; border-bottom: 2px solid var(--border); }
tr.editor-row:hover > td { background: #f7fbf9; }
table.data tbody tr.editor-row:hover { background: transparent; }

.editor-box {
  display: grid; gap: 30px;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  padding: 22px 20px 24px;
}
.editor-col h4 {
  margin: 0 0 14px;
  font-size: 11px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--ink-faint);
}
@media (max-width: 820px) {
  .editor-box { grid-template-columns: 1fr; gap: 24px; }
}

/* ------------------------------------------------------ details */

details.panel {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); margin-bottom: 18px; box-shadow: var(--shadow-sm);
}
details.panel > summary {
  padding: 15px 20px; cursor: pointer; list-style: none;
  font-size: 14.5px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 9px;
}
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::before {
  content: '+'; font-family: var(--font-mono); font-size: 15px; font-weight: 700;
  color: var(--brand); width: 20px; height: 20px; border-radius: 6px;
  background: var(--tint); display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
details.panel[open] > summary::before { content: '\2212'; }
details.panel > .panel-body { padding: 4px 20px 20px; border-top: 1px solid var(--border); padding-top: 18px; }

/* --------------------------------------------------- checkboxes */

.tool-picker {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  margin-top: 6px;
}
.tool-pick {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px;
  background: #fbfdfc; font-size: 13px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.tool-pick:hover { border-color: var(--accent); background: #fff; }
.tool-pick input { margin: 0; flex-shrink: 0; }
.tool-pick .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* One row per tool, with what this person may do in it. Wider cells than the
   tick-list above because each now carries a choice rather than a yes or no. */
.tool-grants {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  margin-top: 6px;
}
.tool-grant {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 11px; border: 1px solid var(--border); border-radius: 9px;
  background: #fbfdfc; font-size: 13px;
}
.tool-grant .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.tool-grant .tg-name { flex: 1; cursor: pointer; margin: 0; font-weight: 500; }
/* Sized to the longest option so the row does not resize as it is changed. */
.tool-grant .input { width: auto; min-width: 124px; padding: 5px 8px; font-size: 12.5px; }

.form-grid { display: grid; gap: 0 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }

  /* Wrap the bar onto two lines rather than dropping the admin links, which
     would leave an admin with no way to reach Users on a phone. */
  .topbar { flex-wrap: wrap; gap: 10px 14px; padding: 11px 16px; }
  .topbar-right { margin-left: auto; }
  .who { display: none; }
  .topnav {
    order: 3; width: 100%; margin-left: 0;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .topnav a { white-space: nowrap; }

  .page { padding: 22px 16px 50px; }
  .page-head h1 { font-size: 21px; }
}

.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 6px; }

/* A line of controls above a table — a search box, a pair of dates, a
   download. Here rather than inline in a template because Users and Activity
   both have one, and the last time a few rules like these were pasted per page
   one page quietly never got its copy. `.push` sends what follows to the right
   edge; portal.css has no general-purpose spacer and does not need one. */
.filter-bar {
  display: flex; align-items: flex-end; gap: 8px;
  flex-wrap: wrap; margin: 18px 0 14px;
}
.filter-bar .field { margin-bottom: 0; }
.filter-bar .push { margin-left: auto; }

/* ---------------------------------------------------------- misc */

.inline-form { display: inline; }
.muted { color: var(--ink-faint); }
.nowrap { white-space: nowrap; }

.error-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 40px 24px; text-align: center;
}
.error-page .box { max-width: 440px; }
.error-page h1 { font-size: 22px; font-weight: 600; margin: 18px 0 8px; }
.error-page p { color: var(--ink-soft); font-size: 14px; margin: 0 0 24px; }
.error-page .code {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; text-align: left; white-space: pre-wrap; word-break: break-word;
  margin-bottom: 22px; max-height: 260px; overflow: auto;
}
