/* Deltoid screen stylesheet.

   Hand-written port of the Forvis Mazars design tokens used by the client's
   other INDEV platform: bright blue for the one action and the live spot,
   indigo for identity only, square corners everywhere but pills, two shadow
   levels, a 4px spacing scale. Plain CSS on purpose: Docker is the only host
   dependency and there is no asset build.

   One departure: the system font stack instead of the web-loaded Public Sans,
   so the demo renders the same with no network. */

:root {
  --accent: #0072ce;
  --accent-dark: #005ba5;
  --accent-soft: #e8f2fb;
  --brand: #171c8f;
  --ink: #111418;
  --text: #111418;
  --muted: #6b7280;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-alt: #ebedf1;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --success: #16a34a;
  --success-text: #117a37;
  --success-soft: rgba(22, 163, 74, 0.12);
  --danger: #dc2626;
  --danger-text: #b31d1d;
  --danger-soft: rgba(220, 38, 38, 0.12);
  --warning: #d97706;
  --warning-text: #a35804;
  --warning-soft: rgba(217, 119, 6, 0.12);
  --info: #2563eb;
  --info-soft: rgba(37, 99, 235, 0.12);
  --flag: #fdf6e6;
  --font: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow-1: 0 1px 2px rgba(17, 20, 24, 0.06), 0 1px 3px rgba(17, 20, 24, 0.08);
  --shadow-2: 0 2px 6px rgba(17, 20, 24, 0.10), 0 10px 28px rgba(17, 20, 24, 0.09);
  --speed: 0.15s ease-out;
  --content-max: 1300px;
  --header-height: 60px;
}

/* generic */

* { box-sizing: border-box; }

html, button, input, select, textarea, a {
  font: 400 15px/1.45 var(--font);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

h1 { font-size: 24px; font-weight: 600; line-height: 1.25; margin: 0 0 4px; }
h2 { font-size: 17px; font-weight: 600; margin: 32px 0 12px; }
h2:first-child { margin-top: 0; }
.panel > h2:first-child { margin-top: 0; }
.panel > p:first-child { margin-top: 0; }
.panel > p:last-child { margin-bottom: 0; }

.lede { color: var(--muted); margin: 0 0 24px; }
.small { font-size: 13px; color: var(--muted); }
.muted { color: var(--line-strong); }

code {
  background: var(--surface-alt);
  padding: 1px 5px;
  font-size: 12px;
}

pre.small { white-space: pre-wrap; }

/* app shell: a white side menu with the client wordmark, the section nav and
   the signed-in user, beside a capped, centred content column. The menu folds
   to an icon rail; the choice is remembered per browser. */

.app {
  display: flex;
  align-items: flex-start;
}

.sidemenu {
  display: flex;
  flex-direction: column;
  flex: none;
  position: sticky;
  top: 0;
  width: 280px;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--line);
  transition: width var(--speed);
}

.sidemenu .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  height: var(--header-height);
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}

.sidemenu .logo .label { display: flex; align-items: center; }
.sidemenu .logo .label svg { display: block; height: 34px; width: auto; }

/* the product mark stands in for the wordmark in the rail; hovering it shows
   the expand icon, so the way back is discoverable */
.sidemenu .logo .mark {
  display: none;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text);
  cursor: pointer;
}

.sidemenu .logo .mark svg { display: block; width: 18px; height: 18px; }
.sidemenu .logo .mark .ic-mark { display: flex; color: var(--accent); }
.sidemenu .logo .mark .ic-mark svg { width: 22px; height: 22px; }
.sidemenu .logo .mark .ic-open { display: none; }
.sidemenu .logo .mark:hover { background: var(--surface-alt); }
.sidemenu .logo .mark:hover .ic-mark { display: none; }
.sidemenu .logo .mark:hover .ic-open { display: block; }

.sidemenu .collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: background-color var(--speed);
}

.sidemenu .collapse-btn:hover { background: var(--surface-alt); color: var(--text); }
.sidemenu .collapse-btn svg { width: 18px; height: 18px; }

.sidemenu .nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.sidemenu .nav-section {
  margin: 0;
  padding: 16px 20px 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidemenu .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  margin: 2px 12px;
  padding: 0 8px;
  color: var(--text);
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--speed);
}

.sidemenu .nav-item .ic {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  color: var(--muted);
}

.sidemenu .nav-item .ic svg { width: 18px; height: 18px; }

.sidemenu .nav-item:hover { background: var(--surface-alt); color: var(--text); }

.sidemenu .nav-item.on {
  background: var(--surface-alt);
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 500;
}

.sidemenu .nav-item.on .ic { color: var(--ink); }

.sidemenu button.nav-item {
  width: calc(100% - 24px);
  border: 0;
  background: none;
  text-align: left;
  font-weight: 400;
}

.sidemenu .foot {
  flex: none;
  border-top: 1px solid var(--line);
}

.sidemenu .user {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 20px;
  white-space: nowrap;
}

.sidemenu .user .avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  font-weight: 500;
}

.sidemenu .user .name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  color: var(--muted);
}

.sidemenu .foot form { margin: 0 0 8px; }

/* the icon rail */

.sidemenu.is-collapsed { width: 72px; }
.sidemenu.is-collapsed .label,
.sidemenu.is-collapsed .collapse-btn,
.sidemenu.is-collapsed .user .name { display: none; }
/* a section title becomes a divider, so the institution's items stay grouped */
.sidemenu.is-collapsed .nav-section {
  height: 0;
  margin: 8px 16px;
  padding: 0;
  border-top: 1px solid var(--line);
  font-size: 0;
}
.sidemenu.is-collapsed .logo { justify-content: center; padding: 0; }
.sidemenu.is-collapsed .logo .mark { display: flex; }
.sidemenu.is-collapsed .nav .nav-item { justify-content: center; margin: 2px 8px; padding: 0; }
.sidemenu.is-collapsed button.nav-item { width: auto; margin: 2px 8px; }
.sidemenu.is-collapsed .user { justify-content: center; padding: 0; }

.content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 100vh;
}

main {
  flex: 1;
  width: calc(100% - 64px);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 28px 0 0;
}

.page-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 24px 40px;
  color: var(--muted);
  font-size: 12px;
}

.page-foot svg { display: block; height: 10px; width: auto; }

/* surfaces */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  padding: 20px 24px;
  margin-bottom: 20px;
}

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

.stat {
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.stat b {
  display: block;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

/* tables */

.scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  margin-bottom: 20px;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  background: var(--surface);
}

th, td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  height: 45px;
  background: var(--bg);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  top: 0;
}

tbody td { transition: background-color var(--speed); }
tbody tr:hover td { background: var(--bg); }
tbody tr:last-child td { border-bottom: none; }

td a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}

td a:hover { text-decoration: underline; }

.rationale { color: var(--muted); font-size: 13px; margin-top: 5px; }
.provision { white-space: pre-line; max-width: 640px; }
.edited td { background: var(--flag); }
tbody tr.edited:hover td { background: var(--flag); }

/* verdicts and tags */

.yes { color: var(--success-text); font-weight: 600; }
.no { color: var(--warning-text); font-weight: 600; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
}

.tag-accent {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

/* tabs: the active one carries the accent underline, the same channel as the nav */

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tabs a {
  padding: 10px 16px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--speed);
}

.tabs a:hover { color: var(--text); }

.tabs a.on {
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* controls */

button, .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--speed), box-shadow var(--speed);
}

button:hover, .btn:hover { background: var(--surface-alt); color: var(--text); }

button:focus-visible, .btn:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 1px;
}

button.primary, .btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-1);
}

button.primary:hover, .btn.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: var(--shadow-2);
}

.btn-block { width: 100%; justify-content: center; }

input[type=text], input[type=password], select {
  min-height: 36px;
  padding: 6px 11px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--speed);
}

input[type=text]:focus, input[type=password]:focus, select:focus {
  outline: 0;
  border-color: var(--ink);
  box-shadow: 0 0 0 2px rgba(17, 20, 24, 0.18);
}

/* in-cell controls sit lower and wear the calmer border: a grid of strong
   boxes reads as noise */
td button, td input[type=text] {
  height: 32px;
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
  border-color: var(--line);
}

td form { margin-top: 6px; }
td form:first-child { margin-top: 0; }
td form input[type=text] { width: 100%; min-width: 140px; max-width: 240px; margin-bottom: 4px; }
td button { white-space: nowrap; }

form.inline { display: inline; }
form.inline button { margin-left: 4px; }

.form-actions { margin-top: 12px; }

/* one field of a stacked form */

.field { display: block; }
.field + .field { margin-top: 24px; }

.field .label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.field .input {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  font-size: 15px;
}

/* notes and banners */

.note {
  border-left: 3px solid var(--accent);
  padding: 2px 0 2px 12px;
  margin: 6px 0;
}

.preview-banner {
  background: var(--warning-soft);
  color: var(--warning-text);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 14px;
}

.alert {
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 13px;
}

.alert.error { background: var(--danger-soft); color: var(--danger-text); }

dl.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 24px;
  margin: 0;
}

dl.facts dt { color: var(--muted); font-size: 13px; }
dl.facts dd { margin: 0; }

.pager { margin: 10px 0; }

/* sign-in: the brand intro panel beside a centred card, as on the client's
   other INDEV platform; the panel gives way on narrow viewports */

.auth {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

.auth-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 0 1 46%;
  max-width: 640px;
  position: relative;
  overflow: hidden;
  padding: 48px;
  background: linear-gradient(165deg, #1f25b5, var(--brand) 45%, #10146a);
  color: #fff;
}

.auth-intro::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -90px;
  width: 380px;
  height: 380px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='0.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8Z'/%3E%3Cpath d='M14 3v5h5'/%3E%3Cpath d='M9 13h5'/%3E%3Cpath d='M9 17h3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.07;
  pointer-events: none;
}

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

.auth-intro .app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.auth-intro .app-brand .mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
}

.auth-intro .app-brand .mark svg { display: block; width: 22px; height: 22px; }

.auth-intro .app-brand .name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.auth-intro .headline {
  margin: 0 0 16px;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.25;
}

.auth-intro .desc {
  margin: 0 0 24px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.78);
}

.auth-intro .points {
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-intro .points li {
  position: relative;
  margin-bottom: 12px;
  padding-left: 20px;
  color: rgba(255, 255, 255, 0.88);
}

.auth-intro .points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 40px;
  border: 0;
  box-shadow: var(--shadow-2);
}

.auth-card .brand { display: flex; margin-bottom: 24px; }
.auth-card .brand svg { display: block; height: 52px; width: auto; }

.auth-card .title {
  margin: 0 0 20px;
  font-size: 20px;
  font-weight: 600;
}

.auth-card .form-actions { margin-top: 20px; }
.auth-card .btn-block { height: 44px; }

.auth-card .powered {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.auth-card .powered svg { display: block; height: 11px; width: auto; }

@media (max-width: 900px) {
  .auth-intro { display: none; }
  main { width: calc(100% - 32px); padding-top: 20px; }
}
