/* Wax Journal redactie dashboard — the one stylesheet for every page.
   Tokens mirror website/app/globals.css (taken from /login): white canvas, grey
   only as an inset rounded panel, near-black ink with a grey second tone, pill
   controls with a hairline outline. opening-hours.js reads the same variables. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:        #1f1d1e;
  --ink-muted:  #6b6b6b;
  --ink-subtle: #8a8a8a;
  --canvas:     #ffffff;
  --panel:      #ebebeb;
  --quiet:      #f5f5f5;               /* cards inside a panel, hover fills */
  --line:       rgba(31, 29, 30, 0.10);
  --line-md:    rgba(31, 29, 30, 0.25);
  --danger:     #d7425e;
  --danger-bg:  #fdf0f2;
  --danger-bd:  #f3c4ce;
  --ok:         #2f7a4f;
  --ok-bg:      #eef6f1;
  --ok-bd:      #c9e3d3;
  --warn:       #9a6412;
  --warn-bg:    #fbf4e8;
  --warn-bd:    #ecd9b4;

  --radius-panel: 28px;
  --radius-card:  20px;
  --radius-sm:    12px;
  --inset:        16px;
  --sidebar-w:    232px;
  --sidebar-w-collapsed: 64px;
  --shadow-md: 0 6px 20px rgba(31, 29, 30, 0.08);
  --shadow-lg: 0 16px 48px rgba(31, 29, 30, 0.16);

  /* Names opening-hours.js uses */
  --text-1: var(--ink);
  --text-2: var(--ink-muted);
  --text-3: var(--ink-subtle);
  --bg: var(--quiet);
  --surface: var(--canvas);
  --border: var(--line);
  --border-md: var(--line-md);
  --red: var(--danger);
  --red-bg: var(--danger-bg);
  --red-bd: var(--danger-bd);
  --green: var(--ok);
}

html, body { height: 100%; }

body {
  font-family: "Inter", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 3px; }

.muted { color: var(--ink-muted); }
.subtle { color: var(--ink-subtle); }
.hidden { display: none !important; }

.wj-wordmark { display: block; height: 20px; width: auto; }

/* ────────────────────────────────────────────
   SHELL: sidebar + main
──────────────────────────────────────────── */

.app { display: flex; height: 100vh; overflow: hidden; }

.main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  height: 100vh; overflow: hidden;
  margin-left: var(--sidebar-w);
  transition: margin-left 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
body.collapsed .main { margin-left: var(--sidebar-w-collapsed); }

.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--canvas);
  display: flex; flex-direction: column;
  z-index: 40;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
body.collapsed .sidebar { width: var(--sidebar-w-collapsed); }

.sb-head, .sb-nav, .sb-foot { overflow: hidden; width: 100%; }
body.collapsed .sb-nav, body.collapsed .sb-foot { overflow: visible; }

.sb-head { height: 64px; display: flex; align-items: center; gap: 8px; padding: 0 14px; flex-shrink: 0; }
.sb-wordmark { flex: 1; overflow: hidden; transition: opacity 0.15s; }
body.collapsed .sb-wordmark { opacity: 0; pointer-events: none; }

.icon-btn {
  all: unset;
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-muted); cursor: pointer;
  position: relative;
  transition: background 0.1s, color 0.1s;
}
.icon-btn:hover { background: var(--quiet); color: var(--ink); }
.icon-btn-danger:hover { background: var(--danger-bg); color: var(--danger); }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.icon-btn:focus-visible, .sb-btn:focus-visible, .filter-tab:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.sb-nav { flex: 1; padding: 8px 12px; overflow-y: auto; }
.sb-section {
  font-size: 12px; font-weight: 500; color: var(--ink-subtle);
  padding: 14px 12px 4px; white-space: nowrap;
  transition: opacity 0.15s;
}
body.collapsed .sb-section { opacity: 0; }

.sb-btn {
  all: unset; box-sizing: border-box;
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px; margin-bottom: 2px;
  border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--ink-muted);
  cursor: pointer; white-space: nowrap; position: relative;
  transition: background 0.1s, color 0.1s;
}
.sb-btn:hover { background: var(--quiet); color: var(--ink); }
.sb-btn.active { background: var(--panel); color: var(--ink); font-weight: 600; }
.sb-icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sb-label { flex: 1; transition: opacity 0.12s; }
body.collapsed .sb-label, body.collapsed .sb-badge { opacity: 0; }

.sb-badge {
  display: none;
  min-width: 20px; padding: 1px 6px;
  border-radius: 999px;
  background: var(--ink); color: #fff;
  font-size: 11px; font-weight: 600; text-align: center;
}
.sb-badge.on { display: inline-block; }

/* Tooltip, shown on the toggle and on nav items while collapsed */
.tip {
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 500;
  padding: 4px 10px; border-radius: 999px;
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity 0.1s 0.3s; z-index: 99;
}
.icon-btn:hover .tip, body.collapsed .sb-btn:hover .tip { opacity: 1; }

.sb-foot { border-top: 1px solid var(--line); padding: 10px 12px; flex-shrink: 0; }
.sb-profile {
  all: unset; box-sizing: border-box;
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 6px 8px; border-radius: 999px; cursor: pointer; overflow: hidden;
}
.sb-profile:hover { background: var(--quiet); }
.sb-avatar {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%;
  background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  display: flex; align-items: center; justify-content: center;
}
.sb-profile-info { flex: 1; overflow: hidden; transition: opacity 0.12s; }
body.collapsed .sb-profile-info { opacity: 0; }
.sb-email, .sb-role { display: block; }
.sb-email { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-role { font-size: 12px; color: var(--ink-subtle); }

/* Top bar and the grey working panel */
.topbar {
  height: 64px; flex-shrink: 0;
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px 0 8px;
}
.topbar-title { flex: 1; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }

.content {
  flex: 1; overflow-y: auto;
  background: var(--panel);
  border-radius: var(--radius-panel);
  margin: 0 var(--inset) var(--inset) 0;
  padding: 24px;
}

.state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 80px 20px;
  color: var(--ink-muted); text-align: center;
}

/* Segmented pills */
.filter-tabs, .status-toggle {
  display: flex; gap: 2px; width: fit-content;
  background: var(--canvas);
  border: 1px solid var(--line-md);
  border-radius: 999px; padding: 3px;
}
.filter-tab, .status-opt {
  all: unset; cursor: pointer; white-space: nowrap;
  padding: 7px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--ink-muted);
}
.filter-tab:hover, .status-opt:hover { color: var(--ink); }
.filter-tab.active, .status-opt.active { background: var(--ink); color: #fff; }

/* Pills */
.tag {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  padding: 3px 10px; border-radius: 999px;
  background: var(--canvas); color: var(--ink);
  border: 1px solid var(--line-md);
}
.tag-ok     { background: var(--ok-bg);     color: var(--ok);     border-color: var(--ok-bd); }
.tag-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-bd); }
.tag-warn   { background: var(--warn-bg);   color: var(--warn);   border-color: var(--warn-bd); }
button.tag { cursor: pointer; }
button.tag:hover { opacity: 0.75; }

.pill-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-wrap .tag { font-size: 13px; padding: 4px 12px; }

/* Buttons */
.btn {
  all: unset; box-sizing: border-box; cursor: pointer;
  height: 48px; padding: 0 22px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 999px;
  font-size: 14px; font-weight: 600; white-space: nowrap;
  background: var(--canvas); color: var(--ink);
  border: 1px solid var(--line-md);
  transition: background 0.1s, opacity 0.1s, border-color 0.1s, color 0.1s;
}
.btn:hover { background: var(--quiet); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: var(--ink); opacity: 0.85; }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger-bd); color: var(--danger); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }

/* Notices */
.notice {
  padding: 12px 16px; margin-bottom: 12px;
  border-radius: 16px; border: 1px solid;
  font-size: 13px;
}
.notice-warn   { background: var(--warn-bg);   border-color: var(--warn-bd);   color: var(--warn); }
.notice-danger { background: var(--danger-bg); border-color: var(--danger-bd); color: var(--danger); }

/* ────────────────────────────────────────────
   SIDE PANEL
──────────────────────────────────────────── */

.dim {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(31, 29, 30, 0.28);
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.dim.on { opacity: 1; pointer-events: all; }

.panel {
  position: fixed; z-index: 60;
  top: var(--inset); right: var(--inset); bottom: var(--inset);
  width: 540px; max-width: calc(100% - var(--inset) * 2);
  background: var(--canvas);
  border-radius: var(--radius-panel);
  overflow: hidden;
  display: flex; flex-direction: column;
  transform: translateX(calc(100% + var(--inset) * 2));
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.panel.on { transform: translateX(0); box-shadow: var(--shadow-lg); }
.panel-wide { width: 680px; }

.panel-hd {
  height: 64px; flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px 0 20px;
  border-bottom: 1px solid var(--line);
}
.panel-hd-badges { flex: 1; display: flex; align-items: center; gap: 6px; }
.panel-hd-title { flex: 1; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.panel-body { flex: 1; overflow-y: auto; padding: 24px; }
.panel-h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 6px; }
.panel-meta { color: var(--ink-muted); font-size: 13px; margin-bottom: 24px; }

.panel-ft {
  flex-shrink: 0; display: flex; gap: 10px;
  padding: 16px 20px; border-top: 1px solid var(--line);
}
.decided-note { flex: 1; text-align: center; padding: 12px; color: var(--ink-muted); }

/* Cards inside the panel */
.card {
  background: var(--quiet);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
}
.card-hd { padding: 16px 18px 0; font-size: 15px; font-weight: 600; }
.card-body { padding: 12px 18px 18px; }

.frow { display: flex; gap: 16px; padding: 8px 0; border-top: 1px solid var(--line); }
.frow:first-child { border-top: none; padding-top: 0; }
.frow:last-child { padding-bottom: 0; }
.flabel { width: 104px; flex-shrink: 0; padding-top: 2px; font-size: 12px; font-weight: 500; color: var(--ink-muted); }
.fval { flex: 1; min-width: 0; word-break: break-word; }
.fval a { text-decoration: underline; }

/* Old → new */
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.diff-was, .diff-becomes { border-radius: var(--radius-sm); padding: 10px 12px; border: 1px solid; }
.diff-was     { background: var(--danger-bg); border-color: var(--danger-bd); }
.diff-becomes { background: var(--ok-bg);     border-color: var(--ok-bd); }
.diff-lbl { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.diff-was .diff-lbl     { color: var(--danger); }
.diff-becomes .diff-lbl { color: var(--ok); }
.diff-val { word-break: break-word; }

.arr-sec + .arr-sec { margin-top: 10px; }
.arr-lbl { font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.arr-lbl.added   { color: var(--ok); }
.arr-lbl.removed { color: var(--danger); }
.arr-lbl.same    { color: var(--ink-subtle); }

.photo-preview {
  display: block; width: 160px; height: 160px; object-fit: cover;
  border-radius: 16px; margin-bottom: 12px;
}

/* ────────────────────────────────────────────
   INBOX (dashboard.html)
──────────────────────────────────────────── */

.group-hd { display: flex; align-items: center; gap: 8px; margin: 24px 0 8px; font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.group-hd:first-child { margin-top: 0; }
.group-count { background: var(--canvas); color: var(--ink-muted); font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; }

.ilist { display: flex; flex-direction: column; gap: 6px; }
.irow {
  all: unset; box-sizing: border-box;
  display: flex; align-items: center; gap: 12px;
  background: var(--canvas);
  border-radius: 16px; padding: 14px 18px;
  cursor: pointer;
  transition: box-shadow 0.1s;
}
.irow:hover { box-shadow: var(--shadow-md); }
.irow:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.irow.active { box-shadow: 0 0 0 1.5px var(--ink); }
.iinfo { flex: 1; min-width: 0; }
.ititle, .isub { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ititle { font-weight: 600; }
.isub { font-size: 13px; color: var(--ink-muted); }
.iright { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.idate { font-size: 12px; color: var(--ink-muted); }

/* ────────────────────────────────────────────
   VENUES (venues.html)
──────────────────────────────────────────── */

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-subtle); pointer-events: none; }
.search-input, .sort-select {
  height: 40px; padding: 0 14px;
  background: var(--canvas);
  border: 1px solid var(--line-md); border-radius: 999px;
  font-size: 13px; outline: none;
}
.search-input { width: 240px; padding-left: 36px; }
.search-input:focus, .sort-select:focus { border-color: var(--ink); }
.sort-select { cursor: pointer; }
.count-label { margin-left: auto; font-size: 13px; color: var(--ink-muted); }

.vtable-wrap { background: var(--canvas); border-radius: var(--radius-card); overflow: hidden; }
.vtable { width: 100%; border-collapse: collapse; }
.vtable th {
  padding: 12px 16px; text-align: left;
  font-size: 12px; font-weight: 500; color: var(--ink-muted);
  border-bottom: 1px solid var(--line);
}
.vtable td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.vtable tbody tr { cursor: pointer; }
.vtable tbody tr:last-child td { border-bottom: none; }
.vtable tbody tr:hover td { background: #f7f7f7; }
.vtable tbody tr.panel-open td { background: var(--quiet); }
.vtable .tag { margin: 1px 3px 1px 0; }
.venue-name { font-weight: 600; }
.venue-slug { font-size: 12px; color: var(--ink-subtle); font-family: ui-monospace, monospace; }
.geo-ok { color: var(--ok); font-weight: 600; }
.geo-miss { color: var(--danger); font-weight: 600; }

/* Edit form */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fg { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fg-full { grid-column: 1 / -1; }
.fg label, .field-label { font-size: 12px; font-weight: 500; color: var(--ink-muted); }
.fg input[type=text], .fg input[type=email], .fg input[type=tel], .fg input[type=number],
.fg input[type=time], .fg select, .fg textarea {
  width: 100%; padding: 9px 12px;
  background: var(--canvas);
  border: 1px solid var(--line-md); border-radius: var(--radius-sm);
  font-size: 14px; outline: none;
  transition: border-color 0.1s;
}
.fg textarea { resize: vertical; min-height: 88px; border-radius: 16px; }
.fg input:focus, .fg select:focus, .fg textarea:focus { border-color: var(--ink); }
.fg select { cursor: pointer; }
.fg-inline { display: flex; gap: 8px; align-items: flex-end; }
.fg-inline .fg { flex: 1; }
.field-status { font-size: 12px; min-height: 18px; color: var(--ink-muted); }
.field-status.ok { color: var(--ok); }
.field-status.error { color: var(--danger); }

.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.check-item { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check-item input { width: 15px; height: 15px; flex-shrink: 0; accent-color: var(--ink); cursor: pointer; }

#mapContainer { width: 100%; height: 260px; border-radius: 16px; overflow: hidden; }
.map-empty { display: flex; align-items: center; justify-content: center; height: 100%; background: var(--canvas); color: var(--ink-muted); font-size: 13px; }

.img-block + .img-block { margin-top: 18px; }
.img-block .field-label { display: block; margin-bottom: 8px; }
.profile-preview { display: block; width: 100%; max-width: 320px; border-radius: 16px; margin-bottom: 8px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.file-input { display: none; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 8px; }
.gallery-grid:empty { display: none; }
.gallery-item { position: relative; }
.gallery-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); }
.gallery-remove {
  all: unset; position: absolute; top: 6px; right: 6px;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(31, 29, 30, 0.7); color: #fff; font-size: 11px; cursor: pointer;
}

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; z-index: 100;
  transform: translateX(-50%) translateY(16px);
  background: var(--ink); color: #fff;
  font-size: 13px; font-weight: 500;
  padding: 10px 18px; border-radius: 999px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }

/* ────────────────────────────────────────────
   LOGIN (index.html)
──────────────────────────────────────────── */

.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; padding: 40px; border: 1px solid var(--line); border-radius: var(--radius-panel); }
.login-card .wj-wordmark { height: 24px; margin-bottom: 32px; }
.login-card h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 6px; }
.login-card .subtitle { color: var(--ink-muted); margin-bottom: 28px; }
.login-card .field { margin-bottom: 16px; }
.login-card label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.login-card input {
  width: 100%; height: 48px; padding: 0 20px;
  border: 1px solid var(--line-md); border-radius: 999px;
  outline: none; background: var(--canvas);
}
.login-card input:focus { border-color: var(--ink); }
.login-card input::placeholder { color: var(--ink-subtle); }
.login-card .btn { width: 100%; margin-top: 8px; }
.login-card .notice { display: none; margin-bottom: 20px; }
.login-card .notice.visible { display: block; }

/* ────────────────────────────────────────────
   MOBILE
──────────────────────────────────────────── */

.mob-bar {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  height: 60px; padding: 0 12px; gap: 8px; align-items: center;
  background: var(--canvas);
}
.mob-bar .wj-wordmark { height: 18px; }
.mob-dim {
  display: none; position: fixed; inset: 0; z-index: 70;
  background: rgba(31, 29, 30, 0.28);
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.panel-back { display: none; }

@media (max-width: 768px) {
  .sidebar {
    width: var(--sidebar-w) !important; z-index: 75;
    transform: translateX(-100%); transition: transform 0.22s ease;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sb-toggle { display: none; }
  body.collapsed .sb-wordmark, body.collapsed .sb-label, body.collapsed .sb-badge,
  body.collapsed .sb-section, body.collapsed .sb-profile-info { opacity: 1; }
  .mob-bar { display: flex; }
  .mob-dim { display: block; }
  .mob-dim.on { opacity: 1; pointer-events: all; }

  .main { margin-left: 0 !important; padding-top: 60px; }
  .topbar { height: auto; flex-direction: column; align-items: stretch; gap: 10px; padding: 8px 16px 12px; }
  .topbar-title { font-size: 20px; text-align: center; }
  .topbar .filter-tabs { align-self: center; }
  .content { margin: 0 8px 8px; padding: 16px; border-radius: var(--radius-card); }

  .irow { padding: 12px 14px; gap: 10px; }
  .idate { display: none; }

  .search-input { width: 100%; }
  .search-wrap { flex: 1 1 100%; }
  .vtable th:nth-child(3), .vtable td:nth-child(3),
  .vtable th:nth-child(4), .vtable td:nth-child(4),
  .vtable th:nth-child(6), .vtable td:nth-child(6) { display: none; }
  .vtable th, .vtable td { padding: 12px; }

  .panel { inset: 0; width: 100%; max-width: 100%; border-radius: 0; z-index: 90; transform: translateX(100%); }
  .panel-back {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
    padding: 14px 20px; border-bottom: 1px solid var(--line);
    color: var(--ink-muted); font-weight: 500; cursor: pointer;
  }
  .panel-close { display: none; }
  .diff-grid, .grid2 { grid-template-columns: 1fr; }
  .flabel { width: 88px; }
  .login-card { padding: 28px 24px; }
}
