/* Haizum admin portal: same palette and type as the website (coral accent on warm neutrals). */
@font-face { font-family: 'DM Sans'; src: url('fonts/dm-sans-latin-wght-normal.woff2') format('woff2'); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: 'Bricolage'; src: url('fonts/bricolage-grotesque-latin-wght-normal.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }

:root {
  --bg: #f4f1ee; --surface: #fff; --raised: #ebe6e1; --side: #262320;
  --ink: #262320; --ink-2: #575049; --ink-3: #807569;
  --line: rgba(38, 35, 32, 0.1); --line-strong: rgba(38, 35, 32, 0.22);
  --accent: #d2330f; --accent-hover: #b02a0b; --accent-ink: #b82b0a; --accent-soft: #fdf1ec; --accent-ring: rgba(210, 51, 15, 0.18);
  --ok: #1e7a35; --ok-soft: #e7f4ea; --warn: #8a6100; --warn-soft: #fff4d6; --info: #00639b; --info-soft: #e3f1fa;
  --r: 12px; --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font: 15px/1.55 'DM Sans', system-ui, sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: 'Bricolage', 'DM Sans', sans-serif; font-weight: 500; line-height: 1.2; }
h1 { font-size: 28px; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin-bottom: 12px; }
code { font: 13px ui-monospace, Menlo, monospace; background: var(--raised); padding: 1px 5px; border-radius: 4px; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid #00aaf8; outline-offset: 2px; }
[hidden] { display: none !important; }

/* shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--side); color: #d9d2cb; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 20px 12px 32px; }
.brand { display: block; background: #fff; border-radius: 10px; padding: 8px 12px; margin: 0 4px 16px; }
.brand img { display: block; height: 36px; width: auto; }
.side nav p { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #8f857b; margin: 18px 12px 6px; }
.side nav a { display: flex; align-items: center; justify-content: space-between; padding: 7px 12px; border-radius: 8px; color: #e8e2dc; font-size: 14px; }
.side nav a:hover { background: rgba(255, 255, 255, 0.06); text-decoration: none; }
.side nav a.on { background: var(--accent); color: #fff; }
.count { background: var(--accent); color: #fff; font-size: 12px; border-radius: 99px; padding: 0 7px; line-height: 20px; }
.side nav a.on .count { background: #fff; color: var(--accent-ink); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 16px; height: 60px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top .build { display: flex; align-items: center; gap: 10px; }
.top .user { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 14px; }
.menu-btn { display: none; }
.content { padding: 28px; max-width: 1240px; width: 100%; }

/* building blocks */
.head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 20px; }
.head h1 { margin-right: auto; display: flex; align-items: center; gap: 12px; }
.head .back { flex-basis: 100%; font-size: 14px; }
.head.sticky { position: sticky; top: 60px; z-index: 10; background: var(--bg); padding: 12px 0; margin: -12px 0 8px; }
.sub { color: var(--ink-2); margin: -12px 0 20px; max-width: 80ch; }
.head .sub { flex-basis: 100%; margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 24px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow-x: auto; }
.card.flush .tbl { min-width: 620px; }
.card.narrow { max-width: 520px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.grid .field:has(textarea), .grid .field:has(.rep), .grid .field.wide { grid-column: 1 / -1; }
.muted { color: var(--ink-3); }
.empty { color: var(--ink-3); padding: 20px; text-align: center; }
.r { text-align: right; }
.nowrap { white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hint { color: var(--ink-3); font-size: 13px; margin-top: 8px; }
.danger-zone, .danger-zone a { color: var(--ink-3); font-size: 14px; }
.danger-zone a:hover { color: var(--accent-ink); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; background: var(--accent); color: #fff; font: 500 14px 'DM Sans', sans-serif; cursor: pointer; transition: background-color 160ms var(--ease), border-color 160ms var(--ease); text-decoration: none !important; }
.btn:hover { background: var(--accent-hover); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn.line { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.line:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.btn.danger { background: #8f1d00; }
.link { background: none; border: 0; color: var(--accent-ink); font: inherit; cursor: pointer; }
.link:hover { text-decoration: underline; }

/* status pills */
.pill { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 99px; padding: 2px 10px; line-height: 18px; white-space: nowrap; }
.pill.new, .pill.pending { background: var(--warn-soft); color: var(--warn); }
.pill.running, .pill.contacted { background: var(--info-soft); color: var(--info); }
.pill.success, .pill.booked { background: var(--ok-soft); color: var(--ok); }
.pill.failed { background: var(--accent-soft); color: var(--accent-ink); }
.pill.closed { background: var(--raised); color: var(--ink-3); }

/* messages */
.msgs { margin-bottom: 16px; display: grid; gap: 8px; }
.msg { padding: 12px 16px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); }
.msg.error { background: var(--accent-soft); color: var(--accent-ink); }

/* tables and filters */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 16px; background: #faf8f6; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fcfaf8; }
.tbl tr.new td:first-child { box-shadow: inset 3px 0 var(--accent); }
.card .tbl td { padding-left: 0; }
.card.flush .tbl td { padding-left: 16px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.filters input[type=search] { min-width: 260px; }
.filters .n { margin-left: auto; color: var(--ink-3); font-size: 14px; }
.pager { margin-top: 12px; display: flex; gap: 16px; color: var(--ink-3); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; color: var(--ink); transition: border-color 160ms var(--ease); }
.stat:hover { border-color: var(--accent); text-decoration: none; }
.stat b { display: block; font: 500 28px 'Bricolage', sans-serif; }
.stat span { color: var(--ink-2); font-size: 14px; }
.stat.accent b { color: var(--accent-ink); }
.facts { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin: 16px 0; font-size: 14px; }
.facts dt { color: var(--ink-3); }
.message { white-space: pre-wrap; background: #faf8f6; border-radius: 10px; padding: 12px 14px; }
.plain { list-style: none; display: grid; gap: 4px; font-size: 14px; }
.log { font: 12px/1.5 ui-monospace, Menlo, monospace; background: #1f1c1a; color: #e9e3dc; padding: 16px; border-radius: 10px; max-height: 560px; overflow: auto; white-space: pre-wrap; }

/* form fields */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label { font-weight: 500; font-size: 14px; }
.field > label i { color: var(--accent); font-style: normal; }
.help { color: var(--ink-3); font-size: 13px; }
.err { color: var(--accent-ink); font-size: 13px; font-weight: 500; }
input[type=text], input[type=search], input[type=email], input[type=url], input[type=number], input[type=date], input[type=password], input[type=file], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 12px; width: 100%; min-height: 40px; transition: border-color 160ms var(--ease);
}
.filters input, .filters select { width: auto; }
textarea { resize: vertical; line-height: 1.55; }
textarea.md { font: 14px/1.6 ui-monospace, Menlo, monospace; min-height: 420px; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--accent); background: var(--accent-soft); }
.field.check label { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.counter { font-size: 12px; color: var(--ink-3); justify-self: end; margin-top: -2px; }
.counter.bad { color: var(--accent-ink); }
.counter.good { color: var(--ok); }

/* on/off switches (checkbox and list toggle) */
input.switch { appearance: none; width: 40px; height: 22px; border-radius: 99px; background: var(--line-strong); position: relative; cursor: pointer; transition: background-color 160ms var(--ease); flex: none; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 160ms var(--ease); }
input.switch:checked { background: var(--accent); }
input.switch:checked::after { transform: translateX(18px); }
.toggle { width: 40px; height: 22px; border: 0; border-radius: 99px; background: var(--line-strong); position: relative; cursor: pointer; transition: background-color 160ms var(--ease); }
.toggle span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 160ms var(--ease); }
.toggle.on { background: var(--accent); }
.toggle.on span { transform: translateX(18px); }

/* repeatable editors (lists, FAQs, sections) */
.rep { display: grid; gap: 8px; }
.rep .row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; background: #faf8f6; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.rep .row .stack { display: grid; gap: 8px; }
.rep .row .stack label { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }
.rep .tools { display: flex; gap: 2px; }
.rep .tools button { width: 30px; height: 30px; border: 1px solid transparent; border-radius: 8px; background: none; cursor: pointer; color: var(--ink-3); font-size: 15px; }
.rep .tools button:hover { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.rep .tools button.del:hover { color: var(--accent-ink); border-color: var(--accent); }
.rep .add { justify-self: start; background: none; border: 1px dashed var(--line-strong); border-radius: 10px; padding: 8px 14px; color: var(--accent-ink); font: 500 14px 'DM Sans', sans-serif; cursor: pointer; }
.rep .add:hover { border-color: var(--accent); background: var(--accent-soft); }
.rep.words { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.rep.words .row { padding: 6px; }
.rep.words .add { grid-column: 1 / -1; }
.rep .sub-list { padding-left: 12px; border-left: 2px solid var(--line); }

/* blog */
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.post { display: grid; grid-template-rows: 160px auto; padding: 0; overflow: hidden; color: var(--ink); transition: border-color 160ms var(--ease); }
.post:hover { border-color: var(--accent); text-decoration: none; }
.post img { width: 100%; height: 160px; object-fit: cover; }
.post div { padding: 14px 16px; }
.post h3 { font-size: 17px; margin: 4px 0; }
.post small { color: var(--ink-3); font-size: 13px; }
.blog-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.md-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.md-head h2 { margin: 0; }
.md-tools { display: flex; flex-wrap: wrap; gap: 4px; }
.md-tools button { height: 30px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); cursor: pointer; font: 13px 'DM Sans', sans-serif; color: var(--ink-2); }
.md-tools button:hover, .md-tools button[aria-pressed=true] { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.md-tools .sep { width: 8px; }
.md-preview { border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; min-height: 420px; }
.prose h2 { font-size: 22px; margin: 20px 0 8px; }
.prose h3 { font-size: 18px; margin: 16px 0 6px; }
.prose p, .prose ul, .prose ol { margin: 0 0 12px; }
.prose ul, .prose ol { padding-left: 22px; }
.cover-preview { width: 100%; height: 180px; object-fit: cover; border-radius: 10px; margin-bottom: 12px; }

/* photos */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.gallery .ph { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; color: var(--ink); font-size: 12px; transition: border-color 160ms var(--ease); }
.gallery .ph:hover { border-color: var(--accent); text-decoration: none; }
.gallery img { display: block; width: 100%; height: 120px; object-fit: cover; }
.gallery span { display: block; padding: 6px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
img.big { width: 100%; border-radius: 10px; margin-bottom: 8px; }

/* login */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 380px; display: grid; gap: 14px; padding: 32px; }
.login img { height: 44px; width: auto; }
.login label { display: grid; gap: 6px; font-weight: 500; font-size: 14px; }
.login .btn { margin-top: 4px; height: 44px; }

@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform 200ms var(--ease); }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.35); }
  .menu-btn { display: inline-flex; flex-direction: column; justify-content: center; gap: 4px; width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); padding: 0 10px; }
  .menu-btn span { height: 1.5px; background: var(--ink); }
  .cols, .blog-grid, .grid { grid-template-columns: 1fr; }
  .top { padding: 0 16px; gap: 10px; }
  .top .user a:first-child { display: none; }
  .content { padding: 20px 16px; }
  .filters input[type=search] { min-width: 0; flex: 1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
