:root {
    font-family: "Segoe UI", system-ui, sans-serif;
    color: #1e3128;
    background: #f3f6f2;
    --green: #225e42;
    --green-dark: #173c2e;
    --muted: #53665b;
    --line: #dce5de;
    --paper: #fff;
    --radius: 14px;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--green); }
h1, h2, p { margin: 0; }
input, select, button { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #b57926; outline-offset: 3px; }

.layout { display: grid; min-height: 100vh; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 38px;
    min-height: 100vh;
    background: var(--green-dark);
    padding: 32px 16px 22px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: white;
    text-decoration: none;
    padding: 0 6px;
}
.brand strong { display: block; font-size: 1.12rem; letter-spacing: -.02em; }
.brand small { display: block; color: #cae0d2; margin-top: 3px; }
.brand-symbol {
    display: grid;
    place-content: center;
    grid-template-columns: repeat(2, 8px);
    gap: 3px;
    flex: none;
    width: 39px;
    height: 39px;
    border-radius: 11px;
    background: #dce9a4;
}
.brand-symbol i {
    width: 8px;
    height: 9px;
    border-radius: 60% 40% 55% 45%;
    background: var(--green-dark);
    transform: rotate(20deg);
}
.brand-symbol i:last-child { grid-column: span 2; justify-self: center; }
.sidebar nav { display: grid; gap: 7px; }
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #e5f0e7;
    font-size: .92rem;
    font-weight: 600;
}
.sidebar nav a:hover { background: #26533f; }
.sidebar nav [aria-current="page"] { background: #32644b; color: white; }
.nav-icon { width: 16px; height: 16px; flex: none; position: relative; }
.list-icon { border: 1.5px solid currentColor; border-radius: 3px; }
.list-icon::after {
    content: "";
    position: absolute;
    inset: 4px 3px;
    border-block: 1px solid currentColor;
}
.bars-icon {
    background: linear-gradient(currentColor, currentColor) 1px bottom / 3px 6px,
                linear-gradient(currentColor, currentColor) 6px bottom / 3px 10px,
                linear-gradient(currentColor, currentColor) 11px bottom / 3px 14px;
    background-repeat: no-repeat;
}
.catalog-icon {
    border: 1.5px solid currentColor;
    border-radius: 3px;
    background: linear-gradient(currentColor, currentColor) center / 8px 1px no-repeat,
                linear-gradient(currentColor, currentColor) center / 1px 8px no-repeat;
}
.signout { margin-top: auto; }
.signout .button { width: 100%; }
.main { width: min(100%, 1360px); margin: 0 auto; padding: 36px 36px 48px; min-width: 0; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 26px; }
h1 { font-size: clamp(1.65rem, 3vw, 2.35rem); letter-spacing: -.045em; line-height: 1.15; }
.page-header p { margin-top: 8px; color: var(--muted); line-height: 1.5; }
.header-date {
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: var(--paper);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-size: .86rem;
    padding: 8px 12px;
}

.panel, .metric {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 2px 3px #183b2c07;
}
.panel { padding: 22px; }
h2 { font-size: 1.13rem; letter-spacing: -.015em; }
.fields { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; margin-top: 19px; }
.filter-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin-fields { grid-template-columns: repeat(2, minmax(0, 220px)); }
.catalog-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.catalog-list { margin-top: 18px; }
.aligned { align-self: end; justify-self: start; }
.centers-link { margin-left: 10px; }
label { display: grid; align-content: start; gap: 7px; font-size: .86rem; font-weight: 600; }
input, select {
    width: 100%;
    min-width: 0;
    height: 42px;
    border: 1px solid #c5d2c9;
    border-radius: 8px;
    color: inherit;
    background: white;
    padding: 8px 10px;
}
input[type="date"] { min-height: 42px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 39px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: .87rem;
    font-weight: 650;
    text-decoration: none;
}
.primary { background: var(--green); color: white; }
.primary:hover { background: var(--green-dark); }
.secondary { background: #fff; color: var(--green-dark); border-color: #c7d4ca; }
.secondary:hover { background: #eef4ee; }
.danger { background: #a12d2d; color: white; }
.danger:hover { background: #7c2424; }
.description { margin-top: 12px; color: var(--muted); }
.notice { margin-bottom: 14px; padding: 11px 14px; border: 1px solid #b9d6bf; border-radius: 8px; background: #edf7ed; }
.notice.error { background: #fff1ef; border-color: #efc0b7; color: #8b2926; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.metric { padding: 15px 17px; border-left: 3px solid #7c9d72; }
.metric span { display: block; color: var(--muted); font-size: .85rem; font-weight: 600; }
.metric strong { display: block; margin-top: 3px; font-size: 1.6rem; letter-spacing: -.025em; overflow-wrap: anywhere; }

.history { padding: 0; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 17px 22px; }
.table-scroll { overflow: auto; }
.catalog-list table { min-width: 340px; }
table { border-collapse: collapse; width: 100%; min-width: 500px; }
th, td { padding: 12px 14px; text-align: left; white-space: nowrap; border-top: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 22px; }
th { background: #f4f7f3; font-size: .81rem; font-weight: 650; color: var(--muted); }
td { font-size: .93rem; font-variant-numeric: tabular-nums; }
tbody tr:nth-child(even) { background: #f8faf8; }
.row-actions a { font-weight: 600; text-underline-offset: 3px; }
.row-actions .remove { color: #8e3931; margin-left: 10px; }
.empty { color: var(--muted); text-align: center; padding: 27px 14px; }
.pagination { display: flex; justify-content: flex-end; gap: 15px; padding: 13px 22px; border-top: 1px solid var(--line); }
.pagination span { color: var(--muted); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-panel { width: min(100%, 390px); padding: 28px; }
.brand-name { color: var(--green); font-weight: 700; margin-bottom: 10px; }
.login-form { display: grid; gap: 15px; margin-top: 22px; }
.login-panel .notice { margin-top: 14px; }

@media (max-width: 1130px) {
    .filter-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 950px) {
    .fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .main { padding-inline: 22px; }
    .layout { grid-template-columns: 185px minmax(0, 1fr); }
}
@media (max-width: 680px) {
    .layout { display: block; }
    .sidebar { min-height: 0; gap: 12px; padding: 14px 16px 12px; }
    .sidebar nav { display: flex; flex-wrap: wrap; }
    .sidebar nav a { padding: 8px 10px; }
    .signout { position: absolute; top: 15px; right: 16px; }
    .signout .button { min-height: 35px; padding-inline: 8px; }
    .main { padding: 22px 14px 32px; }
    .page-header { margin-bottom: 16px; }
    .header-date { display: none; }
    .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .panel { padding: 15px; }
    .history { padding: 0; }
    .panel-head { padding-inline: 15px; }
    .metrics { gap: 7px; margin: 13px 0; }
    .metric { padding: 8px; }
    .metric strong { font-size: 1.25rem; }
}
