:root {
  --navy: #050608;
  --blue: #d9bd4a;
  --gold: #d2af3f;
  --gold-soft: #f1df8a;
  --ink: #f6f2df;
  --muted: #b8b0a0;
  --line: rgba(210, 175, 63, .26);
  --paper: #111214;
  --panel: #18191c;
  --panel-soft: #222326;
  --soft: #07080a;
  --success: #58b879;
  --danger: #ff8a80;
  --shadow: 0 24px 70px rgba(0, 0, 0, .46);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% -10%, rgba(210, 175, 63, .18), transparent 34%),
    radial-gradient(circle at 90% 12%, rgba(255, 255, 255, .06), transparent 28%),
    linear-gradient(180deg, #090a0c, #050608 62%, #0c0d10);
  font-family: "Karla", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}

a { color: var(--gold-soft); text-decoration: none; }

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.app-wrapper.unauthenticated {
  flex-direction: column;
}

.app-wrapper.unauthenticated .sidebar {
  display: none !important;
}

.app-wrapper.unauthenticated .main-content {
  margin-left: 0 !important;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 260px;
  height: 100vh;
  background: rgba(8, 9, 11, .98);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(210, 175, 63, .1);
  display: flex;
  flex-direction: column;
  padding: 0;
  z-index: 20;
  overflow-y: auto;
  transition: width .3s ease;
  border-radius: 0 20px 20px 0;
}

.sidebar.collapsed {
  width: 80px;
}

.sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid rgba(210, 175, 63, .1);
  gap: 8px;
  flex-shrink: 0;
  min-height: 84px;
  flex-direction: column;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
}

.sidebar.collapsed .brand {
  justify-content: center;
  flex: 0;
}

.sidebar-controls {
  display: flex;
  width: 100%;
  justify-content: flex-start;
}

.sidebar.collapsed .sidebar-header {
  align-items: center;
}

.sidebar .brand-logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(210, 175, 63, .1);
  padding: 4px;
}

.sidebar .brand-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--ink);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.sidebar.collapsed .brand-text {
  display: none;
}

.sidebar-toggle {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border: 1px solid rgba(210, 175, 63, .2);
  background: rgba(210, 175, 63, .08);
  border-radius: 8px;
  cursor: pointer;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--ink);
  transition: all .2s ease;
  flex-shrink: 0;
  margin-top: 8px;
  padding: 0;
}


.sidebar-toggle:hover {
  background: rgba(210, 175, 63, .15);
  border-color: rgba(210, 175, 63, .3);
}

.sidebar-toggle span {
  width: 16px;
  height: 2px;
  background: var(--ink);
  transition: all .3s ease;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  /* Override the legacy global `nav` rule (flex-end / center / wrap) so the
     links sit at the top of the panel instead of floating at the bottom. */
  justify-content: flex-start;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 0;
  padding: 8px 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  width: 100%;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
  padding: 12px 12px 6px;
  width: 100%;
  box-sizing: border-box;
}

.sidebar.collapsed .nav-section-title {
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: 0 8px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, .7);
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 10px;
  transition: all .2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.nav-item:hover {
  background: rgba(210, 175, 63, .15);
  border-color: rgba(210, 175, 63, .3);
  color: var(--gold-soft);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 16px;
  flex-shrink: 0;
  color: inherit;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
  color: inherit;
  stroke: currentColor;
  fill: none;
}

.nav-item .nav-icon svg {
  color: rgba(255, 255, 255, .7);
  transition: color .2s ease;
}

.nav-item:hover .nav-icon svg {
  color: var(--gold-soft);
}

.nav-logout .nav-icon svg {
  color: rgba(255, 255, 255, .7);
  transition: color .2s ease;
}

.nav-logout:hover .nav-icon svg {
  color: var(--danger);
}

.nav-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.sidebar.collapsed .nav-text {
  display: none;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  margin: 0 4px;
  padding: 10px 8px;
  gap: 0;
}

.sidebar-footer {
  padding: 8px;
  border-top: 1px solid rgba(210, 175, 63, .1);
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.sidebar-footer form {
  display: flex;
  width: 100%;
}

.nav-logout {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, .7);
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 10px;
  transition: all .2s ease;
  font-family: "Karla", Arial, sans-serif;
  margin: 0;
  box-sizing: border-box;
}

.nav-logout:hover {
  background: rgba(255, 138, 128, .15);
  border-color: rgba(255, 138, 128, .3);
  color: var(--danger);
}

.sidebar.collapsed .nav-logout {
  justify-content: center;
  padding: 10px 8px;
  gap: 0;
}

.sidebar.collapsed .nav-logout .nav-text {
  display: none;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  transition: margin-left .3s ease;
}

.main-content.sidebar-collapsed {
  margin-left: 80px;
}

.site-header {
  position: relative;
  min-height: auto;
  padding: 12px 20px;
  background: transparent;
  border-bottom: none;
  backdrop-filter: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-profile-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  padding: 8px 16px;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(210, 175, 63, .2);
  background: rgba(210, 175, 63, .08);
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}

.user-profile-btn:hover {
  background: rgba(210, 175, 63, .15);
  border-color: rgba(210, 175, 63, .3);
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(210, 175, 63, .3), rgba(210, 175, 63, .1));
  border: 1.5px solid rgba(210, 175, 63, .3);
  font-weight: 700;
  font-size: 12px;
  color: var(--gold);
}

.dropdown-arrow {
  width: 16px;
  height: 16px;
  color: inherit;
  transition: transform .2s ease;
  margin-left: 4px;
}

.user-profile-btn:hover .dropdown-arrow {
  transform: scaleY(-1);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: rgba(17, 18, 20, .98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(210, 175, 63, .15);
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
  display: none;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
}

.user-profile-dropdown:hover .user-dropdown-menu,
.user-profile-btn.active ~ .user-dropdown-menu {
  display: flex;
}

.dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(210, 175, 63, .1);
  background: rgba(210, 175, 63, .05);
}

.user-avatar-large {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(210, 175, 63, .3), rgba(210, 175, 63, .1));
  border: 2px solid rgba(210, 175, 63, .3);
  font-weight: 700;
  font-size: 18px;
  color: var(--gold);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.user-dropdown-name {
  font-weight: 600;
  color: var(--ink);
  font-size: 13px;
}

.user-dropdown-email {
  font-size: 11px;
  color: rgba(255, 255, 255, .6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, .8);
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s ease;
  text-decoration: none;
  font-family: "Karla", Arial, sans-serif;
}

.dropdown-item:hover {
  background: rgba(210, 175, 63, .12);
  color: var(--gold-soft);
}

.dropdown-item:last-of-type:hover {
  background: rgba(255, 138, 128, .12);
  color: var(--danger);
}

.dropdown-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: inherit;
  stroke: currentColor;
  fill: none;
}

.user-profile-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(210, 175, 63, .08);
  border: 1px solid rgba(210, 175, 63, .15);
}

.user-avatar-mini {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(210, 175, 63, .2);
  border: 1.5px solid rgba(210, 175, 63, .3);
  font-weight: 700;
  font-size: 14px;
  color: var(--gold);
  flex-shrink: 0;
}

.user-name-mini {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar.collapsed .user-profile-mini {
  justify-content: center;
  padding: 8px;
}

.sidebar.collapsed .user-name-mini {
  display: none;
}

.dropdown-logout {
  margin: 0;
}

.nav-toggle {
  display: none !important;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 3px 0;
  background: var(--ink);
  transition: transform .2s ease, opacity .2s ease;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(.2); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

nav {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: .03em;
}

.brand-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(210, 175, 63, .22));
}

nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  font-family: "Karla", Arial, sans-serif;
  font-size: .92rem;
}

nav.open {
  display: flex;
}

@media (max-width: 820px) {
  .nav-toggle {
    display: inline-flex;
  }

  nav {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 8px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, .08);
  }

  nav.open {
    display: flex;
  }

  nav a,
  nav form .link-button,
  nav form button {
    width: 100%;
    justify-content: flex-start;
  }
}

nav a,
nav form .link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .06);
  background: linear-gradient(90deg, rgba(210,175,63,.95), rgba(210,175,63,.8));
  color: #081018;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(210,175,63,.08), inset 0 -2px 6px rgba(0,0,0,.18);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease, color .14s ease;
}

nav a:hover,
nav form .link-button:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(210,175,63,.16), inset 0 -2px 8px rgba(0,0,0,.22);
  background: linear-gradient(90deg, rgba(255,235,160,1), rgba(210,175,63,1));
  color: #081018;
}

nav form { margin: 0; }

main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 24px 0 40px;
  flex: 1;
}

main > * {
  width: min(1120px, calc(100% - 28px));
  margin-left: auto;
  margin-right: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .9fr);
  gap: 24px;
  align-items: stretch;
  min-height: 420px;
  padding: clamp(22px, 5vw, 48px);
  color: white;
  background:
    linear-gradient(110deg, rgba(5, 6, 8, .98), rgba(20, 18, 14, .88)),
    url("https://images.unsplash.com/photo-1524995997946-a1c2e315a42f?auto=format&fit=crop&w=1400&q=80");
  background-size: cover;
  background-position: center;
  border-bottom: 8px solid var(--gold);
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2.1rem, 7vw, 4.2rem);
  line-height: 1.05;
}

.hero p { max-width: 700px; font-size: 1rem; line-height: 1.65; }

.mission-panel {
  align-self: end;
  padding: 22px;
  color: var(--ink);
  background: rgba(17, 18, 20, .94);
  border-top: 6px solid var(--gold);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font: 800 .72rem/1 "Karla", Arial, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1, h2, h3 {
  color: var(--ink);
  font-family: "Old Standard TT", Georgia, serif;
  font-weight: 700;
  margin: 0;
  line-height: 1.15;
}

h1 { font-size: clamp(2.1rem, 3.5vw, 3.6rem); }

h2 { font-size: clamp(1.5rem, 2.4vw, 2.1rem); }

h3 { font-size: clamp(1.2rem, 2.1vw, 1.4rem); }

.hero h1,
.hero-copy .eyebrow { color: white; }

.actions, .section-heading, .filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.section-heading {
  justify-content: space-between;
  margin: 0 0 14px;
}

.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  font: 800 .88rem/1 "Karla", Arial, sans-serif;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.button:hover,
button:hover {
  transform: translateY(-1px);
}

.primary {
  color: #08090b;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  box-shadow: 0 12px 28px rgba(210, 175, 63, .18);
}

.secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, .05);
  border-color: var(--line);
}

.small { min-height: 34px; padding: 8px 12px; font-size: .82rem; }
.link-button { background: transparent; border: 0; padding: 0; min-height: auto; }
.nav-cta {
  color: #08090b;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  padding: 10px 14px;
  border-radius: 4px;
}

.feature-grid, .two-column {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

/* Responsive stats grid: 4 cols desktop, 2 cols tablet/mobile */
@media (max-width: 1024px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats article { padding: 14px 16px; min-height: 72px; }
  .stats strong { font-size: 1.9rem; }
  .stats span { font-size: .8rem; }
}

@media (max-width: 520px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stats article { padding: 10px 12px; min-height: 64px; }
  .stats strong { font-size: 1.5rem; }
  .stats span { font-size: .72rem; letter-spacing: .04em; }
  
  /* Dashboard responsive for very small screens */
  .dashboard-stats { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 16px; }
  .dashboard-header { padding: 20px 16px 16px; margin-bottom: 20px; }
  .dashboard-header h1 { font-size: 1.6rem; }
  .stat-card { padding: 16px; gap: 12px; }
  .stat-number { font-size: 24px; }
  .card-header { padding: 16px; }
  .card-header h2 { font-size: 16px; }
  .qr-image { width: 150px; height: 150px; }
}

.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.two-column > * {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.compact-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0 0 18px; }
.compact-stats article { padding: 14px 16px; justify-content: center; gap: 10px; }
.compact-stats strong { font-size: 1.7rem; }

.feature-grid article, .stats article, .form-card, .table-wrap, .qr-panel, .profile-summary, .list-item, .scanner-box {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255,255,255,.1);
  box-shadow: 0 18px 48px rgba(0,0,0,.18);
}

/* Dashboard stat cards */
.stats article {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 12px 16px;
  text-align: left;
}

.stats strong {
  display: inline-block;
  color: var(--gold-soft);
  font-size: 2.4rem;
  line-height: 1;
  font-weight: 800;
}
.stats span, .muted, .list-item span {
  color: rgba(255,255,255,.85);
  font-family: "Karla", Arial, sans-serif;
  font-size: .9rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: .95;
}

/* Responsive: scale stat fonts on narrow screens */
@media (max-width: 820px) {
  .stats article { padding: 10px 12px; min-height: 60px; }
  .stats strong { font-size: 1.6rem; }
  .stats span { font-size: .78rem; letter-spacing: .04em; }
}

/* ===== Dashboard Styles ===== */
.dashboard-container {
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
}

.dashboard-header {
  padding: 20px 24px 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(210, 175, 63, .1);
}

.dashboard-header p.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.dashboard-header h1 {
  margin: 0;
  font-size: clamp(1.95rem, 4vw, 2.7rem);
  letter-spacing: -.02em;
  color: var(--ink);
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  padding: 0 24px;
  margin-bottom: 18px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(210, 175, 63, .08), rgba(210, 175, 63, .03));
  border: 1px solid rgba(210, 175, 63, .2);
  border-radius: 12px;
  transition: all .3s ease;
}

.stat-card:hover {
  background: linear-gradient(135deg, rgba(210, 175, 63, .12), rgba(210, 175, 63, .06));
  border-color: rgba(210, 175, 63, .35);
  transform: translateY(-2px);
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(210, 175, 63, .15);
  font-size: 24px;
  flex-shrink: 0;
}

.stat-icon.members { background: rgba(100, 150, 200, .15); }
.stat-icon.programs { background: rgba(150, 100, 200, .15); }
.stat-icon.sessions { background: rgba(200, 150, 100, .15); }
.stat-icon.attendance { background: rgba(100, 200, 150, .15); }

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

.stat-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--gold-soft);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: rgba(255, 255, 255, .7);
  font-weight: 500;
}

/* Summary Cards for Member Dashboard */
.summary-card {
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(210, 175, 63, .08), rgba(210, 175, 63, .03));
  border: 1px solid rgba(210, 175, 63, .2);
  border-radius: 12px;
  text-align: center;
  transition: all .3s ease;
}

.summary-card:hover {
  border-color: rgba(210, 175, 63, .35);
  transform: translateY(-2px);
}

.summary-card.present {
  border-color: rgba(88, 184, 121, .3);
  background: linear-gradient(135deg, rgba(88, 184, 121, .08), rgba(88, 184, 121, .03));
}

.summary-card.absent {
  border-color: rgba(255, 138, 128, .3);
  background: linear-gradient(135deg, rgba(255, 138, 128, .08), rgba(255, 138, 128, .03));
}

.summary-card.rate {
  border-color: rgba(210, 175, 63, .3);
  background: linear-gradient(135deg, rgba(210, 175, 63, .08), rgba(210, 175, 63, .03));
}

.summary-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--gold-soft);
  line-height: 1;
  margin-bottom: 6px;
}

.summary-label {
  font-size: 13px;
  color: rgba(255, 255, 255, .75);
  font-weight: 500;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 18px;
  padding: 0 24px;
  margin-bottom: 18px;
}

.member-grid {
  grid-template-columns: 1fr 1fr;
}

.dashboard-card {
  background: rgba(17, 18, 20, .6);
  border: 1px solid rgba(210, 175, 63, .12);
  border-radius: 12px;
  overflow: hidden;
  transition: all .3s ease;
}

.dashboard-card:hover {
  border-color: rgba(210, 175, 63, .2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
}

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

.card-header > div {
  flex: 1;
}

.card-header h2 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.card-subtitle {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, .6);
  font-weight: 400;
}

.card-body {
  padding: 16px;
}

.card-body:empty::after {
  content: '';
}

/* Approval Items */
.approval-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.approval-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(210, 175, 63, .1);
  border-radius: 8px;
  transition: all .2s ease;
}

.approval-item:hover {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(210, 175, 63, .2);
}

.approval-info {
  flex: 1;
  min-width: 0;
}

.member-name {
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 4px;
}

.member-details {
  font-size: 12px;
  color: rgba(255, 255, 255, .65);
}

.action-link {
  color: var(--gold-soft);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: color .2s ease;
  white-space: nowrap;
  margin-left: 16px;
}

.action-link:hover {
  color: var(--gold);
}

/* Session Items */
.session-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(210, 175, 63, .1);
  border-radius: 8px;
  text-decoration: none;
  transition: all .2s ease;
}

.session-item:hover {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(210, 175, 63, .2);
  color: var(--gold-soft);
}

.session-info {
  flex: 1;
  min-width: 0;
}

.session-title {
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 4px;
}

.session-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, .65);
}

.session-arrow {
  margin-left: 12px;
  color: var(--gold-soft);
  font-weight: 600;
}

/* Program Items */
.program-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.program-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(210, 175, 63, .1);
  border-radius: 8px;
  transition: all .2s ease;
}

.program-item:hover {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(210, 175, 63, .2);
}

.program-info {
  flex: 1;
  min-width: 0;
}

.program-name {
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 4px;
}

.program-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, .65);
}

/* Enrollment Items */
.enrollment-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.enrollment-item {
  padding: 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(210, 175, 63, .1);
  border-radius: 8px;
  transition: all .2s ease;
}

.enrollment-item:hover {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(210, 175, 63, .2);
}

.enrollment-name {
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 4px;
}

.enrollment-date {
  font-size: 12px;
  color: rgba(255, 255, 255, .65);
}

/* Attendance Items */
.attendance-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attendance-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(210, 175, 63, .1);
  border-radius: 8px;
}

.attendance-main {
  flex: 1;
  min-width: 0;
}

.attendance-session {
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 4px;
}

.attendance-program {
  font-size: 12px;
  color: rgba(255, 255, 255, .65);
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-left: 12px;
}

.status-badge.present {
  background: rgba(88, 184, 121, .2);
  color: rgba(88, 184, 121, .9);
  border: 1px solid rgba(88, 184, 121, .3);
}

.status-badge.absent {
  background: rgba(255, 138, 128, .2);
  color: rgba(255, 138, 128, .9);
  border: 1px solid rgba(255, 138, 128, .3);
}

.status-badge.upcoming {
  background: rgba(210, 175, 63, .2);
  color: rgba(210, 175, 63, .9);
  border: 1px solid rgba(210, 175, 63, .3);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 32px 24px;
  color: rgba(255, 255, 255, .6);
}

.empty-state p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

/* QR Card Specific */
.qr-card .card-body {
  padding: 20px;
}

.qr-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.qr-code-btn {
  background: none;
  border: 2px solid rgba(210, 175, 63, .3);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all .3s ease;
  display: block;
}

.qr-code-btn:hover {
  border-color: rgba(210, 175, 63, .6);
  box-shadow: 0 0 20px rgba(210, 175, 63, .2);
  transform: scale(1.02);
}

.qr-image {
  width: 170px;
  height: 170px;
  display: block;
}

.qr-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, .65);
  margin: 0;
  font-weight: 500;
}

/* Programs Card — sits next to the QR card in the member grid (no full-span). */
.programs-card {
  grid-column: auto;
}

.page-title { margin-bottom: 18px; }
.page-title h1 { margin: 0; font-size: clamp(1.95rem, 4vw, 2.7rem); letter-spacing: -.02em; }

.narrow { max-width: 680px; margin: 0 auto; }
.wide-form { max-width: 860px; }

.form-card p { margin: 0 0 16px; }
.registration-heading {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px;
  background: rgba(17, 18, 20, .66);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.registration-heading img {
  width: 92px;
  height: 92px;
  object-fit: contain;
}

.form-section {
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .025);
}

.step-indicator {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.step-dot {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
  text-align: left;
}

.step-dot span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  color: var(--gold-soft);
  font: 800 .9rem "Karla", Arial, sans-serif;
}

.step-dot strong {
  display: block;
  color: inherit;
  font: 800 .82rem/1.2 "Karla", Arial, sans-serif;
}

.step-dot.active {
  border-color: var(--gold);
  background: rgba(210, 175, 63, .14);
  color: var(--ink);
}

.step-dot.active span,
.step-dot.complete span {
  color: #08090b;
  background: var(--gold);
  border-color: var(--gold);
}

.step-dot.complete {
  color: var(--ink);
  background: rgba(210, 175, 63, .08);
}

.step-title {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.step-title h2 {
  margin: 0 0 6px;
}

.step-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 16px -16px -16px;
  padding: 14px 16px;
  background: rgba(17, 18, 20, .96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.step-actions .primary {
  margin-left: auto;
}

.form-section legend {
  padding: 0 8px;
  color: var(--gold-soft);
  font: 700 1.05rem "Old Standard TT", Georgia, serif;
}

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

.form-grid .full {
  grid-column: 1 / -1;
}

.help,
.field-error {
  display: block;
  margin-top: 5px;
  font: .82rem "Karla", Arial, sans-serif;
}

.field-error { color: var(--danger); }
label { display: block; margin-bottom: 6px; font: 800 .86rem "Karla", Arial, sans-serif; color: #eee4bd; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, .065);
  color: var(--ink);
}

select,
select option {
  color: #08090b;
}
select {
  background: rgba(255, 255, 255, .94);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(210, 175, 63, .34);
  border-color: var(--gold);
}

.filters { margin: 0 0 18px; }
.filters input, .filters select { width: auto; min-width: 210px; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 18px;
}

.filters input,
.filters select,
.filters button {
  flex: 0 1 auto;
  min-width: 160px;
}

.table-wrap { overflow-x: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; background: transparent; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }

td {
  max-width: 300px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
th { color: var(--gold-soft); font: 800 .78rem "Karla", Arial, sans-serif; text-transform: uppercase; }

.list { display: grid; gap: 10px; }
.list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
}
.list-item strong { display: block; color: var(--ink); margin-bottom: 2px; word-break: break-word; }
.list-item span { display: block; margin-top: 2px; word-break: break-word; }

.qr-panel img { width: min(100%, 300px); border: 1px solid var(--line); background: white; padding: 10px; }
.qr-open {
  display: block;
  width: min(100%, 330px);
  padding: 0;
  background: transparent;
  border: 0;
}

.qr-open:hover {
  transform: scale(1.015);
}

.qr-modal[hidden] { display: none; }

.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .78);
  backdrop-filter: blur(8px);
}

.qr-modal-card {
  position: relative;
  width: min(520px, 100%);
  padding: clamp(24px, 5vw, 42px);
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.qr-modal-card img {
  width: min(100%, 390px);
  background: white;
  padding: 16px;
  border-radius: 6px;
}

.qr-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  min-height: 36px;
  padding: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
}

.modal-open { overflow: hidden; }

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

.attendance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.attendance-row strong {
  display: block;
  color: var(--ink);
}

.attendance-row span {
  color: var(--muted);
  font-family: "Karla", Arial, sans-serif;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  padding: 6px 10px;
  border-radius: 999px;
  font: 800 .76rem "Karla", Arial, sans-serif;
  text-transform: uppercase;
}

.status-pill.present { color: #06140b; background: #68d391; }
.status-pill.absent { color: #220806; background: #ff8a80; }
.status-pill.upcoming { color: #08090b; background: var(--gold-soft); }

.member-qr-mini {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.member-qr-mini img {
  width: min(100%, 220px);
  background: white;
  padding: 10px;
  border-radius: 6px;
}

.profile-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
}
.profile-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.profile-photo { width: 160px; height: 160px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); flex-shrink: 0; }
.profile-avatar-placeholder {
  width: 160px;
  height: 160px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 2.4rem;
  font-weight: 700;
}
.application-responses {
  margin-bottom: 24px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(31, 32, 35, .96), rgba(17, 18, 20, .96));
  border: 1px solid var(--line);
  border-radius: 6px;
}

.application-responses h3 { margin-top: 20px; }
.application-responses h3:first-child { margin-top: 0; }
dt { color: var(--gold-soft); font: 800 .78rem "Karla", Arial, sans-serif; text-transform: uppercase; }
dd { margin: 0 0 12px; }

.scanner-layout { display: grid; grid-template-columns: minmax(300px, 1.1fr) minmax(280px, .9fr); gap: 16px; }
#qr-video { width: 100%; min-height: 320px; background: #111; border-radius: 4px; }

.messages { width: 100%; margin: 0; }
.message { padding: 12px 16px; border-radius: 4px; background: var(--panel); border-left: 5px solid var(--blue); box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.message.success { border-left-color: var(--success); }
.badge { display: inline-block; padding: 4px 8px; border-radius: 99px; background: rgba(210, 175, 63, .13); color: var(--gold-soft); font: 800 .78rem "Karla", Arial, sans-serif; }

.success-screen {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 180px);
}

.scan-result-screen {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 180px);
}

.scan-result-card {
  width: min(680px, 100%);
  padding: clamp(28px, 5vw, 52px);
  text-align: center;
  background: linear-gradient(180deg, rgba(31, 32, 35, .97), rgba(10, 11, 13, .98));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.scan-result-card.duplicate {
  border-color: rgba(255, 138, 128, .45);
}

.scan-icon {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  margin: 0 auto 18px;
  border-radius: 50%;
  font: 800 2.8rem "Karla", Arial, sans-serif;
}

.scan-icon.success {
  background: rgba(88, 184, 121, .14);
  animation: successPulse 1.8s ease-out infinite;
}

.scan-icon.success span {
  width: 48px;
  height: 24px;
  border-left: 7px solid var(--success);
  border-bottom: 7px solid var(--success);
  transform: rotate(-45deg) translate(3px, -3px);
  animation: successCheck .6s ease-out both;
}

.scan-icon.duplicate {
  color: var(--danger);
  background: rgba(255, 138, 128, .13);
}

.success-card {
  position: relative;
  width: min(720px, 100%);
  overflow: hidden;
  padding: clamp(28px, 5vw, 52px);
  text-align: center;
  background: linear-gradient(180deg, rgba(31, 32, 35, .97), rgba(10, 11, 13, .98));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.success-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: linear-gradient(90deg, var(--navy), var(--gold), var(--navy));
}

.success-card img {
  width: 116px;
  height: 116px;
  object-fit: contain;
  margin: 0 auto 18px;
  animation: successFloat 3s ease-in-out infinite;
}

.success-card h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.success-message {
  max-width: 620px;
  margin: 0 auto 26px;
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1.7;
}

.success-mark {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: rgba(31, 122, 77, .12);
  animation: successPulse 1.8s ease-out infinite;
}

.success-mark span {
  width: 48px;
  height: 24px;
  border-left: 7px solid var(--success);
  border-bottom: 7px solid var(--success);
  transform: rotate(-45deg) translate(3px, -3px);
  animation: successCheck .6s ease-out both;
}

@keyframes successCheck {
  from { opacity: 0; transform: scale(.6) rotate(-45deg) translate(3px, -3px); }
  to { opacity: 1; transform: scale(1) rotate(-45deg) translate(3px, -3px); }
}

@keyframes successPulse {
  0% { box-shadow: 0 0 0 0 rgba(31, 122, 77, .28); }
  70% { box-shadow: 0 0 0 18px rgba(31, 122, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(31, 122, 77, 0); }
}

@keyframes successFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@media (max-width: 820px) {
  .nav-toggle {
    display: inline-flex;
    order: 2;
    margin-left: auto;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
  }

  .site-header {
    align-items: center;
    flex-direction: row;
    padding: 8px 16px;
    min-height: 56px;
    gap: 12px;
  }

  .brand { display: flex; align-items: center; gap: 12px; }
  .brand-logo { width: 44px; height: 44px; }

  /* mobile nav: default stacked links under header */
  nav {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 8px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, .08);
  }

  nav.open { display: flex; }

  nav a,
  nav form .link-button,
  nav form button {
    width: 100%;
    justify-content: flex-start;
  }

/* Desktop-specific nav compacting */
@media (min-width: 821px) {
  nav { position: static; top: auto; right: auto; width: auto; height: auto; transform: none; padding: 0; background: transparent; box-shadow: none; border-left: 0; }
  nav a, nav form .link-button { display: inline-flex; padding: 8px 12px; margin: 0; background: linear-gradient(90deg, rgba(210,175,63,.95), rgba(210,175,63,.85)); border-radius: 6px; }
  nav a { min-width: 110px; }
  body.modal-open::before { display: none; }
}

  nav a:hover,
  nav form .link-button:hover {
    background: rgba(255,255,255,.04);
    transform: none;
  }

  .hero, .two-column, .scanner-layout { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  
  /* Dashboard responsive */
  .dashboard-stats { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .member-grid { grid-template-columns: 1fr; }
  .programs-card { grid-column: 1; }
  .dashboard-header { padding: 24px 16px 18px; }
  .dashboard-header h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
  
  .registration-heading { grid-template-columns: 82px minmax(0, 1fr); }
  .registration-heading img { width: 82px; height: 82px; }
  .step-indicator { grid-template-columns: 1fr 1fr; }
  .step-dot { grid-template-columns: 30px minmax(0, 1fr); min-height: 52px; }
  .step-dot span { width: 30px; height: 30px; }
  .form-grid { grid-template-columns: 1fr; }
  .filters { display: grid; gap: 12px; }
  .filters input, .filters select, .filters button { width: 100%; }
  .list-item { grid-template-columns: 1fr; padding: 12px; }
  .attendance-row { flex-direction: column; align-items: stretch; }
  .attendance-row .status-pill { margin-top: 10px; width: fit-content; }
  .form-card, .table-wrap, .qr-panel, .profile-summary, .scanner-box { width: 100%; }

  .qr-panel img { width: min(100%, 300px); border: 1px solid var(--line); background: white; padding: 8px; }

  .qr-modal-card {
    position: relative;
    width: min(520px, 100%);
    padding: clamp(18px, 4vw, 32px);
    text-align: center;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  .success-card {
    position: relative;
    width: min(720px, 100%);
    overflow: hidden;
    padding: clamp(20px, 4vw, 36px);
    text-align: center;
    background: linear-gradient(180deg, rgba(31, 32, 35, .97), rgba(10, 11, 13, .98));
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  .scan-result-card {
    width: min(680px, 100%);
    padding: clamp(18px, 4vw, 36px);
    text-align: center;
    background: linear-gradient(180deg, rgba(31, 32, 35, .97), rgba(10, 11, 13, .98));
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }
}

/* Mobile responsive sidebar */
@media (max-width: 768px) {
  .app-wrapper {
    flex-direction: column;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(210, 175, 63, .1);
    flex-direction: column;
    padding: 0;
    border-radius: 0;
  }

  .sidebar.collapsed {
    width: 100%;
  }

  .sidebar-header {
    padding: 12px;
    border-bottom: none;
  }

  .sidebar .brand {
    gap: 8px;
  }

  .sidebar .brand-logo {
    width: 40px;
    height: 40px;
  }

  .sidebar .brand-text {
    font-size: 12px;
  }

  .sidebar-search {
    display: none;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0 12px;
    gap: 6px;
  }

  .nav-section {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }

  .nav-section-title {
    display: none;
  }

  .nav-item {
    margin: 0;
    padding: 8px 12px;
    font-size: 12px;
    flex: 0 1 auto;
  }

  .sidebar.collapsed .nav-item {
    margin: 0;
  }

  .sidebar-footer {
    border-top: none;
    padding: 8px 12px;
  }

  .nav-logout {
    padding: 8px 12px;
    font-size: 12px;
  }

  .main-content {
    margin-left: 0;
  }

  .main-content.sidebar-collapsed {
    margin-left: 0;
  }
}

/* Notifications (Sprint 2) */
.nav-badge{display:inline-block;min-width:18px;padding:0 6px;margin-left:auto;border-radius:9px;background:#c0392b;color:#fff;font-size:.72rem;font-weight:700;line-height:18px;text-align:center}
.notifications-actions{margin-bottom:1rem}
.notification-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}
.notification-item{border:1px solid #e3e3e3;border-radius:10px;background:#fff}
.notification-item.unread{border-left:4px solid #c0392b;background:#fcf6f5}
.notification-link{display:flex;flex-direction:column;gap:.25rem;padding:.85rem 1rem;text-decoration:none;color:inherit}
.notification-category{font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:#7a7a7a}
.notification-message{font-weight:600}
.notification-time{font-size:.78rem;color:#9a9a9a}
.export-buttons{display:flex;gap:.4rem;flex-wrap:wrap}
.scanner-box.scanner-unavailable video{display:none}
.scanner-box.scanner-unavailable{border:2px dashed #c0392b;background:#fcf6f5}
.scanner-box.scanner-unavailable #scanner-status{color:#c0392b;font-weight:600}
.filter-date{display:inline-flex;align-items:center;gap:.35rem;font-size:.85rem;color:#555}
.resend-form{margin-top:.6rem}

/* ===== Topbar & user profile dropdown (reusable components) ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px;
  background: rgba(17, 18, 20, .7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(210, 175, 63, .12);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title { margin: 0; font-size: 18px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 14px; }

.topbar-hamburger { display: none; flex-direction: column; gap: 4px; justify-content: center; width: 40px; height: 40px; padding: 9px; border-radius: 8px; border: 1px solid rgba(210, 175, 63, .2); background: rgba(210, 175, 63, .08); cursor: pointer; }
.topbar-hamburger span { display: block; width: 100%; height: 2px; border-radius: 2px; background: var(--ink); }

.topbar-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ink); text-decoration: none; transition: background .2s ease; }
.topbar-bell:hover { background: rgba(210, 175, 63, .12); }
.topbar-bell svg { width: 22px; height: 22px; flex-shrink: 0; stroke: currentColor; fill: none; }
.topbar-bell-badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #c0392b; color: #fff; font-size: .65rem; font-weight: 700; line-height: 16px; text-align: center; }

.user-menu { position: relative; }
.user-menu-trigger { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid rgba(210, 175, 63, .2); background: rgba(210, 175, 63, .08); border-radius: 10px; cursor: pointer; color: var(--ink); font-family: inherit; transition: all .2s ease; }
.user-menu-trigger:hover { background: rgba(210, 175, 63, .15); border-color: rgba(210, 175, 63, .3); }
.user-menu-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; min-width: 0; }
.user-menu-name { font-size: 13px; font-weight: 700; color: var(--ink); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-role { font-size: 11px; font-weight: 600; color: var(--gold); }
.user-menu-trigger .dropdown-arrow { transition: transform .2s ease; }
.user-menu.open .user-menu-trigger .dropdown-arrow { transform: scaleY(-1); }

/* Avatar: reuse .user-avatar; size per breakpoint and let images fill it */
.topbar .user-avatar { width: 40px; height: 40px; font-size: 14px; overflow: hidden; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.user-avatar-lg { width: 48px; height: 48px; font-size: 18px; flex-shrink: 0; }

.dropdown-menu-custom {
  position: absolute; top: calc(100% + 8px); right: 0; width: 240px;
  background: rgba(17, 18, 20, .98); backdrop-filter: blur(20px);
  border: 1px solid rgba(210, 175, 63, .15); border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
  display: none; flex-direction: column; overflow: hidden; z-index: 1000;
}
.user-menu.open .dropdown-menu-custom { display: flex; }

.dropdown-user { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid rgba(210, 175, 63, .12); background: rgba(210, 175, 63, .05); text-decoration: none; }
.dropdown-user-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dropdown-user-name { font-size: 13px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-user-role { font-size: 11px; font-weight: 600; color: var(--gold); }
.dropdown-user-email { font-size: 11px; color: rgba(255, 255, 255, .6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dropdown-section { display: flex; flex-direction: column; padding: 6px 0; border-bottom: 1px solid rgba(210, 175, 63, .08); }
.dropdown-menu-custom .dropdown-item { padding: 9px 16px; font-size: 13px; }
.dropdown-menu-custom .dropdown-logout { margin: 0; }
.dropdown-item-danger { color: var(--danger); }
.dropdown-menu-custom .dropdown-item-danger:hover { background: rgba(255, 138, 128, .12); color: var(--danger); }

@media (max-width: 1024px) {
  .topbar .user-avatar { width: 36px; height: 36px; }
}

@media (max-width: 768px) {
  .topbar { padding: 8px 14px; }
  .topbar-hamburger { display: flex; }
  .topbar-left { flex: 1; }
  .topbar-title { flex: 1; font-size: 16px; text-align: center; }
  .topbar .user-avatar { width: 32px; height: 32px; font-size: 12px; }
  .user-menu-meta { display: none; }
  .dropdown-menu-custom { width: 230px; }

  /* Off-canvas sidebar driven by the topbar hamburger */
  .sidebar, .sidebar.collapsed {
    position: fixed; top: 0; left: 0; height: 100%; width: 240px; max-width: 84vw;
    z-index: 200; transform: translateX(-100%); transition: transform .25s ease;
    border-right: 1px solid rgba(210, 175, 63, .12); border-bottom: none; border-radius: 0;
  }
  .sidebar.mobile-open { transform: translateX(0); box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
  .sidebar-nav { flex-direction: column; padding: 8px 12px; }
  .nav-section { flex-direction: column; }
  .sidebar.collapsed .nav-text, .sidebar.collapsed .brand-text, .sidebar.collapsed .user-name-mini { display: inline; }
}

/* ===== Notification bell dropdown (toggle panel) ===== */
.topbar-bell { border: none; background: none; font: inherit; }
.notif-menu { position: relative; }
.notif-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; width: 320px; max-width: 86vw;
  background: rgba(17, 18, 20, .98); backdrop-filter: blur(20px);
  border: 1px solid rgba(210, 175, 63, .15); border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
  display: none; flex-direction: column; overflow: hidden; z-index: 1000;
}
.notif-menu.open .notif-dropdown { display: flex; }
.notif-dropdown-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid rgba(210, 175, 63, .12);
  font-size: 13px; font-weight: 700; color: var(--ink);
}
.notif-count { font-size: 11px; font-weight: 700; color: var(--gold); }
.notif-dropdown-list { display: flex; flex-direction: column; max-height: 340px; overflow-y: auto; }
.notif-row {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 16px;
  text-decoration: none; border-bottom: 1px solid rgba(210, 175, 63, .06);
  transition: background .15s ease;
}
.notif-row:hover { background: rgba(210, 175, 63, .08); }
.notif-row.unread { border-left: 3px solid var(--gold); background: rgba(210, 175, 63, .05); }
.notif-row-cat { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--gold); }
.notif-row-msg { font-size: 13px; color: var(--ink); }
.notif-row-time { font-size: 11px; color: rgba(255, 255, 255, .5); }
.notif-empty { margin: 0; padding: 18px 16px; font-size: 13px; color: rgba(255, 255, 255, .55); text-align: center; }
.notif-viewall {
  display: block; padding: 11px 16px; text-align: center; text-decoration: none;
  font-size: 13px; font-weight: 600; color: var(--gold);
  border-top: 1px solid rgba(210, 175, 63, .12); background: rgba(210, 175, 63, .04);
}
.notif-viewall:hover { background: rgba(210, 175, 63, .1); }

@media (max-width: 768px) {
  .notif-dropdown {
    position: fixed; top: 58px; left: 12px; right: 12px; width: auto; max-width: none;
  }
}

/* ===== Reports filter bar — uniform responsive grid ===== */
.report-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
  margin: 0 0 18px;
}
.report-filters > * { width: 100%; min-width: 0; margin: 0; }
.report-filters input,
.report-filters select {
  width: 100%;
  min-width: 0;
  height: 42px;
  box-sizing: border-box;
}
.report-filters .filter-date { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.report-filters .filter-date input { flex: 1; min-width: 0; }
.report-filters button { width: auto; min-width: 0; justify-self: start; white-space: nowrap; }
@media (max-width: 900px) { .report-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .report-filters { grid-template-columns: 1fr; } }

/* Compact stat tiles: group the number + label instead of stretching them apart
   (overrides .stats article justify-content: space-between further up the file). */
.compact-stats article { justify-content: center; gap: 10px; padding: 14px 16px; }
