/* ETDv2 base styles: mobile-first, system fonts, CSUN red accent. */
:root {
  --red: #d22030;
  --red-dark: #a8192a;
  --ink: #1f1f1f;
  --muted: #5f6368;
  --line: #e0e0e0;
  --bg: #fafafa;
  --panel: #ffffff;
  --link: #0b57d0;
  --ok-bg: #e6f4ea; --ok-ink: #1e4620;
  --info-bg: #e8f0fe; --info-ink: #174ea6;
  --err-bg: #fce8e6; --err-ink: #8a1c12;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
.topbar {
  background: var(--red);
  color: #fff;
  padding: 0.75rem 1rem;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between;
}
.topbar a { color: #fff; }
.topbar .brand { text-decoration: none; font-weight: 600; }
.topnav { display: flex; gap: 1rem; align-items: center; }
.page { max-width: 64rem; margin: 0 auto; padding: 1rem; }
.footer {
  max-width: 64rem; margin: 2rem auto 0; padding: 1rem;
  color: var(--muted); font-size: 0.875rem; border-top: 1px solid var(--line);
}
a { color: var(--link); }
h1 { font-size: 1.5rem; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.75rem; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 1rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
label { display: block; font-weight: 600; margin: 0.75rem 0 0.25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 0.6rem; font: inherit; border: 1px solid #999; border-radius: 6px; background: #fff;
}
input:focus, select:focus, textarea:focus, button:focus, a:focus { outline: 3px solid #ffbf47; outline-offset: 2px; }
.btn {
  display: inline-block; padding: 0.6rem 1rem; margin-top: 0.75rem; font: inherit; font-weight: 600;
  border: 1px solid var(--red); border-radius: 6px; background: #fff; color: var(--red); cursor: pointer; text-decoration: none;
  min-height: 44px;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.inline { display: inline; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: #fff; text-decoration: underline; cursor: pointer; }
.alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.masquerade {
  background: #fff3cd; color: #5c4400; border-bottom: 3px solid #e0a800;
  padding: 0.5rem 1rem;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between;
}
.alert-success { background: var(--ok-bg); color: var(--ok-ink); }
.alert-info { background: var(--info-bg); color: var(--info-ink); }
.alert-error { background: var(--err-bg); color: var(--err-ink); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; margin: 0; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; }
ul.plain { list-style: none; padding: 0; margin: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr.current { background: var(--ok-bg); }
.table .ua { word-break: break-all; color: var(--muted); font-size: 0.85rem; }
@media (min-width: 720px) {
  h1 { font-size: 2rem; }
  .grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 719px) {
  .table thead { display: none; }
  .table tr { display: block; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 0.5rem; padding: 0.25rem 0.5rem; }
  .table td { display: block; border: 0; padding: 0.15rem 0; }
  .facts { grid-template-columns: 1fr; }
}

/* Administration */
.subnav { background: #fff; border-bottom: 1px solid var(--line); padding: 0.4rem 1rem; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.95rem; }
.subnav a { text-decoration: none; padding: 0.25rem 0; }
.cardlink { display: block; text-decoration: none; color: var(--ink); }
.cardlink:hover { border-color: var(--red); }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.25rem 0; }
.row input:not([type=checkbox]), .row select { width: auto; flex: 1 1 10rem; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: flex-end; }
.row-wrap label { margin: 0; font-weight: 500; }
.row-wrap input, .row-wrap select { width: auto; display: block; }
.grow { flex: 1 1 20rem; }
.narrow { width: 5rem !important; }
.check { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 500; margin: 0.5rem 0; }
.btn-sm { padding: 0.35rem 0.7rem; min-height: 36px; margin-top: 0; }
.btn-danger { border-color: #8a1c12; color: #8a1c12; }
.linklike-dark { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; cursor: pointer; }
.table td input:not([type=checkbox]), .table td select { width: 100%; min-width: 6rem; padding: 0.35rem; }
.table.audit .details { font-size: 0.8rem; word-break: break-all; }
details summary { cursor: pointer; margin-top: 0.5rem; color: var(--link); }
h3 { font-size: 1rem; margin: 1rem 0 0.5rem; }

/* Thesis page */
.stepper { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.25rem; counter-reset: step; }
.step { padding: 0.5rem 0.6rem; border-top: 4px solid var(--line); background: var(--panel); font-size: 0.9rem; }
.step-label::before { counter-increment: step; content: counter(step) ". "; color: var(--muted); }
.step-done { border-top-color: #1e8e3e; }
.step-current { border-top-color: var(--red); font-weight: 600; }
.step-due { color: var(--muted); font-weight: 400; font-size: 0.85rem; }
.card.current { border-color: var(--red); }
.decision .buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.75rem; }
.btn-disabled { opacity: 0.5; cursor: not-allowed; }
.item { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item-title { font-weight: 600; font-size: 1.05rem; }
.state { display: inline-block; margin-top: 0.25rem; font-size: 0.9rem; }
.chip { display: inline-block; background: var(--ok-bg); color: var(--ok-ink); border-radius: 999px; padding: 0.1rem 0.6rem; font-size: 0.85rem; margin-right: 0.25rem; }
.count { display: inline-block; background: var(--red); color: #fff; border-radius: 999px; padding: 0 0.5rem; font-size: 0.85rem; }
.entry { padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.entry p { margin: 0.25rem 0 0; white-space: pre-wrap; }
.danger { color: #8a1c12; }
details.card summary { font-weight: 600; }
@media (max-width: 719px) {
  .stepper { grid-template-columns: 1fr 1fr; }
}

/* Queue and checklist */
.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0 0 0.75rem; }
.tab { padding: 0.4rem 0.8rem; border: 1px solid var(--line); border-radius: 6px 6px 0 0; background: var(--panel); text-decoration: none; }
.tab-active { border-bottom-color: var(--red); font-weight: 600; }
.filters { margin-bottom: 1rem; }
.checklist textarea { width: 100%; }
.checklist select.snippet { width: 100%; margin-bottom: 0.25rem; }
.upload .buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
form.inline { display: inline; }
tr.muted td { color: var(--muted); }

/* Final submission */
.license { max-height: 14rem; overflow-y: auto; padding: 0.5rem 0.75rem; border: 1px solid var(--line); background: var(--panel); font-size: 0.9rem; margin-bottom: 0.5rem; }
.prewrap { white-space: pre-wrap; }
.alert-success { background: var(--ok-bg); color: var(--ok-ink); padding: 0.6rem 0.8rem; border-radius: 6px; margin-bottom: 0.75rem; }
