:root {
  --app-bg: #f5f7fb;
  --surface: rgba(255, 255, 255, 0.95);
  --surface-strong: #ffffff;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --border-soft: rgba(226, 232, 240, 0.8);
  --shadow-soft: 0 18px 35px rgba(15, 23, 42, 0.12);
  --shadow-hero: 0 25px 45px rgba(80, 106, 234, 0.28);
  --brand-primary: #4c6ef5;
  --brand-primary-dark: #364fc7;
  --brand-secondary: #a855f7;
}

body {
  background: radial-gradient(circle at top left, rgba(76, 110, 245, 0.12), transparent 45%),
    radial-gradient(circle at bottom right, rgba(168, 85, 247, 0.15), transparent 40%),
    var(--app-bg);
  min-height: 100vh;
  color: var(--text-primary);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
}

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

.app-navbar {
  background: linear-gradient(135deg, rgba(76, 110, 245, 0.95), rgba(118, 75, 162, 0.95));
  box-shadow: var(--shadow-hero);
  border: 0;
}

.app-navbar .navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.navbar-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.navbar-logo-text {
  font-size: 1.25rem;
}

.app-navbar .btn,
.app-navbar .nav-link {
  border-radius: 999px;
  font-weight: 600;
  padding-inline: 1.15rem;
}

.app-navbar .btn-outline-light {
  border-width: 2px;
}

.app-main {
  flex: 1 1 auto;
  padding: 2.5rem 0 4rem;
}

.content-shell {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.auth-card {
  max-width: 520px;
  margin: 0 auto;
}

.auth-card .page-header {
  text-align: center;
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.page-title {
  font-weight: 700;
  font-size: clamp(1.75rem, 1.2rem + 1.5vw, 2.5rem);
  color: var(--text-primary);
}

.page-subtitle {
  color: var(--text-muted);
  max-width: 720px;
}

.surface-card,
.card {
  border-radius: 1.5rem;
  border: 1px solid rgba(226, 232, 240, 0.6);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.card-header,
.surface-card-header {
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  background: rgba(243, 246, 255, 0.7);
  border-top-left-radius: 1.5rem;
  border-top-right-radius: 1.5rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.card-body,
.surface-card-body {
  padding: 1.75rem;
}

.alert {
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.selection-panel {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 1.25rem;
  border: 1px solid var(--border-soft);
  padding: 1.25rem;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
  height: 100%;
}

.selection-panel h6 {
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.table {
  border-radius: 1.25rem;
  overflow: hidden;
  background: var(--surface-strong);
}

.table thead {
  background: rgba(76, 110, 245, 0.08);
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.table-striped tbody tr:nth-of-type(odd) {
  background: rgba(76, 110, 245, 0.04);
}

.table > :not(caption) > * > * {
  padding: 1rem 1.25rem;
  vertical-align: middle;
}

.table thead th.text-center {
  text-align: center;
}

.dashboard-table {
  font-size: 0.875rem;
}

.dashboard-table > :not(caption) > * > * {
  padding: 0.5rem 0.75rem;
}

.dashboard-table .table-actions .btn {
  padding: 0.375rem 0.75rem;
  border-radius: 0.75rem;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.table-search-input {
  width: 100%;
  max-width: 220px;
}

@media (max-width: 576px) {
  .table-search-input {
    max-width: 100%;
  }
}

.form-control,
.form-select {
  border-radius: 0.9rem;
  border: 1px solid rgba(209, 213, 219, 0.8);
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(76, 110, 245, 0.65);
  box-shadow: 0 0 0 0.25rem rgba(76, 110, 245, 0.2);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  border: none;
  box-shadow: 0 15px 30px rgba(76, 110, 245, 0.35);
  border-radius: 0.9rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  text-align: center;
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, var(--brand-primary-dark), var(--brand-secondary));
}

.btn-outline-secondary,
.btn-secondary {
  border-radius: 0.9rem;
  border-width: 2px;
  font-weight: 600;
  text-align: center;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background: rgba(15, 23, 42, 0.05);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
}

.pagination .page-item {
  flex: 0 0 auto;
}

.pagination .page-link {
  border: none;
  border-radius: 999px !important;
  padding: 0.65rem 1.1rem;
  color: var(--brand-primary);
  font-weight: 600;
}

.pagination .page-ellipsis {
  cursor: default;
  color: var(--text-muted);
}

.pagination .page-item.active .page-link {
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 10px 20px rgba(76, 110, 245, 0.3);
}

@media (max-width: 576px) {
  .pagination {
    justify-content: flex-start;
  }
}

.progress {
  background-color: rgba(226, 232, 240, 0.8);
  border-radius: 999px;
  overflow: hidden;
  height: 1.75rem;
}

.progress-bar {
  font-weight: 600;
}

.progress-label {
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 1.5rem);
  padding: 0 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* Submission detail page */
.submission-card {
  border-radius: 2rem;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
}

.submission-hero {
  background: linear-gradient(135deg, rgba(76, 110, 245, 0.95), rgba(118, 75, 162, 0.95));
  box-shadow: var(--shadow-hero);
  position: relative;
}

.submission-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.35), transparent 55%);
  opacity: 0.9;
}

.submission-hero .hero-content {
  position: relative;
  z-index: 1;
}

.submission-hero .badge {
  background-color: rgba(255, 255, 255, 0.25) !important;
  color: #fff;
}

.hero-accent {
  position: absolute;
  inset: auto -4rem -4rem auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 65%);
  filter: blur(0px);
  opacity: 0.7;
}

.info-tile {
  background: #ffffff;
  border-radius: 1.25rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border: 1px solid var(--border-soft);
}

.info-tile.minimal {
  box-shadow: none;
  background: rgba(255, 255, 255, 0.9);
}

.info-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.info-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.info-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.section-nav .section-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: rgba(76, 110, 245, 0.1);
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.section-nav .section-pill:hover,
.section-nav .section-pill:focus {
  background: rgba(76, 110, 245, 0.18);
  color: var(--brand-primary-dark);
}

.content-stack {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.section-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 1.5rem;
  padding: 1.75rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(226, 232, 240, 0.7);
}

.section-title {
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 1.25rem;
  color: #1f2937;
}

.section-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-grid {
  display: grid;
  gap: 1.5rem;
}

.detail-grid.two-cols {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.detail-grid.three-cols {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

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

.detail-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 0.35rem;
}

.detail-value {
  font-size: 1rem;
  color: var(--text-primary);
  margin: 0;
}

.gallery-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.75rem;
}

.gallery-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.gallery-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 1rem;
  box-shadow: 0 10px 18px rgba(30, 64, 175, 0.18);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-image:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 18px 28px rgba(59, 130, 246, 0.2);
}

@media (max-width: 767.98px) {
  .submission-card {
    border-radius: 1.25rem;
  }

  .section-card {
    border-radius: 1.25rem;
    padding: 1.35rem;
  }

  .gallery-image {
    height: 140px;
  }
}

#modalImage {
  max-height: 90vh;
  cursor: zoom-in;
  transition: transform 0.3s ease;
}

#modalImage.zoomed {
  transform: scale(1.9);
  cursor: zoom-out;
}

@media (max-width: 991.98px) {
  .app-main {
    padding-top: 1.5rem;
  }

  .card-body,
  .surface-card-body {
    padding: 1.5rem;
  }
}
