/* admin.css — the HQ portal. Desktop-first: this is a back-office screen used at
   a desk at night, not on a phone. It still reflows onto a tablet. */

body { font-size: 14px; line-height: 1.55; }

.shell { display: flex; min-height: 100vh; }

/* ----------------------------------------------------------------- sidebar */

.side {
  width: 216px; flex: 0 0 216px;
  background: var(--navy); color: #cfe0f0;
  padding: 1.1rem .75rem; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: .15rem;
}
.side-brand { display: flex; align-items: center; gap: .6rem; padding: .3rem .5rem 1.1rem; }
.side-brand img { border-radius: 7px; }
.side-brand b { color: #fff; font-size: 1.05rem; letter-spacing: -.01em; display: block; }
.side-brand span { color: #8fb0d0; font-size: .72rem; }

.side a {
  display: flex; align-items: center; gap: .55rem;
  padding: .5rem .6rem; border-radius: 8px;
  color: #cfe0f0; text-decoration: none; font-size: .875rem; font-weight: 500;
}
.side a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side a.on { background: var(--blue); color: #fff; }
.side-foot { margin-top: auto; padding: .6rem .5rem 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.side-foot button {
  width: 100%; background: none; border: 1px solid rgba(255, 255, 255, .22);
  color: #cfe0f0; padding: .45rem; border-radius: 7px; cursor: pointer; font-size: .78rem; font-family: inherit;
}
.side-foot button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side-foot p { color: #7f9bb8; font-size: .68rem; margin: .6rem 0 0; line-height: 1.45; }

/* -------------------------------------------------------------------- main */

.main { flex: 1; min-width: 0; padding: 1.5rem 1.75rem 4rem; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.4rem; letter-spacing: -.02em; }
.page-head p { margin: .25rem 0 0; color: var(--muted); font-size: .875rem; }
.page-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.card-pad { padding: 1.1rem 1.25rem; }
.card + .card { margin-top: 1rem; }
.card-head { padding: .9rem 1.25rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: .95rem; }
.card-head p { margin: .15rem 0 0; color: var(--muted); font-size: .8rem; }

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

.tbl { width: 100%; border-collapse: collapse; font-size: .875rem; }
.tbl th {
  text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  color: #dce8f4; background: var(--navy); padding: .55rem .7rem; font-weight: 600; white-space: nowrap;
}
.tbl td { padding: .5rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--blue-tint); }
.tbl .num { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .code { font-family: var(--font-num); font-size: .8rem; color: var(--navy); font-weight: 600; white-space: nowrap; }
.tbl-wrap { overflow-x: auto; }
.tbl tr.is-unpriced td { color: var(--faint); }
.tbl tr.is-new-row { background: var(--new-bg); }
.tbl tr.is-new-row:hover { background: #ffeccd; }

.cat-row td { background: #f7f9fc; font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--navy); padding: .4rem .7rem; }

/* ------------------------------------------------------- movement + badges */

.mv { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.mv.up { color: var(--up); }
.mv.down { color: var(--down); }
.mv.same { color: var(--same); }
.mv.new { color: var(--new); }
.mv.unpriced { color: var(--faint); font-weight: 500; }

/* .badge lives in styles.css — shared with ui.js. */

.pill-row { display: flex; gap: .4rem; flex-wrap: wrap; }
.pill {
  border: 1px solid var(--line-strong); background: #fff; color: var(--text);
  padding: .3rem .7rem; border-radius: 999px; font-size: .8rem; cursor: pointer; font-family: inherit;
}
.pill.on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ------------------------------------------------------------------ fields */
/* .btn and .field live in styles.css — shared with ui.js. Admin-only extras: */

.field-row { display: flex; gap: .75rem; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 140px; }
input.cell { width: 92px; padding: .25rem .4rem; text-align: right; font-family: var(--font-num); border: 1px solid var(--line-strong); border-radius: 6px; font-size: .82rem; }
input.cell:focus { outline: 2px solid var(--blue); outline-offset: -1px; }

/* The Prices-board date picker. Matches the branch <select> beside it. */
.date-field { padding: .4rem .5rem; border: 1px solid var(--line-strong); border-radius: .5rem; font: inherit; font-size: .85rem; background: #fff; color: var(--text); }
.date-field:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.date-rel { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.today-link { border: none; background: none; color: var(--blue); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; padding: .2rem .1rem; }
.today-link:hover { text-decoration: underline; }
.today-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 3px; }

/* ------------------------------------------------------------------- tabs */

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.1rem; flex-wrap: wrap; }
.tabs button {
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: .55rem .85rem; font: inherit; font-size: .875rem; font-weight: 600;
  color: var(--muted); cursor: pointer; margin-bottom: -1px;
}
.tabs button.on { color: var(--blue); border-bottom-color: var(--blue); }
.tabs button:hover:not(.on) { color: var(--text); }

/* .notice lives in styles.css — shared with ui.js. */

/* ------------------------------------------------------------------- stats */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: .7rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .85rem; }
.stat b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat.up b { color: var(--up); } .stat.down b { color: var(--down); } .stat.new b { color: var(--new); }

/* ------------------------------------------------------------------- misc */
/* .modal*, .toast, .empty, .muted, .faint live in styles.css — shared with ui.js. */

.right { text-align: right; }
.drop { border: 2px dashed var(--line-strong); border-radius: var(--radius-lg); padding: 1.75rem 1.25rem; text-align: center; background: #fbfcfe; }
.drop.over { border-color: var(--blue); background: var(--blue-tint); }
.file-chip { display: inline-flex; align-items: center; gap: .5rem; background: var(--blue-tint); border: 1px solid #c8ddf3; border-radius: 8px; padding: .4rem .7rem; font-size: .82rem; }

.chart-wrap { width: 100%; overflow-x: auto; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .78rem; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 18px; height: 0; border-top-width: 2px; border-top-style: solid; vertical-align: middle; margin-right: .3rem; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .side { width: auto; flex: none; height: auto; position: static; flex-direction: row; overflow-x: auto; align-items: center; padding: .6rem; gap: .3rem; }
  .side-brand { padding: .3rem .6rem .3rem .3rem; }
  .side-brand span { display: none; }
  .side-foot { margin-top: 0; border-top: none; border-left: 1px solid rgba(255, 255, 255, .1); padding: 0 0 0 .6rem; }
  .side-foot p { display: none; }
  .side-foot button { width: auto; white-space: nowrap; }
  .side a { white-space: nowrap; }
  .main { padding: 1rem; }
}
