﻿:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #657383;
  --line: #d9e0e7;
  --surface: #ffffff;
  --page: #f5f7f9;
  --brand: #0f6b8f;
  --brand-strong: #0b4d66;
  --green: #18795b;
  --amber: #b46a00;
  --danger: #b3261e;
  --shadow: 0 10px 30px rgba(23, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--page);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.topnav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.topnav form {
  margin: 0;
}

.shell {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 24px clamp(14px, 4vw, 28px) 48px;
}

.page-heading,
.records-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0 16px;
}

.records-heading {
  margin-top: 28px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: clamp(1.8rem, 6vw, 3rem);
}

h2 {
  font-size: clamp(1.3rem, 4vw, 2rem);
}

h3 {
  font-size: 1.1rem;
}

.panel,
.login-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: clamp(16px, 4vw, 24px);
}

.login-panel {
  width: min(420px, 100%);
  margin: 48px auto;
  padding: 24px;
}

.login-panel h1 {
  margin-bottom: 18px;
}

.form-stack,
.entry-form {
  display: grid;
  gap: 18px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.wide {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 7px;
}

label span,
.timer-label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #c8d2dc;
  border-radius: 7px;
  outline: none;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 107, 143, 0.16);
}

input[type="file"] {
  height: auto;
  min-height: 46px;
  padding: 9px;
}

.upload-row {
  display: grid;
  grid-template-columns: minmax(170px, 240px) 1fr;
  gap: 16px;
  align-items: end;
}

.timer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  background: #eef6f7;
  border: 1px solid #cfe2e7;
  border-radius: 8px;
}

.timer-bar strong {
  display: block;
  min-width: 116px;
  font-size: 1.55rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.button-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.button-row.compact {
  gap: 8px;
}

.button-row.split {
  justify-content: space-between;
}

.primary-button,
.secondary-button,
.ghost-button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 7px;
  border: 1px solid transparent;
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
}

.primary-button {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.primary-button:hover {
  background: var(--brand-strong);
  text-decoration: none;
}

.secondary-button {
  color: var(--brand-strong);
  background: #fff;
  border-color: #9fb9c4;
}

.secondary-button:hover {
  background: #edf7fa;
  text-decoration: none;
}

.ghost-button,
.link-button {
  color: var(--ink);
  background: transparent;
  border-color: transparent;
}

.ghost-button:hover,
.link-button:hover {
  background: #edf0f3;
  text-decoration: none;
}

.danger {
  color: var(--danger);
}

.notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  color: #473000;
  background: #fff2d8;
  border: 1px solid #e4c57d;
  border-radius: 8px;
  font-weight: 700;
}

.notice.subtle {
  margin: 0;
  color: var(--muted);
  background: #f8fafb;
  border-color: var(--line);
  font-weight: 600;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.flash {
  padding: 12px 14px;
  background: #eef6f7;
  border: 1px solid #cfe2e7;
  border-radius: 8px;
  font-weight: 700;
}

.flash.error {
  color: var(--danger);
  background: #fff0ef;
  border-color: #f0b8b4;
}

.flash.success {
  color: var(--green);
  background: #edf8f3;
  border-color: #b9ddcf;
}

.search-form {
  display: flex;
  gap: 8px;
  width: min(420px, 100%);
}

.entry-list {
  display: grid;
  gap: 12px;
}

.entry-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.entry-card h3 a {
  color: var(--ink);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.quick-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(76px, auto));
  gap: 10px;
  margin: 0;
}

.quick-facts div {
  min-width: 76px;
  padding: 8px 10px;
  background: #f8fafb;
  border: 1px solid #e1e7ed;
  border-radius: 7px;
}

.quick-facts dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.quick-facts dd {
  margin: 2px 0 0;
  font-weight: 800;
}

.attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.session-summary {
  margin-bottom: 18px;
}

.session-list {
  display: grid;
  gap: 12px;
}

.session-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.attachment-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.attachment-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background: #e8edf1;
  color: var(--muted);
  font-weight: 900;
}

.attachment-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-body {
  display: grid;
  gap: 9px;
  padding: 12px;
}

.attachment-body span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.9rem;
}

.attachment-body form,
.delete-entry-form {
  margin: 0;
}

.delete-entry-form {
  display: flex;
  justify-content: flex-end;
  margin-top: 26px;
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed #b7c3ce;
  border-radius: 8px;
  text-align: center;
}

.info-band {
  padding: clamp(18px, 4vw, 28px) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.info-band p {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.info-grid article {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.info-grid p {
  margin: 8px 0 0;
  color: var(--muted);
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.report-summary div {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.report-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.report-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 1.2rem;
}

.report-form {
  display: grid;
  gap: 16px;
}

.transfer-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
}

.report-list {
  display: grid;
  gap: 12px;
}

.report-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.check-line {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.check-line input,
.labor-toggle input {
  width: 20px;
  min-height: 20px;
}

.check-line span {
  color: var(--ink);
  font-size: 1.05rem;
}

.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.mini-grid {
  display: grid;
  grid-template-columns: minmax(90px, 140px) minmax(110px, 160px) auto;
  gap: 12px;
  align-items: end;
}

.labor-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
}

.report-total {
  color: var(--muted);
  font-weight: 700;
}

button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .topnav {
    width: 100%;
    justify-content: space-between;
  }

  .page-heading,
  .records-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .field-grid,
  .upload-row {
    grid-template-columns: 1fr;
  }

  .timer-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .timer-bar .button-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .entry-card {
    grid-template-columns: 1fr;
  }

  .session-card {
    grid-template-columns: 1fr;
  }

  .quick-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quick-facts div {
    min-width: 0;
  }

  .search-form {
    width: 100%;
  }

  .info-grid,
  .report-summary,
  .transfer-bar,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }

  .attachment-body .button-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 430px) {
  .shell {
    padding-inline: 10px;
  }

  .quick-facts {
    grid-template-columns: 1fr;
  }

  .timer-bar .button-row {
    grid-template-columns: 1fr;
  }

  .search-form {
    flex-direction: column;
  }
}
