/* Archive presentation only. Search, paging and document actions use the existing handlers. */
:root {
  --bg: #081322; --panel: #101f32; --panel-2: #14263c;
  --line: #293d53; --line-soft: rgb(41 61 83 / 65%);
  --text: #edf4fc; --muted: #b4c4d7; --dim: #91a5bc;
  --champagne: #7dbdff; --champagne-deep: #58a6ef;
  --champagne-soft: rgb(125 189 255 / 10%);
  --danger: #f08f99; --radius: 9px;
}
[hidden] { display: none !important; }
body { background: radial-gradient(ellipse at 70% 0, #142c462e, transparent 55%), #081322; }
body::before, .top-accent { display: none; }
::-webkit-scrollbar-track { background: #0c1b2d; }
::-webkit-scrollbar-thumb { background: #476b91; border-color: #0c1b2d; }
::-webkit-scrollbar-thumb:hover { background: #7dbdff; border-color: #0c1b2d; }
.shell { width: min(1440px, calc(100% - 48px)); padding-top: 26px; }
.page-head { display: flex; align-items: start; gap: 14px; padding: 0 0 24px; text-align: left; }
.back-link { position: static; flex-shrink: 0; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font-size: 12px; letter-spacing: 0; background: #101f3280; }
.back-link:hover { border-color: #476b91; background: #14263c; }
.page-head-copy { flex: 1; min-width: min(185px, 100%); }
h1 { font: 650 clamp(25px, 2.6vw, 32px)/1.2 Inter, Arial, sans-serif; letter-spacing: -.035em; }
.lead { margin: 6px 0 0; font-size: 12px; color: var(--dim); }
.panel { background: #101f32d9; border-radius: 12px; box-shadow: none; }
.panel-head { padding: 12px 16px 0; }
.panel-head:not(:has(button:not([hidden]))) { display: none; }
.filters { padding: 14px 16px; gap: 10px; background: #0c1b2d99; }
.search-field { flex: 1 1 290px; min-width: 220px; }
.search-field input { background: #0b192a; min-height: 40px; border-color: #35506c; border-radius: 8px; font-size: 12px; }
.search-field input::placeholder { color: var(--dim); }
.search-field input:focus { border-color: #7dbdff; box-shadow: 0 0 0 3px #7dbdff15; }
.type-filters { gap: 5px; }
.type-filters button { border-color: transparent; border-radius: 7px; padding: 8px 10px; min-height: 36px; font-size: 11px; }
.type-filters button:hover { background: #1b3048; border-color: var(--line); }
.type-filters button.active { background: #203d58; border-color: #476b91; color: #b5dcff; }
.filters .results-count { font-size: 11px; }
.text-button { min-height: 36px; background: #14263c; font-size: 11px; }
.text-button:hover { background: #1b3048; border-color: #476b91; }
.table-wrap { max-height: min(72vh, 900px); overscroll-behavior: contain; scrollbar-color: #476b91 #0c1b2d; }
.hist-table th { background: #14263c; color: var(--muted); height: 40px; box-shadow: 0 1px var(--line); }
.hist-table th:nth-child(1) { width: 135px; }
.hist-table th:nth-child(2) { width: 26%; }
.hist-table th:nth-child(3) { width: 130px; }
.hist-table th:nth-child(4) { width: 20%; }
.hist-table th:nth-child(5) { width: 125px; }
.hist-table th:nth-child(6) { width: 105px; }
.hist-table th:nth-child(7) { width: 100px; }
.hist-table td { height: 52px; padding: 8px 14px; color: var(--text); font-size: 12px; }
.hist-table tbody tr:hover, .hist-table tbody tr:focus-within { background: #1b304870; }
.doc-title, .money { color: var(--text); }
.doc-title { font-weight: 600; }
.doc-sub { color: var(--dim); font-size: 11px; }
.doc-code { color: #b5dcff; font-size: 11px; }
.type-badge { background: #7dbdff0d; border-color: transparent; color: #a4c9ef; border-radius: 6px; padding: 5px 7px; font-weight: 600; }
.row-actions { gap: 7px; }
.row-actions button { width: 32px; height: 32px; border-radius: 7px; border-color: transparent; }
.row-actions button[data-dl] { color: #b5dcff; background: #7dbdff12; border-color: #355573; }
.row-actions button[data-dl]:hover { color: #edf4fc; background: #244364; border-color: #7dbdff; }
.row-actions button.del { color: var(--dim); }
.row-actions button.del:hover, .row-actions button.confirming { color: #f08f99; background: #f08f9910; border-color: #f08f9960; }
.empty-state { min-height: 220px; }
.empty-state strong { color: var(--text); }
.empty-state p { color: var(--muted); line-height: 1.6; }
.pagination { background: #0c1b2d55; font-size: 11px; }
.panel-foot { background: #0c1b2d55; }
.foot-note { color: var(--dim); line-height: 1.6; }
.page-foot { color: var(--dim); }
.toast { background: #14263c; border-color: var(--line); color: var(--text); }
:focus-visible { outline-color: #9ed1ff; outline-offset: 3px; border-radius: 5px; }
@media (max-width: 980px) {
  .filters .search-field { flex-basis: 100%; }
  .filters .results-count { margin-left: auto; }
}
@media (max-width: 760px) {
  .shell { width: calc(100% - 24px); padding-top: 18px; }
  .page-head { flex-wrap: wrap; gap: 14px; padding-bottom: 18px; }
  .page-head .back-link { position: static; margin: 0; }
  h1 { font-size: 27px; }
  .lead { font-size: 12px; }
  .filters { padding: 12px; }
  .search-field { min-width: 0; }
  .type-filters { width: 100%; }
  .table-wrap { max-height: none; }
  .hist-table td { height: auto; padding: 7px 0; }
  .hist-table th:nth-child(n) { width: auto; }
  .hist-table tr { background: #14263c70; border-color: var(--line); border-radius: 10px; }
  .hist-table td[data-label]::before { color: var(--dim); }
}
@media (prefers-reduced-motion: reduce) {
  .hist-table tbody tr, .row-actions button, .type-filters button, .text-button { transition: none; }
}
