:root {
  --ink: #172438;
  --muted: #6c788b;
  --faint: #9aa6b7;
  --line: #e5eaf0;
  --page: #f3f6fa;
  --card: #ffffff;
  --navy: #102238;
  --navy-soft: #1b3552;
  --blue: #1261d3;
  --blue-soft: #eaf2ff;
  --green: #1f9d68;
  --green-soft: #e8f7f0;
  --orange: #d97716;
  --orange-soft: #fff2df;
  --red: #d44343;
  --red-soft: #fff0f0;
  --shadow: 0 18px 50px rgba(37, 72, 112, 0.09);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--page);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--page); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 28px 20px 22px;
  display: flex; flex-direction: column; color: #fff; background: var(--navy);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; }
.brand-mark { position: relative; width: 42px; height: 42px; border-radius: 13px; background: #fff; }
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; left: 50%; top: 50%; border-radius: 3px;
  background: var(--blue); transform: translate(-50%, -50%);
}
.brand-mark::before { width: 23px; height: 6px; }
.brand-mark::after { width: 6px; height: 23px; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 17px; letter-spacing: .02em; }
.brand span { margin-top: 3px; color: #a9bbce; font-size: 12px; }
nav { display: grid; gap: 7px; }
.nav-item {
  width: 100%; min-height: 46px; padding: 0 12px; display: flex; align-items: center; gap: 11px;
  border: 0; border-radius: 12px; color: #b9c7d7; background: transparent; text-align: left;
}
.nav-item span {
  width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid #36516c;
  border-radius: 8px; font-size: 12px;
}
.nav-item:hover { color: #fff; background: #172e48; }
.nav-item.active { color: #fff; background: var(--navy-soft); box-shadow: inset 3px 0 0 #5b9cff; }
.nav-item.active span { border-color: #5b9cff; color: #8db8ff; }
.nav-divider { margin: 24px 12px 8px; color: #6f849a; font-size: 11px; letter-spacing: .12em; }
.sidebar-status {
  margin-top: auto; padding: 14px; display: flex; align-items: center; gap: 10px;
  border: 1px solid #29425b; border-radius: 14px; background: #142a42;
}
.sidebar-status strong, .sidebar-status small { display: block; }
.sidebar-status strong { font-size: 12px; }
.sidebar-status small { margin-top: 3px; color: #8398ad; font-size: 11px; }
.status-light { width: 9px; height: 9px; border-radius: 50%; background: #f0a340; box-shadow: 0 0 0 5px rgba(240,163,64,.12); }
.status-light.online { background: #47c88b; box-shadow: 0 0 0 5px rgba(71,200,139,.12); }

main { min-width: 0; padding: 0 38px 52px; }
.topbar {
  height: 98px; display: flex; align-items: center; gap: 20px; border-bottom: 1px solid var(--line);
}
.topbar p, .topbar h1 { margin: 0; }
.topbar p { color: var(--muted); font-size: 12px; }
.topbar h1 { margin-top: 4px; font-size: 23px; letter-spacing: -.02em; }
.institution-chip {
  margin-left: auto; padding: 9px 12px; display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff;
}
.institution-chip > span { padding: 5px 7px; border-radius: 7px; color: var(--blue); background: var(--blue-soft); font-size: 11px; }
.institution-chip strong, .institution-chip small { display: block; }
.institution-chip strong { font-size: 12px; }
.institution-chip small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.menu-button { display: none; border: 0; background: transparent; font-size: 22px; }

.view { display: none; padding-top: 30px; }
.view.active { display: block; animation: reveal .22s ease-out; }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.command-card {
  min-height: 316px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  overflow: hidden; border-radius: 24px; color: #fff; background: var(--navy); box-shadow: var(--shadow);
}
.command-copy { min-width: 0; padding: 44px; overflow: hidden; }
.command-copy p { margin: 0; color: #74a9ef; font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.command-copy h2 {
  max-width: 600px; margin: 16px 0 12px; overflow-wrap: anywhere;
  font-size: clamp(28px, 3.2vw, 46px); line-height: 1.13; letter-spacing: -.045em;
}
.command-copy > span { max-width: 620px; display: block; color: #afc1d4; font-size: 14px; line-height: 1.75; }
.primary-action, .secondary-action {
  min-height: 42px; padding: 0 18px; border: 0; border-radius: 11px; font-weight: 700;
}
.primary-action { color: #fff; background: var(--blue); box-shadow: 0 8px 20px rgba(18,97,211,.2); }
.primary-action:hover { background: #0d55bd; }
.primary-action.compact { min-height: 38px; }
.secondary-action { color: var(--blue); background: var(--blue-soft); }
.command-copy .primary-action { margin-top: 28px; background: #fff; color: var(--navy); box-shadow: none; }
.pulse-board {
  position: relative; padding: 52px 42px; display: grid; align-content: center; gap: 34px;
  background: #142c47;
}
.pulse-board::after {
  content: ""; position: absolute; inset: 0; opacity: .25;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 24px 24px;
}
.pulse-line { position: absolute; z-index: 1; left: 57px; top: 78px; bottom: 78px; width: 1px; background: #36516d; }
.pulse-step { position: relative; z-index: 2; padding-left: 46px; }
.pulse-step > span {
  position: absolute; left: 8px; top: 4px; width: 14px; height: 14px;
  border: 3px solid #5b7188; border-radius: 50%; background: #142c47;
}
.pulse-step.done > span { border-color: #47c88b; background: #47c88b; }
.pulse-step.current > span { border-color: #74a9ef; box-shadow: 0 0 0 8px rgba(116,169,239,.12); }
.pulse-step strong, .pulse-step small { display: block; }
.pulse-step strong { font-size: 14px; }
.pulse-step small { margin-top: 5px; color: #8fa5ba; font-size: 11px; }

.metric-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.metric-grid article { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 8px 30px rgba(37,72,112,.05); }
.metric-grid span, .metric-grid strong, .metric-grid small { display: block; }
.metric-grid span { color: var(--muted); font-size: 12px; }
.metric-grid strong { margin-top: 10px; font-size: 31px; font-variant-numeric: tabular-nums; }
.metric-grid small { margin-top: 7px; color: var(--faint); font-size: 10px; }

.section-card, .form-card, .quote-card {
  border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 12px 40px rgba(37,72,112,.05);
}
.section-card { margin-top: 22px; padding: 26px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.section-heading span { color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.section-heading h2 { margin: 5px 0 0; font-size: 21px; }
.section-heading p { max-width: 480px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; text-align: right; }
.page-heading { margin-bottom: 22px; }
.text-action { border: 0; color: var(--blue); background: transparent; font-size: 12px; font-weight: 700; }

.order-table-wrap { margin-top: 20px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th { padding: 11px 12px; color: var(--faint); background: #f8fafc; font-size: 10px; font-weight: 600; text-align: left; }
td { padding: 15px 12px; border-bottom: 1px solid var(--line); font-size: 12px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.cell-main strong, .cell-main small { display: block; }
.cell-main small { margin-top: 4px; color: var(--muted); }
.money { font-weight: 750; font-variant-numeric: tabular-nums; }
.status-pill { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.status-pill.blue { color: var(--blue); background: var(--blue-soft); }
.status-pill.orange { color: var(--orange); background: var(--orange-soft); }
.status-pill.green { color: var(--green); background: var(--green-soft); }
.status-pill.gray { color: var(--muted); background: #eef1f5; }
.status-pill.red { color: var(--red); background: var(--red-soft); }
.row-action { padding: 5px 8px; border: 0; color: var(--blue); background: transparent; font-size: 11px; font-weight: 700; }
.row-action.danger { color: var(--red); }
.empty-state { padding: 50px 20px; color: var(--muted); text-align: center; }

.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.form-card { padding: 26px; grid-column: 1; }
.form-card + .form-card { margin-top: 0; }
.form-card-title { margin-bottom: 22px; display: flex; align-items: center; gap: 12px; }
.form-card-title > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: var(--blue-soft); font-size: 11px; font-weight: 800; }
.form-card-title h3, .form-card-title p { margin: 0; }
.form-card-title h3 { font-size: 16px; }
.form-card-title p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
label { color: #465369; font-size: 11px; font-weight: 650; }
input, select, textarea {
  width: 100%; margin-top: 8px; border: 1px solid #dce3eb; border-radius: 10px;
  color: var(--ink); background: #fff; outline: none;
}
input, select { height: 42px; padding: 0 12px; }
textarea { min-height: 92px; padding: 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #6b9fe8; box-shadow: 0 0 0 3px rgba(18,97,211,.09); }
.dispatch-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.dispatch-options label { position: relative; }
.dispatch-options input { position: absolute; opacity: 0; pointer-events: none; }
.dispatch-options span {
  min-height: 88px; padding: 15px; display: block; border: 1px solid var(--line);
  border-radius: 14px; background: #fbfcfe; cursor: pointer;
}
.dispatch-options strong, .dispatch-options small { display: block; }
.dispatch-options strong { font-size: 12px; }
.dispatch-options small { margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.dispatch-options input:checked + span { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); }
.companion-field, .full-field { margin-top: 18px; display: block; }
.hidden { display: none !important; }
.quote-card { position: sticky; top: 118px; grid-column: 2; grid-row: 1 / span 2; padding: 24px; }
.quote-card > span { display: block; margin-bottom: 14px; color: var(--blue); font-size: 11px; font-weight: 750; }
.quote-card > div { padding: 13px 0; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.quote-card small { color: var(--muted); }
.quote-card strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.quote-card .quote-total { padding-top: 18px; border-bottom: 0; }
.quote-total strong { color: var(--blue); font-size: 24px; }
.quote-card p { margin: 14px 0 20px; color: var(--muted); font-size: 10px; line-height: 1.65; }
.quote-card button { width: 100%; }
.quote-card .secondary-action { margin-top: 9px; }

.toolbar { display: flex; align-items: center; gap: 12px; }
.toolbar input { max-width: 340px; margin: 0; }
.toolbar select { width: 190px; margin: 0; }
.toolbar-note { margin-left: auto; color: var(--muted); font-size: 11px; }
.price-list { display: grid; gap: 1px; background: var(--line); }
.price-row {
  padding: 18px 4px; display: grid; grid-template-columns: minmax(170px, 1fr) 160px 180px 90px;
  align-items: center; gap: 18px; background: #fff;
}
.price-row h3, .price-row p { margin: 0; }
.price-row h3 { font-size: 14px; }
.price-row p { margin-top: 4px; color: var(--muted); font-size: 10px; }
.price-field input { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.price-toggle { display: flex; align-items: center; gap: 8px; }
.price-toggle input { width: auto; height: auto; margin: 0; }
.save-price { min-height: 36px; border: 0; border-radius: 9px; color: var(--blue); background: var(--blue-soft); font-size: 11px; font-weight: 700; }
.companion-price-list { margin-top: 20px; display: grid; gap: 12px; }
.companion-price-row {
  padding: 16px 18px; display: grid; grid-template-columns: minmax(180px, 1fr) 150px 160px 90px;
  align-items: center; gap: 18px; border: 1px solid var(--line); border-radius: 14px;
}
.companion-identity { display: flex; align-items: center; gap: 11px; }
.companion-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--blue); background: var(--blue-soft); font-weight: 800; }
.companion-identity strong, .companion-identity small { display: block; }
.companion-identity strong { font-size: 13px; }
.companion-identity small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.default-price { color: var(--muted); font-size: 11px; }
.companion-price-row input { margin: 0; text-align: right; }

.admin-portal .nav-item.active { box-shadow: inset 3px 0 0 #57c7a2; }
.admin-portal .nav-item.active span { border-color: #57c7a2; color: #7cdbbb; }
.admin-chip > span { color: #15775a; background: #e7f7f1; }
.admin-command { background: #0e2634; }
.admin-command .command-copy p { color: #67d2ad; }
.permission-orbit {
  position: relative; min-height: 316px; overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(87,199,162,.18) 0 12%, transparent 12.5%),
    linear-gradient(145deg, #123145, #10283a);
}
.permission-orbit::before, .permission-orbit::after {
  content: ""; position: absolute; left: 50%; top: 50%; border: 1px solid rgba(120,183,196,.28);
  border-radius: 50%; transform: translate(-50%, -50%);
}
.permission-orbit::before { width: 210px; height: 210px; }
.permission-orbit::after { width: 330px; height: 330px; }
.orbit-core, .orbit-node {
  position: absolute; z-index: 2; display: grid; place-items: center; border-radius: 999px;
  font-size: 11px; font-weight: 750; letter-spacing: .04em;
}
.orbit-core {
  left: 50%; top: 50%; width: 76px; height: 76px; color: #0d2b35; background: #79d8b8;
  transform: translate(-50%, -50%); box-shadow: 0 0 0 14px rgba(121,216,184,.08);
}
.orbit-node { padding: 9px 13px; color: #dbe9ef; border: 1px solid #3b6071; background: #19384a; }
.node-one { left: 12%; top: 22%; }
.node-two { right: 10%; top: 30%; }
.node-three { left: 25%; bottom: 16%; }

.institution-summary { margin-top: 20px; display: grid; gap: 1px; background: var(--line); }
.summary-row {
  padding: 14px 4px; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center; gap: 12px; background: #fff;
}
.summary-row strong, .summary-row small { display: block; }
.summary-row strong { font-size: 13px; }
.summary-row small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.institution-symbol {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px;
  color: #137258; background: #e6f7f0; font-weight: 800;
}
.institution-create { margin-bottom: 22px; }
.permission-fieldset {
  margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; border: 0;
}
.permission-fieldset legend { margin-bottom: 10px; color: var(--ink); font-size: 12px; font-weight: 750; }
.permission-fieldset label { position: relative; }
.permission-fieldset input { position: absolute; opacity: 0; pointer-events: none; }
.permission-fieldset span {
  min-height: 72px; padding: 13px 14px; display: block; border: 1px solid var(--line);
  border-radius: 13px; background: #f8fafc; cursor: pointer;
}
.permission-fieldset strong, .permission-fieldset small { display: block; }
.permission-fieldset strong { font-size: 12px; }
.permission-fieldset small { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.permission-fieldset input:checked + span {
  border-color: #42aa84; background: #eaf8f3; box-shadow: inset 0 0 0 1px #42aa84;
}
.form-actions {
  margin-top: 20px; display: flex; align-items: center; gap: 16px; border-top: 1px solid var(--line); padding-top: 18px;
}
.form-actions span { color: var(--muted); font-size: 10px; }
.institution-access-list { margin-top: 20px; display: grid; gap: 14px; }
.institution-access-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fbfcfe; }
.institution-access-card header {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px;
}
.institution-access-card h3, .institution-access-card p { margin: 0; }
.institution-access-card h3 { font-size: 15px; }
.institution-access-card p { margin-top: 5px; color: var(--muted); font-size: 10px; }
.access-account-grid {
  margin-top: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
}
.compact-permissions { margin-top: 16px; }
.compact-permissions span { min-height: 64px; }
.institution-access-card footer {
  margin-top: 18px; padding-top: 14px; display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--line);
}
.institution-access-card footer small { color: var(--muted); font-size: 10px; }

.account-security-note {
  margin-bottom: 22px; padding: 18px 20px; display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  border: 1px solid #cce9df; border-radius: 18px; background: #effaf6;
}
.account-security-mark {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px;
  color: #0f7455; background: #d8f3e8; font-size: 12px; font-weight: 800;
}
.account-security-note strong, .account-security-note small { display: block; }
.account-security-note strong { font-size: 13px; }
.account-security-note small { margin-top: 5px; color: #5f786f; font-size: 10px; line-height: 1.55; }
.platform-account-create { margin-bottom: 22px; }
.platform-account-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.platform-account-list { margin-top: 20px; display: grid; gap: 14px; }
.platform-account-card {
  padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fbfcfe;
}
.platform-account-card.current {
  border-color: #8bd5bb; box-shadow: inset 3px 0 0 #42aa84; background: #fbfffd;
}
.platform-account-card header {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px;
}
.platform-account-avatar {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px;
  color: #116e55; background: #e2f6ef; font-size: 14px; font-weight: 800;
}
.platform-account-card h3, .platform-account-card p { margin: 0; }
.platform-account-card h3 { font-size: 15px; }
.platform-account-card p { margin-top: 5px; color: var(--muted); font-size: 10px; }
.platform-account-title { display: flex; align-items: center; gap: 8px; }
.current-account-tag {
  padding: 3px 7px; border-radius: 999px; color: #0f7657; background: #ddf5ec;
  font-size: 9px; font-weight: 750;
}
.platform-account-grid {
  margin-top: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
}
.platform-account-card footer {
  margin-top: 18px; padding-top: 14px; display: flex; align-items: center; justify-content: space-between;
  gap: 20px; border-top: 1px solid var(--line);
}
.platform-account-card footer small { display: block; color: var(--muted); font-size: 10px; line-height: 1.7; }
.platform-account-card select:disabled { color: var(--muted); background: #f0f3f6; cursor: not-allowed; }

.order-monitor-metrics { margin-top: 0; }
.institution-order-stats { margin-top: 20px; overflow-x: auto; }
.status-lane-head, .status-lane {
  min-width: 740px; display: grid; grid-template-columns: minmax(220px, 1.7fr) repeat(5, minmax(72px, .55fr));
  align-items: center; gap: 10px;
}
.status-lane-head {
  padding: 10px 14px; color: var(--faint); border-radius: 10px; background: #f8fafc;
  font-size: 10px; font-weight: 650; text-align: center;
}
.status-lane-head span:first-child { text-align: left; }
.status-lane { padding: 14px; border-bottom: 1px solid var(--line); }
.status-lane:last-child { border-bottom: 0; }
.status-lane strong, .status-lane small { display: block; }
.status-lane strong { font-size: 12px; }
.status-lane small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.lane-count {
  width: 34px; height: 30px; display: grid; place-items: center; justify-self: center;
  border-radius: 9px; font-size: 11px; font-weight: 750;
}
.lane-count.gray { color: var(--muted); background: #eef1f5; }
.lane-count.orange { color: var(--orange); background: var(--orange-soft); }
.lane-count.blue { color: var(--blue); background: var(--blue-soft); }
.lane-count.green { color: var(--green); background: var(--green-soft); }
.lane-count.red { color: var(--red); background: var(--red-soft); }
.order-toolbar { margin-top: 20px; }
.order-toolbar input { flex: 1; }
.admin-order-table { min-width: 980px; }

.toast {
  position: fixed; z-index: 100; left: 50%; bottom: 28px; max-width: calc(100vw - 32px);
  padding: 12px 17px; border-radius: 11px; color: #fff; background: var(--navy);
  box-shadow: 0 14px 40px rgba(16,34,56,.25); font-size: 12px;
  opacity: 0; transform: translate(-50%, 14px); pointer-events: none; transition: .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #8d2929; }

@media (max-width: 1050px) {
  .command-card { grid-template-columns: 1fr; }
  .pulse-board { min-height: 240px; grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .pulse-line { left: 16%; right: 16%; top: 72px; bottom: auto; width: auto; height: 1px; }
  .pulse-step { padding: 40px 0 0; text-align: center; }
  .pulse-step > span { left: 50%; top: 0; transform: translateX(-50%); }
  .form-layout { grid-template-columns: 1fr; }
  .quote-card { position: static; grid-column: 1; grid-row: auto; }
  .access-account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .platform-account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 40; left: 0; width: 236px; transform: translateX(-100%); transition: transform .2s ease; }
  body.menu-open .sidebar { transform: translateX(0); }
  main { padding: 0 18px 40px; }
  .menu-button { display: block; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dispatch-options { grid-template-columns: 1fr; }
  .price-row, .companion-price-row { grid-template-columns: 1fr 1fr; }
  .permission-fieldset { grid-template-columns: 1fr; }
  .platform-account-form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .topbar { height: 82px; }
  .institution-chip { padding: 7px; }
  .institution-chip > span, .institution-chip small { display: none; }
  .admin-portal .institution-chip { padding: 0; border: 0; background: transparent; }
  .admin-portal .institution-chip strong { display: none; }
  .admin-portal .logout-button { margin-left: 0; }
  .command-copy { padding: 28px; }
  .pulse-board { padding: 34px 22px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-grid article { padding: 17px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .section-heading p { text-align: left; }
  .field-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar input, .toolbar select { width: 100%; max-width: none; }
  .toolbar-note { margin-left: 0; }
  .price-row, .companion-price-row { grid-template-columns: 1fr; }
  .access-account-grid { grid-template-columns: 1fr; }
  .account-security-note { grid-template-columns: 42px minmax(0, 1fr); }
  .account-security-note .status-pill { grid-column: 2; justify-self: start; }
  .platform-account-grid { grid-template-columns: 1fr; }
  .platform-account-card { padding: 16px; }
  .platform-account-card header { grid-template-columns: 38px minmax(0, 1fr); }
  .platform-account-card header > .status-pill { grid-column: 2; justify-self: start; }
  .platform-account-card footer { align-items: stretch; flex-direction: column; }
  .institution-access-card { padding: 16px; }
  .institution-access-card header { grid-template-columns: 38px minmax(0, 1fr); }
  .institution-access-card header .status-pill { grid-column: 2; justify-self: start; }
  .institution-access-card footer { align-items: stretch; flex-direction: column; gap: 10px; }
  .form-actions { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
body.auth-required .app-shell {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
}

.login-screen {
  position: fixed;
  z-index: 100;
  inset: 0;
  padding: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 24, 43, 0.72);
  backdrop-filter: blur(12px);
}

body.auth-required .login-screen {
  display: flex;
}

.login-card {
  width: min(420px, 100%);
  padding: 38px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(3, 22, 44, 0.28);
}

.login-card p,
.login-card h1,
.login-card > span,
.login-card label,
.login-card small {
  display: block;
}

.login-card p {
  margin: 20px 0 4px;
  color: #0c74de;
  font-weight: 750;
}

.login-card h1 {
  margin: 0;
  color: #102238;
  font-size: 30px;
}

.login-card > span {
  margin: 10px 0 26px;
  color: #6b7b8e;
}

.login-card label {
  margin-top: 16px;
  color: #33465c;
  font-size: 14px;
  font-weight: 650;
}

.login-card input {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  padding: 0 14px;
  box-sizing: border-box;
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  background: #f7f9fc;
  color: #102238;
  font: inherit;
}

.login-card .primary-action {
  width: 100%;
  margin-top: 24px;
}

.login-card small {
  margin-top: 16px;
  color: #97a5b5;
  text-align: center;
}

.login-mark {
  width: 56px;
  height: 56px;
}

.logout-button {
  width: auto;
  min-width: 58px;
  height: 34px;
  margin-left: 12px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  color: #526477;
  background: #eef3f8;
  cursor: pointer;
}

.review-list {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.review-row {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid #e2e9f1;
  border-radius: 14px;
  background: #f9fbfd;
}

.review-row strong,
.review-row small {
  display: block;
}

.review-row small {
  margin-top: 5px;
  color: #748397;
}

.review-actions {
  display: flex;
  gap: 8px;
  flex: none;
}

.review-actions button {
  width: auto;
  min-width: 72px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}

.review-actions .approve {
  color: #087846;
  background: #e5f7ee;
}

.review-actions .reject {
  color: #b53b3b;
  background: #fdecec;
}
