:root {
    color-scheme: light;
    --ink: #142d2b;
    --muted: #536963;
    --accent: #086650;
    --accent-dark: #084b3d;
    --line: #dce7e1;
    --paper: #fff;
    --bg: #f1f5f2;
    font: 15px/1.65 "Segoe UI", Tahoma, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); }
a { color: var(--accent); text-underline-offset: 4px; }
a:hover { color: var(--accent-dark); }
button, input, select { font: inherit; }
h1, h2, p { margin: 0 0 14px; }
h1, h2 { line-height: 1.3; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h2 { font-size: 1.22rem; }
p { color: var(--muted); }
:focus-visible { outline: 3px solid #b87b34; outline-offset: 3px; }
.workspace { display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar, .entry-cover {
    background: #102e2a;
    color: white;
}
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 26px 16px;
    height: 100dvh;
    min-height: 390px;
    position: sticky;
    inset-block-start: 0;
    overflow: auto;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: white; text-decoration: none; font-size: 1.18rem; font-weight: 800; }
.brand:hover { color: #a9f2cc; }
.brand-mark {
    position: relative;
    flex: 0 0 37px;
    width: 37px;
    aspect-ratio: 1;
    border-radius: 11px;
    background: #adf0cc;
}
.brand-mark::after {
    content: "";
    position: absolute;
    inset: 10px 8px;
    border: 2px solid #18463b;
    border-radius: 3px;
    background: linear-gradient(#18463b,#18463b) center 46% / 100% 2px no-repeat;
}
.sidebar .brand { padding-inline: 6px; }
.sidebar nav { display: grid; gap: 6px; margin-block-start: 14px; }
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #c7ddd3;
    text-decoration: none;
    white-space: nowrap;
}
.sidebar nav a:hover { background: #1b453c; color: white; }
.sidebar nav a[aria-current] { background: #205244; border-color: #376d5e; color: #e3fbeb; font-weight: 700; }
.nav-icon { color: #a0d9ba; font-size: 1.25rem; line-height: 1; width: 24px; text-align: center; }
.identity { border-top: 1px solid #3a574e; padding: 16px 4px 0; margin-top: auto; display: flex; align-items: center; gap: 10px; overflow-wrap: anywhere; }
.identity small { display: block; color: #a7c5b7; }
.avatar { display: grid; place-items: center; flex: 0 0 35px; aspect-ratio: 1; background: #325b4c; border-radius: 50%; color: #b5edc8; }
.logout button { width: 100%; background: transparent; color: #ecf8f1; border-color: #527168; }
.logout button:hover { background: #225044; }
.content { padding: 38px clamp(16px, 4vw, 54px) 56px; width: min(100%, 1510px); margin-inline: auto; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 23px; }
.page-heading h1 { margin: 0; }
.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric { min-width: 0; padding: 16px clamp(10px, 2.5vw, 23px); border-radius: 14px; border: 1px solid var(--line); background: var(--paper); }
.metric span { display: block; color: var(--muted); font-weight: 650; }
.metric strong { display: block; font-size: clamp(1.4rem, 3.5vw, 2.2rem); font-variant-numeric: tabular-nums; line-height: 1.25; margin-top: 6px; }
.metric:last-child { border-color: #ebd9b6; background: #fdf7e9; }
.metric:last-child span { color: #725012; }
section, .error, .success { margin-bottom: 17px; padding: clamp(16px, 3vw, 27px); border-radius: 15px; border: 1px solid var(--line); background: var(--paper); }
section { box-shadow: 0 3px 11px #142d2b08; scroll-margin-top: 18px; }
section h2 { margin-bottom: 17px; }
.error { color: #8a261e; background: #fff1ef; border-color: #edb8b2; }
.success { color: #195638; background: #eaf9ef; border-color: #b5dcc2; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 195px), 1fr)); align-items: end; gap: 12px; }
.stack { display: grid; gap: 14px; max-width: 440px; }
.stack button { justify-self: start; }
.filters { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #f5f8f6; }
label { display: grid; gap: 5px; font-weight: 650; }
input, select { width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid #b9cbc2; border-radius: 8px; color: var(--ink); background: white; }
input:hover, select:hover { border-color: #809e91; }
input[type=password] { direction: ltr; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 8px 15px; border-radius: 9px; border: 1px solid var(--accent); background: var(--accent); color: white; text-decoration: none; font-weight: 750; cursor: pointer; }
button:hover, .button:hover { background: var(--accent-dark); color: white; }
.secondary { color: var(--accent); border-color: #a5c3b7; background: white; }
.actions, .check { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; min-height: 44px; }
.check input { width: 17px; min-height: auto; height: 17px; accent-color: var(--accent); }
.scroll { overflow-x: auto; }
form + .scroll { margin-top: 16px; border-radius: 9px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; text-align: start; font-variant-numeric: tabular-nums; }
th, td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: start; }
th { background: #edf5ef; color: #304c41; font-size: .92rem; white-space: nowrap; }
td { min-width: 62px; overflow-wrap: anywhere; }
tbody tr:nth-child(even) { background: #f9fbfa; }
tbody tr:hover { background: #f0f8f2; }
tbody tr:last-child td { border-bottom: 0; }
.pages { margin-top: 14px; }
.account + .account { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.account strong { display: block; margin-bottom: 7px; overflow-wrap: anywhere; }
.entry { display: grid; grid-template-columns: minmax(310px, 40%) 1fr; }
.entry-cover { position: relative; isolation: isolate; overflow: hidden; min-height: 100dvh; padding: clamp(24px, 5vw, 64px); display: flex; flex-direction: column; align-items: flex-start; gap: min(18vh, 150px); }
.cover-content { position: relative; z-index: 1; }
.cover-content p { color: #a4dabe; font-weight: 750; }
.cover-content h2 { color: #eff9f2; font-size: clamp(2rem, 4vw, 4rem); line-height: 1.24; margin-bottom: 0; }
.shelves { position: absolute; inset-inline-end: max(-4vw, -40px); bottom: 0; aspect-ratio: 1.7; width: min(85%, 490px); opacity: .44; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 12px; padding: 14px; border: 3px solid #569477; border-radius: 17px 17px 0 0; background: linear-gradient(transparent 48%,#569477 48% 50%,transparent 50%); }
.shelves i { display: block; width: 88%; height: 80%; border: 2px solid #90c6a3; border-radius: 9px; background: linear-gradient(#90c6a3,#90c6a3) top center / 28% 16% no-repeat, #3a765d; }
.shelves i:nth-child(2n) { height: 96%; background-color: #185741; }
.entry-content { align-self: center; width: min(100%, 830px); margin: auto; padding: clamp(15px, 5vw, 70px); }
.entry-content section { margin: 0; padding: clamp(20px, 4vw, 42px); }
.entry-content p { margin-bottom: 20px; }
.entry-content .stack { max-width: none; }
.entry-content .stack button { justify-self: stretch; }
@media (max-width: 920px) {
    .workspace { grid-template-columns: 184px minmax(0, 1fr); }
    .sidebar { padding-inline: 11px; }
    .content { padding-inline: 20px; }
}
@media (max-width: 690px) {
    .workspace, .entry { display: block; }
    .sidebar { position: static; min-height: auto; height: auto; display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 12px; gap: 9px; }
    .sidebar nav { grid-row: 2; grid-column: 1 / -1; display: flex; flex-wrap: wrap; margin: 0; gap: 4px; }
    .sidebar nav a { padding: 5px 8px; }
    .identity { display: none; }
    .logout button { min-height: 38px; padding: 5px 9px; }
    .content { padding: 21px 12px 36px; }
    .page-heading { margin-bottom: 14px; }
    .summary { gap: 6px; }
    .metric { border-radius: 10px; padding: 7px 8px; }
    .metric span { font-size: .82rem; line-height: 1.4; }
    .entry-cover { min-height: auto; padding: 16px; }
    .cover-content, .shelves { display: none; }
}
