/* ==========================================================================
   The Keeper's Office — super-admin pages. Every class is prefixed ad-.
   ========================================================================== */

/* ---------- numerals and small parts ---------- */
.ad-num { font-family: var(--serif); font-size: 1.18em; font-weight: 500; font-variant-numeric: lining-nums tabular-nums; letter-spacing: .01em; white-space: nowrap; }
.ad-hot { color: var(--warn); }
.ad-name { font-family: var(--serif); font-weight: 500; font-size: 1.1rem; letter-spacing: .01em; }
.ad-block { display: block; }
.ad-count { display: inline-block; margin-left: 6px; padding: 1px 7px; border: 1px solid var(--line); border-radius: 10px; font-family: var(--sans); font-size: .62rem; letter-spacing: .06em; color: var(--gold); vertical-align: middle; text-transform: none; }
.tab:not(.is-active) .ad-count { color: var(--ink-3); border-color: var(--line-2); }
.ad-tag { padding: 2px 7px; font-size: .54rem; letter-spacing: .16em; vertical-align: middle; }
.ad-cell .ad-tag { margin-top: 5px; }
.ad-sub { font-family: var(--sans); font-weight: 400; font-size: .66rem; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); padding-top: 18px; border-top: 1px solid var(--line-2); }
.ad-quote { font-family: var(--serif); font-style: italic; font-size: 1.16rem; line-height: 1.55; color: var(--ink-2); border-left: 1px solid var(--gold-3); padding-left: 18px; }
.ad-clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ad-rowbtn { color: var(--gold-2); border-bottom: 1px solid var(--line); padding-bottom: 1px; text-align: left; font-variant-numeric: tabular-nums; transition: border-color .3s, color .3s; }
.ad-rowbtn:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- maison / person cell ---------- */
.ad-cell { display: flex; align-items: center; gap: 12px; min-width: 190px; }
.ad-cell b { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.1rem; line-height: 1.25; letter-spacing: .01em; }
.ad-cell small { display: block; color: var(--ink-3); font-size: .74rem; line-height: 1.35; }
a.ad-cell:hover b { color: var(--gold-2); }
.ad-items { max-width: 260px; min-width: 150px; }
.ad-parcels { display: flex; flex-direction: column; gap: 6px; font-size: .84rem; }
.ad-parcels span { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- layout helpers ---------- */
.ad-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; align-items: start; }
@media (max-width: 1100px) { .ad-two { grid-template-columns: minmax(0, 1fr); } }
.ad-toolbar { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: flex-end; justify-content: space-between; }
.ad-toolbar .field, .ad-inline-form .field, .field.ad-narrow { margin: 0; }
.ad-toolbar .input, .ad-toolbar .select, .ad-narrow .select, .ad-inline-form .input, .ad-inline-form .select { min-height: 42px; padding-block: 8px; }
.ad-toolbar .chip { min-height: 42px; }
.ad-search { flex: 1 1 240px; min-width: 0; max-width: 460px; }
.ad-narrow { flex: 0 1 230px; min-width: 0; }
.ad-wide { flex: 1 1 320px !important; }
.ad-inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.ad-inline-form .field { flex: 1 1 150px; min-width: 0; max-width: 100%; }
.ad-inline-form .btn { min-height: 42px; }
.ad-manage { display: grid; gap: 18px; min-width: 0; }
.ad-manage > * { min-width: 0; }
.ad-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 560px) { .ad-split { grid-template-columns: minmax(0, 1fr); } }

/* ---------- fact grid ---------- */
.ad-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); }
.ad-fact { background: var(--bg-2); padding: 14px 16px; min-width: 0; }
.ad-fact-l { display: block; font-size: .58rem; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-3); }
.ad-fact-v { display: block; margin-top: 4px; font-family: var(--serif); font-size: 1.2rem; line-height: 1.3; font-variant-numeric: lining-nums tabular-nums; overflow-wrap: anywhere; }
.ad-fact-v small { font-family: var(--sans); font-size: .72rem; }
.ad-line { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.ad-line-total { border-bottom: 0; border-top: 1px solid var(--line); margin-top: -1px; font-size: 1.05rem; }

/* ---------- overview: briefing ---------- */
.ad-brief { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: clamp(24px, 3vw, 56px); align-items: end; padding: clamp(24px, 3.6vw, 52px); border: 1px solid var(--line);
  background: radial-gradient(110% 150% at 0% 0%, rgba(201,163,92,.13), transparent 58%), linear-gradient(180deg, var(--bg-3), var(--bg-2)); }
.ad-brief > * { position: relative; min-width: 0; }
.ad-brief-mark { position: absolute; right: -40px; top: -30px; opacity: .05; pointer-events: none; }
.ad-brief-list li { position: relative; padding: 5px 0 5px 26px; color: var(--ink-2); }
.ad-brief-list li::before { content: ""; position: absolute; left: 0; top: 1.05em; width: 14px; height: 1px; background: var(--gold); }
.ad-brief-today { border-left: 1px solid var(--line); padding-left: clamp(18px, 2.4vw, 36px); }
.ad-today-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.ad-today-v { display: block; font-family: var(--serif); font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.05; color: var(--gold-2); font-variant-numeric: lining-nums tabular-nums; }
.ad-today-l { display: block; margin-top: 4px; font-size: .6rem; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-3); }
@media (max-width: 900px) {
  .ad-brief { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .ad-brief-today { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 22px; }
  .ad-today-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 520px) { .ad-today-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- overview: insights ---------- */
.ad-insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 16px; }
.ad-insight { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px 24px; background: var(--bg-2); border: 1px solid var(--line-2); border-top: 2px solid var(--warn); transition: border-color .4s, transform .5s var(--ease), background .4s; }
.ad-insight:hover { background: var(--bg-3); transform: translateY(-3px); }
.ad-insight-win { border-top-color: var(--ok); }
.ad-insight-idea { border-top-color: var(--gold); }
.ad-insight-kind { font-size: .58rem; letter-spacing: .26em; text-transform: uppercase; color: var(--warn); }
.ad-insight-win .ad-insight-kind { color: var(--ok); }
.ad-insight-idea .ad-insight-kind { color: var(--gold); }
.ad-insight .link-arrow { margin-top: auto; padding-top: 8px; }
.feed li.ad-read { opacity: .55; }
.ad-convos .dot { font-family: var(--serif); font-size: .95rem; }
.ad-convos li > div { min-width: 0; }

/* ---------- applications ---------- */
.ad-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 16px 20px; border: 1px solid var(--line); background: rgba(201,163,92,.04); }
.ad-banner-off { border-color: var(--line-2); background: var(--bg-2); }
.ad-banner p { flex: 1 1 260px; }
.ad-apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 24px; align-items: start; }
.ad-app { display: grid; gap: 20px; }
.ad-app > * { min-width: 0; }
.ad-app-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ad-app-foot { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; align-items: center; padding-top: 20px; border-top: 1px solid var(--line-2); }
.ad-app-decided { justify-content: space-between; }

/* ---------- orders ---------- */
.table tr.ad-late td:first-child { box-shadow: inset 2px 0 0 var(--warn); }
.table tr.ad-late td { background: rgba(217,168,96,.035); }
.table tr.ad-total td { border-top: 1px solid var(--line); border-bottom: 0; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); }
.table tr.ad-total td.ad-num { font-size: 1.1rem; letter-spacing: .01em; text-transform: none; color: var(--ink); }
.table tr.ad-total td.gold { color: var(--gold); }

/* ---------- finance ---------- */
.ad-fee { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(24px, 4vw, 64px); align-items: start;
  background: radial-gradient(90% 140% at 0% 0%, rgba(201,163,92,.1), transparent 60%), var(--bg-2); }
@media (max-width: 900px) { .ad-fee { grid-template-columns: minmax(0, 1fr); } }
.ad-fee-rate { font-family: var(--serif); font-weight: 300; font-size: clamp(4.4rem, 10vw, 7.5rem); line-height: .9; color: var(--gold-2); font-variant-numeric: lining-nums; letter-spacing: -.01em; }
.ad-rates li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }

/* ---------- AI oversight ---------- */
.ad-master { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.ad-master .grow { flex: 1 1 280px; }
.ad-switch-label { display: inline-flex; align-items: center; gap: 12px; color: var(--ink-2); cursor: pointer; }
.ad-transcript { max-height: 54vh; padding: 16px; border: 1px solid var(--line-2); background: var(--bg); }

/* ---------- curation ---------- */
.ad-setting { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.ad-setting:last-child { border-bottom: 0; }
.ad-setting .ad-cell { min-width: 0; }
.ad-feature-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); column-gap: 40px; }
.ad-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px; }
.ad-thumb { display: block; min-width: 0; }
.ad-thumb .art-frame { display: block; aspect-ratio: 4 / 5; border: 1px solid var(--line-2); transition: border-color .3s; }
.ad-thumb:hover .art-frame { border-color: var(--line); }
.ad-thumb-name { display: block; margin-top: 8px; font-family: var(--serif); font-size: .98rem; line-height: 1.25; }
.ad-thumb-off .art-frame { opacity: .4; }
.ad-pick { max-height: 44vh; overflow-y: auto; border: 1px solid var(--line-2); margin-top: 16px; }
.ad-pick-row { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background .3s; }
.ad-pick-row:last-child { border-bottom: 0; }
.ad-pick-row:hover { background: rgba(201,163,92,.05); }
.ad-pick-row input { accent-color: var(--gold); width: 16px; height: 16px; flex: none; }
.ad-pick-row b { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.05rem; line-height: 1.25; }
.ad-pick-row small { color: var(--ink-3); font-size: .74rem; }

/* ---------- settings ---------- */
.ad-standards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); }
.ad-standards li { background: var(--bg-2); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.ad-standards b { font-family: var(--serif); font-weight: 500; font-size: 1.12rem; color: var(--gold-2); }
.ad-danger-zone { border-color: rgba(207,130,113,.28); }

/* ---------- small screens ---------- */
@media (max-width: 520px) {
  .ad-toolbar { justify-content: flex-start; }
  .ad-search, .ad-narrow { flex: 1 1 100%; max-width: none; }
  .ad-app-foot .btn, .ad-inline-form .btn { flex: 1 1 auto; }
  .ad-cell { min-width: 160px; }

}
