/* =========================================================
   e-Daftar Sinode 41 PCS — Modern design system
   Brand: navy + gold · clean cards · refined type
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  /* Brand Palette: #3b5998, #8b9dc3, #dfe3ee, #f7f7f7, #ffffff */
  --navy: #3b5998;
  --navy-mid: #3b5998;
  --navy-deep: #2d4373;
  --blue-accent: #8b9dc3;
  --border-light: #dfe3ee;
  --bg-page: #f7f7f7;
  --white: #ffffff;
  
  --gold: #3b5998;
  --gold-light: #8b9dc3;
  --gold-soft: #dfe3ee;
  --gold-ink: #3b5998;

  /* Surfaces */
  --cream: #f7f7f7;
  --cream-2: #dfe3ee;
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --surface-3: #dfe3ee;

  /* Text */
  --text: #1e293b;
  --text-secondary: #3b5998;
  --muted: #64748b;
  --muted-2: #8b9dc3;

  /* Lines & feedback */
  --border: #dfe3ee;
  --border-strong: #8b9dc3;
  --success: #059669;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --error: #b91c1c;
  --error-bg: #fef2f2;
  --error-border: #fecaca;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(59, 89, 152, 0.04);
  --shadow-sm: 0 2px 8px rgba(59, 89, 152, 0.06);
  --shadow: 0 8px 30px rgba(59, 89, 152, 0.08);
  --shadow-lg: 0 24px 60px rgba(45, 67, 115, 0.15);
  --shadow-gold: 0 8px 20px rgba(59, 89, 152, 0.25);

  /* Shape & type */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 999px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --focus-ring: 0 0 0 3px rgba(59, 89, 152, 0.2);
  --focus-gold: 0 0 0 3px rgba(139, 157, 195, 0.4);

  /* Layout */
  --content-width: 940px;
  --header-max: 940px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background-color: var(--cream);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(18, 58, 99, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(212, 168, 42, 0.07), transparent 45%),
    radial-gradient(ellipse 50% 30% at 0% 100%, rgba(10, 39, 68, 0.04), transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  font-size: 15.5px;
  font-weight: 400;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--navy);
  font-weight: 700;
}

p {
  color: var(--text-secondary);
}

/* ---------- Header ---------- */
.site-header {
  background:
    linear-gradient(135deg, rgba(212, 168, 42, 0.12) 0%, transparent 40%),
    linear-gradient(145deg, var(--navy-deep) 0%, var(--navy) 48%, var(--navy-mid) 100%);
  color: var(--white);
  padding: 1.15rem 1.5rem 1.35rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(5, 21, 37, 0.22);
}

.site-header::before {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -80px;
  top: -120px;
  background: radial-gradient(circle, rgba(212, 168, 42, 0.18) 0%, transparent 68%);
  pointer-events: none;
}

.site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 50%, var(--gold) 100%);
}

.header-inner {
  max-width: var(--header-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.logo-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--gold-light), var(--gold));
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.28);
}

.logo-badge span {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--navy-deep);
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.1;
}

.logo-img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 16px;
  padding: 5px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.header-text h1 {
  font-size: clamp(1.2rem, 2.8vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.2;
}

.header-text p {
  opacity: 0.82;
  font-size: 0.9rem;
  margin-top: 0.2rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: -0.01em;
}

.nav-links {
  margin-left: auto;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--white);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.15s var(--ease);
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.32);
}

.nav-links a.active {
  background: linear-gradient(135deg, rgba(212, 168, 42, 0.35), rgba(212, 168, 42, 0.18));
  border-color: rgba(236, 201, 75, 0.65);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

/* ---------- Main ---------- */
main {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 3.25rem;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid rgba(15, 23, 42, 0.06);
  overflow: hidden;
  transition: box-shadow 0.25s var(--ease);
}

.card-header {
  padding: 1.35rem 1.5rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fff 0%, var(--surface-2) 100%);
  position: relative;
}

.card-header::after {
  content: "";
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 0;
  height: 0;
}

.card-header h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.03em;
}

.card-header p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.35rem;
  line-height: 1.5;
  font-weight: 500;
}

.card-body {
  padding: 1.5rem 1.5rem 1.6rem;
}

/* ---------- Forms ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group.full {
  grid-column: 1 / -1;
}

label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.01em;
}

label .req {
  color: var(--error);
  margin-left: 2px;
  font-weight: 700;
}

input[type="text"],
input[type="search"],
input[type="tel"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.72rem 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface-2);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
  max-width: 100%;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-strong);
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--navy-mid);
  background: #fff;
  box-shadow: var(--focus-ring);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
  font-weight: 400;
}

input.readonly,
input[readonly] {
  background: var(--surface-3);
  color: var(--muted);
  cursor: default;
}

textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}

.hint {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.4;
}

.hint-error {
  color: var(--error);
}

.hint-ok {
  color: var(--success);
}

.hint-error #icCount,
.hint-ok #icCount {
  font-weight: 800;
}

/* Photo upload */
.photo-upload {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.photo-preview {
  width: 140px;
  height: 160px;
  border-radius: 14px;
  border: 2px dashed var(--border-strong);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s var(--ease);
}

.photo-preview:hover {
  border-color: var(--gold);
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-preview .placeholder {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.5rem;
  font-weight: 500;
}

.photo-preview .placeholder svg {
  display: block;
  margin: 0 auto 0.4rem;
  opacity: 0.45;
}

.file-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.68rem 1.1rem;
  background: var(--navy);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-xs);
  transition: background 0.18s var(--ease), transform 0.12s var(--ease), box-shadow 0.18s var(--ease);
}/* ---------- File Input Button ---------- */
.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  background: #3b5998;
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid #3b5998;
  box-shadow: 0 2px 6px rgba(59, 89, 152, 0.15);
  transition: all 0.2s var(--ease);
}

.file-btn:hover {
  background: #2d4373;
  border-color: #2d4373;
  box-shadow: 0 4px 12px rgba(59, 89, 152, 0.25);
  transform: translateY(-1px);
}

.file-btn:active {
  transform: scale(0.98);
}

input[type="file"] {
  display: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  font-size: 0.925rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  line-height: 1.35;
  min-height: 44px;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none !important;
}

.btn-primary {
  background: #3b5998 !important;
  color: #ffffff !important;
  border-color: #3b5998 !important;
  box-shadow: 0 4px 14px rgba(59, 89, 152, 0.25);
}

.btn-primary:hover:not(:disabled) {
  background: #2d4373 !important;
  border-color: #2d4373 !important;
  box-shadow: 0 6px 18px rgba(59, 89, 152, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #ffffff !important;
  color: #3b5998 !important;
  border: 1.5px solid #dfe3ee !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.btn-secondary:hover:not(:disabled) {
  background: #f7f7f7 !important;
  border-color: #8b9dc3 !important;
  color: #2d4373 !important;
  transform: translateY(-1px);
}

.btn-danger {
  background: #dc2626 !important;
  color: #ffffff !important;
  border: 1px solid #dc2626 !important;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  min-height: 36px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.2);
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c !important;
  border-color: #b91c1c !important;
  transform: translateY(-1px);
}
}

.form-actions {
  margin-top: 1.6rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ---------- Alerts ---------- */
.alert {
  padding: 0.9rem 1.05rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  display: none;
  line-height: 1.45;
}

.alert.show {
  display: block;
  animation: alertIn 0.28s var(--ease);
}

@keyframes alertIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.alert-error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error-border);
}

/* ---------- Success panel ---------- */
.success-panel {
  display: none;
  text-align: center;
  padding: 2.25rem 1rem 1.5rem;
}

.success-panel.show {
  display: block;
  animation: alertIn 0.35s var(--ease);
}

.success-icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  display: grid;
  place-items: center;
  margin: 0 auto 1.1rem;
  font-size: 2rem;
  border: 1px solid var(--success-border);
  box-shadow: 0 8px 24px rgba(4, 120, 87, 0.12);
}

.success-panel h3 {
  color: var(--navy);
  margin-bottom: 0.4rem;
  font-size: 1.35rem;
  font-weight: 800;
}

.success-panel p {
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.success-details {
  text-align: left;
  background: var(--surface-2);
  border-radius: 14px;
  padding: 1.05rem 1.25rem;
  margin: 0 auto 1.5rem;
  max-width: 400px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
}

.success-details dt {
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.success-details dd {
  font-weight: 700;
  color: var(--navy);
  margin-top: 0.1rem;
}

/* ---------- Profile dashboard ---------- */
.profile-simple {
  max-width: 460px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #dfe3ee;
  box-shadow: 0 4px 20px rgba(59, 89, 152, 0.08);
  position: relative;
}

.profile-cover {
  display: none !important;
}

.profile-body {
  padding: 1.35rem 1.25rem 1.45rem;
  position: relative;
}

.profile-simple-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.15rem;
  margin-top: 0 !important;
  padding-top: 0.25rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid #dfe3ee;
}

.profile-simple-photo,
.profile-page-photo {
  width: 90px !important;
  height: 108px !important;
  object-fit: cover !important;
  object-position: center top !important;
  border-radius: 14px !important;
  border: 2px solid #dfe3ee !important;
  background: #f8fafc !important;
  display: block !important;
  box-shadow: 0 4px 14px rgba(59, 89, 152, 0.12) !important;
  flex-shrink: 0 !important;
  margin-top: 0 !important;
}

.profile-simple-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
}

.profile-serial {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  color: #3b5998;
  background: #dfe3ee;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  display: inline-block;
  width: fit-content;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
}

.profile-name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: #1e293b !important;
  line-height: 1.25;
  letter-spacing: -0.02em;
  word-break: break-word;
}

.profile-verify-line {
  margin: 0.25rem 0 0 0;
}

.verify-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #059669;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.verify-badge.pending {
  background: #d97706;
}

.pending-verify-banner {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid #fcd34d;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  color: #78350f;
}

.pending-verify-banner .pending-verify-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.pending-verify-banner strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.98rem;
}

.pending-verify-banner p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #92400e;
}

/* Unverified participants: Profile tab only (hide Acara / Jadual / Tugas until Admin Verify) */
body:not(.user-verified) .dash-tab.tab-requires-verified,
body.user-unverified .dash-tab.tab-requires-verified {
  display: none !important;
}

/* Always show Profile (details + edit) for pending users — never blank */
body:not(.user-verified) #viewProfile,
body.user-unverified #viewProfile,
#viewProfile.is-active-view {
  display: block !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

body:not(.user-verified) #viewEvent,
body:not(.user-verified) #viewSchedule,
body:not(.user-verified) #viewTugas,
body.user-unverified #viewEvent,
body.user-unverified #viewSchedule,
body.user-unverified #viewTugas {
  display: none !important;
}

body:not(.user-verified) #selfAttSection,
body.user-unverified #selfAttSection {
  display: none !important;
}

/* Header badges: Verified + Yuran */
.profile-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0.2rem 0 0.15rem;
}

.yuran-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.yuran-badge.paid {
  background: #047857;
}

.yuran-badge.unpaid {
  background: #b91c1c;
}

.profile-sub {
  margin: 0;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1.5px solid #dfe3ee;
  background: #ffffff;
  color: #3b5998;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
  flex-shrink: 0;
}
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: #f7f7f7;
  border-color: #8b9dc3;
  color: #2d4373;
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: scale(0.96);
}

.profile-section {
  margin-top: 1.2rem;
}

.profile-section-title {
  margin: 0 0 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.2;
}

.profile-details {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-2);
}

.profile-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: baseline;
  gap: 0.75rem;
  margin: 0;
  padding: 0.78rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.4;
}

.profile-row:last-child {
  border-bottom: none;
}

.profile-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.55);
}

.profile-row dt {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
}

.profile-row dd {
  margin: 0;
  color: var(--navy);
  font-weight: 700;
  font-size: 0.92rem;
  text-align: right;
  word-break: break-word;
  letter-spacing: -0.01em;
}

.profile-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.65rem;
}

/* QR block */
.profile-qr-block {
  margin-top: 1.2rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.profile-qr-block .profile-section-title {
  margin: 0 0 0.25rem;
  width: 100%;
  text-align: center;
}

.profile-qr-label {
  margin: 0 0 0.8rem;
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.35;
}

.profile-qr-box {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 0.65rem;
  width: fit-content;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  line-height: 0;
  box-shadow: var(--shadow-sm);
}

.profile-qr-box canvas,
.profile-qr-img {
  display: block;
  width: 148px;
  height: 148px;
  margin: 0 auto;
}

.profile-qr-box canvas[hidden],
.profile-qr-box img[hidden],
.nametag-qr-wrap canvas[hidden],
.nametag-qr-wrap img[hidden] {
  display: none !important;
}

.profile-qr-sn {
  margin: 0.6rem auto 0;
  width: 100%;
  text-align: center;
  font-weight: 800;
  font-size: 1rem;
  color: var(--navy);
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.photo-preview-sm {
  width: 72px;
  height: 86px;
}

.photo-upload-sm {
  grid-template-columns: 72px 1fr;
}

/* ---------- Name tag ---------- */
.nametag {
  background: linear-gradient(180deg, #fff 0%, #f7f9fc 100%);
  border: 2px solid var(--navy);
  border-radius: 16px;
  padding: 0.95rem 0.95rem 0.9rem;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.nametag-lg {
  width: 100%;
  max-width: 280px;
  padding: 1.05rem 1rem 0.95rem;
  gap: 0;
}

.nametag-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-align: left;
  width: 100%;
  margin: 0 0 0.55rem;
  padding: 0 0 0.55rem;
  border-bottom: 2px solid var(--gold);
}

.nametag-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.nametag-event {
  font-weight: 800;
  color: var(--navy);
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.nametag-serial {
  font-size: 0.78rem;
  color: var(--gold-ink);
  font-weight: 700;
  margin-top: 0.15rem;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.nametag-photo {
  width: 88px;
  height: 102px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin: 0 auto 0.4rem;
  display: block;
  background: #eee;
}

.nametag-lg .nametag-photo {
  width: 96px;
  height: 112px;
  margin-bottom: 0.4rem;
}

.nametag-name {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0;
}

.nametag-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.25rem 0 0;
  line-height: 1.4;
  font-weight: 500;
  max-width: 100%;
}

.nametag-qr-wrap {
  margin: 0.45rem 0 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.nametag-qr-wrap canvas,
.nametag-qr-wrap img {
  display: block;
  border-radius: 8px;
  width: 120px;
  height: 120px;
  margin: 0 auto;
}

.modal.tag-modal {
  max-width: 360px;
}

.tag-modal .modal-body,
#tagModal .modal-body {
  display: flex;
  justify-content: center;
  padding: 1rem 1rem 1.15rem;
}

@media (min-width: 721px) {
  #tagModal.modal-overlay {
    padding: 1rem;
    align-items: center;
    justify-content: center;
  }

  #tagModal .modal.tag-modal {
    width: 100%;
    max-width: 360px;
    height: auto;
    max-height: 90vh;
    min-height: 0;
    border-radius: var(--radius-lg);
  }

  #tagModal .modal-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
  }

  #tagModal .modal-header h3 {
    color: var(--navy);
  }

  #tagModal .modal-close {
    color: var(--muted);
  }

  #tagModal .modal-body {
    flex: none;
    background: transparent;
    padding: 1rem 1rem 1.15rem;
  }
}

@media print {
  body * {
    visibility: hidden;
  }
  #tagModal,
  #tagModal * {
    visibility: visible;
  }
  #tagModal {
    position: fixed;
    inset: 0;
    background: white;
    display: grid !important;
  }
  .modal-header,
  .modal-close {
    display: none !important;
  }
}

/* ---------- Admin toolbar / table ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.toolbar .search-box {
  flex: 1;
  min-width: 200px;
}

.stat-pill {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-sm);
}

.stat-pill span {
  color: var(--gold-light);
}

.table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: white;
}

th {
  text-align: left;
  padding: 0.85rem 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

td {
  padding: 0.75rem 0.95rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-secondary);
  font-weight: 500;
}

td strong {
  color: var(--navy);
  font-weight: 700;
  letter-spacing: 0.02em;
}

tbody tr {
  transition: background 0.15s var(--ease);
}

tbody tr:hover {
  background: #f8fafc;
}

tbody tr:last-child td {
  border-bottom: none;
}

.avatar {
  width: 44px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #eee;
  box-shadow: var(--shadow-xs);
}

.empty-state {
  text-align: center;
  padding: 3rem 1.25rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.5;
}

.empty-state strong {
  display: block;
  color: var(--navy);
  margin-bottom: 0.4rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 21, 37, 0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none !important;
  place-items: center;
  z-index: 100;
  padding: 1rem;
  pointer-events: none;
  visibility: hidden;
}

.modal-overlay.show {
  display: grid !important;
  pointer-events: auto;
  visibility: visible;
  animation: fadeIn 0.2s var(--ease);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  animation: modalUp 0.28s var(--ease);
}

@keyframes modalUp {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.05rem 1.3rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fff 0%, var(--surface-2) 100%);
  position: sticky;
  top: 0;
  z-index: 2;
}

.modal-header h3 {
  color: var(--navy);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.modal-close {
  background: var(--surface-2);
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.35rem;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
  padding: 0;
  display: grid;
  place-items: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.modal-close:hover {
  background: var(--error-bg);
  color: var(--error);
  border-color: var(--error-border);
}

.modal-body {
  padding: 1.3rem;
}

.modal-wide {
  max-width: 580px;
}

.detail-photo {
  width: 120px;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: block;
  margin: 0 auto 1rem;
  background: var(--surface-3);
  box-shadow: var(--shadow-sm);
}

.admin-detail-top {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.admin-detail .detail-photo {
  margin: 0;
  flex-shrink: 0;
}

.admin-detail-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  min-width: 140px;
}

.admin-qr-img {
  display: block;
  width: 140px;
  height: 140px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 0.4rem;
  box-sizing: border-box;
  box-shadow: var(--shadow-xs);
}

.admin-qr-missing {
  width: 140px;
  height: 140px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  background: var(--surface-2);
  font-weight: 500;
}

.admin-qr-sn {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--navy);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.admin-qr-caption {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

.admin-serial-value {
  letter-spacing: 0.04em;
  color: var(--gold-ink) !important;
}

.detail-grid {
  display: grid;
  gap: 0.55rem;
}

.detail-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.5rem;
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  background: var(--surface-2);
  border-radius: 10px;
  border: 1px solid transparent;
}

.detail-row .label {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
}

.detail-row .value {
  font-weight: 700;
  color: var(--navy);
  word-break: break-word;
  letter-spacing: -0.01em;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 1.6rem 1.25rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  letter-spacing: -0.01em;
}

/* ---------- Admin tabs ---------- */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.15rem;
  padding: 0.4rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 5;
  pointer-events: auto;
}

.admin-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: -0.015em;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease);
  pointer-events: auto;
  position: relative;
  z-index: 6;
  -webkit-tap-highlight-color: rgba(10, 39, 68, 0.12);
  touch-action: manipulation;
  user-select: none;
}

.admin-tab:hover {
  color: var(--navy);
  background: rgba(15, 23, 42, 0.04);
}

.admin-tab.active {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(10, 39, 68, 0.22);
}

.admin-logout-btn {
  margin-left: auto;
  position: relative;
  z-index: 6;
  pointer-events: auto;
}

/* Ensure admin panels respect explicit show/hide */
#overviewCard[hidden],
#eventCard[hidden],
#scheduleCard[hidden],
#adminCard[hidden] {
  display: none !important;
}

#overviewCard:not([hidden]),
#eventCard:not([hidden]),
#scheduleCard:not([hidden]),
#adminCard:not([hidden]) {
  display: block;
}

/* ---------- Schedule ---------- */
.schedule-list,
.schedule-admin-list {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.schedule-day-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.schedule-day-title {
  margin: 0;
  font-size: 0.92rem;
  color: var(--navy);
  font-weight: 800;
  letter-spacing: -0.02em;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--gold);
}

.schedule-item {
  display: grid;
  grid-template-columns: minmax(76px, auto) 1fr;
  gap: 0.8rem 1rem;
  align-items: start;
  padding: 0.95rem 1.05rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.15s var(--ease);
}

.schedule-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.schedule-item:not(:has(.schedule-time)) {
  grid-template-columns: 1fr;
}

.schedule-item-admin {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.schedule-item-main {
  display: grid;
  grid-template-columns: minmax(76px, auto) 1fr;
  gap: 0.75rem 0.9rem;
  align-items: start;
  min-width: 0;
}

.schedule-item-main:not(:has(.schedule-time)) {
  grid-template-columns: 1fr;
}

.schedule-time {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4rem 0.55rem;
  text-align: center;
  white-space: nowrap;
  line-height: 1.25;
  box-shadow: var(--shadow-xs);
  letter-spacing: -0.01em;
}

.schedule-item-title {
  margin: 0 0 0.2rem;
  font-size: 0.98rem;
  color: var(--navy);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.schedule-location {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.schedule-location::before {
  content: "📍 ";
}

.schedule-desc {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
  font-weight: 500;
}

.schedule-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ---------- Responsive / Mobile ---------- */
@media (max-width: 720px) {
  .site-header {
    padding: 0.9rem 0.95rem 1.05rem;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 0.65rem 0.75rem;
    align-items: center;
  }

  .logo-img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    padding: 3px;
  }

  .header-text {
    flex: 1;
    min-width: 0;
  }

  .header-text h1 {
    font-size: 1.05rem;
    line-height: 1.25;
  }

  .header-text p {
    font-size: 0.78rem;
    margin-top: 0.1rem;
  }

  .nav-links {
    margin-left: 0;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-start;
  }

  .nav-links a {
    font-size: 0.8rem;
    padding: 0.42rem 0.8rem;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }

  main {
    padding: 1.1rem 0.8rem 2.25rem;
    max-width: 100%;
  }

  .card {
    border-radius: 16px;
  }

  .card-header {
    padding: 1.05rem 1.05rem 0.95rem;
  }

  .card-header h2 {
    font-size: 1.08rem;
  }

  .card-header p {
    font-size: 0.84rem;
  }

  .card-body {
    padding: 1.05rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0.95rem;
  }

  input[type="text"],
  input[type="search"],
  input[type="tel"],
  input[type="password"],
  input[type="date"],
  input[type="time"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px;
    padding: 0.78rem 0.9rem;
  }

  .photo-upload {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 0.85rem;
  }

  .photo-preview {
    width: 88px;
    height: 100px;
  }

  .photo-preview-sm {
    width: 56px;
    height: 66px;
  }

  .photo-upload-sm {
    grid-template-columns: 56px 1fr;
    gap: 0.75rem;
  }

  .file-input-wrap {
    align-items: center;
    width: 100%;
  }

  .file-btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .form-actions {
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 1.2rem;
  }

  .form-actions .btn,
  .form-actions a.btn {
    width: 100%;
    min-height: 48px;
  }

  .profile-simple {
    max-width: 100%;
  }

  .profile-body {
    padding: 1.1rem 0.95rem 1.15rem;
  }

  .profile-simple-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0;
    padding-bottom: 0.95rem;
  }

  .profile-simple-photo {
    width: 68px;
    height: 82px;
    border-radius: 10px;
    border: 1px solid #dfe3ee;
  }

  .profile-serial {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
  }

  .profile-name {
    font-size: 1.05rem;
    line-height: 1.25;
    color: #1e293b !important;
  }

  .profile-sub {
    font-size: 0.78rem;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .profile-section {
    margin-top: 1rem;
  }

  .profile-section-title {
    font-size: 0.68rem;
    margin-bottom: 0.45rem;
  }

  .profile-row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
    padding: 0.7rem 0.85rem;
  }

  .profile-row dt {
    font-size: 0.74rem;
  }

  .profile-row dd {
    text-align: left;
    font-size: 0.92rem;
  }

  .profile-qr-block {
    margin-top: 1rem;
    padding-top: 1rem;
  }

  .profile-qr-label {
    font-size: 0.75rem;
    margin-bottom: 0.65rem;
    padding: 0 0.5rem;
  }

  .profile-qr-box {
    margin-left: auto;
    margin-right: auto;
  }

  .profile-qr-box canvas,
  .profile-qr-img {
    width: 112px;
    height: 112px;
  }

  .profile-qr-sn {
    font-size: 0.9rem;
    letter-spacing: 0.1em;
  }

  .profile-actions {
    flex-direction: column;
    width: 100%;
  }

  .profile-actions .btn {
    width: 100%;
  }

  .modal-overlay:not(#tagModal) {
    padding: 0.65rem;
    align-items: flex-end;
  }

  @supports (padding: max(0px)) {
    .modal-overlay:not(#tagModal) {
      padding-bottom: max(0.65rem, env(safe-area-inset-bottom));
    }
  }

  .modal-overlay:not(#tagModal) .modal {
    max-width: 100%;
    width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 14px 14px;
  }

  .modal-header {
    padding: 0.9rem 1rem;
  }

  .modal-header h3 {
    font-size: 1rem;
  }

  .modal-body {
    padding: 0.95rem 0.95rem 1.15rem;
  }

  #tagModal.modal-overlay {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
    background: rgba(5, 21, 37, 0.78);
  }

  #tagModal .modal.tag-modal {
    max-width: none;
    width: 100%;
    height: 100%;
    max-height: 100%;
    min-height: 100%;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    box-shadow: none;
    animation: none;
  }

  #tagModal .modal-header {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    padding-top: max(0.75rem, env(safe-area-inset-top));
    background: var(--navy);
    border-bottom: none;
  }

  #tagModal .modal-header h3 {
    color: #fff;
    font-size: 1rem;
  }

  #tagModal .modal-close {
    color: #fff;
    opacity: 0.95;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
  }

  #tagModal .modal-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    overflow: auto;
    background: linear-gradient(180deg, #f4f7fa 0%, #e8eef5 100%);
  }

  #tagModal .nametag-lg {
    max-width: min(320px, 92vw);
    width: 100%;
    margin: 0 auto;
    padding: 1.1rem 1rem 1rem;
  }

  #tagModal .nametag-photo,
  #tagModal .nametag-lg .nametag-photo {
    width: 100px;
    height: 118px;
    margin-bottom: 0.45rem;
  }

  #tagModal .nametag-name {
    font-size: 1.15rem;
  }

  #tagModal .nametag-meta {
    font-size: 0.8rem;
  }

  #tagModal .nametag-qr-wrap {
    margin-top: 0.5rem;
  }

  #tagModal .nametag-qr-wrap canvas,
  #tagModal .nametag-qr-wrap img {
    width: 128px;
    height: 128px;
  }

  .detail-photo {
    width: 72px;
    height: 86px;
  }

  .admin-detail-top {
    gap: 0.85rem;
  }

  .admin-detail .detail-photo {
    width: 96px;
    height: 112px;
  }

  .admin-qr-img,
  .admin-qr-missing {
    width: 120px;
    height: 120px;
  }

  .avatar {
    width: 36px;
    height: 42px;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 0.12rem;
  }

  .table-wrap {
    margin: 0 -0.1rem;
    border-radius: 12px;
  }

  table {
    font-size: 0.8rem;
  }

  th, td {
    padding: 0.55rem 0.5rem;
  }

  th:nth-child(5),
  td:nth-child(5),
  th:nth-child(6),
  td:nth-child(6) {
    display: none;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar .search-box {
    min-width: 0;
    width: 100%;
  }

  .toolbar .btn {
    width: 100%;
  }

  .stat-pill {
    text-align: center;
  }

  .site-footer {
    padding: 1.15rem 0.75rem;
    font-size: 0.75rem;
  }

  .admin-tabs {
    border-radius: 16px;
    gap: 0.35rem;
  }

  .admin-logout-btn {
    margin-left: 0;
    width: 100%;
  }

  .admin-tab {
    flex: 1 1 auto;
    text-align: center;
    padding: 0.55rem 0.75rem;
  }
}

@media (max-width: 640px) {
  .schedule-item {
    grid-template-columns: 1fr;
  }

  .schedule-item-admin {
    grid-template-columns: 1fr;
  }

  .schedule-item-main {
    grid-template-columns: 1fr;
  }

  .schedule-time {
    justify-self: start;
  }

  .schedule-item-actions {
    justify-content: stretch;
  }

  .schedule-item-actions .btn {
    flex: 1;
  }
}

@media (max-width: 400px) {
  .header-text h1 {
    font-size: 0.95rem;
  }

  .logo-img {
    width: 40px;
    height: 40px;
  }

  .profile-simple-head {
    grid-template-columns: 44px minmax(0, 1fr) 34px;
    column-gap: 0.55rem;
  }

  .profile-simple-photo {
    width: 44px;
    height: 52px;
    border-radius: 8px;
  }

  .profile-name {
    font-size: 0.95rem;
  }

  .profile-sub {
    font-size: 0.75rem;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
  }

  .icon-btn svg {
    width: 15px;
    height: 15px;
  }

  .photo-preview {
    width: 72px;
    height: 84px;
  }

  .profile-qr-box canvas,
  .profile-qr-img {
    width: 100px;
    height: 100px;
  }

  .profile-qr-sn {
    font-size: 0.85rem;
  }

  #tagModal .nametag-photo,
  #tagModal .nametag-lg .nametag-photo {
    width: 96px;
    height: 112px;
  }

  #tagModal .nametag-qr-wrap canvas,
  #tagModal .nametag-qr-wrap img {
    width: 120px;
    height: 120px;
  }
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================
   Facebook-style participant dashboard + Event feed
   ========================================================= */

.dash-body {
  padding-bottom: 2rem;
}

.dash-tabs {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
  pointer-events: auto;
}

.dash-tabs-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 0.2rem;
  padding: 0.25rem 0.35rem;
  width: 100%;
}

.dash-tab {
  flex: 1 1 0px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: -0.015em;
  padding: 0.65rem 0.2rem;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(10, 39, 68, 0.12);
  user-select: none;
  white-space: nowrap;
}

.dash-tab span:not(.dash-tab-icon) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-tab:hover {
  background: var(--surface-2);
  color: var(--navy);
}

.dash-tab.active {
  color: #3b5998;
  font-weight: 800;
}

.dash-tab.active::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #3b5998;
}

/* Red unread badge on Event tab */
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 2px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.45);
  animation: badgePop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.tab-badge[hidden] {
  display: none !important;
}

.dash-tab.has-badge {
  font-weight: 800;
}

@keyframes badgePop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.dash-tab-icon {
 font-size: 1.05rem;
 line-height: 1;
}

.dash-main {
 max-width: 680px;
 margin: 0 auto;
 padding: 1rem 0.85rem 2.5rem;
}

.dash-view[hidden],
.dash-view.is-hidden-view {
  display: none !important;
  pointer-events: none !important;
}

.dash-view.is-active-view,
.dash-view:not([hidden]) {
  display: block;
  pointer-events: auto;
}

/* Tabs must always receive taps */
.dash-tabs,
.dash-tabs-inner,
.dash-tab {
  pointer-events: auto !important;
  position: relative;
  z-index: 50;
}

/* Feed cards */
.feed-list {
 display: flex;
 flex-direction: column;
 gap: 0.85rem;
}

.feed-card {
 padding: 0;
 overflow: hidden;
}

.feed-card > .feed-card-head,
.feed-card > .feed-title,
.feed-card > .feed-body,
.feed-card > .poll-options,
.feed-card > .poll-footer,
.feed-card > .feed-hint-text {
 padding-left: 1.05rem;
 padding-right: 1.05rem;
}

.feed-card-head {
 display: flex;
 align-items: center;
 gap: 0.7rem;
 padding-top: 1rem;
 padding-bottom: 0.55rem;
}

.feed-avatar {
 width: 42px;
 height: 42px;
 border-radius: 50%;
 display: grid;
 place-items: center;
 font-weight: 800;
 font-size: 0.95rem;
 flex-shrink: 0;
 color: #fff;
 background: linear-gradient(145deg, var(--navy) 0%, var(--navy-mid) 100%);
 box-shadow: var(--shadow-xs);
}

.feed-avatar-admin {
 background: linear-gradient(145deg, var(--gold) 0%, #b8921f 100%);
 color: var(--navy-deep);
}

.feed-meta {
 display: flex;
 flex-direction: column;
 gap: 0.1rem;
 min-width: 0;
 flex: 1;
}

.feed-meta strong {
 color: var(--navy);
 font-size: 0.92rem;
 font-weight: 800;
 letter-spacing: -0.02em;
}

.feed-time {
 font-size: 0.78rem;
 color: var(--muted);
 font-weight: 500;
}

.feed-badge {
 font-size: 0.7rem;
 font-weight: 700;
 letter-spacing: 0.04em;
 text-transform: uppercase;
 padding: 0.28rem 0.55rem;
 border-radius: 999px;
 background: #eef2ff;
 color: #3730a3;
 border: 1px solid #c7d2fe;
 white-space: nowrap;
}

.feed-badge-ann {
 background: var(--gold-soft);
 color: var(--gold-ink);
 border-color: #f0d78a;
}

.feed-badge-off {
 background: var(--surface-3);
 color: var(--muted);
 border-color: var(--border);
}

.feed-title {
 margin: 0 0 0.55rem;
 font-size: 1.05rem;
 font-weight: 800;
 color: var(--navy);
 letter-spacing: -0.025em;
 line-height: 1.3;
}

.ann-content {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ann-content h2,
.ann-content h3,
.ann-content h4 {
  margin: 0;
  color: #0f172a;
  line-height: 1.3;
}

.ann-content h2 { font-size: 1.15rem; font-weight: 800; }
.ann-content h3 { font-size: 1.05rem; font-weight: 800; }
.ann-content h4 { font-size: 0.98rem; font-weight: 700; }

.ann-content p {
  margin: 0;
  color: #334155;
  line-height: 1.55;
  white-space: pre-wrap;
}

.ann-content ul,
.ann-content ol {
  margin: 0;
  padding-left: 1.25rem;
  color: #334155;
  line-height: 1.5;
}

.ann-content ul.ann-list-dash {
  list-style: none;
  padding-left: 0.15rem;
}

.ann-content ul.ann-list-dash li::before {
  content: "– ";
  color: #64748b;
  font-weight: 700;
}

.ann-content .ann-image {
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  display: block;
}

.ann-content .ann-pdf {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #991b1b;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
}

.ann-content .ann-pdf:hover {
  background: #fee2e2;
}

.feed-body {
 margin: 0 0 1.05rem;
 color: var(--text-secondary);
 font-size: 0.94rem;
 line-height: 1.55;
 font-weight: 500;
 white-space: pre-wrap;
}

.feed-body .ann-content {
  white-space: normal;
}

.feed-hint-text {
 margin: 0 0 1rem;
 color: var(--muted);
 font-size: 0.88rem;
 font-weight: 500;
 line-height: 1.45;
}

.feed-composer-hint {
 margin-bottom: 0.85rem;
}

/* Poll UI */
.poll-options {
 display: flex;
 flex-direction: column;
 gap: 0.45rem;
 margin-bottom: 0.65rem;
}

.poll-option-btn {
 width: 100%;
 text-align: left;
 border: 1.5px solid var(--border);
 background: var(--surface-2);
 color: var(--navy);
 font-family: inherit;
 font-weight: 700;
 font-size: 0.92rem;
 padding: 0.75rem 0.95rem;
 border-radius: 12px;
 cursor: pointer;
 transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.poll-option-btn:hover {
 border-color: var(--navy-mid);
 background: #fff;
 box-shadow: var(--shadow-sm);
}

.poll-option-btn:active {
 transform: scale(0.99);
}

.poll-option-result {
 position: relative;
 border: 1.5px solid var(--border);
 border-radius: 12px;
 overflow: hidden;
 background: #fff;
 min-height: 46px;
}

.poll-option-result.is-mine {
 border-color: var(--gold);
 box-shadow: 0 0 0 1px rgba(212, 168, 42, 0.25);
}

.poll-option-bar {
 position: absolute;
 inset: 0 auto 0 0;
 background: linear-gradient(90deg, rgba(212, 168, 42, 0.28), rgba(212, 168, 42, 0.12));
 max-width: 100%;
 transition: width 0.35s var(--ease);
}

.poll-option-content {
 position: relative;
 display: flex;
 justify-content: space-between;
 align-items: center;
 gap: 0.75rem;
 padding: 0.75rem 0.95rem;
 font-weight: 700;
 font-size: 0.9rem;
 color: var(--navy);
}

.poll-option-pct {
 color: var(--muted);
 font-size: 0.8rem;
 font-weight: 600;
 white-space: nowrap;
}

.poll-footer {
 margin: 0 0 1rem;
 font-size: 0.8rem;
 color: var(--muted);
 font-weight: 600;
}

/* Profile page cover */
.profile-page {
 max-width: none;
 overflow: hidden;
}

.profile-cover {
  display: none !important;
}

.profile-page-head {
  margin-top: 0 !important;
}

.profile-page-photo {
 border: 3px solid #fff;
 box-shadow: var(--shadow-sm);
 width: 88px;
 height: 104px;
}

/* Admin event composers */
.admin-composer-grid {
 display: grid;
 grid-template-columns: 1fr 1fr;
 gap: 1rem;
}

.admin-composer {
 padding: 1.1rem 1.15rem 1.15rem;
 box-shadow: var(--shadow-xs);
}

.composer-title {
 margin: 0 0 0.85rem;
 font-size: 1rem;
 font-weight: 800;
 color: var(--navy);
 letter-spacing: -0.02em;
}

.admin-composer .form-group {
 margin-bottom: 0.75rem;
}

.feed-admin-list {
 display: flex;
 flex-direction: column;
 gap: 0.75rem;
}

.feed-admin-item {
 border: 1px solid var(--border);
 border-radius: 14px;
 padding: 1rem 1.05rem;
 background: var(--surface-2);
}

.feed-admin-item-head {
 display: flex;
 flex-wrap: wrap;
 align-items: center;
 gap: 0.45rem;
 margin-bottom: 0.45rem;
}

.feed-admin-item h4 {
 margin: 0 0 0.4rem;
 font-size: 1rem;
 color: var(--navy);
 font-weight: 800;
 letter-spacing: -0.02em;
}

.feed-admin-body {
 margin: 0 0 0.75rem;
 color: var(--text-secondary);
 font-size: 0.9rem;
 line-height: 1.5;
 font-weight: 500;
}

.feed-admin-opts {
 margin: 0 0 0.5rem 1.1rem;
 color: var(--text-secondary);
 font-size: 0.88rem;
 font-weight: 500;
}

.feed-admin-opts.poll-result-list {
  list-style: none;
  margin: 0 0 0.65rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.poll-result-chip {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.poll-result-chip:hover {
  border-color: var(--navy-mid);
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}

.poll-result-label {
  font-weight: 700;
  color: var(--navy);
  font-size: 0.9rem;
}

.poll-result-meta {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: var(--navy-mid);
  text-decoration: underline;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--navy);
}

.poll-results-question {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.poll-results-toolbar {
  margin-bottom: 1rem;
}

.poll-results-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.poll-results-section {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  padding: 0.85rem 0.95rem;
}

.poll-results-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.poll-results-section-head h4 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--navy);
}

.poll-results-option-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.poll-results-option-btn:hover h4 {
  text-decoration: underline;
}

.poll-voter-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.poll-voter-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.poll-voter-avatar {
  width: 40px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface-3);
}

.poll-voter-avatar-empty {
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--muted);
  font-size: 0.9rem;
}

.poll-voter-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.poll-voter-info strong {
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 800;
}

.poll-voter-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.35;
}

.empty-state-sm {
  padding: 0.75rem 0.5rem;
  font-size: 0.85rem;
}

.poll-results-modal {
  max-width: 640px;
}

/* ---------- Admin overview / Ringkasan ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: linear-gradient(180deg, #fff 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 96px;
}

.stat-card-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat-card-sub {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.stats-charts {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
}

.stats-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.1rem 1.15rem;
  box-shadow: var(--shadow-xs);
  min-height: 220px;
}

/* Full-width row for parokhi registration cards */
.stats-panel-parokhi {
  grid-column: 1 / -1;
  min-height: 0;
}

.parokhi-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.75rem;
}

.parokhi-stat-card {
  background: linear-gradient(165deg, #f8fafc 0%, #ffffff 55%);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.85rem 0.9rem 0.75rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.parokhi-stat-card:hover {
  transform: translateY(-2px);
  border-color: #bfdbfe;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.1);
}

.parokhi-stat-card.is-empty {
  opacity: 0.72;
  background: #fafafa;
}

.parokhi-stat-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.parokhi-stat-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.parokhi-stat-pct {
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.parokhi-stat-count {
  font-size: 1.65rem;
  font-weight: 800;
  color: #1e3a8a;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.parokhi-stat-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 0.4rem;
}

.parokhi-stat-bar {
  height: 5px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: auto;
}

.parokhi-stat-bar-fill {
  height: 100%;
  border-radius: 999px;
  min-width: 0;
  transition: width 0.35s ease;
}

.stats-panel-head {
  margin-bottom: 0.85rem;
}

.stats-panel-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.stats-panel-head p {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.chart-bars {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.hbar-row {
  display: grid;
  grid-template-columns: minmax(90px, 140px) 1fr 36px;
  gap: 0.5rem;
  align-items: center;
}

.hbar-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hbar-track {
  height: 12px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}

.hbar-fill {
  height: 100%;
  border-radius: 999px;
  min-width: 0;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.hbar-value {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--navy);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.chart-bars-vertical {
  min-height: 180px;
}

.vbar-chart {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 0.3rem;
  align-items: end;
  height: 180px;
  padding-top: 0.5rem;
}

.vbar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
  gap: 0.2rem;
}

.vbar-value {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
  min-height: 0.75rem;
}

.vbar-track {
  width: 100%;
  max-width: 22px;
  flex: 1;
  background: var(--surface-3);
  border-radius: 8px 8px 4px 4px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  min-height: 40px;
}

.vbar-fill {
  width: 100%;
  border-radius: 8px 8px 4px 4px;
  min-height: 0;
  transition: height 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.vbar-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transform: rotate(-35deg);
  transform-origin: center top;
  margin-top: 0.35rem;
  max-width: 100%;
}

.stats-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.stat-mini {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-mini span {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-mini strong {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
}

@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .stats-charts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }
  .stat-card-value {
    font-size: 1.4rem;
  }
  .hbar-row {
    grid-template-columns: minmax(72px, 100px) 1fr 28px;
  }
  .vbar-chart {
    gap: 0.15rem;
    height: 160px;
  }
  .vbar-label {
    font-size: 0.55rem;
  }
}

@media (max-width: 420px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.feed-admin-opts .muted,
.muted {
 color: var(--muted);
 font-weight: 500;
}

@media (max-width: 720px) {
 .dash-tabs-inner {
 max-width: 100%;
 padding: 0.25rem 0.35rem;
 }

 .dash-tab {
 font-size: 0.82rem;
 padding: 0.7rem 0.25rem;
 gap: 0.25rem;
 }

 .dash-tab-icon {
 font-size: 1rem;
 }

 .dash-main {
 padding: 0.85rem 0.65rem 2rem;
 }

 .profile-cover {
 height: 88px;
 }

 .profile-page-photo {
 width: 72px;
 height: 86px;
 }

 .admin-composer-grid {
 grid-template-columns: 1fr;
 }
}

@media (max-width: 400px) {
 .dash-tab span:not(.dash-tab-icon) {
 font-size: 0.78rem;
 }
}

/* ========== PCS Census extras ========== */
.consent-box {
  background: var(--success-bg);
  border: 1.5px solid var(--success-border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.consent-box input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: var(--navy);
}
.consent-box label {
  font-weight: 500;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
  cursor: pointer;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.badge-pending { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.badge-approved { background: var(--success-bg); color: #047857; border: 1px solid var(--success-border); }
.badge-rejected { background: var(--error-bg); color: var(--error); border: 1px solid var(--error-border); }
.badge-staff { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.waiting-hero {
  text-align: center;
  padding: 1.5rem 1rem 0.5rem;
}
.waiting-hero .clock {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.profile-hero {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.profile-hero img, .avatar-lg {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-light);
  background: var(--surface-2);
}
.avatar-lg.placeholder {
  display: grid;
  place-items: center;
  font-size: 2rem;
  color: var(--muted);
}
.married-fields.hidden, .hidden { display: none !important; }
.children-list { display: flex; flex-direction: column; gap: 0.65rem; }
.child-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
  align-items: end;
}
@media (max-width: 640px) {
  .child-row { grid-template-columns: 1fr; }
}
.family-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 0.5rem;
}
.tree-couple {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
}
.tree-node {
  text-align: center;
  width: 130px;
}
.tree-node img, .tree-node .tree-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--navy);
  background: var(--surface-2);
  margin: 0 auto 0.45rem;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
}
.tree-node .name { font-weight: 700; font-size: 0.88rem; color: var(--navy); line-height: 1.25; }
.tree-node .meta { font-size: 0.75rem; color: var(--muted); }
.tree-connector {
  width: 2px;
  height: 28px;
  background: var(--border-strong);
}
.tree-children {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  max-width: 100%;
}
.tree-children .tree-node img, .tree-children .tree-avatar {
  border-color: var(--blue-accent);
  width: 60px;
  height: 60px;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 640px) {
  .stats-row { grid-template-columns: 1fr; }
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
}
.stat-card .num { font-size: 1.6rem; font-weight: 800; color: var(--navy); }
.stat-card .lbl { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
  align-items: center;
}
.admin-toolbar input, .admin-toolbar select {
  max-width: 220px;
}
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
table.data-table th, table.data-table td {
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
table.data-table th {
  background: var(--surface-2);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
}
table.data-table tr:hover td { background: #f8fafc; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.btn-xs {
  padding: 0.3rem 0.55rem;
  font-size: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  color: var(--navy);
}
.btn-xs:hover { background: var(--surface-2); }
.btn-xs.success { background: var(--success-bg); border-color: var(--success-border); color: #047857; }
.btn-xs.danger { background: var(--error-bg); border-color: var(--error-border); color: var(--error); }
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem 1rem;
  overflow-y: auto;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 720px;
  box-shadow: var(--shadow-lg);
  margin: auto;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.1rem; }
.modal-body { padding: 1.25rem; }
.modal-close {
  border: none; background: transparent; font-size: 1.4rem;
  cursor: pointer; color: var(--muted); line-height: 1;
}
.tabs-bar {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  padding: 0 0.25rem;
}
.tabs-bar button {
  border: none;
  background: transparent;
  padding: 0.7rem 1rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  font-size: 0.9rem;
}
.tabs-bar button.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 560px) {
  .photo-grid { grid-template-columns: 1fr; }
}
.photo-card {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.photo-card img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 0.75rem;
  border: 2px solid var(--border);
}
.hero-landing {
  text-align: center;
  padding: 2rem 1rem 1rem;
}
.hero-landing .logo-big {
  width: 96px;
  height: 96px;
  object-fit: contain;
  background: #fff;
  border-radius: 20px;
  padding: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}
.info-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  text-align: left;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.info-list li {
  padding: 0.45rem 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  border-bottom: 1px solid var(--border);
}
.info-list li::before {
  content: "? ";
  color: var(--success);
  font-weight: 700;
}
.alert {
  display: none;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.alert.show { display: block; }
.alert-error { background: var(--error-bg); color: var(--error); border: 1px solid var(--error-border); }
.alert-success { background: var(--success-bg); color: #047857; border: 1px solid var(--success-border); }
.alert-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}
.detail-grid .full { grid-column: 1 / -1; }
.detail-item label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.15rem;
}
.detail-item .val {
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}
@media (max-width: 560px) {
  .detail-grid { grid-template-columns: 1fr; }
}
