/* Dashboard Portal - The Belgian Waffle Co theme.
   Brand palette (BWC): Sunglow Yellow #FFC10E, Burnt Orange #9D5C2F,
   Chocolate Brown #442619, Glazed Butter #FFFCD5, Day Glow Orange #F05A35,
   Summer Blue #84D5F7, Vibrant Grape #8C3E97.
   No external assets/fonts are referenced (app Content-Security-Policy safe). */

:root {
  /* brand */
  --yellow: #ffc10e;
  --burnt: #9d5c2f;
  --choc: #442619;
  --butter: #fffcd5;
  --orange: #f05a35;
  --blue: #84d5f7;
  --grape: #8c3e97;

  /* semantic */
  --bg: #fbf6ea;          /* soft warm cream page */
  --panel: #ffffff;
  --panel-soft: #fffdf7;
  --ink: #4a3326;         /* warm brown body text */
  --head: #442619;        /* chocolate headings */
  --muted: #9a8b7c;       /* warm taupe */
  --line: #ece0cc;        /* warm border */
  --line-soft: #f4ecdc;
  --accent: #9d5c2f;      /* links / secondary */
  --danger: #e24a27;
  --danger-ink: #ffffff;

  --radius: 14px;
  --radius-sm: 9px;
  --focus: 0 0 0 3px rgba(255, 193, 14, 0.45);
  --shadow-sm: 0 1px 2px rgba(68, 38, 25, 0.06), 0 2px 6px rgba(68, 38, 25, 0.05);
  --shadow: 0 4px 14px rgba(68, 38, 25, 0.07), 0 14px 34px rgba(68, 38, 25, 0.06);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background-color: var(--bg);
  /* Whisper-soft waffle grid + warm glow; soothing, not busy. */
  background-image:
    radial-gradient(1200px 500px at 50% -10%, rgba(255, 193, 14, 0.10), transparent 70%),
    repeating-linear-gradient(45deg, rgba(157, 92, 47, 0.035) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(-45deg, rgba(157, 92, 47, 0.035) 0 1px, transparent 1px 34px);
  background-attachment: fixed;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- Top bar ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.7rem 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(1.2) blur(6px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-sub {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--burnt);
  border-left: 1px solid var(--line);
  padding-left: 0.7rem;
}
.topbar nav { display: flex; align-items: center; gap: 0.35rem; margin-left: auto; flex-wrap: wrap; }
.topbar nav a {
  text-decoration: none;
  color: var(--head);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.topbar nav a:hover { background: var(--butter); color: var(--burnt); }
.who {
  margin-left: 0.4rem;
  font-size: 0.82rem;
  color: var(--head);
  background: var(--butter);
  border: 1px solid #f0e7b8;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------------- Layout ---------------- */
.container { max-width: 1120px; margin: 2rem auto; padding: 0 1.5rem; }

h1 { font-size: 1.34rem; margin: 0 0 1.1rem; color: var(--head); letter-spacing: -0.015em; font-weight: 700; }
h2 { font-size: 1.02rem; margin: 1.4rem 0 0.75rem; color: var(--head); letter-spacing: -0.01em; }
p { margin: 0 0 0.9rem; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  margin-bottom: 1.6rem;
  box-shadow: var(--shadow-sm);
}
.card.narrow { max-width: 470px; }

/* ---------------- Forms ---------------- */
label { display: block; margin-bottom: 0.9rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.62rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: var(--panel-soft);
  color: var(--ink);
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--burnt);
  background: #fff;
  box-shadow: var(--focus);
}
.row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.row label { flex: 1 1 180px; margin-bottom: 0; }

/* ---------------- Buttons ---------------- */
button {
  font-family: inherit;
  padding: 0.6rem 1.05rem;
  border: 1px solid var(--choc);
  background: var(--choc);
  color: #fff7e9;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s, box-shadow 0.15s;
}
button:hover { background: var(--burnt); border-color: var(--burnt); box-shadow: var(--shadow-sm); }
button:active { transform: translateY(1px); }
button:focus-visible { outline: none; box-shadow: var(--focus); }
button.danger { background: var(--danger); border-color: var(--danger); color: var(--danger-ink); }
button.danger:hover { background: #c83d1c; border-color: #c83d1c; }
button.link {
  background: none; border: none; color: var(--accent);
  padding: 0.4rem 0.5rem; font-weight: 600; cursor: pointer;
}
button.link:hover { background: none; color: var(--choc); text-decoration: underline; box-shadow: none; }

.btn {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--burnt);
  border-radius: var(--radius-sm);
  color: var(--burnt);
  background: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn:hover { background: var(--butter); box-shadow: var(--shadow-sm); }

.inline { display: inline; margin: 0; }
form.inline select { width: auto; display: inline-block; margin: 0; }

/* compact role editor: dropdown + Update button on one line */
.role-form { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; }
.role-form select { width: auto; margin: 0; padding: 0.4rem 0.5rem; }
.role-form button { padding: 0.4rem 0.75rem; font-size: 0.82rem; }
.role-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--butter);
  border: 1px solid #f0e7b8;
  color: var(--head);
  font-size: 0.82rem;
  font-weight: 600;
}
.muted-note { color: var(--muted); }

/* "who can see this" count badge */
.viewers-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--butter);
  border: 1px solid #f0e7b8;
  color: var(--burnt);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s;
}
.viewers-badge svg { width: 14px; height: 14px; }
.viewers-badge:hover { background: #fbf2cf; border-color: #e6d68f; }
.viewers-badge.zero { background: var(--panel-soft); border-color: var(--line); color: var(--muted); }

/* builder + draft UI */
.source-pick { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.7rem 0.9rem; margin-bottom: 0.9rem; }
.source-pick legend { font-size: 0.85rem; font-weight: 600; color: var(--muted); padding: 0 0.4rem; }
label.radio { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; color: var(--ink); margin-bottom: 0.4rem; }
label.radio input { width: auto; display: inline-block; margin: 0; }
.draft-tag {
  display: inline-block; vertical-align: middle; margin-left: 0.5rem;
  padding: 0.12rem 0.55rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--yellow); color: var(--choc);
}
.draft-actions { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.refine-card { margin-top: 1.2rem; }
.suggest-card { margin-top: 1.2rem; }
.suggest-item { display: block; padding: 0.45rem 0.2rem; border-bottom: 1px solid var(--line-soft); font-size: 0.92rem; color: var(--ink); }
.suggest-item:last-child { border-bottom: none; }
.suggest-item input { width: auto; display: inline-block; margin: 0 0.5rem 0 0; vertical-align: middle; }
#suggest-extra { margin-top: 0.8rem; }
.spinner {
  display: inline-block; width: 14px; height: 14px; vertical-align: -2px;
  border: 2px solid #e7d8b6; border-top-color: var(--burnt); border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* SQL builder */
.btn-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0.8rem 0; }
.sql-result { padding: 0.6rem 0.8rem; border-radius: var(--radius-sm); font-size: 0.88rem; margin-bottom: 0.9rem; }
.sql-result.ok { background: var(--butter); border: 1px solid #f0e7b8; color: var(--head); }
.sql-result.err { background: #fde7df; border: 1px solid #f6c3b2; color: #b23a1e; }
#sql-schema h3 { font-size: 0.95rem; margin: 1rem 0 0.5rem; }
.sql-tables { display: flex; flex-direction: column; gap: 0.4rem; max-height: 320px; overflow: auto; padding: 0.4rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-soft); }
.tbl-card { border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.tbl-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.45rem 0.6rem; }
.tbl-pick { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-size: 0.9rem; color: var(--ink); cursor: pointer; min-width: 0; }
.tbl-pick input { width: auto; display: inline-block; margin: 0; flex: 0 0 auto; }
.tbl-pick strong { color: var(--head); overflow-wrap: anywhere; }
.tbl-toggle { display: inline-flex; align-items: center; gap: 0.3rem; background: var(--butter); border: 1px solid #f0e7b8; color: var(--burnt); border-radius: 999px; padding: 0.2rem 0.6rem; font-size: 0.78rem; font-weight: 600; cursor: pointer; white-space: nowrap; flex: 0 0 auto; }
.tbl-toggle:hover { background: #fbf2cf; }
.tbl-toggle .chev { display: inline-block; transition: transform 0.15s; font-size: 0.7rem; }
.tbl-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.tbl-cols { display: flex; flex-wrap: wrap; gap: 0.3rem; padding: 0.1rem 0.6rem 0.6rem; }
.tbl-cols[hidden] { display: none; }
.col-chip { display: inline-flex; align-items: baseline; gap: 0.3rem; background: var(--panel-soft); border: 1px solid var(--line); border-radius: 6px; padding: 0.15rem 0.45rem; font-size: 0.8rem; color: var(--ink); }
.col-chip em { font-style: normal; color: var(--muted); font-size: 0.72rem; text-transform: lowercase; }
.join-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.join-row select { width: auto; margin: 0; min-width: 200px; }
.join-row select.jtype { min-width: 130px; flex: 0 0 auto; background: var(--butter); border-color: #f0e7b8; font-weight: 600; color: var(--burnt); }

/* custom join column picker: searchable, collapsible-by-table dropdown */
.colpick { position: relative; flex: 1 1 210px; min-width: 200px; }
.colpick-btn {
  width: 100%; text-align: left; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 0.5rem 0.6rem; font-size: 0.88rem; color: var(--ink);
  cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.colpick-btn:hover { border-color: var(--burnt); }
.colpick-panel {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; min-width: 230px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 0.4rem; max-height: 280px; overflow: auto;
}
.colpick-search { width: 100%; margin: 0 0 0.4rem; padding: 0.4rem 0.5rem; font-size: 0.85rem; }
.cp-table { border-bottom: 1px solid var(--line-soft); }
.cp-table:last-child { border-bottom: none; }
.cp-thead {
  display: flex; align-items: center; gap: 0.4rem; width: 100%; text-align: left;
  background: none; border: none; padding: 0.4rem 0.3rem; font-weight: 700; color: var(--head);
  cursor: pointer; font-size: 0.85rem;
}
.cp-thead:hover { background: var(--panel-soft); }
.cp-arrow { display: inline-block; transition: transform 0.15s; color: var(--burnt); font-size: 0.72rem; }
.cp-thead[aria-expanded="true"] .cp-arrow { transform: rotate(90deg); }
.cp-count { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 0.75rem; }
.cp-cols { display: flex; flex-direction: column; padding: 0 0 0.3rem 1rem; }
.cp-cols[hidden] { display: none; }
.cp-col {
  text-align: left; background: none; border: none; padding: 0.3rem 0.4rem; border-radius: 6px;
  font-size: 0.84rem; color: var(--ink); cursor: pointer;
}
.cp-col:hover { background: var(--butter); color: var(--burnt); }
.cp-col em { font-style: normal; color: var(--muted); font-size: 0.74rem; }
.cp-empty { color: var(--muted); font-size: 0.85rem; padding: 0.4rem; }
.join-row span { color: var(--muted); font-weight: 700; }
.tbl-filter { margin-bottom: 0.5rem; }
.tbl-filter input { margin: 0; max-width: 320px; }

/* ---------------- Tables ---------------- */
.grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.grid th, .grid td {
  text-align: left;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  font-size: 0.9rem;
}
.grid thead th {
  background: var(--butter);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--burnt);
  border-bottom: 1px solid #f0e7b8;
}
.grid tbody tr:last-child td { border-bottom: none; }
.grid tbody tr:hover td { background: #fffaf0; }

.matrix-scroll { overflow-x: auto; border-radius: var(--radius); }
.matrix .rowhead { white-space: nowrap; font-weight: 700; color: var(--head); }
.matrix .cell { text-align: center; }
.matrix button { padding: 0.35rem 0.7rem; font-size: 0.82rem; }
.matrix button.granted { background: var(--choc); border-color: var(--choc); color: #fff7e9; }
.matrix button.granted:hover { background: var(--burnt); border-color: var(--burnt); }
.matrix button.revoked { background: #fff; color: var(--muted); border-color: var(--line); }
.matrix button.revoked:hover { background: var(--butter); color: var(--burnt); border-color: var(--burnt); }

/* ---------- Access mapping (vertical, per-dashboard cards) ---------- */
.lede { color: var(--ink); max-width: 72ch; }
.access-toolbar { display: flex; align-items: center; gap: 0.8rem; margin: 0.2rem 0 1rem; flex-wrap: wrap; }
.access-toolbar input[type="search"] { flex: 1 1 260px; max-width: 440px; margin: 0; }
.access-list { display: flex; flex-direction: column; gap: 0.6rem; }

.acard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.acard[open] { box-shadow: var(--shadow); border-color: #e6d6b8; }
.acard-head {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.8rem 1rem; cursor: pointer; list-style: none; user-select: none;
}
.acard-head::-webkit-details-marker { display: none; }
.acard-head::marker { content: ''; }
.acard-head:hover { background: #fffaf0; }
.acard-main { display: flex; flex-direction: column; gap: 0.12rem; min-width: 0; flex: 1 1 auto; }
.acard-title { font-weight: 700; color: var(--head); font-size: 1.02rem; }
.acard-owner { font-size: 0.78rem; color: var(--muted); }
.acard-count {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.2rem 0.6rem; border-radius: 999px;
  background: var(--butter); border: 1px solid #f0e7b8; color: var(--burnt);
  font-size: 0.8rem; font-weight: 700; white-space: nowrap;
}
.acard-count svg { width: 14px; height: 14px; }
.acard-count.zero { background: var(--panel-soft); border-color: var(--line); color: var(--muted); }
.acard-chev { width: 16px; height: 16px; color: var(--muted); transition: transform 0.18s; flex: 0 0 auto; }
.acard[open] .acard-chev { transform: rotate(90deg); }

.acard-body { padding: 0.2rem 1rem 0.85rem; border-top: 1px solid var(--line-soft); }
.acard-body .userfilter { margin: 0.7rem 0 0.4rem; }
.acard-body .userfilter input { margin: 0; max-width: 380px; }

.grantlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.grantrow {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.55rem 0.25rem; border-bottom: 1px solid var(--line-soft);
}
.grantrow:last-child { border-bottom: none; }
.grantrow.on { background: linear-gradient(90deg, rgba(255, 193, 14, 0.07), transparent 55%); }
.gr-user { display: flex; flex-direction: column; gap: 0.05rem; min-width: 0; }
.gr-name { font-weight: 600; color: var(--ink); }
.gr-meta { font-size: 0.76rem; color: var(--muted); }

.access-toggle { min-width: 96px; padding: 0.4rem 0.85rem; font-size: 0.84rem; font-weight: 700; border-radius: 999px; }
.access-toggle.on { background: var(--choc); border-color: var(--choc); color: #fff7e9; }
.access-toggle.on:hover { background: var(--danger); border-color: var(--danger); }
.access-toggle.off { background: #fff; color: var(--burnt); border-color: var(--burnt); }
.access-toggle.off:hover { background: var(--butter); }

.builder-access { margin-top: 1.6rem; }

/* ---------------- Misc UI ---------------- */
.viewbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.viewbar-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.frame-wrap {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}
.frame-wrap iframe { display: block; width: 100%; height: 78vh; border: 0; }

.error {
  background: #fde7df;
  border: 1px solid #f6c3b2;
  border-left: 4px solid var(--orange);
  color: #b23a1e;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}
.notice {
  background: var(--butter);
  border: 1px solid #f0e7b8;
  border-left: 4px solid var(--yellow);
  color: var(--head);
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}
code {
  background: #f3ead9;
  color: var(--choc);
  padding: 0.12rem 0.4rem;
  border-radius: 5px;
  font-size: 0.92em;
}

/* ---------------- My dashboards: filter bar + tiles ---------------- */
.filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.25rem;
}
.filter-field { display: flex; flex-direction: column; gap: 0.3rem; }
.filter-field label { margin: 0; font-size: 0.78rem; }
.filter-field input, .filter-field select { margin: 0; min-width: 230px; }
.filter-count { margin-left: auto; align-self: center; color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.no-results { color: var(--muted); padding: 1.2rem 0.2rem; }

/* KPI stat strip (premium summary cards) */
.statstrip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.4rem;
}
.stat {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0.8rem 0.95rem;
  box-shadow: var(--shadow-sm);
}
.stat-ic {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--si-bg, linear-gradient(135deg, var(--butter), #fff));
  color: var(--si, var(--burnt));
  border: 1px solid var(--si-bd, #f0e7b8);
}
.stat-ic svg { width: 19px; height: 19px; }
.stat-val { font-size: 1.3rem; font-weight: 800; color: var(--head); line-height: 1; letter-spacing: -0.01em; }
.stat-lbl { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-top: 0.28rem; font-weight: 600; }
.stat.s1 { --si: #9d5c2f; --si-bg: linear-gradient(135deg, #fbeede, #fff); --si-bd: #ecdcc7; }
.stat.s2 { --si: #3aa6d8; --si-bg: linear-gradient(135deg, #e3f4fc, #fff); --si-bd: #cfeaf7; }
.stat.s3 { --si: #c98a00; --si-bg: linear-gradient(135deg, #fff6da, #fff); --si-bd: #f0e7b8; }
.stat.s4 { --si: #8c3e97; --si-bg: linear-gradient(135deg, #f6e9f8, #fff); --si-bd: #ecd5ef; }

/* compact, premium dashboard tiles */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
  gap: 0.7rem;
}
.tile {
  --tile-accent: var(--burnt);
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.8rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.tile::before {
  content: "";
  position: absolute;
  left: 0; top: 9px; bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--tile-accent);
}
.tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #e3d6bf;
}
.tile-badge {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 800; color: #fff;
  background: var(--tile-accent);
  box-shadow: inset 0 -2px 5px rgba(0, 0, 0, 0.14);
}
.tile-body { min-width: 0; display: flex; flex-direction: column; gap: 0.12rem; }
.tile-title {
  font-size: 0.94rem; font-weight: 700; color: var(--head); line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile-meta {
  font-size: 0.75rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile-owner { color: var(--burnt); font-weight: 600; }
.tile-go {
  margin-left: auto; flex: 0 0 auto;
  color: var(--muted); font-size: 1.35rem; line-height: 1; font-weight: 400;
  transition: transform 0.12s ease, color 0.12s ease;
}
.tile:hover .tile-go { color: var(--tile-accent); transform: translateX(2px); }

/* per-tile accent colours (rotated) */
.tile.c-yellow { --tile-accent: #e3a307; }
.tile.c-burnt  { --tile-accent: #9d5c2f; }
.tile.c-orange { --tile-accent: #f05a35; }
.tile.c-blue   { --tile-accent: #3aa6d8; }
.tile.c-grape  { --tile-accent: #8c3e97; }
.tile.c-choc   { --tile-accent: #442619; }

@media (max-width: 560px) {
  .filter-field input, .filter-field select { min-width: 0; width: 100%; }
  .filter-field { flex: 1 1 100%; }
  .filter-count { margin-left: 0; }
}

.footer { text-align: center; color: var(--muted); padding: 2.5rem 0 2rem; font-size: 0.85rem; }

/* ---------------- Auth (login / reset) ---------------- */
body.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}
.auth-main { margin: 0; padding: 0; width: 100%; max-width: 430px; }
.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2.3rem 2.1rem 2rem;
  box-shadow: var(--shadow);
  text-align: center;
}
.auth-card .badge { width: 104px; height: auto; margin: 0 auto 1rem; display: block; }
.auth-card h1 { text-align: center; margin-bottom: 0.25rem; }
.auth-card .lead { color: var(--muted); margin-bottom: 1.5rem; font-size: 0.95rem; }
.auth-card form { text-align: left; }
.auth-card label { color: var(--head); }
.auth-card button[type="submit"] { width: 100%; margin-top: 0.4rem; padding: 0.7rem; font-size: 1rem; }
.auth-foot { margin-top: 1.4rem; color: var(--muted); font-size: 0.78rem; }
body.auth .footer { display: none; }
