/* Ideation admin: brand colours from the website (ink, brand orange, bronze, cream). */
@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap");

:root {
  --ink: #231F20;
  --brand: #FBB041;
  --bronze: #A56C29;
  --cream: #F8F3EA;
  --bg: #F6F4F0;
  --card: #FFFFFF;
  --line: rgba(30, 30, 30, .1);
  --text: #231F20;
  --soft: #524F4A;
  --muted: #6B6862;
  --ok: #2F855A;
  --warn: #B7791F;
  --bad: #C53030;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 Montserrat, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
a { color: inherit; }
a:hover { color: var(--bronze); }
h1, h2 { margin: 0; letter-spacing: -.02em; }
h1 { font-size: 26px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
h2 { font-size: 16px; margin-bottom: 12px; }
code { font-family: "JetBrains Mono", monospace; font-size: 12px; background: var(--cream); padding: 2px 6px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

/* Layout */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #fff; padding: 22px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; text-decoration: none; font-size: 15px; }
.logo b { color: var(--brand); }
.logo:hover { color: #fff; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: rgba(255,255,255,.72); font-weight: 500; }
.side nav a i { font-style: normal; width: 18px; text-align: center; color: rgba(255,255,255,.4); }
.side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side nav a.on { background: rgba(251,176,65,.14); color: #fff; }
.side nav a.on i { color: var(--brand); }
.nav-label { margin: 18px 10px 6px; font: 500 10px "JetBrains Mono", monospace; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.35); }
.badge { margin-left: auto; font-style: normal; background: var(--brand); color: var(--ink); border-radius: 99px; padding: 0 7px; font-size: 11px; font-weight: 700; }
.dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.me { border-top: 1px solid rgba(255,255,255,.1); padding: 14px 10px 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; }
.me span { display: block; color: rgba(255,255,255,.5); overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.me .link { color: rgba(255,255,255,.7); }
.main { padding: 28px 36px 60px; min-width: 0; max-width: 1240px; }
.menu-btn { display: none; }

.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: var(--brand); color: var(--ink); font: 800 24px Montserrat, sans-serif; }
.brand-mark.sm { width: 26px; height: 26px; font-size: 16px; border-radius: 7px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; max-width: 640px; }
.page-head.sticky { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 16px 0 14px; margin-top: -16px; border-bottom: 1px solid var(--line); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Surfaces */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.panel-head a { font-size: 12px; font-weight: 600; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; align-items: start; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; display: flex; flex-direction: column; gap: 2px; transition: border-color .2s, transform .2s; }
.card:hover { border-color: var(--ink); transform: translateY(-1px); color: inherit; }
.card i { font-style: normal; color: var(--bronze); margin-bottom: 6px; }
.card b { font-size: 28px; letter-spacing: -.03em; line-height: 1.1; }
.card span { font-weight: 600; }
.callout { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 16px 20px; margin-bottom: 18px; }
.callout .muted { color: rgba(255,255,255,.6); }
.callout .btn.primary { background: var(--brand); border-color: var(--brand); color: var(--ink); }
.callout .btn.primary:hover { background: #fff; border-color: #fff; }
.empty { color: var(--muted); padding: 18px 0 6px; margin: 0; }
.empty a { font-weight: 600; }

/* Notices */
.notice { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid; font-weight: 500; }
.notice.ok { background: #F0FAF4; border-color: #C6E9D3; color: #22543D; }
.notice.warn { background: #FFF8EB; border-color: #F6DDB0; color: #7B4A12; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--ink); background: var(--card); color: var(--ink); font: 600 13px Montserrat, sans-serif; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.btn:hover { background: var(--ink); color: #fff; }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--brand); border-color: var(--brand); color: var(--ink); }
.btn.ghost { border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); background: var(--card); color: var(--ink); }
.btn.small { height: 32px; padding: 0 12px; font-size: 12px; }
.btn.block { width: 100%; height: 46px; margin-top: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; font: 600 12px Montserrat, sans-serif; color: var(--soft); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.link:hover { color: var(--bronze); }
.link.danger { color: var(--bad); }
form.inline { display: inline-flex; gap: 12px; align-items: center; }
.danger-zone { margin-top: 26px; }

/* Pills */
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font: 600 11px Montserrat, sans-serif; background: var(--cream); color: var(--soft); vertical-align: middle; letter-spacing: 0; }
.pill.published { background: #E6F6EC; color: var(--ok); }
.pill.draft { background: #F1EDE5; color: var(--muted); }
.pill.running { background: #FFF4DE; color: var(--warn); }
.pill.failed { background: #FDECEC; color: var(--bad); }

/* Tables */
table.table { width: 100%; border-collapse: collapse; }
table.table th { text-align: left; font: 500 10px "JetBrains Mono", monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.table tr:last-child td { border-bottom: 0; }
table.table td a { text-decoration: none; }
table.table tr.unread td:first-child b::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-right: 7px; vertical-align: middle; }
table.table tr.on td { background: var(--cream); }
.handle-col { width: 24px; }
.handle { cursor: grab; color: var(--muted); letter-spacing: -2px; user-select: none; }
[data-sortable="0"] .handle { visibility: hidden; }
tr.dragging { opacity: .4; }
.mini-thumb { width: 56px; }
.mini-thumb img { width: 48px; height: 36px; object-fit: cover; border-radius: 6px; display: block; background: var(--cream); }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.tabs a { padding: 7px 14px; border-radius: 8px; text-decoration: none; font-weight: 600; color: var(--muted); }
.tabs a.on { background: var(--card); color: var(--ink); border: 1px solid var(--line); }

/* Forms */
input, select, textarea { width: 100%; font: 14px Montserrat, sans-serif; color: var(--text); background: #fff; border: 1px solid rgba(30,30,30,.18); border-radius: 9px; padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(251,176,65,.25); }
input.big { font-size: 20px; font-weight: 700; letter-spacing: -.02em; padding: 12px 14px; }
input.search { max-width: 320px; }
textarea { resize: vertical; line-height: 1.55; }
select { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236B6862' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") no-repeat right 12px center; padding-right: 32px; }
.toolbar select { width: auto; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label > span, label.field > span { font-weight: 600; font-size: 13px; }
.field small { color: var(--muted); font-size: 12px; }
.req { color: var(--bad); font-style: normal; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; padding-top: 22px; }
.form-grid > .field { grid-column: 1 / -1; }
.form-grid > .field.half { grid-column: auto; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.slug { display: flex; align-items: center; border: 1px solid rgba(30,30,30,.18); border-radius: 9px; overflow: hidden; background: #fff; }
.slug span { padding: 0 0 0 12px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.slug input { border: 0; box-shadow: none; padding-left: 2px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13px; cursor: pointer; padding: 6px 0; }
.toggle input { display: none; }
.toggle span { width: 36px; height: 20px; border-radius: 99px; background: rgba(30,30,30,.18); position: relative; transition: background .2s; flex: none; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle input:checked + span { background: var(--ink); }
.toggle input:checked + span::after { transform: translateX(16px); background: var(--brand); }

/* Image pickers */
.picker { border: 1px dashed rgba(30,30,30,.22); border-radius: 10px; padding: 12px; background: #FCFBF9; }
.picker.drop { border-color: var(--brand); background: #FFF8EB; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumbs:not(:empty) { margin-bottom: 10px; }
.thumb { position: relative; width: 120px; height: 90px; border-radius: 8px; overflow: hidden; background: var(--cream); border: 1px solid var(--line); cursor: grab; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-x { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(35,31,32,.8); color: #fff; font-size: 10px; cursor: pointer; }
.picker-actions { display: flex; gap: 8px; align-items: center; }
.picker-actions .uploading { font-size: 12px; color: var(--muted); }
.file-ext { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font: 600 12px "JetBrains Mono", monospace; color: var(--bronze); }
.file-ext.big { font-size: 28px; min-height: 200px; }

/* Repeater */
.rep-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.rep-row input:first-child { max-width: 160px; }

/* Media library */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.media-tile { position: relative; aspect-ratio: 4 / 3; border-radius: 9px; overflow: hidden; background: var(--cream); border: 2px solid transparent; display: block; cursor: pointer; }
.media-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-tile.on, .media-tile:hover { border-color: var(--brand); }
.media-tile.picked { border-color: var(--ink); }
.media-tile.picked::after { content: "✓"; position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 12px; }
.no-alt { position: absolute; bottom: 5px; left: 5px; font: 600 9px "JetBrains Mono", monospace; background: rgba(255,255,255,.9); color: var(--warn); padding: 1px 5px; border-radius: 4px; font-style: normal; }
.media-detail { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; }
.media-detail .preview { background: var(--cream); border-radius: 10px; display: flex; align-items: center; justify-content: center; min-height: 240px; overflow: hidden; }
.media-detail .preview img, .media-detail .preview video { max-width: 100%; max-height: 420px; display: block; }
.media-detail form.field { gap: 8px; }
.media-detail .btn.small { align-self: flex-start; }
.upload-form { margin: 0; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(35,31,32,.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: var(--card); border-radius: 14px; width: min(980px, 100%); max-height: 86vh; display: flex; flex-direction: column; padding: 18px 20px; gap: 12px; }
.modal-head { display: flex; align-items: center; gap: 12px; }
.modal-head b { flex: 1; }
.modal .media-grid { overflow-y: auto; padding: 2px; }
.modal input.search { max-width: none; }

/* Enquiries */
.meta { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; margin: 6px 0 16px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }
.message { white-space: normal; background: var(--cream); border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; line-height: 1.65; }

/* Login and setup */
body.auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; background: var(--ink); }
.auth-card { background: var(--card); border-radius: 16px; padding: 34px 32px; width: min(400px, 100%); }
.auth-card.wide { width: min(640px, 100%); }
.auth-card h1 { margin: 18px 0 6px; }
.auth-card h2 { margin: 26px 0 6px; font-size: 15px; }
.auth-card > p { margin: 0 0 20px; }

/* Markdown editor */
.EasyMDEContainer .CodeMirror { border-radius: 0 0 9px 9px; border-color: rgba(30,30,30,.18); font: 14px/1.6 Montserrat, sans-serif; }
.editor-toolbar { border-radius: 9px 9px 0 0; border-color: rgba(30,30,30,.18); }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .25s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
  .main { padding: 16px 16px 60px; }
  .menu-btn { display: inline-flex; margin-bottom: 12px; border: 1px solid var(--line); background: var(--card); border-radius: 8px; width: 40px; height: 40px; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; }
  .form-grid, .row, .media-detail { grid-template-columns: 1fr; }
  .form-grid > .field.half { grid-column: 1 / -1; }
  .hide-sm, .mini-thumb, .handle-col, .handle { display: none; }
  table.table td form.inline { flex-direction: column; align-items: flex-end; gap: 6px; }
  .panel { padding: 16px; overflow-x: auto; }
  .meta { grid-template-columns: 1fr; gap: 2px; }
  .meta dd { margin-bottom: 8px; }
  .page-head.sticky { position: static; }
}
