/* Component styles for the Dashboard PWA.
 *
 * Phase 2 module split: every component rule below is carried over verbatim from the old
 * single-file index.html <style> block, EXCEPT the newly-added .tabbar / .tabbar__btn (bottom
 * icon nav, replaces the old top .tabBtn text nav), .card / .skeleton / .segmented, and the
 * .staleBanner. No palette / depth / font redesign here — that is Phase 5. */

/* ---------- bottom icon tab bar (new) ---------- */
#tabbar {
  flex: 0 0 auto;
  display: flex;
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
}
.tabbar__btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  padding: 8px 4px 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: .01em;
  cursor: pointer;
}
.tabbar__btn svg { width: 24px; height: 24px; display: block; }
.tabbar__btn.active { color: var(--accent); }

/* ---------- per-panel top bar ---------- */
.panelBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.panelBarTitle {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.panelBar button {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.panelBar button:hover { background: var(--panel); border-color: var(--accent); }
.panelBar button:disabled { opacity: 0.5; cursor: default; }

/* ---------- list items / cards ---------- */
.listItem, .card {
  display: block;
  padding: 12px 14px;
  margin: 8px 0;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: border-color .12s ease, background .12s ease;
}
a.listItem:hover, a.listItem:active,
a.card:hover, a.card:active,
.card[role="button"]:hover, .card[role="button"]:active,
.card[role="button"]:focus-visible {
  border-color: var(--accent);
  background: var(--panel-raised);
}
.card[role="button"] { cursor: pointer; }
.card[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card.isTapped { opacity: .6; }

.listItemTitle {
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.35;
}
.listItemMeta {
  font-size: 12px;
  color: var(--muted);
}

/* Warhammer feed cards with an image use a full-width top banner (news-feed style) instead of
   a side thumbnail. .listItem stays the shared card shell used by other tabs too. */
.listItem.hasBanner {
  padding: 0;
  overflow: hidden;
}
.listItemBanner {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--panel-raised);
}
.listItemBannerBody {
  padding: 12px 14px;
}

/* Warhammer "new since last visit" pill. */
.whNewPill {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 10.5px;
  font-weight: 700;
  vertical-align: middle;
}
.listItem.isNew { border-color: var(--accent); }

/* ---------- skeleton loader (new) ---------- */
.skeleton {
  margin: 8px 0;
  height: 64px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
  animation: skeletonSweep 1.3s ease-in-out infinite;
}
@keyframes skeletonSweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* ---------- segmented control (new) ---------- */
.segmented {
  display: flex;
  gap: 2px;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 2px;
  margin: 4px 2px 14px;
}
.segmented button {
  flex: 1;
  background: none;
  border: none;
  border-radius: 7px;
  padding: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  font-family: inherit;
  cursor: pointer;
}
.segmented button.active {
  background: var(--accent);
  color: var(--accent-text);
}

/* ---------- stale / info banner (new) ---------- */
.staleBanner {
  margin: 8px 0 4px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

/* ---------- headings ---------- */
.taskGroup { margin-bottom: 20px; }
.taskGroup h3, .notesHeading {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin: 16px 2px 6px;
  font-weight: 700;
}
.notesHeading { margin-top: 24px; }

/* ---------- inline forms ---------- */
.inlineForm {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 2px 4px;
}
.inlineForm input[type="text"],
.inlineForm input[type="number"] {
  flex: 1 1 140px;
  min-width: 0;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 13.5px;
  color: var(--text);
  font-family: inherit;
}
.inlineForm input::placeholder { color: var(--muted); }
.inlineForm input:focus { outline: none; border-color: var(--accent); }
.inlineForm input:disabled { opacity: .6; }
.inlineForm button[type="submit"] {
  flex: 0 0 auto;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-text);
  cursor: pointer;
  font-family: inherit;
}
.inlineForm button[type="submit"]:hover { opacity: .92; }
.inlineForm button[type="submit"]:disabled { opacity: .5; cursor: default; }

.inlineError {
  color: var(--error-text);
  font-size: 12px;
  margin: 0 2px 6px;
}
.inlineError:empty { display: none; }

.smallBtn {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.smallBtn:hover { background: var(--panel); border-color: var(--accent); }
.smallBtn:disabled { opacity: .5; cursor: default; }

/* ---------- due-date presets + picker ---------- */
.dueRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 2px 2px 2px;
}
.duePresetGroup {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.duePresetBtn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.duePickerInput {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--text);
  font-family: inherit;
  color-scheme: dark;
}
.duePickerInput:focus { outline: none; border-color: var(--accent); }
.duePickerInput:disabled { opacity: .5; }
.dueSummary {
  font-size: 12px;
  color: var(--muted);
  margin: 0 2px 6px;
  min-height: 1em;
}

/* ---------- task rows ---------- */
.taskRow {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.taskCheckbox {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}
.taskContent { flex: 1; min-width: 0; }

/* ---------- note rows ---------- */
.noteRow {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.noteViewWrap { flex: 1; min-width: 0; }
.noteBtnGroup { flex: 0 0 auto; display: flex; gap: 8px; }
.noteEditBtn { flex: 0 0 auto; }
.noteDeleteBtn {
  flex: 0 0 auto;
  color: var(--error-text);
  border-color: var(--error-border);
}
.noteDeleteBtn:hover { background: var(--error-bg); border-color: var(--error-text); }
.noteEditForm { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.noteEditForm input[type="text"] {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
}
.noteEditForm input[type="text"]:focus { outline: none; border-color: var(--accent); }
.noteEditBtnRow { display: flex; gap: 8px; }

/* ---------- error bubble ---------- */
.bubble.error {
  max-width: none;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
  font-size: 13.5px;
  line-height: 1.4;
}
.bubble.error details {
  margin-top: 8px;
  font-size: 12px;
}
.bubble.error a {
  color: var(--error-text);
  font-weight: 700;
}
.bubble.error.compact {
  font-size: 12.5px;
  padding: 10px 12px;
}

/* ---------- My Garage ---------- */
.garageProfileCard { cursor: pointer; }
.garageProfileCard:hover, .garageProfileCard:active, .garageProfileCard:focus-visible {
  border-color: var(--accent);
  background: var(--panel-raised);
}
.garageProfileCard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.garageProfileTitle {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.garageProfileHint {
  margin-top: 6px;
  color: var(--accent);
}
.garageBackBtn { margin-bottom: 14px; }
.garageDetailContent {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.garageDetailSection h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin: 0 0 6px;
  font-weight: 700;
}
.garageField {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  line-height: 1.4;
}
.garageField:last-child { border-bottom: none; }
.garageFieldLabel { color: var(--muted); flex: 0 0 auto; }
.garageFieldValue { text-align: right; flex: 1 1 auto; }
.garageNoteBlock {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
}
.garageMaintWork {
  font-size: 13.5px;
  color: var(--text);
  margin-top: 4px;
  line-height: 1.4;
}
