/* Server management dashboard (#/admin) and the Settings link to it. */
.panel-link { flex-direction: row; align-items: center; justify-content: space-between; transition: background 0.15s; }
.panel-link:hover { background: var(--bg-hover); }
.chev { font-size: 32px; color: var(--text-faint); }
.small-text { font-size: 13px; }
.link, .notice a { color: var(--accent); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.danger { color: var(--bad); border-color: rgba(255, 95, 95, 0.4); }
.info { color: #6cb6ff; }
.warn-text { color: #ffc53d; font-weight: 600; }

.admin { padding: 96px var(--gutter) 0; max-width: 1200px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.admin-head h1 { font-size: clamp(26px, 3.5vw, 34px); }
.admin-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 22px; scrollbar-width: none; }
.admin-tabs a { padding: 10px 14px; color: var(--text-dim); font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.admin-tabs a:hover { color: var(--text); }
.admin-tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.admin-body { display: flex; flex-direction: column; gap: 18px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 18px; align-items: start; }
.notice { background: rgba(255, 197, 61, 0.1); border: 1px solid rgba(255, 197, 61, 0.35); color: #ffe2a0; border-radius: 10px; padding: 12px 16px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.tile { background: var(--bg-raised); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.tile b { font-size: 26px; font-weight: 750; font-variant-numeric: tabular-nums; }
.tile span { color: var(--text-dim); font-size: 13px; }
.tile-link:hover { background: var(--bg-hover); }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; width: 100%; }
.facts dt { color: var(--text-dim); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.addresses { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; width: 100%; }
.addresses li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.addresses code { font-size: 15px; }

.drive { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.drive-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.meter { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; width: 100%; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.meter.full i { background: var(--bad); }

.form-grid { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.form-grid label, .transcode-form label { display: flex; flex-direction: column; gap: 6px; color: var(--text-dim); font-size: 14px; }
.form-grid input:not([type=radio]):not([type=checkbox]):not([type=range]), .form-grid select, .lock input {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--text); font-size: 15px; outline: 0; width: 100%;
}
.form-grid input:focus, .form-grid select:focus, .lock input:focus { border-color: var(--accent); }
label.check { flex-direction: row !important; align-items: center; gap: 10px !important; color: var(--text) !important; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.path-row { display: flex; gap: 8px; }
.path-row input { flex: 1; min-width: 0; font-family: ui-monospace, monospace; font-size: 13px !important; }
.segmented { display: flex; gap: 8px; flex-wrap: wrap; }
.segmented label { flex-direction: row !important; align-items: center; gap: 8px !important; padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--text) !important; cursor: pointer; }
.segmented label:has(input:checked) { border-color: var(--accent); background: rgba(255, 106, 61, 0.1); }
.segmented input { accent-color: var(--accent); }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-head p { margin: 0; }
.lib-cards { display: flex; flex-direction: column; gap: 10px; }
.lib-card { display: flex; align-items: center; gap: 16px; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.lib-card.selected { border-color: var(--accent); }
.lib-icon { font-size: 28px; }
.lib-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lib-main code { align-self: flex-start; }
.lib-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.lib-form { border-color: var(--accent); }

.streams { display: flex; flex-direction: column; gap: 12px; }
.stream { display: flex; gap: 16px; align-items: center; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.stream-art { width: clamp(110px, 18vw, 200px); flex: none; border-radius: 8px; overflow: hidden; }
.stream-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.stream-title { display: flex; flex-direction: column; }
.stream-title span { color: var(--text-dim); font-size: 14px; }
.stream-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 14px; }
.who { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.dot-avatar { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.pill { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.ok { background: rgba(70, 196, 110, 0.15); color: var(--ok); }
.pill.info { background: rgba(108, 182, 255, 0.15); color: #6cb6ff; }
.pill.warn { background: rgba(255, 197, 61, 0.15); color: #ffc53d; }
.stream-progress { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.stream-progress .meter { height: 5px; flex: 1; }
.empty-state { padding: 40px 0; text-align: center; }
.empty-state p { margin: 4px 0; }

.transcode-form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; width: 100%; }
.transcode-form legend { color: var(--text-dim); font-size: 14px; margin-bottom: 6px; }
.choice { flex-direction: row !important; align-items: center; gap: 12px !important; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--text) !important; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); background: rgba(255, 106, 61, 0.08); }
.choice.disabled { opacity: 0.45; cursor: default; }
.choice input { accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.q-range { accent-color: var(--accent); width: 100%; }
.range-ends { display: flex; justify-content: space-between; font-size: 12px; }

.log-toolbar { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.log-view {
  margin: 0; background: #07080c; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  height: min(65vh, 640px); overflow: auto; font: 12.5px/1.55 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere;
}
.log-time { color: var(--text-faint); }
.log-warn { color: #ffc53d; }
.log-error { color: #ff8a8a; }

.lock { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 100px var(--gutter) 40px; text-align: center; }
.lock-icon { font-size: 44px; }
.lock h1 { font-size: 28px; }
.lock p { margin: 0; }
.pin-form { display: flex; gap: 8px; }
.pin-form input { width: 160px !important; text-align: center; font-size: 22px !important; letter-spacing: 0.3em; }

.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.6); display: grid; place-items: center; padding: 16px; }
.modal { background: var(--bg-raised); border: 1px solid var(--line); border-radius: 16px; width: min(560px, 100%); max-height: min(80vh, 700px); display: flex; flex-direction: column; overflow: hidden; }
.modal-head { padding: 18px 20px 12px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18px; }
.crumb { align-self: flex-start; }
.folder-list { list-style: none; margin: 0; padding: 6px; overflow: auto; flex: 1; }
.folder-list button { width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 8px; color: var(--text); }
.folder-list button:hover, .folder-list button:focus-visible { background: var(--bg-hover); }
.pad-s { padding: 10px 12px; }
.modal-actions { padding: 14px 20px; border-top: 1px solid var(--line); justify-content: flex-end; }

@media (max-width: 700px) {
  .admin { padding-top: 120px; }
  .stream { flex-direction: column; align-items: stretch; }
  .stream-art { width: 100%; }
  .lib-card { flex-wrap: wrap; }
  .lib-actions { width: 100%; justify-content: flex-start; }
}
