:root {
  --admin-bg: #f2f7fb;
  --admin-surface: #ffffff;
  --admin-surface-soft: rgba(255, 255, 255, 0.72);
  --admin-text: #132238;
  --admin-muted: #607089;
  --admin-border: rgba(26, 50, 83, 0.12);
  --admin-shadow: 0 24px 80px rgba(31, 64, 104, 0.14);
  --admin-shadow-soft: 0 12px 36px rgba(31, 64, 104, 0.10);
  --sidebar-width: 284px;
  --topbar-height: 88px;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --primary: #2663ff;
  --primary-dark: #1e2e7b;
  --success: #0a9f78;
  --warning: #d97706;
  --danger: #dc2626;
  --purple: #7c3aed;
  --pink: #db2777;
  --teal: #0891b2;
  --orange: #ea580c;
}

* {
  box-sizing: border-box;
}

.admin-dashboard-body {
  min-height: 100vh;
  margin: 0;
  color: var(--admin-text);
  background:
    radial-gradient(circle at 12% 8%, rgba(38, 99, 255, 0.18), transparent 30%),
    radial-gradient(circle at 88% 12%, rgba(219, 39, 119, 0.16), transparent 30%),
    linear-gradient(135deg, #f8fbff 0%, #eef7ff 45%, #fdf7ff 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.admin-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  color: #f8fbff;
  background:
    linear-gradient(155deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 101, 0.98) 42%, rgba(76, 29, 149, 0.96)),
    radial-gradient(circle at top left, rgba(45, 212, 191, 0.35), transparent 28%);
  box-shadow: 18px 0 60px rgba(15, 23, 42, 0.22);
  overflow-y: auto;
  z-index: 20;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 12px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand strong {
  font-size: 16px;
  letter-spacing: -0.02em;
}

.sidebar-brand span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 16px;
  color: #10203c;
  font-weight: 900;
  letter-spacing: -0.05em;
  background: linear-gradient(135deg, #ffffff, #67e8f9 48%, #a78bfa);
  box-shadow: 0 14px 28px rgba(14, 165, 233, 0.28);
}

.sidebar-menu {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 13px 14px;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: left;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border 0.2s ease;
}

.menu-item:hover,
.menu-item:focus-visible {
  transform: translateX(4px);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.10);
  outline: none;
}

.menu-item.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0.10));
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 16px 34px rgba(0, 0, 0, 0.18);
}

.menu-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.13);
  font-weight: 900;
}

.sidebar-footer {
  margin-top: 26px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-footer p {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
}

.sidebar-footer a {
  color: #b5f4ff;
  font-weight: 800;
  text-decoration: none;
}

.admin-main {
  min-width: 0;
  padding: 22px 28px 44px;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: -22px -28px 24px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--admin-border);
  background: rgba(248, 251, 255, 0.82);
  backdrop-filter: blur(18px);
}

.topbar-title h1 {
  margin: 2px 0 0;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.05em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.global-search {
  position: relative;
  display: block;
}

.global-search span {
  position: absolute;
  left: 14px;
  top: 8px;
  color: var(--admin-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.global-search input {
  width: min(300px, 28vw);
  min-width: 190px;
  height: 50px;
  padding: 22px 14px 7px;
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  color: var(--admin-text);
  background: var(--admin-surface-soft);
  box-shadow: var(--admin-shadow-soft);
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 8px 12px;
  border: 1px solid var(--admin-border);
  border-radius: 18px;
  background: var(--admin-surface-soft);
  box-shadow: var(--admin-shadow-soft);
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 800;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--purple));
}

.icon-button,
.ghost-button,
.danger-button,
.primary-button,
.mini-button {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.icon-button:hover,
.ghost-button:hover,
.danger-button:hover,
.primary-button:hover,
.mini-button:hover {
  transform: translateY(-1px);
}

.sidebar-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--purple));
}

.ghost-button,
.mini-button {
  border: 1px solid var(--admin-border);
  color: var(--primary-dark);
  background: var(--admin-surface);
}

.ghost-button {
  min-height: 50px;
  padding: 0 16px;
  border-radius: 16px;
  box-shadow: var(--admin-shadow-soft);
}

.danger-button {
  min-height: 50px;
  padding: 0 16px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 16px 32px rgba(220, 38, 38, 0.20);
}

.primary-button {
  min-height: 50px;
  padding: 0 18px;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  box-shadow: 0 16px 32px rgba(38, 99, 255, 0.22);
}

.mini-button {
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.dashboard-message {
  min-height: 0;
  margin: 0 0 16px;
}

.dashboard-message:empty {
  display: none;
}

.view-section {
  display: none;
  animation: sectionIn 0.28s ease both;
}

.view-section.active {
  display: block;
}

@keyframes sectionIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-card,
.section-header-card,
.dashboard-card,
.stat-card,
.quick-action {
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-xl);
  background: var(--admin-surface-soft);
  box-shadow: var(--admin-shadow);
  backdrop-filter: blur(14px);
}

.hero-card {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  padding: clamp(24px, 4vw, 42px);
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.96), rgba(124, 58, 237, 0.92) 48%, rgba(219, 39, 119, 0.88)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.28), transparent 36%);
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -120px;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
}

.hero-card .eyebrow {
  color: #dbeafe;
}

.hero-card h2,
.section-header-card h2 {
  margin: 8px 0 10px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
  letter-spacing: -0.06em;
}

.hero-card p,
.section-header-card p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
  line-height: 1.7;
}

.hero-pulse {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(190px, 24vw);
  min-width: 130px;
  place-items: center;
}

.hero-pulse span {
  position: absolute;
  width: 96px;
  height: 96px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  animation: pulse 2.4s ease-in-out infinite;
}

.hero-pulse span:nth-child(2) { width: 140px; height: 140px; animation-delay: 0.25s; }
.hero-pulse span:nth-child(3) { width: 180px; height: 180px; animation-delay: 0.5s; }

@keyframes pulse {
  0%, 100% { transform: scale(0.92); opacity: 0.38; }
  50% { transform: scale(1.03); opacity: 0.92; }
}

.section-header-card {
  margin-bottom: 20px;
  padding: 30px;
  color: #ffffff;
  overflow: hidden;
}

.notices-gradient { background: linear-gradient(135deg, #0ea5e9, #2563eb 48%, #7c3aed); }
.designations-gradient { background: linear-gradient(135deg, #10b981, #0891b2 52%, #2563eb); }
.events-gradient { background: linear-gradient(135deg, #f97316, #db2777 48%, #7c3aed); }
.users-gradient { background: linear-gradient(135deg, #2563eb, #06b6d4 52%, #10b981); }
.membership-gradient { background: linear-gradient(135deg, #7c3aed, #db2777 52%, #f97316); }
.audit-gradient { background: linear-gradient(135deg, #111827, #334155 48%, #7c3aed); }
.help-gradient { background: linear-gradient(135deg, #0f766e, #2563eb 52%, #1d4ed8); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 16px;
  margin: 18px 0;
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -32px;
  top: -42px;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: var(--card-glow, rgba(37, 99, 235, 0.12));
}

.stat-label {
  display: block;
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 900;
}

.stat-value {
  display: block;
  margin-top: 8px;
  font-size: 38px;
  font-weight: 950;
  letter-spacing: -0.08em;
}

.stat-note {
  display: block;
  margin-top: 8px;
  color: var(--admin-muted);
  font-size: 13px;
}

.stat-icon {
  display: grid;
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: var(--card-gradient, linear-gradient(135deg, var(--primary), var(--purple)));
}

.content-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.two-columns {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.form-and-table {
  align-items: start;
}

.wide-form {
  grid-template-columns: minmax(330px, 0.78fr) minmax(0, 1fr);
}

.dashboard-card {
  padding: 20px;
  overflow: hidden;
}

.dashboard-card h3 {
  margin: 0 0 12px;
  letter-spacing: -0.03em;
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.card-heading h3,
.card-heading p {
  margin: 0;
}

.muted-text {
  color: var(--admin-muted);
  font-size: 13px;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.quick-action {
  min-height: 118px;
  padding: 20px;
  color: #ffffff;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 17px;
  font-weight: 950;
  text-align: left;
  letter-spacing: -0.03em;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.quick-action:hover {
  transform: translateY(-3px);
}

.notice-bg { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.event-bg { background: linear-gradient(135deg, #f97316, #db2777); }
.member-bg { background: linear-gradient(135deg, #7c3aed, #db2777); }
.user-bg { background: linear-gradient(135deg, #10b981, #0891b2); }

.modern-form {
  display: grid;
  gap: 14px;
}

.modern-form label {
  display: grid;
  gap: 7px;
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 900;
}

.modern-form input,
.modern-form textarea,
.modern-form select {
  width: 100%;
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  padding: 12px 13px;
  color: var(--admin-text);
  background: #ffffff;
  font: inherit;
  font-weight: 650;
  outline: none;
  transition: border 0.18s ease, box-shadow 0.18s ease;
}

.modern-form textarea {
  resize: vertical;
}

.modern-form input:focus,
.modern-form textarea:focus,
.modern-form select:focus {
  border-color: rgba(37, 99, 235, 0.48);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.checkbox-line {
  display: flex !important;
  grid-template-columns: unset !important;
  align-items: center;
  gap: 9px !important;
}

.checkbox-line input {
  width: auto;
}

.table-card {
  min-width: 0;
}

.full-width-card {
  margin-top: 18px;
}

.enhanced-table-wrap {
  width: 100%;
  max-height: 580px;
  overflow: auto;
  border: 1px solid var(--admin-border);
  border-radius: 18px;
  background: #ffffff;
}

.small-table {
  max-height: 390px;
}

.enhanced-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  background: #ffffff;
}

.enhanced-table th,
.enhanced-table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.enhanced-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #475569;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.enhanced-table td {
  color: #334155;
  font-weight: 650;
}

.enhanced-table tbody tr:hover {
  background: #f8fbff;
}

.table-empty {
  padding: 26px;
  color: var(--admin-muted);
  text-align: center;
  font-weight: 800;
}

.status-chip,
.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-chip::before,
.role-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.status-active,
.status-published,
.status-success {
  color: #047857;
  background: #dcfce7;
}

.status-draft,
.status-pending {
  color: #b45309;
  background: #fef3c7;
}

.status-closed,
.status-archived,
.status-inactive,
.status-expired,
.status-cancelled,
.status-blocked,
.status-failed {
  color: #b91c1c;
  background: #fee2e2;
}

.status-super_admin,
.status-admin {
  color: #5b21b6;
  background: #ede9fe;
}

.status-supervisor {
  color: #0369a1;
  background: #e0f2fe;
}

.status-member {
  color: #047857;
  background: #dcfce7;
}

.activity-list {
  display: grid;
  gap: 10px;
}

.activity-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  background: #ffffff;
}

.activity-dot {
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.10);
}

.activity-title {
  margin: 0;
  color: var(--admin-text);
  font-weight: 950;
}

.activity-meta {
  margin: 4px 0 0;
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 700;
}

.mini-chart {
  display: grid;
  gap: 12px;
}

.chart-row {
  display: grid;
  grid-template-columns: 120px 1fr 48px;
  align-items: center;
  gap: 12px;
}

.chart-label {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 900;
}

.chart-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.chart-fill {
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--purple));
}

.chart-value {
  color: var(--admin-text);
  font-size: 13px;
  font-weight: 950;
  text-align: right;
}

.pretty-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pretty-list li {
  position: relative;
  padding: 14px 14px 14px 42px;
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  background: #ffffff;
  color: #334155;
  font-weight: 750;
}

.pretty-list li::before {
  content: "✓";
  position: absolute;
  left: 14px;
  top: 14px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 7px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--success), var(--teal));
  font-size: 12px;
  font-weight: 950;
}

.security-list li::before {
  content: "!";
  background: linear-gradient(135deg, var(--warning), var(--orange));
}

.loading-row td {
  color: var(--admin-muted);
}

@media (max-width: 1180px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-105%);
    transition: transform 0.24s ease;
  }

  .admin-shell.sidebar-open .admin-sidebar {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: grid;
    place-items: center;
  }

  .stat-grid,
  .quick-action-grid {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }

  .two-columns,
  .wide-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .admin-main {
    padding: 18px 16px 34px;
  }

  .admin-topbar {
    align-items: flex-start;
    margin: -18px -16px 18px;
    padding: 14px 16px;
    flex-wrap: wrap;
  }

  .topbar-actions {
    width: 100%;
    justify-content: stretch;
  }

  .global-search,
  .global-search input,
  .ghost-button,
  .danger-button,
  .admin-profile {
    width: 100%;
  }

  .stat-grid,
  .quick-action-grid,
  .form-grid,
  .form-grid.three {
    grid-template-columns: 1fr;
  }

  .hero-card {
    display: block;
  }

  .hero-pulse {
    display: none;
  }

  .section-header-card,
  .dashboard-card {
    padding: 18px;
    border-radius: 22px;
  }

  .chart-row {
    grid-template-columns: 92px 1fr 38px;
  }
}

/* Event edit/delete upgrade */
.hidden {
  display: none !important;
}

.form-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.form-title-row h3 {
  margin-bottom: 4px;
}

.edit-mode-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--orange), var(--pink));
  box-shadow: 0 12px 28px rgba(219, 39, 119, 0.22);
}

.json-help-box {
  display: grid;
  gap: 5px;
  border: 1px dashed rgba(37, 99, 235, 0.30);
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--admin-muted);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(124, 58, 237, 0.07));
  font-size: 13px;
  line-height: 1.55;
}

.json-help-box strong {
  color: var(--admin-text);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
}

.danger-mini {
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.25);
  background: #fff5f5;
}

.action-edit {
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.22);
  background: #eff6ff;
}

.muted-action-text {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

#eventsTable th:last-child,
#eventsTable td:last-child {
  min-width: 150px;
}

/* Upgrade: event registration report, early bird pricing, profile approval modal */
.early-bird-box,
.report-filter-card {
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 20px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.07), rgba(6, 182, 212, 0.08));
}

.inline-report-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 16px;
}

.report-actions {
  align-items: center;
  flex-wrap: wrap;
}

.report-table-wrap {
  max-height: 65vh;
}

#eventRegistrationsTable th,
#eventRegistrationsTable td {
  white-space: nowrap;
}

.admin-dialog.hidden {
  display: none;
}

.admin-dialog {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 22px;
}

.admin-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(8px);
}

.admin-dialog-card {
  position: relative;
  width: min(540px, 96vw);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 30px;
  padding: 30px;
  text-align: center;
  background: linear-gradient(135deg, #ffffff, #f8fbff);
  box-shadow: 0 34px 100px rgba(15, 23, 42, 0.32);
  animation: adminDialogIn 0.18s ease-out;
}

@keyframes adminDialogIn {
  from { transform: translateY(12px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.dialog-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 14px;
  color: #475569;
  background: #eef2ff;
  font-size: 24px;
  cursor: pointer;
}

.dialog-icon {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 24px;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  font-size: 34px;
  font-weight: 900;
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.26);
}

.admin-dialog.success .dialog-icon {
  background: linear-gradient(135deg, #059669, #10b981);
}

.admin-dialog.error .dialog-icon {
  background: linear-gradient(135deg, #dc2626, #f97316);
}

.admin-dialog.warning .dialog-icon {
  background: linear-gradient(135deg, #d97706, #f59e0b);
}

.admin-dialog-card h3 {
  margin: 0 0 10px;
  color: #111827;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.04em;
}

.admin-dialog-card p {
  margin: 0 0 24px;
  white-space: pre-wrap;
  color: #334155;
  font-size: 18px;
  line-height: 1.55;
}

.dialog-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .inline-report-form {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Complete mobile/tablet responsive upgrade for admin panel
   ========================================================= */
.admin-dashboard-body {
  overflow-x: hidden;
}

.admin-shell,
.admin-main,
.admin-topbar,
.view-section,
.dashboard-card,
.section-header-card,
.hero-card,
.content-grid,
.form-grid,
.table-wrap {
  min-width: 0;
}

.sidebar-toggle {
  display: none;
}

.enhanced-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.enhanced-table {
  min-width: 760px;
}

#eventRegistrationsTable,
#auditTable,
#usersTable,
#eventsTable {
  min-width: 960px;
}

.admin-dialog {
  overscroll-behavior: contain;
}

@media (max-width: 1180px) {
  .admin-shell {
    grid-template-columns: 1fr !important;
  }

  .admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(330px, 88vw);
    max-width: 88vw;
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    z-index: 40;
  }

  .admin-shell.sidebar-open .admin-sidebar {
    transform: translateX(0);
  }

  .admin-shell.sidebar-open::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(4px);
  }

  .sidebar-toggle {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
  }

  .admin-main {
    width: 100%;
    padding-inline: 22px;
  }

  .admin-topbar {
    margin-inline: -22px;
    padding-inline: 22px;
  }

  .content-grid.two-columns,
  .content-grid.three-columns,
  .wide-form,
  .two-columns {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 900px) {
  .admin-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .global-search {
    grid-column: 1 / -1;
  }

  .global-search input,
  .admin-profile,
  .ghost-button,
  .danger-button,
  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .stat-grid,
  .quick-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .inline-report-form {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  .admin-main {
    padding: 14px 12px 28px;
  }

  .admin-topbar {
    min-height: 0;
    margin: -14px -12px 16px;
    padding: 12px;
  }

  .topbar-title h1 {
    font-size: 26px;
    line-height: 1.12;
  }

  .topbar-actions {
    grid-template-columns: 1fr;
  }

  .stat-grid,
  .quick-action-grid,
  .form-grid,
  .form-grid.three {
    grid-template-columns: 1fr !important;
  }

  .hero-card,
  .section-header-card,
  .dashboard-card {
    padding: 18px;
    border-radius: 20px;
  }

  .card-heading,
  .form-title-row,
  .report-actions,
  .form-actions,
  .row-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .card-heading > *,
  .form-actions > *,
  .row-actions > *,
  .report-actions > *,
  .dialog-actions > *,
  .primary-button,
  .ghost-button,
  .danger-button,
  .secondary-button,
  .small-button,
  .action-edit,
  .danger-mini {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .admin-sidebar {
    width: min(310px, 90vw);
    padding: 18px 14px;
  }

  .sidebar-brand {
    padding-bottom: 16px;
  }

  .menu-item {
    min-height: 48px;
    border-radius: 16px;
  }

  .admin-dialog {
    padding: 12px;
  }

  .admin-dialog-card {
    width: 100%;
    padding: 24px 18px;
    border-radius: 22px;
  }

  .dialog-icon {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    font-size: 28px;
  }

  .admin-dialog-card p {
    font-size: 16px;
  }
}

@media (max-width: 420px) {
  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .admin-profile {
    align-items: flex-start;
    flex-direction: column;
  }

  .enhanced-table,
  #eventRegistrationsTable,
  #auditTable,
  #usersTable,
  #eventsTable {
    min-width: 780px;
  }
}

/* Admin additions - divisions, event codes, password reset */
.registration-code-box {
  padding: 1rem;
  border: 1px solid rgba(124, 58, 237, .16);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(124, 58, 237, .08), rgba(6, 182, 212, .08));
}
.password-reset-admin-form { max-width: 760px; }
@media (max-width: 800px) {
  .registration-code-box { padding: .8rem; }
  .password-reset-admin-form { max-width: 100%; }
}

/* SSLCommerz manual confirmation action */
.mini-button.danger-soft {
  color: #991b1b;
  border-color: rgba(220, 38, 38, 0.28);
  background: #fff1f2;
}

.mini-button.danger-soft:hover {
  box-shadow: 0 12px 24px rgba(220, 38, 38, 0.14);
}


.txn-code-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 260px;
  flex-wrap: wrap;
}

.txn-code {
  display: inline-block;
  max-width: 180px;
  padding: 4px 7px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.txn-copy-btn {
  padding: 4px 8px;
  min-height: 28px;
  font-size: 11px;
}

.ssl-status-text {
  display: inline-block;
  min-width: 110px;
  max-width: 220px;
  font-size: 12px;
  line-height: 1.35;
  color: #334155;
}

@media (max-width: 768px) {
  .txn-code-box {
    max-width: 220px;
  }
  .txn-code {
    max-width: 150px;
  }
}
