.who { color: var(--muted); font-size: 14px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; margin-top: 14px; }
.field input { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; color: var(--text); padding: 11px 13px; font-size: 15px; font-family: inherit; }

/* auth */
.auth-view { display: grid; place-items: center; padding: 60px 24px; }
.auth-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 34px; }
.auth-card h1 { font-size: 28px; margin: 6px 0 4px; }
.auth-card .row { margin-top: 22px; gap: 10px; }
.auth-error { margin-top: 14px; color: #ff6b7a; font-size: 14px; }
.row { display: flex; align-items: center; gap: 10px; }

/* login vs signup fields */
.signup-only { display: none; }
body.mode-signup .signup-only { display: flex; }
.auth-submit { width: 100%; margin-top: 24px; justify-content: center; }
.auth-switch { margin-top: 16px; text-align: center; font-size: 14px; }
.link-btn { background: none; border: none; padding: 0; margin-left: 5px; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: #fff; }

/* dashboard layout */
.dash { max-width: 1180px; margin: 0 auto; padding: 20px 24px 60px; display: grid; grid-template-columns: 280px 1fr; gap: 22px; min-height: calc(100vh - 82px); }
.sidebar { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; }
.side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.side-head h2 { font-size: 18px; }
.script-list { list-style: none; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; flex: 1; }
.script-item { padding: 11px 12px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; transition: background-color .2s, border-color .2s; }
.script-item:hover { background: var(--accent-soft); }
.script-item.active { background: var(--accent-soft); border-color: var(--accent); }
.script-item .t { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 7px; }
.script-item .m { color: var(--muted); font-size: 12px; margin-top: 3px; }
.tag { font-size: 10px; background: rgba(167,139,250,.2); color: var(--accent-2); padding: 1px 6px; border-radius: 5px; }
.side-foot { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.side-link { display: flex; align-items: center; gap: 9px; background: transparent; border: none; color: var(--muted); text-align: left; padding: 10px 11px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 500; font-family: inherit; transition: background-color .18s var(--ease), color .18s var(--ease); }
.side-link .ico { color: var(--faint); transition: color .18s var(--ease); }
.side-link:hover { color: var(--text); background: var(--surface-2); }
.side-link:hover .ico { color: var(--muted); }
.side-link.active { color: var(--accent); background: var(--accent-soft); }
.side-link.active .ico { color: var(--accent); }

.content { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 22px; min-height: 400px; }
.pane { display: flex; flex-direction: column; gap: 14px; height: 100%; }
.pane h2 { font-size: 20px; }
.editor-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ed-title { flex: 1; min-width: 180px; background: transparent; border: none; border-bottom: 1px solid var(--border); color: var(--text); font-size: 20px; font-weight: 700; padding: 6px 2px; font-family: inherit; }
.ed-title:focus { outline: none; border-color: var(--accent); }
.chk { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.save-state { color: var(--live); font-size: 13px; min-width: 60px; }
.ed-body { flex: 1; min-height: 360px; background: rgba(0,0,0,.2); border: 1px solid var(--border); border-radius: 12px; color: var(--text); padding: 16px; font-size: 15px; line-height: 1.7; resize: none; font-family: inherit; }
.ed-body.tall { min-height: 420px; }
.ed-body:focus { outline: none; border-color: var(--accent); }
.danger { color: #ff6b7a; }

.cards-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.mini-card { background: rgba(0,0,0,.2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; font-size: 13px; color: var(--muted); }

.upload-drop { border: 1.5px dashed var(--border-strong); border-radius: 14px; padding: 32px; text-align: center; color: var(--muted); transition: border-color .2s, background-color .2s; }
.upload-drop:hover { border-color: var(--accent); }
.upload-drop.drag { border-color: var(--accent); background: var(--accent-soft); }
.upload-ico { width: 30px; height: 30px; margin: 0 auto 8px; color: var(--faint); stroke-width: 1.6; }
.link { color: var(--accent); cursor: pointer; text-decoration: underline; }
.media-list { list-style: none; margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.media-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: rgba(0,0,0,.2); border: 1px solid var(--border); border-radius: 10px; }
.media-item .mi-name { font-weight: 600; font-size: 14px; }
.media-item .mi-meta { color: var(--muted); font-size: 12px; }

/* admin console */
.admin-link { color: var(--accent-2); }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.stat { background: rgba(0,0,0,.2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-align: center; }
.stat-n { font-size: 26px; font-weight: 800; color: var(--text); }
.stat-k { font-size: 12px; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; }
.admin-section-head { display: flex; align-items: center; justify-content: space-between; }
.admin-h { font-size: 16px; margin-top: 6px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.admin-table th { text-align: left; padding: 10px 12px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.role-badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--muted); }
.role-badge.admin { background: rgba(167,139,250,.2); color: var(--accent-2); font-weight: 700; }
.row-actions { display: flex; gap: 6px; white-space: nowrap; }
.contact-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.contact-item { background: rgba(0,0,0,.2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.contact-item .c-msg { margin-top: 5px; color: var(--text); font-size: 14px; line-height: 1.5; }

@media (max-width: 820px) {
  .dash { grid-template-columns: 1fr; }
}
