/* ── Design tokens ─────────────────────────────────────── */
:root {
  --bg: #f4f5f7;
  --card: #fff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d1d5db;
  --radius: 16px;
  --green: #22c55e;
  --red: #fca5a5;
  --blue: #3b82f6;
  --dark: #111827;
}

/* ── Reset ──────────────────────────────────────────────── */
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; background: var(--bg); color: var(--text); }

/* ── Base ───────────────────────────────────────────────── */
.logo { font-size: 20px; font-weight: 700; color: var(--text); text-decoration: none; }
.back-link { display: inline-block; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; margin-top: 2px; }
.back-link:hover { text-decoration: underline; }
#auth-check { text-align: center; padding: 60px 20px; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }

/* ── Form ───────────────────────────────────────────────── */
label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 4px; margin-top: 14px; }
label:first-of-type { margin-top: 0; }
input { width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px; }
textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; resize: vertical; font-family: inherit; }

/* ── Messages ───────────────────────────────────────────── */
.msg { font-size: 14px; padding: 10px 12px; border-radius: 10px; }
.msg.ok  { background: #ecfdf5; color: #166534; }
.msg.err { background: #fef2f2; color: #991b1b; }

/* ── Topbar & hamburger ─────────────────────────────────── */
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.hamburger { position: relative; }
.ham-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--border); background: var(--card);
  border-radius: 10px; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
}
.ham-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 6px; min-width: 140px;
  display: none; z-index: 50; box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.ham-menu.open { display: flex; flex-direction: column; gap: 2px; }
.ham-menu button {
  width: 100%; text-align: left; padding: 10px 12px;
  border: none; background: transparent; font-size: 14px;
  font-weight: 600; cursor: pointer; border-radius: 8px; color: var(--text);
}
.ham-menu button:hover { background: var(--bg); }
.ham-menu .logout { color: #dc2626; }

/* ── Semantic buttons ───────────────────────────────────── */
.btn-primary { background: var(--dark); color: #fff; }
.btn-ghost   { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-danger  { background: #dc2626; color: #fff; }
.btn-success { background: #16a34a; color: #fff; }
.btn-row     { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ── Badges ─────────────────────────────────────────────── */
.badge-open     { background: #fef2f2; color: #991b1b; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; }
.badge-resolved { background: #ecfdf5; color: #166534; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; }

/* ── Board list ─────────────────────────────────────────── */
.board-list-row          { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; align-items: center; }
.board-list-row:last-child { border-bottom: none; }
.board-list-thumb        { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.board-list-thumb-empty  { width: 48px; height: 48px; border-radius: 8px; flex-shrink: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.board-list-body         { flex: 1; min-width: 0; }
.board-list-cat          { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.board-list-text         { font-size: 13px; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.board-list-meta         { font-size: 11px; color: var(--muted); margin-top: 3px; }
.board-empty             { font-size: 13px; color: var(--muted); text-align: center; padding: 12px 0; }

/* ── Bottom sheet ───────────────────────────────────────── */
#backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); align-items: flex-end;
  justify-content: center; z-index: 100; padding: 12px;
}
.sheet-content {
  background: #fff; border-radius: 22px 22px 12px 12px;
  padding: 22px; width: 100%; max-width: 480px;
  max-height: 88vh; overflow-y: auto;
}
.sheet-content h3   { margin: 0 0 10px; font-size: 20px; }
.sheet-info         { color: var(--muted); font-size: 15px; margin-bottom: 14px; line-height: 1.5; }
.sheet-ok           { background: #ecfdf5; color: #166534; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 14px; }
.sheet-warn         { background: #fef9c3; color: #854d0e; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 14px; }
.sheet-actions      { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.sheet-cancel       { padding: 13px; border: 1px solid var(--border); background: #f3f4f6; border-radius: 14px; font-size: 15px; font-weight: 700; cursor: pointer; }
.sheet-confirm      { padding: 13px; border: none; background: var(--dark); color: #fff; border-radius: 14px; font-size: 15px; font-weight: 700; cursor: pointer; }
.sheet-confirm:disabled { opacity: .4; cursor: not-allowed; }
.sheet-confirm.danger   { background: #dc2626; }
.sheet-select       { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; margin-bottom: 10px; background: var(--card); }
.sheet-textarea     { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; margin-bottom: 10px; resize: vertical; min-height: 90px; font-family: inherit; box-sizing: border-box; }
.sheet-img-preview  { width: 100%; max-height: 140px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; display: none; }
.sheet-img-btn      { width: 100%; padding: 10px; border: 1px dashed var(--border); background: var(--bg); border-radius: 10px; font-size: 13px; cursor: pointer; margin-bottom: 10px; color: var(--muted); font-weight: 600; }
.sheet-radio-group  { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sheet-radio-label  { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--bg); }
.sheet-radio-label:has(input:checked) { border-color: var(--dark); background: var(--card); font-weight: 600; }
