/* LiveActs Studio — shared brand design system (acts view, fans view, super-admin).
   Dark-first "stage" look mirroring the mobile app: stage-black, electric violet, spotlight amber. */

:root {
    --bg: #0D0A12;
    --surface: #17131F;
    --surface-2: #1F1A2B;
    --border: #2B2438;
    --text: #F4F1FA;
    --muted: #A79FBF;
    --violet: #8B6DFF;
    --violet-strong: #7C5CFF;
    --amber: #FFB020;
    --danger: #FF5C7A;
    --ok: #35D0A5;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 12px 40px rgba(0, 0, 0, .45);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color-scheme: dark;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #F5F3FA;
        --surface: #FFFFFF;
        --surface-2: #F0ECF8;
        --border: #E2DCEF;
        --text: #1A1526;
        --muted: #6A6280;
        --shadow: 0 10px 30px rgba(50, 30, 90, .10);
        color-scheme: light;
    }
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    background: radial-gradient(1200px 600px at 80% -10%, rgba(124, 92, 255, .16), transparent 60%),
                radial-gradient(900px 500px at 0% 0%, rgba(255, 176, 32, .08), transparent 55%),
                var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

a { color: var(--violet); text-decoration: none; }
a:hover { color: var(--amber); }

h1 { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 1.05rem; font-weight: 650; margin: 0; }

.muted { color: var(--muted); }

/* ---- Brand mark ---- */
.brand-mark {
    width: 16px; height: 16px;
    transform: rotate(45deg);
    border-radius: 4px;
    background: linear-gradient(135deg, var(--violet-strong), var(--amber));
    box-shadow: 0 0 14px rgba(139, 109, 255, .7);
    display: inline-block;
}
.brand-mark-lg { width: 30px; height: 30px; border-radius: 7px; }

/* ---- Shell ---- */
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: .85rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 75%, transparent);
    backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 10;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 700; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.brand-name { font-size: 1.1rem; }
.brand-tag {
    font-size: .62rem; text-transform: uppercase; letter-spacing: .18em;
    color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent);
    padding: .12rem .4rem; border-radius: 999px;
}
.topnav { display: flex; align-items: center; gap: .9rem; }
.navlink { color: var(--muted); font-weight: 600; font-size: .9rem; }
.navlink:hover { color: var(--text); }
.user { color: var(--muted); font-size: .9rem; max-width: 30ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.content { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

/* ---- Buttons ---- */
.btn {
    font: inherit; font-weight: 600; cursor: pointer;
    border-radius: var(--radius-sm); padding: .6rem 1.1rem;
    border: 1px solid transparent; transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: linear-gradient(135deg, var(--violet-strong), var(--violet)); color: #fff; box-shadow: 0 6px 20px rgba(124, 92, 255, .35); }
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, var(--violet), var(--violet-strong)); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--violet); }
.btn-block { width: 100%; }

/* ---- Page ---- */
.page { display: flex; flex-direction: column; gap: 1.6rem; }
.page-head { display: flex; flex-direction: column; gap: .3rem; }
.back-link { font-size: .85rem; color: var(--muted); }
.back-link:hover { color: var(--violet); }
.page-loading { padding: 3rem 0; text-align: center; color: var(--muted); }

/* ---- Acts grid ---- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.act-card {
    display: flex; align-items: center; gap: .9rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.1rem; color: var(--text); transition: border-color .15s ease, transform .1s ease;
}
.act-card:hover { color: var(--text); border-color: var(--violet); transform: translateY(-2px); }
.act-avatar {
    width: 46px; height: 46px; flex: none; border-radius: 12px;
    display: grid; place-items: center; font-weight: 700;
    background: linear-gradient(135deg, rgba(139, 109, 255, .35), rgba(255, 176, 32, .3)); color: var(--text);
}
.act-meta { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.act-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-role { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.role-owner { color: var(--amber); }

/* ---- Stats ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; display: flex; flex-direction: column; gap: .3rem; }
.stat-value { font-size: 2rem; font-weight: 750; letter-spacing: -.02em; }
.stat-label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }

/* ---- Panels ---- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem 1.4rem; }
.panel-alert { border-color: color-mix(in srgb, var(--amber) 45%, var(--border)); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.badge { min-width: 1.7rem; text-align: center; padding: .15rem .55rem; border-radius: 999px; font-weight: 700; font-size: .85rem; }
.badge-ok { background: color-mix(in srgb, var(--ok) 22%, transparent); color: var(--ok); }
.badge-alert { background: color-mix(in srgb, var(--amber) 22%, transparent); color: var(--amber); }
.attn-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .2rem; }
.attn-list li { display: flex; justify-content: space-between; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.attn-list li:last-child { border-bottom: none; }
.attn-list strong { font-variant-numeric: tabular-nums; }

/* ---- Growth chart ---- */
.chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: .5rem; }
.chart-col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.chart-bar { width: 100%; border-radius: 3px 3px 0 0; background: linear-gradient(to top, var(--violet-strong), var(--amber)); transition: height .3s ease; }
.chart-caption { margin-top: .8rem; font-size: .85rem; }

/* ---- Auth ---- */
.auth-screen { min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2.2rem; }
.auth-head { display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center; margin-bottom: 1.6rem; }
.auth-head h1 { font-size: 1.5rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; font-size: .85rem; color: var(--muted); }
.field input {
    font: inherit; color: var(--text); background: var(--surface-2);
    border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .7rem .85rem;
}
.field input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 25%, transparent); }
.form-error { color: var(--danger); font-size: .85rem; margin: 0; }
.form-ok { color: var(--ok); font-size: .85rem; margin: 0; }

/* ---- Section nav + tabs ---- */
.section-nav { margin-top: .4rem; display: flex; gap: 1rem; font-size: .9rem; font-weight: 600; }
.tabs { display: flex; gap: .4rem; }
.tab {
    font: inherit; font-weight: 600; cursor: pointer; color: var(--muted);
    background: transparent; border: 1px solid var(--border); border-radius: 999px; padding: .4rem .9rem;
}
.tab:hover { color: var(--text); }
.tab-active { color: var(--text); border-color: var(--violet); background: color-mix(in srgb, var(--violet) 14%, transparent); }

/* ---- Shows ---- */
.show-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.show-row {
    display: flex; align-items: center; gap: 1rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1.1rem;
}
.show-date {
    flex: none; width: 54px; text-align: center; line-height: 1.1;
    border-right: 1px solid var(--border); padding-right: 1rem;
}
.show-month { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--amber); }
.show-day { display: block; font-size: 1.5rem; font-weight: 750; }
.show-main { min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.show-title-row { display: flex; align-items: center; gap: .6rem; }
.show-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.show-meta { font-size: .85rem; }
.status-pill { font-size: .64rem; text-transform: uppercase; letter-spacing: .1em; padding: .1rem .45rem; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.status-published { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.status-draft { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.status-cancelled { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); text-decoration: line-through; }

/* ---- Media review ---- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.media-tile { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: opacity .2s ease; }
.media-tile.is-busy { opacity: .5; pointer-events: none; }
.media-frame { aspect-ratio: 1; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.media-frame img, .media-frame video { width: 100%; height: 100%; object-fit: cover; }
.media-missing { color: var(--muted); font-size: .85rem; }
.media-info { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .8rem; }
.media-tags { display: flex; gap: .35rem; }
.media-time { font-size: .75rem; }
.media-actions { display: flex; gap: .5rem; padding: 0 .8rem .8rem; }
.media-actions .btn { flex: 1; padding: .5rem; }
.chip { font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; padding: .12rem .45rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.chip-live { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, transparent); }

/* ---- Feedback ---- */
.feedback-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.feedback-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; transition: opacity .2s ease; }
.feedback-card.is-busy { opacity: .5; pointer-events: none; }
.feedback-body { margin: 0 0 .7rem; font-size: 1.02rem; line-height: 1.5; border-left: 3px solid var(--violet); padding-left: .9rem; }
.feedback-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.feedback-actions { display: flex; gap: .5rem; }
.feedback-actions .btn { padding: .45rem .9rem; }

/* ---- Forms ---- */
.page-narrow { max-width: 640px; }
.page-head-row { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; display: flex; flex-direction: column; gap: 1.1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field select, .field textarea { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .7rem .85rem; }
.field select:focus, .field textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 25%, transparent); }
.field em { font-style: normal; }
.check { display: flex; align-items: center; gap: .6rem; color: var(--text); font-size: .95rem; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--violet-strong); }
.form-actions { display: flex; gap: .8rem; align-items: center; }
.form-actions .btn-ghost { text-decoration: none; }
.btn-sm { padding: .4rem .8rem; font-size: .85rem; }
.show-actions { display: flex; gap: .5rem; align-items: center; margin-left: auto; }

@media (max-width: 560px) {
    .field-row { grid-template-columns: 1fr; }
    .show-actions { margin-left: 0; }
    .show-row { flex-wrap: wrap; }
}

/* ---- Fan: home + act ---- */
.follow-chips { display: flex; flex-wrap: wrap; gap: .6rem; }
.follow-chip { display: inline-flex; align-items: center; gap: .5rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: .35rem .8rem .35rem .35rem; color: var(--text); }
.follow-chip:hover { color: var(--text); border-color: var(--violet); }
.chip-avatar { width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; font-weight: 700; font-size: .8rem; background: linear-gradient(135deg, rgba(139,109,255,.4), rgba(255,176,32,.35)); }

.act-hero {
    display: flex; align-items: center; gap: 1.2rem;
    background: radial-gradient(600px 200px at 90% -40%, rgba(124,92,255,.25), transparent 60%), var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; margin-top: 1rem;
}
.act-hero-avatar { width: 72px; height: 72px; flex: none; border-radius: 18px; display: grid; place-items: center; font-size: 1.7rem; font-weight: 750; background: linear-gradient(135deg, var(--violet-strong), var(--amber)); color: #fff; box-shadow: 0 0 24px rgba(139,109,255,.5); }
.act-hero-main { flex: 1; min-width: 0; }
.act-hero-main h1 { font-size: 1.8rem; }
.act-hero-count { margin: .3rem 0 0; }
.act-bio { margin: 0; line-height: 1.6; color: var(--text); }

.news-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .2rem; }
.news-item { padding: .7rem 0; border-bottom: 1px solid var(--border); }
.news-item:last-child { border-bottom: none; }
.news-item p { margin: 0 0 .2rem; line-height: 1.5; }
.news-time { font-size: .78rem; }

@media (max-width: 560px) {
    .act-hero { flex-wrap: wrap; }
}

/* ---- Inbox ---- */
.inbox { display: grid; grid-template-columns: minmax(200px, 280px) 1fr; gap: 1rem; align-items: start; }
.thread-list { display: flex; flex-direction: column; gap: .4rem; }
.thread-item {
    font: inherit; text-align: left; cursor: pointer; color: var(--text);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: .7rem .85rem; display: flex; flex-direction: column; gap: .25rem;
}
.thread-item:hover { border-color: var(--violet); }
.thread-active { border-color: var(--violet); background: color-mix(in srgb, var(--violet) 12%, var(--surface)); }
.thread-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.thread-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-sub { font-size: .75rem; display: flex; align-items: center; gap: .4rem; }
.unread-dot { background: var(--amber); color: #1a1526; font-weight: 700; font-size: .7rem; min-width: 1.2rem; text-align: center; border-radius: 999px; padding: .05rem .35rem; }

.thread-view { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-height: 320px; display: flex; flex-direction: column; }
.thread-empty { padding: 2.5rem; text-align: center; }
.thread-view-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); }
.messages { flex: 1; display: flex; flex-direction: column; gap: .5rem; padding: 1.2rem; overflow-y: auto; max-height: 55vh; }
.bubble { max-width: 78%; padding: .55rem .8rem; border-radius: 12px; display: flex; flex-direction: column; gap: .2rem; }
.bubble-body { line-height: 1.4; }
.bubble-time { font-size: .68rem; opacity: .7; }
.bubble-fan { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); }
.bubble-act { align-self: flex-end; background: linear-gradient(135deg, var(--violet-strong), var(--violet)); color: #fff; }
.reply-bar { display: flex; gap: .5rem; padding: 1rem 1.2rem; border-top: 1px solid var(--border); }
.reply-bar input { flex: 1; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .6rem .85rem; }
.reply-bar input:focus { outline: none; border-color: var(--violet); }

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

/* ---- Footer / version ---- */
.app-footer {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: 1rem 1.5rem; max-width: 1100px; width: 100%; margin: 0 auto;
    border-top: 1px solid var(--border); color: var(--muted); font-size: .78rem;
}
.app-version { font-variant-numeric: tabular-nums; letter-spacing: .03em; color: var(--muted); }
.auth-version { text-align: center; margin: 1.3rem 0 0; font-size: .75rem; }

/* ---- Empty ---- */
.empty { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 2.5rem; text-align: center; }
.empty h2 { margin-bottom: .5rem; }

@media (max-width: 640px) {
    .content { padding: 1.4rem 1rem 3rem; }
    .topbar { padding: .75rem 1rem; }
    .user { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
