/* ---------- Admin page ---------- */
[hidden] { display: none !important; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(360px, 100%); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.login-card .brand { margin-bottom: 4px; }
.login-card .btn { padding: 9px; font-size: 13px; }
.login-err { color: #fca5a5; font-size: 12px; min-height: 16px; }
.login-card a { text-decoration: none; }

.admin-app {
  display: grid; grid-template-columns: 200px minmax(0, 1fr); grid-template-rows: 60px minmax(0, 1fr);
  grid-template-areas: 'top top' 'menu main'; height: 100vh;
}
.admin-app .topbar { grid-area: top; }
.admin-app .brand { text-decoration: none; color: inherit; }
.top-right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.admin-menu { grid-area: menu; }
.admin-main { grid-area: main; overflow-y: auto; padding: 18px; min-width: 0; }
.view { display: flex; flex-direction: column; gap: 14px; max-width: 1400px; }
.view-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.view-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.view-head .btn:last-child { margin-left: auto; }
.pad { padding: 12px 14px 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.note { margin: 0; line-height: 1.5; }
.note a, .tbl a, .bar-row a { color: var(--accent); text-decoration: none; }
code { font-family: var(--mono); font-size: 11.5px; color: var(--amber); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tile span { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--text3); font-weight: 600; }
.tile b { font: 600 20px var(--mono); }
.tile small { color: var(--text2); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bar-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 56px; gap: 10px; align-items: center; padding: 4px 0; font-size: 12px; }
.bar-row[data-filter] { cursor: pointer; border-radius: 6px; }
.bar-row[data-filter]:hover { background: var(--panel2); }
.bar-row .bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bl small { color: var(--text3); }
.bar-row .bt { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar-row .bt i { display: block; height: 100%; background: var(--accent2); border-radius: 3px; }
.bar-row b { font: 500 12px var(--mono); text-align: right; }

.up-row { display: grid; grid-template-columns: 12px 1fr auto 70px; gap: 10px; align-items: center; padding: 5px 0; }
.up-row b { text-align: right; font-weight: 500; }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot.ok { background: var(--up); box-shadow: 0 0 0 3px rgba(34,197,94,.15); }
.dot.bad { background: var(--down); box-shadow: 0 0 0 3px rgba(239,68,68,.15); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }

.filters { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.search-box { position: relative; flex: 1 1 280px; max-width: 460px; }
.search-box .ico { position: absolute; left: 10px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); stroke: var(--text3); fill: none; stroke-width: 2; }
.search-box input { width: 100%; height: 34px; padding: 0 12px 0 32px; background: var(--bg); border: 1px solid var(--line2); border-radius: 8px; outline: none; }
.search-box input:focus { border-color: var(--accent2); }

.table-wrap.tall { max-height: 62vh; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th { position: sticky; top: 0; background: var(--panel); text-align: left; font-weight: 600; color: var(--text3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; padding: 8px 10px; border-bottom: 1px solid var(--line); z-index: 1; }
.tbl td { padding: 6px 10px; border-bottom: 1px solid #142030; vertical-align: top; }
.tbl tr:hover td { background: rgba(21,32,48,.6); }
.tbl.acc .path { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl.acc .path .m { color: var(--text3); }
.tbl.acc .ref { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text2); }

.btn.danger { color: #fca5a5; border-color: #7f1d1d; background: #2a1215; }
.params textarea { background: var(--bg); border: 1px solid var(--line2); border-radius: 7px; padding: 8px 10px; outline: none; resize: vertical; font: inherit; color: inherit; }
.params textarea:focus { border-color: var(--accent2); }
.save-row { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.save-row .btn { padding: 8px 18px; font-size: 13px; }
.toast.ok { background: #0f2a22; border-color: #14532d; color: #bbf7d0; }

@media (max-width: 900px) {
  .admin-app { grid-template-columns: 1fr; grid-template-rows: 60px auto minmax(0, 1fr); grid-template-areas: 'top' 'menu' 'main'; }
  .admin-menu { flex-direction: row; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-menu h4 { display: none; }
  .admin-menu button { width: auto; flex: none; }
  .grid2 { grid-template-columns: 1fr; }
  .admin-main { padding: 12px; }
}
@media (max-width: 600px) {
  .admin-app .brand-text span { display: none; }
  .admin-app .topbar { padding: 0 12px; gap: 8px; }
}

/* ---------- Users, share links, logins ---------- */
.login-note { background: #2a2010; border: 1px solid #5c4310; color: #fde68a; border-radius: 8px; padding: 9px 11px; font-size: 12.5px; line-height: 1.45; }
.who { align-self: center; color: var(--text2); font-size: 12.5px; }
.view-head h2 + .muted { flex: 1 1 260px; }
.inline-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 10px 14px 14px; }
.inline-form .field { flex: 1 1 170px; min-width: 0; }
.inline-form .field.grow { flex: 3 1 280px; }
.inline-form .field.narrow { flex: 0 0 90px; }
.inline-form .btn { padding: 8px 16px; white-space: nowrap; }
.new-link { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.new-link input { flex: 1 1 320px; min-width: 0; height: 32px; padding: 0 10px; background: var(--bg); border: 1px solid var(--line2); border-radius: 7px; font-family: var(--mono); font-size: 12px; outline: none; }
.tbl td.acts { white-space: nowrap; text-align: right; }
.tbl td.acts .btn { margin-left: 6px; }
.tbl td { vertical-align: middle; }
.tbl .path { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl tr.gone td { opacity: .55; }
.tbl select.sel { padding: 3px 6px; }
