/* AGPL-3.0. Root HomeBox palette and adapted item/card/detail layouts. */
:root {
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #fff;
  color: hsl(0 0% 20%);
  font-size: 15px;
  line-height: 1.5;
  --primary: hsl(139 16% 43%);
  --primary-foreground: #fff;
  --secondary: hsl(77 8% 17%);
  --secondary-foreground: hsl(76 18% 83%);
  --accent: hsl(97 37% 93%);
  --accent-foreground: hsl(97 31% 19%);
  --border: hsl(0 0% 81%);
  --muted: #5d655c;
  --radius: 0.5rem;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
main {
  max-width: 1160px;
  margin: auto;
  padding: 24px;
  min-width: 0;
}
header {
  margin-bottom: 24px;
  max-width: 740px;
}
h1 {
  font-size: clamp(1.8rem, 4vw, 2.65rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: 650;
}
h2 {
  font-size: 1.45rem;
  line-height: 1.3;
}
h3 {
  font-size: 1.1rem;
  line-height: 1.4;
  margin: 0 0 12px;
}
p,
h2,
h3 {
  overflow-wrap: anywhere;
}
.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.13em;
  font-weight: 700;
  color: var(--primary);
}
a {
  color: #40654d;
}
button,
.file-button {
  font: inherit;
  min-height: 42px;
  max-width: 100%;
  border: 1px solid #a6b3a5;
  border-radius: var(--radius);
  padding: 8px 13px;
  cursor: pointer;
  background: white;
  color: #344c37;
  overflow-wrap: anywhere;
}
button:hover {
  background: var(--accent);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
.primary,
nav button[aria-current="page"] {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.primary:hover {
  background: #466e52;
}
:focus-visible {
  outline: 3px solid #618e6c;
  outline-offset: 3px;
}
nav,
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
nav {
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 16px;
}
.toolbar {
  font-size: 0.83rem;
  margin-bottom: 20px;
}
.file-button {
  position: relative;
  overflow: hidden;
}
.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.notice {
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #345033;
}
.notice.error {
  background: #fff0ef;
  color: #902d26;
}
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: #fff;
  margin: 18px 0;
  min-width: 0;
  box-shadow: 0 1px 4px #00000005;
}
.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(215px, 100%), 1fr));
  gap: 14px;
  margin: 14px 0;
}
label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #43533f;
  font-size: 0.87rem;
  min-width: 0;
}
input,
textarea,
select {
  font: inherit;
  color: #333;
  background: white;
  border: 1px solid #adb8a9;
  border-radius: 6px;
  padding: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
}
textarea {
  min-height: 90px;
  resize: vertical;
}
.check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}
.check input {
  width: 19px;
  min-height: 19px;
  height: 19px;
  flex: none;
  accent-color: var(--primary);
}
.checks {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(245px, 100%), 1fr));
  gap: 18px;
  margin: 20px 0;
}
.item-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 6px #00000009;
  min-width: 0;
}
.item-picture {
  position: relative;
  height: 200px;
  background: #f1f4ee;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #739074;
  font-size: 2.8rem;
}
.item-picture img {
  width: 100%;
  height: 200px;
  object-fit: contain;
}
.item-picture .badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  width: fit-content;
  max-width: calc(100% - 12px);
  background: var(--secondary);
  color: var(--secondary-foreground);
}
.item-body {
  padding: 16px;
}
.item-body h3 {
  border-bottom: 1px solid #ddd;
  padding-bottom: 9px;
}
.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent);
  color: #405537;
  overflow-wrap: anywhere;
}
.badge.danger {
  background: #ffede9;
  color: #992d24;
}
.badge.warning {
  background: #fff5de;
  color: #886315;
}
.meta,
small {
  color: var(--muted);
  font-size: 0.85rem;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(175px, 100%), 1fr));
  gap: 12px;
  margin: 20px 0;
}
.stat {
  background: var(--accent);
  border: 1px solid #dbe4d6;
  border-radius: 8px;
  padding: 16px;
}
.stat strong {
  display: block;
  font-size: 1.5rem;
}
.empty {
  padding: 24px;
  background: #f3f6f0;
  border-radius: 8px;
}
.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 16px 0;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.85rem;
}
th,
td {
  padding: 11px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  min-width: 90px;
  overflow-wrap: anywhere;
}
th {
  background: #f2f5ef;
}
.details {
  display: grid;
  grid-template-columns: minmax(95px, 1fr) 3fr;
  gap: 10px;
}
.details dt {
  font-weight: 600;
}
.details dd {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.detail-grid .panel {
  margin: 0;
}
.attachment-list {
  list-style: none;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.attachment-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 13px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.attachment-list li > span {
  flex: 1;
  min-width: 100px;
  overflow-wrap: anywhere;
}
.photo {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #f4f6f1;
}
.preview {
  background: #f8faf5;
}
.preview .export-text {
  font:
    12px ui-monospace,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 360px;
  overflow: auto;
}
fieldset {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
}
legend {
  font-weight: 650;
}
footer {
  border-top: 1px solid var(--border);
  margin-top: 28px;
  padding-top: 16px;
  font-size: 0.83rem;
  color: var(--muted);
}
@media (max-width: 640px) {
  main {
    padding: 16px;
  }
  .panel {
    padding: 15px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .details {
    grid-template-columns: 1fr;
  }
  .details dd {
    margin-bottom: 9px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .toolbar button,
  .file-button {
    font-size: 0.8rem;
  }
  .actions > * {
    max-width: 100%;
  }
  .item-picture,
  .item-picture img {
    height: 180px;
  }
}
