:root {
  --ink: #19212b;
  --muted: #647081;
  --line: #dfe5eb;
  --paper: #ffffff;
  --soft: #f4f7f9;
  --blue: #085294;
  --blue-2: #0b6fab;
  --green: #6f9f37;
  --orange: #f39200;
  --red: #bb3d3d;
  --shadow: 0 16px 38px rgba(23, 38, 58, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  font-weight: 750;
  letter-spacing: 0;
}

.brand img {
  width: 118px;
  height: auto;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 6px;
  color: #2f3a47;
  font-size: 14px;
  font-weight: 650;
}

.nav a.active,
.nav a:hover {
  background: #e8f1f7;
  color: var(--blue);
  text-decoration: none;
}

.container,
.container-wide {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.container-wide {
  width: min(1480px, calc(100% - 32px));
}

.login-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: center;
  gap: 32px;
  min-height: 210px;
  padding: 36px max(32px, calc((100vw - 1120px) / 2));
  color: #fff;
  background: #0b477d;
}

.login-hero h1 {
  margin: 4px 0 0;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.02;
}

.login-hero img {
  justify-self: end;
  width: 260px;
  border-radius: 6px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue-2);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-hero .eyebrow {
  color: #d5e8f6;
}

h1,
h2,
h3 {
  letter-spacing: 0;
  line-height: 1.16;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
}

h2 {
  margin: 0 0 18px;
  font-size: 24px;
}

h3 {
  margin: 24px 0 8px;
  font-size: 17px;
}

.muted {
  color: var(--muted);
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.form-panel {
  padding: 28px;
}

.quiet {
  padding: 28px;
  box-shadow: none;
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(280px, 460px) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.compact-head {
  margin-bottom: 14px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat {
  min-height: 92px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}

.stat span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.stat.compact {
  min-height: 74px;
}

.stat.compact strong {
  font-size: 24px;
}

label {
  display: grid;
  gap: 7px;
  color: #344050;
  font-size: 14px;
  font-weight: 680;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  font: inherit;
  font-weight: 450;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(8, 82, 148, 0.12);
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.span-two {
  grid-column: 1 / -1;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  color: var(--blue);
  background: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 740;
  cursor: pointer;
}

.button:hover {
  text-decoration: none;
  background: #eaf3f9;
}

.button.primary {
  color: #fff;
  background: var(--blue);
}

.button.primary:hover {
  background: #064b87;
}

.button.ghost {
  border-color: #cbd5df;
  color: #2d4054;
}

.button.small {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.actions,
.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.list {
  display: grid;
  gap: 12px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.list-item h2 {
  margin: 8px 0 4px;
  font-size: 20px;
}

.list-item p {
  margin: 0;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e9eef3;
  color: #394656;
  font-size: 12px;
  font-weight: 760;
}

.status-submitted,
.status-under_review,
.status-proof {
  background: #e7f1fb;
  color: #07518f;
}

.status-accepted,
.status-published {
  background: #eaf4e1;
  color: #3f6f1a;
}

.status-revision_requested,
.status-rejected {
  background: #f8e8e8;
  color: #8d2f2f;
}

.status-layout,
.status-revised {
  background: #fff2db;
  color: #875400;
}

.alert {
  margin-bottom: 16px;
  padding: 13px 16px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
}

.alert.success {
  border-color: #cbe2b8;
  background: #f2f8ed;
}

.alert.error {
  border-color: #ecc5c5;
  background: #fbefef;
}

.meta-list {
  display: grid;
  gap: 12px;
}

.meta-list div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.meta-list dt {
  color: var(--muted);
  font-weight: 720;
}

.meta-list dd {
  margin: 0;
}

.upload-box {
  margin-top: 24px;
  padding: 18px;
  border: 1px dashed #b9c6d1;
  border-radius: 8px;
  background: #f8fafc;
}

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 12px;
  margin-bottom: 10px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 20px;
  margin-bottom: 20px;
}

.detail-grid > .panel {
  padding: 24px;
}

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

.file-list,
.file-list li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-list {
  display: grid;
  gap: 12px;
}

.file-list li {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.file-list span,
.comment span,
.reviewer span,
.timeline span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.comment-form,
.stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.comment,
.reviewer,
.timeline div {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 170px 210px auto auto;
  gap: 10px;
  align-items: center;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: none;
}

.address-box {
  margin: 18px 0 28px;
  padding: 22px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.address-box h2,
.form-section-title {
  margin-bottom: 16px;
}

.table-wrap {
  overflow-x: auto;
  box-shadow: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.empty-state {
  padding: 38px;
}

@media (max-width: 900px) {
  .topbar,
  .page-head,
  .list-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-hero,
  .auth-grid,
  .detail-grid,
  .form-grid.two,
  .file-row,
  .filters {
    grid-template-columns: 1fr;
  }

  .login-hero img {
    justify-self: start;
  }

  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 14px 16px;
  }

  .brand img {
    width: 96px;
  }

  .container,
  .container-wide {
    width: min(100% - 20px, 1120px);
  }

  .stats-row {
    grid-template-columns: 1fr;
  }
}
