/*
 * The signed-in website's shell, loaded after tnvs.css and overriding it.
 *
 * Desktop: a dark maroon sidebar on the left with grouped navigation and the account at its
 * foot; pages sit on a warm light canvas beside it, with no floating sheet. Phones: a slim
 * dark top bar, the drawer, and a floating dark tab bar. Components — cards, panels,
 * buttons, pills, tabs — are restyled here so every page follows without per-page CSS.
 */
:root {
    --sh-red: #AC2019;
    --sh-red-deep: #5A110D;
    --sh-night: #1f0706;
    --sh-gold: #FFC52E;
    --sh-canvas: #f7f3f2;
    --sh-line: #eadedc;
    --sh-ink: #221a19;
    --sh-muted: #6d5f5d;
    --sh-side: 252px;
    --red-800: #9c1d16;
    --red-700: #AC2019;
    --line: var(--sh-line);
    --canvas: var(--sh-canvas);
    --muted: var(--sh-muted);
    --ink: var(--sh-ink);
}

body.app { background: var(--sh-canvas); }

/* The old red header is gone; hide it if a page still renders it. */
.tb { display: none; }

/* ── Sidebar (desktop) ───────────────────────────────────────────────────── */
.side { display: none; }

.side__brand {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--display); font-size: 1.25rem; color: #fff; text-decoration: none;
}
.side__brand img { width: 32px; height: 32px; }
.side__brand b { color: var(--sh-gold); font-weight: 600; }

@media (min-width: 992px) {
    body.app { padding-left: var(--sh-side); }
    .side {
        position: fixed; left: 0; top: 0; bottom: 0; z-index: 45;
        width: var(--sh-side);
        display: flex; flex-direction: column; gap: 18px;
        padding: 22px 16px 16px;
        color: rgba(255, 255, 255, .8);
        background:
            radial-gradient(120% 40% at 0% 0%, rgba(255, 220, 180, .12), transparent 70%),
            linear-gradient(180deg, #4a0f0b, var(--sh-night) 60%);
        overflow-y: auto;
    }
    .side__brand { padding: 0 8px; }
    .side__create {
        display: flex; align-items: center; justify-content: center; gap: 8px;
        padding: 11px 14px; border-radius: 12px;
        background: var(--sh-gold); color: #2a1a00 !important;
        font-family: var(--display); font-weight: 600;
    }
    .side__create:hover { filter: brightness(1.05); }
    .side__nav { display: grid; gap: 2px; }
    .side__group {
        margin: 14px 10px 6px; font-size: .74rem; color: rgba(255, 255, 255, .45);
        letter-spacing: .02em;
    }
    .side__group:first-child { margin-top: 0; }
    .side__nav a {
        display: flex; align-items: center; gap: 12px;
        padding: 10px 12px; border-radius: 10px;
        color: rgba(255, 255, 255, .82); font-weight: 400;
    }
    .side__nav a i { font-size: 1.1rem; width: 20px; text-align: center; }
    .side__nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
    .side__nav a.is-active {
        background: rgba(255, 197, 46, .12); color: var(--sh-gold); font-weight: 500;
        box-shadow: inset 3px 0 0 var(--sh-gold);
    }
    .side__me {
        margin-top: auto;
        display: flex; align-items: center; gap: 10px;
        padding: 12px 10px; border-radius: 12px; background: rgba(255, 255, 255, .06);
    }
    .side__avatar {
        width: 36px; height: 36px; border-radius: 50%; flex: none;
        display: grid; place-items: center;
        background: var(--sh-red); color: #fff; font-family: var(--display); font-weight: 600;
    }
    .side__who { flex: 1; min-width: 0; }
    .side__who b { display: block; color: #fff; font-weight: 500; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .side__who small { color: rgba(255, 255, 255, .55); font-size: .72rem; }
    .side__out { color: rgba(255, 255, 255, .7); font-size: 1.15rem; padding: 4px; }
    .side__out:hover { color: #fff; }
    .side__signin { margin-top: auto; color: #fff; padding: 10px 12px; }
}

/* ── Top bar (phones) ────────────────────────────────────────────────────── */
.topbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; gap: 6px;
    height: 56px; padding: 0 10px 0 16px;
    background: linear-gradient(180deg, #4a0f0b, var(--sh-night));
    color: #fff;
}
.topbar .side__brand { margin-right: auto; font-size: 1.1rem; }
.topbar .side__brand img { width: 28px; height: 28px; }
.topbar__icon {
    width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent;
    display: grid; place-items: center; color: #fff; font-size: 1.3rem; cursor: pointer;
}
.topbar__icon:hover { background: rgba(255, 255, 255, .1); }
@media (min-width: 992px) { .topbar { display: none; } }

.drawer__panel a i { color: var(--sh-red); }

/* ── Page frame: no floating sheet, just a centred column on the canvas ──── */
.sheet {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    min-height: 0;
    padding: 22px 16px calc(var(--tabs-h) + 40px);
}
@media (min-width: 992px) {
    .sheet { max-width: 1120px; margin: 0 auto; padding: 34px 36px 56px; box-shadow: none; border-radius: 0; }
}
.page-title { font-size: clamp(1.6rem, 3.2vw, 2.1rem); font-weight: 700; color: var(--sh-ink); }
.page-sub { color: var(--sh-muted); }
.sec-head h2 { font-family: var(--display); font-size: 1.25rem; font-weight: 600; }
.sec-head a { text-decoration: none; font-weight: 500; }

/* ── Bottom tabs (phones): a floating dark bar ──────────────────────────── */
.tabs {
    left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom));
    height: 62px; padding: 0;
    border-radius: 18px;
    background: var(--sh-night);
    box-shadow: 0 12px 30px rgba(31, 7, 6, .35);
}
.tabs a { color: rgba(255, 255, 255, .65); font-size: .72rem; }
.tabs a.is-active { color: var(--sh-gold); }
.tabs a.is-active i { transform: translateY(-1px); }

/* ── Panels ──────────────────────────────────────────────────────────────── */
.panel {
    background: #fff; border: 1px solid var(--sh-line); border-radius: 16px;
    box-shadow: none;
}
.stat { background: #fff; border: 1px solid var(--sh-line); border-radius: 14px; box-shadow: none; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn { border-radius: 10px; font-family: var(--display); font-weight: 600; letter-spacing: .01em; }
.btn--primary { background: var(--sh-red); }
.btn--primary:hover:not(:disabled) { background: #951a14; }
.btn--green { background: #2f8f3a; }
.btn--gold { background: var(--sh-gold); color: #2a1a00; }
.btn--ghost { background: #fff; border: 1px solid var(--sh-line); }

/* ── Pills and segmented tabs ────────────────────────────────────────────── */
.pill { border-radius: 6px; font-weight: 600; }
.pill--code { background: #fff3d6; color: #7a4d00; }
.seg { background: #efe6e4; border-radius: 12px; }
.seg .is-active { color: var(--sh-red); }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-section { color: var(--sh-red); }
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--sh-red); box-shadow: 0 0 0 3px rgba(172, 32, 25, .14);
}

/* ── Coloured heads on manage and results pages: dark, like the sidebar ─── */
.live-head {
    background: linear-gradient(120deg, #6b1712, #3a0a0c 60%, var(--sh-night)) !important;
    border-radius: 16px;
}

/* ── Auction cards ───────────────────────────────────────────────────────── */
.cards { gap: 16px; }
.xcard {
    display: flex; flex-direction: column; gap: 10px; height: 100%;
    padding: 18px 18px 16px 22px;
    background: #fff; border: 1px solid var(--sh-line); border-radius: 16px;
    position: relative; overflow: hidden; color: var(--sh-ink);
    transition: border-color .15s ease;
}
.xcard::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
    background: #d6c6c3;
}
.xcard.is-live::before { background: var(--sh-red); }
.xcard.is-paused::before { background: #e89b0c; }
.xcard.is-done { opacity: .75; }
.xcard:hover { border-color: var(--sh-red); }
.xcard__when { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-right: 34px; font-size: .86rem; color: var(--sh-muted); }
.xcard__live { display: inline-flex; align-items: center; gap: 6px; color: var(--sh-red); font-weight: 600; }
.xcard__live i { width: 9px; height: 9px; border-radius: 50%; background: #e53935; }
.xcard__code { font-family: var(--display); font-weight: 600; letter-spacing: .1em; color: var(--sh-ink); background: #fff3d6; padding: 1px 8px; border-radius: 6px; }
.xcard__name { font-family: var(--display); font-weight: 600; font-size: 1.3rem; line-height: 1.2; }
.xcard__logos { display: flex; align-items: center; }
.xcard__logos img { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; object-fit: cover; background: #f1e7e5; margin-left: -8px; }
.xcard__logos img:first-child { margin-left: 0; }
.xcard__logos em { font-style: normal; font-size: .8rem; color: var(--sh-muted); margin-left: 6px; }
.xcard__facts { margin-top: auto; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .86rem; color: var(--sh-muted); padding-top: 10px; border-top: 1px dashed var(--sh-line); }
.xcard__facts b { color: var(--sh-ink); font-weight: 500; }

/* The bookmark flag sits in the card's top-right corner, now on white. */
.acard__flag {
    top: 12px; right: 12px; width: 32px; height: 32px;
    background: #fff; border: 1px solid var(--sh-line); color: var(--sh-muted);
}
.acard__flag:hover { background: #fbf3f2; color: var(--sh-red); }
.acard__flag.is-on .on { color: var(--sh-red); }

/* The home page's greeting band spans the content column. */
.hm-band { margin: 0; }
