*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.4;
    color: #1f1f1f;
    background: #f2f2f0;
}

h1, h2, p { margin: 0; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.site-header { background: #fff; border-bottom: 1px solid #cfcfcb; }
.site-header__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: inherit; text-decoration: none; }
.brand__logo { width: 32px; height: 32px; border: 2px dashed #8a8a86; border-radius: 6px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.site-nav a { padding: 10px 12px; border-radius: 6px; color: inherit; text-decoration: none; }
.site-nav a[aria-current="page"] { background: #e6e6e3; font-weight: 600; }
.site-user { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.site-user form { margin: 0; }

.site-main { padding-top: 24px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 16px; }
.site-main--bare { max-width: 440px; padding-top: 64px; }

.page-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.page-heading__intro { color: #4a4a47; margin-top: 4px; }
.back-link { align-self: flex-start; }

.button {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 0 16px; border: 1px solid #8a8a86; border-radius: 8px;
    background: #fff; color: inherit; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.button--primary { background: #1f1f1f; border-color: #1f1f1f; color: #fff; }
.link-button { border: 0; background: none; padding: 10px 4px; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.link-button--danger { color: #a12c1f; }

.panel { background: #fff; border: 1px solid #cfcfcb; border-radius: 10px; padding: 16px; }

.item-image {
    display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
    background: #e6e6e3; border: 1px solid #cfcfcb; border-radius: 6px; text-align: center;
}
.item-image__label { font-size: 11px; color: #4a4a47; padding: 2px; }
.item-image--small { width: 56px; height: 40px; }
.item-image--small .item-image__label { display: none; }
.item-image--medium { width: 64px; height: 64px; }
.item-image--large { width: 96px; height: 96px; }

.item-list { display: flex; flex-direction: column; gap: 12px; }
.item-card { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 20px; background: #fff; border: 1px solid #cfcfcb; border-radius: 10px; padding: 14px; }
.item-card__body { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; gap: 4px; color: #4a4a47; }
.item-card__name { font-size: 21px; color: #1f1f1f; }
.item-card__body strong { color: #1f1f1f; }
.item-card__note { font-style: italic; font-size: 14px; }
.item-card__actions { flex: 1 1 280px; max-width: 420px; display: flex; gap: 8px; }
.item-card__actions > * { flex: 1 1 0; }
.item-card__actions form { margin: 0; display: flex; }
.item-card__actions form .button { flex: 1 1 auto; }

.stats { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; font-size: 14px; color: #4a4a47; }
.stats div { display: flex; gap: 4px; }
.stats dt::after { content: ":"; }
.stats dd { margin: 0; font-weight: 700; color: #1f1f1f; }
.history-list { list-style: none; margin: 8px 0 0; padding: 0; }
.history-entry { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid #e0e0dc; }
.history-entry__body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: #4a4a47; }
.history-entry__date { font-size: 16px; font-weight: 600; color: #1f1f1f; }

.menu { position: relative; }
.menu > summary {
    list-style: none; display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: 1px solid #cfcfcb; border-radius: 8px; background: #fff; cursor: pointer;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu__items {
    position: absolute; right: 0; top: 48px; z-index: 2; min-width: 190px; padding: 6px;
    display: flex; flex-direction: column; background: #fff; border: 1px solid #8a8a86; border-radius: 8px;
}
.menu__items form { margin: 0; }
.menu__item { display: flex; align-items: center; min-height: 44px; padding: 0 12px; color: inherit; text-decoration: none; }
.menu__items .link-button { width: 100%; text-align: left; text-decoration: none; padding: 0 12px; min-height: 44px; }

.form { display: flex; flex-direction: column; gap: 20px; margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; }
.field__label, .field > label, .field > legend { font-size: 14px; font-weight: 600; padding: 0; }
.field__optional, .field__hint { font-weight: 400; font-size: 13px; color: #4a4a47; }
.field input[type="text"], .field input[type="date"], .field textarea {
    min-height: 44px; padding: 8px 12px; border: 1px solid #8a8a86; border-radius: 8px; font: inherit; max-width: 100%;
}
.field--narrow input { max-width: 240px; }
.choice { display: flex; align-items: center; gap: 10px; }
.image-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 8px; border-top: 1px solid #e0e0dc; }
.form-actions__end { margin-left: auto; }

.log-change { max-width: 480px; display: flex; flex-direction: column; gap: 16px; }
.log-change__header { display: flex; align-items: center; gap: 14px; }
.item-type-form { max-width: 760px; }

.table-scroll { position: relative; overflow-x: auto; }
.data-table { width: 100%; min-width: 600px; border-collapse: collapse; }
.data-table th, .data-table td { padding: 8px 12px; border-bottom: 1px solid #e0e0dc; text-align: left; }
.data-table th { font-size: 13px; color: #4a4a47; border-bottom-width: 2px; }
.data-table__actions { text-align: right; white-space: nowrap; }
.data-table__actions form { display: inline; margin: 0; }
.status { font-size: 13px; font-weight: 600; border: 1px solid #6b6b67; border-radius: 999px; padding: 2px 10px; }

.sign-in { display: flex; flex-direction: column; gap: 20px; padding: 32px; }
