/* BV VENTURES admin — implemented from "BV Phones Admin.dc.html" */

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

body {
  margin: 0;
  background: #f4f2ee;
  font-family: "Archivo", system-ui, sans-serif;
  color: #16140f;
}
a { color: #157a42; text-decoration: none; }
a:hover { color: #1fa855; }
::placeholder { color: #a49d8f; }
button { font-family: inherit; }

:focus-visible { outline: 2px solid #16140f; outline-offset: 2px; }

.page { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- Header ---------- */

.admin-header { background: #fff; border-bottom: 1px solid #e7e4de; }
.admin-header__inner {
  max-width: 900px; margin: 0 auto; padding: 13px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.admin-brand { display: flex; align-items: center; gap: 9px; }
.admin-brand__name { font-weight: 800; font-size: 17px; letter-spacing: -.01em; color: #16140f; }
.admin-brand__mark { height: 26px; width: auto; display: block; flex: none; }
.admin-brand__pill {
  background: #16140f; color: #fff;
  font-weight: 600; font-size: 9.5px; letter-spacing: .1em;
  padding: 3px 8px; border-radius: 99px;
}
.admin-header__right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.admin-header__who { font-weight: 500; font-size: 11.5px; color: #8a857b; }
.admin-header__store { font-weight: 500; font-size: 12.5px; }
.admin-header__logout {
  background: none; border: none; padding: 0; cursor: pointer;
  font-weight: 600; font-size: 12.5px; color: #a1402c;
}

/* ---------- Tabs ---------- */

.tabs {
  max-width: 900px; width: 100%; margin: 0 auto; padding: 16px 20px 0;
  display: flex; gap: 7px; flex-wrap: wrap;
}
.tab {
  background: #fff; border: 1px solid #e2ddd4; color: #4d483f;
  font-weight: 500; font-size: 12px; padding: 7px 14px;
  border-radius: 99px; cursor: pointer; transition: border-color .15s;
}
.tab:hover { border-color: #16140f; }
.tab--active { background: #16140f; border-color: #16140f; color: #fff; font-weight: 600; }

.admin-main { flex: 1; width: 100%; max-width: 900px; margin: 0 auto; padding: 18px 20px 60px; }

/* ---------- Listings ---------- */

.listings-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 13px;
}
.listings-title { font-weight: 700; font-size: 17px; color: #16140f; }
.listings-sub { font-size: 12px; color: #8a857b; }
.btn-add {
  background: #1fa855; color: #fff; border: none; border-radius: 10px;
  padding: 10px 15px; font-weight: 600; font-size: 13px; cursor: pointer;
  transition: background .15s;
}
.btn-add:hover { background: #178f47; }

/* ---------- Bulk selection ---------- */

.bulk-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 9px;
  background: #fff; border: 1px solid #e7e4de; border-radius: 11px;
  padding: 9px 14px; transition: border-color .15s, background .15s;
}
.bulk-bar--active { border-color: #16140f; background: #fbfaf8; }
.bulk-bar__all {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  font-weight: 600; font-size: 12.5px; color: #4d483f;
}
.bulk-bar__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-tick, .bulk-bar__all input {
  width: 16px; height: 16px; flex: none; cursor: pointer;
  accent-color: #16140f; margin: 0;
}
.listing-row--ticked { background: #f6f4f0; }

.listing-list { background: #fff; border: 1px solid #e7e4de; border-radius: 14px; overflow: hidden; }
.listing-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; flex-wrap: wrap; background: #fff;
}
.listing-row + .listing-row { border-top: 1px solid #edeae4; }
.listing-row--sold { background: #fbfaf8; opacity: .8; }
.listing-row__thumb {
  width: 46px; height: 46px; flex: none; border-radius: 9px;
  background: repeating-linear-gradient(45deg, #f0ede7 0 8px, #e5e1d8 8px 16px);
  background-size: cover; background-position: center;
  overflow: hidden;
}
.listing-row__main { flex: 1; min-width: 140px; }
.listing-row__name { font-weight: 600; font-size: 13px; color: #16140f; }
.listing-row--sold .listing-row__name { color: #6f6a60; text-decoration: line-through; }
.listing-row__meta { font-size: 11.5px; color: #8a857b; }
.pill { font-weight: 600; font-size: 10.5px; padding: 4px 10px; border-radius: 99px; }
.pill--live { background: #e8f6ee; color: #157a42; }
.pill--sold { background: #f2e5e2; color: #a1402c; }
.listing-row__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-row {
  background: #fff; border: 1px solid #dcd8d0; border-radius: 8px;
  padding: 6px 11px; font-weight: 600; font-size: 11px; color: #4d483f;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.btn-row:hover { border-color: #16140f; }
.btn-row--danger { border-color: #e5c7c0; color: #a1402c; }
.btn-row--danger:hover { border-color: #e5c7c0; background: #fbf1ef; }
.listings-note { margin-top: 10px; font-size: 11.5px; color: #a49d8f; }

/* ---------- Pagination ---------- */

.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-top: 14px;
}
.pager__range { font-weight: 500; font-size: 12px; color: #8a857b; }
.pager__nav { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.pager__btn {
  display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px;
  background: #fff; border: 1px solid #dcd8d0; color: #16140f;
  font-weight: 600; font-size: 12.5px; border-radius: 9px; cursor: pointer;
}
.pager__btn:hover:not(:disabled) { border-color: #16140f; }
.pager__btn:disabled {
  background: #f4f2ee; border-color: #ece8e1; color: #c2bcb1; cursor: default;
}
.pager__num {
  min-width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid #dcd8d0; color: #4d483f;
  font-weight: 500; font-size: 12.5px; border-radius: 9px; cursor: pointer;
}
.pager__num:hover { border-color: #16140f; }
.pager__num--active {
  background: #16140f; border-color: #16140f; color: #fff; font-weight: 600;
}

/* ---------- Forms (add phone / settings) ---------- */

.panel-title { font-weight: 700; font-size: 17px; color: #16140f; margin-bottom: 13px; }
.panel { max-width: 560px; }
.form-card {
  background: #fff; border: 1px solid #e7e4de; border-radius: 14px;
  padding: 18px; display: flex; flex-direction: column; gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field__label { font-weight: 600; font-size: 12px; color: #4d483f; }
.field__label .req { color: #c4442d; }
.field__label .opt { font-weight: 400; color: #8a857b; }
.field__row { display: flex; gap: 12px; flex-wrap: wrap; }
.field__row .field { flex: 1; min-width: 150px; }
.input, .select, .textarea {
  background: #fff; border: 1px solid #d9d5cd; border-radius: 10px;
  padding: 11px 13px; font-family: inherit; font-size: 13px; color: #16140f;
  outline: none; width: 100%;
}
.input:focus, .select:focus, .textarea:focus { border-color: #16140f; }
.input--mono { font-family: ui-monospace, Menlo, monospace; font-weight: 500; font-size: 13.5px; }
.select-wrap { position: relative; }
.select { appearance: none; -webkit-appearance: none; cursor: pointer; }
.select-wrap::after {
  content: "▾"; position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  font-size: 10px; color: #8a857b; pointer-events: none;
}
.textarea { min-height: 64px; line-height: 1.55; resize: vertical; }

/* ---------- Rich text editor ---------- */

.editor { background: #fff; border: 1px solid #d9d5cd; border-radius: 10px; overflow: hidden; }
.editor:focus-within { border-color: #16140f; }

/* Quill's snow theme, brought in line with the rest of the admin. It draws its
   own borders and radii, which would otherwise sit inside ours as a second box. */
.editor .ql-toolbar.ql-snow {
  border: 0; border-bottom: 1px solid #e2ddd4; background: #faf9f7;
  padding: 6px 8px; font-family: inherit;
}
.editor .ql-container.ql-snow { border: 0; font-family: inherit; font-size: 14px; }
.editor .ql-editor {
  min-height: 132px; padding: 11px 12px; line-height: 1.55; color: #16140f;
}
.editor .ql-editor.ql-blank::before {
  color: #9a948a; font-style: normal; left: 12px; right: 12px;
}
.editor .ql-editor p { margin: 0 0 .55em; }
.editor .ql-editor p:last-child { margin-bottom: 0; }
.editor .ql-editor ul, .editor .ql-editor ol { padding-left: 1.35em; }
.editor .ql-editor a { color: #157a42; text-decoration: underline; }
.editor .ql-snow .ql-stroke { stroke: #56504a; }
.editor .ql-snow .ql-fill { fill: #56504a; }
.editor .ql-snow .ql-picker { color: #56504a; }
.editor .ql-snow button:hover { background: #f0ede7; border-radius: 5px; }
.editor .ql-snow button:hover .ql-stroke { stroke: #16140f; }
.editor .ql-snow button.ql-active { background: #16140f; border-radius: 5px; }
.editor .ql-snow button.ql-active .ql-stroke { stroke: #fff; }
.editor .ql-snow button.ql-active .ql-fill { fill: #fff; }
/* the link tooltip escapes the rounded box without this */
.editor .ql-snow .ql-tooltip { z-index: 5; box-shadow: 0 6px 20px rgba(0,0,0,.12); border-radius: 8px; }

/* only shown if the Quill CDN cannot be reached */
.editor__fallback {
  display: block; width: 100%; min-height: 132px; border: 0; resize: vertical;
  padding: 11px 12px; font: inherit; font-size: 14px; line-height: 1.55; color: #16140f;
}
.editor__fallback:focus { outline: none; }
.field__hint { font-size: 11px; color: #a49d8f; }
.form-error { font-size: 12px; font-weight: 600; color: #a1402c; }
.form-ok { font-size: 12px; font-weight: 600; color: #157a42; }
.loading-note { padding: 40px 0; text-align: center; font-size: 13px; color: #8a857b; }
.claim-note {
  background: #eef8f0; border: 1px solid #cfe9d7; border-radius: 11px;
  padding: 11px 13px; font-size: 12px; line-height: 1.55; color: #2d5b40;
}
.photo-tile--busy {
  display: flex; align-items: center; justify-content: center;
  border: 1.5px dashed #c9c4ba; background: none;
}

/* photos */
.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}
.photo-tile {
  position: relative; aspect-ratio: 1 / 1; border-radius: 10px;
  background: repeating-linear-gradient(45deg, #f0ede7 0 8px, #e5e1d8 8px 16px);
  overflow: hidden;
}
.photo-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-tile__cover {
  position: absolute; bottom: 5px; left: 5px;
  background: #16140f; color: #fff; font-weight: 600; font-size: 9px;
  padding: 2px 7px; border-radius: 99px;
}
.photo-tile__x {
  position: absolute; top: 5px; right: 5px; width: 17px; height: 17px;
  border-radius: 50%; border: none; background: rgba(22, 20, 15, .75); color: #fff;
  font-weight: 600; font-size: 9px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  padding: 0;
}
.photo-add {
  aspect-ratio: 1 / 1; border-radius: 10px;
  border: 1.5px dashed #c9c4ba; background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; cursor: pointer; transition: border-color .15s;
}
.photo-add:hover { border-color: #1fa855; }
.photo-add__plus { font-size: 17px; color: #a49d8f; line-height: 1; }
.photo-add__label { font-weight: 500; font-size: 9px; color: #a49d8f; }

.btn-publish {
  background: #1fa855; border: none; border-radius: 10px;
  text-align: center; padding: 13px 0; font-weight: 600; font-size: 14px; color: #fff;
  cursor: pointer; transition: background .15s;
}
.btn-publish:hover { background: #178f47; }
.btn-dark {
  background: #16140f; border: none; border-radius: 10px;
  text-align: center; padding: 12px 0; font-weight: 600; font-size: 13px; color: #fff;
  cursor: pointer;
}
.btn-cancel {
  background: none; border: none; padding: 0; align-self: center;
  font-weight: 500; font-size: 12px; color: #8a857b; cursor: pointer;
}
.btn-cancel:hover { color: #16140f; }

/* ---------- Settings ---------- */

.settings { max-width: 560px; display: flex; flex-direction: column; gap: 14px; }
.settings .form-card { gap: 11px; }
.form-card__title { font-weight: 700; font-size: 13.5px; color: #16140f; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.check input { width: 16px; height: 16px; flex: none; accent-color: #1fa855; margin: 0; }
.check span { font-weight: 500; font-size: 12px; color: #4d483f; }
.settings-note { font-size: 11.5px; color: #a49d8f; }

/* ---------- Categories ---------- */

.section-head { display: flex; flex-direction: column; gap: 2px; }
.section-head__sub { font-size: 12px; color: #8a857b; }
.cats { display: flex; flex-direction: column; gap: 14px; max-width: 620px; }
.cat-add { background: #fff; border: 1px solid #e7e4de; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 9px; }
.cat-add__row { display: flex; gap: 9px; flex-wrap: wrap; }
.cat-add__row .input { flex: 1; min-width: 180px; }
.btn-green {
  background: #1fa855; color: #fff; border: none; border-radius: 10px;
  padding: 12px 17px; font-weight: 600; font-size: 13px; cursor: pointer;
  transition: background .15s;
}
.btn-green:hover { background: #178f47; }
.cat-list { background: #fff; border: 1px solid #e7e4de; border-radius: 14px; overflow: hidden; }
.cat-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; flex-wrap: wrap; background: #fff;
}
.cat-row + .cat-row { border-top: 1px solid #edeae4; }
.cat-row__grip { font-weight: 500; font-size: 13px; color: #c2bcb1; cursor: grab; }
.cat-row__main { flex: 1; min-width: 120px; }
.cat-row__name { font-weight: 600; font-size: 13px; color: #16140f; }
.cat-row__count { font-size: 11.5px; color: #8a857b; }
.btn-row:disabled, .btn-row--locked {
  background: #f4f2ee; border-color: #ece8e1; color: #c2bcb1; cursor: default;
}
.btn-row--locked:hover { border-color: #ece8e1; background: #f4f2ee; }
.notice {
  border-radius: 11px; padding: 11px 13px;
  font-weight: 500; font-size: 12px; line-height: 1.5;
}
.notice--ok { background: #eef8f0; border: 1px solid #cfe9d7; color: #1a5c37; }
.notice--warn { background: #fbf5e8; border: 1px solid #ecdcbd; color: #7a5a1c; }

.note-card {
  background: #fff; border: 1px solid #e7e4de; border-radius: 14px;
  padding: 14px 16px; font-size: 11.5px; line-height: 1.6; color: #8a857b;
}

/* ---------- Staff & roles ---------- */

.staff { display: flex; flex-direction: column; gap: 14px; }
.staff-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.staff-list { background: #fff; border: 1px solid #e7e4de; border-radius: 14px; overflow: hidden; }
.staff-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; flex-wrap: wrap; background: #fff;
}
.staff-row + .staff-row { border-top: 1px solid #edeae4; }
.avatar {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; background: #efece6; color: #4d483f;
}
.avatar--owner { background: #16140f; color: #fff; }
.staff-row__main { flex: 1; min-width: 150px; }
.staff-row__name-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.staff-row__name { font-weight: 600; font-size: 13px; color: #16140f; }
.staff-row__meta { font-size: 11.5px; color: #8a857b; }
.tag { font-weight: 600; font-size: 9.5px; padding: 2px 7px; border-radius: 99px; }
.tag--you { background: #f2efe9; color: #7a756c; }
.tag--pending { background: #fbf1e8; color: #9a6520; }
.pill--owner { background: #16140f; color: #fff; }
.pill--manager { background: #e8f6ee; color: #157a42; }
.pill--sales { background: #f2efe9; color: #4d483f; }

.invite-card {
  background: #fff; border: 1px solid #e7e4de; border-radius: 14px;
  padding: 18px; display: flex; flex-direction: column; gap: 12px; max-width: 560px;
}
.role-choices { display: flex; gap: 7px; flex-wrap: wrap; }
.role-chip {
  background: #fff; border: 1px solid #e2ddd4; color: #4d483f;
  font-weight: 500; font-size: 12px; padding: 7px 14px;
  border-radius: 99px; cursor: pointer;
}
.role-chip--active { background: #16140f; border-color: #16140f; color: #fff; font-weight: 600; }
.invite-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.btn-plain {
  background: #fff; border: 1px solid #dcd8d0; color: #4d483f; border-radius: 10px;
  padding: 11px 16px; font-weight: 600; font-size: 13px; cursor: pointer;
}

.perms-card {
  background: #fff; border: 1px solid #e7e4de; border-radius: 14px;
  padding: 18px; display: flex; flex-direction: column; gap: 13px;
}
.perms-scroll { overflow-x: auto; }
.perms-grid { min-width: 440px; display: grid; grid-template-columns: 1.7fr repeat(3, 1fr); }
.perms-grid__cap {
  font-weight: 600; font-size: 10px; letter-spacing: .09em; color: #a49d8f;
  padding: 0 8px 9px 0;
}
.perms-grid__role {
  font-weight: 700; font-size: 11.5px; color: #16140f; text-align: center; padding-bottom: 9px;
}
.perms-grid__label {
  font-weight: 500; font-size: 12px; color: #4d483f;
  padding: 9px 10px 9px 0; border-top: 1px solid #f1eee8;
}
.perms-grid__cell {
  text-align: center; padding: 9px 0; border-top: 1px solid #f1eee8;
  font-weight: 500; font-size: 13px; color: #cfc9bd;
}
.perms-grid__cell--on { font-weight: 700; color: #157a42; }

/* ---------- Login ---------- */

.login-wrap { display: flex; justify-content: center; padding: 40px 0; }
.login-card {
  width: 100%; max-width: 360px;
  background: #fff; border: 1px solid #e7e4de; border-radius: 16px;
  padding: 36px 26px; display: flex; flex-direction: column; gap: 14px;
}
.login-brand { text-align: center; margin-bottom: 6px; }
.login-brand__name { font-weight: 800; font-size: 18px; color: #16140f; }
.login-brand__pill { font-weight: 500; font-size: 10.5px; color: #8a857b; letter-spacing: .14em; margin-top: 3px; }
.login-card .input { padding: 12px 13px; }
.btn-signin {
  background: #16140f; border: none; border-radius: 10px;
  text-align: center; padding: 13px 0; font-weight: 600; font-size: 13.5px; color: #fff;
  cursor: pointer;
}
.login-forgot {
  background: none; border: none; padding: 0;
  text-align: center; font-weight: 600; font-size: 11.5px; color: #157a42; cursor: pointer;
}
.login-forgot:hover { color: #1fa855; }
.login-note { text-align: center; font-size: 11px; line-height: 1.6; color: #a49d8f; }

@media (prefers-reduced-motion: reduce) {
  .tab, .btn-add, .btn-row, .btn-publish, .photo-add { transition: none; }
}

/* Password is deliberately visible: the owner has to read it back to someone. */
.pw-field { display: flex; gap: 8px; align-items: stretch; }
.pw-field .input { flex: 1; font-family: ui-monospace, Menlo, monospace; }
.pw-field .btn-row { flex: none; padding: 0 14px; }

/* ---------- Modal ---------- */

body.no-scroll { overflow: hidden; }

.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(22, 20, 15, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: overlay-in .16s ease-out;
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  background: #fff; border: 1px solid #e7e4de; border-radius: 16px;
  width: 100%; max-width: 560px; max-height: 92vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  animation: modal-in .16s ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }

.modal-card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid #edeae4;
}
.modal-card__close {
  width: 28px; height: 28px; flex: none;
  background: none; border: none; border-radius: 8px;
  font-size: 13px; color: #7a756c; cursor: pointer;
}
.modal-card__close:hover { background: #f2efe9; color: #16140f; }

/* the body scrolls, so the footer buttons stay reachable on a short screen */
.modal-card__body {
  padding: 18px; display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto;
}
.modal-card__foot {
  display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap;
  padding-top: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .modal-overlay, .modal-card { animation: none; }
}

/* ---------- Inline role editor ---------- */

.role-edit {
  width: 100%;
  background: #faf9f7; border: 1px solid #ece8e1; border-radius: 10px;
  padding: 11px 13px; display: flex; flex-direction: column; gap: 8px;
}
.role-edit__title { font-weight: 600; font-size: 11.5px; color: #4d483f; }
.role-edit__note { font-size: 11px; line-height: 1.5; color: #8a857b; }
.role-pick {
  background: #fff; border: 1px solid #dcd8d0; color: #4d483f;
  font-family: inherit; font-weight: 600; font-size: 11.5px;
  padding: 5px 13px; border-radius: 99px; cursor: pointer;
  transition: border-color .15s;
}
.role-pick:hover { border-color: #16140f; }
.role-pick--on {
  background: #16140f; border-color: #16140f; color: #fff; padding: 6px 13px;
}

/* ---------- Analytics ---------- */

.an-head { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.an-range { display: inline-flex; gap: 2px; background: #f0ede7; border-radius: 9px; padding: 3px; }
.an-range__btn {
  border: 0; background: none; cursor: pointer; font: inherit; font-size: 12.5px;
  color: #56504a; padding: 6px 12px; border-radius: 7px;
}
.an-range__btn--on { background: #fff; color: #16140f; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.an-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; margin-bottom: 14px; }
.an-tile {
  background: #fff; border: 1px solid #e2ddd4; border-radius: 12px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 2px;
}
.an-tile__label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: #8a8378; font-weight: 600; }
.an-tile__value { font-size: 26px; font-weight: 800; color: #16140f; line-height: 1.15; }
.an-tile__hint  { font-size: 11.5px; color: #8a8378; }

/* Bars rather than a charting library — two series over at most 90 days does
   not justify shipping one, and this stays readable with no data at all. */
.an-chart { display: flex; align-items: flex-end; justify-content: flex-start; gap: 3px; height: 150px; margin: 6px 0 10px; overflow-x: auto; }
/* max-width so a single day does not stretch its bars across the whole panel */
.an-chart__col { flex: 1 0 14px; max-width: 46px; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; }
.an-chart__bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.an-chart__bar { width: 45%; min-height: 2px; border-radius: 3px 3px 0 0; }
.an-chart__bar--views  { background: #cfc7b8; }
.an-chart__bar--orders { background: #2fb35e; }
.an-chart__day { font-size: 9.5px; color: #9a948a; white-space: nowrap; }
.an-legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #6b655c; }
.an-legend__key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.an-legend__key--views  { background: #cfc7b8; }
.an-legend__key--orders { background: #2fb35e; margin-left: 10px; }

.an-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.an-table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: #8a8378; font-weight: 600; padding: 0 0 7px; border-bottom: 1px solid #e2ddd4;
}
.an-table td { padding: 9px 0; border-bottom: 1px solid #f0ede7; color: #2e2a24; }
.an-table tr:last-child td { border-bottom: 0; }
.an-table .an-num { text-align: right; width: 78px; white-space: nowrap; }
.an-table th.an-num { text-align: right; }

@media (max-width: 720px) {
  .an-tiles { grid-template-columns: repeat(2, 1fr); }
  .an-tile__value { font-size: 22px; }
}

/* Analytics panels are their own class: .panel is capped at 560px for forms,
   which is too narrow for these tables. */
.an-panel {
  background: #fff; border: 1px solid #e7e4de; border-radius: 14px;
  padding: 16px 18px; margin-bottom: 12px;
}
.an-panel__title { font-weight: 700; font-size: 14.5px; color: #16140f; margin-bottom: 4px; }
.an-panel__note { font-size: 12px; color: #8a857b; margin: 0 0 10px; }
.an-panel__note code {
  font-family: ui-monospace, Menlo, monospace; font-size: 11.5px;
  background: #f4f2ee; padding: 2px 5px; border-radius: 4px; color: #4d483f;
}

/* ---------- Installment plans ---------- */

.plan-pick { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.plan-pick .select-wrap { flex: 1; min-width: 240px; }
.plan-price { display: flex; flex-direction: column; gap: 5px; width: 170px; }

.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 10px; }
.plan-card {
  border: 1px solid #e2ddd4; border-radius: 12px; padding: 14px;
  display: flex; flex-direction: column; gap: 10px; background: #fbfaf8;
}
.plan-card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.plan-card__term { font-weight: 700; font-size: 13.5px; color: #16140f; }
.plan-card__markup { font-size: 11px; color: #8a857b; }
.plan-card__monthly { font-weight: 800; font-size: 24px; color: #16140f; line-height: 1.1; }
.plan-card__monthly span { font-weight: 500; font-size: 12.5px; color: #8a857b; margin-left: 2px; }

.plan-card__rows { margin: 0; display: flex; flex-direction: column; gap: 5px; }
.plan-card__rows > div { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.plan-card__rows dt { color: #8a857b; }
.plan-card__rows dd { margin: 0; font-weight: 600; color: #2e2a24; text-align: right; }
.plan-card__extra { border-top: 1px solid #e7e4de; padding-top: 5px; }
.plan-card__extra dd { color: #a1402c; }
.plan-card__copy { align-self: flex-start; }

.plan-foot { margin-top: 12px; margin-bottom: 0; }

.plan-terms .plan-in { padding: 7px 9px; font-size: 12.5px; width: 84px; }
.plan-terms td { vertical-align: middle; }
.plan-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.plan-card__pct { font-weight: 500; color: #8a857b; font-size: 11.5px; }
.plan-dep-note { margin: 10px 0 0; }

/* A fixed deposit amount overrides the per-term percentages; show that rather
   than leaving live-looking inputs that do nothing. */
.plan-override-note { background: #fdf6e7; border: 1px solid #eadfc4; border-radius: 9px; padding: 9px 11px; }
.plan-terms--overridden th:nth-child(2) { color: #c2bcb1; }
.plan-in:disabled { background: #f4f2ee; color: #a49d8f; cursor: not-allowed; border-color: #ece8e1; }
.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
  color: #157a42; text-decoration: underline;
}
.link-btn:hover { color: #1fa855; }

.field--check { gap: 6px; }
.check-row { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.check-row input { width: 16px; height: 16px; flex: none; accent-color: #16140f; margin: 0; cursor: pointer; }
.check-row .field__label { cursor: pointer; }

/* ---------- Admin listing search ---------- */

.admin-search {
  display: flex; align-items: center; gap: 9px;
  background: #fff; border: 1px solid #e2ddd4; border-radius: 11px;
  padding: 9px 13px; margin-bottom: 9px;
}
.admin-search:focus-within { border-color: #16140f; }
.admin-search svg { flex: none; }
.admin-search input {
  flex: 1; border: 0; outline: none; background: none;
  font-family: inherit; font-size: 13px; color: #16140f; min-width: 0;
}
.admin-search__clear {
  flex: none; border: 0; background: #f0ede7; color: #6b655c; cursor: pointer;
  width: 20px; height: 20px; border-radius: 50%; font-size: 11px; line-height: 1;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.admin-search__clear:hover { background: #e2ddd4; color: #16140f; }
.listings-note--found { margin-top: 0; margin-bottom: 9px; color: #6b655c; }


/* A number and its unit as one control. The unit is a button: clicking it
   switches the row between a percentage of the balance and a flat cash
   amount. Replaces a dropdown that was wider than its column and overlapped
   the field beside it. */
.unit-field {
  display: inline-flex; align-items: stretch; width: 118px;
  border: 1px solid #d9d5cd; border-radius: 9px; overflow: hidden; background: #fff;
}
.unit-field:focus-within { border-color: #16140f; }
.unit-field__input {
  flex: 1; min-width: 0; border: 0; outline: none; background: none;
  padding: 7px 8px; font-family: ui-monospace, Menlo, monospace;
  font-size: 12.5px; font-weight: 500; color: #16140f; text-align: right;
  -moz-appearance: textfield;
}
.unit-field__input::-webkit-outer-spin-button,
.unit-field__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.unit-field__unit {
  flex: none; min-width: 44px; border: 0; border-left: 1px solid #e7e4de;
  background: #f4f2ee; color: #4d483f; cursor: pointer;
  font-size: 12px; font-weight: 700; padding: 0 8px;
  transition: background .12s, color .12s;
}
.unit-field__unit:hover { background: #16140f; color: #fff; }
.unit-field__unit:active { transform: none; }

/* Give each column a width so the headers sit over their own fields. */
.plan-terms { table-layout: fixed; }
.plan-terms th:nth-child(1), .plan-terms td:nth-child(1) { width: auto; }
.plan-terms th:nth-child(2), .plan-terms td:nth-child(2) { width: 96px; }
.plan-terms th:nth-child(3), .plan-terms td:nth-child(3) { width: 130px; }
.plan-terms th:nth-child(4), .plan-terms td:nth-child(4) { width: 92px; }
.plan-terms td { padding-right: 0; }
.plan-terms .plan-in[data-f="months"],
.plan-terms .plan-in[data-f="deposit"] { width: 100%; max-width: 84px; }
.plan-terms td:nth-child(2) { text-align: right; }
.plan-terms td:nth-child(2) .plan-in { margin-left: auto; display: block; }

@media (max-width: 560px) {
  .plan-terms th:nth-child(2), .plan-terms td:nth-child(2) { width: 76px; }
  .plan-terms th:nth-child(3), .plan-terms td:nth-child(3) { width: 112px; }
  .plan-terms th:nth-child(4), .plan-terms td:nth-child(4) { width: 76px; }
  .unit-field { width: 106px; }
}
