/* =========================================================
   CodeRunner — admin portal styles
   ========================================================= */
.admin-main { padding: 2.5rem 0 4rem; min-height: calc(100vh - 72px); }
.admin-tag { font-size: .7rem; padding: .1rem .45rem; border-radius: 6px; background: var(--orange-soft); color: var(--orange); vertical-align: middle; margin-left: .3rem; }
.muted { color: var(--muted); }
.btn-block { width: 100%; justify-content: center; }
.link-btn { background: none; border: 0; color: var(--muted); font-size: .88rem; margin-top: .9rem; width: 100%; }
.link-btn:hover { color: var(--accent); }

.notice { padding: 1rem 1.2rem; border-radius: 14px; border: 1px solid var(--orange); background: var(--orange-soft); margin-bottom: 1.5rem; }
.notice code { color: var(--orange); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 1.6rem; box-shadow: var(--shadow); }
.panel h2 { font-size: 1.25rem; }
.panel.narrow { max-width: 480px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.panel-head h2 { margin: 0; }

/* Login */
.login-wrap { display: grid; place-items: center; min-height: 70vh; }
.login-card { width: min(420px, 100%); }
.login-head { text-align: center; margin-bottom: 1.4rem; }
.login-head img { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 1rem; box-shadow: var(--glow); }
.login-head h1 { font-size: 1.7rem; margin-bottom: .2rem; }
.login-head p { color: var(--muted); margin: 0; }

/* Fields */
.field { display: block; margin-bottom: 1rem; }
.field > span { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .4rem; }
.field em { font-weight: 400; color: var(--muted); font-style: normal; }
.field input, .field select, .field textarea, .panel-head select {
  width: 100%; padding: .75rem .9rem; border-radius: 11px; border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text); font: inherit; transition: border-color .2s, box-shadow .2s;
}
.panel-head select { width: auto; padding: .45rem .7rem; font-size: .9rem; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field textarea { resize: vertical; }
.pw { position: relative; }
.pw input { padding-right: 4.2rem; }
.pw-toggle { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); background: var(--accent-soft); border: 0; border-radius: 7px; padding: .25rem .55rem; font-size: .75rem; font-family: "JetBrains Mono", monospace; color: var(--accent); }
.form-error { color: var(--danger); font-size: .9rem; min-height: 1.2em; margin: 0 0 .8rem; }
.hint { color: var(--muted); font-size: .85rem; margin: .5rem 0 1rem; }

/* Dashboard header */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.8rem; }
.dash-head h1 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); margin: 0; }
.dash-head p.muted { margin: .3rem 0 0; font-family: "JetBrains Mono", monospace; font-size: .85rem; }
.stat-row { display: flex; gap: .8rem; }
.stat { min-width: 96px; padding: .8rem 1rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); text-align: center; }
.stat strong { display: block; font-family: "JetBrains Mono", monospace; font-size: 1.5rem; color: var(--accent); }
.stat span { font-size: .78rem; color: var(--muted); }

.admin-tabs { display: inline-flex; gap: .4rem; padding: .35rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 1.5rem; flex-wrap: wrap; }
.admin-tab { padding: .6rem 1.1rem; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: .92rem; }
.admin-tab:hover { color: var(--text); }
.admin-tab.active { background: var(--accent); color: var(--accent-ink); }

.two-col { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 1.5rem; align-items: start; }

/* Segmented control */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; padding: .3rem; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); margin-bottom: 1rem; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: .55rem; border-radius: 9px; font-weight: 600; font-size: .9rem; color: var(--muted); cursor: pointer; transition: all .2s; }
.seg input:checked + span { background: var(--surface-2); color: var(--accent); box-shadow: inset 0 0 0 1px var(--border-strong); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }

/* Dropzone */
.dropzone { position: relative; display: block; border: 2px dashed var(--border-strong); border-radius: 16px; background: var(--bg); cursor: pointer; transition: border-color .2s, background .2s; overflow: hidden; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-inner { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 2rem 1rem; text-align: center; color: var(--muted); }
.dz-inner svg { color: var(--accent); margin-bottom: .3rem; }
.dz-inner strong { color: var(--text); }
.dz-preview img, .dz-preview video { width: 100%; max-height: 240px; object-fit: contain; background: #000; }
.dz-preview .dz-name { padding: .5rem .8rem; font-size: .82rem; font-family: "JetBrains Mono", monospace; color: var(--muted); display: flex; justify-content: space-between; gap: .5rem; }

.yt-preview { margin: -.3rem 0 1rem; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.yt-preview img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.yt-preview .bad { padding: .7rem .9rem; color: var(--danger); font-size: .88rem; }
.yt-preview .playlist-thumb { aspect-ratio: 16/9; }

.progress { height: 8px; border-radius: 99px; background: var(--bg); border: 1px solid var(--border); overflow: hidden; margin-bottom: 1rem; }
.progress .bar { height: 100%; width: 0; background: var(--accent); box-shadow: var(--glow); transition: width .2s; }

/* Media list */
.media-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.m-item { border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--bg); display: flex; flex-direction: column; }
.m-thumb { position: relative; aspect-ratio: 16/9; background: var(--surface-2); }
.m-thumb img, .m-thumb video { width: 100%; height: 100%; object-fit: cover; }
.m-info { padding: .7rem .8rem; flex: 1; }
.m-info strong { display: block; font-size: .92rem; line-height: 1.3; }
.m-info span { font-size: .76rem; color: var(--muted); font-family: "JetBrains Mono", monospace; }
.m-actions { display: flex; gap: .4rem; padding: 0 .8rem .8rem; }
.m-actions .btn { flex: 1; justify-content: center; padding: .4rem; font-size: .8rem; }
.list-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 2.5rem 1rem; border: 1px dashed var(--border-strong); border-radius: 14px; }

/* Tab list */
.tab-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.tab-list li { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); }
.tab-list .name { flex: 1; font-family: "JetBrains Mono", monospace; font-weight: 600; }
.tab-list .name input { width: 100%; padding: .35rem .5rem; border-radius: 8px; border: 1px solid var(--accent); background: var(--surface); color: var(--text); font: inherit; }
.tab-list .cnt { font-size: .78rem; color: var(--muted); }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; color: var(--muted); transition: all .2s; }
.icon-btn:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.icon-btn.del:hover:not(:disabled) { color: var(--danger); border-color: var(--danger); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }

/* Password meter */
.meter { height: 6px; border-radius: 99px; background: var(--bg); margin: -.4rem 0 1rem; overflow: hidden; }
.meter div { height: 100%; width: 0; transition: width .25s, background .25s; }

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .nav-actions .btn-ghost { display: none; }
  .stat-row { width: 100%; }
  .stat { flex: 1; min-width: 0; }
}
.m-actions select { flex: 1.4; min-width: 0; padding: .35rem .4rem; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: .8rem; }
