/* ══════════════════════════════════════
   PORTAL FORMS — Split-pane, data grid, form detail
   ══════════════════════════════════════ */

/* ── SPLIT-PANE LAYOUT ── */
.portal-split {
  display: flex;
  gap: 0;
  height: calc(100vh - 80px);
  min-height: 400px;
}

/* Left pane — forms list */
.portal-left {
  width: 420px;
  min-width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 2px solid rgba(255, 255, 255, 0.15);
  border-left: 3px solid rgba(255, 180, 0, 0.25);
  overflow: hidden;
}

/* Right pane — form detail */
.portal-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: rgba(10, 10, 12, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-left: none;
  border-radius: 0 12px 12px 0;
}

/* ── GRID HEADER ── */
.grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  flex-shrink: 0;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.grid-title {
  font-family: "Electrolize", "Rajdhani", sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ll-off-white);
  margin: 0;
}

.grid-count {
  font-family: "Share Tech Mono", monospace;
  font-size: 1.1rem;
  color: var(--ll-amber);
  background: rgba(255, 180, 0, 0.1);
  border: 1px solid rgba(255, 180, 0, 0.2);
  border-radius: 6px;
  padding: 2px 10px;
  min-width: 28px;
  text-align: center;
}

/* ── DATA GRID — Table ── */
.grid-table {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Column headers */
.grid-head {
  display: grid;
  grid-template-columns: 1fr 100px 100px;
  gap: 12px;
  padding: 10px 24px;
  border-top: none;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.gh-col {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Scrollable row container */
.grid-body {
  flex: 1;
  overflow-y: auto;
}

/* Individual rows */
.grid-row {
  display: grid;
  grid-template-columns: 1fr 100px 100px;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: background 0.15s;
}

.grid-row:hover {
  background: rgba(255, 180, 0, 0.04);
}

.grid-row--active {
  background: rgba(255, 180, 0, 0.08);
  border-left: 3px solid var(--ll-gold);
  padding-left: 21px;
}

/* Row cells */
.gr-title {
  font-family: "Electrolize", sans-serif;
  font-size: 1.1rem;
  color: var(--ll-off-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gr-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gr-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gr-dot--pending {
  background: var(--ll-amber);
  box-shadow: 0 0 6px rgba(255, 180, 0, 0.4);
}

.gr-dot--submitted {
  background: #4caf50;
  box-shadow: 0 0 6px rgba(76, 175, 80, 0.4);
}

.gr-status-text {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
}

.gr-status--pending .gr-status-text { color: var(--ll-amber); }
.gr-status--submitted .gr-status-text { color: #4caf50; }

.gr-date {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.35);
}
.grid-empty {
  padding: 60px 24px;
  text-align: center;
  color: rgba(255, 255, 255, 0.35);
  font-family: "Share Tech Mono", monospace;
  font-size: 1.1rem;
}

/* ── DETAIL — Placeholder ── */
.detail-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 16px;
  opacity: 0.3;
}

.detail-placeholder-icon {
  font-size: 64px;
  color: rgba(255, 255, 255, 0.2);
}

.detail-placeholder-text {
  font-family: "Share Tech Mono", monospace;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.3);
}

/* ── DETAIL — Form content ── */
.detail-content {
  padding: 32px;
  width: 100%;
  box-sizing: border-box;
}

/* Form header */
.df-header {
  margin-bottom: 28px;
  padding: 24px 28px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
}

.df-title {
  font-family: "Rajdhani", sans-serif;
  font-size: 2rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 6px;
}

.df-subtitle {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.45);
}

/* Form body — 12-column grid */
.df-body {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px 24px;
  align-items: start;
}

/* Column span classes */
.df-col-12 { grid-column: span 12; }
.df-col-6  { grid-column: span 6; }
.df-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 18px 20px;
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  box-shadow:
    0 6px 24px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: background 0.2s, box-shadow 0.2s;
}

.df-field:hover {
  background: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.df-label {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  justify-content: space-between;
}
.df-req { color: var(--ll-amber); }
.df-input {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: "Rajdhani", sans-serif;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.85);
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.df-input:focus {
  border-color: rgba(255, 180, 0, 0.35);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 2px rgba(255, 180, 0, 0.1);
  outline: none;
}

.df-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

.df-input option { background: #1a1a1e; color: var(--ll-off-white); }

/* Section heading — matches admin heading card */
.df-section {
  grid-column: span 12;
  margin-top: 8px;
  padding: 16px 20px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
}

.df-section-title {
  font-family: "Share Tech Mono", monospace;
  font-size: 1.25rem;
  color: var(--ll-gold);
  letter-spacing: 0.03em;
}

/* Notes block — matches admin notes card */
.df-note {
  grid-column: span 12;
  background: rgba(80, 160, 255, 0.05);
  border: 1px dashed rgba(80, 160, 255, 0.2);
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}

/* Checkbox / Radio pill groups */
.df-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.df-pill {
  cursor: pointer;
  user-select: none;
  position: relative;
}

.df-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.df-pill-face {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: rgba(30, 30, 30, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.2s;
}

.df-pill:hover .df-pill-face {
  background: rgba(255, 180, 0, 0.15);
  border-color: var(--ll-gold);
  color: #fff;
  transform: translateY(-1px);
}

.df-pill input:checked + .df-pill-face {
  background: rgba(255, 180, 0, 0.18);
  border-color: var(--ll-gold);
  color: var(--ll-gold);
  box-shadow: 0 0 8px rgba(255, 180, 0, 0.2);
}

/* File upload */
.df-file-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px dashed rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(0, 0, 0, 0.2);
  text-align: center;
  justify-content: center;
}

.df-file-wrap:hover {
  border-color: rgba(255, 180, 0, 0.3);
  background: rgba(255, 180, 0, 0.04);
}

.df-file-label {
  font-size: 1.05rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.4);
}

/* Footer */
.df-footer {
  grid-column: span 12;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.df-status {
  font-family: "Share Tech Mono", monospace;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.4);
}

.df-status--success { color: #4caf50; }
.df-status--error   { color: #ff6b6b; }

.df-submit {
  background: var(--ll-gold);
  color: #000;
  border: none;
  padding: 14px 32px;
  font-family: "Share Tech Mono", monospace;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 12px rgba(255, 180, 0, 0.3);
}

.df-submit:hover {
  background: #ffc42e;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 180, 0, 0.4);
}

/* Date picker icon */
.df-input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
}

/* Mobile back button (visible only on small screens) */
.df-back-btn {
  display: none;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--ll-gold);
  font-family: "Share Tech Mono", monospace;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 16px;
}

/* ── FORMS — Mobile ── */
@media (max-width: 768px) {
  /* Split-pane stacks vertically */
  .portal-split {
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - 120px);
  }

  .portal-left {
    width: 100%;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    max-height: 50vh;
  }

  /* When a form is open, hide the list on mobile */
  .portal-split--detail-open .portal-left {
    display: none;
  }

  .portal-split--detail-open .portal-right {
    min-height: calc(100vh - 140px);
  }

  .detail-content {
    padding: 20px 16px;
  }

  .df-col-6 { grid-column: span 12; }

  .grid-head { grid-template-columns: 1fr 80px; }
  .gh-date { display: none; }
  .grid-row { grid-template-columns: 1fr 80px; }
  .gr-date { display: none; }

  .df-back-btn { display: inline-flex; }
}
