/* ==========================================================================
   styles.css — how everything LOOKS (shared by the board and the dashboard)
   --------------------------------------------------------------------------
   Styled with the Click4Time brand guide:
     • Open Sans throughout
     • teal (#46b3d1) is the brand colour: the hero band, large titles, accents
     • deep steel blue (#31708f) for buttons, links and anything that must be
       easy to read (the brand teal is too light for small text, per the guide)
     • flat colour, no shadows or gradients; 8px buttons, 5px inputs, 10px cards
   The "--c4t-…" values below are the brand tokens. The other variables map
   them to jobs (e.g. --link), so changing one line restyles everything.
   ========================================================================== */

:root {
  /* ---- Click4Time brand tokens (from the brand guide) ---- */
  --c4t-teal-500:  #46b3d1;  /* brand teal */
  --c4t-blue-700:  #31708f;  /* deep steel blue (accessible partner) */
  --c4t-green-500: #29ae5f;  /* green accent */
  --c4t-gray-700:  #555555;  /* readable body text */
  --c4t-gray-600:  #777777;  /* light grey (decoration only, too light for text) */
  --c4t-gray-300:  #dddddd;  /* borders */
  --c4t-gray-100:  #eeeeee;  /* input fill */
  --c4t-gray-50:   #f7f7f7;  /* light fills */
  --c4t-white:     #ffffff;

  /* ---- What each colour is used for ---- */
  --page:       var(--c4t-white);
  --surface:    var(--c4t-white);
  --ink:        var(--c4t-gray-700);   /* body text */
  --heading:    var(--c4t-blue-700);   /* small headings that must be readable */
  --muted:      var(--c4t-gray-700);   /* secondary text: same colour, smaller size */
  --line:       var(--c4t-gray-300);
  --brand:      var(--c4t-teal-500);   /* large titles, bands, decoration */
  --action:     var(--c4t-blue-700);   /* buttons, links, the vote you've cast */
  --on-brand:   var(--c4t-white);
  --danger:     #b42318;               /* errors and delete (not in the guide; kept for safety) */

  /* Status dots (always shown next to their name, so colour is never the only clue) */
  --s-under_review: var(--c4t-gray-600);
  --s-planned:      var(--c4t-blue-700);
  --s-in_progress:  var(--c4t-teal-500);
  --s-done:         var(--c4t-green-500);
  --s-not_planned:  var(--c4t-gray-300);

  /* Shapes and spacing (brand tokens) */
  --radius-input:  5px;
  --radius-button: 8px;
  --radius-card:   10px;
  --space-2: 8px;  --space-4: 16px;  --space-6: 24px;  --space-12: 48px;

  --font: "Open Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 24px;
}

h1, h2, h3 { line-height: 1.2; margin: 0; }
a { color: var(--action); }
button, input, select, textarea { font: inherit; color: inherit; }

/* Visible keyboard focus everywhere: solid 2px steel blue, as the guide specifies. */
:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
/* Bot-trap fields: moved off-screen so people never see or tab into them */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.turnstile:empty { display: none; }
.turnstile { margin: 4px 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 20px; }

/* ---------- Header with the Click4Time logo ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .wrap, .topbar .wrap-wide { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 76px; }
/* Logo: never stretched, at least 120px wide, with clear space around it. */
.logo { display: flex; align-items: center; gap: 14px; padding: 14px 0; text-decoration: none; }
.logo img { width: 150px; height: auto; display: block; }
.logo .product { font-weight: 600; color: var(--heading); font-size: 15px; padding-left: 14px; border-left: 1px solid var(--line); }

/* ---------- Buttons (brand Button component, accessible variant) ---------- */
.btn {
  display: inline-block; border: 1px solid rgba(0, 0, 0, 0.05); border-radius: var(--radius-button);
  padding: 13px 30px; cursor: pointer; font-size: 16px; line-height: 20.8px; font-weight: 700;
  text-decoration: none; background: var(--c4t-gray-50); color: var(--c4t-gray-700);
}
.btn:hover { background: var(--c4t-gray-100); }
.btn-primary { background: var(--action); color: var(--on-brand); }
.btn-primary:hover { background: #285d77; }
.btn-danger { color: var(--danger); }
.btn-small { padding: 9px 18px; font-size: 15px; }
.btn-link { border: 0; background: none; padding: 0; color: var(--action); cursor: pointer; font-weight: 600; text-align: left; }
.btn-link:hover { text-decoration: underline; }
.btn:disabled { opacity: .55; cursor: default; }

/* ---------- Form fields (grey fill, light border, 5px corners) ---------- */
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-input);
  background: var(--c4t-gray-100); padding: 10px 12px; font-size: 16px;
}
textarea { resize: vertical; min-height: 88px; }
input:focus, select:focus, textarea:focus { background: var(--surface); border-color: var(--action); outline: 2px solid var(--action); outline-offset: 0; }
.field { margin-bottom: 16px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.error { color: var(--danger); font-size: 14px; margin: 8px 0 0; }

/* ---------- Hero: the teal band with the italic display headline ---------- */
.hero-band { background: var(--brand); color: var(--on-brand); }
.hero-band .wrap { padding-top: 48px; padding-bottom: 44px; }
.hero-band h1 { font-size: clamp(34px, 6vw, 48px); line-height: 1.2; font-weight: 400; font-style: italic; max-width: 100%; }

/* The steel-blue message band under the hero */
.message-band { background: var(--c4t-blue-700); color: var(--on-brand); }
.message-band p { margin: 0; padding: 18px 0; font-size: 17px; line-height: 26px; max-width: 100%; }

/* ---------- Suggestion form ---------- */
.suggest-section { padding: 32px 0 0; }
.suggest-section h2 { font-size: 24px; line-height: 33.6px; font-weight: 700; color: var(--heading); margin-bottom: 12px; }
.suggest { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 20px; }
.suggest .title-input { font-size: 18px; padding: 14px 16px; }
.suggest .more { margin-top: 16px; }
.suggest-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* "Already suggested?" box shown while typing */
.similar-hint { margin-top: 14px; border-left: 4px solid var(--brand); padding: 4px 0 4px 14px; }
.similar-hint h3 { font-size: 16px; font-weight: 700; color: var(--heading); margin-bottom: 6px; }
.similar-hint ul { list-style: none; margin: 0; padding: 0; }
.similar-hint li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; }
.similar-hint li + li { border-top: 1px solid var(--line); }

/* ---------- Toolbar (sort + filters) ---------- */
.list-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin: 40px 0 14px; }
.list-head h2 { font-size: 24px; line-height: 38.4px; font-weight: 600; letter-spacing: 0.96px; color: var(--brand); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 14px; }
.tabs { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-button); overflow: hidden; }
.tabs button { border: 0; background: var(--surface); padding: 8px 16px; cursor: pointer; font-weight: 600; color: var(--ink); }
.tabs button + button { border-left: 1px solid var(--line); }
.tabs button[aria-pressed="true"] { background: var(--action); color: var(--on-brand); }
.toolbar select { width: auto; padding: 8px 10px; font-size: 15px; }
.toolbar input[type=search] { flex: 1 1 180px; padding: 8px 12px; font-size: 15px; }

/* ---------- Idea list ---------- */
.ideas { list-style: none; margin: 0 0 64px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-card); }
.idea { display: flex; gap: 18px; padding: 18px; align-items: flex-start; }
.idea + .idea { border-top: 1px solid var(--line); }
.idea-body { flex: 1; min-width: 0; }
.idea-title { font-size: 18px; line-height: 26px; font-weight: 700; color: var(--heading); margin: 2px 0 4px; }
.idea-title button { all: unset; cursor: pointer; }
.idea-title button:hover { text-decoration: underline; }
.idea-title button:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.idea-desc { margin: 0 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 14px; line-height: 20px; }
.empty { padding: 40px 16px; text-align: center; }

/* The vote button: the signature element of the board. A teal top edge marks
   it as a Click4Time control; once you vote it fills with steel blue. */
.vote {
  flex: none; width: 66px; padding: 8px 0 6px; border: 1px solid var(--line); border-top: 4px solid var(--brand);
  border-radius: var(--radius-card); background: var(--surface); color: var(--heading); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; transition: background .15s, color .15s;
}
.vote:hover { background: var(--c4t-gray-50); }
.vote .arrow { width: 14px; height: 10px; color: var(--brand); }
.vote .count { font-weight: 700; font-size: 24px; line-height: 30px; }
.vote .word { font-size: 12px; line-height: 16px; color: var(--ink); }
.vote[aria-pressed="true"] { background: var(--action); border-color: var(--action); color: var(--on-brand); }
.vote[aria-pressed="true"] .arrow, .vote[aria-pressed="true"] .word { color: var(--on-brand); }
.vote.bump .count { animation: bump .3s ease-out; }
@keyframes bump { 40% { transform: scale(1.2); } }
.vote-sm { width: auto; flex-direction: row; gap: 6px; padding: 4px 12px; border-top-width: 1px; border-radius: var(--radius-button); }
.vote-sm .count { font-size: 16px; line-height: 22px; }

/* Status labels + category tags */
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--dot, var(--c4t-gray-600)); }
.tag { border: 1px solid var(--line); border-radius: 999px; padding: 0 10px; font-size: 13px; }

/* ---------- Dialogs (pop-up windows): flat, no shadow ---------- */
dialog {
  border: 0; border-top: 6px solid var(--brand); border-radius: var(--radius-card); padding: 0;
  width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); color: var(--ink);
}
dialog::backdrop { background: rgba(49, 112, 143, 0.6); }
.dialog-inner { padding: 24px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.dialog-head h2 { font-size: 24px; line-height: 33.6px; font-weight: 700; color: var(--heading); }
.close { border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer; color: var(--ink); padding: 0 4px; }
.detail-top { display: flex; gap: 16px; align-items: flex-start; }
.detail-top h2 { margin-bottom: 6px; }
.detail-desc { white-space: pre-wrap; margin: 16px 0; }
.dialog-inner h3 { font-size: 18px; font-weight: 700; color: var(--heading); }

.comments { list-style: none; padding: 0; margin: 12px 0 18px; }
.comment { padding: 12px 0; border-top: 1px solid var(--line); }
.comment-name { font-weight: 700; }
.comment.team { background: var(--c4t-gray-50); border-left: 4px solid var(--brand); padding-left: 12px; }
.comment .badge { font-size: 12px; font-weight: 700; color: var(--heading); margin-left: 6px; }
.comment p { margin: 4px 0 0; white-space: pre-wrap; }

/* After-submit result: the big number of people who asked for something similar */
.result-count { font-size: 64px; font-weight: 700; line-height: 1; color: var(--heading); margin: 16px 0 4px; }
.result-count + p { margin-top: 0; }

/* ---------- Toast (small confirmation message) ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--c4t-blue-700); color: var(--on-brand);
  padding: 12px 20px; border-radius: var(--radius-button); font-weight: 600; z-index: 50; max-width: calc(100vw - 32px);
}

/* ---------- Phones ---------- */
@media (max-width: 560px) {
  .row-2 { grid-template-columns: 1fr; }
  .hero-band .wrap { padding-top: 32px; padding-bottom: 32px; }
  .idea { gap: 12px; padding: 14px 12px; }
  .vote { width: 56px; }
  .logo img { width: 124px; }
  .logo .product { display: none; }
  .list-head h2 { font-size: 26px; }
  .btn { padding: 12px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ==========================================================================
   ADMIN DASHBOARD styles (admin.html)
   ========================================================================== */
.wrap-wide { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.topbar nav { display: flex; gap: 8px; flex-wrap: wrap; }
.topbar nav .btn { padding: 9px 18px; font-size: 15px; }
.admin-band { background: var(--brand); color: var(--on-brand); }
.admin-band h1 { font-size: 32px; line-height: 1.2; font-weight: 400; font-style: italic; padding: 22px 0; margin: 0; }

.login { max-width: 400px; margin: 10vh auto; border: 1px solid var(--line); border-top: 6px solid var(--brand); border-radius: var(--radius-card); padding: 28px; }
.login img { width: 150px; display: block; margin-bottom: 20px; }
.login h1 { font-size: 24px; font-weight: 700; color: var(--heading); margin-bottom: 6px; }

.section { margin: 36px 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h2 { font-size: 32px; line-height: 38.4px; font-weight: 600; letter-spacing: 0.96px; color: var(--brand); }
.section-head h3 { color: var(--heading); }

/* Stat tiles: big number, plain label underneath */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; }
.stat { background: var(--surface); padding: 16px 18px; border-top: 4px solid var(--brand); }
.stat .num { font-size: 34px; font-weight: 700; line-height: 1.15; color: var(--heading); }
.stat .lbl { font-size: 14px; font-weight: 600; }
.stat .sub { font-size: 13px; }

.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 20px; }
.panel h3 { font-size: 18px; font-weight: 700; color: var(--heading); margin-bottom: 12px; }

/* Simple horizontal bar list: label + value in text, a thin teal bar for size */
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: 140px 1fr 40px; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; }
.bars .track { display: block; height: 10px; background: var(--c4t-gray-100); border-radius: 4px; overflow: hidden; }
.bars .fill { display: block; height: 100%; background: var(--brand); border-radius: 0 4px 4px 0; min-width: 2px; }
.bars .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--heading); }

/* Table of suggestions */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius-card); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; font-weight: 700; background: var(--c4t-gray-50); white-space: nowrap; color: var(--ink); }
th button { all: unset; cursor: pointer; color: var(--action); }
th button:hover { text-decoration: underline; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
td .votes { font-weight: 700; font-size: 20px; color: var(--heading); }
td select { padding: 6px 8px; font-size: 14px; min-width: 140px; }
.trend { color: #1f7a45; font-size: 13px; font-weight: 600; white-space: nowrap; }

.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cat-list input { flex: 1; }
.inline-form { display: flex; gap: 8px; margin-top: 12px; }
.inline-form input { flex: 1; }

.voters { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-input); }
.voters table { font-size: 14px; }
.danger-zone { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--line); }
.danger-zone .field { flex: 1 1 240px; margin: 0; }
dialog.wide { width: min(780px, calc(100vw - 32px)); }

@media (max-width: 760px) {
  .panels { grid-template-columns: 1fr; }
  .bars li { grid-template-columns: 110px 1fr 36px; }
  .section-head h2 { font-size: 26px; }
}

/* Moderation queue */
.switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; cursor: pointer; margin: 0; }
.switch input { width: 18px; height: 18px; accent-color: var(--action); }
.review-list { list-style: none; margin: 0; padding: 0; }
.review-item { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); }
.review-item:first-child { border-top: 0; padding-top: 0; }
.review-item strong { color: var(--heading); }
.review-item p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-actions { display: flex; gap: 8px; flex: none; flex-wrap: wrap; }
.review-actions .btn { padding: 9px 18px; font-size: 15px; }
.flag { display: inline-block; font-size: 12px; font-weight: 700; color: var(--danger); border: 1px solid currentColor; border-radius: 999px; padding: 0 8px; margin-left: 6px; }
@media (max-width: 560px) { .review-item { flex-direction: column; } }
