/* SiteMate dashboard: the one shared stylesheet (ADR 0013). Brand tokens from the PlantLogic website.
   Mobile-first (360 px phones up); nothing may scroll the page sideways (daybook-dashboard AC21). */

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/assets/fonts/outfit-latin-wght-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/assets/fonts/inter-latin-wght-normal.woff2) format('woff2');
}

:root {
  --navy-deep: #0a1c33;
  --navy: #1b3a6b;
  --navy-600: #284f88;
  --orange: #e07b2a;
  --paper: #ffffff;
  --paper-2: #f5f8fc;
  --ink: #1b2a3d;
  --muted: #4e5d72;
  --hair: rgba(27, 58, 107, 0.16);
  --on-dark: #f2f6fb;
  --danger: #b42318;
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --radius: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper-2);
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--navy-deep);
}
h1 {
  font-size: 1.75rem;
  margin: 0.25rem 0 1rem;
}
h2 {
  font-size: 1.3rem;
  margin: 1.5rem 0 0.5rem;
}
h3 {
  font-size: 1.1rem;
}
a {
  color: var(--navy-600);
}
/* focus-within: a date input's calendar button takes a Tab stop without the input matching :focus. */
:focus-visible,
input[type='date']:focus-within {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}
/* A standalone text link as a 44 px target (AC11). */
.tap {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
}
img {
  max-width: 100%;
  height: auto;
}

/* Shell (AC9): below 1024 px a navy top bar whose Menu button shows the links; from 1024 px a persistent sidebar.
   The links hide only under html.js (set by menu.js) and only with display:none, so without JS they stay usable. */
aside {
  background: var(--navy-deep);
  color: var(--on-dark);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0.375rem 0.75rem;
}
.brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--on-dark);
}
.brand::before {
  content: '';
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.55rem;
  border-radius: 2px;
  background: var(--orange);
  vertical-align: 0.1em;
}
aside button {
  background: transparent;
  color: var(--on-dark);
  border-color: rgba(242, 246, 251, 0.45);
}
.menu {
  display: none;
}
.links {
  padding: 0 0.5rem 0.75rem;
}
nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 0.75rem;
  border-radius: 8px;
  color: var(--on-dark);
  text-decoration: none;
  font-weight: 500;
}
nav a:hover {
  background: rgba(255, 255, 255, 0.08);
}
nav a[aria-current='page'] {
  background: var(--navy);
  box-shadow: inset 3px 0 0 var(--orange);
  font-weight: 600;
}
nav .badge {
  margin-left: auto;
}
.links form {
  margin: 0.75rem 0.25rem 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(242, 246, 251, 0.16);
}
main {
  padding: 1rem 0.75rem 2rem;
  max-width: 72rem;
  margin: 0 auto;
}
@media (max-width: 1023.98px) {
  html.js .menu {
    display: inline-flex;
    align-items: center;
  }
  html.js .links:not(.open) {
    display: none;
  }
}
@media (min-width: 1024px) {
  body.shell {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
  }
  aside {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
  }
  .topbar {
    padding: 1.25rem 1.25rem 1rem;
  }
  main {
    padding: 1.5rem 2rem 3rem;
  }
  h1 {
    font-size: 2rem;
  }
}
.page {
  min-width: 0;
}

/* No nav (login): the page as one centred card on navy. */
body.card {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--navy-deep);
}
body.card .page {
  width: 100%;
  max-width: 26rem;
}
body.card main {
  padding: 1.5rem;
  background: var(--paper);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
}
th,
td {
  text-align: left;
  padding: 0.4rem;
  border-bottom: 1px solid var(--hair);
  vertical-align: top;
}
th {
  color: var(--muted);
  font-weight: 600;
}
.scroll {
  overflow-x: auto;
  max-width: 100%;
}
/* Tables of form fields: one block per row on phones, so every control stays on screen (daybook-dashboard AC21). */
@media (max-width: 40rem) {
  .stack,
  .stack tbody,
  .stack tr,
  .stack td {
    display: block;
  }
  .stack thead {
    display: none;
  }
  .stack td {
    border: 0;
    padding: 0.2rem 0.4rem;
  }
  .stack tr {
    border-bottom: 1px solid var(--hair);
    padding: 0.3rem 0;
  }
}

input,
select,
button,
textarea,
.btn {
  font: inherit;
  max-width: 100%;
  min-height: 44px;
  padding: 0.35rem 0.75rem;
  color: var(--ink);
  border: 1px solid var(--hair);
  border-radius: 8px;
  background: var(--paper);
}
input[type='checkbox'],
input[type='radio'] {
  min-height: 0;
}
/* A checkbox's label is its 44 px target (AC11). */
label:has(> input[type='checkbox']) {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
}
/* Buttons: secondary by default (navy outline); .btn--primary is the one orange action per page (AC10), with
   navy-deep text because white on orange fails AA. */
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  border-radius: 999px;
  padding-inline: 1.1rem;
  border-color: var(--navy);
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
}
button:hover,
.btn:hover {
  background: var(--paper-2);
}
.btn--primary,
.btn--primary:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--navy-deep);
}
.btn--primary:hover {
  filter: brightness(1.05);
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
  margin: 0 0 1.25rem;
  padding: 0.75rem;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 12px;
}
/* Flex items size to content: a long site name in the picker must not push the page sideways (AC21). */
.toolbar > * {
  max-width: 100%;
}
form.inline {
  display: inline;
}
/* A day book add form under its section; the previous/next day and download links as one row of buttons. */
form.add,
.days,
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
form.add {
  margin: 0.5rem 0 1.75rem;
}
.toolbar .days {
  margin-left: auto;
}

.error {
  flex-basis: 100%;
  margin: 0.25rem 0;
  color: var(--danger);
  font-weight: 600;
}
[role='alert'] {
  margin: 0;
  background: var(--danger);
  color: #fff;
  padding: 0.5rem 0.75rem;
}
[role='alert'] a {
  color: #fff;
}
dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 0.5rem;
}
dd {
  margin: 0;
}
.badge {
  background: var(--orange);
  color: var(--navy-deep);
  border-radius: 999px;
  padding: 0 0.45rem;
  font-size: 0.85em;
  font-weight: 700;
}

.document-thumb {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-right: 0.5rem;
}
