/* Backoffice — same dark base as the storefront, amber accent so an operator
   always knows which side of the demo they are looking at. */

.admin { --accent: #ffb020; background: #06080b; }

/* ---------------- login gate ---------------- */

.gate {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(700px 380px at 50% 0%, rgba(255, 176, 32, .1), transparent 70%),
        #06080b;
}
.gate-card {
    width: min(380px, 100%);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 32px 28px;
    background: linear-gradient(170deg, #121820, #0a0e13);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 40px 90px -40px #000;
}
.gate-mark { width: 46px; height: 46px; }
.gate-card h1 { font-size: 26px; }
.gate-card > p { margin-top: -10px; font-size: 13.5px; }
.gate-card .btn { background: var(--accent); color: #1a1204; }
.gate-card .btn:hover { background: #ffc04d; box-shadow: 0 8px 26px -8px rgba(255, 176, 32, .4); }
.gate-card .field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 176, 32, .14); }

/* ---------------- shell ---------------- */

.admin-head {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 22px;
    background: rgba(6, 8, 11, .94);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line-soft);
}
.admin-head .brand { display: flex; align-items: center; gap: 10px; }
.admin-head .brand svg { width: 30px; height: 30px; }
.admin-head .brand b { font-family: 'Oswald', sans-serif; font-size: 18px; letter-spacing: .02em; display: block; }
.admin-head .brand span { font-size: 10px; letter-spacing: .28em; text-transform: uppercase; color: var(--accent); }

.tabs { display: flex; gap: 3px; margin-left: 20px; }
.tab {
    padding: 9px 16px;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--muted);
    cursor: pointer;
    transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--txt); }
.tab.active { color: var(--txt); border-bottom-color: var(--accent); }

.admin-main { padding: 26px 22px 60px; }
.pane-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.pane-head h2 { font-size: 24px; }
.pane-head p { font-size: 13px; max-width: 60ch; }

.filter {
    padding: 9px 12px;
    background: #0a1015;
    border: 1px solid var(--line);
    border-radius: 3px;
    outline: none;
    font-size: 13.5px;
    min-width: 210px;
}
.filter:focus { border-color: var(--accent); }

/* ---------------- order cards ---------------- */

.o-card {
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--panel);
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color .18s;
}
.o-card:hover { border-color: #2f3d4c; }
.o-card.just-changed { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.o-top { display: flex; align-items: center; gap: 16px; padding: 14px 16px; flex-wrap: wrap; }
.o-num { font-family: 'Oswald', sans-serif; font-size: 19px; letter-spacing: .04em; }
.o-meta { font-size: 12px; color: var(--muted); }
.o-cust { min-width: 190px; }
.o-cust b { font-size: 14px; font-weight: 700; display: block; }
.o-total { font-family: 'Oswald', sans-serif; font-size: 22px; }

.via {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 20px;
    font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700;
    border: 1px solid rgba(30, 155, 240, .35);
    background: rgba(30, 155, 240, .1);
    color: var(--blue);
}
.via.web { border-color: var(--line); background: rgba(255, 255, 255, .05); color: var(--muted); }

.o-body { padding: 0 16px 14px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.o-items { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.o-items .it { display: flex; gap: 10px; }
.o-items .it span { color: var(--muted); }
.o-addr { font-size: 13px; color: var(--muted); margin-top: 8px; }

.status-picker { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.status-picker label { width: 100%; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.sbtn {
    padding: 7px 13px;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: #0b1116;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--muted);
    cursor: pointer;
    transition: all .15s;
}
.sbtn:hover { color: var(--txt); border-color: #3b4b5c; }
.sbtn.on { color: #1a1204; background: var(--accent); border-color: var(--accent); }
.sbtn.on[data-status="delivered"] { background: var(--green); border-color: var(--green); color: #04180e; }
.sbtn.on[data-status="cancelled"] { background: var(--red); border-color: var(--red); color: #1a0404; }
.sbtn:disabled { opacity: .5; cursor: wait; }

.hist { margin-top: 12px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.hist b { color: #b6c3d2; font-weight: 600; }

/* ---------------- tables ---------------- */

.table-wrap { border: 1px solid var(--line); border-radius: 4px; overflow-x: auto; background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
    text-align: left;
    padding: 11px 14px;
    background: #0b1116;
    border-bottom: 1px solid var(--line);
    font-family: 'Oswald', sans-serif;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}
td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .022); }
td.num { font-family: 'Oswald', sans-serif; font-size: 15px; }
td .thumb { width: 40px; height: 40px; border-radius: 3px; object-fit: cover; background: #0d141b; }
td .sku { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.chip-off { opacity: .45; }

.stock { font-weight: 700; }
.stock.low { color: var(--amber); }
.stock.none { color: var(--red); }

@media (max-width: 900px) {
    .admin-head { flex-wrap: wrap; }
    .tabs { margin-left: 0; order: 3; width: 100%; overflow-x: auto; }
    .o-body { grid-template-columns: 1fr; }
}

/* ---------------- media library ---------------- */

.dropzone {
    display: grid;
    place-items: center;
    padding: 26px;
    margin-bottom: 18px;
    border: 1px dashed #2b3a49;
    border-radius: 5px;
    background: rgba(255, 255, 255, .015);
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    transition: border-color .15s, background .15s, color .15s;
}
.dropzone.over { border-color: var(--accent); color: var(--txt); background: rgba(255, 176, 32, .07); }

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.media-tile {
    position: relative;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--panel);
    overflow: hidden;
    cursor: pointer;
    transition: border-color .15s, transform .15s;
}
.media-tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.media-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #0d141b; }
.media-tile figcaption { padding: 8px 10px; border-top: 1px solid var(--line-soft); }
.media-tile figcaption b {
    display: block;
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.media-tile figcaption span { font-size: 11px; color: var(--muted); }

.tile-flash {
    position: absolute;
    inset: auto 8px 8px;
    padding: 5px 8px;
    border-radius: 3px;
    background: rgba(255, 176, 32, .92);
    color: #1a1204;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    animation: fade .18s;
}

.modal.wide { width: min(760px, 100%); }
.media-grid.pick { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }

/* ---------------- image field in the edit sheet ---------------- */

.img-field { display: grid; grid-template-columns: 108px 1fr; gap: 14px; align-items: start; }
.img-field.busy { opacity: .55; pointer-events: none; }

.img-prev {
    display: grid;
    place-items: center;
    width: 108px;
    height: 108px;
    border: 1px dashed #2b3a49;
    border-radius: 4px;
    background: #0d141b;
    overflow: hidden;
    cursor: pointer;
    font-size: 11px;
    color: var(--muted);
    transition: border-color .15s;
}
.img-prev:hover, .img-prev.over { border-color: var(--accent); }
.img-prev img { width: 100%; height: 100%; object-fit: cover; }

.img-side { display: flex; flex-direction: column; gap: 9px; }
.img-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.img-note { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
