/* Availability report portal. One stylesheet, no framework: this is an
   internal tool for a handful of people on a desktop browser. */

:root {
  --ink: #14202b;
  --muted: #5d6b78;
  --line: #d8dee4;
  --bg: #f6f7f9;
  --card: #ffffff;
  --accent: #00558c;
  --good: #008c61;
  --bad: #c00000;
  --warn: #8a5a00;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        Helvetica, Arial, sans-serif;
}

body.centered {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

main { max-width: 66rem; margin: 1.5rem auto 4rem; padding: 0 1.25rem; }

h1 { font-size: 1.5rem; margin: 1.25rem 0 0.25rem; }
h2 { font-size: 1.15rem; margin: 2rem 0 0.5rem; }

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

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
p.muted { margin: 0.25rem 0; }

/* Header */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1.25rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; text-decoration: none; color: var(--ink); }
.bar nav { display: flex; align-items: center; gap: 1rem; }
.bar nav form { margin: 0; }
.who { color: var(--muted); }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}
.card.problem { border-color: var(--bad); }
.card.problem h2 { margin-top: 0; color: var(--bad); }
.card ul { margin: 0.5rem 0 0; padding-left: 1.25rem; }
.card li { margin: 0.2rem 0; }

.login { width: min(24rem, 92vw); }
.login h1 { margin-top: 0; }

/* Forms */
label { display: block; margin: 0.75rem 0 0.2rem; font-weight: 500; }
label.check { font-weight: 400; display: flex; gap: 0.5rem;
              align-items: center; }
input[type=text], input[type=password], input[type=number], input:not([type]) {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  background: #fff;
  color: inherit;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button {
  font: inherit;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 500;
  margin-top: 1rem;
}
button.primary[disabled] {
  background: var(--muted);
  border-color: var(--muted);
  cursor: not-allowed;
}
button.link {
  border: 0; background: none; color: var(--accent); padding: 0;
  cursor: pointer;
}

.generate .fields { display: flex; gap: 1rem; }
.generate .fields span { flex: 0 0 8rem; }
.generate .fields label { margin-top: 0; }

/* Tables */
table.list, table.edit {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
}
table.list th, table.list td, table.edit th, table.edit td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.list th, table.edit th { background: #eef1f4; font-size: 0.9rem; }
table.edit th span { display: block; font-weight: 400; }
table.list tr:last-child td, table.edit tr:last-child td {
  border-bottom: 0;
}
td.week { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.edit td { padding: 0.25rem; }
table.edit input { min-width: 7rem; }

/* Status and flashes */
.status { font-weight: 600; }
.status.succeeded { color: var(--good); }
.status.failed, .status.timed-out { color: var(--bad); }
.status.running { color: var(--warn); }

.flashes { max-width: 66rem; margin: 0 auto; padding: 0 1.25rem; }
.flash {
  margin: 0.75rem 0 0;
  padding: 0.6rem 0.85rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--card);
}
.flash.error { border-color: var(--bad); color: var(--bad); }
.flash.success { border-color: var(--good); color: var(--good); }

/* Run log */
pre#log {
  background: #11161c;
  color: #dfe6ee;
  padding: 0.9rem;
  border-radius: 6px;
  max-height: 30rem;
  overflow: auto;
  font-size: 0.83rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

details.card summary { cursor: pointer; font-weight: 500; }

/* Viewer: the weeks beside the report */
.viewer {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 1.25rem;
  max-width: 84rem;
  margin: 1.25rem auto 2rem;
  padding: 0 1.25rem;
  align-items: start;
}
.weeks h2 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.weeks ul { list-style: none; margin: 0; padding: 0; }
.weeks li { margin: 0; }
.weeks li a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  text-decoration: none;
  color: var(--ink);
}
.weeks li a:hover { background: #e9edf1; }
.weeks li.chosen a { background: var(--accent); color: #fff; }
.weeks li.chosen a .muted { color: #d7e6f2; }
.weeks li a .week { font-weight: 600; display: block; }

.deck { min-width: 0; }
.deck-bar h1 { margin: 0; }
.deck-bar p { margin: 0.15rem 0; }
.deck-bar .downloads { margin-top: 0.5rem; }

/* The PDF fills what is left of the window. 16:9 would leave the
   controls off screen on a laptop, so the height is viewport based. */
iframe.pdf {
  width: 100%;
  height: calc(100vh - 13rem);
  min-height: 26rem;
  margin-top: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
}

@media (max-width: 60rem) {
  .viewer { grid-template-columns: 1fr; }
  iframe.pdf { height: 70vh; }
}
