/* CKC admin — light theme in the website palette (charcoal, CKC yellow, cream, paper). */
@font-face { font-family: 'Roboto'; src: url('fonts/Roboto.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Kaushan Script'; src: url('fonts/KaushanScript.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  color-scheme: light;
  --yellow: #ffdf0e;
  --yellow-soft: #fff6b8;
  --charcoal: #191818;
  --ink: #272424;
  --ink-2: #3a3636;
  --ink-3: #6b6460;
  --paper: #fdfdf8;
  --cream: #fbf6ea;
  --white: #fff;
  --line: #efe7d4;
  --line-2: #d9cfb6;
  --gold: #7a6a2e;
  --green: #1e8e3e;
  --green-soft: #e3f4e7;
  --red: #b42318;
  --red-soft: #fdecea;
  --blue: #1d4f91;
  --blue-soft: #e7eefa;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(25, 24, 24, .05), 0 8px 24px -12px rgba(25, 24, 24, .12);
  --font: 'Roboto', Arial, Helvetica, sans-serif;
  --script: 'Kaushan Script', 'Brush Script MT', cursive;
  --side: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--charcoal); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.script { font-family: var(--script); font-weight: 400; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--charcoal); color: #e9e4da; display: flex; flex-direction: column; padding: 18px 14px; }
.side__brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; text-decoration: none; }
.side__brand img { width: 44px; height: auto; }
.scrim { display: none; }
.side__brand b { display: block; color: var(--white); font-size: 15px; letter-spacing: .2px; }
.side__brand > span > span { display: block; color: var(--yellow); font-family: var(--script); font-size: 15px; line-height: 1; }
.side__title { margin: 16px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: #8f877d; }
.side__link { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: #d9d3c8; text-decoration: none; font-weight: 500; transition: background .15s, color .15s; }
.side__link:hover { background: #2a2828; color: var(--white); }
.side__link.is-active { background: var(--yellow); color: var(--charcoal); font-weight: 700; }
.side__count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 99px; background: var(--yellow); color: var(--charcoal); font-size: 11.5px; font-weight: 700; text-align: center; }
.side__link.is-active .side__count { background: var(--charcoal); color: var(--yellow); }
.side__foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid #2f2d2d; font-size: 12px; color: #8f877d; }
.side__foot a { color: #d9d3c8; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(253, 253, 248, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top__menu { display: none; }
.top__crumbs { display: flex; gap: 8px; align-items: center; color: var(--ink-3); font-size: 13px; min-width: 0; }
.top__crumbs a { text-decoration: none; }
.top__crumbs a:hover { color: var(--ink); text-decoration: underline; }
.top__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user { position: relative; }
.user summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 6px 4px 4px; border-radius: 99px; border: 1px solid var(--line); background: var(--white); }
.user summary::-webkit-details-marker { display: none; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); color: var(--charcoal); font-weight: 800; font-size: 13px; }
.user__menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; }
.user__menu a, .user__menu button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 10px; border: 0; background: none; border-radius: 8px; text-decoration: none; cursor: pointer; text-align: left; }
.user__menu a:hover, .user__menu button:hover { background: var(--cream); }
.user__head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

.content { padding: 26px 28px 60px; max-width: 1240px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 20px; margin-bottom: 22px; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.3px; color: var(--charcoal); }
.page-head h1 .script { color: var(--gold); font-size: 1.05em; margin-left: 4px; }
.page-head p { margin-top: 4px; color: var(--ink-3); max-width: 720px; }
.page-head__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 99px; border: 1.5px solid transparent; font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform .08s, background .15s, border-color .15s, box-shadow .15s; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--yellow); color: var(--charcoal); border-color: var(--yellow); box-shadow: 0 2px 0 #c9ae00; }
.btn--primary:hover { background: #ffe83f; }
.btn--dark { background: var(--charcoal); color: var(--white); }
.btn--dark:hover { background: #333; }
.btn--ghost { background: var(--white); border-color: var(--line-2); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink-3); }
.btn--danger { background: var(--white); border-color: #efc4bf; color: var(--red); }
.btn--danger:hover { background: var(--red-soft); }
.btn--sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn--icon { width: 34px; min-height: 34px; padding: 0; border-radius: 10px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.linkish { background: none; border: 0; padding: 0; color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* ---------- cards & stats ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card__head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card__head h2 { font-size: 15.5px; font-weight: 800; }
.card__head .muted { margin-left: auto; font-size: 13px; }
.card__body { padding: 20px; }
.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; position: relative; overflow: hidden; }
.stat__label { font-size: 12.5px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }
.stat__value { font-size: 30px; font-weight: 800; color: var(--charcoal); line-height: 1.1; }
.stat__hint { font-size: 12.5px; color: var(--ink-3); }
.stat--yellow { background: var(--yellow); border-color: var(--yellow); }
.stat--yellow .stat__label, .stat--yellow .stat__hint { color: var(--ink-2); }
.stat--dark { background: var(--charcoal); border-color: var(--charcoal); }
.stat--dark .stat__value { color: var(--yellow); }
.stat--dark .stat__label, .stat--dark .stat__hint { color: #cfc8c0; }
a.stat:hover { box-shadow: 0 10px 30px -14px rgba(25, 24, 24, .35); }
.welcome { display: flex; align-items: center; gap: 18px; padding: 22px 24px; margin-bottom: 18px; background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); }
.welcome h1 { font-size: 24px; font-weight: 800; }
.welcome h1 .script { color: var(--gold); }
.welcome img { width: 64px; }

/* ---------- alerts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 500; border: 1px solid; }
.alert--ok { background: var(--green-soft); border-color: #bfe3c8; color: #145c29; }
.alert--error { background: var(--red-soft); border-color: #f2c2bc; color: var(--red); }
.alert--warn { background: var(--yellow-soft); border-color: #f0dc6a; color: #5c4d00; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 90; max-width: 380px; box-shadow: var(--shadow); animation: toast-in .25s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- toolbar / table ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1 1 240px; max-width: 360px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 16px; height: 16px; }
.search input { padding-left: 36px !important; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--white); text-decoration: none; font-weight: 600; font-size: 13px; }
.tab:hover { border-color: var(--ink-3); }
.tab.is-active { background: var(--charcoal); border-color: var(--charcoal); color: var(--white); }
.tab b { font-size: 11.5px; padding: 0 6px; border-radius: 99px; background: var(--yellow); color: var(--charcoal); }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-3); font-weight: 700; padding: 10px 14px; background: var(--cream); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fffdf3; }
.table tr.is-off td:not(.td-actions) { opacity: .55; }
.table .title { font-weight: 700; color: var(--charcoal); text-decoration: none; }
.table .title:hover { text-decoration: underline; }
.table .sub { display: block; color: var(--ink-3); font-size: 12.5px; max-width: 460px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: var(--cream); border: 1px solid var(--line); }
.thumb--empty { display: grid; place-items: center; color: var(--line-2); }
.td-actions { white-space: nowrap; text-align: right; width: 1%; }
.td-actions form { display: inline; }
.row-actions { display: inline-flex; gap: 4px; align-items: center; }
.empty { padding: 48px 20px; text-align: center; color: var(--ink-3); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--cream); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.badge--new { background: var(--yellow); border-color: var(--yellow); color: var(--charcoal); }
.badge--contacted { background: var(--blue-soft); border-color: #c9d8f0; color: var(--blue); }
.badge--qualified, .badge--on { background: var(--green-soft); border-color: #bfe3c8; color: #145c29; }
.badge--follow_up { background: #fff1db; border-color: #f3d9a8; color: #8a5300; }
.badge--closed { background: #ecebe8; border-color: #dcd9d3; color: #4c4846; }
.badge--rejected, .badge--off { background: var(--red-soft); border-color: #f2c2bc; color: var(--red); }
.badge--franchise { background: var(--charcoal); border-color: var(--charcoal); color: var(--yellow); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* switch */
.switch { position: relative; display: inline-flex; width: 40px; height: 23px; border-radius: 99px; background: #dcd5c5; border: 0; padding: 0; cursor: pointer; transition: background .15s; vertical-align: middle; }
.switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch.is-on { background: var(--green); }
.switch.is-on::after { transform: translateX(17px); }

.pagination { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; padding: 14px 16px; border-top: 1px solid var(--line); }
.pagination__pages { display: flex; gap: 4px; flex-wrap: wrap; }
.pagination a, .pagination span.page { min-width: 34px; height: 34px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line-2); text-decoration: none; font-weight: 600; background: var(--white); }
.pagination span.is-current { background: var(--charcoal); color: var(--white); border-color: var(--charcoal); }
.pagination span.is-disabled { opacity: .4; }

/* ---------- forms ---------- */
.form { display: grid; gap: 18px; }
.fieldset { padding: 0; border: 0; margin: 0; }
.fieldset__title { display: flex; align-items: center; gap: 10px; font-size: 15.5px; font-weight: 800; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; padding: 20px; }
.field { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--half { grid-column: span 1; }
.field > label, .field__label { font-weight: 700; font-size: 13.5px; color: var(--ink-2); }
.field__help { font-size: 12.5px; color: var(--ink-3); }
.field__error { font-size: 12.5px; color: var(--red); font-weight: 600; }
.input, .field input[type=text], .field input[type=email], .field input[type=url], .field input[type=tel], .field input[type=number],
.field input[type=password], .field input[type=search], .field input[type=date], .field input[type=datetime-local], .field select, .field textarea, .input-plain {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1.5px solid var(--line-2); border-radius: 10px; background: var(--white); transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.field select, select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23191818' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--charcoal); box-shadow: 0 0 0 3px rgba(255, 223, 14, .55); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red); }
.prefix { display: flex; align-items: stretch; }
.prefix span { display: grid; place-items: center; padding: 0 10px; background: var(--cream); border: 1.5px solid var(--line-2); border-right: 0; border-radius: 10px 0 0 10px; color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.prefix input { border-radius: 0 10px 10px 0 !important; }
.check { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--cream); cursor: pointer; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--charcoal); }
.form-bar { position: sticky; bottom: 0; z-index: 10; display: flex; gap: 10px; align-items: center; padding: 14px 20px; background: rgba(255, 255, 255, .95); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -8px 24px -18px rgba(25, 24, 24, .3); }
.form-bar__note { margin-left: auto; color: var(--ink-3); font-size: 12.5px; }
.form-bar .dirty-flag { display: none; color: #8a5300; font-weight: 700; }
.is-dirty .form-bar .dirty-flag { display: inline; }

/* repeatable rows / lists */
.rep { display: grid; gap: 8px; }
.rep__row { display: flex; gap: 8px; align-items: flex-start; }
.rep__row > .rep__cells { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.rep__tools { display: flex; gap: 4px; }
.rep__add { justify-self: start; }

/* image fields */
.img-field { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1.5px dashed var(--line-2); border-radius: 12px; background: var(--cream); }
.img-field__preview { width: 76px; height: 76px; border-radius: 10px; overflow: hidden; background: var(--white) center/cover no-repeat; border: 1px solid var(--line); flex: none; display: grid; place-items: center; color: var(--line-2); }
.img-field__preview img { width: 100%; height: 100%; object-fit: contain; }
.img-field__body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.img-field__value { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.img-field__btns { display: flex; gap: 6px; flex-wrap: wrap; }
.img-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.img-list__item { position: relative; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; background: var(--white); }
.img-list__item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.img-list__tools { position: absolute; inset: auto 6px 6px 6px; display: flex; justify-content: space-between; gap: 4px; }
.img-list__tools button { width: 28px; height: 28px; border-radius: 8px; border: 0; background: rgba(255,255,255,.95); box-shadow: 0 1px 3px rgba(0,0,0,.2); cursor: pointer; display: grid; place-items: center; }
.img-list__add { aspect-ratio: 1; border: 1.5px dashed var(--line-2); border-radius: 12px; background: var(--cream); display: grid; place-items: center; cursor: pointer; font-weight: 700; color: var(--ink-3); }
.img-list__add:hover { border-color: var(--ink-3); color: var(--ink); }

/* modal (image picker) */
.modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 20px; background: rgba(25, 24, 24, .55); }
.modal.is-open { display: grid; }
.modal__box { width: min(960px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--paper); border-radius: 18px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); overflow: hidden; }
.modal__head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: var(--white); border-bottom: 1px solid var(--line); }
.modal__head h2 { font-size: 17px; font-weight: 800; }
.modal__body { padding: 18px 20px; overflow-y: auto; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.picker-item { border: 2px solid transparent; border-radius: 12px; background: var(--white); padding: 6px; cursor: pointer; text-align: left; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.picker-item:hover, .picker-item:focus-visible { border-color: var(--charcoal); }
.picker-item img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--cream); border-radius: 8px; }
.picker-item span { display: block; margin-top: 5px; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-section { margin: 4px 0 10px; font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-3); }
.dropzone { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px; margin-bottom: 18px; border: 2px dashed var(--line-2); border-radius: 14px; background: var(--white); color: var(--ink-3); font-weight: 600; cursor: pointer; text-align: center; }
.dropzone.is-over { border-color: var(--charcoal); background: var(--yellow-soft); color: var(--ink); }

/* content editor (JSON-driven) */
.ce-section { margin-bottom: 14px; }
.ce-section > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 15px 20px; cursor: pointer; font-weight: 800; font-size: 15.5px; }
.ce-section > summary::-webkit-details-marker { display: none; }
.ce-section > summary::after { content: ''; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform .15s; }
.ce-section[open] > summary { border-bottom: 1px solid var(--line); }
.ce-section[open] > summary::after { transform: rotate(-135deg); }
.ce-section__num { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--yellow); font-size: 12.5px; }
.ce-section__hint { font-weight: 500; font-size: 12.5px; color: var(--ink-3); }
.ce-body { padding: 18px 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.ce-group { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 12px; background: #fffdf6; }
.ce-group > .ce-group__title { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 800; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.ce-group > .ce-body { padding: 14px; }
.ce-list { grid-column: 1 / -1; display: grid; gap: 10px; }
.ce-list__head { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13.5px; }
.ce-item { border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.ce-item__bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line); background: var(--cream); border-radius: 12px 12px 0 0; }
.ce-item__bar b { font-size: 12.5px; color: var(--ink-3); }
.ce-item__bar .ce-item__title { font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.ce-item > .ce-body { padding: 14px; }
.ce-scalar-list .rep__row input { flex: 1; }
.managed { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--yellow-soft); border: 1px solid #f0dc6a; font-weight: 600; }
.managed a { margin-left: auto; }

/* enquiries */
.lead-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.kv { display: grid; grid-template-columns: 160px minmax(0, 1fr); }
.kv dt, .kv dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--ink-3); font-weight: 600; }
.kv dd { font-weight: 500; white-space: pre-wrap; word-break: break-word; }
.kv > :nth-last-child(-n+2) { border-bottom: 0; }
.notes { display: grid; gap: 12px; }
.note { padding: 12px 14px; border-radius: 12px; background: var(--cream); border: 1px solid var(--line); }
.note__meta { font-size: 12px; color: var(--ink-3); margin-bottom: 3px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.timeline { display: grid; gap: 0; }
.timeline__item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline__item:last-child { border-bottom: 0; }
.timeline__when { width: 120px; flex: none; color: var(--ink-3); font-size: 12.5px; }

/* media library */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; padding: 16px; }
.media-card { border: 1px solid var(--line); border-radius: 14px; background: var(--white); overflow: hidden; display: flex; flex-direction: column; }
.media-card__img { aspect-ratio: 4/3; background: var(--cream); display: grid; place-items: center; }
.media-card__img img { width: 100%; height: 100%; object-fit: cover; }
.media-card__body { padding: 10px; display: grid; gap: 6px; font-size: 12.5px; }
.media-card__body input { min-height: 34px !important; padding: 6px 9px !important; font-size: 12.5px; }
.media-card__tools { display: flex; gap: 6px; }

/* login */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth__brand { position: relative; background: var(--yellow); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 60px; overflow: hidden; }
.auth__brand img { width: min(360px, 80%); }
.auth__brand h2 { margin-top: 28px; font-size: 34px; font-weight: 900; color: var(--charcoal); line-height: 1.1; }
.auth__brand h2 .script { display: block; font-size: 1.15em; color: var(--charcoal); }
.auth__brand::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; border: 48px solid rgba(25, 24, 24, .07); }
.auth__panel { display: grid; place-items: center; padding: 40px 24px; background: var(--paper); }
.auth__card { width: min(400px, 100%); }
.auth__card h1 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.auth__card .muted { margin-bottom: 24px; }
.auth__card .field { margin-bottom: 14px; }

@media (max-width: 1100px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 60; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; box-shadow: 20px 0 60px -20px rgba(0,0,0,.4); }
  .nav-open .side { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(25,24,24,.45); }
  .top { padding: 10px 16px; }
  .top__menu { display: inline-flex; }
  .content { padding: 20px 16px 50px; }
  .fields, .ce-body { grid-template-columns: minmax(0, 1fr); }
  .field--half { grid-column: 1 / -1; }
  .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth__brand { padding: 32px 24px; min-height: 0; }
  .auth__brand h2 { font-size: 24px; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv dt { padding-bottom: 0; border-bottom: 0; }
  .table .sub { max-width: 220px; }
  .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* footer */
.main { min-height: 100vh; }
.content { flex: 1; }
.admin-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 28px; border-top: 1px solid var(--line); background: var(--cream); color: var(--ink-3); font-size: 13px; }
.admin-foot b { color: var(--charcoal); font-weight: 800; letter-spacing: .3px; }
.admin-foot__heart { width: 15px; height: 15px; fill: #e0245e; vertical-align: -2px; margin: 0 2px; }
.admin-foot__version { padding: 3px 10px; border-radius: 99px; background: var(--charcoal); color: var(--yellow); font-weight: 700; font-size: 12px; }
.auth__panel .admin-foot { background: none; border: 0; padding: 0; margin-top: 28px; }
@media (max-width: 860px) { .admin-foot { padding: 14px 16px; } }
