/* Look and feel carried over from the original app (red title block, left menu), made responsive for phones. */
:root {
  --red: #d40000;
  --ink: #111;
  --bg: #f0f0f0;
  --panel: #fff;
  --line: #222;
  --muted: #555;
  --blue: #2f6fd6;
  --ok: #17803d;
  --bad: #c00000;
}
* { box-sizing: border-box; }
html { font-family: "Roboto", system-ui, sans-serif; color: var(--ink); }
body { margin: 0 auto; max-width: 1100px; background: var(--bg); padding: 0 12px 40px; }
a { color: var(--blue); }

.titleBlock {
  display: flex; align-items: center; gap: 16px;
  background: var(--red); color: #fff; padding: 8px 16px; border: 4px solid #000; margin-top: 8px;
}
.titleBlock img { width: 110px; display: block; }
.titleBlock div { flex: 1; text-align: center; }
.titleBlock h1 { font-size: 38px; margin: 0; line-height: 1.15; }

.page { display: flex; gap: 20px; align-items: flex-start; margin-top: 24px; }
.menu { flex: 0 0 210px; border: 2px solid #000; background: var(--bg); }
.menu-title { text-align: center; font-weight: bold; margin: 10px 0 4px; }
.menu a { display: block; padding: 11px 10px; color: #000; text-decoration: none; }
.menu a:hover { background: #ddd; }
.main { flex: 1; min-width: 0; }

fieldset { border: 2px solid #c8c8c8; border-radius: 4px; margin: 0 0 16px; padding: 12px 16px; background: transparent; }
legend { font-weight: bold; font-size: 18px; padding: 0 6px; }
legend h1 { margin: 0; font-size: 28px; }
.page-title { text-align: center; margin: 0 0 8px; font-size: 28px; }
.center { text-align: center; }
.hero { width: 100%; height: auto; display: block; margin-bottom: 8px; }
.hint { color: var(--muted); font-size: 14px; }

/* Forms */
.row { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 10px; }
label { display: inline-flex; flex-direction: column; gap: 4px; font-weight: 500; font-size: 15px; }
label.grow { flex: 1; min-width: 220px; }
label.block { display: flex; margin: 10px 0; }
label.check { flex-direction: row; align-items: center; gap: 6px; align-self: flex-end; padding-bottom: 8px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  font: inherit; font-size: 16px; padding: 7px 8px; border: 1px solid #aaa; border-radius: 3px; background: #fff; min-height: 38px;
}
input[type=number] { width: 130px; }
textarea { width: 100%; resize: vertical; }
.checks { max-width: 480px; }
.check-row { display: flex; align-items: center; gap: 14px; padding: 4px 0; flex-wrap: wrap; }
.check-row > span { width: 110px; font-weight: 500; }
.check-row label { flex-direction: row; align-items: center; gap: 4px; font-weight: normal; }
.check-row label.bad { color: var(--bad); }
input[type=radio], input[type=checkbox] { width: 18px; height: 18px; }

button, .button {
  font: inherit; font-size: 16px; cursor: pointer; border: 1px solid #999; border-radius: 3px;
  background: #fff; color: #000; padding: 8px 14px; text-decoration: none; display: inline-block; text-align: center;
}
button:hover, .button:hover { background: #eaeaea; }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; padding: 10px 18px; margin-top: 8px; }
button.primary:hover { background: #255bb3; }
button.primary:disabled { opacity: .6; cursor: wait; }
button.wide { width: 100%; }
button.link { border: none; background: none; padding: 2px 6px; color: var(--blue); text-decoration: underline; }
button.link.danger { color: var(--bad); }
.button.big { min-width: 240px; padding: 14px; margin: 4px; }
.button.print { background: var(--blue); color: #fff; border-color: var(--blue); }
.button-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 12px 0 18px; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.title-row .page-title { text-align: left; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; justify-content: center; margin: 10px 0; }
.inline-form.tight { justify-content: flex-start; margin: 0; flex-wrap: nowrap; }
.inline-form.tight input { width: 150px; }
.inline-form button.primary { margin-top: 0; }
.inline-form label { flex-direction: row; align-items: center; gap: 6px; }

.notice { padding: 10px 14px; border-radius: 4px; background: #fff; border-left: 4px solid #999; text-align: left; }
.notice.ok { border-color: var(--ok); color: var(--ok); }
.notice.error { border-color: var(--bad); color: var(--bad); }
.notice ul { margin: 6px 0 0; }

.item-list { list-style: none; padding: 0; max-width: 520px; margin: 8px auto; }
.item-list li { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; border-bottom: 1px solid #ccc; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; background: #fff; }
table.data th, table.data td { border: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: top; }
table.data th { border-width: 2px; background: #f7f7f7; }
table.data td.num { text-align: right; }
table.data tr.total td { font-weight: bold; border-top: 2px solid var(--line); }
table.data a { color: inherit; text-decoration: none; display: block; }
table.data tbody tr:hover { background: #fff3f3; }

.login { padding: 24px; max-width: 420px; background: #f7f7f7; margin: 0 auto; border-radius: 2px; box-shadow: 0 2px 2px rgba(0,0,0,.3); }
.login h1 { text-align: center; font-size: 26px; }
.login input { width: 100%; margin-bottom: 10px; height: 44px; }

/* Print page */
body.bare { background: #fff; max-width: 850px; }
.print-page h1 { text-align: center; margin: 12px 0 0; }
.print-page h3 { margin: 18px 0 6px; border-bottom: 2px solid #000; }
.print-table { width: 100%; border-collapse: collapse; }
.print-table th, .print-table td { border: 1px solid #000; padding: 5px 7px; text-align: left; }
.print-table th { width: 25%; background: #f3f3f3; }
.print-table td.bad { color: var(--bad); font-weight: bold; }
.print-box { border: 1px solid #000; padding: 6px 8px; margin-top: 10px; min-height: 70px; }
.print-box h4 { margin: 0 0 4px; }
.print-box p { margin: 0; white-space: pre-wrap; }
.print-foot { display: flex; justify-content: space-between; margin-top: 16px; font-size: 14px; }
@media print { @page { margin: 0.4in 0.5in; } body.bare { padding: 0; } }

/* Phones */
@media (max-width: 800px) {
  .titleBlock img { width: 60px; }
  .titleBlock h1 { font-size: 20px; }
  .page { flex-direction: column; gap: 12px; margin-top: 12px; }
  .menu { flex: none; width: 100%; display: flex; flex-wrap: wrap; }
  .menu-title { display: none; }
  .menu a { flex: 1 1 45%; border: 1px solid #bbb; text-align: center; padding: 10px 6px; }
  fieldset { padding: 10px; }
  .row > label { flex: 1 1 100%; }
  .row > label.check { flex: 1 1 auto; }
  input[type=number] { width: 100%; }
  .button.big { min-width: 0; width: 100%; }
}

/* layout fixes */
.report-form fieldset > button.primary { display: block; margin-top: 14px; }
@media (max-width: 800px) {
  .check-row { flex-wrap: nowrap; gap: 8px; font-size: 14px; }
  .check-row > span { width: 78px; flex: none; }
  .report-form fieldset > button.primary { width: 100%; }
  .report-form select { width: 100%; }
}
