/* Ezyplace prototype, round 3: back office.
   A working layout for the team: dark sidebar, light work area, dense tables.
   Same colours and type as the public site (site.css, pages.css). */

/* the public header, footer and cookie bar are not part of the back office */
body.is-admin #header, body.is-admin #footer, body.is-admin #dock { display: none; }
body.is-admin { background: var(--surface); }

/* ---------- team sign-in ---------- */
.adm-gate { display: grid; place-items: center; min-height: calc(100vh - 42px); padding: 32px 16px; background: linear-gradient(160deg, #1F2A33, #2C3A45); }
.adm-login { display: grid; gap: 10px; width: min(420px, 100%); padding: 30px 28px; text-align: center; }
.adm-login > img { margin: 0 auto; }
.adm-login h1 { font: 700 24px/1.4 var(--font-display); }
.adm-login .join-f { text-align: left; }
.adm-login .pnote { text-align: left; }
.step2 { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--green-tint); color: var(--green); font-size: 14px; }
.step2 .ic { flex: none; margin-top: 4px; }

/* ---------- shell ---------- */
.adm { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: calc(100vh - 42px); background: linear-gradient(90deg, #1F2A33 252px, transparent 252px); }
.adm-side { position: sticky; top: 0; height: calc(100vh - 42px); overflow-y: auto; padding: 10px 12px 12px; background: #1F2A33; color: #C9D3DA; scrollbar-width: thin; }
.adm-brand { display: flex; align-items: center; gap: 10px; margin: 0 4px 6px; padding: 6px 10px; border-radius: 12px; background: #fff; color: var(--ink); text-decoration: none; }
.adm-brand img { width: 112px; height: auto; }
.adm-brand span { padding-left: 10px; border-left: 1px solid var(--line); font: 700 14px/1.3 var(--font-display); color: var(--red-deep); }
.adm-nav { display: grid; gap: 1px; }
.adm-grp { margin: 8px 10px 2px; font-size: 11.5px; line-height: 1.3; font-weight: 600; letter-spacing: .04em; color: #8C9BA6; }
.adm-nav a { display: flex; align-items: center; gap: 10px; padding: 5px 10px; border-radius: 9px; color: #D8E0E6; font-size: 14px; line-height: 1.4; text-decoration: none; }
.adm-nav a .ic { font-size: 17px; color: #8FB8D3; }
.adm-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.adm-nav a[aria-current="page"] { background: var(--blue-deep); color: #fff; font-weight: 600; }
.adm-nav a[aria-current="page"] .ic { color: #fff; }
.adm-nav .nbadge { margin-left: auto; }
.adm-main { min-width: 0; }
.adm-top { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 28px; border-bottom: 1px solid var(--line); background: #fff; }
.adm-h1 { font: 700 22px/1.4 var(--font-display); color: var(--ink); }
.adm-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--blue-deep); font-weight: 600; font-size: 14px; text-decoration: none; }
.adm-link:hover { background: var(--blue-tint); }
.adm-me { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.adm-body { padding: 24px 28px 56px; }
.adm-body > .blk-first:first-child, .adm-body > section.blk:first-child { padding-top: 0; border-top: 0; }
.adm-body .blk { border-top-color: #E4EAEE; }
.adm-body .card { box-shadow: 0 1px 2px rgba(37, 49, 59, .05); }
.adm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 16px; }
.adm-bar .btn { margin-left: auto; }
.adm-q { flex: 0 1 320px; }
.adm-q input { width: 100%; height: 42px; border: 1px solid #C3CDD4; border-radius: 10px; background: #fff; }
.adm-tabs { margin-bottom: 12px; }
.adm-bar .adm-tabs { margin: 0; }
.adm-tabs small { margin-left: 4px; opacity: .8; }
.tile-hot { border-color: #F3C9C5; background: var(--red-tint); }
.tile-hot .tile-ic { background: #fff; color: var(--red-deep); }

/* ---------- queue cards ---------- */
.qlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 14px; margin-bottom: 18px; }
.qcard { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.qcard-h { display: grid; gap: 4px; }
.qcard-h .badge { justify-self: start; }
.qcard h3 { font: 700 16px/1.45 var(--font-display); color: var(--ink); }
.qcard-h small { color: var(--muted); }
.qcard blockquote { margin: 0; padding: 8px 12px; border-left: 3px solid var(--line); background: var(--surface); border-radius: 0 8px 8px 0; }
.qcard-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.qrow { display: flex; gap: 12px; }
.qrow img { width: 112px; aspect-ratio: 4 / 3; flex: none; object-fit: cover; border-radius: 8px; }
.qrow .price { font-size: 18px; }
.qmeta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; color: var(--muted); }
.qmeta span { display: inline-flex; align-items: center; gap: 5px; }
.qflag { display: flex; gap: 8px; padding: 8px 12px; border-radius: 8px; background: #FFF6DA; color: #5A4A00; font-size: 14px; }
.qflag .ic { flex: none; margin-top: 4px; }
.qflag.ok { background: var(--green-tint); color: var(--green); }
.ai { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 12px; border-radius: 8px; background: #F1EEFF; color: #3E2F8F; font-size: 14px; }
.ai > span:first-of-type { flex: 1 1 220px; }
.ai .ic { color: #6A55D8; }
.conf { display: inline-block; width: 80px; height: 8px; overflow: hidden; border-radius: 99px; background: #DCD5FA; }
.conf i { display: block; height: 100%; background: #6A55D8; }
.small { font-size: 13px; }

/* ---------- identity checks ---------- */
.kyc { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 18px; align-items: start; }
.kyc-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.kyc-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; }
.kyc-item > span:nth-child(2) { display: grid; flex: 1; min-width: 0; }
.kyc-item small { color: var(--muted); }
.kyc-item.on { border: 2px solid var(--blue-deep); padding: 9px 11px; background: var(--blue-tint); }
.kyc-detail { display: grid; gap: 12px; }
.idview { display: grid; place-items: center; width: min(100%, 420px); aspect-ratio: 16 / 10; overflow: hidden; border-radius: 12px; background: repeating-linear-gradient(135deg, #E9EEF2 0 12px, #F4F7F9 12px 24px); color: var(--muted); text-align: center; }
.idview span { display: grid; justify-items: center; gap: 8px; max-width: 280px; padding: 12px; font-size: 14px; }
.idview .ic { font-size: 28px; }
.idview.on { background: #fff; border: 1px solid var(--line); }
.idview img { width: 100%; height: 100%; object-fit: contain; }
.kyc-check { margin: 0; }

/* ---------- tables ---------- */
.tl { display: flex; align-items: center; gap: 10px; min-width: 260px; }
.tl img { width: 64px; height: 48px; flex: none; object-fit: cover; border-radius: 6px; }
.tl small { display: block; color: var(--muted); }
.cell-inp, .cell-sel { height: 38px; padding: 0 10px; border: 1px solid #C3CDD4; border-radius: 8px; background: #fff; }
.cell-inp { width: 140px; }
.cell-sel { min-width: 250px; }
.muted-row td { color: var(--muted); }
.perm { text-align: center !important; }
.perm .yes { color: var(--green); font-size: 18px; }
.perm .no { color: #B6C1C9; font-size: 16px; }
.slot { display: inline-block; padding: 2px 10px; border-radius: 6px; background: var(--green-tint); color: var(--green); font-size: 13px; font-weight: 600; }
.slot-on { background: var(--blue-tint); color: var(--blue-ink); }
.adm-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin-bottom: 6px; font-size: 14.5px; }
.adm-sum span { display: inline-flex; align-items: center; gap: 6px; }
.adm-sum .ic { color: var(--blue-deep); }
.adm-sum .more { margin-left: auto; }
.mds { display: grid; gap: 10px; }
.md summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.md summary::-webkit-details-marker { display: none; }
.md summary .ic { margin-left: auto; }
.md[open] summary .ic { transform: rotate(180deg); }
.md .chiprow { margin-top: 12px; }
.slip { max-width: 560px; }

/* ---------- smaller screens ---------- */
@media (max-width: 1120px) {
  .kyc { grid-template-columns: minmax(0, 1fr); }
  .kyc-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
  .kyc-list li { flex: none; }
  .kyc-item { width: auto; }
}
@media (max-width: 900px) {
  .adm { grid-template-columns: minmax(0, 1fr); background: none; }
  .adm-side { position: static; height: auto; padding: 10px var(--gutter) 6px; }
  .adm-brand { display: inline-flex; margin: 0 0 8px; }
  .adm-nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .adm-grp { display: none; }
  .adm-nav a { flex: none; white-space: nowrap; border: 1px solid rgba(255, 255, 255, .14); }
  .adm-top { position: static; padding: 12px var(--gutter); }
  .adm-me { display: none; }
  .adm-body { padding: 18px var(--gutter) 48px; }
  .adm-bar .btn { margin-left: 0; }
  .cell-sel { min-width: 0; width: 100%; }
}
@media (max-width: 600px) {
  .adm-top .adm-link span { display: none; }
  .adm-h1 { font-size: 19px; }
  .qrow img { width: 88px; }
  .adm-q { flex: 1 1 100%; }
  .tl { min-width: 0; }
  /* stacked tables: two labelled cells per line; the first cell and the buttons go across */
  .adm-body .tbl-stack tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 14px; }
  .adm-body .tbl-stack tr > :first-child, .adm-body .tbl-stack td:not([data-l]) { grid-column: 1 / -1; }
  .adm-body .tbl-stack td:empty { display: none; }
  .adm-body .tbl.tbl-fit { min-width: 0; }
  .tbl-fit .cell-inp { width: 100%; min-width: 80px; }
  /* bidding: the rank sits on the left of its row */
  .adm-body .tbl-rank tr { grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr); }
  .adm-body .tbl-rank tr > :first-child { grid-column: 1; grid-row: 1 / span 3; }
  .adm-body .tbl-rank tr > :nth-child(2), .adm-body .tbl-rank tr > :nth-child(n+5) { grid-column: 2 / -1; }
}

/* table cells: keep ids, dates and status labels on one line; second lines in a cell */
.adm-body .tbl .badge, .adm-body .nw { white-space: nowrap; }
.cell-sub { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.cell-sub .badge { margin-top: 2px; }
.tbl-wrap + .row-form, .tbl-wrap + .fine + .row-form { margin-top: 16px; }
.adm-login > .seg-lang { justify-self: end; margin: -14px -12px 0 0; }
.adm-top .seg-lang button { padding: 3px 9px; }
.adm-back { display: inline-flex; align-items: center; justify-self: center; gap: 4px; font-size: 14px; color: var(--muted); text-decoration: none; }
.adm-back:hover { color: var(--blue-deep); text-decoration: underline; }
