/* Admin page: builds on style.css (colours, header, buttons, dialogs, toast) */
body.admin .container { max-width: 1200px; }
.container.narrow { max-width: 460px; }
.tag { margin-left: .4rem; padding: .1rem .5rem; border-radius: 999px; background: var(--accent); font: 600 .7rem system-ui, sans-serif; letter-spacing: .05em; text-transform: uppercase; vertical-align: middle; }
.site-header nav a[aria-current="page"] { color: #fff; border-bottom: 2px solid var(--accent); }
.tab[hidden] { display: none; }
code { background: #f3ece4; padding: .1rem .35rem; border-radius: 4px; font-size: .85em; }

select { font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--cocoa); max-width: 100%; }
input[type="checkbox"], input[type="radio"] { display: inline-block; width: auto; margin: 0 .45rem 0 0; }
label.check { display: flex; align-items: center; margin: .5rem 0; }
.btn.small { padding: .4rem .9rem; font-size: .9rem; }
.btn.secondary { background: var(--cocoa-soft); }
.btn.danger, .btn.danger:hover:not(:disabled) { background: var(--err); }

.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .7rem; margin-bottom: 1rem; }
.toolbar label { margin: 0; font-size: .8rem; color: var(--muted); }
.toolbar input, .toolbar select { width: auto; margin-top: .2rem; }
.toolbar .grow { flex: 1 1 220px; }
.toolbar .grow input { width: 100%; }
.presets { display: flex; flex-wrap: wrap; gap: .4rem; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
.panel h3 { margin: 0 0 .6rem; font-size: 1.05rem; }
.panel.scroll { overflow-x: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; } }
.two-col.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 560px) { .two-col.three { grid-template-columns: 1fr; } }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.tile { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .85rem 1rem; color: inherit; text-decoration: none; }
.tile .v { font: 700 1.5rem Georgia, serif; }
.tile .l { color: var(--muted); font-size: .8rem; }
.tile .s { color: var(--muted); font-size: .8rem; }
.tile.attn { border-color: #d9a400; background: #fff8e1; }
a.tile:hover { border-color: var(--accent); }

.chart svg { display: block; width: 100%; height: auto; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--muted); font: 11px system-ui, sans-serif; }
.chart .bar { fill: var(--accent); }
.chart .bar:hover { fill: var(--accent-dark); }

table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th { text-align: left; font-weight: 600; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
table.data th, table.data td { padding: .5rem .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th.num { text-align: right; }
table.data tr.dim td { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips .chip button { margin-left: .35rem; }

.badge-s { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: #eee; color: var(--cocoa); white-space: nowrap; }
.badge-s.src-admin { background: #e6ecf8; color: #28446b; }
.badge-s.src-website { background: #efe6dc; color: var(--cocoa-soft); }
.badge-s.st-processing { background: #ffeeba; color: #7a5b00; }
.badge-s.st-pending { background: #f8d7da; color: #8a1f2b; }
.badge-s.st-paid, .badge-s.st-shipped, .badge-s.st-delivered { background: #d8f0e0; color: #1b6b3a; }
.badge-s.st-cancelled { background: #e4e4e4; color: #555; }

.o-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: .6rem; }
.o-card.attn { border-color: #d9a400; background: #fffdf3; }
.o-head { display: grid; grid-template-columns: 4.5rem 1fr auto auto auto; gap: .7rem; align-items: center; padding: .7rem .9rem; }
.o-head .o-id { font-weight: 700; }
.o-head .o-main { min-width: 0; }
.o-head .o-main .sub { color: var(--muted); font-size: .8rem; }
.o-head .o-total { font-weight: 700; text-align: right; white-space: nowrap; }
@media (max-width: 760px) { .o-head { grid-template-columns: 1fr 1fr; } .o-head .o-total { text-align: left; } }
.o-body { border-top: 1px dashed var(--line); padding: .7rem .9rem 1rem; font-size: .9rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 760px) { .o-body { grid-template-columns: 1fr; } }
.o-body h4 { margin: 0 0 .3rem; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.o-body ul { margin: 0; padding-left: 1.1rem; }

.panel label select { display: block; width: 100%; margin-top: .25rem; }
#emailForm { margin-bottom: 1rem; }
.switch-row { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; }
label.check.big { font-size: 1.05rem; margin: 0; }
label.check.big input { width: 1.2rem; height: 1.2rem; }
details.tpl { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem; margin-bottom: .6rem; background: #fffdf9; }
details.tpl summary { cursor: pointer; }
details.tpl[open] summary { margin-bottom: .6rem; }
dialog.wide { width: min(640px, 94vw); }
dialog iframe { width: 100%; height: 480px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.ok-text { color: #1b6b3a; }

.banner { padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; }
.banner.ok { background: #d8f0e0; color: #1b6b3a; }
.banner a { color: inherit; font-weight: 600; }

.item-row { display: grid; grid-template-columns: 1fr 5.5rem 7rem 6.5rem auto; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.item-row input, .item-row select { margin: 0; width: 100%; }
.item-row .it-line { font-weight: 600; }
@media (max-width: 640px) { .item-row { grid-template-columns: 1fr 1fr; } .item-row .it-product { grid-column: 1 / -1; } }

/* Payments tab: QR check */
.qr-check { display: flex; flex-wrap: wrap; gap: 1.4rem; align-items: flex-start; margin: .6rem 0 .4rem; padding: 1rem; border: 1px dashed var(--line); border-radius: 12px; background: var(--cream); }
.qr-box { flex: none; display: grid; place-items: center; width: 210px; min-height: 210px; padding: .6rem; border-radius: 10px; background: #fff; text-align: center; }
.qr-box svg { display: block; width: 190px; max-width: 100%; height: auto; }
.qr-check > div:last-child { flex: 1 1 260px; }
.qr-check ol { margin: .4rem 0 .8rem; padding-left: 1.2rem; }

/* Gift box tables: inputs sized to their content instead of stretching the whole table */
#gbThemes input:not([type="checkbox"]), #gbItems input:not([type="checkbox"]), #gbItems select { width: auto; display: inline-block; margin: 0; }
#gbThemes [data-f="name"] { width: 14rem; } #gbThemes [data-f="note"], #gbItems [data-f="note"] { width: 15rem; }
#gbItems select { width: 17rem; max-width: 100%; } #gbThemes [data-f="price"], #gbItems [data-f="price"] { width: 6rem; }
#gbThemes td, #gbItems td { vertical-align: middle; white-space: nowrap; }

/* Coupon table: compact inputs */
#couponTable input:not([type="checkbox"]) { width: auto; display: inline-block; margin: 0; }
#couponTable [data-f="code"] { width: 13rem; text-transform: uppercase; } #couponTable [data-f="percent"] { width: 5rem; } #couponTable [data-f="minTotal"] { width: 8rem; }
#couponTable td { vertical-align: middle; white-space: nowrap; }

#gbThemes [data-f="imageUrl"] { width: 16rem; } #gbThemes .thumb { vertical-align: middle; border-radius: 4px; }
#gbFree { max-width: 16rem; }

/* Developer kit tab */
#dkTasks td, #dkAreas td { vertical-align: top; }
#dkAreas table { width: 100%; }
#dkAreas td:nth-child(2) { min-width: 18rem; } #dkAreas td:nth-child(3) { min-width: 12rem; color: var(--muted); }
#dkAreas code, #dkTasks code { font-size: .85em; word-break: break-all; }
.nowrap { white-space: nowrap; }
#dkAreas .panel { overflow-x: auto; } #dkAreas table { min-width: 46rem; } #dkTasks { min-width: 0; } #dkTasks td:first-child { width: 55%; }

/* Delete orders */
.o-head .o-id label { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
.o-head .o-id input { margin: 0; }
#deleteDialog label.check { display: block; margin: .5rem 0; }
#delList { word-break: break-word; }
