/* NSS Activity Manager - Official NSS Color Theme & Mobile-Optimized Design System */
:root {
  /* NSS Brand Palette: Deep Blue, Energy Crimson Red, Konark Sun Gold */
  --nss-navy: #0f2a4a;
  --nss-navy-dark: #09182b;
  --nss-navy-light: #1e3a64;
  --nss-red: #c0392b;
  --nss-red-hover: #a93226;
  --nss-gold: #f39c12;
  --nss-gold-light: #fef3c7;
  
  --bg: #f4f7fa;
  --surface: #ffffff;
  --surface-2: #edf2f7;
  --text: #0f172a;
  --muted: #475569;
  --line: #cbd5e1;
  
  --primary: var(--nss-navy);
  --primary-hover: var(--nss-navy-light);
  --accent: var(--nss-red);
  --warning: #d97706;
  --danger: #b91c1c;
  --success: #15803d;
  
  --radius: 0px;
  --radius-sm: 0px;
  --shadow: 0 4px 20px -2px rgba(15, 42, 74, 0.08), 0 2px 6px -1px rgba(15, 42, 74, 0.04);
  --shadow-lg: 0 12px 32px -4px rgba(15, 42, 74, 0.12);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  border-radius: 0 !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Topbar & Header */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-toggle,
.sidebar-overlay {
  display: none;
}

/* Sidebar & Navigation - NSS Navy Theme */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  background: var(--nss-navy-dark);
  color: #f8fafc;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(9, 24, 43, 0.15);
  overflow-y: auto;
  max-height: 100vh;
  -webkit-overflow-scrolling: touch;
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 8px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: transparent;
  color: #ffffff;
  border-radius: 10px;
  font-weight: 900;
  font-size: 22px;
  overflow: hidden;
}

.brand-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand strong {
  font-size: 17px;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.brand small {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 2px;
}

nav {
  display: grid;
  gap: 6px;
}

nav a {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  font-weight: 500;
  font-size: 14.5px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(2px);
}

nav a.active {
  background: var(--nss-red);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(192, 57, 43, 0.35);
}

.session-card {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
}

.session-card span {
  font-weight: 600;
  color: #ffffff;
  font-size: 14px;
}

.session-card small {
  color: #94a3b8;
  margin: 2px 0 10px;
  font-size: 12px;
  text-transform: capitalize;
  display: block;
}

.session-card a {
  color: var(--nss-gold);
  font-weight: 700;
  font-size: 13px;
  display: inline-block;
  transition: var(--transition);
}

.session-card a:hover {
  text-decoration: underline;
}

/* Layout & Main Content */
.main {
  margin-left: 260px;
  padding: 32px 28px;
  min-height: 100vh;
  max-width: 1440px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

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

h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--nss-navy);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--nss-navy);
  margin-bottom: 16px;
}

h3 {
  font-size: 16px;
  font-weight: 650;
  color: var(--nss-navy-light);
  margin: 20px 0 12px;
}

.topbar p,
.form-intro {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}

/* Buttons & Controls */
.button,
button {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  touch-action: manipulation;
  min-height: 42px;
}

.button,
.primary {
  background: var(--nss-navy);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 42, 74, 0.2);
}

.button:hover,
.primary:hover {
  background: var(--nss-navy-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(15, 42, 74, 0.3);
}

.secondary,
.icon-button {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--line);
}

.secondary:hover,
.icon-button:hover {
  background: var(--surface-2);
  border-color: #94a3b8;
}

.danger,
.button-danger {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
  font-weight: 650;
}

.danger:hover,
.button-danger:hover {
  background: #fee2e2;
  color: #991b1b;
}

/* Alert Notices */
.notice {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  font-size: 14.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}

.notice.success {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bbf7d0;
}

.notice.error {
  background: #fef2f2;
  color: var(--danger);
  border-color: #fecaca;
}

/* Metric Cards Grid */
.metrics,
.student-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metrics {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.metric {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-left: 4px solid var(--nss-navy);
}

.metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-left-color: var(--nss-red);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric strong {
  font-size: 32px;
  font-weight: 800;
  color: var(--nss-navy);
}

/* Panels & Form Grids */
.panel {
  padding: 24px;
}

.workspace,
.survey-layout,
.split {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

@media (max-width: 1100px) {
  .workspace,
  .survey-layout,
  .split {
    grid-template-columns: 1fr;
  }
}

.survey-layout {
  grid-template-columns: minmax(360px, 640px) minmax(0, 1fr);
}

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

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

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

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label span,
.choice-field legend {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}

/* Choice Radio Grid */
.choice-field {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.choice-field > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice-field label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  cursor: pointer;
  transition: var(--transition);
}

.choice-field input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.choice-field label:has(input:checked) {
  border-color: var(--nss-navy);
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px var(--nss-navy);
}

.choice-field label:has(input:checked) span {
  color: var(--nss-navy);
  font-weight: 700;
}

/* Inputs & Form Controls */
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: #ffffff;
  min-width: 0;
  transition: var(--transition);
  min-height: 44px;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--nss-navy);
  box-shadow: 0 0 0 3px rgba(15, 42, 74, 0.15);
}

/* Number Stepper Control UI */
.stepper-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  overflow: hidden;
  transition: var(--transition);
}

.stepper-wrap:focus-within {
  border-color: var(--nss-navy);
  box-shadow: 0 0 0 3px rgba(15, 42, 74, 0.15);
}

.stepper-btn {
  flex: 0 0 42px;
  height: 44px;
  min-height: 44px;
  border: none;
  background: #f1f5f9;
  color: var(--nss-navy);
  font-size: 20px;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
  padding: 0;
  border-radius: 0;
}

.stepper-btn:hover {
  background: var(--nss-navy);
  color: #ffffff;
}

.stepper-btn:active {
  transform: scale(0.92);
}

.stepper-input {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  padding: 0 6px;
  min-width: 0;
  -moz-appearance: textfield;
  appearance: textfield;
}

.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.wide {
  grid-column: 1 / -1;
}

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

.actions {
  margin-top: 18px;
}

.actions button {
  min-width: 120px;
}

.editing {
  outline: 3px solid var(--nss-gold);
  border-color: var(--nss-gold);
}

/* Checkbox Grid */
.checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.checks label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #ffffff;
  cursor: pointer;
  transition: var(--transition);
  min-height: 44px;
}

.checks label:hover {
  border-color: var(--nss-navy);
  background: #f8fafc;
}

.checks input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--nss-navy);
  cursor: pointer;
}

/* Data Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  text-align: left;
  vertical-align: middle;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

th {
  color: var(--nss-navy);
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: #f8fafc;
}

/* Login Page Styling */
.login-page {
  background: 
    radial-gradient(circle at 10% 20%, rgba(15, 42, 74, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(192, 57, 43, 0.08) 0%, transparent 40%),
    var(--bg);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(100%, 420px);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px;
}

.login-brand {
  margin-bottom: 24px;
}

.login-brand strong {
  color: var(--nss-navy-dark) !important;
  font-size: 18px;
  font-weight: 800;
}

.login-brand small {
  color: var(--muted) !important;
}

.full-button {
  width: 100%;
  margin-top: 8px;
  height: 46px;
  font-size: 15px;
}

/* Settings & Switches */
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: #ffffff;
}

.switch input {
  width: 22px;
  height: 22px;
  accent-color: var(--nss-navy);
}

/* Student Mobile Portal Header */
.student-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--nss-navy-dark);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(9, 24, 43, 0.2);
}

.student-header .brand {
  gap: 10px;
}

.student-header strong {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  display: block;
}

.student-header span {
  color: #cbd5e1;
  font-size: 12px;
  display: block;
}

.student-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.student-header-actions .button,
.student-header-actions button {
  padding: 8px 12px;
  min-height: 38px;
  font-size: 13px;
}

.student-header-actions .button {
  background: var(--nss-red);
  color: #ffffff;
}

.student-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* Draft Panel */
.draft-panel {
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #eff6ff, #ffffff);
  padding: 16px;
  margin-bottom: 20px;
}

.draft-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 12px;
  transition: var(--transition);
}

.draft-card.active {
  border-color: var(--nss-navy);
  box-shadow: inset 4px 0 0 var(--nss-navy);
}

/* Geo Panel */
.geo-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  padding: 14px;
  margin-bottom: 18px;
}

.geo-panel.required {
  border-color: var(--nss-gold);
  background: var(--nss-gold-light);
}

/* Mobile Card Stack Component */
.mobile-list {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.mobile-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 16px;
  box-shadow: var(--shadow);
}

.mobile-card strong {
  display: block;
  font-size: 16px;
  color: var(--nss-navy);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f1f5f9;
}

.mobile-card div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid #f1f5f9;
  font-size: 14px;
}

.mobile-card div:first-of-type {
  border-top: none;
}

.mobile-card span {
  color: var(--muted);
  font-size: 13px;
}

.mobile-card b {
  color: var(--text);
  font-weight: 600;
}

/* RESPONSIVE & MOBILE DESIGN SYSTEM */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--nss-navy);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    max-width: 84vw;
    height: 100vh;
    background: var(--nss-navy-dark);
    padding: 24px 16px;
    gap: 20px;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 8px 0 24px rgba(9, 24, 43, 0.3);
  }

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

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(9, 24, 43, 0.6);
    backdrop-filter: blur(3px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  body.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  nav {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding-bottom: 0;
    gap: 6px;
  }

  nav a {
    white-space: normal;
    padding: 12px 16px;
    flex: none;
  }

  .session-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: auto;
    gap: 6px;
  }

  .session-card small {
    display: block;
    margin: 0;
  }

  .session-card a {
    display: block;
    margin-top: 6px;
  }

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

  .metrics,
  .workspace,
  .survey-layout,
  .student-layout,
  .split {
    grid-template-columns: 1fr;
  }

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

  .student-summary .metric {
    padding: 10px 8px;
  }

  .student-summary .metric span {
    font-size: 11px;
    line-height: 1.2;
  }

  .student-summary .metric strong {
    font-size: 20px;
  }
}

@media (max-width: 768px) {
  .table-wrap {
    border: none;
    background: transparent;
    overflow: visible;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap th,
  .table-wrap td,
  .table-wrap tr {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tbody tr {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
  }

  .table-wrap td {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
    font-size: 14px;
  }

  .table-wrap td:last-child {
    border-bottom: none;
    padding-top: 12px;
    justify-content: flex-end;
  }

  .table-wrap td[data-label]::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    margin-right: 12px;
  }
}

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

  .topbar .button {
    width: 100%;
  }

  nav,
  .form-grid,
  .form-grid.compact,
  .checks {
    grid-template-columns: 1fr;
  }

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

  .metric {
    padding: 14px;
  }

  .metric strong {
    font-size: 24px;
  }

  h1 {
    font-size: 22px;
  }

  .panel {
    padding: 16px;
  }

  input,
  select,
  textarea {
    font-size: 16px; /* Prevents auto-zoom on iOS */
    padding: 12px;
  }

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

  .actions button {
    width: 100%;
    height: 48px;
  }
}

@media (max-width: 480px) {
  .student-header {
    padding: 12px 14px;
  }

  .student-header strong {
    font-size: 14px;
  }

  .student-main {
    padding: 14px 10px;
  }

  .mobile-card div {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .mobile-card b {
    text-align: left;
  }
}

/* QR Code & Modal Styles */
.hidden {
  display: none !important;
}

.qr-reg-card {
  width: min(100%, 640px);
}

.qr-camera-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.qr-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(9, 24, 43, 0.7);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 16px;
}

.qr-modal-card {
  background: #ffffff;
  border-radius: var(--radius);
  padding: 24px;
  width: min(100%, 480px);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.qr-modal-card h3 {
  margin: 0;
}

.qr-code-display-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.qr-url-text {
  font-family: monospace;
  font-size: 13px;
  color: var(--navy);
  word-break: break-all;
  overflow-wrap: anywhere;
  white-space: normal;
  text-align: center;
  margin: 0;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  width: 100%;
  box-sizing: border-box;
  user-select: all;
}

.qr-video-preview {
  width: 100%;
  max-height: 260px;
  background: #000000;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.qr-status-msg {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* Photo Manager inside Form */
.photos-manager-wrapper {
  margin-top: 15px;
}
.photos-manager-wrapper label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-dark);
}
.photos-manager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  background: var(--bg-light);
  border: 1px dashed var(--line);
  padding: 12px;
  border-radius: var(--radius);
}
.photos-manager-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #ffffff;
}
.photos-manager-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.remove-photo-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: #ffffff;
  border: none;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: var(--transition);
}
.remove-photo-btn:hover {
  background: rgb(220, 38, 38);
  transform: scale(1.1);
}

/* Activities Grid & Cards */
.activities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 20px;
}
.activity-card {
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.activity-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Activity Gallery / Slider */
.activity-gallery {
  position: relative;
  width: 100%;
  height: 220px;
  background: var(--bg-light);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.gallery-viewport {
  position: relative;
  width: 100%;
  height: 100%;
}
.gallery-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
}
.gallery-slide.active {
  opacity: 1;
  z-index: 2;
}
.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-prev,
.gallery-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(15, 42, 74, 0.7);
  color: #ffffff;
  border: none;
  font-size: 16px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.gallery-prev:hover,
.gallery-next:hover {
  background: rgba(15, 42, 74, 0.9);
}
.gallery-prev {
  left: 10px;
}
.gallery-next {
  right: 10px;
}
.gallery-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 8px;
  border-radius: 12px;
}
.gallery-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--transition);
}
.gallery-dot.active {
  background: #ffffff;
  transform: scale(1.2);
}

.activity-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: var(--muted);
}
.placeholder-icon {
  font-size: 36px;
  margin-bottom: 8px;
}
.placeholder-text {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Activity Card Body */
.activity-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.activity-card-header {
  margin-bottom: 12px;
}
.activity-meta-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 8px;
}
.activity-date-badge {
  color: var(--muted);
  font-weight: 500;
}
.activity-type-badge {
  background: rgba(15, 42, 74, 0.08);
  color: var(--nss-navy);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
}
.activity-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
  margin: 0;
  line-height: 1.3;
}
.activity-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
}
.tag-unit,
.tag-village {
  background: var(--bg-light);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  color: var(--text);
}
.tag-general {
  border-color: #cbd5e1;
  color: var(--muted);
}
.activity-card-desc {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  margin: 0 0 12px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.activity-card-outcomes {
  background: #f8fafc;
  border-left: 3px solid #10b981;
  padding: 8px 12px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.activity-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  margin-bottom: 16px;
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-light);
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.stat-count {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
}
.stat-lbl {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 500;
  margin-top: 2px;
}
.activity-card-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* Public Landing & Detail Page Styles */
.public-page {
  --navy: var(--nss-navy);
  background-color: #f8fafc;
  color: var(--text);
  font-family: var(--font-base);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.public-header {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.public-header .brand strong {
  color: var(--nss-navy) !important;
}
.public-header .brand small {
  color: var(--muted) !important;
}
.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.public-nav {
  display: flex;
  gap: 12px;
}
.nav-btn {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.dashboard-btn {
  background: var(--navy);
  color: #ffffff;
}
.dashboard-btn:hover {
  background: #1e3a5f;
}
.login-btn {
  background: #f1f5f9;
  color: var(--navy);
}
.login-btn:hover {
  background: #e2e8f0;
}
.student-btn {
  background: #10b981;
  color: #ffffff;
}
.student-btn:hover {
  background: #059669;
}
.back-btn {
  color: var(--navy);
  border: 1px solid var(--line);
}
.back-btn:hover {
  background: var(--bg-light);
}

.public-hero {
  background: #ffffff;
  color: var(--nss-navy);
  padding: 60px 20px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.hero-content {
  max-width: 800px;
  margin: 0 auto;
}
.hero-content h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--nss-navy);
}
.hero-content p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}

.public-content {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
  flex-grow: 1;
}
.public-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 24px;
}

/* Public details custom styles */
.public-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.view-details-action {
  margin-top: auto;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  text-align: right;
  transition: var(--transition);
}
.public-card:hover .view-details-action span {
  text-decoration: underline;
  padding-right: 4px;
}

/* Detail view layout */
.detail-container {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
  flex-grow: 1;
}
.activity-detail-card {
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}
.activity-detail-gallery {
  position: relative;
  width: 100%;
  height: 400px;
  background: var(--bg-light);
  overflow: hidden;
}
@media (max-width: 768px) {
  .activity-detail-gallery {
    height: 250px;
  }
}
.activity-detail-body {
  padding: 32px;
}
.activity-detail-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  margin: 8px 0 20px 0;
  line-height: 1.25;
}
.activity-detail-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}
.meta-card {
  background: var(--bg-light);
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: var(--radius-sm);
}
.meta-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}
.meta-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}

.activity-detail-section {
  margin-bottom: 30px;
}
.activity-detail-section h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 12px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 8px;
}
.description-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}
.outcomes-section {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 20px;
}
.outcomes-section h2 {
  border-bottom-color: #bbf7d0;
  color: #166534;
}
.outcomes-text {
  font-size: 15px;
  line-height: 1.6;
  color: #14532d;
}

.activity-detail-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}
.detail-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-light);
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: var(--radius-sm);
}
.detail-stat-card .stat-icon {
  font-size: 28px;
  margin-bottom: 8px;
}
.detail-stat-card .stat-number {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
}
.detail-stat-card .stat-label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.public-footer {
  background: #ffffff;
  border-top: 1px solid var(--line);
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-top: auto;
}
