/* Nav Bar */
.nav-bar {
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-bar-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 10px 16px;
  min-height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}
.nav-title {
  font-size: 15px; font-weight: 600;
  position: absolute; left: 50%; transform: translateX(-50%);
  pointer-events: none; letter-spacing: -0.01em;
}
.nav-btn {
  background: none; border: none; color: var(--muted);
  font-size: 14px; font-weight: 500; font-family: inherit; cursor: pointer;
  padding: 6px 10px; border-radius: var(--radius-sm); min-height: 36px;
  transition: color 0.15s, background 0.15s;
  display: inline-flex; align-items: center; gap: 4px;
}
.nav-btn:hover { color: var(--text); background: var(--fill-tertiary); }
.nav-btn:active { background: var(--fill-quaternary); }
.nav-logo {
  font-size: 22px; text-decoration: none; line-height: 1;
  padding: 4px; border-radius: var(--radius-sm); min-width: 36px; text-align: center;
  transition: transform 0.15s ease;
}
.nav-logo:active { transform: scale(0.92); }

/* Large Title */
.large-title-section { padding: 16px 16px 12px; max-width: 680px; margin: 0 auto; }
.large-title { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.large-subtitle { font-size: 14px; color: var(--muted); margin-top: 2px; }

/* Segment Control */
.segment-wrap { padding: 0 16px; max-width: 680px; margin: 0 auto 16px; }
.segment-control {
  display: flex; background: var(--fill-tertiary);
  border-radius: var(--radius); padding: 2px; position: relative;
}
.segment-btn {
  flex: 1; padding: 6px 4px; border: none; background: none;
  font-size: 13px; font-weight: 500; font-family: inherit; color: var(--muted);
  cursor: pointer; border-radius: var(--radius-sm); transition: all 0.15s ease;
  text-align: center; position: relative; z-index: 1; white-space: nowrap;
}
.segment-btn.active {
  background: var(--card); font-weight: 600; color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.segment-badge {
  display: inline-block; background: var(--urgent); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; line-height: 16px;
  text-align: center; border-radius: 8px; padding: 0 4px; margin-left: 4px; vertical-align: 1px;
}

/* Grouped List */
.list-group {
  background: var(--glass-card); border-radius: var(--radius); overflow: hidden;
  margin-bottom: 16px; border: 1px solid var(--border);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.list-group:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.list-item {
  padding: 14px 16px; display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: background 0.15s; position: relative;
}
.list-item:not(:last-child)::after {
  content: ''; position: absolute; bottom: 0; left: 72px; right: 0;
  height: 0.5px; background: var(--separator);
}
.list-item:active { background: var(--fill-quaternary); }
.list-icon {
  width: 40px; height: 40px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.list-item-content { flex: 1; min-width: 0; }
.list-item-title { font-size: 17px; font-weight: 400; line-height: 1.3; }
.list-item-subtitle { font-size: 13px; color: var(--label); line-height: 1.3; }
.list-item-right { flex-shrink: 0; display: flex; align-items: center; gap: 6px; }
.list-chevron { color: rgba(60,60,67,0.3); font-size: 14px; font-weight: 600; }

/* Section Header */
.section-header {
  font-size: 13px; font-weight: 500; color: var(--label);
  text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 16px 6px;
}

/* Slot Pill */
.slot-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px;
}
.slot-pill.full { background: var(--fresh-light); color: var(--fresh-dark); }
.slot-pill.almost { background: rgba(255,159,10,0.12); color: #c67600; }
.slot-pill.urgent { background: rgba(255,69,58,0.12); color: var(--urgent); }
.slot-pill.waitlist { background: var(--accent-blue-light); color: var(--accent-blue); }

/* Bottom Sheet */
.sheet-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 150;
  opacity: 0; transition: opacity 0.3s; pointer-events: none;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.sheet-overlay.visible { opacity: 1; pointer-events: all; }
.sheet {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%) translateY(100%);
  width: 100%; max-width: 600px;
  background: var(--glass-card-strong); border-radius: var(--radius-lg) var(--radius-lg) 0 0; z-index: 151;
  border: 1px solid var(--border); border-bottom: none;
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow-lg);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 90dvh; display: flex; flex-direction: column; padding-bottom: var(--safe-bottom);
}
.sheet.visible { transform: translateX(-50%) translateY(0); }
.sheet-header { padding: 16px 20px 12px; display: flex; align-items: flex-start; gap: 14px; flex-shrink: 0; }
.sheet-icon {
  width: 48px; height: 48px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0;
}
.sheet-title-area { flex: 1; }
.sheet-title { font-size: 22px; font-weight: 700; line-height: 1.2; }
.sheet-meta { font-size: 13px; color: var(--label); margin-top: 2px; }
.sheet-desc { font-size: 15px; color: var(--text-secondary); margin-top: 6px; line-height: 1.4; }
.sheet-close {
  width: 30px; height: 30px; border-radius: 50%; background: var(--fill-tertiary);
  border: none; display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; font-size: 14px; color: var(--label); margin-top: 2px;
  transition: background 0.15s;
}
.sheet-close:hover { background: var(--fill-quaternary); }
.sheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 20px 24px; }

/* People List */
.people-title {
  font-size: 13px; font-weight: 500; color: var(--label);
  text-transform: uppercase; letter-spacing: 0.04em; margin: 16px 0 8px;
}
.people-list { background: var(--glass-card); border-radius: 12px; overflow: hidden; border: 1px solid var(--border); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.person-row {
  padding: 11px 14px; display: flex; align-items: center; gap: 12px;
  font-size: 15px; position: relative;
}
.person-row:not(:last-child)::after {
  content: ''; position: absolute; bottom: 0; left: 44px; right: 0;
  height: 0.5px; background: var(--separator);
}
.person-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--fill-tertiary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--label); flex-shrink: 0;
}
.person-name { flex: 1; font-weight: 400; }
.person-tag { font-size: 12px; color: var(--label); }
.person-own { color: var(--fresh-dark); font-weight: 500; }

/* Registration Form */
.reg-form { background: var(--glass-card); border-radius: var(--radius); padding: 16px; margin-top: 16px; border: 1px solid var(--border); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow-sm); }
.reg-form-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.reg-input {
  width: 100%; padding: 10px 12px; background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 15px; color: var(--text); outline: none;
  margin-bottom: 8px; transition: border-color 0.15s, box-shadow 0.15s;
}
.reg-input:focus { border-color: var(--event-color, var(--text)); box-shadow: 0 0 0 2px var(--event-color-light, var(--ring)); }
.reg-input::placeholder { color: var(--muted-foreground); }

/* Buttons */
.btn-primary {
  width: 100%; padding: 10px 16px; background: var(--event-color-dark, var(--swarmi-dark)); color: #fff;
  border: none; border-radius: var(--radius); font-size: 15px; font-weight: 500;
  font-family: inherit; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
}
.btn-primary:hover { opacity: 0.92; box-shadow: 0 4px 14px rgba(0,0,0,0.16); }
.btn-primary:active { opacity: 0.85; transform: scale(0.98); box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.btn-primary:disabled { background: var(--muted-foreground); cursor: not-allowed; color: #fff; opacity: 0.6; box-shadow: none; }

.btn-secondary {
  width: 100%; padding: 10px 16px; background: none; color: var(--event-color-dark, var(--swarmi-dark));
  border: none; font-size: 14px; font-weight: 500; font-family: inherit;
  cursor: pointer; margin-top: 8px;
}
.btn-secondary:hover { opacity: 0.8; }
.btn-secondary:active { opacity: 0.6; }

.btn-sm {
  padding: 6px 12px; border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; font-family: inherit; cursor: pointer;
  transition: opacity 0.15s;
}
.btn-sm.primary { background: var(--event-color-dark, var(--swarmi-dark)); color: #fff; }
.btn-sm.secondary { background: var(--fill-tertiary); color: var(--text); }
.btn-sm.danger { background: rgba(255,69,58,0.12); color: var(--urgent); }

/* Toast */
.toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%) translateY(-100px);
  background: rgba(28,28,30,0.88); color: #F5F5F7; padding: 10px 20px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.08);
  z-index: 1000; transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  pointer-events: none; max-width: 90vw; text-align: center;
}
.toast.visible { transform: translateX(-50%) translateY(0); }

/* Status message */
.msg { font-size: 13px; text-align: center; margin-top: 8px; padding: 8px; border-radius: 8px; display: none; }
.msg.error { display: block; background: rgba(255,69,58,0.1); color: var(--urgent); }
.msg.success { display: block; background: var(--fresh-light); color: var(--fresh-dark); }

/* Color util */
.bg-green { background: var(--fresh-light); }
.bg-blue { background: var(--accent-blue-light); }
.bg-orange { background: rgba(255,159,10,0.12); }
.bg-red { background: rgba(255,69,58,0.12); }
.bg-teal { background: rgba(90,200,250,0.12); }
.bg-purple { background: rgba(175,82,222,0.12); }
.bg-pink { background: var(--pink-light); }
.bg-yellow { background: rgba(255,184,0,0.12); }

/* Loading */
.loading { text-align: center; padding: 40px 20px; color: var(--label); font-size: 15px; }

/* Content wrapper */
.content { max-width: 680px; margin: 0 auto; padding: 0 16px 100px; }
.content-no-bottom { padding-bottom: 0; }

/* Highlight badge on shifts */
.highlight-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--fresh-light); color: var(--fresh-dark);
  font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; margin-top: 4px;
}

/* Full-screen bottom sheet (sub-page replacement) */
.fullsheet-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 160;
  opacity: 0; transition: opacity 0.3s; pointer-events: none;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.fullsheet-overlay.visible { opacity: 1; pointer-events: all; }
.fullsheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 161;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 95dvh; height: 95dvh;
  display: flex; flex-direction: column;
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.12);
}
.fullsheet.visible { transform: translateY(0); }
.fullsheet-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--fill-tertiary); margin: 8px auto 0; flex-shrink: 0;
}
.fullsheet-header {
  display: flex; align-items: center; padding: 12px 16px 12px;
  flex-shrink: 0; gap: 12px;
}
.fullsheet-title { flex: 1; font-size: 17px; font-weight: 600; text-align: center; }
.fullsheet-close {
  width: 30px; height: 30px; border-radius: 50%; background: var(--fill-tertiary);
  border: none; display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; font-size: 14px; color: var(--label);
  transition: background 0.15s;
}
.fullsheet-close:hover { background: var(--fill-quaternary); }
.fullsheet-spacer { width: 30px; flex-shrink: 0; }
.fullsheet-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 16px 24px;
}

@media (max-width: 390px) {
  .large-title { font-size: 28px; }
  .segment-btn { font-size: 12px; }
}
