@import url("./styles/management-auth.css");

:root {
  --bg: #e7e4dc;
  --card: #fbfaf6;
  --muted-ink: #8a8577;
  --accent-soft: #e3ebf5;
  --border: #ece7db;
  --danger: #9e3f1e;

  --t308-navy: #16294a;
  --t308-navy-accent: #1b3a6b;
  --t308-red: #c0392b;
  --t308-green: #4a7a3a;
  --t308-body-text: #3d4436;
  --t308-rail-bg: #f6f4ee;
  --t308-border-soft: #e6e0d2;

  /* --ink/--accent/--meeting/--camping/--service/--other/--leadership were
     separately-declared tokens carrying the exact same hex values as the
     --t308-* set above (e.g. --ink and --t308-navy were both #16294a).
     Aliasing them here means every existing var(--ink) etc. call site keeps
     working untouched, but there is now one place - the --t308-* line - that
     defines each actual color. */
  --ink: var(--t308-navy);
  --accent: var(--t308-navy-accent);
  --meeting: var(--t308-navy-accent);
  --leadership: var(--t308-navy-accent);
  --camping: var(--t308-red);
  --service: var(--t308-green);
  --other: var(--t308-green);

  /* Previously-hardcoded colors that repeated across 2-3 unrelated rules
     (meeting/band-main tags, camping/band-campouts tags, the
     service/leadership/band-308b "crimson" tag family, and the protected/
     leadership light-pink card backgrounds). Tokenized so they can't drift
     apart by accident; not a color change. */
  --tag-blue-bg: #dbe9fb;
  --tag-blue-text: #0d3f79;
  --tag-green-bg: #def4e6;
  --tag-green-text: #14532d;
  --tag-red-bg: #ffe3e8;
  --tag-red: #9f1239;
  --danger-soft-bg: #fff8f8;
}

* {
  box-sizing: border-box;
}

/* One rule for the whole app: previously the only `outline` anywhere was
   `.today`'s calendar-day indicator, so keyboard focus was invisible on
   custom controls like .admin-icon-btn and .bottom-tab-more summary. A flat
   outline color can't work everywhere here - the app mixes light cards
   (#fff/--card) with the dark navy hero/nav/tab-bar, and --accent is itself
   a dark blue that would vanish against navy. A double ring (light inside,
   dark outside) stays visible against either. box-shadow follows whatever
   border-radius the focused element already has. */
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--t308-navy);
}

body {
  margin: 0;
  font-family: "Public Sans", system-ui, sans-serif;
  color: var(--t308-body-text);
  background: var(--bg);
}

.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem;
}

.hero {
  padding: 0;
  border: none;
  border-radius: 14px;
  background: var(--t308-navy);
  color: #f4f6fb;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  flex-wrap: wrap;
}

.hero-brand {
  display: flex;
  align-items: center;
  width: auto;
  gap: 0.85rem;
}

.hero-titles {
  text-align: left;
}

.hero-logo-chip {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  flex: 0 0 auto;
}

.hero-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

h1,
h2,
h3 {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0;
}

h1 {
  margin-top: 0;
  font-size: 1.2rem;
  line-height: 1.25;
  color: #fff;
}

.subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: #9fb0cc;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.troop-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 3px;
}

.troop-toggle-btn {
  font: 600 12px "Public Sans", sans-serif;
  padding: 6px 12px;
  border-radius: 6px;
  color: #a7cf9a;
  text-decoration: none;
}

.troop-toggle-btn.active {
  background: #f4f6fb;
  color: var(--t308-navy);
}

.top-nav {
  margin-top: 0;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  background: transparent;
  padding: 0.5rem 1.5rem;
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.nav-link {
  text-decoration: none;
  cursor: pointer;
}

.top-nav .nav-link {
  color: #9fb0cc;
  padding: 0.4rem 0;
  border-bottom: 3px solid transparent;
  font: 600 13px "Public Sans", sans-serif;
}

.top-nav .nav-link:hover {
  color: #fff;
}

.top-nav .nav-link.active {
  color: #fff;
  border-bottom-color: var(--t308-red);
}

.layout {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}

.pane[hidden] {
  display: none !important;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
}

.calendar-card {
  grid-column: span 12;
}

.upcoming-card,
.data-card,
.links-card {
  grid-column: span 12;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.badge {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
  font-size: 0.75rem;
}

.form-block + .form-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

form {
  display: grid;
  gap: 0.5rem;
}

.admin-note {
  margin: 0.2rem 0 0.7rem;
  color: #34435b;
  line-height: 1.45;
}

.admin-menu {
  position: relative;
  min-width: 0;
}

.admin-icon-btn {
  list-style: none;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.admin-icon-btn::-webkit-details-marker {
  display: none;
}

.admin-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  width: min(280px, calc(100vw - 2rem));
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(17, 38, 73, 0.14);
  display: grid;
  gap: 0.6rem;
  z-index: 20;
}

.admin-panel[hidden] {
  display: none !important;
}

.sync-status {
  margin: 0;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 0.86rem;
}

.sync-status.error {
  background: #ffe4e6;
  color: var(--tag-red);
}

label {
  font-size: 0.88rem;
  display: grid;
  gap: 0.3rem;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid #cfc8b8;
  border-radius: 8px;
  padding: 0.45rem 0.5rem;
  background: #fff;
}

button {
  border: none;
  border-radius: 9px;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

button.secondary {
  background: var(--accent-soft);
  color: var(--ink);
}

button.danger {
  background: var(--danger);
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.month-label {
  min-width: 8.75rem;
  text-align: center;
  font-weight: 700;
  margin: 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.calendar-wrap {
  position: relative;
}

.cell {
  min-height: 95px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.35rem;
  background: #fff;
}

.cell:nth-child(7n) {
  border-right: none;
}

.calendar-day {
  cursor: pointer;
}

.calendar-day:hover {
  background: #f8fbff;
}

.day-name {
  min-height: auto;
  background: var(--accent-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.date-num {
  font-size: 0.8rem;
  color: var(--muted-ink);
}

.muted .date-num {
  color: #9ca3af;
}

.today {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.event-tag {
  font-size: 0.72rem;
  border-radius: 7px;
  padding: 0.12rem 0.28rem;
  margin-top: 0.22rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meeting-tag {
  background: var(--tag-blue-bg);
  color: var(--tag-blue-text);
}

.camping-tag {
  background: var(--tag-green-bg);
  color: var(--tag-green-text);
}

.service-tag {
  background: var(--tag-red-bg);
  color: var(--tag-red);
}

.other-tag {
  background: #ececec;
  color: #374151;
}

.leadership-tag {
  background: var(--tag-red-bg);
  color: var(--tag-red);
}

.band-tag {
  background: #e6edf9;
  color: #1d3356;
}

.band-main-tag {
  background: var(--tag-blue-bg);
  color: var(--tag-blue-text);
}

.band-campouts-tag {
  background: var(--tag-green-bg);
  color: var(--tag-green-text);
}

.band-merit-tag {
  background: #fff2d8;
  color: #8a5a12;
}

.band-308b-tag {
  background: var(--tag-red-bg);
  color: var(--tag-red);
}

.legend {
  margin-top: 0.7rem;
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

.calendar-popover {
  position: absolute;
  z-index: 6;
  width: min(280px, calc(100% - 16px));
  max-height: 280px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(24, 33, 47, 0.18);
  padding: 0.55rem;
}

.popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.popover-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.dot {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  margin-right: 0.2rem;
}

.meeting-dot {
  background: var(--meeting);
}

.leadership-dot {
  background: var(--leadership);
}

.band-dot {
  background: var(--accent);
}

.band-main-dot {
  background: #1d4f91;
}

.band-campouts-dot {
  background: #2f6b3a;
}

.band-merit-dot {
  background: #c07a1a;
}

.band-308b-dot {
  background: #ce1126;
}

.camping-dot {
  background: var(--camping);
}

.service-dot {
  background: var(--service);
}

.other-dot {
  background: var(--other);
}

.data-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.data-columns > :only-child {
  grid-column: 1 / -1;
}

.managed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

/* ===== Upcoming dashboard (split desktop / agenda-rail mobile) ===== */

.upcoming-card {
  padding: 0;
  overflow: hidden;
}

.dashboard {
  display: flex;
}

.agenda-col {
  flex: 1.6;
  padding: 26px 30px;
  border-right: 1px solid var(--border);
  min-width: 0;
}

.home-sync-text {
  margin: 10px 2px 0;
  font-size: 12px;
  color: var(--muted-ink);
}

.agenda-col .section-title-wrap h2 {
  font-size: 24px;
  color: var(--t308-navy);
}

.rail-col {
  flex: 1;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: var(--t308-rail-bg);
  min-width: 0;
}

.band-card {
  background: var(--t308-navy);
  border-radius: 14px;
  padding: 20px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.band-card-title {
  font: 700 15px "Barlow Semi Condensed", sans-serif;
}

.band-card-desc {
  font-size: 12.5px;
  color: #9fb0cc;
  line-height: 1.4;
}

.band-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--t308-navy);
  font: 700 13px "Public Sans", sans-serif;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  margin-top: 4px;
}

.agenda-timeline {
  position: relative;
  padding-left: 64px;
  margin-bottom: 6px;
}

.agenda-timeline:empty {
  display: none;
}

.agenda-timeline::before {
  content: "";
  position: absolute;
  left: 50px;
  top: 8px;
  bottom: 16px;
  width: 2px;
  background: var(--t308-border-soft);
}

.agenda-entry {
  position: relative;
  margin-bottom: 14px;
}

.agenda-entry-date {
  position: absolute;
  left: -64px;
  top: 2px;
  width: 38px;
  text-align: center;
}

.agenda-entry-day {
  font: 600 9px "Public Sans", sans-serif;
  color: var(--muted-ink);
  letter-spacing: 0.08em;
}

.agenda-entry-num {
  font: 700 20px "Barlow Semi Condensed", sans-serif;
  color: var(--t308-navy);
  line-height: 1;
}

.agenda-entry-month {
  font-size: 9px;
  color: var(--muted-ink);
}

.agenda-entry-dot {
  position: absolute;
  left: -17px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--card);
}

.agenda-entry-card {
  background: #fff;
  border: 1px solid var(--t308-border-soft);
  border-left: 4px solid var(--t308-navy-accent);
  border-radius: 9px;
  padding: 10px 12px;
  box-shadow: 0 2px 6px rgba(22, 41, 74, 0.05);
  cursor: pointer;
}

.agenda-entry-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.agenda-entry-title {
  font: 600 14.5px "Public Sans", sans-serif;
  color: var(--t308-navy);
}

.agenda-entry-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 20px;
  white-space: nowrap;
  color: var(--t308-navy-accent);
  background: var(--accent-soft);
}

.agenda-entry-meta {
  font-size: 12.5px;
  color: var(--muted-ink);
  margin-top: 4px;
}

.agenda-entry-detail {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--t308-border-soft);
}

.view-event-link {
  font: 700 12.5px "Public Sans", sans-serif;
  color: var(--t308-navy-accent);
  text-decoration: none;
}

.view-event-link:hover {
  text-decoration: underline;
}

.agenda-entry-tag.type-campout,
.agenda-entry-dot.type-campout {
  color: var(--t308-red);
  background: #f6e3e0;
}

.agenda-entry-dot.type-campout {
  background: var(--t308-red);
}

.agenda-entry-card.type-campout {
  border-left-color: var(--t308-red);
}

.agenda-entry-tag.type-event {
  color: var(--t308-green);
  background: #e6efe2;
}

.agenda-entry-dot.type-event {
  background: var(--t308-green);
}

.agenda-entry-card.type-event {
  border-left-color: var(--t308-green);
}

.agenda-entry-dot.type-meeting {
  background: var(--t308-navy-accent);
}

.agenda-later-row {
  padding: 9px 11px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 7px;
  cursor: pointer;
}

.agenda-later-row:hover {
  border-color: var(--t308-navy-accent);
}

.agenda-later-row.expanded {
  border-color: var(--t308-navy-accent);
}

.agenda-later-row-main {
  display: flex;
  align-items: center;
  gap: 11px;
}

.agenda-later-date {
  text-align: center;
  width: 30px;
  flex: 0 0 auto;
}

.agenda-later-date .later-num {
  font: 700 14px "Barlow Semi Condensed", sans-serif;
  color: var(--t308-navy);
  line-height: 1;
}

.agenda-later-date .later-month {
  font-size: 9px;
  color: var(--muted-ink);
}

.agenda-later-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex: 0 0 auto;
}

.agenda-later-title {
  flex: 1;
  font-size: 13px;
  color: var(--t308-body-text);
}

.agenda-later-details {
  margin: 10px 0 2px 41px;
  padding-top: 10px;
  border-top: 1px dashed var(--t308-border-soft);
}

/* Modifier for .empty - combine as class="empty agenda-empty" in markup.
   Color/italic come from .empty; this only adjusts size for the tighter
   Home-rail context. */
.agenda-empty {
  font-size: 13.5px;
}

.mini-month-block {
  display: flex;
  flex-direction: column;
}

.mini-month-title {
  font: 700 15px "Barlow Semi Condensed", sans-serif;
  color: var(--t308-navy);
  margin-bottom: 2px;
}

.mini-month-subtitle {
  font-size: 11.5px;
  color: var(--muted-ink);
  margin-bottom: 14px;
}

.mini-month-head {
  text-align: center;
  margin-bottom: 8px;
}

.mini-month-label {
  font: 700 14px "Barlow Semi Condensed", sans-serif;
  color: var(--t308-navy);
  letter-spacing: 0.02em;
}

.mini-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  text-align: center;
  font: 600 11px "Public Sans", sans-serif;
}

.mini-month-dayname {
  color: #a39d8d;
  padding: 3px 0;
}

.mini-month-day {
  padding: 7px 0;
  color: var(--t308-body-text);
  border-radius: 50%;
  font-weight: 600;
}

.mini-month-day.clickable {
  cursor: pointer;
}

.mini-month-day.muted {
  color: #c9c3b3;
}

.mini-month-day.today {
  background: var(--t308-navy-accent);
  color: #fff;
  font-weight: 700;
}

.mini-month-day.in-week {
  background: var(--tag-blue-bg);
  color: var(--tag-blue-text);
  font-weight: 700;
}

.mini-month-day.has-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 0;
  padding: 6px 0 3px;
}

.mini-month-day-dot {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin: 2px auto 0;
}

.mini-month-day-dot.type-meeting {
  background: var(--t308-navy-accent);
}

.mini-month-day-dot.type-campout {
  background: var(--t308-red);
}

.mini-month-day-dot.type-event {
  background: var(--t308-green);
}

.mini-week-head {
  margin: 14px 0 2px;
  padding-top: 14px;
  border-top: 1px dashed var(--t308-border-soft);
  text-align: center;
}

.mini-week-label {
  font: 700 13px "Public Sans", sans-serif;
  color: var(--t308-navy);
}

.mini-week-events {
  margin-top: 6px;
}

.quick-links-title {
  font: 700 16px "Barlow Semi Condensed", sans-serif;
  color: var(--t308-navy);
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

.quick-links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-link-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--t308-body-text);
  text-decoration: none;
}

.quick-link-item span {
  color: #a39d8d;
}

.quick-link-item:hover {
  border-color: var(--t308-navy-accent);
}

/* ===== Mobile bottom tab bar ===== */

.bottom-tab-bar {
  display: none;
}

.table-wrap {
  overflow-x: auto;
}

.roster-groups {
  display: grid;
  gap: 1rem;
}

.roster-group h3 {
  margin: 0 0 0.4rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.55rem;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 700;
}

.list-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem;
  display: grid;
  gap: 0.2rem;
  background: #fff;
}

.leadership-item {
  border-left: 5px solid var(--leadership);
  background: var(--danger-soft-bg);
}

.leadership-text {
  color: var(--tag-red);
  font-weight: 700;
}

.links-card a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.links-card a:hover {
  text-decoration: underline;
}

/* A-Words lives in a .data-card, not .links-card, so its file link had no
   scoped rule and fell back to the browser default blue/underline - the only
   place in the app that happened. Same recipe as .links-card a, applied via
   an explicit class instead of broadening a section-wide selector (a bare
   .data-card a would out-specificity .signup-link, which also lives in a
   .data-card, for no reason tied to this fix). */
.awords-file-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.awords-file-link:hover {
  text-decoration: underline;
}

.signup-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.86rem;
}

.signup-link:hover {
  text-decoration: underline;
}

.links-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.links-manage-panel {
  margin-bottom: 0.8rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.links-form {
  display: grid;
  gap: 0.55rem;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.checkbox-line input {
  width: auto;
}

.links-form-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.links-item-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.links-item-actions button {
  /* min-height guarantees a real 44px touch target regardless of the
     compact font-size/padding used here - the previous ~24px box was well
     under the accessible minimum for a tap target. Shared by both the
     Links and A-Words manage rows (app.js renders this class for both). */
  min-height: 44px;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.links-move-btn {
  min-width: 44px;
  padding: 0.4rem;
  font-size: 1rem;
}

.links-move-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.links-groups {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.links-group-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.links-group-title {
  font: 700 11px "Public Sans", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-ink);
}

.links-group[data-category="Band"] .links-group-title {
  color: var(--accent);
}

.links-group-count {
  font: 600 10px "Public Sans", sans-serif;
  color: var(--muted-ink);
}

.links-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.link-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  background: #fff;
  text-decoration: none;
  color: var(--accent);
  font: 600 0.82rem "Public Sans", sans-serif;
}

.link-item:hover {
  text-decoration: none;
  border-color: var(--accent);
}

.link-item .link-name {
  /* Flex items default to min-width:auto, which floors their size at the
     content's min-content width - for an unbroken string (a pasted URL, a
     label with no spaces) that can exceed the card width and push .arrow
     off-screen instead of wrapping. min-width:0 lets it actually shrink;
     overflow-wrap covers the pathological case where a single "word" is
     still wider than the row. */
  min-width: 0;
  overflow-wrap: anywhere;
}

.link-item .arrow {
  color: var(--muted-ink);
  font-size: 0.82rem;
  flex: 0 0 auto;
}

.link-item.protected {
  background: var(--danger-soft-bg);
  border-color: #e8c3bb;
}

.link-item.protected .link-name {
  color: var(--danger);
}

.link-item .lock {
  font-size: 0.7rem;
  margin-right: 0.3em;
}

.links-group[data-category="Band"] .link-item {
  background: var(--t308-navy);
  border-color: var(--t308-navy);
  color: #fff;
}

.links-group[data-category="Band"] .link-item .arrow {
  color: #9fb0cc;
}

/* Modifier for .empty - combine as class="empty links-empty-note" in markup.
   Color/italic come from .empty; this only adjusts size/spacing for the
   Links pane's card layout (a <p>, not a <li>/<td>, so it needs its own
   margin reset). */
.links-empty-note {
  font-size: 0.75rem;
  padding: 0.5rem 0.1rem;
  margin: 0;
}

#awords-file {
  padding: 0.35rem 0.4rem;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  padding: 1rem;
  /* Above .bottom-tab-bar (30) so the fixed mobile nav can't paint over the
     bottom of a scrolled modal card; below .event-panel-overlay (40), the
     one thing allowed to sit on top of everything. */
  z-index: 35;
}

.modal[hidden] {
  display: none !important;
}

.event-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.event-panel-overlay[hidden] {
  display: none !important;
}

.event-panel {
  background: var(--card);
  border-left: 1px solid var(--t308-border-soft);
  display: flex;
  flex-direction: column;
}

@media (min-width: 769px) {
  .event-panel-overlay {
    background: rgba(22, 41, 74, 0.35);
    opacity: 0;
    transition: opacity 0.28s ease;
  }

  .event-panel-overlay.open {
    opacity: 1;
  }

  .event-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 100%;
    box-shadow: -14px 0 30px rgba(22, 41, 74, 0.2);
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.3, 1);
  }

  .event-panel-overlay.open .event-panel {
    transform: translateX(0);
  }
}

@media (max-width: 768px) {
  .event-panel {
    position: absolute;
    inset: 0;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.3, 1);
  }

  .event-panel-overlay.open .event-panel {
    transform: translateY(0);
  }
}

.event-panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--t308-border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.event-panel-close-btn {
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: var(--muted-ink);
  cursor: pointer;
  padding: 2px 6px;
}

.event-panel-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
}

.event-panel-title {
  margin: 0 0 10px;
  font: 700 21px "Public Sans", sans-serif;
  color: var(--t308-navy);
  line-height: 1.25;
}

.event-panel-date {
  color: var(--muted-ink);
  font-size: 13.5px;
  margin-bottom: 6px;
}

.event-panel-location {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.event-panel-location[hidden],
.event-panel-map-link[hidden],
.event-panel-leader[hidden],
.event-panel-notes[hidden],
.event-panel-actions[hidden] {
  display: none;
}

.event-panel-map-link {
  margin-bottom: 10px;
}

.event-panel-leader {
  color: var(--muted-ink);
  font-size: 13.5px;
  margin-bottom: 10px;
}

.event-panel-notes {
  padding: 11px 13px;
  background: #fff;
  border: 1px solid var(--t308-border-soft);
  border-radius: 8px;
  color: var(--t308-navy);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 14px;
  white-space: pre-wrap;
}

.event-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.event-panel-actions .signup-link {
  font: 600 12px "Public Sans", sans-serif;
  color: #fff;
  background: var(--t308-navy-accent);
  padding: 7px 14px;
  border-radius: 7px;
  text-decoration: none;
}

.event-panel-map-embed {
  width: 100%;
  height: 160px;
  border: 1px solid var(--t308-border-soft);
  border-radius: 8px;
  margin-top: 4px;
}

.event-panel-map-embed[hidden] {
  display: none;
}

.event-panel-footer {
  display: flex;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--t308-border-soft);
}

.event-panel-btn {
  flex: 1;
  border: none;
  border-radius: 9px;
  padding: 0.65rem 0.9rem;
  font: 700 13px "Public Sans", sans-serif;
  cursor: pointer;
}

.event-panel-btn.primary {
  background: var(--t308-navy-accent);
  color: #fff;
}

.event-panel-btn.secondary {
  background: var(--accent-soft);
  color: var(--t308-navy);
}

.modal-card {
  width: min(760px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem;
  display: grid;
  gap: 0.7rem;
}

.management-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  align-items: center;
}

.management-row label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font-size: 0.88rem;
}

#post-text {
  width: 100%;
  resize: vertical;
}

.meta {
  color: var(--muted-ink);
  font-size: 0.85rem;
}

.delete-btn {
  align-self: start;
  padding: 0.25rem 0.45rem;
  border-radius: 7px;
  font-size: 0.76rem;
  background: #fce7f3;
  color: var(--tag-red);
}

/* Shared base for every empty-state message in the app. .agenda-empty and
   .links-empty-note used to duplicate this (color + italic) with their own,
   different color values - #6b7280 here vs var(--muted-ink) there, so the
   identical sentence "No A-Words files uploaded yet." rendered in two
   different greys depending on which pane showed it. They're now modifiers:
   apply "empty" alongside them for the size/padding that fits their context. */
.empty {
  color: var(--muted-ink);
  font-style: italic;
}

@media (max-width: 960px) {
  .calendar-card,
  .upcoming-card,
  .data-card {
    grid-column: span 12;
  }
}

/* ===== Single breakpoint: split dashboard -> mobile agenda rail ===== */
@media (max-width: 768px) {
  .app-shell {
    padding-bottom: 5.5rem;
  }

  .hero-top {
    padding: 13px 16px 11px;
  }

  .hero-logo-chip {
    width: 40px;
    height: 40px;
  }

  h1 {
    font-size: 1.05rem;
  }

  .top-nav {
    display: none;
  }

  .dashboard {
    flex-direction: column;
  }

  .agenda-col {
    flex: 1 1 auto;
    border-right: none;
    padding: 18px 16px;
  }

  .rail-col {
    display: none;
  }

  .agenda-timeline {
    padding-left: 54px;
  }

  .agenda-entry-date {
    left: -54px;
    width: 34px;
  }

  .agenda-entry-dot {
    left: -14px;
  }

  .bottom-tab-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    background: var(--t308-navy);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.18);
    text-align: center;
    font: 600 9px "Public Sans", sans-serif;
    padding: 8px 6px;
    gap: 4px;
  }

  .bottom-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 5px 8px;
    border-radius: 10px;
    color: #9fb0cc;
    text-decoration: none;
  }

  .bottom-tab.active {
    color: #fff;
    font-weight: 700;
    background: rgba(192, 57, 43, 0.9);
  }

  .bottom-tab-icon {
    display: block;
  }

  .bottom-tab-more {
    flex: 1;
    position: relative;
  }

  .bottom-tab-more summary {
    list-style: none;
    cursor: pointer;
  }

  .bottom-tab-more summary::-webkit-details-marker {
    display: none;
  }

  .bottom-tab-more-panel {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    right: 0.5rem;
    width: max-content;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(17, 38, 73, 0.14);
    padding: 0.5rem;
    display: grid;
    gap: 0.35rem;
    text-align: left;
  }

  .bottom-tab-more-panel .nav-link {
    display: block;
    padding: 0.4rem 0.6rem;
    font: 600 13px "Public Sans", sans-serif;
    color: var(--t308-navy);
  }

  .link-item {
    font-size: 12.5px;
    padding: 0.6rem 0.65rem;
  }

  /* Merged from a separate max-width:700px query. It must share this
     breakpoint, not its own narrower one: the phone-shaped chrome above
     (hidden top-nav, fixed bottom tab bar, single-column dashboard) turns on
     at 768px, so a 701-767px viewport used to get that phone chrome wrapped
     around an unchanged desktop-width 3-column grid and horizontal calendar
     controls. */
  #calendar-view .section-title-wrap,
  #band-calendar .section-title-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  #calendar-view .calendar-controls,
  #band-calendar .calendar-controls {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  #calendar-view .calendar-controls {
    flex-wrap: nowrap;
  }

  #calendar-view .month-label,
  #band-calendar .month-label {
    min-width: 0;
    margin: 0;
    flex: 1;
    text-align: center;
  }

  #band-sync {
    flex: 0 0 100%;
  }

  .data-columns {
    grid-template-columns: 1fr;
  }

  .cell {
    min-height: 80px;
  }
}
