:root {
  --navy: #203c56;
  --blue: #2a587a;
  --ink: #23364a;
  --muted: #53667a;
  --line: #dce3e9;
  --background: #f4f6f8;
  font: 100%/1.5 "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--background);
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--blue); text-underline-offset: 3px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.wordmark { color: var(--navy); font-weight: 800; font-size: 1.45rem; letter-spacing: 2px; line-height: 1; }
.wordmark small { display: block; margin-top: 8px; font-size: .65rem; letter-spacing: 2.3px; font-weight: 500; }
.brand-caption { font-size: .75rem; margin-top: 13px; color: var(--muted); }
.primary {
  background: var(--blue);
  color: white;
  border: 1px solid var(--blue);
  border-radius: 5px;
  padding: .65rem 1rem;
}
.primary:hover { background: var(--navy); }
.notice {
  background: #f0f4f7;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .85rem 1rem;
  margin: 0 0 1rem;
}

.login-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 100vh;
  background: white;
}
.login-story {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #25445f;
  padding: clamp(2rem, 6vw, 5rem);
  color: white;
}
.login-story .wordmark { color: white; }
.login-story .brand-caption, .login-story footer { color: #c5d1dd; }
.login-story h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 550; line-height: 1.2; margin: 4rem 0 .75rem; }
.login-story p { max-width: 390px; color: #dce6ed; }
.login-story footer { margin-top: 3rem; font-size: .8rem; }
.login-form-wrap { display: grid; place-items: center; padding: clamp(1.5rem, 4vw, 3rem); }
.login-form { width: 100%; max-width: 350px; }
.login-form h2 { font-size: 1.6rem; margin: 0 0 .75rem; }
.login-form p { color: var(--muted); }
.login-form label { display: block; margin: 1rem 0; }
.login-form input, .portal-picker select {
  display: block;
  width: 100%;
  margin-top: .4rem;
  padding: .65rem .75rem;
  color: var(--ink);
  border: 1px solid #aabac8;
  border-radius: 5px;
  background: white;
}
.login-form .primary { width: 100%; margin-top: .4rem; }
.owner-code { margin: .875rem 0; }
.owner-code summary { color: var(--blue); cursor: pointer; }
.login-form form + form { margin-top: 1rem; }
.text-button { border: 0; padding: 0; color: var(--blue); background: none; text-decoration: underline; }

.portal-shell { display: grid; grid-template-columns: 14rem minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--navy); color: #e3edf5; padding: 2rem 1.25rem; }
.sidebar .wordmark { color: white; }
.sidebar .brand-caption { color: #c9d8e5; }
.account-role { margin: 1.5rem 0 0; font-size: .875rem; }
.portal-nav { display: grid; gap: .3rem; margin-top: 1.75rem; }
.portal-nav a { padding: .55rem .7rem; border-radius: 5px; text-decoration: none; color: white; }
.portal-nav a:hover, .portal-nav a:focus-visible { background: #365975; }
.portal-nav a:focus-visible { outline-color: white; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .8rem clamp(1rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  background: white;
}
.topbar a { text-decoration: none; font-weight: 650; }
.account button { border: 1px solid #aabac8; border-radius: 5px; padding: .4rem .8rem; background: white; color: var(--blue); }
.account button:hover { background: var(--background); }
.workspace { max-width: 88rem; margin: auto; padding: clamp(1rem, 3vw, 2.5rem); }
.page-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem 1rem; margin-bottom: 1.25rem; }
.page-heading h1 { margin: 0; font-size: clamp(1.45rem, 3vw, 2rem); overflow-wrap: anywhere; }
.sync { color: var(--muted); font-size: .875rem; }
.portal-picker { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; margin-bottom: 1.25rem; }
.portal-picker label { min-width: 0; width: min(24rem, 100%); }
.panel { background: white; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 1.25rem; }
.panel-heading { padding: 1rem; }
.panel-heading h2 { margin: 0; font-size: 1.15rem; }
.panel-heading p { margin: .3rem 0 0; color: var(--muted); font-size: .875rem; }
.help-block { margin: 0; padding: 0 1rem 1rem; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.table-wrap:focus-visible { outline-offset: -2px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .75rem 1rem; border-top: 1px solid var(--line); }
th { font-size: .875rem; background: #f5f8fa; color: var(--muted); white-space: nowrap; }
.article-code { font-weight: 650; }
.number { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; border-radius: 4px; padding: .16rem .45rem; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.badge.neutral { background: #eaf0f4; color: #43566a; }
.badge.amber { background: #fff1d8; color: #774d16; }
.badge.green { background: #e1f2e8; color: #235b42; }

@media (max-width: 720px) {
  .login-layout, .portal-shell { grid-template-columns: minmax(0, 1fr); }
  .login-story h1 { margin-top: 1.75rem; }
  .login-story footer { margin-top: 1rem; }
  .sidebar { padding: 1rem; }
  .portal-nav { display: flex; flex-wrap: wrap; margin-top: .75rem; }
  .account-role { margin-top: .75rem; }
  th, td { padding: .6rem .75rem; }
}
