/* CBCC admin styling. Clean and friendly, lighter than the public crayon theme. */

:root {
    --ink: #2b2b2b;
    --paper: #fbf7ef;
    --panel: #ffffff;
    --line: #e7e0d3;
    --brand: #ff5d5d;
    --brand-2: #4cc9f0;
    --good: #57cc99;
    --danger: #e5484d;
    --font-display: 'Baloo 2', system-ui, sans-serif;
    --font-body: 'Nunito', system-ui, sans-serif;
}

* { box-sizing: border-box; }
body.cbcc-admin { margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--paper); }
h1, h2 { font-family: var(--font-display); }
.muted { color: #8a8275; font-size: 0.92rem; }

.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--ink); color: #fff; padding: 22px 16px; display: flex; flex-direction: column; gap: 6px; }
.admin-brand { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; margin-bottom: 18px; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.admin-sidebar a { color: #e8e8e8; text-decoration: none; padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.admin-sidebar a:hover { background: rgba(255, 255, 255, 0.08); }
.admin-sidebar a.is-active { background: var(--brand); color: #fff; }
.admin-logout { margin-top: auto; }
.admin-logout button { width: 100%; background: none; border: 2px solid rgba(255, 255, 255, 0.3); color: #fff; padding: 9px; border-radius: 10px; cursor: pointer; font: inherit; }
.admin-logout button:hover { background: rgba(255, 255, 255, 0.08); }

.admin-main { padding: 32px 36px; max-width: 980px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { margin: 0 0 4px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.tile__value { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; color: var(--brand); }
.tile__label { color: #8a8275; font-size: 0.9rem; }
.quick-links { display: flex; gap: 12px; flex-wrap: wrap; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin-bottom: 22px; }
.panel h2 { margin: 0 0 14px; }
.panel__actions { display: flex; gap: 10px; margin-top: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

label { display: block; font-weight: 700; margin-bottom: 12px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
    width: 100%; margin-top: 5px; padding: 10px 12px; border: 1px solid var(--line);
    border-radius: 10px; font: inherit; background: #fff; font-weight: 400;
}
textarea { resize: vertical; }

.btn { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 700;
    padding: 10px 18px; border-radius: 999px; border: 2px solid var(--ink); background: #fff; color: var(--ink);
    cursor: pointer; text-decoration: none; }
.btn:hover { background: #f3efe6; }
.btn--primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn--sm { padding: 6px 12px; font-size: 0.85rem; }
.btn--danger { color: var(--danger); border-color: var(--danger); }

.flash { background: var(--good); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 700; margin-bottom: 18px; }
.field-error { color: var(--danger); font-weight: 700; font-size: 0.85rem; display: block; margin: -6px 0 12px; }
.badge { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #eee; margin-left: 6px; }
.badge--live { background: var(--good); color: #fff; }
.badge--draft { background: #ddd; }
.badge--sold { background: var(--brand); color: #fff; }
.badge--closed { background: #c9c2b4; }

.list-heading { margin: 26px 0 10px; }
.row-list { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.row__thumb { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: #f0ece1; display: grid; place-items: center; flex: none; }
.row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.row__body { flex: 1; }
.row__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.tile-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.art-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.art-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.art-tile__bar { display: flex; gap: 6px; padding: 8px; flex-wrap: wrap; }

.img-field { border: 1px dashed var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.img-field__label { display: block; margin-bottom: 6px; }
.img-field__cropbox { max-width: 420px; margin: 10px 0; }
.img-field__cropbox img { max-width: 100%; display: block; }
.img-field__current img { max-width: 180px; border-radius: 10px; display: block; margin-top: 6px; }
.img-field__cropped { color: var(--good); font-weight: 700; margin-left: 8px; }

.bid-table { width: 100%; border-collapse: collapse; }
.bid-table th, .bid-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }

.logo-preview img { max-width: 240px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.thumb-strip { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.thumb-strip img { width: 90px; height: 90px; object-fit: cover; border-radius: 10px; }

/* Guest (login) */
.cbcc-admin--guest .guest-main { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 32px; width: min(380px, 92vw); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08); }
.login-card h1 { margin: 0 0 4px; }

@media (max-width: 760px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; }
    .admin-sidebar nav { flex-direction: row; flex-wrap: wrap; }
    .admin-logout { margin: 0 0 0 auto; width: auto; }
    .admin-logout button { width: auto; }
    .grid-2 { grid-template-columns: 1fr; }
}

.checkbox-row { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.checkbox-row input { width: auto; margin: 0; }
.badge--featured { background: #ffd93b; color: #2b2b2b; }
.submission-grid { display: flex; flex-direction: column; gap: 12px; }
.submission { display: flex; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.submission__thumb { width: 90px; height: 90px; border-radius: 10px; overflow: hidden; background: #f0ece1; flex: none; }
.submission__thumb img { width: 100%; height: 100%; object-fit: cover; }
.submission__body { flex: 1; }
.submission__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.status-pill { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.status-pill--pending { background: #ffe08a; }
.status-pill--approved { background: var(--good); color: #fff; }
.status-pill--rejected { background: var(--danger); color: #fff; }
.status-pill--info_requested { background: var(--brand-2); color: #fff; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: #fff; padding: 8px 14px; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 700; }
.tabs button.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.nav-count { display: inline-block; min-width: 20px; text-align: center; background: var(--brand); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 0.75rem; margin-left: 4px; }

/* cbcc-admin-file-inputs-v1: kill the Win95 default and match the public site's crayon/file aesthetic. */
input[type="file"] {
    display: block;
    width: 100%;
    padding: 14px;
    background: #fffbec;
    border: 2px dashed #1c1c1c;
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.95rem;
    color: #2a2a2a;
    cursor: pointer;
}
input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 8px 18px;
    background: #86c8ff;
    color: #1c1c1c;
    border: 2px solid #1c1c1c;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 2px 3px 0 #1c1c1c;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
input[type="file"]::file-selector-button:hover {
    transform: translate(-1px, -2px);
    box-shadow: 3px 5px 0 #1c1c1c;
}

/* Scrollable admin sidebar (menu grew; keep it reachable on short screens) */
.admin-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain; }
.admin-sidebar::-webkit-scrollbar { width: 9px; }
.admin-sidebar::-webkit-scrollbar-track { background: transparent; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.22); border-radius: 6px; }
.admin-sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.38); }
.admin-sidebar { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.28) transparent; }
@media (max-width: 820px) { .admin-sidebar { position: static; height: auto; overflow-y: visible; } }

/* page-images-admin-v1 */
.page-images-admin .panel { background: #fff; border: 1px solid #e3e3e3; border-radius: 12px; padding: 18px; margin: 14px 0 20px; }
.pi-select { display: block; margin-top: 6px; padding: 9px 12px; border: 2px solid var(--ink); border-radius: 8px; font-size: 1rem; min-width: 240px; }
.pi-upload { margin-top: 16px; }
.pi-uploadbtn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; background: var(--brand); color: #fff; font-weight: 700; padding: 10px 16px; border-radius: 10px; border: 2px solid var(--ink); }
.pi-uploadbtn input[type=file] { display: none; }
.pi-empty { padding: 20px 0; }
.pi-list { display: flex; flex-direction: column; gap: 12px; }
.pi-row { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid #e3e3e3; border-radius: 12px; padding: 12px; }
.pi-thumb { width: 92px; height: 92px; object-fit: cover; border-radius: 8px; border: 1px solid #ddd; flex: 0 0 auto; }
.pi-meta { flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pi-controls { display: flex; gap: 14px; flex-wrap: wrap; }
.pi-controls label { font-size: .82rem; font-weight: 700; color: #444; display: flex; flex-direction: column; gap: 3px; }
.pi-controls select, .pi-controls input, .pi-caption { padding: 7px 9px; border: 2px solid #d0d0d0; border-radius: 7px; font-size: .92rem; }
.pi-caption { width: 100%; }
.pi-actions { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.pi-actions button { padding: 6px 10px; border: 2px solid var(--ink); border-radius: 7px; background: #fff; cursor: pointer; font-weight: 700; }
.pi-actions .pi-del { border-color: #c0392b; color: #c0392b; }
.flash-ok { background: #e6f8ec; border: 1px solid #57cc99; color: #1c6b3f; padding: 10px 14px; border-radius: 8px; margin: 10px 0; }
@media (max-width: 600px) {
    .pi-row { flex-wrap: wrap; }
    .pi-thumb { width: 64px; height: 64px; }
}

/* hero-editor-v1 */
.hero-editor-panel { margin-top: 18px; }
.hero-stage { position: relative; width: 100%; max-width: 680px; aspect-ratio: 16 / 7; background: linear-gradient(135deg,#fff3c4,#ffe08a); border: 2px dashed #c9a227; border-radius: 14px; overflow: hidden; margin: 10px 0 14px; touch-action: none; }
.hero-stage__text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 12px; pointer-events: none; }
.hero-stage__eyebrow { font-size: .68rem; color: #8a6d1f; font-weight: 700; }
.hero-stage__heading { font-size: clamp(1rem, 3.4vw, 1.7rem); font-weight: 800; color: #2b2b2b; line-height: 1.15; margin: 4px 0; }
.hero-stage__sub { font-size: .72rem; color: #5a5a5a; max-width: 320px; }
.hero-drag { position: absolute; cursor: grab; touch-action: none; z-index: 3; }
.hero-drag.is-dragging { cursor: grabbing; z-index: 9; }
.hero-drag img { width: 100%; height: auto; display: block; border-radius: 10px; border: 3px solid #fff; box-shadow: 3px 4px 0 rgba(0,0,0,0.18); pointer-events: none; }
.hero-drag::after { content: ""; position: absolute; inset: -6px; border: 2px solid rgba(43,43,43,.35); border-radius: 12px; pointer-events: none; opacity: 0; transition: opacity .15s; }
.hero-drag:hover::after, .hero-drag.is-dragging::after { opacity: 1; }
.hero-editor-controls { display: flex; flex-direction: column; gap: 10px; }
.hero-ctl { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #fafafa; border: 1px solid #e3e3e3; border-radius: 8px; padding: 8px 12px; }
.hero-ctl__name { font-weight: 700; font-size: .85rem; min-width: 80px; }
.hero-ctl label { display: flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: #555; }

/* hero-editor-v4 additions */
.hero-stage-wrap { position: relative; }
.hero-saved-badge { position: absolute; top: 8px; right: 8px; z-index: 20; background: #16a34a; color: #fff; font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 20px; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.hero-saved-badge--saving { background: #f59e0b; }
.hero-stage--real .hero-stage__heading { font-size: clamp(1.1rem, 3.8vw, 2rem); font-weight: 800; line-height: 1.12; display: block; margin: 5px 0; }
.hero-stage--real .hero-stage__heading span { display: inline; }
/* paint splash in the editor + public (shared look) */
.hero-drag.has-splash, .hero-free-img.has-splash { padding: 14px; }
.hero-drag.has-splash::before, .hero-free-img.has-splash::before {
    content: ""; position: absolute; inset: -6px; z-index: -1;
    background:
        radial-gradient(circle at 22% 28%, var(--crayon-pink) 0 12%, transparent 14%),
        radial-gradient(circle at 80% 18%, var(--crayon-sun) 0 13%, transparent 15%),
        radial-gradient(circle at 84% 76%, var(--crayon-blue) 0 12%, transparent 14%),
        radial-gradient(circle at 16% 82%, var(--crayon-green) 0 13%, transparent 15%),
        radial-gradient(circle at 50% 50%, var(--crayon-purple) 0 30%, transparent 62%);
    filter: blur(2px); border-radius: 50% 42% 56% 44% / 48% 54% 46% 52%;
    transform: scale(1.18) rotate(-6deg); opacity: .9;
}
/* colourful frame (rainbow border) */

.hero-ctl__chk { flex-direction: row !important; align-items: center; gap: 5px; cursor: pointer; }

/* colourful-frame-v2: gradient ring via padding box, var-free for reliability */
.hero-drag.has-frame, .hero-free-img.has-frame {
    padding: 6px;
    background: linear-gradient(135deg, #ff85c0, #ffb703, #57cc99, #4cc9f0, #9b5de5);
    border-radius: 14px;
    box-shadow: 4px 6px 0 rgba(0,0,0,0.16);
}
.hero-drag.has-frame img, .hero-free-img.has-frame img {
    border: 3px solid #fff !important;
    border-radius: 10px;
    box-shadow: none !important;
}

/* waitlist-tile-v1: clickable dashboard tile linking to the waitlist page */
.tile--link { display: block; text-decoration: none; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
.tile--link:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); border-color: var(--brand); }
.tile--link .tile__go { display: inline-block; margin-left: 4px; font-weight: 800; color: var(--brand); transition: transform 0.15s ease; }
.tile--link:hover .tile__go { transform: translateX(3px); }

/* nav-group-v1: section headings to group the admin sidebar nav */
.admin-sidebar .nav-group {
    color: var(--crayon-sun, #ffd93b);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    padding: 16px 12px 6px;
    margin: 0;
    pointer-events: none;
    user-select: none;
}
.admin-sidebar .nav-group:first-of-type { padding-top: 8px; }
@media (max-width: 860px) {
    .admin-sidebar .nav-group { width: 100%; padding: 8px 12px 2px; }
}

/* admin-nav-logout-v1: Log out styled as a nav item directly under Dashboard */
.admin-sidebar .admin-nav-logout { margin: 0; padding: 0; }
.admin-sidebar .admin-nav-logout__btn {
    display: block;
    width: 100%;
    text-align: left;
    color: #ffffff;
    background: #1e8e3e;
    border: 0;
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 700;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    transition: background 0.15s ease;
}
.admin-sidebar .admin-nav-logout__btn:hover { background: #25a149; color: #ffffff; }
@media (max-width: 860px) { .admin-sidebar .admin-nav-logout { width: auto; } .admin-sidebar .admin-nav-logout__btn { width: auto; } }

/* login-branding-v1: brand the back-to-home + forgot-password links on the login page */
.admin-back-home {
    display: inline-block;
    color: var(--brand);
    background: #fff;
    border: 2px solid var(--brand);
    border-radius: 999px;
    padding: 9px 20px;
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.admin-back-home:hover { background: var(--brand); color: #fff; transform: translateY(-2px); }
.login-card p a {
    color: var(--brand);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 2px solid var(--crayon-sun, #ffd93b);
    padding-bottom: 1px;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.login-card p a:hover { color: var(--brand-2); border-color: var(--brand-2); }

/* login-centre-v1: centre the sign-in button and forgot-password link */
.login-card .btn--primary { display: block; margin-left: auto; margin-right: auto; }
.login-card p { text-align: center; }

/* login-heading-centre-v1: centre Welcome back heading + intro text */
.login-card h1 { text-align: center; }
.login-card .muted { text-align: center; }
