/* Admin panel (admin.html). Layout only: colours, type, buttons, cards, inputs and the
   dialog all come from styles.css (Organic), so the admin looks like the site. */

body { margin: 0; background: #fdf6df; color: #201e1d; font-family: "Figtree", system-ui, sans-serif; }
[hidden] { display: none !important; }

.hc-top {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: 1180px; margin: 0 auto; padding: 14px 20px; box-sizing: border-box;
}
.hc-brand { display: flex; align-items: center; gap: 10px; margin-right: auto; text-decoration: none; color: inherit; }
.hc-brand img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: 50% 42%; }
.hc-brand span { font-family: 'Caprasimo', serif; font-size: 19px; line-height: 1; }
.hc-top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hc-top-actions .btn { min-height: 44px; padding: 0 16px; }
.hc-lang { font-family: 'Figtree', sans-serif !important; font-weight: 700 !important; font-size: 12px !important; letter-spacing: .06em; }

.hc-main { max-width: 1180px; margin: 0 auto; padding: 0 20px 64px; box-sizing: border-box; }
body.hc-has-bar .hc-main { padding-bottom: calc(132px + env(safe-area-inset-bottom)); }
.hc-muted { opacity: .7; font-size: 14px; }
.hc-sub { margin: 0; font-size: 13px; opacity: .75; }

.hc-dash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 0 16px; }
.hc-dash-head h1 { margin: 0 0 4px; font-size: clamp(28px, 4vw, 40px); }
.hc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.hc-stat { padding: 16px 18px; gap: 2px; }
.hc-stat b { font-family: 'Caprasimo', serif; font-weight: 400; font-size: 30px; line-height: 1.1; }
.hc-stat span { font-size: 12px; opacity: .7; }

.hc-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.hc-tabs a { min-height: 44px; padding: 0 20px; background: var(--color-neutral-100); }
.hc-tabs a[aria-current="page"] { background: var(--color-accent); }

.hc-row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.hc-row-head h2, .hc-row-head h3 { margin: 0; font-size: 22px; }
.hc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.hc-item { padding: 16px 18px; gap: 8px; }
.hc-item-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.hc-item-title { font-size: 17px; color: inherit; text-decoration: none; }
.hc-item-title:hover { text-decoration: underline; }
.hc-item-meta { font-size: 12px; opacity: .65; }
.hc-price { font-family: 'Caprasimo', serif; font-size: 18px; }
.hc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hc-actions .btn, .hc-btn { min-height: 44px; padding: 0 16px; }
.hc-danger { color: var(--color-accent-800) !important; }
.tag.hc-on { background: var(--color-accent-2-100); color: var(--color-accent-2-800); flex: none; }
.tag.hc-off { background: var(--color-neutral-200); color: var(--color-neutral-700); flex: none; }

/* editor */
.hc-editor { display: flex; flex-direction: column; gap: 18px; max-width: 900px; }
.hc-sec { padding: 20px 22px; gap: 14px; }
.hc-sec h3 { margin: 0; font-size: 18px; }
.hc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hc-cols > .wide { grid-column: 1 / -1; }
@media (max-width: 759px) { .hc-cols { grid-template-columns: 1fr; } .hc-sec { padding: 18px 16px; } }
.field .input { min-height: 44px; font-size: 16px; }
textarea.input { border-radius: 16px; min-height: 110px; padding-top: 10px; }
.input[aria-invalid="true"], [aria-invalid="true"].hc-pills { box-shadow: 0 0 0 2px var(--color-accent-800); border-radius: 16px; }
.hc-err { font-size: 13px; font-weight: 600; margin-top: 4px; color: var(--color-accent-800); }
.hc-hint { font-size: 12px; opacity: .7; margin-top: 4px; }
.hc-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.hc-pills .btn { min-height: 44px; padding: 0 18px; }
.hc-pills .btn[aria-pressed="true"] { background: var(--color-accent); }
.hc-zone-pill { border-left-width: 6px !important; border-left-style: solid !important; }
.hc-note { padding: 12px 16px; border-radius: 16px; font-size: 14px; background: var(--color-accent-2-100); color: var(--color-accent-2-800); display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.hc-note.err { background: var(--color-accent-200); color: var(--color-accent-800); }
.hc-map { border-radius: 20px; overflow: hidden; height: 320px; background: var(--color-accent-2-100); }
.hc-map iframe { width: 100%; height: 100%; border: 0; display: block; }
.hc-inc { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: start; }
@media (max-width: 759px) { .hc-inc { grid-template-columns: 1fr; } }
.hc-inc textarea.input { min-height: 64px; }
.hc-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.hc-photo { display: flex; flex-direction: column; gap: 6px; }
.hc-photo-img { aspect-ratio: 4/3; border-radius: 16px; background-color: var(--color-neutral-200); background-size: cover; background-position: center; }
.hc-photo .btn { min-height: 44px; }
.hc-photo-row { display: flex; gap: 6px; }
.hc-photo-row .btn-icon { width: 44px; height: 44px; }
.hc-file { min-height: 44px; padding-top: 10px; }
.hc-blocks { display: flex; flex-wrap: wrap; gap: 8px; }
.hc-block { font-family: ui-monospace, monospace; gap: 6px; min-height: 40px; padding-right: 4px; }
.hc-adv { align-self: flex-start; }
.hc-delete-row { display: flex; justify-content: flex-end; padding-top: 4px; }

/* sticky action bar: Save / Cancel stay under the thumb, with the result next to them */
.hc-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: #fffdf3; border-top: 1px solid rgba(32,30,29,.12);
  box-shadow: 0 -4px 14px rgba(46,43,37,.12);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.hc-bar-in { max-width: 900px; margin: 0 auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hc-bar .btn { min-height: 48px; padding: 0 22px; font-size: 15px; }
.hc-bar-status { flex: 1 1 180px; font-size: 14px; font-weight: 600; min-height: 20px; }
.hc-bar-status.ok { color: var(--color-accent-2-800); }
.hc-bar-status.err { color: var(--color-accent-800); }
.hc-bar-status.busy { opacity: .75; }

.hc-toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  z-index: 90; max-width: min(92vw, 520px); padding: 12px 18px; border-radius: 16px;
  background: var(--color-neutral-900); color: #fff; font-size: 15px; font-weight: 600;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.hc-toast.show { opacity: 1; transform: translate(-50%, 0); }
.hc-toast.err { background: var(--color-accent-800); }

.hc-overlay { z-index: 80; }
.hc-login { max-width: 440px; margin: 40px auto; display: flex; flex-direction: column; gap: 16px; }
.hc-login img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; object-position: 50% 42%; margin: 0 auto; }
.hc-login form, .hc-overlay form { padding: 28px; gap: 14px; background: var(--color-neutral-100); }
.hc-login h1, .hc-overlay h2 { font-size: 26px; margin: 0; }
.hc-alert { font-size: 13px; font-weight: 600; padding: 10px 14px; border-radius: 16px; background: var(--color-accent-200); color: var(--color-accent-800); }
.dialog-actions { flex-wrap: wrap; }
.dialog-actions .btn { min-height: 44px; padding: 0 18px; }

.hc-inq-text { margin: 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.hc-inq-about { font-size: 12px; font-weight: 600; color: var(--color-accent-700); }
.hc-mono { font-family: ui-monospace, monospace; font-size: 12px; opacity: .75; }
.hc-clause { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: start; }
@media (max-width: 759px) { .hc-clause { grid-template-columns: 1fr; } }
.hc-clause .btn-icon, .hc-item .btn-icon { width: 44px; height: 44px; }
