/* ==========================================================================
   app.css — library, global search, user dashboard and admin console.
   ========================================================================== */
.tb { display: grid; gap: 14px; margin-bottom: 22px; }
.tb__row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.tb select { padding: 9px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(2,14,28,.78); color: var(--text); font: inherit; font-size: .9rem; }
.count { color: var(--muted); font-size: .88rem; text-align: center; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* library cards */
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; }
.lib__item { display: flex; flex-direction: column; gap: 10px; padding: 18px; position: relative; }
.lib__head { display: flex; gap: 12px; align-items: flex-start; }
.lib__ico { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; font-size: 22px; background: rgba(var(--blue-rgb), .14); border: 1px solid rgba(var(--blue-rgb), .4); }
.lib__item h3 { font-size: 1rem; line-height: 1.55; direction: ltr; text-align: start; }
.lib__dom { display: block; direction: ltr; text-align: start; color: var(--muted); font-size: .78rem; }
.lib__da { margin-inline-start: auto; text-align: center; font-weight: 800; color: var(--tq); font-size: 1.15rem; line-height: 1; }
.lib__da small { display: block; font-size: .62rem; font-weight: 500; color: var(--muted); }
.lib__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font-size: .72rem; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.pill--hi { color: var(--gold); border-color: rgba(var(--gold-rgb), .5); }
.lib__item p { color: var(--muted); font-size: .88rem; }
.lib__foot { margin-top: auto; display: flex; gap: 8px; align-items: center; }
.save { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; background: transparent; transition: all .2s; }
.save:hover, .save[aria-pressed="true"] { color: var(--gold); border-color: rgba(var(--gold-rgb), .7); box-shadow: var(--glow-gold); }
mark { background: rgba(var(--gold-rgb), .28); color: inherit; border-radius: 3px; padding: 0 2px; }

/* global search results */
.res { display: grid; gap: 12px; max-width: 860px; margin: 0 auto; }
.res__item { display: grid; gap: 4px; padding: 16px 20px; }
.res__item h3 { font-size: 1.02rem; } .res__item p { color: var(--muted); font-size: .88rem; }
.res__meta { display: flex; gap: 8px; align-items: center; font-size: .75rem; color: var(--muted); }
.res__url { direction: ltr; text-align: start; font-size: .76rem; color: var(--tq); overflow-wrap: anywhere; }

/* dashboards */
.dash { display: grid; grid-template-columns: 230px 1fr; gap: 20px; max-width: var(--wrap); margin: 0 auto; padding: 28px 20px 0; align-items: start; }
.dash__nav { position: sticky; top: 92px; display: grid; gap: 6px; padding: 12px; }
.dash__nav button { text-align: start; padding: 10px 14px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--muted); font: inherit; cursor: pointer; display: flex; gap: 10px; align-items: center; transition: all .2s; }
.dash__nav button:hover { color: var(--text); background: rgba(255,255,255,.04); }
.dash__nav button[aria-selected="true"] { color: var(--gold); border-color: rgba(var(--gold-rgb), .45); background: rgba(var(--gold-rgb), .08); }
.dash__main { min-width: 0; }
.pane { display: none; gap: 18px; } .pane.on { display: grid; }
.pane h2 { font-size: 1.3rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.kpi { padding: 16px 18px; } .kpi b { display: block; font-size: 1.7rem; color: var(--blue); } .kpi span { color: var(--muted); font-size: .84rem; }
.box { padding: 20px; display: grid; gap: 12px; }
.list { display: grid; gap: 8px; }
.row { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(2,14,28,.45); }
.row a { color: var(--text); } .row small { color: var(--muted); }
.banner { padding: 12px 16px; border-radius: 12px; border: 1px solid rgba(var(--gold-rgb), .5); background: rgba(var(--gold-rgb), .08); color: #f4e7c6; font-size: .88rem; }
.tbl { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tbl th, .tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.tbl th { color: var(--gold); font-weight: 600; position: sticky; top: 0; background: var(--panel); }
.tbl-wrap { overflow: auto; max-height: 520px; border: 1px solid var(--line); border-radius: 12px; }
.tbl .ltr { direction: ltr; text-align: start; }
.chk { display: flex; gap: 10px; align-items: flex-start; } .chk input { margin-top: 6px; accent-color: var(--tq); }
.bar { height: 8px; border-radius: 8px; background: rgba(255,255,255,.08); overflow: hidden; } .bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--tq)); transition: width .6s var(--ease); }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; }
.inl-form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.inl-form label { display: grid; gap: 4px; font-size: .84rem; color: var(--muted); }
.inl-form input, .inl-form select, .inl-form textarea { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(2,14,28,.78); color: var(--text); font: inherit; }
@media (max-width: 820px) { .dash { grid-template-columns: 1fr; } .dash__nav { position: static; grid-auto-flow: column; overflow-x: auto; } .dash__nav button { white-space: nowrap; } }

/* article reader */
.article { max-width: 780px; margin: 0 auto; padding: 8px 20px 0; }
.article h2 { margin: 30px 0 8px; font-size: 1.35rem; color: var(--tq); scroll-margin-top: 90px; }
.article p, .article li { color: #cfe0ee; line-height: 2; } .article ol { padding-inline-start: 22px; list-style: decimal; }
.toc { padding: 16px 20px; margin-bottom: 20px; } .toc ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 4px 20px; } .toc a { color: var(--muted); font-size: .9rem; } .toc a:hover { color: var(--gold); }
.notice { margin: 22px 0; padding: 14px 18px; border-radius: 12px; border-inline-start: 4px solid var(--gold); background: rgba(var(--gold-rgb), .08); color: #f4e7c6; font-size: .9rem; }
.refs li { margin: 10px 0; overflow-wrap: anywhere; } .refs a { color: var(--tq); }


.cm-chip .n { margin-inline-start: 8px; padding: 0 7px; border-radius: 999px; font-size: .72em; background: rgba(255,255,255,.09); }
.cm-chip[aria-pressed="true"] .n { background: rgba(0,0,0,.18); }
.hero__search { margin-top: 26px; }
.hero__quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.lib--top { margin-bottom: 20px; }
.lib--top .lib__item { height: 100%; color: inherit; }
.hl__links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.lib > li { list-style: none; }

.cards--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
