/* ─── 615 Interactive Studio — dark theme ─────────────────────────────── */

:root {
  --bg:          #0b0e14;
  --bg-raised:   #121722;
  --bg-hover:    #1a2130;
  --border:      #232c3d;
  --border-soft: #1c2433;
  --text:        #e6e9f0;
  --text-dim:    #8b94a7;
  --accent:      #7c5cff;
  --accent-hi:   #9d85ff;
  --accent-soft: rgba(124, 92, 255, 0.14);
  --cyan:        #37c8dc;
  --ok:          #3ecf8e;
  --warn:        #e8b84b;
  --err:         #ef5f74;
  --radius:      10px;
  --shadow:      0 8px 28px rgba(0, 0, 0, 0.45);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(124, 92, 255, 0.08), transparent 60%),
    radial-gradient(900px 420px at -10% 0%, rgba(55, 200, 220, 0.05), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent-hi); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
h2 { font-size: 1.05rem; margin: 0 0 .9rem; }
h3 { margin: 0; }

code {
  font-family: var(--mono);
  font-size: .85em;
  background: var(--bg-hover);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: .1em .4em;
  word-break: break-all;
}

.muted  { color: var(--text-dim); }
.small  { font-size: .82rem; }
.mono   { font-family: var(--mono); font-size: .85em; }
.nowrap { white-space: nowrap; }
.text-error { color: var(--err); }
.inline { display: inline; }

/* ─── Top bar ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1.4rem;
  height: 58px;
  background: rgba(13, 17, 26, 0.92);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--text);
  font-weight: 700;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  color: #0b0e14;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.brand-mark-lg { width: 52px; height: 52px; font-size: 1.15rem; border-radius: 13px; }
.brand-name { letter-spacing: .2px; }

.topnav { display: flex; gap: .25rem; flex: 1; }
.topnav a {
  color: var(--text-dim);
  padding: .42rem .85rem;
  border-radius: 8px;
  font-weight: 500;
}
.topnav a:hover { color: var(--text); background: var(--bg-hover); text-decoration: none; }
.topnav a.active { color: var(--text); background: var(--accent-soft); }

.topbar-user { display: flex; align-items: center; gap: .6rem; }
.user-chip {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: var(--text);
  padding: .3rem .7rem .3rem .3rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
}
.user-chip:hover { background: var(--bg-hover); text-decoration: none; }
.avatar {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-hi);
  font-size: .78rem;
  font-weight: 700;
}
.user-name { font-size: .88rem; }

/* ─── Admin sub-nav ── */
.subnav {
  display: flex;
  gap: .25rem;
  padding: .55rem 1.4rem;
  background: rgba(15, 20, 30, 0.85);
  border-bottom: 1px solid var(--border-soft);
}
.subnav a {
  color: var(--text-dim);
  padding: .3rem .8rem;
  border-radius: 7px;
  font-size: .88rem;
  font-weight: 500;
}
.subnav a:hover { color: var(--text); background: var(--bg-hover); text-decoration: none; }
.subnav a.active { color: var(--accent-hi); background: var(--accent-soft); }

/* ─── Page shell ── */
.page {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.6rem 1.4rem 3rem;
  flex: 1;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}
.page-head p { margin: 0; }

.footer {
  padding: 1.1rem 1.4rem;
  border-top: 1px solid var(--border-soft);
  color: var(--text-dim);
  font-size: .82rem;
  text-align: center;
}

/* ─── Cards ── */
.card {
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  margin-bottom: 1.3rem;
}
.card-highlight { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .9rem;
}
.card-head h2 { margin: 0; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.3rem;
  align-items: start;
}
.grid-2-wide { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.grid-2 .card { margin-bottom: 0; }
@media (max-width: 900px) { .grid-2, .grid-2-wide { grid-template-columns: 1fr; } }

/* ─── Flash messages ── */
.flash {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid;
  margin-bottom: 1rem;
  font-size: .92rem;
  overflow-wrap: anywhere;
}
.flash-ok    { background: rgba(62, 207, 142, .08); border-color: rgba(62, 207, 142, .35); color: #b8f0d8; }
.flash-error { background: rgba(239, 95, 116, .08); border-color: rgba(239, 95, 116, .4);  color: #ffd2d9; }
.flash-warn  { background: rgba(232, 184, 75, .08); border-color: rgba(232, 184, 75, .38); color: #f4e3b0; }
.flash code { background: rgba(0, 0, 0, .35); user-select: all; }
.flash-close {
  background: none;
  border: 0;
  color: inherit;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: .6;
  line-height: 1;
  padding: 0 .1rem;
}
.flash-close:hover { opacity: 1; }

/* ─── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .52rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  background: var(--bg-hover);
  transition: filter .12s ease, background .12s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; filter: brightness(1.15); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #5d8bf7);
  color: #fff;
  box-shadow: 0 4px 14px rgba(124, 92, 255, .28);
}
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); background: var(--bg-hover); }
.btn-danger { background: transparent; border-color: rgba(239, 95, 116, .45); color: var(--err); }
.btn-danger:hover { background: rgba(239, 95, 116, .12); }
.btn-sm { padding: .28rem .6rem; font-size: .8rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: .6rem; }

/* ─── Forms ── */
label { display: block; margin-bottom: .85rem; font-size: .88rem; font-weight: 600; }
label input, label select, label textarea { margin-top: .3rem; }

input[type="text"], input[type="password"], input[type="search"],
input[type="email"], select, textarea {
  width: 100%;
  padding: .55rem .75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: .92rem;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; }

.check {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 500;
  cursor: pointer;
}
.check input { width: auto; margin: 0; accent-color: var(--accent); }

.fieldset {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  margin: 1rem 0;
}
.fieldset legend { padding: 0 .4rem; font-size: .82rem; color: var(--text-dim); font-weight: 600; }
.fieldset .check { margin-bottom: .5rem; }
.indent { margin: 0 0 .8rem 1.7rem; width: calc(100% - 1.7rem); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 700px) { .form-row { grid-template-columns: 1fr; } }

/* ─── Tables ── */
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th {
  text-align: left;
  padding: .5rem .65rem;
  color: var(--text-dim);
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: .55rem .65rem;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(255, 255, 255, .015); }
.row-muted td { opacity: .5; }
.th-actions, .td-actions { text-align: right; }
.td-actions { white-space: nowrap; }
.td-actions .btn { margin-left: .25rem; }
.table-scroll { overflow-x: auto; }
.ua { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Badges & dots ── */
.badge {
  display: inline-block;
  padding: .12rem .5rem;
  border-radius: 5px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .05em;
}
.badge-zip          { background: rgba(55, 200, 220, .14); color: var(--cyan); }
.badge-unitypackage { background: rgba(124, 92, 255, .16); color: var(--accent-hi); }
.badge-admin        { background: rgba(232, 184, 75, .14); color: var(--warn); }
.badge-warn         { background: rgba(232, 184, 75, .14); color: var(--warn); }

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: .45rem;
  vertical-align: middle;
}
.dot-ok  { background: var(--ok); box-shadow: 0 0 6px rgba(62, 207, 142, .7); }
.dot-err { background: var(--err); box-shadow: 0 0 6px rgba(239, 95, 116, .7); }
.dot-off { background: var(--text-dim); }

/* ─── Stat cards ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .9rem;
  margin-bottom: 1.3rem;
}
.stat-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: .95rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}
.stat-num { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
.stat-label { color: var(--text-dim); font-size: .78rem; font-weight: 600; }
.stat-alert { border-color: rgba(239, 95, 116, .5); }
.stat-alert .stat-num { color: var(--err); }

/* ─── Browser layout ── */
.browser {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 860px) { .browser { grid-template-columns: 1fr; } }

.sidebar {
  position: sticky;
  top: 76px;
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1rem;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.sidebar-title {
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  margin: 0 0 .7rem .4rem;
}
.devlist { display: flex; flex-direction: column; gap: 2px; }
.devlist a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .42rem .65rem;
  border-radius: 7px;
  color: var(--text-dim);
  font-size: .9rem;
  font-weight: 500;
}
.devlist a:hover { color: var(--text); background: var(--bg-hover); text-decoration: none; }
.devlist a.active { color: var(--accent-hi); background: var(--accent-soft); }
.devlist .count {
  font-size: .72rem;
  background: var(--bg-hover);
  border-radius: 999px;
  padding: .05rem .5rem;
  color: var(--text-dim);
}
.devlist a.active .count { background: rgba(124, 92, 255, .25); color: var(--accent-hi); }
.sidebar-empty { margin: .4rem; font-size: .85rem; }

/* ─── Browser toolbar ── */
.toolbar {
  display: flex;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.searchbox {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1;
  min-width: 200px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 .7rem;
  color: var(--text-dim);
}
.searchbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.searchbox input { border: 0; background: none; padding: .55rem 0; box-shadow: none !important; }

.chipgroup { display: flex; gap: .35rem; }
.chipgroup-tabs { margin-bottom: 1.1rem; }
.chip {
  padding: .35rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: .84rem;
  font-weight: 600;
}
.chip:hover { color: var(--text); text-decoration: none; background: var(--bg-hover); }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-hi); }

.sortbox {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  font-size: .84rem;
  color: var(--text-dim);
}
.sortbox select { width: auto; margin: 0; padding: .4rem .6rem; font-size: .85rem; }

.result-meta {
  display: flex;
  align-items: baseline;
  gap: .8rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.result-title { margin: 0; }

/* ─── Asset grid ── */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 1rem;
}
.asset-card {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.asset-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.asset-card-top { display: flex; align-items: center; justify-content: space-between; }
.version { font-size: .76rem; color: var(--text-dim); font-family: var(--mono); }
.asset-title {
  font-size: 1rem;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.asset-dev { font-size: .82rem; color: var(--cyan); }
.asset-desc {
  margin: 0;
  font-size: .82rem;
  color: var(--text-dim);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.asset-meta {
  display: flex;
  gap: .9rem;
  font-size: .76rem;
  color: var(--text-dim);
  margin-top: auto;
  padding-top: .3rem;
}
.asset-card .btn { margin-top: .35rem; }

.empty-state {
  text-align: center;
  padding: 3.5rem 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
}
.empty-state .btn { margin-top: .5rem; }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* ─── Upload dropzone ── */
.dropzone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.2rem 1rem;
  text-align: center;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}
.dropzone p { margin: .3rem 0 0; }
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.filelist {
  list-style: none;
  margin: .8rem 0 0;
  padding: 0;
  font-size: .85rem;
  max-height: 220px;
  overflow-y: auto;
}
.filelist li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .35rem .6rem;
  border-radius: 6px;
}
.filelist li:nth-child(odd) { background: rgba(255, 255, 255, .02); }
.filelist .fl-parse { color: var(--text-dim); text-align: right; }
.filelist .fl-bad { color: var(--err); }

.hint-list { padding-left: 1.1rem; }
.hint-list li { margin-bottom: .7rem; }

/* ─── Auth pages ── */
.auth-body {
  justify-content: center;
  align-items: center;
  display: flex;
  padding: 1.5rem;
}
.auth-wrap { width: 100%; max-width: 400px; }
.auth-brand { text-align: center; margin-bottom: 1.4rem; }
.auth-brand h1 { margin: .8rem 0 .1rem; font-size: 1.3rem; }
.auth-brand p { margin: 0; }
.auth-card { box-shadow: var(--shadow); }
.auth-card h2 { font-size: 1.15rem; }
.auth-note { margin-bottom: 0; font-size: .82rem; text-align: center; }

.copyable { user-select: all; cursor: copy; }

.version-line {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: .2rem 0 .4rem;
}
