/* NYSC Delta Type Helper - plain styles */

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: #fff;
  color: #222;
  font: 15px/1.5 Verdana, Arial, sans-serif;
}
a { color: #000; }
h1 { font-size: 20px; margin: 4px 0 10px; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 16px 0 8px; }
code { background: #f2f2f2; padding: 1px 4px; word-break: break-all; }

/* top bar */
.topbar {
  background: #e6e6e6;
  color: #000;
  border-bottom: 1px solid #bbb;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
}
.brand { color: #000; font-weight: bold; font-size: 17px; text-decoration: none; }
.nav a { color: #000; margin-left: 14px; text-decoration: none; font-size: 14px; }
.nav a:first-child { margin-left: 0; }
.nav a.on, .nav a:hover { text-decoration: underline; }

.wrap { max-width: 820px; margin: 0 auto; padding: 16px; }
.foot { max-width: 820px; margin: 0 auto; padding: 20px 16px 40px; color: #777; font-size: 13px; border-top: 1px solid #ddd; }

/* boxes */
.card { border: 1px solid #ccc; padding: 14px 16px; margin-bottom: 16px; background: #fff; }
.card.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }

.muted { color: #666; }
.small { font-size: 13px; }
.oktext { color: #000; }
.badtext { color: #000; font-weight: bold; }
.warntext { color: #444; font-style: italic; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap { gap: 8px; }
.wrapgap { flex-wrap: wrap; gap: 8px; }
.grow { flex: 1 1 240px; min-width: 0; }

.alert { padding: 8px 12px; margin-bottom: 14px; border: 1px solid; }
.alert.ok { background: #f4f4f4; border-color: #bbb; }
.alert.bad { background: #e6e6e6; border-color: #666; font-weight: bold; }
.alert.warn { background: #eee; border-color: #999; }

/* forms */
.form { display: grid; gap: 10px; }
.form label { display: block; font-size: 14px; }
.form label input, .form label select, .form label textarea { display: block; margin-top: 3px; }
.form label.check input { display: inline; margin: 0; }
.form label.check { display: flex; align-items: center; gap: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px 14px; }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.inner { margin-top: 10px; }
@media (max-width: 640px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2, .span3 { grid-column: auto; }
}
input, select, textarea {
  font: inherit;
  color: #222;
  background: #fff;
  border: 1px solid #aaa;
  border-radius: 0;
  padding: 6px 8px;
  width: 100%;
}
input[type=checkbox] { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid #999; outline-offset: 0; }
details summary { cursor: pointer; padding: 4px 0; color: #000; }
details.opts { margin-top: 12px; border-top: 1px solid #ddd; padding-top: 6px; }

/* buttons */
.btn {
  display: inline-block;
  font: inherit;
  font-size: 14px;
  padding: 7px 14px;
  border: 1px solid #999;
  border-radius: 0;
  background: #f3f3f3;
  color: #222;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}
.btn:hover { background: #e8e8e8; }
.btn.primary { background: #333; border-color: #222; color: #fff; }
.btn.primary:hover { background: #000; }
.btn.danger { color: #000; }
.btn.small { padding: 3px 9px; font-size: 13px; }
.btn.block { display: block; width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.big-btn { padding: 10px 16px; }

.checks { padding-left: 18px; }
.checks .ok { color: #000; }
.checks .bad { color: #000; font-weight: bold; }
.status-line { background: #f6f6f6; border: 1px solid #ddd; padding: 8px 10px; margin-bottom: 12px; font-size: 14px; }

/* progress */
.bar { display: block; height: 8px; border: 1px solid #aaa; background: #fff; margin-top: 4px; }
.bar.big { min-width: 200px; }
.bar span { display: block; height: 100%; background: #555; }
.stats { min-width: 210px; }

/* document list */
.joblist { list-style: none; padding: 0; margin: 0; }
.joblist li { border-bottom: 1px solid #e3e3e3; }
.jobrow { display: block; padding: 8px 0; text-decoration: none; color: #222; }
.jobrow .jt { color: #000; text-decoration: underline; }
.jobrow .jm { display: block; }
.jobrow .bar { max-width: 240px; }

.editable-title { cursor: pointer; }

/* photos waiting to be sent */
.tray-wrap { margin-top: 12px; display: grid; gap: 8px; }
.tray { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.tray-item { position: relative; border: 1px solid #ccc; background: #fafafa; }
.tray-item img { display: block; width: 100%; height: 130px; object-fit: contain; background: #eee; }
.tray-n { position: absolute; top: 2px; left: 2px; background: #fff; border: 1px solid #999; font-size: 12px; padding: 0 5px; }
.tray-btns { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid #ccc; }
.tray-btns button { border: 0; background: #f3f3f3; font: inherit; font-size: 12px; padding: 5px 0; cursor: pointer; color: #222; }
.tray-btns button + button { border-left: 1px solid #ccc; }
.tray-btns button:disabled { color: #bbb; }

/* pages of a document */
.pages { list-style: none; padding: 0; margin: 0; }
.pg { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid #e3e3e3; }
.thumb { width: 64px; height: 84px; object-fit: cover; border: 1px solid #ccc; cursor: pointer; background: #eee; }
.pg-main { min-width: 0; }
.pg-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.badge { font-size: 13px; }
.badge.done { color: #000; }
.badge.busy { color: #555; font-style: italic; }
.badge.wait { color: #777; }
.badge.bad { color: #000; font-weight: bold; }

/* admin table */
.tablewrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 6px; border-bottom: 1px solid #ddd; vertical-align: top; }
.inline-form { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.inline-form input[type=password] { width: 170px; }
.inline-form select { width: auto; }

/* messages */
#toasts { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(520px, calc(100% - 24px)); z-index: 1000; display: grid; gap: 6px; }
.toast { background: #333; color: #fff; padding: 9px 12px; font-size: 14px; }
.toast.bad { background: #000; }
.toast.warn { background: #555; }

/* review window */
dialog { border: 1px solid #888; padding: 0; color: #222; background: #fff; }
dialog::backdrop { background: rgba(0, 0, 0, .5); }
dialog.review { width: min(1150px, 100vw); height: min(94vh, 100%); max-width: 100vw; max-height: 100vh; display: none; }
dialog.review[open] { display: flex; flex-direction: column; }
.review-head, .review-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; padding: 8px 12px; background: #f3f3f3; }
.review-head { border-bottom: 1px solid #ccc; }
.review-foot { border-top: 1px solid #ccc; }
.review-body { flex: 1; display: grid; grid-template-columns: 1fr 1fr; min-height: 0; }
.review-img { overflow: auto; background: #555; }
.review-img img { width: 100%; display: block; }
.review-doc { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid #ccc; }
@media (max-width: 760px) {
  dialog.review { height: 100vh; }
  .review-body { grid-template-columns: 1fr; grid-template-rows: 32% 68%; }
  .review-doc { border-left: 0; border-top: 1px solid #ccc; }
}
.toolbar { display: flex; flex-wrap: wrap; gap: 5px; padding: 6px; border-bottom: 1px solid #ccc; }
.toolbar button { font: inherit; font-size: 13px; padding: 3px 9px; border: 1px solid #999; border-radius: 0; background: #f3f3f3; color: #222; cursor: pointer; }
.small-dlg { width: min(480px, calc(100vw - 24px)); padding: 16px; }

/* typed page preview (looks like the Word file) */
.docpreview { flex: 1; overflow: auto; padding: 20px 24px; background: #fff; color: #111; font-family: "Times New Roman", Times, serif; font-size: 12pt; line-height: 1.35; }
.docpreview [contenteditable="true"]:focus { outline: 1px dashed #666; outline-offset: 2px; }
.b-h { font-weight: bold; margin: 12px 0 6px; }
.b-h.h1 { font-size: 16pt; } .b-h.h2 { font-size: 14pt; } .b-h.h3 { font-size: 12pt; }
.b-p { margin: 0 0 8px; min-height: 1em; }
.ind1 { margin-left: 36px; } .ind2 { margin-left: 72px; } .ind3 { margin-left: 108px; }
.al-center { text-align: center; } .al-right { text-align: right; } .al-justify { text-align: justify; }
.b-li { display: flex; gap: 8px; margin: 0 0 4px 18px; }
.b-li.lvl1 { margin-left: 54px; } .b-li.lvl2 { margin-left: 90px; }
.b-li .mk { min-width: 22px; text-align: right; user-select: none; }
.b-li .tx { flex: 1; }
.b-tw { margin: 8px 0 12px; overflow-x: auto; }
.b-t { border-collapse: collapse; width: 100%; font-size: 11pt; }
.b-t td, .b-t th { border: 1px solid #000; padding: 3px 6px; vertical-align: top; min-width: 30px; }
.b-t th { background: #e7e6e6; font-weight: bold; text-align: center; }
.tbl-tools { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; font: 12px Verdana, Arial, sans-serif; }
.tbl-tools button { font: inherit; border: 1px solid #aaa; background: #f3f3f3; padding: 2px 7px; cursor: pointer; color: #222; }
.b-sp { height: 18px; }
.b-pb { text-align: center; color: #888; font: 12px Verdana, Arial, sans-serif; margin: 10px 0; }
.docpreview hr { border: 0; border-top: 1px solid #000; }
mark.unsure { background: #ff0; color: #000; }

/* square corners everywhere */
*, *::before, *::after, input, select, textarea, button, .btn, dialog { border-radius: 0 !important; }

/* ---------- layout: organised on desktop, stacked on phones ---------- */
.wrap, .foot { max-width: 1120px; }

/* home: new document | my documents */
.home-grid { display: grid; gap: 16px; align-items: start; }
.home-grid .card { margin-bottom: 0; }
@media (min-width: 900px) {
  .home-grid { grid-template-columns: 1fr 1fr; }
}

/* document page: pages list on the left, actions on the right */
.job-grid { display: grid; gap: 16px; align-items: start; grid-template-areas: "add" "pages" "get"; }
.job-grid .card { margin-bottom: 0; }
.area-add { grid-area: add; }
.area-pages { grid-area: pages; }
.area-get { grid-area: get; }
.area-add .wrapgap > .btn, .area-get .wrapgap > .btn { flex: 1 1 200px; }
@media (min-width: 900px) {
  .job-grid {
    grid-template-columns: minmax(0, 1fr) 350px;
    grid-template-rows: auto auto 1fr;
    grid-template-areas: "pages add" "pages get" "pages .";
  }
  .area-add .wrapgap > .btn, .area-get .wrapgap > .btn { flex: 1 1 100%; }
}

/* one page in the list */
.pg { grid-template-columns: 64px minmax(0, 1fr); align-items: start; }
.pg-actions { grid-column: 1 / -1; margin-top: 2px; }
@media (min-width: 700px) {
  .pg { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .pg-actions { grid-column: auto; margin-top: 0; justify-content: flex-end; max-width: 330px; }
}

/* footer */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.foot .credit { text-align: right; }
@media (max-width: 600px) {
  .foot { flex-direction: column; }
  .foot .credit { text-align: left; }
}
