/* CC Club HQ — portal styles (extends the site design system in css/styles.css) */

.portal-body { background: var(--paper); min-height: 100vh; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 440px; }
.login-logo { height: 64px; width: auto !important; margin: 0 auto 10px; }
.setup-note {
  background: var(--sage); border: 1px solid var(--hairline); border-radius: 14px;
  padding: 16px 18px; margin-bottom: 20px; font-size: 14px;
}
.setup-note code { background: rgba(88,96,64,.1); padding: 1px 6px; border-radius: 6px; }

/* ---------- App shell (floating frosted bubble bar, matching the website) ---------- */
.hq { display: flex; flex-direction: column; min-height: 100vh; }
.hq-top {
  position: sticky; top: 12px; z-index: 50;
  margin: 12px auto 0;
  width: min(1360px, calc(100% - 28px));
  background: rgba(246, 244, 239, 0.72);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(88, 96, 64, 0.16);
  border-radius: 999px;
  box-shadow: 0 10px 34px rgba(60, 66, 41, 0.10);
  color: var(--ink);
  display: flex; align-items: center; gap: clamp(10px, 1.5vw, 18px);
  padding: 9px clamp(14px, 2vw, 24px);
  flex-wrap: nowrap;
}
.hq-top .brand { display: inline-flex; align-items: center; gap: 12px; flex: none; }
.hq-top .brand img { height: 38px; width: auto !important; }
.hq-title { font-family: var(--font-display); font-weight: 300; color: var(--olive-soft); font-size: 1.25rem; line-height: 1; white-space: nowrap; letter-spacing: 0.08em; }
.hq-tabs {
  display: flex; align-items: center; gap: 1px; flex: 1 1 auto;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
}
.hq-tabs::-webkit-scrollbar { display: none; }
.hq-tabs a {
  color: var(--olive);
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  white-space: nowrap;
  flex: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.hq-tabs a:hover { background: rgba(88, 96, 64, 0.08); }
.hq-tabs a.active { background: var(--olive); color: var(--chalk); }
.hq-top .signout {
  flex: none; margin-left: auto;
  border-color: var(--olive); color: var(--olive);
}
.hq-top .signout:hover { background: rgba(88, 96, 64, 0.72); border-color: rgba(88, 96, 64, 0.35); color: var(--chalk); }

@media (max-width: 880px) { .hq-top { top: 8px; } }

.hq-main { padding: clamp(24px, 4vw, 48px); max-width: 1100px; width: 100%; margin: 0 auto; }
.hq-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.hq-head h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin: 0; }
.hq-head .eyebrow-serif { font-size: 1.15rem; margin: 0; }



/* ---------- Cards, tables, stats ---------- */
.hq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.stat { background: var(--chalk); border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: 22px 24px; }
.stat .num { font-family: var(--font-display); font-size: 2.4rem; color: var(--olive); line-height: 1; }
.stat .lbl { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--olive-soft); font-weight: 600; margin-top: 6px; }

.hq-panel { background: var(--chalk); border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: clamp(18px, 3vw, 30px); margin-bottom: 22px; }
.hq-panel h2 { font-size: 1.5rem; margin-top: 0; }

.hq-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.hq-table th { text-align: left; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--olive-soft); padding: 10px 12px; border-bottom: 1px solid var(--hairline); }
.hq-table td { padding: 12px; border-bottom: 1px solid rgba(88,96,64,.12); vertical-align: top; }
.hq-table tr:hover td { background: rgba(88,96,64,.04); }
.table-scroll { overflow-x: auto; }

.tag-chip {
  display: inline-block; border: 1px solid var(--hairline); border-radius: 999px;
  padding: 2px 10px; font-size: 11.5px; letter-spacing: .06em; color: var(--olive);
  margin: 0 4px 4px 0; background: var(--sage);
}

/* ---------- Toolbar / forms ---------- */
.hq-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.hq-toolbar input[type="search"], .hq-toolbar input[type="text"], .hq-toolbar select { width: auto; flex: 1 1 200px; max-width: 320px; }
.btn-sm { padding: 11px 20px; font-size: 11.5px; }
.btn-danger { border-color: #a3512e; color: #a3512e; background: transparent; }
.btn-danger:hover { background: #a3512e; color: var(--chalk); }

/* ---------- Modal ---------- */
.hq-modal { border: none; border-radius: var(--radius-card); padding: 0; max-width: 560px; width: calc(100% - 32px); background: var(--chalk); }
.hq-modal::backdrop { background: rgba(44, 49, 37, 0.45); backdrop-filter: blur(4px); }
.hq-modal .modal-body { padding: clamp(22px, 4vw, 34px); }
.hq-modal h3 { margin-top: 0; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

/* ---------- Tasks / timeline ---------- */
.task-row { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid rgba(88,96,64,.12); }
.task-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--olive); }
.task-row.done .task-title { text-decoration: line-through; opacity: .55; }
.task-title { flex: 1; }
.task-due { font-size: 12.5px; color: var(--olive-soft); white-space: nowrap; }
.task-due.overdue { color: #a3512e; font-weight: 600; }

.timeline { position: relative; margin: 10px 0 0; padding-left: 26px; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 4px; bottom: 4px; width: 1px; background: var(--hairline); }
.timeline li { position: relative; padding: 0 0 22px; }
.timeline li::before {
  content: ""; position: absolute; left: -26px; top: 4px; width: 13px; height: 13px;
  border-radius: 50%; border: 2px solid var(--olive); background: var(--paper);
}
.timeline li.done::before { background: var(--olive); }
.timeline .tl-date { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--olive-soft); font-weight: 600; }
.timeline .tl-title { font-family: var(--font-display); font-size: 1.25rem; color: var(--olive); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(calc(100% + 30px));
  background: var(--olive-deep); color: var(--chalk); border-radius: 999px;
  padding: 13px 26px; font-size: 14px; transition: transform .3s ease; z-index: 300;
  max-width: min(92vw, 560px); text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { background: #7c3d20; }

/* ---------- Misc ---------- */
.empty-note { color: rgba(44,49,37,.55); font-style: italic; padding: 18px 6px; }
.hint { font-size: 13px; color: rgba(44,49,37,.6); }
.key-missing {
  background: var(--stone); border: 1px solid var(--hairline); border-radius: 14px;
  padding: 14px 16px; font-size: 13.5px; margin-bottom: 16px;
}

/* ---------- Visual photo picker ---------- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--paper);
}
.photo-grid .photo-pick {
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: none;
  aspect-ratio: 1;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.photo-grid .photo-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-grid .photo-pick:hover { transform: scale(1.03); }
.photo-grid .photo-pick.selected { border-color: var(--olive); box-shadow: 0 0 0 2px rgba(88, 96, 64, 0.25); }

/* ---------- Task board (drag & drop) ---------- */
.kanban { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
@media (max-width: 720px) { .kanban { grid-template-columns: 1fr; } }
.kanban-col {
  background: var(--paper);
  border: 1.5px dashed var(--hairline);
  border-radius: 16px;
  padding: 12px 14px;
  min-height: 150px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.kanban-col--done { background: rgba(224, 227, 213, 0.4); }
.kanban-col.drag-over { border-color: var(--olive); background: var(--sage); }
.kanban-title {
  font-family: var(--font-body);
  font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--olive-soft);
  margin: 4px 4px 8px;
}
.kanban .task-row { cursor: grab; background: var(--chalk); border: 1px solid rgba(88,96,64,.14); border-radius: 12px; margin-bottom: 8px; padding: 10px 12px; }
.kanban .task-row:active { cursor: grabbing; }
.kanban .task-row.dragging { opacity: 0.45; }

/* ---------- Themed dropdowns ---------- */
.cc-select { position: relative; width: 100%; }
.cc-select-native {
  position: absolute !important; width: 1px; height: 1px;
  opacity: 0; pointer-events: none; margin: 0; padding: 0; border: 0;
}
.cc-select-btn {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--chalk);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 15px 44px 15px 20px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s ease;
}
.cc-select-btn::after {
  content: "";
  position: absolute; right: 18px; top: 50%;
  width: 8px; height: 8px;
  border-right: 1.5px solid var(--olive);
  border-bottom: 1.5px solid var(--olive);
  transform: translateY(-70%) rotate(45deg);
}
.cc-select-btn:hover, .cc-select-btn[aria-expanded="true"] { border-color: var(--olive); }
.cc-select-menu {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--chalk);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  box-shadow: 0 14px 40px rgba(60, 66, 41, 0.16);
  padding: 6px;
  max-height: 260px;
  overflow-y: auto;
}
.cc-option {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14.5px;
  color: var(--ink);
  cursor: pointer;
}
.cc-option:hover { background: var(--sage); }
.cc-option.selected { background: var(--olive); color: var(--chalk); }
