/* ===== Design tokens ===== */
:root {
  --bg: #08090b;
  --bg-glow:
    radial-gradient(
      circle at 20% -10%,
      rgba(10, 132, 255, 0.12),
      transparent 45%
    ),
    radial-gradient(
      circle at 90% 10%,
      rgba(120, 90, 255, 0.08),
      transparent 40%
    );

  --card-bg: rgba(255, 255, 255, 0.045);
  --card-bg-strong: rgba(255, 255, 255, 0.07);
  --card-border: rgba(255, 255, 255, 0.09);
  --card-blur: blur(24px);
  --panel-bg: rgba(0, 0, 0, 0.16);

  --text-primary: #f5f5f7;
  --text-secondary: rgba(245, 245, 247, 0.58);
  --text-tertiary: rgba(245, 245, 247, 0.36);

  --accent: #0a84ff;
  --accent-soft: rgba(10, 132, 255, 0.16);
  --accent-glow: rgba(10, 132, 255, 0.45);
  --success: #34c759;

  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --radius-pill: 999px;

  --shadow-card:
    0 20px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow-card-hover:
    0 28px 70px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);

  --font:
    "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
}

html,
body {
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  background: var(--bg);
  background-image: var(--bg-glow);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

/* ===== Motion ===== */
@keyframes contentIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: contentIn 0.28s var(--ease) both;
}

@keyframes pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

/* ===== Layout ===== */
.app {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.top-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

/* ===== Base glass card ===== */
.card {
  background: var(--card-bg);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition:
    transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow-card-hover);
}

/* ===== Profile header ===== */
.profile-header {
  padding: 20px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(160deg, var(--accent), #5b6bff);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.profile-name {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.profile-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ===== Calendar ===== */
.calendar-card {
  padding: 0;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 16px;
}

.calendar-header h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.nav-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--card-bg-strong);
  color: var(--text-primary);
  font-size: 18px;
  transition:
    background 0.15s var(--ease),
    transform 0.12s var(--ease);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.nav-btn:active {
  transform: scale(0.9);
}

/* ===== Month / year picker ===== */
.month-year-wrap {
  position: relative;
}

.month-year-btn {
  background: transparent;
  border: none;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  transition:
    background 0.15s var(--ease),
    transform 0.12s var(--ease);
}

.month-year-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.month-year-btn:active {
  transform: scale(0.97);
}

.month-year-btn span {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.nav-btn.small {
  width: 28px;
  height: 28px;
  font-size: 15px;
}

.month-picker {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px) scale(0.96);
  transform-origin: top center;
  width: 220px;
  max-width: calc(100vw - 40px);
  background: rgba(18, 20, 24, 0.92);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 16px;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.16s var(--ease),
    transform 0.16s var(--ease);
}

.month-picker.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.year-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.month-grid button {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 0;
  border-radius: var(--radius-sm);
  transition:
    background 0.15s var(--ease),
    transform 0.12s var(--ease);
}

.month-grid button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.month-grid button:active {
  transform: scale(0.92);
}

.month-grid button.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.calendar-body {
  background: var(--panel-bg);
  padding: 16px 28px 24px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  color: rgba(245, 245, 247, 0.5);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.calendar-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 6px;
}

.day-highlight {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow:
    0 0 0 6px var(--accent-soft),
    0 4px 18px var(--accent-glow);
  transition:
    transform 0.32s var(--ease),
    opacity 0.15s var(--ease);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
}

.day-highlight.no-transition {
  transition: none;
}

.calendar-grid .day {
  position: relative;
  z-index: 1;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  border-radius: 50%;
  transition:
    background 0.18s var(--ease),
    transform 0.12s var(--ease),
    color 0.15s var(--ease);
}

.calendar-grid .day.outside {
  color: var(--text-tertiary);
}

.calendar-grid .day:hover:not(.selected) {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.08);
}

.calendar-grid .day:active {
  transform: scale(0.9);
}

.calendar-grid .day.selected {
  color: #fff;
}

.calendar-grid .day.today:not(.selected) {
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* A small marker under any date that has at least one shift — brings the
   calendar to life instead of feeling disconnected from the shift data.
   Not literal black: on this dark theme a true black dot has almost no
   contrast against the card background, so a light muted dot is used
   instead to actually be visible. */
.calendar-grid .day.has-shift::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(245, 245, 247, 0.55);
  z-index: 2;
}

.calendar-grid .day.has-shift.selected::after,
.calendar-grid .day.has-shift.today::after {
  background: #ffffff;
}

/* ===== Right column layout ===== */
.right-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ===== Shift status card ===== */
.status-card {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-tertiary);
  transition: background 0.25s var(--ease);
}

.status-dot.on {
  background: var(--success);
  animation: pulseDot 2s var(--ease) infinite;
}

@keyframes pulseDot {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(52, 199, 89, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
  }
}

.status-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.status-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ===== Weekly overview ===== */
.weekly-card {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.weekly-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 28px 16px;
}

.weekly-header h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.weekly-range {
  color: rgba(245, 245, 247, 0.68);
  font-size: 13px;
  margin-top: 4px;
}

.weekly-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.weekly-total {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.weekly-body {
  background: var(--panel-bg);
  padding: 4px 28px 24px;
  flex: 1;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.shift-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.shift-list li {
  padding: 16px 10px;
  margin: 0 -10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  transition: background 0.2s var(--ease);
}

.shift-list li:first-child {
  border-top: none;
}

.shift-list li:hover {
  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.06) 18%,
    rgba(255, 255, 255, 0.06) 82%,
    transparent
  );
}

.shift-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.shift-day {
  font-size: 15px;
  font-weight: 600;
}

.shift-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.shift-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.shift-hours {
  font-size: 14px;
  font-weight: 600;
}

.status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.status-pill.done {
  background: rgba(52, 199, 89, 0.16);
  color: var(--success);
}

.status-pill.upcoming {
  background: var(--accent-soft);
  color: var(--accent);
}

.shift-notes {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.empty-state {
  text-align: center;
  color: var(--text-secondary);
  padding: 32px 0;
  font-size: 14px;
}

/* ===== Message box ===== */
.email-card {
  padding: 24px 28px;
}

.email-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.email-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  transition:
    background 0.15s var(--ease),
    transform 0.12s var(--ease);
  flex-shrink: 0;
}

.btn-accent:hover {
  background: #2b9dff;
}

.btn-accent:active {
  transform: scale(0.95);
}

.btn-accent.success {
  background: var(--success);
  animation: pop 0.35s var(--ease);
}

.btn-accent.full-width {
  width: 100%;
  padding: 13px 22px;
}

/* ===== Message / form popup (shared with admin's add/edit shift modal) ===== */
.message-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 6, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
  z-index: 100;
}

.message-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.message-modal {
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0.04)
  );
  backdrop-filter: blur(36px) saturate(180%);
  -webkit-backdrop-filter: blur(36px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  padding: 28px;
  position: relative;
  transform: translateY(16px) scale(0.97);
  opacity: 0;
  transition:
    transform 0.24s var(--ease),
    opacity 0.2s var(--ease);
}

.message-overlay.open .message-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.message-modal h3 {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 20px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--card-bg-strong);
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1;
  transition:
    background 0.15s var(--ease),
    transform 0.12s var(--ease);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.14);
}

.modal-close:active {
  transform: scale(0.9);
}

.message-form-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: -6px;
}

.message-form-fields input,
.message-form-fields textarea {
  width: 100%;
  background: var(--card-bg-strong);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition:
    border-color 0.15s var(--ease),
    background 0.15s var(--ease);
}

.message-form-fields textarea {
  resize: vertical;
  min-height: 110px;
}

.message-form-fields input::placeholder,
.message-form-fields textarea::placeholder {
  color: var(--text-tertiary);
}

.message-form-fields input:focus,
.message-form-fields textarea:focus {
  border-color: var(--accent);
}

/* ===== Footer ===== */
.app-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 24px 40px;
  text-align: center;
}

.app-footer p {
  font-size: 12px;
  color: var(--text-tertiary);
}

.footer-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.15s var(--ease);
}

.footer-link:hover {
  color: var(--accent);
}

/* ===== Scale-to-fit wrapper (desktop only) ===== */
#scaleWrapper {
  transform-origin: top center;
}

/* ===== Weekly card header actions / share menu =====
   Centered under the trigger rather than right-anchored: once the
   header stacks on mobile, the trigger ends up near the left edge,
   and a right:0 popover would extend mostly off the left side of the
   screen. Centering avoids that regardless of where the trigger sits. */
.share-menu-wrap {
  position: relative;
}

.share-menu,
.pdf-range-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  background: rgba(18, 20, 24, 0.92);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 8px;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-6px) scale(0.97);
  transform-origin: top center;
  transition:
    opacity 0.16s var(--ease),
    transform 0.16s var(--ease);
  min-width: 180px;
  max-width: calc(100vw - 40px);
}

.share-menu.open,
.pdf-range-popover.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.share-menu-item,
.pdf-range-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s var(--ease);
}

.share-menu-item:hover,
.pdf-range-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.pdf-custom-range {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 4px 4px;
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pdf-custom-range input {
  width: 100%;
  background: var(--card-bg-strong);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
}

/* ===== Off-screen shareable image card ===== */
.export-card {
  position: fixed;
  top: 0;
  left: -9999px;
  width: 480px;
  background: linear-gradient(160deg, #12141a, #08090b);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  padding: 32px;
  font-family: var(--font);
  color: var(--text-primary);
}

.export-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.export-card-name {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
}

.export-card-range {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.export-card-total {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.export-card-list {
  display: flex;
  flex-direction: column;
}

.export-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.export-row:first-child {
  border-top: none;
  padding-top: 0;
}

.export-row-day {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.export-row-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.export-row-hours {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

/* ===== Admin: passcode gate ===== */
.passcode-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.passcode-card {
  width: 100%;
  max-width: 340px;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.passcode-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--accent), #5b6bff);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.passcode-card h1 {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
}

.passcode-card > p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: -12px;
}

.passcode-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.passcode-form input {
  width: 100%;
  padding: 12px 16px;
  background: var(--card-bg-strong);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 16px;
  letter-spacing: 4px;
  text-align: center;
  font-family: inherit;
  transition: border-color 0.15s var(--ease);
}

.passcode-form input:focus {
  border-color: var(--accent);
}

.passcode-error {
  font-size: 13px;
  color: #ff453a;
  min-height: 16px;
  margin: 0;
}

/* ===== Admin: shift list actions ===== */
.shift-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg-strong);
  color: var(--text-primary);
  transition:
    background 0.15s var(--ease),
    transform 0.12s var(--ease);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.icon-btn:active {
  transform: scale(0.9);
}

.icon-btn.delete {
  background: rgba(255, 59, 48, 0.14);
  color: #ff453a;
}

.icon-btn.delete:hover {
  background: rgba(255, 59, 48, 0.22);
}

.logout-btn {
  margin-left: auto;
}

/* ===== Admin: previous shifts (collapsed section) ===== */
.previous-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  margin-top: 4px;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
}

.previous-toggle:hover {
  color: var(--text-primary);
}

.previous-toggle svg {
  transition: transform 0.2s var(--ease);
}

.previous-toggle.expanded svg {
  transform: rotate(180deg);
}

.previous-list {
  padding-top: 4px;
}

/* ===== Admin: filter bar ===== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 28px 16px;
  align-items: center;
}

.filter-search {
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg-strong);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  padding: 9px 14px;
  color: var(--text-tertiary);
}

.filter-search input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  min-width: 0;
}

.filter-search input::placeholder {
  color: var(--text-tertiary);
}

.filter-search input:focus {
  outline: none;
}

.filter-select {
  background: var(--card-bg-strong);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  padding: 9px 14px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  max-width: 100%;
}

.filter-date-trigger {
  width: auto;
  white-space: nowrap;
  border-radius: var(--radius-pill);
  padding: 9px 14px;
  font-size: 13px;
}

.filter-clear {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  padding: 9px 4px;
}

.filter-clear:hover {
  text-decoration: underline;
}

/* ===== Admin: form layout ===== */
.form-row {
  display: flex;
  gap: 12px;
}

.form-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row .field-label {
  margin-bottom: 0;
}

/* ===== Admin: completed segmented control ===== */
.segmented {
  display: flex;
  gap: 8px;
}

.segmented-btn {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  background: var(--card-bg-strong);
  color: var(--text-secondary);
  border: none;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition:
    background 0.15s var(--ease),
    color 0.15s var(--ease);
}

.segmented-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ===== Admin: avatar upload ===== */
.avatar-upload-btn {
  position: relative;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.avatar-edit-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--card-bg-strong);
  border: 2px solid #08090b;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

/* ===== Admin: location suggestion chips ===== */
.location-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -2px 0 2px;
}

.location-chip {
  padding: 5px 10px;
  background: var(--card-bg-strong);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  transition:
    background 0.15s var(--ease),
    color 0.15s var(--ease);
}

.location-chip:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ===== Admin: icon-only date/time pickers (custom, not native) ===== */
.picker-wrap {
  position: relative;
}

.picker-trigger {
  width: 100%;
  text-align: left;
  background: var(--card-bg-strong);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s var(--ease);
}

.picker-trigger.placeholder {
  color: var(--text-tertiary);
}

.picker-trigger:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.date-picker-popover,
.time-picker-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  background: rgba(18, 20, 24, 0.92);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 14px;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-6px) scale(0.97);
  transform-origin: top center;
  transition:
    opacity 0.16s var(--ease),
    transform 0.16s var(--ease);
}

.date-picker-popover.open,
.time-picker-popover.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.date-picker-popover {
  width: 260px;
  max-width: calc(100vw - 40px);
}

.date-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.date-picker-header span {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.date-picker-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 6px;
}

.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 2px;
}

.date-picker-grid .day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  border-radius: 50%;
  transition: background 0.15s var(--ease);
}

.date-picker-grid .day.outside {
  color: var(--text-tertiary);
}

.date-picker-grid .day:hover:not(.selected) {
  background: rgba(255, 255, 255, 0.08);
}

.date-picker-grid .day.selected {
  background: var(--accent);
  color: #fff;
}

.date-picker-grid .day.today:not(.selected) {
  box-shadow: inset 0 0 0 1px var(--accent);
}

.time-picker-popover {
  width: 140px;
  max-width: calc(100vw - 40px);
  padding: 8px;
}

.time-picker-columns {
  display: flex;
  gap: 4px;
}

.time-picker-col {
  flex: 1;
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.time-picker-col button {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  padding: 8px 0;
  border-radius: var(--radius-sm);
  text-align: center;
  transition: background 0.15s var(--ease);
}

.time-picker-col button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.time-picker-col button.selected {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* ===== Admin: page views card ===== */
.views-card {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.views-stat {
  flex: 1;
  text-align: center;
}

.views-number {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
}

.views-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.views-divider {
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
}

/* ===== Responsive ===== */
@media (max-width: 760px) {
  .top-row {
    grid-template-columns: 1fr;
  }

  .app {
    padding: 32px 16px 48px;
  }

  .email-form {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-accent:not(.full-width) {
    width: 100%;
  }

  .form-row {
    flex-direction: column;
  }

  .weekly-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .weekly-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 0 16px 16px;
  }

  .filter-select,
  .filter-date-trigger {
    width: 100%;
  }

  .filter-clear {
    align-self: flex-end;
  }

  .share-menu,
  .pdf-range-popover {
    position: fixed;
    left: 16px;
    right: 16px;
    top: auto;
    bottom: 16px;
    width: auto;
    max-width: none;
    transform: translateY(16px);
    transform-origin: bottom center;
  }

  .share-menu.open,
  .pdf-range-popover.open {
    transform: translateY(0);
  }
}

/* ===== Admin: filter search sizing on mobile ===== */
@media (max-width: 760px) {
  .filter-search {
    flex: none;
    width: 100%;
  }
}

/* ===== Admin: undo toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(16px);
  background: rgba(18, 20, 24, 0.95);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-card);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s var(--ease),
    transform 0.2s var(--ease);
  overflow: hidden;
  max-width: calc(100vw - 32px);
}

.toast.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.toast-message {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
}

.toast-undo {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}

.toast-undo:hover {
  text-decoration: underline;
}

.toast-progress-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.toast-progress {
  height: 100%;
  background: var(--accent);
  width: 100%;
}
