@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Roboto+Slab:wght@500;600;700&display=swap');
:root {
    --brand: #4f46e5;
    --brand-dark: #3730a3;
    --brand-soft: #eef2ff;
    --ink: #16192b;
    --ink-soft: #5b6478;
    --border: #e6e8f0;
    --bg: #f6f7fb;
    --surface: #ffffff;
    --good: #16a34a;
    --warn: #d97706;
    --bad: #dc2626;
    --sidebar-w: 232px;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.92rem;
}

a { color: var(--brand); text-decoration: none; }

/* ---- Shell layout ---- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: #14152b;
    color: #cbd0e6;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    padding: 6px 8px 8px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 8px;
    padding-bottom: 22px;
}
.sidebar-brand .mark {
    width: 32px; height: 32px; border-radius: 9px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.88rem; font-weight: 800; color: #fff;
}

/* Only two destinations live here now, so the nav is centered in the
   available space and each item reads as a deliberate, roomy tile rather
   than a cramped list -- that's what keeps it balanced. */
.sidebar-nav { display: flex; flex-direction: column; gap: 10px; flex: 1; justify-content: center; }

.nav-tile {
    color: #aeb4cf;
    padding: 14px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 13px;
    border: 1px solid transparent;
    transition: background .15s, border-color .15s, transform .15s;
}
.nav-tile:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-tile.active {
    background: linear-gradient(135deg, var(--brand), #7c3aed);
    color: #fff;
    border-color: rgba(255,255,255,0.12);
    box-shadow: 0 8px 20px rgba(79,70,229,0.35);
}
.nav-tile-icon {
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    background: rgba(255,255,255,0.08);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem;
}
.nav-tile.active .nav-tile-icon { background: rgba(255,255,255,0.18); }
.nav-tile-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.nav-tile-label { font-weight: 600; font-size: 0.92rem; color: inherit; }
.nav-tile-desc { font-size: 0.72rem; color: #8896b0; }
.nav-tile.active .nav-tile-desc { color: rgba(255,255,255,0.8); }

.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 26px 32px 60px;
    max-width: 1280px;
}

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 1.4rem; font-weight: 700; margin: 0; }
.page-header p.subtitle { color: var(--ink-soft); margin: 2px 0 0; font-size: 0.85rem; }

/* ---- Cards ---- */
.card-flat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(20,21,43,0.03);
}
.card-flat h2.h6 { display: flex; align-items: center; }
.card-flat h2.h6 i { color: var(--brand); }
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 1px 2px rgba(20,21,43,0.03);
    transition: box-shadow .15s, transform .15s;
}
.stat-card:hover { box-shadow: 0 6px 18px rgba(20,21,43,0.07); transform: translateY(-1px); }
.stat-card .label { color: var(--ink-soft); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-card .value { font-size: 1.6rem; font-weight: 700; margin-top: 4px; }

/* ---- Buttons ---- */
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-outline-brand { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.btn-outline-brand:hover { background: var(--brand); color: #fff; }

/* ---- Badges / pills ---- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 0.74rem; font-weight: 600; }
.pill-draft { background: #f1f2f6; color: #5b6478; }
.pill-active { background: #fef3c7; color: #92400e; }
.pill-good { background: #dcfce7; color: #166534; }
.pill-bad { background: #fee2e2; color: #991b1b; }

/* ---- Score ring ---- */
.score-ring { display: flex; align-items: center; gap: 10px; }
.score-num { font-size: 1.4rem; font-weight: 800; }
.score-good { color: var(--good); }
.score-mid { color: var(--warn); }
.score-low { color: var(--bad); }

/* ---- Concept cards ---- */
.concept-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; height: 100%; display: flex; flex-direction: column; gap: 10px; transition: box-shadow .15s, transform .15s; }
.concept-card:hover { box-shadow: 0 8px 24px rgba(20,21,43,0.08); transform: translateY(-2px); }
.concept-hook { font-size: 0.95rem; font-weight: 600; color: var(--ink); }
.concept-meta { font-size: 0.78rem; color: var(--ink-soft); }

/* ---- Wizard steps ---- */
.wizard-steps { display: flex; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.wizard-step { padding: 6px 14px; border-radius: 99px; background: #eceef5; color: var(--ink-soft); font-size: 0.78rem; font-weight: 600; }
.wizard-step.active { background: var(--brand-soft); color: var(--brand); }
.wizard-step.done { background: #dcfce7; color: #166534; }

/* ---- Scene / timeline cards ---- */
.scene-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; gap: 14px; align-items: flex-start; }
.scene-idx { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 0.78rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.scene-video { width: 96px; height: 170px; object-fit: cover; border-radius: 8px; background: #14152b; flex-shrink: 0; }
.tweak-btn { font-size: 0.72rem; padding: 3px 9px; border-radius: 99px; }

.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.status-pending { background: #cbd0e6; }
.status-processing, .status-generating, .status-queued { background: var(--warn); }
.status-completed { background: var(--good); }
.status-failed { background: var(--bad); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
.empty-state i { font-size: 2.2rem; color: #c7cbe0; margin-bottom: 10px; display: block; }

.form-label { font-weight: 600; font-size: 0.82rem; }
.form-control, .form-select { border-radius: 9px; border-color: var(--border); font-size: 0.87rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.toast-container { z-index: 2000; }

/* ---- AI UGC Video modal: keep the modal from growing past the viewport
   now that it can hold two dropzones + a generated-script textarea + result. ---- */
#ugcModal .modal-body { max-height: 85vh; overflow-y: auto; }

/* ---- AI UGC Video modal: actor/model reference -- compact attachment badge.
   Replaces the dropzone's default icon/text when a file is selected. Never
   renders the photo at native size -- everything here is hard-capped so a
   huge source image can't blow out the dropzone or the modal. ---- */
.ugc-actor-badge {
    display: flex; align-items: center; gap: 10px;
    max-height: 60px; overflow: hidden; text-align: left;
}
.ugc-actor-thumb {
    width: 48px; height: 48px; object-fit: cover; border-radius: 8px;
    flex-shrink: 0; background: var(--border);
}
.ugc-actor-badge-info {
    display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto;
}
.ugc-actor-badge-name {
    font-size: 0.85rem; font-weight: 600; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ugc-actor-badge-pill {
    display: inline-flex; align-items: center; gap: 4px; width: fit-content;
    background: #dcfce7; color: #166534; font-size: 0.7rem; font-weight: 600;
    padding: 2px 8px; border-radius: 99px;
}
.ugc-actor-remove {
    flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; border: none;
    background: #f1f2f6; color: #5b6478; font-size: 0.68rem;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
}
.ugc-actor-remove:hover { background: #fee2e2; color: #991b1b; }

/* ---- AI UGC Video modal: creative-angle toggle pills (single-select; wrap on narrow screens) ---- */
.ugc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ugc-chip {
    border: 1px solid var(--border); background: #fff; color: var(--ink);
    border-radius: 99px; padding: 6px 14px; font-size: 0.78rem; font-weight: 600; line-height: 1.3;
    cursor: pointer; transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
}
.ugc-chip:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.ugc-chip:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-soft); border-color: var(--brand); }
/* Selected: solid brand fill, highlighted border, white text -- stays fill-on-hover. */
.ugc-chip.active,
.ugc-chip.active:hover:not(:disabled) {
    border-color: var(--brand-dark); background: var(--brand); color: #fff;
    box-shadow: 0 2px 8px rgba(79,70,229,0.35);
}
.ugc-chip:disabled { opacity: .55; cursor: default; }
.ugc-chip.active:disabled { opacity: .9; }   /* a locked selection must still read as selected */
.ugc-chips.disabled { pointer-events: none; }


/* ============================================================
   Mobile / small screens
   ============================================================ */
.mobile-bar, .sidebar-backdrop { display: none; }

@media (max-width: 900px) {
    html { -webkit-text-size-adjust: 100%; }
    body { font-size: 0.95rem; overflow-x: hidden; }

    /* top bar + slide-in drawer */
    .mobile-bar {
        display: flex; align-items: center; gap: 10px;
        position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 1030;
        padding: 0 12px; padding-top: env(safe-area-inset-top);
        background: #14152b; color: #fff; box-shadow: 0 2px 10px rgba(20,21,43,0.18);
    }
    .mobile-bar .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 800; }
    .mobile-title { font-weight: 700; letter-spacing: .01em; }
    .mobile-menu-btn { width: 44px; height: 44px; border: 0; border-radius: 10px; background: rgba(255,255,255,.08); color: #fff; font-size: 1.6rem; display: flex; align-items: center; justify-content: center; }
    .mobile-menu-btn:active { background: rgba(255,255,255,.18); }

    .sidebar {
        position: fixed !important; top: 0; bottom: 0; left: 0; z-index: 1050;
        width: min(82vw, 300px); height: 100dvh; overflow-y: auto;
        transform: translateX(-102%); transition: transform .22s ease; box-shadow: none;
        padding-top: calc(18px + env(safe-area-inset-top));
    }
    .sidebar.open { transform: none; box-shadow: 8px 0 30px rgba(0,0,0,.35); }
    .sidebar-nav { justify-content: flex-start; }
    .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 1040; background: rgba(10,12,28,.5); opacity: 0; pointer-events: none; transition: opacity .2s; }
    .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
    body.menu-open { overflow: hidden; }
    .nav-tile { min-height: 52px; }

    /* content */
    .main { margin-left: 0; padding: 72px 14px calc(40px + env(safe-area-inset-bottom)); max-width: 100%; min-width: 0; }
    .page-header { margin-bottom: 14px; gap: 8px; align-items: flex-start; }
    .page-header h1 { font-size: 1.2rem; }
    .page-header p.subtitle { font-size: .8rem; }
    .card-flat, .stat-card { padding: 14px; border-radius: 12px; }
    .stat-card .value { font-size: 1.35rem; }

    /* forms: 16px stops iOS zooming into a field; comfortable touch sizes */
    input, select, textarea, .form-control, .form-select { font-size: 16px !important; }
    .form-control, .form-select { min-height: 44px; }
    textarea.form-control { min-height: 84px; }
    .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
    .btn-sm { min-height: 38px; }
    .form-check-input { width: 1.25em; height: 1.25em; }
    .form-check-label { padding-left: 4px; }

    /* wide things scroll inside themselves instead of the whole page */
    .table-responsive-auto, table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    img, video, canvas { max-width: 100%; }
    pre { white-space: pre-wrap; word-break: break-word; }
    .modal-dialog { margin: 10px; }
}

@media (max-width: 900px) {
    #statsRow { --bs-gutter-x: .6rem; --bs-gutter-y: .6rem; }
    #statsRow > [class*="col-"] { flex: 0 0 50%; max-width: 50%; }
    #statsRow .stat-card { padding: 12px; }
    #statsRow .stat-card .label { font-size: .68rem; }
}

@media (max-width: 520px) {
    .main { padding-left: 12px; padding-right: 12px; }
    .page-header .btn, .page-header .btn-brand { width: 100%; }
    .row > [class*="col-"] { min-width: 0; }
    .toast-container { left: 0; right: 0; padding: 10px !important; }
    .toast-container .toast { width: 100%; }
}

@media (max-width: 520px) {
    /* shot cards: preview on top, fields below, full width */
    .scene-card { flex-direction: column !important; align-items: stretch !important; }
    .scene-card .scene-video { width: 100% !important; max-height: 340px; aspect-ratio: 9 / 16; object-fit: contain; }
    .shot.d-flex { flex-direction: column; }
    .shot video { width: 100% !important; max-height: 320px; }
}


/* ============================================================
   Aesthetic layer (v10): softer palette, rounded cards, gradient actions
   ============================================================ */
:root {
    --brand: #6a5af9; --brand-2: #9b6bff; --brand-dark: #5546e6; --brand-soft: #f1efff;
    --ink: #14162b; --ink-soft: #667089; --border: #e8eaf4; --bg: #f5f6fc; --surface: #ffffff;
    --radius: 16px;
    --shadow-sm: 0 1px 2px rgba(20,22,43,.04), 0 6px 18px rgba(20,22,43,.05);
    --shadow-md: 0 10px 32px rgba(88,72,230,.14);
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(1100px 420px at 85% -120px, rgba(155,107,255,.10), transparent 70%), var(--bg);
    -webkit-font-smoothing: antialiased; letter-spacing: -.005em;
}
.page-header h1 { font-weight: 800; letter-spacing: -.02em; }
.card-flat, .stat-card { border-radius: var(--radius); box-shadow: var(--shadow-sm); border-color: var(--border); }
.stat-card:hover, .creation-card:hover { box-shadow: var(--shadow-md); }

.btn { border-radius: 12px; font-weight: 600; transition: transform .12s ease, box-shadow .15s ease, background .15s; }
.btn-brand { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border: 0; box-shadow: 0 6px 18px rgba(106,90,249,.30); }
.btn-brand:hover { background: linear-gradient(135deg, var(--brand-dark), var(--brand)); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(106,90,249,.36); }
.btn-brand:active { transform: translateY(0); }
.btn-brand:disabled { opacity: .55; box-shadow: none; transform: none; }
.btn-outline-brand { border: 1.5px solid var(--brand); color: var(--brand); background: #fff; }
.btn-outline-brand:hover { background: var(--brand-soft); color: var(--brand-dark); border-color: var(--brand); }
.btn-ghost { background: transparent; border: 0; color: var(--ink-soft); }
.btn-ghost:hover { background: rgba(20,22,43,.05); color: var(--ink); }

.form-control, .form-select { border-radius: 12px; border: 1.5px solid var(--border); background: #fff; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(106,90,249,.14); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-switch .form-check-input:focus { box-shadow: 0 0 0 4px rgba(106,90,249,.14); }
.badge { font-weight: 600; letter-spacing: .01em; }
a { color: var(--brand); }
::selection { background: rgba(106,90,249,.22); }

.sidebar { background: linear-gradient(180deg, #15162e 0%, #1b1a3d 100%); }
.nav-tile { transition: background .15s, transform .15s; }
.nav-tile:hover { transform: translateX(2px); }
.nav-tile.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 10px 26px rgba(106,90,249,.35); }
.mobile-bar { background: linear-gradient(180deg, #15162e, #1b1a3d); }


/* ============================================================
   MiniBay theme (v11): warm off-white canvas, white cards, MiniBay pink,
   Roboto Slab headings, pill buttons -- same tokens as minibay.in
   ============================================================ */
:root {
    --brand: #D3266F; --brand-2: #E5427F; --brand-dark: #B01F5C; --brand-soft: #FCEEF2;
    --ink: #232326; --ink-soft: #54595F; --muted: #7A7A7A;
    --border: #EDE6E3; --bg: #FBF8F6; --surface: #FFFFFF; --dark-band: #201F22;
    --good: #2E9E40; --good-soft: #E7F7E9; --warn: #C27A0A; --bad: #C8283C;
    --accent-success: #61CE70;
    --radius: 22px;
    --shadow-sm: 0 1px 2px rgba(35,35,38,.04), 0 8px 24px rgba(35,35,38,.05);
    --shadow-md: 0 14px 32px rgba(211,38,111,.13);
    --font-body: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-head: 'Roboto Slab', Georgia, serif;
}
body {
    font-family: var(--font-body); color: var(--ink-soft); letter-spacing: 0;
    background: radial-gradient(900px 380px at 88% -140px, rgba(211,38,111,.07), transparent 70%), var(--bg);
}
h1, h2, h3, h4, .h1, .h2, .h3, .h4, .h5, .h6, .modal-title { font-family: var(--font-head); color: var(--ink); }
.page-header h1 { font-weight: 700; letter-spacing: -.01em; font-size: 1.6rem; }
.page-header p.subtitle { color: var(--muted); }
.eyebrow { color: var(--brand); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
a { color: var(--brand); } a:hover { color: var(--brand-dark); }
::selection { background: rgba(211,38,111,.18); }
.text-muted { color: var(--muted) !important; }

/* ---- sidebar: light, like the MiniBay header ---- */
.sidebar { background: var(--surface); color: var(--ink-soft); border-right: 1px solid var(--border); box-shadow: 1px 0 0 rgba(255,255,255,.6); }
.sidebar-brand { color: var(--ink); border-bottom: 1px solid var(--border); padding: 4px 6px 18px; flex-direction: column; align-items: flex-start; gap: 4px; }
.sidebar-brand img { height: 46px; width: auto; display: block; }
.sidebar-brand .brand-sub { font-family: var(--font-head); font-size: .74rem; font-weight: 600; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; padding-left: 4px; }
.nav-tile { color: var(--ink-soft); border-radius: 18px; padding: 12px 14px; }
.nav-tile:hover { background: var(--brand-soft); color: var(--brand-dark); transform: none; }
.nav-tile-icon { background: var(--brand-soft); color: var(--brand); border-radius: 50%; }
.nav-tile-label { color: var(--ink); }
.nav-tile-desc { color: var(--muted); }
.nav-tile.active { background: var(--brand); border-color: transparent; color: #fff; box-shadow: 0 10px 22px rgba(211,38,111,.28); }
.nav-tile.active .nav-tile-label { color: #fff; }
.nav-tile.active .nav-tile-icon { background: rgba(255,255,255,.2); color: #fff; }
.nav-tile.active .nav-tile-desc { color: rgba(255,255,255,.85); }
.user-card { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); font-size: .8rem; }
.user-card .avatar { background: var(--brand); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: .8rem; font-weight: 700; flex: none; }
.user-card .uname { color: var(--ink); font-weight: 600; }
.user-card .umeta { font-size: .72rem; color: var(--muted); }
.user-card a.logout { color: var(--brand-dark); }
.mobile-bar { background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: var(--ink); box-shadow: 0 1px 0 var(--border); }
.mobile-bar img { height: 34px; }
.mobile-menu-btn { background: var(--brand-soft); color: var(--brand); }
.sidebar.open { box-shadow: 8px 0 30px rgba(35,35,38,.18); }

/* ---- cards ---- */
.card-flat, .stat-card, .creation-card, .concept-card { border-radius: var(--radius); border-color: var(--border); box-shadow: var(--shadow-sm); }
.stat-card:hover, .creation-card:hover, .concept-card:hover { box-shadow: var(--shadow-md); }
.card-flat h2.h6 i { color: var(--brand); }
.stat-card .label { color: var(--muted); letter-spacing: .06em; }
.stat-card .value { font-family: var(--font-head); color: var(--ink); font-weight: 700; }

/* ---- buttons: pills ---- */
.btn { border-radius: 999px; }
.btn-brand { background: var(--brand); border: 0; color: #fff; box-shadow: 0 6px 16px rgba(211,38,111,.28); }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); color: #fff; box-shadow: 0 10px 22px rgba(211,38,111,.36); transform: translateY(-2px); }
.btn-outline-brand { border: 1.5px solid var(--brand); color: var(--brand); background: transparent; }
.btn-outline-brand:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-light { background: var(--surface); border: 1px solid var(--border); color: var(--ink); }
.btn-ghost:hover { background: var(--brand-soft); color: var(--brand-dark); }
.btn-outline-secondary { border-color: var(--border); color: var(--ink-soft); }
.btn-outline-secondary:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }
.btn-primary { background: var(--brand); border-color: var(--brand); } .btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

/* ---- forms ---- */
.form-control, .form-select { border-radius: 14px; border: 1.5px solid var(--border); }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(211,38,111,.12); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-switch .form-check-input:focus, .form-check-input:focus { box-shadow: 0 0 0 4px rgba(211,38,111,.12); border-color: var(--brand); }

/* ---- pills / badges / steps ---- */
.pill-draft { background: #F3EEEB; color: var(--ink-soft); }
.pill-active { background: #FFF1D6; color: #8A5A00; }
.pill-good { background: var(--good-soft); color: #1F7A2E; }
.pill-bad { background: #FDE6E9; color: #A41E31; }
.wizard-step { background: #F3EEEB; color: var(--ink-soft); }
.wizard-step.active { background: var(--brand-soft); color: var(--brand); }
.wizard-step.done { background: var(--good-soft); color: #1F7A2E; }
.scene-idx { background: var(--brand-soft); color: var(--brand); }
.ugc-chip.active, .ugc-chip.active:hover:not(:disabled) { border-color: var(--brand-dark); background: var(--brand); box-shadow: 0 2px 8px rgba(211,38,111,.32); }
.ugc-chip:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.ugc-chip:focus-visible { box-shadow: 0 0 0 3px rgba(211,38,111,.15); border-color: var(--brand); }
.empty-state i { color: #E6C9D5; }
.table > :not(caption) > * > * { border-color: var(--border); }
.table thead th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.badge.text-bg-dark { background: var(--dark-band) !important; }
.toast.text-bg-dark { background: var(--dark-band) !important; }
.toast { border-radius: 16px; }
.modal-content { border-radius: 24px; border: 0; box-shadow: 0 30px 70px rgba(35,35,38,.25); }
.progress-bar { background: var(--brand); }

/* ---- dashboard analytics ---- */
.range-pills { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px; gap: 2px; box-shadow: var(--shadow-sm); }
.range-pills button { border: 0; background: transparent; color: var(--ink-soft); font-weight: 600; font-size: .8rem; padding: 7px 16px; border-radius: 999px; transition: background .15s, color .15s; }
.range-pills button:hover { color: var(--brand-dark); }
.range-pills button.on { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(211,38,111,.28); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); height: 100%; transition: box-shadow .15s, transform .15s; }
.kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.kpi .k-label { color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.kpi .k-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.kpi .k-value { font-family: var(--font-head); font-size: 1.9rem; font-weight: 700; color: var(--ink); line-height: 1.2; margin-top: 6px; }
.kpi .k-sub { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-left: 8px; vertical-align: middle; }
.delta.up { background: var(--good-soft); color: #1F7A2E; }
.delta.down { background: #FDE6E9; color: #A41E31; }
.delta.flat { background: #F3EEEB; color: var(--muted); }
.chart-wrap { position: relative; height: 280px; }
.chart-wrap.sm { height: 210px; }
.legend-dots { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .78rem; color: var(--ink-soft); margin-bottom: 8px; }
.legend-dots i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.bar-row { margin-bottom: 14px; } .bar-row:last-child { margin-bottom: 0; }
.bar-row .b-top { display: flex; justify-content: space-between; font-size: .82rem; color: var(--ink); margin-bottom: 5px; }
.bar-row .b-top span:last-child { color: var(--muted); }
.bar-track { height: 10px; border-radius: 999px; background: #F3EEEB; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--brand); transition: width .5s ease; }
.bar-fill.good { background: var(--accent-success); } .bar-fill.dark { background: var(--dark-band); } .bar-fill.soft { background: #F4A6C3; }
.funnel-step { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.funnel-bar { height: 38px; border-radius: 14px; background: var(--brand); color: #fff; display: flex; align-items: center; padding: 0 14px; font-weight: 700; font-size: .85rem; min-width: 64px; transition: width .5s ease; }
.funnel-meta { font-size: .76rem; color: var(--muted); white-space: nowrap; }
.fail-item { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .82rem; } .fail-item:last-child { border-bottom: 0; }
.fail-item .f-kind { font-weight: 700; color: var(--ink); } .fail-item .f-err { color: var(--ink-soft); word-break: break-word; } .fail-item .f-at { color: var(--muted); font-size: .72rem; }
.nudge { background: var(--brand-soft); border: 1px solid #F4C7D8; border-radius: 18px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--ink); font-size: .85rem; }
.nudge i { color: var(--brand); font-size: 1.2rem; }
.nudge .btn { margin-left: auto; }

/* ---- security page ---- */
.qr-box { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 14px; display: inline-block; line-height: 0; }
.secret-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; background: #F3EEEB; border-radius: 12px; padding: 8px 12px; word-break: break-all; font-size: .85rem; color: var(--ink); }
.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.5rem !important; letter-spacing: .4em; text-align: center; }
.backup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.backup-grid code { background: #F3EEEB; border-radius: 12px; padding: 9px 12px; text-align: center; color: var(--ink); font-size: .95rem; letter-spacing: .06em; }
.step-no { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: .78rem; display: inline-flex; align-items: center; justify-content: center; margin-right: 8px; }

@media (max-width: 900px) {
    .kpi { padding: 14px; } .kpi .k-value { font-size: 1.45rem; }
    .chart-wrap { height: 230px; }
    .range-pills { width: 100%; } .range-pills button { flex: 1; padding: 9px 4px; }
}
