/* My Personal Radio — application styles (login, admin, player shell). Uses tokens from base.css. */

a { color: #ff8a95; }
h1, h2, h3 { line-height: 1.25; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .85em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
.btn:hover { background: #1f222b; }
.btn:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #ff6574; }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn-danger:hover { background: rgba(255,92,92,.12); }
.btn-sm { padding: 6px 10px; font-size: .85rem; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: .85rem; color: var(--muted); font-weight: 500; }
.field small { color: var(--muted); font-size: .78rem; }
input[type=text], input[type=password], input[type=number], input[type=email], select {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: #0b0c10; color: var(--text); font: inherit; font-size: 16px; /* 16px stops iOS/Android zoom */ }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
select:disabled, input:disabled { opacity: .55; }
.check { display: flex; align-items: center; gap: 10px; margin: 6px 0 16px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); column-gap: 16px; align-items: start; }
.form-grid .form-actions, .form-grid .span-all { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* ---------- alerts / tags ---------- */
.alert { padding: 11px 14px; border-radius: 10px; margin: 0 0 14px; border: 1px solid; font-size: .92rem; white-space: pre-wrap; word-break: break-word; }
.alert-success { border-color: rgba(62,207,142,.4); background: rgba(62,207,142,.1); color: #9af0c6; }
.alert-error { border-color: rgba(255,92,92,.4); background: rgba(255,92,92,.1); color: #ffb3b3; }
.alert-info { border-color: var(--line); background: var(--surface); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: #222630; color: var(--muted); white-space: nowrap; }
.tag-admin { background: rgba(255,77,94,.15); color: #ff8a95; }
.tag-ok, .tag-info { background: rgba(62,207,142,.13); color: var(--good); }
.tag-off { background: #2a2d36; color: var(--muted); }
.tag-warning { background: rgba(245,185,66,.15); color: var(--mid); }
.tag-error, .tag-critical { background: rgba(255,92,92,.15); color: var(--bad); }

/* ---------- cards / tables ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.card h2 { font-size: 1.05rem; margin: 0; }
.card h3 { font-size: .95rem; margin: 22px 0 10px; color: var(--muted); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card.danger { border-color: rgba(255,92,92,.35); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 4px; }
.cards .card { margin-bottom: 14px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font-size: 1.8rem; font-weight: 700; }
.stat-value.off { font-size: 1.2rem; color: var(--muted); letter-spacing: .08em; padding: 7px 0; }
.stat-value.warn { color: var(--mid); }
.stat-note { color: var(--muted); font-size: .8rem; }
.stat.dim { opacity: .55; }
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; color: var(--muted); font-weight: 500; font-size: .8rem; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .sub { display: block; color: var(--muted); font-size: .8rem; }
.table form { display: inline; }
.row-dim td { opacity: .55; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 4px 0 12px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.back { color: var(--muted); text-decoration: none; }
.back:hover { color: var(--text); }

/* ---------- ON AIR dot ---------- */
.onair-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-right: 10px; vertical-align: middle; }
.onair-dot.big { width: 16px; height: 16px; margin: 0 auto 14px; display: block; box-shadow: 0 0 0 0 rgba(255,77,94,.6); animation: pulse 1.8s infinite; }

/* ---------- centred pages (login, denied) ---------- */
.center-page { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.card.narrow { width: 100%; max-width: 380px; padding: 28px 24px; }
.login-head { text-align: center; margin-bottom: 20px; }
.login-head h1 { font-size: 1.4rem; margin: 0 0 4px; }
.login-head p { margin: 0; }

/* ---------- admin shell ---------- */
.topbar { position: sticky; top: 0; z-index: 30; height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: rgba(14,15,19,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: .02em; display: flex; align-items: center; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who { color: var(--muted); font-size: .9rem; }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); padding: 6px; cursor: pointer; }
.shell { display: flex; min-height: calc(100dvh - 56px); }
.sidebar { width: 230px; flex-shrink: 0; border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column;
  position: sticky; top: 56px; height: calc(100dvh - 56px); overflow-y: auto; background: var(--bg); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 500; }
.sidebar a:hover { background: var(--surface); color: var(--text); }
.sidebar a.active { background: rgba(255,77,94,.12); color: #ff8a95; }
.nav-section { margin: 18px 12px 6px; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #5d6170; }
.soon li span { display: flex; justify-content: space-between; padding: 6px 12px; color: #5d6170; font-size: .88rem; }
.soon small { font-size: .7rem; }
.nav-logout { margin-top: auto; padding-top: 14px; }
.nav-version { text-align: center; color: #5d6170; font-size: .72rem; margin: 8px 0 0; }
.content { flex: 1; min-width: 0; padding: 22px 24px 60px; max-width: 1100px; }
.page-title { font-size: 1.35rem; margin: 0 0 18px; }
.scrim { position: fixed; inset: 56px 0 0 0; background: rgba(0,0,0,.5); z-index: 19; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .sidebar { position: fixed; left: 0; top: 56px; z-index: 20; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; }
  .content { padding: 18px 14px 60px; }
  .who { display: none; }
  .hide-sm { display: none; }
}

/* ---------- player placeholder (real player in Phase 8) ---------- */
.player-page { min-height: 100dvh; display: flex; flex-direction: column; }
.player-top { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.player-top-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.player-top-right form { margin: 0; }
.player-placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.art-placeholder { width: min(70vw, 300px); aspect-ratio: 1; border-radius: 18px; display: grid; place-items: center;
  background: linear-gradient(145deg, #1d2029, #12141a); border: 1px solid var(--line); color: #3a3f4d; margin-bottom: 24px; }
.player-placeholder h1 { margin: 0 0 8px; font-size: 1.4rem; }
.player-placeholder p { max-width: 340px; margin: 0; }
@media (max-width: 480px) {
  .table th, .table td { padding: 9px 6px; }
  .table-wrap { margin: 0 -12px; padding: 0 12px; }
  .card { padding: 16px 14px; }
}

/* ---------- Phase 2: music directories ---------- */
.lead { margin: -6px 0 18px; max-width: 760px; }
.small { font-size: .82rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.break { word-break: break-all; }
code, .code { font-family: ui-monospace, Consolas, monospace; font-size: .85em; background: #0b0c10; border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }
pre.code { display: block; padding: 10px 12px; overflow-x: auto; white-space: pre; margin: 8px 0 12px; }
.callout { border-color: rgba(245,185,66,.45); }
.callout h2 { margin-bottom: 8px; }
.statusbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 16px; font-size: .88rem; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.head-actions form { margin: 0; }
.actions form { display: inline; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; }
.mono-input { font-family: ui-monospace, Consolas, monospace !important; font-size: 14px !important; }
input[readonly] { opacity: .8; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.checks .check { margin: 4px 0 10px; }
.picker { margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; background: #0b0c10; padding: 10px; }
.picker-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; word-break: break-all; }
.picker-list { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.picker-item { text-align: left; background: none; border: 0; color: var(--text); padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; }
.picker-item:hover { background: var(--surface); }
.picker-item.up { color: var(--muted); }
.job { margin-bottom: 12px; }
.job-line { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: .9rem; }
progress { width: 100%; height: 8px; border: 0; border-radius: 999px; overflow: hidden; background: #262a33; appearance: none; }
progress::-webkit-progress-bar { background: #262a33; border-radius: 999px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; transition: width .4s; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; }
.mini-stats div { background: #0b0c10; border: 1px solid var(--line); border-radius: 10px; padding: 10px; color: var(--muted); font-size: .78rem; }
.mini-stats span { display: block; color: var(--text); font-size: 1.25rem; font-weight: 700; }
a.card.stat.link { text-decoration: none; color: var(--text); }
a.card.stat.link:hover { border-color: #3a3f4d; }
.row-link { color: var(--text); text-decoration: none; }
.row-link:hover { text-decoration: underline; }
.picker .btn { margin-top: 4px; }
