/* index.php, the dashboard (v2 layout): the welcome strip, the tiles, the week ahead, the
   Sunday announcements, the noticeboard and the side cards. Self-contained, so it loads
   without weekly.css or calendar.css. upcoming.php loads it too for the dash-* cards, lists,
   date chips and badges. */

:root {
  --dash-ink: #00008a;
  --dash-new: #d63384;
}

.dash-kicker {
  color: var(--bs-secondary-color);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dash-kicker sup,
.dash-hero h1 sup,
.dash-day-date sup {
  font-size: 0.6em;
}

/* ---------- Welcome strip ---------- */

.dash-hero {
  background: linear-gradient(135deg, #1f2429 0%, #2b3a55 60%, #35507a 100%);
  color: #fff;
  overflow: hidden;
}

.dash-hero .card-body {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem 2rem;
  padding: 1.5rem 1.75rem;
}

.dash-hero .card-body::after {
  content: "";
  position: absolute;
  right: -4rem;
  top: -5rem;
  width: 16rem;
  height: 16rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.dash-hero-main {
  flex: 1 1 22rem;
  min-width: 0;
}

.dash-hero .dash-kicker {
  color: rgba(255, 255, 255, 0.65);
}

.dash-hero h1 {
  margin: 0.15rem 0 0.35rem;
  font-weight: 700;
}

.dash-hero-sub {
  margin: 0;
  max-width: 40rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
}

.dash-hero-sub a {
  color: #fff;
}

.dash-readings {
  flex: 0 1 auto;
  min-width: 14rem;
}

.dash-readings .dash-kicker {
  margin-bottom: 0.35rem;
}

.dash-readings ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dash-readings a {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}

.dash-readings a:hover,
.dash-readings a:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.5);
}

.dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 1 1 100%;
  padding-top: 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 0.25rem;
  padding-top: 1rem;
}

.dash-actions .btn {
  --bs-btn-color: #fff;
  --bs-btn-border-color: rgba(255, 255, 255, 0.35);
  --bs-btn-hover-bg: rgba(255, 255, 255, 0.14);
  --bs-btn-hover-border-color: rgba(255, 255, 255, 0.6);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: rgba(255, 255, 255, 0.2);
  --bs-btn-active-color: #fff;
}

.dash-actions .btn-light {
  --bs-btn-color: #1f2429;
  --bs-btn-bg: #fff;
  --bs-btn-border-color: #fff;
  --bs-btn-hover-color: #1f2429;
  --bs-btn-hover-bg: #e9ecef;
}

/* ---------- Tiles ---------- */

.dash-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.dash-tile {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--bs-card-border-radius, 0.5rem);
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.08);
  color: var(--bs-body-color);
  text-decoration: none;
  min-width: 0;
}

a.dash-tile:hover,
a.dash-tile:focus-visible {
  color: var(--bs-body-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.dash-tile-icon {
  flex: 0 0 2.4rem;
  width: 2.4rem;
  height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.6rem;
  background: #eef3fb;
  color: var(--dash-ink);
  font-size: 1.05rem;
}

.dash-tile.is-warn .dash-tile-icon {
  background: #fff4e5;
  color: #8a4b00;
}

.dash-tile.is-danger .dash-tile-icon {
  background: #fde8ea;
  color: #b02a37;
}

.dash-tile.is-ok .dash-tile-icon {
  background: #e8f5ee;
  color: #146c43;
}

.dash-tile.is-muted .dash-tile-icon {
  background: #f1f3f5;
  color: var(--bs-secondary-color);
}

.dash-tile-body {
  min-width: 0;
  line-height: 1.25;
}

.dash-tile-label {
  color: var(--bs-secondary-color);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dash-tile-value {
  font-size: 1.05rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-tile-sub {
  color: var(--bs-secondary-color);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Cards ---------- */

.dash-card .card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
}

.dash-card .card-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.dash-card .card-header .fa-solid {
  color: var(--bs-secondary-color);
}

.dash-card .card-header .ms-auto a {
  font-size: 0.85rem;
}

.dash-empty {
  padding: 1.75rem 1rem;
  color: var(--bs-secondary-color);
  font-size: 0.9rem;
  text-align: center;
}

.dash-empty i {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
  opacity: 0.35;
}

/* ---------- The week ahead ---------- */

.dash-day {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 1rem;
}

.dash-day + .dash-day {
  border-top: 1px solid var(--bs-border-color-translucent);
}

.dash-day-head {
  flex: 0 0 5.5rem;
  line-height: 1.2;
}

.dash-day-name {
  font-weight: 700;
  color: var(--dash-ink);
}

.dash-day.is-today .dash-day-name {
  color: #fff;
  background: var(--dash-ink);
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border-radius: 0.35rem;
}

.dash-day-date {
  color: var(--bs-secondary-color);
  font-size: 0.8rem;
}

.dash-day-events {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.dash-event {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.45rem 0.75rem 0.45rem 0.65rem;
  border-left: 3px solid var(--hue, var(--dash-ink));
  border-radius: 0.35rem;
  background: #f8f9fb;
  color: var(--bs-body-color);
  text-decoration: none;
  min-width: 0;
}

.dash-event:hover,
.dash-event:focus-visible {
  background: #eef3fb;
  color: var(--bs-body-color);
}

.dash-event.is-external {
  background: #fdfdf2;
}

.dash-event.is-external:hover {
  background: #f8f8e2;
}

.dash-event.is-mine {
  background: #fff8e6;
}

.dash-event.is-mine:hover {
  background: #fff0cc;
}

.dash-event-time {
  flex: 0 0 3.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--dash-ink);
  font-size: 0.9rem;
}

.dash-event.is-external .dash-event-time {
  color: var(--bs-secondary-color);
  font-weight: 600;
  font-size: 0.8rem;
  padding-top: 0.1rem;
}

.dash-event-main {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.3;
}

.dash-event-title {
  font-weight: 600;
}

.dash-event-sub {
  color: var(--bs-secondary-color);
  font-size: 0.85rem;
}

.dash-event-notes {
  color: var(--bs-secondary-color);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.dash-event-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.3rem;
}

.dash-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.dash-badge-mine {
  background: #ffe69c;
  color: #664d03;
}

.dash-badge-now {
  background: #146c43;
  color: #fff;
}

.dash-badge-gap {
  background: #fde8ea;
  color: #b02a37;
}

.dash-badge-ext {
  background: #f1f0d9;
  color: #6b621d;
}

.dash-badge-new {
  background: var(--dash-new);
  color: #fff;
}

/* ---------- Announcements ---------- */

.dash-announce-group + .dash-announce-group {
  margin-top: 1rem;
}

.dash-announce-group h3 {
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
}

.dash-announce {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.dash-announce + .dash-announce {
  border-top: 1px dashed var(--bs-border-color);
}

.dash-announce-num {
  flex: 0 0 1.6rem;
  width: 1.6rem;
  height: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #eef3fb;
  color: var(--dash-ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.dash-announce-body {
  min-width: 0;
  font-size: 0.9rem;
}

.dash-announce-title {
  font-weight: 600;
}

.dash-announce-text {
  color: var(--bs-body-color);
  white-space: normal;
}

/* ---------- Noticeboard ---------- */

.dash-notices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 1rem;
}

.dash-notice {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--bs-border-color-translucent);
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
  color: var(--bs-body-color);
  text-decoration: none;
  transition: box-shadow 0.15s, transform 0.15s;
}

.dash-notice:hover,
.dash-notice:focus-visible {
  color: var(--bs-body-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.dash-notice-thumb {
  aspect-ratio: 1 / 1.3;
  background: #f1f3f5;
  overflow: hidden;
}

.dash-notice-thumb.is-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  font-size: 2.5rem;
}

.dash-notice-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.dash-notice .dash-badge-new {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dash-notice-body {
  padding: 0.55rem 0.7rem 0.65rem;
  line-height: 1.25;
}

.dash-notice-title {
  font-size: 0.875rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dash-notice-meta {
  margin-top: 0.2rem;
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
}

/* ---------- Side cards ---------- */

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

.dash-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.dash-date {
  flex: 0 0 5.2rem;
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.35rem;
  background: #fff;
  color: var(--dash-ink);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

a.dash-date:hover,
a.dash-date:focus-visible {
  background: #f4f8ff;
  border-color: #b6d4fe;
}

.dash-date.is-soon {
  background: var(--dash-ink);
  border-color: var(--dash-ink);
  color: #fff;
}

.dash-item-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.dash-item-what {
  font-size: 0.875rem;
  font-weight: 500;
}

.dash-item-where {
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
}

.dash-side-note {
  margin: 0.6rem 0 0;
  color: var(--bs-secondary-color);
  font-size: 0.78rem;
}

.dash-cover {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #f1aeb5;
  border-radius: 0.4rem;
  background: #fdf2f3;
  color: #842029;
  font-size: 0.875rem;
  text-decoration: none;
}

.dash-cover:hover {
  background: #f8d7da;
  color: #842029;
}

.dash-cleaning {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--bs-border-color-translucent);
  font-size: 0.875rem;
}

.dash-cleaning i {
  color: var(--bs-secondary-color);
}

.dash-progress {
  height: 0.45rem;
  margin: 0.5rem 0 0.25rem;
}

.dash-admin dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 0.75rem;
  margin: 0;
  font-size: 0.875rem;
}

.dash-admin dt {
  font-weight: 500;
  color: var(--bs-secondary-color);
}

.dash-admin dd {
  margin: 0;
  font-weight: 600;
}

.dash-state {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.dash-state i {
  font-size: 0.7rem;
}

.dash-state.is-ok i { color: #146c43; }
.dash-state.is-warn i { color: #cc8400; }
.dash-state.is-todo i { color: var(--bs-secondary-color); }

/* ---------- Phones ---------- */

@media (max-width: 575.98px) {
  .dash-hero .card-body {
    padding: 1.25rem 1rem;
  }

  .dash-hero h1 {
    font-size: 1.4rem;
  }

  .dash-day {
    flex-direction: column;
    gap: 0.4rem;
  }

  .dash-day-head {
    flex-basis: auto;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
  }

  .dash-notices {
    grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
    gap: 0.6rem;
  }

  .dash-tiles {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .dash-tile {
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.7rem 0.75rem;
  }

  .dash-tile-icon {
    flex-basis: 2rem;
    width: 2rem;
    height: 2rem;
    font-size: 0.9rem;
  }

  .dash-tile-value {
    font-size: 0.95rem;
    white-space: normal;
  }

  .dash-tile-sub {
    white-space: normal;
  }
}
