/* ============================================
   TNC Proposals — Global Styles
   Matches TNC Platform design system
   vw-based scaling: designed at 1920px
   ============================================ */

:root {
  --bg: #39009d;
  --fg: #7fcdff;
  --accent: #5c66ce;
  --font-display: 'Helvetica', 'Arial', sans-serif;
  --font-body: 'Helvetica', 'Arial', sans-serif;
  --font: var(--font-display);
  --page-padding: 2.45vw;

  --text-xxl: 3.75vw;
  --text-xl: 3.2vw;
  --text-lg: 2.5vw;
  --text-body: 2vw;
  --text-nav: 1.45vw;
  --text-card: 1.25vw;
  --text-ui: 1.04vw;
  --text-meta: 0.85vw;
  --text-sm: 0.73vw;
  --text-xs: 0.65vw;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
.hidden { display: none !important; }

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  min-height: 100vh;
  overflow-x: clip;
}

a { color: var(--fg); text-decoration: none; }
img { display: block; max-width: 100%; }
input, textarea, select, button { font-family: inherit; }

/* ============================================
   HEADER
   ============================================ */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background-color: var(--bg);
  border-bottom: 2px solid var(--fg);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5vw var(--page-padding);
}

.logo {
  font-size: var(--text-xxl);
  font-weight: 700;
  line-height: 1;
  color: var(--fg);
  white-space: nowrap;
  letter-spacing: -0.16vw;
}

.logo-block {
  display: flex;
  flex-direction: column;
}

.logo-subtitle {
  font-size: var(--text-meta);
  font-weight: 400;
  letter-spacing: 0.05vw;
  opacity: 0.6;
  text-transform: uppercase;
  line-height: 1;
  margin-top: -0.1vw;
}

.logo-amp { letter-spacing: -0.06em; }
.logo-tnc { letter-spacing: -0.03em; }
.logo-words { letter-spacing: -0.03em; }

.header-buttons {
  display: flex;
  gap: 0.5vw;
  align-items: center;
  flex-shrink: 1;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-user-email {
  width: 100%;
  text-align: right;
  margin-bottom: -0.2vw;
  font-size: var(--text-meta);
  text-transform: uppercase;
  font-weight: 400;
  letter-spacing: 0.05vw;
  opacity: 0.5;
}

.btn {
  display: inline-block;
  padding: 0.4vw 0.8vw;
  font-size: var(--text-ui);
  font-weight: 700;
  line-height: 0.83;
  letter-spacing: -0.05vw;
  text-transform: uppercase;
  white-space: nowrap;
  border: none;
  outline: none;
  cursor: pointer;
}

.btn-accent {
  background-color: var(--fg);
  color: var(--bg);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--fg);
  color: var(--fg);
}

.btn-danger {
  background: transparent;
  border: 2px solid #ff4444;
  color: #ff4444;
}

.btn-danger:hover { background: #ff4444; color: var(--bg); }

/* ============================================
   CONTENT
   ============================================ */
.content {
  margin-top: 8vw;
  padding: 1.5vw var(--page-padding) 2vw;
}

.page-title {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 0.83;
  letter-spacing: -0.125vw;
  text-transform: uppercase;
  margin-bottom: 1.5vw;
}

.page-subtitle {
  font-size: var(--text-nav);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.07vw;
  text-transform: uppercase;
  margin-bottom: 2vw;
  opacity: 0.7;
}

.divider {
  border: none;
  border-top: 2px solid var(--fg);
  margin: 2vw 0;
  width: 100%;
}

/* ============================================
   GATE — Login screen
   ============================================ */
.gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  padding: 16px;
}

.gate h1 {
  font-size: var(--text-xxl);
  font-weight: 700;
  line-height: 0.83;
  letter-spacing: -0.16vw;
  text-transform: uppercase;
  margin-bottom: 2vw;
}

.gate p {
  font-size: var(--text-nav);
  opacity: 0.7;
  margin-bottom: 2vw;
}

.gate-btn {
  font-size: var(--text-nav);
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.8vw 2.5vw;
  background: var(--fg);
  color: var(--bg);
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
}

/* ============================================
   NETFLIX CARD GRID
   ============================================ */
.card-row {
  position: relative;
  margin-bottom: 2vw;
}

.card-row-label {
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 0.83;
  letter-spacing: -0.125vw;
  text-transform: uppercase;
  margin-bottom: 1vw;
  padding-top: 1vw;
}

.card-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 1.5vw;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding-bottom: 0.5vw;
}

.card-grid::-webkit-scrollbar { display: none; }

/* Wrapping grid */
.card-grid-wrap {
  flex-wrap: wrap;
}

.card-grid-wrap .proposal-card {
  min-width: 0;
  max-width: none;
  flex: 0 0 calc(33.33% - 1vw);
}

/* ============================================
   PROPOSAL CARD
   ============================================ */
.proposal-card {
  min-width: 22.5vw;
  max-width: 22.5vw;
  scroll-snap-align: start;
  text-decoration: none;
  color: var(--fg);
  cursor: pointer;
  position: relative;
}

.proposal-card-image {
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--bg);
  border: 2px solid var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.proposal-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.proposal-card-image .placeholder-icon {
  font-size: var(--text-xxl);
  opacity: 0.2;
}

.proposal-card-title {
  font-size: var(--text-card);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.063vw;
  text-transform: uppercase;
  margin-top: 0.5vw;
}

.proposal-card-meta {
  font-size: var(--text-meta);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.05vw;
  margin-top: 0.2vw;
  opacity: 0.7;
}

.proposal-card-status {
  position: absolute;
  top: 0.5vw;
  right: 0.5vw;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2vw 0.5vw;
  background: var(--bg);
  border: 1px solid var(--fg);
}

.status-draft { opacity: 0.5; }
.status-submitted { border-color: var(--fg); }
.status-approved { border-color: #4caf50; color: #4caf50; }
.status-rejected { border-color: #ff4444; color: #ff4444; }
.status-revision { border-color: #ff9800; color: #ff9800; }

/* Scroll arrows */
.card-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg);
  color: var(--fg);
  border: 2px solid var(--fg);
  width: 3vw;
  height: 3vw;
  font-size: var(--text-nav);
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.card-row:hover .card-arrow { opacity: 1; }
.card-arrow-left { left: 0; }
.card-arrow-right { right: 0; }

/* ============================================
   PROPOSAL FORM
   ============================================ */
.form-section {
  margin-bottom: 2vw;
}

.form-section-title {
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 0.83;
  letter-spacing: -0.125vw;
  text-transform: uppercase;
  margin-bottom: 1vw;
  padding-bottom: 0.5vw;
  border-bottom: 2px solid var(--fg);
}

.form-guide {
  font-size: var(--text-card);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.063vw;
  margin-bottom: 1vw;
}

.form-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1vw;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.3vw;
}

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

.form-label {
  font-size: var(--text-meta);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05vw;
}

.form-label .required {
  color: var(--accent);
}

.form-input {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(127,205,255,0.3);
  color: var(--fg);
  font-size: var(--text-ui);
  padding: 0.5vw 0.7vw;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--fg);
  border-width: 2px;
}

.form-input::placeholder {
  color: var(--fg);
  opacity: 0.3;
}

textarea.form-input {
  resize: vertical;
  min-height: 6vw;
  line-height: 1.5;
  font-weight: 400;
}

select.form-input {
  cursor: pointer;
}

/* Rich Text Editor — Form Text Editor toolbar + editable area */
.rte-toolbar {
  display: flex;
  gap: 0.3vw;
  margin-bottom: 0.2vw;
}

.rte-btn {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(127,205,255,0.3);
  color: var(--fg);
  font-size: var(--text-meta);
  padding: 0.2vw 0.5vw;
  cursor: pointer;
  line-height: 1;
  min-width: 1.8vw;
  text-align: center;
  transition: background 0.2s, border-color 0.2s;
}

.rte-btn:hover {
  background: rgba(127,205,255,0.15);
  border-color: var(--fg);
}

.rte-editor {
  min-height: 3vw;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-y: auto;
  max-height: 15vw;
}

.rte-editor a {
  text-decoration: underline;
  color: var(--fg);
}

.rte-editor:empty::before {
  content: 'Click to edit...';
  opacity: 0.3;
  pointer-events: none;
}

.form-checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5vw;
  font-size: var(--text-ui);
}

.form-checkbox-row input[type="checkbox"] {
  width: 1.2vw;
  height: 1.2vw;
  accent-color: var(--fg);
}

.form-hint {
  font-size: var(--text-xs);
  opacity: 0.5;
  margin-top: 0.2vw;
}

.form-error {
  font-size: var(--text-xs);
  color: #ff4444;
  margin-top: 0.2vw;
}

/* Session fields — dynamic count */
.session-fields {
  display: flex;
  flex-direction: column;
  gap: 1vw;
}

.session-block {
  border: 1px solid rgba(127,205,255,0.2);
  padding: 1vw;
}

.session-block-title {
  font-size: var(--text-meta);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.5vw;
}

/* Reading fields */
.reading-fields {
  display: flex;
  flex-direction: column;
  gap: 0.5vw;
}

.reading-row {
  display: flex;
  gap: 0.5vw;
  align-items: center;
}

.reading-row input { flex: 1; }

.reading-skip-btn {
  margin-top: 0.5vw;
}

/* Month selector — multi-select chips */
.month-selector {
  display: flex;
  gap: 0.4vw;
  flex-wrap: wrap;
  margin-top: 0.3vw;
}

.month-chip {
  font-family: inherit;
  font-size: var(--text-meta);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03vw;
  padding: 0.35vw 0.8vw;
  border: 2px solid var(--fg);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.month-chip.active {
  background: var(--fg);
  color: var(--bg);
}

/* Image upload grid */
.image-upload-grid {
  display: flex;
  gap: 1vw;
  flex-wrap: wrap;
}

.image-upload-slot {
  width: 10vw;
  height: 7vw;
  border: 2px dashed rgba(127,205,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.image-upload-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-upload-slot .upload-label {
  font-size: var(--text-meta);
  opacity: 0.4;
  text-transform: uppercase;
}

.image-upload-slot .remove-image {
  position: absolute;
  top: 0.2vw;
  right: 0.2vw;
  background: var(--bg);
  color: #ff4444;
  border: 1px solid #ff4444;
  width: 1.5vw;
  height: 1.5vw;
  font-size: var(--text-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Portrait upload */
.portrait-upload {
  width: 8vw;
  height: 8vw;
  border: 2px dashed rgba(127,205,255,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

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

/* Form actions */
.form-actions {
  display: flex;
  gap: 1vw;
  align-items: center;
  margin-top: 2vw;
  padding-top: 1vw;
  border-top: 2px solid var(--fg);
}

.form-status {
  font-size: var(--text-meta);
  margin-left: 1vw;
}

/* ============================================
   REVIEW PAGE — Evaluation panel
   ============================================ */
.eval-panel {
  border: 2px solid var(--fg);
  padding: 1.5vw;
  margin-top: 1.5vw;
}

.eval-panel-title {
  font-size: var(--text-nav);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 1vw;
}

.eval-row {
  display: flex;
  gap: 1vw;
  align-items: flex-start;
  margin-bottom: 1vw;
}

.eval-label {
  font-size: var(--text-meta);
  font-weight: 700;
  text-transform: uppercase;
  min-width: 8vw;
  padding-top: 0.3vw;
}

.eval-stars {
  display: flex;
  gap: 0.3vw;
}

.eval-star {
  width: 2vw;
  height: 2vw;
  border: 2px solid var(--fg);
  background: transparent;
  color: var(--fg);
  font-size: var(--text-ui);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eval-star.active {
  background: var(--fg);
  color: var(--bg);
}

.eval-programs {
  display: flex;
  gap: 0.5vw;
  flex-wrap: wrap;
}

.eval-program-btn {
  font-size: var(--text-meta);
  padding: 0.3vw 0.8vw;
  border: 1px solid var(--fg);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  text-transform: uppercase;
}

.eval-program-btn.active {
  background: var(--fg);
  color: var(--bg);
}

.eval-season select {
  background: rgba(0,0,0,0.3);
  border: 2px solid var(--fg);
  color: var(--fg);
  font-size: var(--text-ui);
  padding: 0.3vw 0.6vw;
}

.eval-comment textarea {
  width: 100%;
  min-height: 4vw;
  background: rgba(0,0,0,0.3);
  border: 2px solid transparent;
  color: var(--fg);
  font-size: var(--text-ui);
  padding: 0.5vw;
  outline: none;
  resize: vertical;
  line-height: 1.5;
}

.eval-comment textarea:focus {
  border-color: var(--fg);
}

/* Other evaluations display */
.eval-others {
  margin-top: 1.5vw;
  border-top: 1px solid rgba(127,205,255,0.2);
  padding-top: 1vw;
}

.eval-other-item {
  margin-bottom: 1vw;
  padding-bottom: 0.5vw;
  border-bottom: 1px solid rgba(127,205,255,0.1);
}

.eval-other-email {
  font-size: var(--text-meta);
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.6;
}

.eval-other-detail {
  font-size: var(--text-meta);
  margin-top: 0.2vw;
}

/* ============================================
   PROPOSAL DETAIL — Course page layout
   Two-column grid: image left, info+content right
   ============================================ */
.proposal-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5vw;
  align-items: start;
}

.proposal-detail-left {
  position: sticky;
  top: 9vw;
}

.proposal-detail-right {
  min-width: 0;
}

/* Media — proposal image */
.proposal-media img {
  width: 100%;
  display: block;
}

.proposal-extra-images {
  display: flex;
  gap: 0.5vw;
  margin-top: 0.8vw;
}

.proposal-extra-images img {
  flex: 1;
  min-width: 0;
  aspect-ratio: 3/2;
  object-fit: cover;
  border: 1px solid rgba(127,205,255,0.2);
}

/* Portrait below images */
.proposal-portrait-wrap {
  display: flex;
  align-items: center;
  gap: 0.8vw;
  margin-top: 1.5vw;
}

.proposal-portrait-name {
  font-size: var(--text-card);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.063vw;
}

.detail-portrait {
  width: 5vw;
  height: 5vw;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--fg);
  flex-shrink: 0;
}

/* Info box — matches .course-info-box on platform */
.proposal-info-box {
  border: 2px solid var(--fg);
  padding: 1.2vw;
  font-size: var(--text-card);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.063vw;
  overflow: hidden;
}

.proposal-info-box p { margin: 0; }

.proposal-info-title {
  font-weight: 700;
  text-transform: uppercase;
  font-size: var(--text-card);
  letter-spacing: -0.063vw;
  line-height: 1.2;
  padding-bottom: 0.6vw;
}

.proposal-info-fields p {
  margin: 0;
  line-height: 1.6;
}

/* Content sections below info box */
.proposal-section {
  margin-top: 1.5vw;
}

.proposal-section-label {
  font-size: var(--text-meta);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05vw;
  opacity: 0.6;
  margin-bottom: 0.5vw;
}

.proposal-section-text {
  font-size: var(--text-card);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.063vw;
  white-space: pre-wrap;
}

.proposal-session {
  font-size: var(--text-card);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.063vw;
  margin-bottom: 0.8vw;
}

/* Evaluation controls below the detail layout */
.proposal-eval-section {
  margin-top: 3vw;
  border-top: 2px solid var(--fg);
  padding-top: 2vw;
}

/* Admin status bar */
.admin-status-bar {
  display: flex;
  gap: 0.5vw;
  align-items: center;
  margin-bottom: 1vw;
  padding: 0.8vw 1vw;
  border: 2px solid var(--fg);
}

.admin-status-bar select {
  background: rgba(0,0,0,0.3);
  border: 2px solid var(--fg);
  color: var(--fg);
  font-size: var(--text-ui);
  padding: 0.3vw 0.6vw;
  font-family: inherit;
}

/* Score summary */
.score-summary {
  display: flex;
  gap: 1vw;
  align-items: center;
  font-size: var(--text-nav);
  font-weight: 700;
}

.score-avg {
  font-size: var(--text-lg);
}

/* ============================================
   LIGHTBOX — Full-size image overlay
   ============================================ */
.lightbox-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1vw;
  cursor: pointer;
}

.lightbox-overlay.active { display: flex; }

.lightbox-full {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: clamp(10px, 1.5vw, 30px);
  right: clamp(10px, 1.5vw, 30px);
  background: none;
  border: none;
  color: #fff;
  font-size: clamp(28px, 3vw, 48px);
  cursor: pointer;
  line-height: 1;
  z-index: 1;
}

.lightbox-download {
  font-size: var(--text-meta);
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.5);
  padding: 0.3vw 1vw;
  cursor: pointer;
  text-decoration: none;
}

.lightbox-download:hover { background: rgba(255,255,255,0.1); }

.lightbox-img, [data-lightbox] { cursor: pointer; }

/* ============================================
   ANALYTICS — Charts & Tallies
   ============================================ */
.analytics-summary {
  margin-bottom: 2vw;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5vw;
}

.analytics-card {
  border: 2px solid var(--fg);
  padding: 1.2vw;
}

.analytics-big-number {
  font-size: var(--text-xxl);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5vw;
}

.analytics-out-of {
  font-size: var(--text-nav);
  opacity: 0.5;
}

.analytics-card-label {
  font-size: var(--text-meta);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05vw;
  opacity: 0.6;
  margin-bottom: 0.8vw;
}

.analytics-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.4vw;
}

.analytics-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5vw;
}

.analytics-bar-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  min-width: 1.5vw;
  text-align: right;
  flex-shrink: 0;
}

.analytics-bar-track {
  flex: 1;
  height: 1.2vw;
  background: rgba(127,205,255,0.1);
  position: relative;
  overflow: hidden;
}

.analytics-bar-fill {
  height: 100%;
  background: var(--fg);
  transition: width 0.5s ease;
  min-width: 0;
}

.analytics-bar-fill-green { background: #4caf50; }
.analytics-bar-fill-yellow { background: #ff9800; }
.analytics-bar-fill-red { background: #ff4444; }

.analytics-bar-count {
  font-size: var(--text-xs);
  font-weight: 700;
  min-width: 2vw;
  flex-shrink: 0;
}

/* ============================================
   THEME PICKER
   ============================================ */
.theme-picker {
  display: flex;
  align-items: center;
  gap: 0.5vw;
}

.theme-picker-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.5;
}

.theme-swatches {
  display: flex;
  gap: 0.3vw;
}

.theme-swatch {
  width: 1.2vw;
  height: 1.2vw;
  border: 1px solid rgba(127,205,255,0.3);
  cursor: pointer;
  padding: 0;
}

.theme-swatch.active {
  border: 2px solid var(--fg);
  transform: scale(1.3);
}

/* ============================================
   DEADLINE BANNER
   ============================================ */
.deadline-banner {
  background: rgba(0,0,0,0.2);
  border: 2px solid var(--fg);
  padding: 0.8vw 1.5vw;
  margin-bottom: 1.5vw;
  font-size: var(--text-nav);
  font-weight: 700;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.deadline-edit {
  display: flex;
  gap: 0.5vw;
  align-items: center;
}

.deadline-edit input {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--fg);
  color: var(--fg);
  font-size: var(--text-ui);
  padding: 0.3vw 0.6vw;
  font-family: inherit;
}

/* ============================================
   SEARCH BAR
   ============================================ */
.search-bar {
  display: flex;
  gap: 0.5vw;
  margin-bottom: 1.5vw;
  align-items: center;
}

.search-bar input {
  flex: 1;
  background: rgba(0,0,0,0.3);
  border: 2px solid transparent;
  color: var(--fg);
  font-size: var(--text-nav);
  padding: 0.5vw 0.8vw;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.search-bar input:focus {
  border-color: var(--fg);
}

.search-bar input::placeholder {
  color: var(--fg);
  opacity: 0.3;
}

.search-count {
  font-size: var(--text-meta);
  opacity: 0.5;
  white-space: nowrap;
}

/* ============================================
   AUDIT TRAIL
   ============================================ */
.audit-trail {
  margin-top: 1vw;
}

.audit-trail-title {
  font-size: var(--text-nav);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.5vw;
  opacity: 0.6;
}

.audit-entry {
  font-size: var(--text-meta);
  padding: 0.3vw 0;
  opacity: 0.6;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.audit-entry:last-child {
  border-bottom: none;
}

/* ============================================
   LOADING
   ============================================ */
.loading-bar {
  width: 8vw;
  height: 0.2vw;
  background: currentColor;
  opacity: 0.3;
  border-radius: 1px;
  animation: loading-slide 1s ease-in-out infinite;
  margin: 4vw 0;
}

@keyframes loading-slide {
  0% { width: 4vw; opacity: .15; }
  50% { width: 12vw; opacity: .4; }
  100% { width: 4vw; opacity: .15; }
}

/* ============================================
   HAMBURGER (mobile)
   ============================================ */
.mobile-icons {
  display: none;
}

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--fg);
  transition: 0.3s;
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(7px, 7px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -7px); }

.mobile-nav-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 1000;
  display: none;
  flex-direction: column;
  padding: var(--page-padding);
}

.mobile-nav-overlay.active { display: flex; }

.mobile-nav-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.mobile-nav-close {
  background: none;
  border: none;
  color: var(--fg);
  font-size: 36px;
  cursor: pointer;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mobile-nav-links a {
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
}

.mobile-nav-buttons {
  margin-top: auto;
  padding-bottom: 20px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  margin-top: 4vw;
  border-top: 2px solid var(--fg);
  padding: 2vw var(--page-padding);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.footer-contact {
  font-size: var(--text-meta);
  line-height: 1.6;
  opacity: 0.6;
}

.footer-logo {
  font-size: var(--text-meta);
  font-weight: 700;
  text-transform: uppercase;
}

/* ============================================
   MOBILE (max 768px)
   ============================================ */
@media (max-width: 768px) {
  :root {
    --page-padding: 16px;
    --text-xxl: 28px;
    --text-xl: 24px;
    --text-lg: 20px;
    --text-body: 18px;
    --text-nav: 16px;
    --text-card: 15px;
    --text-ui: 15px;
    --text-meta: 13px;
    --text-sm: 12px;
    --text-xs: 11px;
  }

  .header-buttons { display: none; }
  .mobile-icons { display: flex; gap: 12px; align-items: center; }

  .content { margin-top: 70px; }

  .form-fields { grid-template-columns: 1fr; }
  .proposal-detail {
    grid-template-columns: 1fr;
  }
  .proposal-detail-left {
    position: static;
  }

  .proposal-card {
    min-width: 65%;
    max-width: 65%;
  }

  .card-grid-wrap .proposal-card {
    flex: 0 0 100%;
  }

  .card-arrow { display: none; }

  .month-chip { font-size: 12px; padding: 6px 12px; }

  .image-upload-slot { width: 80px; height: 56px; }
  .portrait-upload { width: 80px; height: 80px; }

  .theme-swatch { width: 16px; height: 16px; }
  .theme-picker-label { font-size: 10px; }

  .analytics-grid { grid-template-columns: 1fr; }
  .analytics-big-number { font-size: 36px; }
  .analytics-bar-label { font-size: 11px; min-width: 60px; }
  .analytics-bar-track { height: 16px; }
  .analytics-bar-count { font-size: 11px; min-width: 24px; }

  .eval-row { flex-direction: column; gap: 4px; }
  .eval-label { min-width: 0; }
  .eval-star { width: 32px; height: 32px; }

  .detail-portrait { width: 60px; height: 60px; }
  .proposal-extra-images img { min-width: 80px; }
  .proposal-info-box { padding: 12px; font-size: 16px; }

  .footer-inner { flex-direction: column; gap: 16px; }

  .deadline-banner { flex-direction: column; gap: 8px; font-size: 14px; }

  .score-summary { font-size: 16px; }
  .score-avg { font-size: 24px; }
}
