/* ==========================================================================
   Phoenix Boiler Solutions — admin panel
   ========================================================================== */

:root {
  --red:       #b5151f;
  --red-dark:  #8e0f16;
  --red-soft:  #fdecec;
  --ink:       #14161a;
  --ink-2:     #333a42;
  --soft:      #667081;
  --faint:     #96a0ad;
  --line:      #e3e7ec;
  --line-2:    #eef1f4;
  --bg:        #f6f7f9;
  --card:      #ffffff;
  --ok:        #1c7a41;
  --ok-bg:     #e8f7ee;
  --bad:       #b02020;
  --bad-bg:    #fdecec;
  --warn:      #8a5a00;
  --warn-bg:   #fff5e0;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 1px 2px rgba(16,20,26,.05), 0 4px 14px rgba(16,20,26,.06);
  --font-head: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font:      "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --bar-h:     60px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--red); }
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); line-height: 1.1; margin: 0 0 .4em; letter-spacing: .01em; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; margin-top: 1.5rem; }
p { margin: 0 0 .9em; }
p:last-child { margin-bottom: 0; }
.muted { color: var(--soft); }
.small { font-size: .85rem; }
.warn { color: var(--warn); font-weight: 500; }
.icon { width: 1.3em; height: 1.3em; flex: none; }
.icon--sm { width: 1.05em; height: 1.05em; }

:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 0; top: 0; z-index: 200; background: var(--ink); color: #fff; padding: .7rem 1rem; }

/* ---------- top bar ---------- */
.abar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1rem;
  height: var(--bar-h);
  padding: 0 clamp(.9rem, 2vw, 1.5rem);
  background: var(--ink);
  color: #fff;
}
.abar__brand { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; font-family: var(--font-head); font-size: 1.25rem; letter-spacing: .04em; text-transform: uppercase; }
.abar__brand img { height: 34px; width: auto; background: #fff; border-radius: 5px; padding: 3px 5px; }
.abar__right { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.abar__link { color: #c8cfd8; text-decoration: none; font-size: .9rem; font-weight: 500; }
.abar__link:hover { color: #fff; }
.chip { font-size: .78rem; font-weight: 700; padding: .25rem .6rem; border-radius: 100px; text-decoration: none; }
.chip--warn { background: #ffca6b; color: #4a2f00; }
.abar__burger { display: none; flex-direction: column; gap: 4px; width: 40px; height: 36px; padding: 0 8px; background: none; border: 1px solid #343a43; border-radius: 7px; cursor: pointer; }
.abar__burger span { display: block; height: 2px; background: #fff; border-radius: 2px; }

/* ---------- shell ---------- */
.ashell { display: grid; grid-template-columns: 244px minmax(0, 1fr); align-items: start; }

.asidebar {
  position: sticky; top: var(--bar-h);
  height: calc(100dvh - var(--bar-h));
  overflow-y: auto;
  background: var(--card);
  border-right: 1px solid var(--line);
  padding: 1.1rem .75rem 2rem;
}
.asidebar__group { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 1.15rem .6rem .4rem; }
.asidebar__group:first-child { margin-top: 0; }
.asidebar ul { list-style: none; margin: 0 0 .2rem; padding: 0; }
.asidebar a {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .65rem;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
  font-size: .93rem;
}
.asidebar a:hover { background: var(--line-2); }
.asidebar a[aria-current="page"] { background: var(--red-soft); color: var(--red-dark); font-weight: 600; }
.asidebar a[aria-current="page"] .icon { color: var(--red); }
.asidebar .icon { color: var(--faint); }
.badge { margin-left: auto; background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; padding: .08rem .42rem; border-radius: 100px; }
.badge--warn { background: #ffca6b; color: #4a2f00; }

.amain { padding: clamp(1.1rem, 2.5vw, 2rem); max-width: 1000px; width: 100%; }

@media (max-width: 900px) {
  .abar__burger { display: flex; }
  .ashell { grid-template-columns: 1fr; }
  .asidebar {
    position: fixed; inset: var(--bar-h) 0 auto 0;
    height: auto; max-height: calc(100dvh - var(--bar-h));
    border-right: 0; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none; z-index: 30;
  }
  .asidebar.is-open { display: block; }
}

/* ---------- page head ---------- */
.phead {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem;
}
.phead p { color: var(--soft); margin: 0; max-width: 62ch; }

/* ---------- panels ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.1rem, 2vw, 1.6rem);
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow);
}
.panel--narrow { max-width: 520px; }
.panel--warn { border-color: #f0cf8e; background: var(--warn-bg); }
.panel--live { border-color: #b7e3c6; background: var(--ok-bg); }
.panel h2 { margin-bottom: .8rem; }
.panel h2 + .muted { margin-top: -.5rem; margin-bottom: 1rem; }

.statusrow { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap; }
.statusrow__label { font-family: var(--font-head); font-size: 1.35rem; color: var(--ink); margin: 0 0 .2rem; }

/* ---------- stats ---------- */
.statgrid { list-style: none; margin: 0 0 1.2rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.statgrid li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.statgrid strong { display: block; font-family: var(--font-head); font-size: 2.4rem; line-height: 1; color: var(--ink); }
.statgrid span { display: block; color: var(--soft); font-size: .9rem; margin: .25rem 0 .5rem; }
.statgrid a { font-size: .88rem; font-weight: 600; text-decoration: none; }
.statgrid a:hover { text-decoration: underline; }

.checklist { margin: 0; padding-left: 1.2rem; display: grid; gap: .7rem; }
.checklist li { display: flex; gap: 1rem; justify-content: space-between; align-items: baseline; flex-wrap: wrap; }
.checklist li.is-done { color: var(--faint); text-decoration-color: var(--faint); }
.checklist li.is-done strong { text-decoration: line-through; }
.checklist a { white-space: nowrap; font-weight: 600; font-size: .88rem; }

.quicklinks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .8rem; }
.quicklinks a { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .8rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink-2); }
.quicklinks a:hover { border-color: var(--red); background: var(--red-soft); }
.quicklinks .icon { grid-row: 1 / 3; align-self: center; color: var(--red); width: 1.7rem; height: 1.7rem; }
.quicklinks strong { font-family: var(--font-head); font-size: 1.15rem; color: var(--ink); }
.quicklinks span { font-size: .84rem; color: var(--soft); }

/* ---------- fields ---------- */
.fld { margin-bottom: 1.1rem; }
.fld > label { display: block; font-weight: 600; color: var(--ink); font-size: .9rem; margin-bottom: .3rem; }
.fld__hint { font-size: .84rem; color: var(--soft); margin: 0 0 .45rem; }
.fld__hint--indent { margin-left: 3.4rem; }
.fld input[type="text"], .fld input[type="email"], .fld input[type="url"],
.fld input[type="password"], .fld input[type="tel"], .fld textarea, .fld select {
  width: 100%; font: inherit; color: var(--ink);
  padding: .6rem .75rem;
  border: 1px solid #ccd3db; border-radius: var(--radius-sm);
  background: #fff;
}
.fld textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
.fld input:focus, .fld textarea:focus, .fld select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(181,21,31,.12); }
.fld input[type="file"] { font-size: .88rem; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.1rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1.1rem; }
@media (max-width: 700px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* switch */
.fld--check { margin-bottom: 1rem; }
/* Specificity must beat `.fld > label { display: block }` above, or the
   track collapses to an inline span with no width. */
.fld--check > .switch { display: flex; align-items: center; gap: .75rem; cursor: pointer; font-weight: 400; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { position: relative; width: 46px; height: 26px; border-radius: 100px; background: #ccd3db; transition: background .18s ease; flex: none; }
.switch__dot { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s ease; }
.switch input:checked + .switch__track { background: var(--red); }
.switch input:checked + .switch__track .switch__dot { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--red); outline-offset: 2px; }
.switch__label { font-weight: 600; color: var(--ink); }

.tick { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--soft); cursor: pointer; }
.tick input { margin: 0; }

/* image field */
.imgfield { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 560px) { .imgfield { grid-template-columns: 1fr; } }
.imgfield__preview { aspect-ratio: 4 / 3; border: 1px dashed #ccd3db; border-radius: var(--radius-sm); background: var(--line-2); display: grid; place-items: center; overflow: hidden; }
.imgfield__preview img { width: 100%; height: 100%; object-fit: cover; }
.imgfield__empty { font-size: .82rem; color: var(--faint); }
.imgfield__controls { display: grid; gap: .55rem; }
.imgfield__path { font-size: .76rem; color: var(--faint); word-break: break-all; margin: 0; }

/* repeater */
.rep__rows { display: grid; gap: .6rem; margin-bottom: .7rem; }
.rep__row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .6rem; align-items: start; background: #fbfcfd; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .8rem; }
.rep__grip { color: var(--faint); font-size: .9rem; letter-spacing: -2px; padding-top: 1.5rem; user-select: none; }
.rep__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
.rep__field { display: block; }
.rep__field span { display: block; font-size: .78rem; font-weight: 600; color: var(--soft); margin-bottom: .2rem; }
.rep__field input, .rep__field textarea { width: 100%; font: inherit; font-size: .9rem; padding: .45rem .6rem; border: 1px solid #ccd3db; border-radius: 6px; background: #fff; }
.rep__field input:focus, .rep__field textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 2px rgba(181,21,31,.12); }
.rep__remove { align-self: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--faint); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.rep__remove:hover { border-color: var(--bad); color: var(--bad); background: var(--bad-bg); }

/* photo grid */
.photogrid { list-style: none; margin: 0 0 1.2rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.photogrid li { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.photogrid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photogrid .tick { padding: .4rem .55rem 0; }
.photogrid .tick:last-child { padding-bottom: .5rem; }

.mapprev { margin-top: 1rem; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.mapprev iframe { display: block; width: 100%; }

.vidprev { position: relative; margin-top: .2rem; aspect-ratio: 16 / 9; max-width: 560px; background: #111; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.vidprev--square { aspect-ratio: 1 / 1; max-width: 400px; }
.vidprev--portrait { aspect-ratio: 9 / 16; max-width: 300px; }
.vidprev iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- item list ---------- */
.itemlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.itemlist li { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 1rem; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .75rem; background: #fff; }
.itemlist li.is-hidden { opacity: .62; }
.itemlist__thumb { aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: var(--line-2); display: grid; place-items: center; }
.itemlist__thumb img { width: 100%; height: 100%; object-fit: cover; }
.itemlist__thumb--contain img { object-fit: contain; padding: 6px; }
.itemlist__thumb--pair { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.itemlist__thumb--pair img { width: 100%; height: 100%; object-fit: cover; }
.itemlist__icon { color: var(--faint); }
.itemlist__icon .icon { width: 1.8rem; height: 1.8rem; }
.itemlist__body strong { display: inline; font-family: var(--font-head); font-size: 1.2rem; color: var(--ink); }
.itemlist__body p { margin: .2rem 0 0; font-size: .88rem; color: var(--soft); }
.itemlist__actions { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.inline { display: inline; margin: 0; }

@media (max-width: 640px) {
  .itemlist li { grid-template-columns: 72px minmax(0, 1fr); }
  .itemlist__actions { grid-column: 1 / -1; justify-content: flex-start; }
}

.tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--line-2); color: var(--soft); padding: .1rem .45rem; border-radius: 4px; margin-left: .4rem; vertical-align: middle; }
.tag--new { background: var(--red); color: #fff; }
.tagoff { font-style: normal; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--warn); background: var(--warn-bg); padding: .1rem .4rem; border-radius: 4px; margin-left: .4rem; }

.empty { text-align: center; padding: 1.5rem 1rem; }
.empty p { max-width: 52ch; margin-inline: auto; }
.empty .btn { margin-top: .9rem; }

/* ---------- enquiries ---------- */
.enq { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.enq li { border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.15rem; background: #fff; }
.enq li.is-unread { border-left-color: var(--red); background: #fffdfd; }
.enq__head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.enq__head strong { font-family: var(--font-head); font-size: 1.25rem; color: var(--ink); }
.enq__meta { font-size: .83rem; color: var(--soft); margin: .15rem 0 0; }
.enq__actions { display: flex; gap: .4rem; align-items: center; }
.enq__subject { font-weight: 600; color: var(--ink); margin: .7rem 0 .2rem; }
.enq__msg { white-space: pre-wrap; color: var(--ink-2); background: var(--line-2); border-radius: 6px; padding: .8rem .9rem; margin: .5rem 0 .8rem; font-size: .93rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font-family: var(--font-head); font-size: 1rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  padding: .58rem 1.1rem;
  border: 2px solid transparent; border-radius: var(--radius-sm);
  background: var(--red); color: #fff; text-decoration: none;
  cursor: pointer; white-space: nowrap;
  transition: background .16s ease, transform .12s ease, box-shadow .16s ease;
}
.btn:hover { background: var(--red-dark); transform: translateY(-1px); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn--primary { box-shadow: 0 4px 12px rgba(181,21,31,.28); }
.btn--ghost { background: #fff; border-color: #ccd3db; color: var(--ink-2); }
.btn--ghost:hover { background: #fff; border-color: var(--red); color: var(--red); }
.btn--sm { font-size: .88rem; padding: .38rem .75rem; }
.btn--block { width: 100%; }

.iconbtn {
  width: 32px; height: 32px;
  display: inline-grid; place-items: center;
  border: 1px solid #ccd3db; border-radius: 6px;
  background: #fff; color: var(--soft);
  font-size: 1rem; line-height: 1; cursor: pointer;
  padding: 0;
}
.iconbtn:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.iconbtn:disabled { opacity: .35; cursor: not-allowed; }
.iconbtn--danger:hover { border-color: var(--bad); color: var(--bad); background: var(--bad-bg); }
.iconbtn--off { width: auto; padding: 0 .5rem; font-size: .78rem; font-weight: 600; color: var(--warn); border-color: #f0cf8e; background: var(--warn-bg); }

.sticky-save {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; gap: .6rem; align-items: center;
  padding: .9rem 0;
  margin-top: -.2rem;
  background: linear-gradient(180deg, rgba(246,247,249,0), var(--bg) 30%);
}

/* ---------- alerts ---------- */
.alert { display: flex; gap: .6rem; align-items: flex-start; border-radius: var(--radius-sm); padding: .8rem 1rem; margin-bottom: 1.1rem; font-weight: 500; }
.alert p { margin: 0; }
.alert--ok { background: var(--ok-bg); border: 1px solid #b7e3c6; color: var(--ok); }
.alert--bad { background: var(--bad-bg); border: 1px solid #f0c0c0; color: var(--bad); }

/* ---------- sign in ---------- */
.signin-body { background: linear-gradient(160deg, #1a1c21, #3d0609 60%, #14161a); min-height: 100dvh; }
.signin { min-height: 100dvh; display: grid; place-content: center; gap: 1rem; padding: 2rem 1.25rem; }
.signin__card { width: min(430px, 92vw); background: #fff; border-radius: 16px; padding: clamp(1.5rem, 4vw, 2.25rem); box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.signin__logo { width: 190px; margin: 0 auto 1.5rem; }
.signin__title { font-size: 1.8rem; margin-bottom: .2rem; }
.signin__lede { color: var(--soft); font-size: .92rem; margin-bottom: 1.5rem; }
.signin__foot { text-align: center; margin: 0; }
.signin__foot a { color: rgba(255,255,255,.6); text-decoration: none; font-size: .88rem; }
.signin__foot a:hover { color: #fff; }
