@font-face {
  font-family: "EB Garamond Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 400 800;
  src: url("/assets/fonts/eb-garamond-latin.woff2") format("woff2-variations");
}

@font-face {
  font-family: "EB Garamond Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 400 800;
  src: url("/assets/fonts/eb-garamond-latin-ext.woff2") format("woff2-variations");
}

:root {
  --navy: #011063;
  --royal: #1d27a8;
  --lav: #777bad;
  --vlight: #edeff7;
  --grey: #e5e5ea;
  --green: #2e7d32;
  --greenbg: #c6efce;
  --amber: #9c6500;
  --amberbg: #ffeb9c;
  --red: #9c0006;
  --redbg: #ffc7ce;
  --bluebg: #ddebf7;
  --ink: #1b2148;
  --muted: #6b7192;
  --surface: #ffffff;
  --page: #f4f5f9;
  --shadow: 0 12px 36px rgba(1, 16, 99, 0.09);
  --brand-900: #00165f;
  --brand-800: #16307c;
  --brand-soft: #eef1f9;
  --text: #2b3550;
  --soft: #f8f8f8;
  --line: #e3e3e3;
  --font-display: "EB Garamond Variable", "EB Garamond", Georgia, serif;
  --font-ui: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--navy);
}

a {
  color: var(--royal);
}

.hidden {
  display: none !important;
}

.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;
}

select,
input,
textarea,
button {
  font-size: 13px;
  padding: 7px 9px;
  border: 1px solid var(--grey);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--royal);
  outline-offset: 2px;
}

button {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled,
textarea:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

button.primary,
.btn-primary {
  background: var(--royal);
  color: #fff;
  border-color: var(--royal);
  font-weight: 700;
}

button.primary:hover,
.btn-primary:hover {
  background: var(--navy);
  border-color: var(--navy);
}

.btn-secondary {
  background: #fff;
  color: var(--navy);
  border: 1px solid #cfd3e5;
  font-weight: 700;
}

.btn-secondary:hover {
  background: var(--vlight);
}

.btn-danger {
  background: #fff;
  border: 1px solid #d6a3a8;
  color: var(--red);
  font-weight: 700;
}

.btn-danger:hover {
  background: #fff3f4;
}

.btn-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--navy);
}

.btn-quiet:hover {
  background: var(--vlight);
}

.btn-sm {
  padding: 4px 9px;
  font-size: 11.5px;
  border-radius: 6px;
}

/* ---------- Tracker shell ---------- */
header.app-header {
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

header.app-header h1 {
  font-size: 16px;
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.1px;
}

.header-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  color: #fff;
  text-decoration: none;
  flex: 0 0 auto;
}

.app-logo {
  width: 125px;
  height: auto;
  display: block;
}

.brand-tag {
  color: #c3c8ec;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

header.app-header label {
  font-size: 12px;
  color: #dfe2f3;
}

header.app-header select,
header.app-header button {
  border-color: transparent;
}

header.app-header select {
  padding: 6px 8px;
}

.header-spacer {
  flex: 1;
}

.header-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.identity-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #2f3db4;
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex: 0 0 auto;
}

.identity-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.identity-name {
  font-size: 12px;
  font-weight: 700;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-role {
  font-size: 10.5px;
  color: #c3c8ec;
}

.header-link,
.header-button {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 12px;
  text-decoration: none;
  font-weight: 700;
}

.header-link:hover,
.header-button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.user-menu {
  position: relative;
}

.user-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 7px 4px 5px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  user-select: none;
}

.user-summary::-webkit-details-marker {
  display: none;
}

.user-summary:hover,
.user-menu[open] .user-summary {
  background: rgba(255, 255, 255, 0.14);
}

.user-chevron {
  color: #b9bfe5;
  font-size: 9px;
  margin-left: 2px;
}

.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 7px);
  z-index: 50;
  width: 200px;
  background: #fff;
  border: 1px solid var(--grey);
  border-radius: 10px;
  box-shadow: 0 16px 44px rgba(1, 16, 99, 0.22);
  padding: 5px;
  display: flex;
  flex-direction: column;
}

.user-menu-panel a,
.user-menu-panel button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--navy);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 10px;
  border-radius: 6px;
}

.user-menu-panel a:hover,
.user-menu-panel button:hover {
  background: var(--vlight);
}

.user-menu-panel button {
  color: var(--red);
  border-top: 1px solid #eef0f6;
  border-radius: 0 0 6px 6px;
  margin-top: 2px;
  padding-top: 10px;
}

.header-spacer {
  flex: 1;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid var(--grey);
  flex-wrap: wrap;
  align-items: center;
}

.tab {
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
}

.tab:hover {
  background: var(--vlight);
}

.tab.active {
  background: var(--navy);
  color: #fff;
}

.tab-link {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

.wrap {
  padding: 10px;
}

.tablewrap {
  width: 100%;
  overflow: auto;
  max-height: calc(100vh - 170px);
}

.tablewrap::-webkit-scrollbar {
  height: 10px;
}

.tablewrap::-webkit-scrollbar-thumb {
  background: #9aa0c0;
  border-radius: 6px;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 1240px;
  background: #fff;
  font-size: 12px;
}

th,
td {
  border: 1px solid var(--grey);
  padding: 4px 7px;
  text-align: left;
  vertical-align: top;
}

:fullscreen .wrap,
:-webkit-full-screen .wrap {
  height: calc(100vh - 92px);
  overflow: auto;
}

th {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 3;
}

tr.blocked td {
  background: #fff7f7;
}

tr.phaserow td {
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.3px;
  padding: 5px 9px;
}

tr.r-todo td {
  background: #fbfbfd;
}

tr.r-prog td {
  background: #fff6df;
}

tr.r-block td {
  background: #ffe3e3;
}

tr.r-done td {
  background: #e3f4e8;
}

tr.r-done td:first-child {
  color: #2f6b43;
}

.badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

.b-block {
  background: var(--redbg);
  color: var(--red);
}

.b-inst {
  background: #eef0f7;
  color: #5b6180;
  border: 1px solid #d3d8ea;
  font-weight: 600;
  cursor: help;
}

.sgn-wait {
  background: #b3122b;
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
  animation: sgnblink 1.1s steps(2, start) infinite;
}

@keyframes sgnblink {
  50% {
    opacity: 0.4;
  }
}

.sgn-ok {
  background: #5a807e;
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
}

.sgnbtn {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 5px;
  cursor: pointer;
  background: #5a807e;
  color: #fff;
  border: 0;
  font-weight: 700;
}

.sgnbtn:hover {
  background: #4a6c6a;
}

.reqsgn {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 5px;
  cursor: pointer;
  background: #fff;
  border: 1px solid #b3122b;
  color: #b3122b;
  font-weight: 700;
}

.reqsgn:hover {
  background: #faeef0;
}

.btnblue {
  background: var(--royal);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 6px 12px;
  font-weight: 700;
  cursor: pointer;
}

.btnblue:hover {
  background: var(--navy);
}

.btnupload {
  background: #5a807e;
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 6px 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-block;
}

.btnupload:hover {
  background: #4a6c6a;
}

tr.locked td {
  opacity: 0.96;
}

.lockmark {
  color: #9aa0c0;
  font-size: 11px;
  margin-left: 4px;
}

.b-prog {
  background: var(--amberbg);
  color: var(--amber);
}

.b-done {
  background: var(--greenbg);
  color: var(--green);
}

.pill {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
}

.s-todo {
  background: #eee;
  color: #444;
}

.s-prog {
  background: var(--amberbg);
  color: var(--amber);
}

.s-block {
  background: var(--redbg);
  color: var(--red);
}

.s-done {
  background: var(--greenbg);
  color: var(--green);
}

.kan {
  display: flex;
  gap: 12px;
  overflow-x: auto;
}

.kcol {
  flex: 1;
  min-width: 230px;
  background: #fff;
  border: 1px solid var(--grey);
  border-radius: 8px;
  padding: 8px;
}

.kcol h3 {
  margin: 4px 0 8px;
  font-size: 13px;
  text-align: center;
  padding: 4px;
  border-radius: 6px;
}

.card {
  background: var(--vlight);
  border: 1px solid var(--grey);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  cursor: grab;
}

.card .t {
  font-weight: 700;
  margin-bottom: 4px;
}

.card.blk {
  border-color: var(--red);
  background: #fff2f2;
}

.meta {
  color: var(--lav);
  font-size: 11px;
}

.gantt {
  background: #fff;
  border: 1px solid var(--grey);
  border-radius: 8px;
  padding: 10px;
  overflow-x: auto;
}

.grow {
  display: grid;
  grid-template-columns: 260px 1fr;
  align-items: center;
  border-top: 1px solid var(--grey);
  min-height: 26px;
}

.gbarwrap {
  position: relative;
  height: 18px;
  margin: 3px 0;
}

.gbar {
  position: absolute;
  height: 16px;
  border-radius: 4px;
  background: var(--royal);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  padding: 0 4px;
  white-space: nowrap;
  overflow: hidden;
}

.gbar.blk {
  background: var(--red);
}

.gbar.done {
  background: var(--green);
}

.phaseh {
  background: var(--vlight);
  font-weight: 700;
  padding: 4px 8px;
  border-top: 2px solid var(--navy);
}

.cards-dash {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.kpi {
  background: #fff;
  border: 1px solid var(--grey);
  border-radius: 10px;
  padding: 10px 16px;
  min-width: 130px;
}

.kpi .n {
  font-size: 24px;
  font-weight: 700;
}

.kpi .l {
  font-size: 11px;
  color: var(--lav);
}

.barrow {
  display: grid;
  grid-template-columns: 230px 1fr 46px;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  font-size: 12px;
}

.barbg {
  background: var(--grey);
  border-radius: 6px;
  height: 14px;
  overflow: hidden;
}

.barfg {
  background: var(--royal);
  height: 14px;
}

.note {
  font-size: 11px;
  color: var(--lav);
}

.depinfo {
  font-size: 11.5px;
  color: var(--lav);
  margin-top: 3px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.rem {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 5px;
  cursor: pointer;
  background: #fff;
}

.rem:hover {
  background: var(--vlight);
}

.empty-state {
  background: #fff;
  border: 1px dashed #cfd3e5;
  border-radius: 10px;
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ---------- Login ---------- */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px 24px;
  background: var(--soft);
  font-family: var(--font-ui);
}

.login-shell input,
.login-shell button,
.login-shell label,
.login-shell span,
.login-shell p {
  font-family: var(--font-ui);
}

.login-card {
  width: min(430px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 44px;
  box-shadow: 0 10px 40px rgba(0, 22, 95, 0.06);
}

.login-heading {
  margin-bottom: 30px;
}

.login-logo {
  width: 150px;
  height: auto;
  display: block;
  margin-bottom: 28px;
}

.login-heading h2 {
  margin: 0 0 9px;
  color: var(--brand-900);
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.login-heading > p:last-child {
  margin: 0;
  color: #707070;
  font-size: 14px;
  line-height: 1.55;
}

.login-card .alert {
  margin: -8px 0 18px;
  padding: 11px 13px;
  border-radius: 2px;
  font-size: 13px;
}

.login-card .alert-error {
  color: #a63c3c;
  background: #fbf0f0;
  border: 1px solid rgba(166, 60, 60, 0.3);
}

.login-card .field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.login-card .field > span {
  color: var(--brand-900);
  font-size: 13px;
  font-weight: 700;
}

.login-card input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  color: var(--text);
  background: #fff;
  border: 1px solid #cfd6e4;
  border-radius: 2px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-card input:focus,
.login-card input:focus-visible {
  outline: none;
  border-color: var(--brand-900);
  box-shadow: 0 0 0 3px rgba(0, 22, 95, 0.09);
}

.login-submit {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 18px;
  color: #fff;
  background: var(--brand-900);
  border: 0;
  border-radius: 2px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.login-submit:hover {
  background: var(--brand-800);
}

.login-submit:disabled {
  opacity: 0.55;
  cursor: default;
}

.button-arrow {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  transition: transform 0.2s;
}

.login-submit:hover .button-arrow {
  transform: translateX(2px);
}

/* ---------- Auth pages ---------- */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(380px, 0.95fr);
  background: var(--vlight);
}

.auth-brand {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 18%, rgba(119, 123, 173, 0.45), transparent 34%),
    radial-gradient(circle at 8% 92%, rgba(29, 39, 168, 0.62), transparent 40%),
    linear-gradient(145deg, #010b47 0%, var(--navy) 48%, #111d7a 100%);
  color: #fff;
  padding: clamp(28px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-brand::after {
  content: "";
  position: absolute;
  inset: auto -80px -190px auto;
  width: 440px;
  height: 440px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  box-shadow:
    0 0 0 36px rgba(255, 255, 255, 0.035),
    0 0 0 72px rgba(255, 255, 255, 0.025);
  pointer-events: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 13px;
  text-transform: uppercase;
  color: #d8dcf4;
}

.brand-mark::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: #7d86db;
  box-shadow: 0 0 0 4px rgba(125, 134, 219, 0.17);
}

.auth-brand-copy {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 36px 0;
}

.auth-brand-copy h1 {
  font-size: clamp(34px, 4.6vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 18px;
  font-weight: 800;
}

.auth-brand-copy p {
  color: #cbd0ed;
  font-size: 15px;
  line-height: 1.6;
  max-width: 420px;
  margin: 0;
}

.auth-brand-foot {
  position: relative;
  z-index: 1;
  font-size: 11px;
  color: #a7add8;
  letter-spacing: 0.03em;
}

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 56px);
}

.auth-card {
  width: min(430px, 100%);
  background: #fff;
  border: 1px solid var(--grey);
  border-radius: 16px;
  padding: clamp(24px, 3.5vw, 36px);
  box-shadow: var(--shadow);
}

.auth-card h2 {
  margin: 0 0 8px;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.auth-card .auth-intro {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 22px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > label {
  font-size: 12px;
  font-weight: 700;
  color: #343b69;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font-size: 14px;
  padding: 10px 11px;
  border-color: #d4d7e3;
}

.field .hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 62px;
}

.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 8px;
}

.password-toggle:hover {
  color: var(--navy);
  background: var(--vlight);
}

.auth-submit {
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
}

.auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
}

.auth-note {
  margin-top: 20px;
  padding: 11px 13px;
  border-radius: 8px;
  background: #f6f7fc;
  border: 1px solid #e3e5f0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}

.alert {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  border: 1px solid transparent;
}

.alert-error {
  background: #fff3f4;
  border-color: #f0c6cb;
  color: var(--red);
}

.alert-success {
  background: #f1f9f3;
  border-color: #c5e3cc;
  color: #226632;
}

.alert-info {
  background: #f2f4fd;
  border-color: #d7dbf1;
  color: #3d467f;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.brand-logo {
  width: 150px;
  height: auto;
  display: block;
  margin-bottom: 24px;
}

/* ---------- External upload page ---------- */
.upload-page {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(24px, 6vw, 72px) 18px;
  background:
    radial-gradient(circle at 50% -10%, rgba(119, 123, 173, 0.22), transparent 46%),
    var(--page);
}

.upload-card {
  width: min(620px, 100%);
  background: #fff;
  border: 1px solid var(--grey);
  border-radius: 16px;
  padding: clamp(24px, 4vw, 38px);
  box-shadow: var(--shadow);
}

.upload-card h1 {
  margin: 0 0 8px;
  font-size: 27px;
  letter-spacing: -0.025em;
}

.upload-intro {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin: 0 0 20px;
}

.upload-exit {
  border: 1px solid #e3e5f0;
  background: #f8f9fd;
  border-radius: 10px;
  padding: 13px 15px;
  margin-bottom: 18px;
}

.upload-exit .label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 4px;
}

.upload-exit .value {
  font-size: 15px;
  font-weight: 700;
}

.upload-exit .expiry {
  margin-top: 5px;
  font-size: 11px;
  color: var(--muted);
}

.upload-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.upload-file-field input[type="file"] {
  width: 100%;
  font-size: 12.5px;
  padding: 9px;
  background: #fbfbfe;
}

.upload-footnote {
  border-top: 1px solid #eef0f6;
  margin-top: 20px;
  padding-top: 14px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.55;
}

.upload-success {
  margin-top: 16px;
}

#manageUploadLinksDialog {
  width: min(1080px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
}

#manageUploadLinksDialog .dialog-body {
  overflow-y: auto;
}

.link-table {
  min-width: 900px;
}

.link-table td {
  vertical-align: middle;
}

.link-label {
  font-weight: 700;
  max-width: 240px;
  overflow-wrap: anywhere;
}

.link-table .note {
  margin-top: 3px;
}

/* ---------- Simple page shell (account/admin) ---------- */
.page-shell {
  min-height: 100vh;
  background: var(--page);
}

.page-topbar {
  background: var(--navy);
  color: #fff;
  padding: 11px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.page-topbar h1 {
  font-size: 15px;
  margin: 0;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
}

.topbar-logo {
  width: 112px;
  height: auto;
  display: block;
}

.topbar-sep {
  color: rgba(255, 255, 255, 0.35);
}

.page-topbar .back-link {
  color: #dfe2f3;
  font-size: 12px;
  text-decoration: none;
  font-weight: 700;
}

.page-topbar .back-link:hover {
  color: #fff;
  text-decoration: underline;
}

.page-content {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px) 18px 48px;
}

.page-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-title-row h2 {
  margin: 0 0 5px;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.page-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  max-width: 650px;
}

.panel {
  background: #fff;
  border: 1px solid var(--grey);
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(1, 16, 99, 0.04);
}

.panel-head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--grey);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-head h3 {
  margin: 0;
  font-size: 15px;
}

.panel-body {
  padding: 18px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.profile-item {
  padding: 13px 14px;
  border: 1px solid #e6e8f0;
  border-radius: 9px;
  background: #fafbfe;
}

.profile-item .label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 5px;
  font-weight: 700;
}

.profile-item .value {
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.account-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

/* ---------- Admin users ---------- */
.toolbar {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar input[type="search"] {
  min-width: 230px;
}

.admin-table-wrap {
  overflow-x: auto;
}

.user-table {
  min-width: 820px;
}

.user-table th {
  position: static;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.user-table td {
  vertical-align: middle;
  font-size: 12.5px;
  padding: 9px 10px;
}

.user-name {
  font-weight: 700;
  color: var(--ink);
}

.user-email {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 20px;
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-active {
  background: #e9f6ec;
  color: #2d713d;
}

.status-inactive {
  background: #f1f2f6;
  color: #6b7192;
}

.role-badge {
  background: #eef0fb;
  color: #3c4582;
  border-radius: 20px;
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

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

.row-actions button {
  white-space: nowrap;
}

.you-badge {
  background: var(--navy);
  color: #fff;
  border-radius: 20px;
  padding: 2px 7px;
  font-size: 9.5px;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: 1px;
}

/* ---------- Dialogs, toasts ---------- */
dialog {
  border: 0;
  border-radius: 14px;
  padding: 0;
  width: min(520px, calc(100vw - 28px));
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(1, 16, 99, 0.28);
}

dialog::backdrop {
  background: rgba(1, 10, 54, 0.48);
}

.dialog-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--grey);
}

.dialog-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
  color: var(--navy);
}

.dialog-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.dialog-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dialog-actions {
  padding: 0 20px 18px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.dialog-actions .left {
  margin-right: auto;
}

.temp-password-box {
  border: 1px dashed #b8bdd8;
  background: #f7f8fd;
  border-radius: 9px;
  padding: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.temp-password-box code {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  overflow-wrap: anywhere;
  flex: 1;
  min-width: 170px;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  border-radius: 9px;
  padding: 11px 13px;
  background: #fff;
  border: 1px solid var(--grey);
  box-shadow: 0 12px 34px rgba(1, 16, 99, 0.16);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink);
  animation: toast-in 0.18s ease-out;
}

.toast.success {
  border-left: 4px solid #3a8a4c;
}

.toast.error {
  border-left: 4px solid #b3122b;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--page);
  color: var(--muted);
  font-size: 13px;
  z-index: 999;
}

.loading-screen .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--royal);
  margin-right: 8px;
  animation: pulse 1s infinite ease-in-out;
}

@keyframes pulse {
  50% {
    opacity: 0.3;
    transform: scale(0.8);
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .login-shell {
    padding: 32px 18px;
  }

  .login-card {
    padding: 30px 22px;
  }

  .login-heading h2 {
    font-size: 36px;
  }
}

@media (max-width: 860px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    min-height: 240px;
    padding: 28px;
  }

  .auth-brand-copy {
    margin: 24px 0 8px;
  }

  .auth-brand-copy h1 {
    font-size: 36px;
  }

  .auth-brand-copy p {
    font-size: 13px;
  }

  .auth-brand-foot {
    display: none;
  }

  .auth-main {
    padding: 24px 16px 40px;
    align-items: flex-start;
  }

  .account-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .upload-form-grid {
    grid-template-columns: 1fr;
  }

  header.app-header {
    padding: 9px 11px;
    gap: 8px;
  }

  .identity-copy {
    display: none;
  }

  .header-link,
  .header-button {
    padding: 6px 8px;
    font-size: 11px;
  }

  .tabs {
    padding: 7px 10px;
  }

  .page-topbar {
    padding: 10px 13px;
  }

  .page-content {
    padding-left: 12px;
    padding-right: 12px;
  }

  .toolbar {
    width: 100%;
  }

  .toolbar input[type="search"] {
    flex: 1;
    min-width: 150px;
  }
}
