:root {
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: #17283f;
  background: #eef3f9;
  font-size: 15px;
  --blue: #194b88;
  --muted: #52647a;
  --line: #d5dfeb;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 3px;
}
button {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  border-radius: 5px;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 600;
  min-height: 42px;
}
button:hover {
  filter: brightness(0.93);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.secondary {
  background: #fff;
  color: var(--blue);
  border-color: #b7c9df;
}
.quiet {
  border: 0;
  background: none;
  color: var(--blue);
  padding: 6px 10px;
}
.danger {
  color: #a32f40;
  border-color: #bd7480;
  background: #fff;
}
header {
  background: var(--blue);
  color: #fff;
  padding: 17px 4%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.brand {
  font-size: 23px;
  font-weight: 750;
  text-decoration: none;
  color: #fff;
  white-space: nowrap;
}
.brand span {
  font-size: 15px;
  font-weight: 400;
  margin-left: 12px;
  border-left: 1px solid #ffffff70;
  padding-left: 14px;
}
#identity {
  display: flex;
  gap: 15px;
  align-items: center;
  font-size: 13px;
}
#identity button {
  color: #fff;
  border-color: #ffffff80;
  background: transparent;
  min-height: 34px;
  padding: 5px 10px;
}
main {
  max-width: 1460px;
  margin: auto;
  padding: 35px 4%;
}
h1 {
  font:
    normal 31px/1.2 Georgia,
    serif;
  margin: 5px 0 20px;
}
h2 {
  font-size: 23px;
  line-height: 1.25;
  margin: 0 0 14px;
}
h3 {
  font-size: 17px;
  margin: 24px 0 12px;
}
p {
  line-height: 1.55;
}
.workspace-label {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 8px;
}
.muted {
  font-size: 13px;
  color: var(--muted);
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.toolbar {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.login {
  max-width: 470px;
  margin: 45px auto;
  background: #fff;
  padding: 35px;
  border-top: 5px solid var(--blue);
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 15px 0 8px;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  border: 1px solid #b3c2d4;
  background: white;
  color: #17283f;
  padding: 10px 11px;
  border-radius: 4px;
  min-width: 0;
}
textarea {
  resize: vertical;
  line-height: 1.5;
}
form > button {
  margin-top: 12px;
}
#message {
  padding: 13px 16px;
  background: #fff1df;
  border-left: 4px solid #875500;
  margin-bottom: 20px;
  white-space: pre-line;
}
#summary {
  display: flex;
  border: 1px solid var(--line);
  background: #fff;
  margin: 12px 0 24px;
  overflow-x: auto;
}
#summary button {
  flex: 1;
  background: none;
  color: var(--muted);
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  min-width: 110px;
  text-align: left;
  padding: 15px;
}
#summary button strong {
  display: block;
  font-size: 25px;
  color: #17283f;
  margin-bottom: 4px;
}
#summary button.active {
  box-shadow: inset 0 -4px var(--blue);
  background: #f1f6fd;
  color: var(--blue);
}
.workbench {
  display: grid;
  grid-template-columns: minmax(290px, 0.85fr) minmax(0, 1.55fr);
  gap: 24px;
  align-items: start;
}
#register,
#worksheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}
.register-controls {
  padding: 16px;
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.register-controls input,
.register-controls select {
  margin: 0;
}
.task-row {
  display: block;
  background: #fff;
  color: #17283f;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  width: 100%;
  padding: 18px;
  text-align: left;
  min-height: 100px;
  font-weight: 400;
}
.task-row.selected {
  background: #edf4fc;
  box-shadow: inset 4px 0 var(--blue);
}
.task-row:hover {
  filter: none;
  background: #f1f6fd;
}
.task-title {
  font-weight: 650;
  font-size: 16px;
  display: block;
  margin: 8px 0;
  overflow-wrap: anywhere;
}
.task-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}
.badge {
  font-size: 12px;
  border-radius: 3px;
  padding: 4px 7px;
  background: #eaf0f7;
  color: #35506e;
  display: inline-block;
}
.badge.review {
  background: #e9e7fa;
  color: #57448e;
}
.badge.completed {
  background: #e2f3ed;
  color: #14695e;
}
.badge.alert {
  background: #fff0d5;
  color: #875500;
}
.badge.overdue {
  background: #fbe8ec;
  color: #a32f40;
}
.empty {
  padding: 40px 28px;
  color: var(--muted);
}
.worksheet-inner {
  padding: 26px;
}
.task-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}
.task-topline p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.task-description {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
  margin: 18px 0 24px;
}
.deadline-sheet {
  border-left: 4px solid var(--blue);
  background: #f0f5fb;
  padding: 12px 18px;
}
.deadline-sheet dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 12px;
  font-size: 13px;
}
.deadline-sheet dt {
  color: var(--muted);
}
.deadline-sheet dd {
  margin: 0;
  font-weight: 600;
}
.exception {
  background: #fff4df;
  color: #754b0b;
  padding: 13px 16px;
  margin-top: 12px;
  overflow-wrap: anywhere;
}
.exception p {
  margin: 5px 0;
}
.action-panel {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 8px;
}
.inline-form {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}
.inline-form label {
  flex: 1;
}
.inline-form button {
  margin-bottom: 8px;
}
#command-form button {
  margin-top: 10px;
}
.history {
  list-style: none;
  padding: 0;
  margin: 0;
}
.history li {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.history-head {
  font-size: 13px;
  font-weight: 600;
}
.history time {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
  margin: 5px 0;
}
.history p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 8px 0;
  font-size: 14px;
}
.history details {
  font-size: 12px;
  color: var(--muted);
}
.history pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  line-height: 1.6;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 7px;
  width: min(620px, calc(100% - 24px));
  padding: 26px;
  max-height: 90vh;
  color: #17283f;
}
dialog::backdrop {
  background: #17283f88;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.dialog-heading h2 {
  margin: 0;
}
.close-dialog {
  font-size: 25px;
}
.form-error {
  color: #a32f40;
  font-size: 13px;
  white-space: pre-line;
}
.staff-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}
.staff-row small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.report-summary {
  padding: 15px;
  background: #f0f5fb;
  line-height: 1.7;
}
.report-item {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  font-size: 14px;
}
.report-item p {
  margin: 4px 0;
}
.export-link {
  display: inline-block;
  color: var(--blue);
  margin: 15px 0;
  font-weight: 600;
}
footer {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 15px 20px 30px;
}
.mobile-back {
  display: none;
}
#more-tasks {
  margin: 14px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 900px) {
  .page-heading {
    display: block;
  }
  .toolbar {
    margin-bottom: 20px;
  }
  .workbench {
    grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  }
  .worksheet-inner {
    padding: 20px;
  }
  .deadline-sheet dl {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .deadline-sheet dd {
    margin-bottom: 9px;
  }
}
@media (max-width: 680px) {
  header {
    padding: 14px 16px;
  }
  .brand {
    font-size: 20px;
  }
  .brand span {
    display: none;
  }
  #identity {
    font-size: 12px;
    gap: 8px;
  }
  main {
    padding: 24px 14px;
  }
  h1 {
    font-size: 28px;
  }
  .toolbar button {
    padding: 9px 11px;
    font-size: 13px;
  }
  #summary {
    margin-bottom: 16px;
  }
  #summary button {
    min-width: 103px;
    padding: 12px;
  }
  .workbench {
    display: block;
  }
  #worksheet {
    display: none;
  }
  .workbench.detail-open #register {
    display: none;
  }
  .workbench.detail-open #worksheet {
    display: block;
  }
  .mobile-back {
    display: inline-block;
    margin-bottom: 20px;
  }
  .worksheet-inner {
    padding: 21px 18px;
  }
  .deadline-sheet dl {
    grid-template-columns: 1fr 1.2fr;
    gap: 10px;
  }
  .deadline-sheet dd {
    margin: 0;
  }
  dialog {
    padding: 20px;
  }
  .login {
    margin: 20px auto;
    padding: 25px;
  }
  .staff-row {
    align-items: start;
  }
  .page-heading h1 {
    max-width: 320px;
  }
  footer {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

.history-changes {
  margin: 12px 0 0;
  line-height: 1.5;
}
.history-changes dt {
  font-weight: 600;
  margin-top: 10px;
}
.history-changes dd {
  margin: 3px 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
