@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #172b32;
  --muted: #74848a;
  --line: #e4eaeb;
  --canvas: #f4f7f7;
  --white: #fff;
  --green: #236b57;
  --green-dark: #174d40;
  --green-soft: #e7f3ee;
  --blue: #e8f1fb;
  --orange: #fff0e4;
  --shadow: 0 8px 26px rgba(28, 53, 59, 0.045);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
strong {
  font-family: Manrope, sans-serif;
}

h1 {
  font-size: 28px;
  letter-spacing: -0.8px;
  margin: 3px 0 0;
}

h2 {
  font-size: 21px;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

h3 {
  font-size: 15px;
  margin-bottom: 5px;
}

p {
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 0;
}

.dashboard {
  min-height: 100vh;
}

.sidebar {
  width: 242px;
  background: #fff;
  border-right: 1px solid var(--line);
  position: fixed;
  inset: 0 auto 0 0;
  padding: 28px 17px 20px;
  display: flex;
  flex-direction: column;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
  padding: 0 9px 38px;
}

.brand-mark {
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  width: 39px;
  height: 39px;
  border-radius: 12px;
  font-family: Manrope;
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
}

.brand strong,
.admin-chip strong {
  display: block;
  font-size: 13px;
}

.brand small,
.admin-chip small,
.sidebar-bottom small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1.2px;
  margin-top: 4px;
}

.nav-label,
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: #8b999d;
}

.nav-label {
  padding: 0 12px;
  margin-bottom: 10px;
}

.side-nav {
  display: grid;
  gap: 5px;
}

.nav-link {
  border: 0;
  background: transparent;
  color: #687b80;
  padding: 13px 12px;
  border-radius: 9px;
  text-align: left;
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.15s ease;
}

.nav-link span {
  font-size: 18px;
  width: 21px;
  text-align: center;
  line-height: 1;
  flex-shrink: 0;
}

.nav-link:hover,
.nav-link.active {
  background: var(--green-soft);
  color: var(--green-dark);
}

.sidebar-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 11px;
  background: #f7f9f8;
  border-radius: 11px;
}

.sidebar-bottom strong {
  font-size: 12px;
}

.sidebar-bottom small {
  letter-spacing: 0;
  font-size: 10px;
}

.status-dot {
  width: 9px;
  height: 9px;
  background: #45a47e;
  border-radius: 50%;
  box-shadow: 0 0 0 4px #dff2e8;
  flex-shrink: 0;
}

.main {
  margin-left: 242px;
  padding: 0 34px 40px;
  max-width: 1800px;
}

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.bc-brand {
  color: #7b8e92;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.bc-sep {
  color: #c4d0cd;
  font-size: 12px;
  user-select: none;
}

.bc-section {
  color: #7b8e92;
  font-weight: 500;
}

.bc-current {
  color: var(--ink);
  font-weight: 700;
  font-size: 13.5px;
}

.topbar-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  color: #246f50;
  background: #eaf5ef;
  border: 1px solid #c9e4d5;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.2px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: #3eb57f;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(62, 181, 127, 0.25);
  animation: pulse-ring 2.4s infinite ease-in-out;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(62, 181, 127, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(62, 181, 127, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 181, 127, 0); }
}

.admin-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 5px 12px 5px 6px;
  border-radius: 24px;
  box-shadow: 0 2px 6px rgba(28, 53, 59, 0.04);
}

.admin-chip .avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: #e2f0e9;
  color: var(--green);
  font-weight: 800;
  font-size: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.admin-meta {
  display: flex;
  flex-direction: column;
}

.admin-meta strong {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.admin-role-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.3px;
}

.logout-btn {
  margin-left: 4px;
  border: 1px solid #e1e8e5;
  background: #f7f9f8;
  color: #63777c;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.logout-btn:hover {
  background: #fdeeee;
  color: #dc3545;
  border-color: #f5c2c7;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.welcome-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 22px;
}

.page-main-heading {
  font-size: clamp(22px, 2.4vw, 27px);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 6px 0;
}

.page-subheading {
  font-size: 13.5px;
  color: #6c7e82;
  margin: 0;
  max-width: 70ch;
  line-height: 1.5;
}

.welcome-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.season-tag {
  white-space: nowrap;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.7px;
  color: var(--green);
  background: #e7f3ed;
  padding: 9px 12px;
  border-radius: 6px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(28, 53, 59, 0.08);
}

.stat-card.stat-interactive {
  cursor: pointer;
  position: relative;
  user-select: none;
}

.stat-card.stat-interactive:hover {
  border-color: #a4bdb7;
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(28, 53, 59, 0.12);
}

.stat-card.stat-interactive.active {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(47, 95, 78, 0.22), 0 8px 24px rgba(28, 53, 59, 0.08);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}

.stat-icon.blue {
  background: var(--blue);
  color: #356fa9;
}

.stat-icon.green {
  background: var(--green-soft);
  color: var(--green);
}

.stat-icon.orange {
  background: var(--orange);
  color: #b96b2d;
}

.stat-icon.purple {
  background: rgba(124, 58, 237, 0.14);
  color: #7c3aed;
}

.stat-icon.red {
  background: rgba(230, 57, 70, 0.14);
  color: #e63946;
}

.stat-icon.gold {
  background: rgba(200, 169, 107, 0.22);
  color: #9d7b32;
}

.stat-card p {
  font-size: 12px;
  margin-bottom: 4px;
}

.stat-card strong {
  font-size: 24px;
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 22px;
  margin-bottom: 23px;
  box-shadow: var(--shadow);
  min-width: 0;
}

/* ========================================================
   ACCORDION PANELS SYSTEM (ONE AT A TIME PER DASHBOARD VIEW)
   ======================================================== */
.panel.accordion-panel {
  padding: 0;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  margin-bottom: 20px;
}

.panel.accordion-panel:hover {
  border-color: #cbdad5;
}

.panel.accordion-panel.is-open {
  border-color: rgba(47, 95, 78, 0.4);
  box-shadow: 0 8px 26px rgba(47, 95, 78, 0.08);
}

.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
  user-select: none;
  background: #ffffff;
  border-bottom: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
  margin-bottom: 0;
}

.accordion-trigger:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

.panel.accordion-panel:not(.is-open) .accordion-trigger:hover {
  background: #f8faf9;
}

.panel.accordion-panel.is-open .accordion-trigger {
  background: #fbfdfc;
  border-bottom: 1px solid var(--line);
}

.accordion-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.accordion-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 9.5px var(--font-mono, monospace);
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: 5px;
  background: #eef3f1;
  color: #4b665c;
  text-transform: uppercase;
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease;
}

.panel.accordion-panel.is-open .accordion-badge {
  background: var(--green);
  color: #ffffff;
}

.accordion-title-group h3,
.accordion-title-group h2 {
  margin: 0 0 3px 0;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.accordion-title-group p {
  margin: 0;
  font-size: 12.5px;
  color: #6c7e82;
}

.accordion-toggle-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.accordion-state-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7a8e8b;
  transition: color 0.2s ease;
}

.panel.accordion-panel.is-open .accordion-state-label {
  color: var(--green);
}

.accordion-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f0f4f2;
  color: #3b5048;
  font-size: 14px;
  line-height: 1;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease, color 0.2s ease;
}

.panel.accordion-panel:hover .accordion-chevron {
  background: #e2ede8;
}

.panel.accordion-panel.is-open .accordion-chevron {
  transform: rotate(180deg);
  background: var(--green);
  color: #ffffff;
}

.accordion-body {
  padding: 24px;
  display: none;
  animation: accordionFadeSlide 0.25s ease forwards;
}

.panel.accordion-panel.is-open .accordion-body {
  display: block;
}

@keyframes accordionFadeSlide {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.panel-heading p {
  font-size: 12px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: 0.15s ease;
  width:200px;
}

.btn-primary {
  background: var(--green);
  color: #fff;
}

.btn-primary:hover {
  background: var(--green-dark);
}

.btn-secondary {
  background: #fff;
  border-color: #dce5e5;
  color: #334b50;
}

.btn-secondary:hover {
  background: #f7faf9;
}

.btn-ghost {
  background: #f1f5f4;
  color: #52686c;
}

.btn-ghost:hover {
  background: #e6ecea;
}

.tabs {
  display: flex;
  gap: 7px;
  border-bottom: 1px solid var(--line);
  margin: 0 -22px;
  padding: 0 22px;
}

.tab {
  padding: 12px 15px 13px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #7b898d;
  font-weight: 700;
  font-size: 12px;
  margin-bottom: -1px;
}

.tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

.tab span {
  background: #edf1f1;
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 10px;
  margin-left: 5px;
}

.table-panel {
  padding: 20px 22px 18px;
}

.table-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 8px;
}

.table-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tab-badge {
  display: inline-block;
  background: #edf3f0;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 6px;
  line-height: 1.2;
}

.tab.active .tab-badge {
  background: var(--green);
  color: #ffffff;
}

.filter-dropdown-wrap {
  display: flex;
  align-items: center;
  position: relative;
  background: #f7faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px 0 10px;
  height: 38px;
  transition: all 0.2s ease;
}

.filter-dropdown-wrap:focus-within {
  border-color: var(--green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 95, 78, 0.12);
}

.filter-icon {
  font-size: 13px;
  color: var(--muted);
  margin-right: 6px;
  pointer-events: none;
}

.filter-select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  outline: none;
  padding-right: 10px;
}

.subcategory-pills-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 10px 0 12px;
  margin-bottom: 6px;
  border-bottom: 1px dashed var(--line);
}

.sub-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #4b6065;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.sub-pill:hover {
  background: #f0f5f3;
  border-color: #bcd1cc;
  color: var(--ink);
  transform: translateY(-1px);
}

.sub-pill.active {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
  box-shadow: 0 3px 10px rgba(28, 53, 59, 0.18);
}

.sub-pill-badge {
  display: inline-block;
  background: rgba(0, 0, 0, 0.08);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
}

.sub-pill.active .sub-pill-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.table-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.meta-filter-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #eef5f2;
  border: 1px solid #cbe0d9;
  color: var(--green);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11px;
}

.clear-filter-btn {
  background: none;
  border: none;
  color: #8a999d;
  cursor: pointer;
  padding: 0 2px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.clear-filter-btn:hover {
  color: #c92a2a;
}

/* Category Badges for all 11 categories in tables */
.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.cat-pill.cat-rescuer {
  background: #fde8e8;
  color: #c92a2a;
  border: 1px solid #f8b4b4;
}

.cat-pill.cat-mountaineer {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.cat-pill.cat-trekker {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.cat-pill.cat-hiker {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.cat-pill.cat-student {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.cat-pill.cat-media {
  background: #fce7f3;
  color: #be185d;
  border: 1px solid #fbcfe8;
}

.cat-pill.cat-guest {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fef08a;
}

.cat-pill.cat-sponsors,
.cat-pill.cat-sponsor {
  background: #ccfbf1;
  color: #0f766e;
  border: 1px solid #99f6e4;
}

.cat-pill.cat-organiser,
.cat-pill.cat-organizer {
  background: #e0e7ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.cat-pill.cat-volunteer {
  background: #cffafe;
  color: #0e7490;
  border: 1px solid #a5f3fc;
}

.cat-pill.cat-other {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.table-meta-bar #table-summary {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
}

.gender-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #f1f4f3;
  color: #4b6065;
}

.gender-pill.male {
  background: #eef4fb;
  color: #2b6cb0;
}

.gender-pill.female {
  background: #fdf0f5;
  color: #b83280;
}

.person-name {
  font-weight: 700;
  color: var(--ink);
  font-size: 12.5px;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  color: var(--muted);
  font-size: 11px;
}

.search-box {
  border: 1px solid var(--line);
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: #829297;
  width: min(300px, 100%);
  background: #fff;
}

.search-box input {
  border: 0;
  outline: 0;
  padding: 9px 0;
  width: 100%;
  min-width: 0;
  background: transparent;
  color: var(--ink);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: #c2d1cd #f1f4f3;
}

.table-wrap::-webkit-scrollbar {
  height: 6px;
}

.table-wrap::-webkit-scrollbar-track {
  background: #f1f4f3;
  border-radius: 4px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: #c2d1cd;
  border-radius: 4px;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--green);
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  white-space: nowrap;
  text-align: left;
}

thead {
  background: #f7f9f9;
}

th {
  font-size: 10px;
  color: #7c8a8f;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  padding: 12px 13px;
  border-bottom: 1px solid #edf0f0;
}

td {
  padding: 12px 13px;
  border-bottom: 1px solid #edf0f0;
  font-size: 12px;
  color: #40555a;
  background: #ffffff;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #fbfcfc;
}

/* Sticky Columns: First Column (Attendee) and Last Column (Actions) */
th:first-child,
td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  box-shadow: 4px 0 8px rgba(28, 53, 59, 0.04);
}

thead th:first-child {
  background: #f7f9f9;
  z-index: 3;
}

td:first-child {
  background: #ffffff;
}

tbody tr:hover td:first-child {
  background: #fbfcfc;
}

/* Sticky Action Column to Guarantee Buttons are Always Visible */
th:last-child,
td:last-child {
  position: sticky;
  right: 0;
  text-align: right;
  z-index: 2;
  box-shadow: -6px 0 12px rgba(28, 53, 59, 0.05);
}

thead th:last-child {
  background: #f7f9f9;
  z-index: 3;
}

td:last-child {
  background: #ffffff;
}

tbody tr:hover td:last-child {
  background: #fbfcfc;
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--ink);
}

.person-photo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #e8efec;
  object-fit: cover;
  display: grid;
  place-items: center;
  color: var(--green);
  font-weight: 800;
  flex-shrink: 0;
}

.id-tag {
  background: #f0f4f4;
  border-radius: 5px;
  padding: 5px 7px;
  font-weight: 700;
  font-size: 10px;
}

.truncate-cell {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
  min-width: 170px;
}

.small-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #52666b;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s ease;
  white-space: nowrap;
  cursor: pointer;
}

.small-btn:hover {
  border-color: #a9c8bb;
  color: var(--green);
  background: #f7faf9;
}

.small-btn.danger {
  color: #bd5555;
}

.small-btn.danger:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.table-note,
.field-help {
  font-size: 11px;
  color: #8a999d;
  margin-top: 12px;
}

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

.form-stack {
  display: grid;
  gap: 15px;
}

form label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: #41575b;
  min-width: 0;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #dfe7e7;
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
  font-size: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: transparent;
}

.search-box:focus {
    border: 1px solid var(--green);
    border-radius: 7px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 10px !important;
    color: #829297;
    width: min(300px, 100%);
    background: #fff;
}

input[type="file"] {
  padding: 8px;
  font-size: 11px;
}

textarea {
  resize: vertical;
}

.span-2 {
  grid-column: span 2;
}

.form-actions {
  display: flex;
  gap: 8px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 25px 0 14px;
}

.section-heading h2 {
  margin-bottom: 4px;
}

.section-heading p {
  font-size: 12px;
}

.count-pill {
  background: #e8f2ed;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 6px;
}

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

.story-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.story-image {
  height: 150px;
  width: 100%;
  object-fit: cover;
  background: #eaf0ed;
}

.story-body {
  padding: 16px;
}

.story-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.temperature {
  font-size: 12px;
  font-weight: 800;
  color: #bd6d36;
  background: #fff1e6;
  padding: 6px 8px;
  border-radius: 6px;
}

.story-location {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 9px;
}

.story-body p {
  font-size: 12px;
  color: #52666b;
  margin: 0 0 14px;
}

.card-actions {
  display: flex;
  gap: 6px;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

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

.event-mini {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.event-mini-content {
  flex: 1;
  min-width: 0;
}

.event-mini h4 {
  margin: 0 0 5px;
  font-family: Manrope;
  font-size: 13px;
}

.event-mini p {
  font-size: 11px;
}

.event-mini-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 32px;
  height: 18px;
  border: 0;
  border-radius: 20px;
  background: #d7e0df;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle:before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: white;
  transition: 0.15s;
}

.toggle:checked {
  background: #4c9a78;
}

.toggle:checked:before {
  left: 17px;
}

.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.sponsor-tile {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 14px 9px 12px;
  text-align: center;
  min-width: 0;
}

.sponsor-logo {
  height: 48px;
  width: 100%;
  object-fit: contain;
  margin-bottom: 9px;
}

.sponsor-placeholder {
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--green);
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 9px;
}

.sponsor-tile strong {
  font-size: 11px;
  display: block;
  overflow-wrap: anywhere;
}

.sponsor-tile a {
  font-size: 10px;
  color: var(--green);
  text-decoration: none;
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.remove-sponsor {
  position: absolute;
  top: 5px;
  right: 5px;
  border: 0;
  background: #fff0f0;
  color: #b54b4b;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
}

.empty-state {
  border: 1px dashed #d8e2e1;
  border-radius: 9px;
  padding: 22px;
  text-align: center;
  color: #829195;
  font-size: 12px;
  grid-column: 1 / -1;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 0 25px;
  color: #98a5a8;
  font-size: 10px;
}

/* =====================================================
   CREATIVE ALERT & CONFIRMATION MODAL SYSTEM
===================================================== */
.creative-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.creative-alert-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.creative-alert-card {
  position: relative;
  background: #ffffff;
  width: min(440px, 100%);
  border-radius: 20px;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(15, 23, 42, 0.08);
  padding: 32px 28px 26px;
  text-align: center;
  transform: scale(0.92) translateY(12px);
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.creative-alert-overlay.active .creative-alert-card {
  transform: scale(1) translateY(0);
}

.alert-top-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
}

.creative-alert-card.type-danger .alert-top-accent {
  background: linear-gradient(90deg, #f87171, #dc2626);
}

.creative-alert-card.type-warning .alert-top-accent {
  background: linear-gradient(90deg, #fbbf24, #fe6612);
}

.creative-alert-card.type-success .alert-top-accent {
  background: linear-gradient(90deg, #34d399, #059669);
}

.creative-alert-card.type-info .alert-top-accent {
  background: linear-gradient(90deg, #38bdf8, #205c4b);
}

.alert-icon-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  transition: transform 0.25s ease;
}

.alert-icon-ring svg {
  width: 28px;
  height: 28px;
}

.alert-icon-ring.danger {
  background: #fef2f2;
  color: #dc2626;
  box-shadow: 0 0 0 8px #fee2e2;
}

.alert-icon-ring.warning {
  background: #fffbeb;
  color: #d97706;
  box-shadow: 0 0 0 8px #fef3c7;
}

.alert-icon-ring.success {
  background: #ecfdf5;
  color: #059669;
  box-shadow: 0 0 0 8px #d1fae5;
}

.alert-icon-ring.info {
  background: #f0fdf9;
  color: #205c4b;
  box-shadow: 0 0 0 8px #dcfce7;
}

.alert-title {
  font-family: inherit;
  font-size: 19px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 8px;
  line-height: 1.3;
}

.alert-message {
  font-size: 13.5px;
  color: #475569;
  line-height: 1.6;
  margin: 0 0 24px;
}

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

.alert-btn {
  flex: 1;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.16s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.alert-btn.btn-cancel {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

.alert-btn.btn-cancel:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.alert-btn.btn-danger {
  background: #dc2626;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}

.alert-btn.btn-danger:hover {
  background: #b91c1c;
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.45);
  transform: translateY(-1px);
}

.alert-btn.btn-primary {
  background: var(--green, #205c4b);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(32, 92, 75, 0.35);
}

.alert-btn.btn-primary:hover {
  background: #174639;
  box-shadow: 0 6px 18px rgba(32, 92, 75, 0.45);
  transform: translateY(-1px);
}

/* Upgraded Creative Toast */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: rgba(24, 59, 51, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.12);
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  pointer-events: none;
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 99990;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-icon-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.toast.toast-error {
  background: rgba(220, 38, 38, 0.96);
}

.toast.toast-info {
  background: rgba(14, 116, 144, 0.96);
}

.hidden {
  display: none !important;
}

.details-dialog {
  border: 0;
  border-radius: 14px;
  padding: 25px;
  width: min(520px, calc(100% - 28px));
  box-shadow: 0 20px 80px #122c2d35;
  background: #fff;
}

.details-dialog::backdrop {
  background: #10272980;
}

.edit-dialog {
  width: min(620px, calc(100% - 28px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.dialog-heading h2 {
  margin: 0;
}

.icon-button {
  border: 0;
  background: #f1f5f4;
  border-radius: 7px;
  width: 32px;
  height: 32px;
  font-size: 20px;
  cursor: pointer;
}

.detail-row {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  font-size: 12px;
}

.detail-row span:first-child {
  color: var(--muted);
}

.detail-row span:last-child {
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* Status badge styling in tables */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.status-dot-mini {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-approved {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.status-approved .status-dot-mini {
  background: #10b981;
}

.status-pending {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}
.status-pending .status-dot-mini {
  background: #f59e0b;
}

.status-rejected {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.status-rejected .status-dot-mini {
  background: #ef4444;
}

/* Responsive Media Queries */
@media (max-width: 1100px) {
  .main {
    padding: 0 22px;
  }

  .sidebar {
    width: 215px;
  }

  .main {
    margin-left: 215px;
  }

  .two-column {
    grid-template-columns: 1fr;
  }

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

  .row-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: auto;
    height: auto;
    padding: 13px 15px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    padding: 0 3px 14px;
  }

  .nav-label,
  .sidebar-bottom {
    display: none;
  }

  .side-nav {
    display: flex;
    overflow-x: auto;
  }

  .nav-link {
    white-space: nowrap;
    padding: 10px 12px;
    font-size: 12px;
  }

  .main {
    margin-left: 0;
    padding: 0 14px;
  }

  .topbar {
    height: auto;
    min-height: 88px;
    margin-bottom: 22px;
  }

  .topbar h1 {
    font-size: 23px;
  }

  .admin-chip strong,
  .admin-chip small {
    display: none;
  }

  .welcome-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

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

  .stat-card {
    padding: 12px 10px;
    gap: 8px;
  }

  .stat-icon {
    width: 32px;
    height: 32px;
  }

  .stat-card p {
    font-size: 10px;
  }

  .stat-card strong {
    font-size: 20px;
  }

  .panel {
    padding: 16px;
  }

  .tabs {
    margin: 0 -16px;
    padding: 0 16px;
  }

  .tab {
    padding: 12px 8px;
    font-size: 11px;
  }

  .tab span {
    margin-left: 2px;
  }

  .panel-heading {
    align-items: flex-start;
  }

  .panel-heading .btn {
    white-space: nowrap;
    padding: 9px;
  }

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

  .span-2 {
    grid-column: span 1;
  }

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

  .footer {
    font-size: 9px;
  }

  .table-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-card p {
    font-size: 12px;
  }

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

  .tab {
    font-size: 10px;
  }

  .panel-heading h3 {
    font-size: 14px;
  }
}

/* Login screen & Auth */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(circle at 50% 20%, #eef5f2 0%, var(--canvas) 70%);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 38px 32px 32px;
  box-shadow: 0 16px 40px rgba(28, 53, 59, 0.08);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.login-header h2 {
  font-size: 22px;
  color: var(--ink);
  margin: 0 0 6px;
}

.login-header p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.login-form input {
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: #fbfdfc;
  color: var(--ink);
  font-size: 13.5px;
  transition: border-color .2s, box-shadow .2s;
}

.login-form input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(35, 107, 87, 0.12);
  background: #fff;
}

.login-submit {
  height: 46px;
  margin-top: 8px;
  border: none;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: .3px;
  cursor: pointer;
  transition: background .2s, transform .2s, box-shadow .2s;
  box-shadow: 0 6px 18px rgba(35, 107, 87, 0.28);
}

.login-submit:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.login-error {
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  font-size: 12.5px;
}

.login-hint {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
}

.logout-btn {
  background: #f1f5f4;
  border: 1px solid var(--line);
  color: #64748b;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .2s;
  margin-left: 8px;
}

.logout-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

.dialog-photo-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--canvas);
  border-radius: 12px;
  margin-bottom: 16px;
}

.dialog-photo {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.dialog-photo-initials {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 24px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.hero-admin-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.hero-admin-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-admin-img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: #e2e8f0;
}

.hero-admin-meta strong {
  font-size: 14px;
  color: var(--ink);
  display: block;
}

.hero-admin-meta span {
  font-size: 11px;
  color: var(--green);
  font-weight: 700;
}

.hero-admin-telemetry {
  display: flex;
  gap: 8px;
  font-size: 10.5px;
  color: var(--muted);
  flex-wrap: wrap;
}

.hero-admin-quote {
  font-size: 11.5px;
  font-style: italic;
  color: #475569;
  border-left: 2px solid var(--green);
  padding-left: 8px;
  margin: 4px 0 0;
}
