* { box-sizing: border-box; }
:root {
    --ink: #172335;
    --muted: #576477;
    --nav: #172435;
    --panel: #fff;
    --canvas: #f2f4f7;
    --line: #dbe1e9;
    --accent: #ac421f;
    --accent-hover: #8f3416;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: var(--canvas);
    font-size: 15px;
    line-height: 1.5;
}
body { margin: 0; }
a { color: #294969; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid #e68b4a; outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.85rem, 4vw, 2.65rem); letter-spacing: -.04em; line-height: 1.12; margin-bottom: 8px; }
h2 { font-size: 1.18rem; margin-bottom: 16px; }
h3 { font-size: 1rem; margin-bottom: 6px; }
.muted { color: var(--muted); }
.app { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar { background: var(--nav); color: #fff; display: flex; flex-direction: column; min-height: 100vh; padding: 30px 18px 22px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 760; font-size: 1.2rem; letter-spacing: -.02em; text-decoration: none; color: inherit; }
.sidebar .brand { margin: 0 10px 38px; }
.brand-icon { width: 29px; height: 29px; display: inline-block; border-radius: 8px; background: linear-gradient(140deg, #ffd0a3, #ee774a 67%, #ae3d24); box-shadow: inset 0 0 0 1px #ffdbbb5e; }
nav { display: grid; gap: 5px; }
nav a { color: #d8e1ee; padding: 11px 13px; border-radius: 7px; text-decoration: none; }
nav a:hover, nav a.current { background: #2a3b51; color: #fff; }
.profile { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid #ffffff24; }
.profile strong, .profile small { display: block; overflow-wrap: anywhere; }
.profile small { color: #b9c6d8; }
.logout { background: transparent; border: 0; color: #e4eaf2; padding: 8px 0 0; text-decoration: underline; text-underline-offset: 3px; }
.workspace { width: 100%; max-width: 1370px; margin: 0 auto; padding: clamp(22px, 4vw, 55px); }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 20px; margin-bottom: 23px; flex-wrap: wrap; }
.page-head p { margin-bottom: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 6px #13294106; }
.search, .details, .error-page { padding: 21px 24px; }
.search { margin-bottom: 22px; }
.search-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
label { display: grid; align-content: start; gap: 6px; font-weight: 600; font-size: .87rem; }
input:not([type=hidden]):not([type=checkbox]), select, textarea { width: 100%; min-width: 0; border: 1px solid #c7d0dd; border-radius: 6px; padding: 9px 10px; background: #fff; color: var(--ink); font-weight: 400; }
textarea { resize: vertical; }
details { margin: 14px 0; }
summary { cursor: pointer; color: #3e526b; width: fit-content; font-size: .87rem; }
details .search-fields { margin-top: 12px; }
.actions, .title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.title-row { gap: 14px; }
.title-row h1 { margin-bottom: 0; }
.title-row + p { margin-top: 6px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 41px; padding: 8px 15px; border: 1px solid #c7d0dd; border-radius: 7px; background: #fff; color: var(--ink); font-weight: 650; text-decoration: none; font-size: .9rem; white-space: nowrap; }
.button:hover { background: #f4f6f9; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-hover); }
.button.quiet { border-color: transparent; }
.button.danger { border-color: #e7b3ac; color: #8d2c22; }
.results-head { display: flex; gap: 11px; align-items: center; padding: 16px 22px; }
.results-head h2 { margin: 0; }
.count, .status { background: #edf1f6; color: #37495e; font-size: .77rem; font-weight: 650; border-radius: 50px; padding: 3px 9px; white-space: nowrap; }
.status.verified { background: #e5f4ec; color: #206043; }
.status.reference { background: #fcebdc; color: #7f3616; }
.status.working { background: #e5ecfa; color: #25497e; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 11px 16px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 22px; }
thead th { font-size: .79rem; color: #43546b; background: #f7f9fb; white-space: nowrap; }
tbody tr:hover { background: #fafbfd; }
td small { display: block; color: var(--muted); }
.code-link { font-weight: 750; }
.number { text-align: right; font-variant-numeric: tabular-nums; }
.layer th { background: #f3f6fa; color: #3d516a; font-weight: 650; }
.empty { padding: 18px 22px; margin: 0; border-top: 1px solid var(--line); }
.pagination { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 12px 22px; margin: 0; border-top: 1px solid var(--line); }
.pagination a, .pagination span { display: block; padding: 4px 9px; border-radius: 5px; text-decoration: none; }
.pagination .active a { background: #e7eef7; font-weight: 700; }
.pagination .disabled { color: var(--muted); }
.back { display: inline-block; margin-bottom: 14px; font-size: .88rem; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 17px; align-items: start; }
dl { margin: 0 0 15px; }
dl div { display: grid; grid-template-columns: minmax(105px, 1fr) minmax(0, 1.3fr); gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.history, .archive-form { margin-top: 17px; }
.history ul { margin: 0; padding-left: 18px; }
.history li + li { margin-top: 6px; }
.history span { margin-left: 8px; }
.notice, .error { padding: 11px 15px; border: 1px solid #becde0; background: #edf4ff; color: #243e62; border-radius: 8px; }
.error { background: #fff2ef; border-color: #e7b3ac; color: #8a2d25; }
.error ul { margin: 7px 0 0; }
.editor { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.component-row { display: grid; grid-template-columns: 66px minmax(100px, 1fr) minmax(78px, .6fr) auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.column-labels { color: var(--muted); font-size: .83rem; }
.row-actions { display: flex; gap: 3px; }
.row-actions button { background: #f5f7fa; color: var(--ink); border: 1px solid #d1d9e5; border-radius: 5px; min-width: 27px; height: 33px; }
.entry { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse at 18% 20%, #354d68, #182535 62%); }
.login, .entry .error-page { width: min(100%, 410px); background: #fff; border-radius: 14px; padding: clamp(22px, 5vw, 36px); box-shadow: 0 18px 60px #08111c66; }
.login .brand { margin-bottom: 28px; }
.login h1 { font-size: 1.9rem; }
.login-form { display: grid; gap: 16px; margin-top: 24px; }
.other-login { margin: 19px 0 0; font-size: .9rem; text-align: center; }
.credentials { margin-bottom: 18px; }
.credentials dl { margin-bottom: 0; }
.expert-option label { display: flex; align-items: center; gap: 8px; }
.expert-option input[type=checkbox] { accent-color: var(--accent); }
.expert-option p { margin: 5px 0 0; }
.directory-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr)); gap: 14px; align-items: start; }
.directory-grid ul { max-height: 245px; overflow: auto; padding-left: 19px; margin: 0; }
.directory-grid li + li { margin-top: 4px; }
.directory-form { margin-bottom: 18px; }
.directory-form .actions { margin-top: 12px; }
@media (max-width: 920px) {
    .app { grid-template-columns: 174px minmax(0, 1fr); }
    .sidebar { padding-inline: 12px; }
    .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
    .app { display: block; }
    .sidebar { min-height: auto; gap: 12px; padding: 14px; }
    .sidebar .brand { margin: 0; }
    .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
    .sidebar nav a { padding: 7px 9px; }
    .profile { display: flex; gap: 8px; align-items: center; padding: 8px 0 0; }
    .logout { padding: 0; }
    .workspace { padding: 18px 12px; }
    .search, .details { padding: 14px; }
    .form-grid { grid-template-columns: 1fr; }
    .component-row { grid-template-columns: 47px minmax(69px, 1fr) minmax(56px, .6fr) auto; gap: 4px; }
    .component-row input { padding-inline: 4px; }
    .row-actions button { min-width: 22px; padding: 0; }
}
