/* Content admin. Uses the website's own fonts and colours (Barlow Condensed, Roboto, #c23788, #ed4c2f). */
:root {
  --pink: #c23788;
  --pink-dark: #911360;
  --orange: #ed4c2f;
  --ink: #232323;
  --muted: #6b6b6b;
  --line: #e4e1dc;
  --soft: #f7f7f3;
  --white: #fff;
  --ok: #1f7a46;
  --warn: #9a5b00;
  --bad: #b3261e;
  --radius: 6px;
  --shadow: 0 2px 2px 0 rgba(0,0,0,.08), 0 1px 5px 0 rgba(0,0,0,.08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 Roboto, Arial, sans-serif; color: var(--ink); background: var(--soft); }
h1, h2, h3, h4 { font-family: 'Barlow Condensed', Arial, sans-serif; font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: .2px; }
h1 { font-size: 30px; } h2 { font-size: 24px; } h3 { font-size: 19px; }
a { color: var(--pink); }
button, input, select, textarea { font: inherit; color: inherit; }
.boot, .noscript { padding: 60px 20px; text-align: center; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--pink); background: var(--pink); color: #fff; padding: 8px 16px; border-radius: var(--radius); cursor: pointer; font-weight: 500; text-decoration: none; white-space: nowrap; transition: background .2s, color .2s; }
.btn:hover { background: var(--pink-dark); border-color: var(--pink-dark); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.secondary { background: #fff; color: var(--pink); }
.btn.secondary:hover { background: #fbeef5; }
.btn.plain { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.plain:hover { background: #fff; }
.btn.danger { background: #fff; border-color: #e6b8b4; color: var(--bad); }
.btn.danger:hover { background: #fdf0ef; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.orange { background: var(--orange); border-color: var(--orange); }
:focus-visible { outline: 3px solid rgba(194,55,136,.45); outline-offset: 2px; }

/* layout */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: #fff; border-bottom: 3px solid var(--pink); padding: 10px 24px; position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; font-family: 'Barlow Condensed', sans-serif; font-size: 22px; font-weight: 600; color: var(--ink); text-decoration: none; }
.brand img { height: 38px; width: auto; }
.brand small { color: var(--muted); font-size: 16px; font-weight: 500; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.nav a, .nav button { background: none; border: 0; padding: 8px 12px; border-radius: var(--radius); color: var(--ink); text-decoration: none; cursor: pointer; font-weight: 500; }
.nav a.active, .nav a:hover, .nav button:hover { background: #fbeef5; color: var(--pink-dark); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 24px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.head-row h1 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* auth screens */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: 100%; max-width: 440px; }
.auth .logo { display: block; height: 60px; margin: 0 auto 14px; }
.auth h1 { text-align: center; }
.auth p { margin: 0 0 14px; }
.steps { padding-left: 20px; margin: 0 0 16px; }
.steps li { margin-bottom: 4px; }

/* forms */
.field { margin-bottom: 16px; }
.field > label, .label { display: block; font-weight: 500; margin-bottom: 5px; }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.req::after { content: ' *'; color: var(--pink); }
input[type=text], input[type=password], input[type=url], input[type=date], input[type=search], input[type=number], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #cfcac2; border-radius: var(--radius); background: #fff; min-height: 40px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--pink); outline: none; box-shadow: 0 0 0 3px rgba(194,55,136,.15); }
.has-error input, .has-error select, .has-error textarea, .has-error .rte { border-color: var(--bad) !important; }
.err { color: var(--bad); font-size: 13px; margin-top: 4px; }
.counter { float: right; font-size: 12px; color: var(--muted); font-weight: 400; }
.counter.over { color: var(--bad); font-weight: 700; }
.counter.near { color: var(--warn); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline > input, .inline > select { flex: 1 1 160px; width: auto; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.notice { border-left: 4px solid var(--pink); background: #fbeef5; padding: 10px 14px; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 16px; }
.notice.ok { border-color: var(--ok); background: #eaf6ef; }
.notice.bad { border-color: var(--bad); background: #fdf0ef; }
.notice.warn { border-color: var(--warn); background: #fff6e5; }
.address { font-family: Consolas, Menlo, monospace; font-size: 13px; background: var(--soft); border: 1px dashed var(--line); padding: 6px 8px; border-radius: 4px; word-break: break-all; }
details.adv > summary { cursor: pointer; font-weight: 500; margin-bottom: 8px; }
fieldset { border: 0; padding: 0; margin: 0; }

/* dashboard */
.filters { display: grid; grid-template-columns: 2fr repeat(3, 1fr) 1fr 1fr auto; gap: 8px; margin-bottom: 14px; align-items: end; }
.filters label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 2px; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 8px; border-bottom: 2px solid var(--line); }
table.list td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:hover td { background: #fcfbf9; }
.thumb { width: 72px; height: 44px; object-fit: cover; border-radius: 4px; background: var(--soft); display: block; }
.thumb.none { display: grid; place-items: center; font-size: 11px; color: var(--muted); }
.t-title { font-weight: 500; }
.t-sub { font-size: 12px; color: var(--muted); word-break: break-all; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill.published { background: #e3f4ea; color: var(--ok); }
.pill.draft { background: #eee; color: #555; }
.pill.unpublished { background: #fff1d6; color: var(--warn); }
.pill.old { background: #eef1fb; color: #3c50a8; }
.actions { display: flex; gap: 4px; flex-wrap: wrap; }
.pager { display: flex; gap: 6px; justify-content: center; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.menu { position: relative; display: inline-block; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0,0,0,.12); min-width: 220px; z-index: 30; padding: 6px; }
.menu-list button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: 4px; cursor: pointer; }
.menu-list button:hover { background: #fbeef5; }
.menu-list small { display: block; color: var(--muted); }

/* item form */
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.side .card { padding: 16px; }
.side h3 { margin-bottom: 10px; }
.status-line { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.btn-col { display: grid; gap: 8px; }
.preview-img { display: block; max-width: 100%; max-height: 180px; border-radius: 4px; border: 1px solid var(--line); margin-top: 8px; background: var(--soft); }
.logo-preview { height: 30px; width: auto; max-width: 120px; object-fit: contain; border: 1px solid var(--line); border-radius: 4px; padding: 3px; background: #fff; }
.drop { border: 2px dashed #cfcac2; border-radius: var(--radius); padding: 14px; text-align: center; background: #fcfbf9; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--pink); background: #fbeef5; }
.files { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.files li { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; background: #fff; }
.files .ficon { width: 60px; height: 44px; object-fit: cover; border-radius: 4px; background: var(--soft); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--bad); }
.files .fname { flex: 1; font-size: 13px; word-break: break-all; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; background: #fcfbf9; }
.faq-item .inline { justify-content: space-between; margin-bottom: 6px; }
.toast { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast div { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.toast div.bad { background: var(--bad); }
.toast div.ok { background: var(--ok); }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(20,20,20,.45); z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: 8px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal .btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* rich text editor */
.rte { border: 1px solid #cfcac2; border-radius: var(--radius); background: #fff; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: #fcfbf9; border-radius: var(--radius) var(--radius) 0 0; position: sticky; top: 62px; z-index: 5; }
.rte-bar button, .rte-bar select { border: 1px solid transparent; background: none; border-radius: 4px; min-width: 32px; height: 32px; padding: 0 7px; cursor: pointer; font-size: 14px; }
.rte-bar select { border-color: var(--line); background: #fff; min-width: 120px; width: auto; min-height: 32px; padding: 0 6px; }
.rte-bar button:hover { background: #fbeef5; border-color: #efc6dd; }
.rte-bar button.on { background: #f6d9e9; border-color: #e6a9cb; }
.rte-bar .sep { width: 1px; background: var(--line); margin: 4px 4px; }
.rte-tablebar { display: none; flex-wrap: wrap; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); background: #fff6e5; font-size: 13px; align-items: center; }
.rte-tablebar.show { display: flex; }
.rte-tablebar button { border: 1px solid #e8d3a8; background: #fff; border-radius: 4px; padding: 3px 8px; cursor: pointer; font-size: 13px; }
.rte-area { min-height: 360px; padding: 16px 18px; outline: none; overflow-wrap: anywhere; }
.rte-area:empty::before { content: attr(data-placeholder); color: #9a9a9a; }
.rte-area h2 { font-size: 26px; margin: 1em 0 .4em; } .rte-area h3 { font-size: 21px; margin: 1em 0 .4em; } .rte-area h4 { font-size: 18px; margin: 1em 0 .4em; }
.rte-area blockquote { border-left: 4px solid var(--pink); margin: 1em 0; padding: 4px 14px; color: #444; background: #fcfbf9; }
.rte-area pre { background: #2b2b2b; color: #f5f5f5; padding: 12px 14px; border-radius: 4px; overflow-x: auto; white-space: pre-wrap; font-family: Consolas, Menlo, monospace; font-size: 13px; }
.rte-area mark { background: #fff2a8; }
.rte-area hr { border: 0; border-top: 2px solid var(--line); margin: 1.5em 0; }
.rte-area table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.rte-area th, .rte-area td { border: 1px solid #999; padding: 6px 8px; min-width: 40px; vertical-align: top; }
.rte-area th { background: #bf3385; color: #fff; }
.rte-area caption { caption-side: top; font-weight: 600; padding: 4px; text-align: left; }
.rte-area td.sel, .rte-area th.sel { outline: 2px solid var(--orange); outline-offset: -2px; }
.rte-area img { max-width: 100%; height: auto; }
.rte-area iframe { width: 100%; aspect-ratio: 16/9; border: 0; display: block; pointer-events: none; background: #eee; }
.rte-area .rte-embed-wrap { position: relative; margin: 1em 0; }
.rte-html { width: 100%; min-height: 360px; border: 0; border-radius: 0 0 var(--radius) var(--radius); font-family: Consolas, Menlo, monospace; font-size: 13px; padding: 14px; display: none; }
.rte.html-mode .rte-area { display: none; }
.rte.html-mode .rte-html { display: block; }
.rte-foot { display: flex; justify-content: space-between; padding: 4px 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

@media (max-width: 1000px) {
  .form-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .grow { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .wrap { padding: 16px; }
  .top { padding: 8px 16px; }
  .brand small { display: none; }
  .row2 { grid-template-columns: 1fr; }
  table.list thead { display: none; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; width: 100%; }
  table.list tr { display: grid; grid-template-columns: 80px 1fr; gap: 2px 10px; border-bottom: 1px solid var(--line); padding: 10px 0; }
  table.list td { border: 0; padding: 2px 0; }
  table.list td.c-thumb { grid-row: span 4; }
  table.list td.c-type::before { content: 'Type: '; color: var(--muted); }
  table.list td.c-date::before { content: 'Date: '; color: var(--muted); }
  .rte-bar { top: 0; position: static; }
  .card { padding: 14px; }
}
