@import "tailwindcss";

@source "../.././*.php";
@source "../../admin/**/*.php";
@source "../../includes/**/*.php";
@source "../../assets/**/*.js";
@source "../../task-comms/**/*.php";

/* ══════════════════════════════════════════════════════════════
   Asana Form Builder — Design System
   Shared tokens with triage-gpt for seamless flow
   ══════════════════════════════════════════════════════════════ */

/* ── Smooth global transitions (mirrors triage-gpt) ────────── */
button, input, select, textarea {
  transition: all 0.2s ease;
}

/* ════════════════════════════════════════════════════════════
   1. FORM TITLE
   ════════════════════════════════════════════════════════════ */

.asana-title-wrap {
  padding: 0 0.25rem;
}

.asana-title-wrap h1,
.asana-title-wrap .js-project-title {
  font-size: 1.4rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin: 0 0 0.75rem !important;
  letter-spacing: -0.02em !important;
  line-height: 1.2 !important;
}

/* ════════════════════════════════════════════════════════════
   2. CARD WRAPPER (mirrors triage-glass-card)
   ════════════════════════════════════════════════════════════ */

.asana-form-wrapper {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  padding: 2.5rem 2.25rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  margin-top: 0;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .asana-form-wrapper {
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Mobile: edge-to-edge, no card */
@media (max-width: 640px) {
  .asana-form-wrapper {
    background: transparent !important;
    box-shadow: none        !important;
    border: none            !important;
    border-radius: 0        !important;
    margin: 0               !important;
    width: 100%             !important;
    max-width: none         !important;
    padding: 1rem           !important;
  }
}

/* ════════════════════════════════════════════════════════════
   3. FORM CONTAINER
   ════════════════════════════════════════════════════════════ */

.asana-form-container {
  max-width: 1024px;
  margin: 0 auto;
}

/* ════════════════════════════════════════════════════════════
   4. FORM INPUTS (mirrors triage-field-input)
   ════════════════════════════════════════════════════════════ */

.asana-dynamic-form input[type="text"],
.asana-dynamic-form input[type="date"],
.asana-dynamic-form input[type="email"],
.asana-dynamic-form input[type="number"],
.asana-dynamic-form select,
.asana-dynamic-form textarea {
  width: 100%;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  color: #0f172a;
  font-size: 0.875rem;
  outline: none;
  box-sizing: border-box;
  display: block;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.asana-dynamic-form input::placeholder,
.asana-dynamic-form textarea::placeholder,
.asana-dynamic-form select::placeholder {
  color: #9ca3af;
}

.asana-dynamic-form input:focus,
.asana-dynamic-form select:focus,
.asana-dynamic-form textarea:focus {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
  outline: none;
}

/* Validation error state */
.asana-dynamic-form input.afb-field-error,
.asana-dynamic-form select.afb-field-error,
.asana-dynamic-form textarea.afb-field-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15);
}

.asana-dynamic-form textarea {
  resize: none;
  line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════
   5. LABELS
   ════════════════════════════════════════════════════════════ */

.asana-dynamic-form label {
  display: block;
}

label[data-field-id] {
  margin-bottom: 0.5rem;
}

.asana-dynamic-form label > span.text-gray-700,
.asana-dynamic-form label > span:first-child {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  display: block;
  margin-bottom: 0.35rem;
}

.asana-dynamic-form .text-sm.text-gray-500 {
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.5;
}

.afb-single-ai-helper {
  margin-top: 0.65rem;
  background: #f8fafc;
  border: 1px solid #dbeafe;
  border-radius: 0.75rem;
  padding: 0.6rem 0.75rem;
}

.afb-single-ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.afb-single-ai-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.asana-dynamic-form .afb-single-ai-preset {
  width: auto;
  min-width: 9.5rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.38rem 0.45rem;
  line-height: 1.15;
  box-shadow: none;
}

.asana-dynamic-form .afb-single-ai-preset:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}

.afb-single-ai-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.55rem;
  text-transform: uppercase;
}

.asana-dynamic-form .afb-single-ai-btn {
  width: auto;
  border: 1px solid #3b82f6;
  background: #ffffff;
  color: #1d4ed8;
  border-radius: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.1;
  padding: 0.42rem 0.7rem;
  box-shadow: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.asana-dynamic-form .afb-single-ai-btn:hover:not(:disabled) {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1e40af;
}

.asana-dynamic-form .afb-single-ai-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.afb-single-ai-note {
  margin-top: 0.45rem;
}

/* ════════════════════════════════════════════════════════════
   6. SUBMIT BUTTON (mirrors triage-start-btn gradient)
   ════════════════════════════════════════════════════════════ */

.asana-dynamic-form button[type="submit"],
.asana-dynamic-form .header-and-submit button {
  width: 100%;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: white;
  border: none;
  border-radius: 0.75rem;
  padding: 0.9rem 1.5rem;
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(37,99,235,0.38);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.asana-dynamic-form button[type="submit"]::after,
.asana-dynamic-form .header-and-submit button::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transition: left 0.55s ease;
}

.asana-dynamic-form button[type="submit"]:hover::after,
.asana-dynamic-form .header-and-submit button:hover::after {
  left: 100%;
}

.asana-dynamic-form button[type="submit"]:hover,
.asana-dynamic-form .header-and-submit button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(37,99,235,0.48);
}

.asana-dynamic-form button[type="submit"]:active,
.asana-dynamic-form .header-and-submit button:active {
  transform: translateY(0);
}

/* Disabled/busy state */
.asana-dynamic-form button[type="submit"].opacity-60 {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 4px 18px rgba(37,99,235,0.2);
}

/* ════════════════════════════════════════════════════════════
   6b. STEP NAV BUTTONS (Back / Next) — green to differentiate
       from the blue-purple Submit button
   ════════════════════════════════════════════════════════════ */

.asana-dynamic-form .afb-step-next {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 0.75rem !important;
  padding: 0.9rem 1.5rem !important;
  font-size: 0.93rem !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 18px rgba(22,163,74,0.35) !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease !important;
}

.asana-dynamic-form .afb-step-next:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 28px rgba(22,163,74,0.45) !important;
}

.asana-dynamic-form .afb-step-next:active {
  transform: translateY(0) !important;
}

.asana-dynamic-form .afb-step-back {
  background: #ffffff !important;
  color: #16a34a !important;
  border: 2px solid #16a34a !important;
  border-radius: 0.75rem !important;
  padding: 0.9rem 1.5rem !important;
  font-size: 0.93rem !important;
  font-weight: 600 !important;
  box-shadow: none !important;
  transition: background 0.18s ease, color 0.18s ease !important;
}

.asana-dynamic-form .afb-step-back:hover {
  background: #f0fdf4 !important;
  box-shadow: 0 2px 10px rgba(22,163,74,0.15) !important;
}

/* ════════════════════════════════════════════════════════════
   7. SELECT (PROJECT PICKER)
   ════════════════════════════════════════════════════════════ */

.asana-dynamic-form .project-picker {
  width: 100%;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  color: #0f172a;
  font-size: 0.875rem;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.asana-dynamic-form .project-picker:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

/* ════════════════════════════════════════════════════════════
   8. TRIAGE SUMMARY CARD
   ════════════════════════════════════════════════════════════ */

.afb-triage-summary {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #2563eb;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.afb-triage-summary h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.5rem;
}

.afb-triage-summary .afb-triage-summary-body {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.6;
}

.afb-triage-summary ul {
  padding-left: 1.25em;
  margin: 0.5rem 0;
}

.afb-triage-summary li {
  margin-bottom: 0.25rem;
}

/* Breathing room between triage summary and upload section */
.afb-triage-summary {
  margin-bottom: 1.5rem;
}

.afb-upload-section {
  margin-top: 1.5rem;
}

/* ════════════════════════════════════════════════════════════
   9. PARAGRAPH BLOCKS
   ════════════════════════════════════════════════════════════ */

.afb-paragraph-block {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.afb-paragraph-block h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.35rem;
}

.afb-paragraph-block p {
  color: #475569;
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0;
}

.afb-notes-textarea {
  min-height: 9rem;
}

/* ════════════════════════════════════════════════════════════
   9b. STEP WIZARD
   ════════════════════════════════════════════════════════════ */

.afb-stepper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .afb-stepper {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

.afb-step-pill {
  border: 1px solid #dbe3ee;
  background: #ffffff;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  text-align: left;
}

.afb-step-pill-index {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
}

.afb-step-pill-title {
  font-size: 0.8rem;
  color: #334155;
  font-weight: 600;
}

.afb-step-pill.is-active {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.afb-step-pill.is-active .afb-step-pill-index {
  background: #2563eb;
  color: #ffffff;
}

.afb-step-pill.is-done .afb-step-pill-index {
  background: #0f766e;
  color: #ffffff;
}

.afb-step-intro {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.8rem;
}

.afb-step-title {
  margin: 0;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 700;
}

.afb-step-desc {
  margin: 0.3rem 0 0;
  color: #475569;
  font-size: 0.82rem;
}

/* ════════════════════════════════════════════════════════════
   10. UPLOAD SECTION
   ════════════════════════════════════════════════════════════ */

.asana-dynamic-form .space-y-2.p-4.border.rounded.bg-gray-50 {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
}

.asana-dynamic-form .file-input {
  width: 100%;
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.35;
}

.asana-dynamic-form .file-input::file-selector-button,
.asana-dynamic-form .file-input::-webkit-file-upload-button {
  margin-right: 0.75rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  border-radius: 0.6rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.asana-dynamic-form .file-input:hover::file-selector-button,
.asana-dynamic-form .file-input:hover::-webkit-file-upload-button {
  background: #f8fafc;
  border-color: #94a3b8;
}

.asana-dynamic-form .file-input:focus-visible::file-selector-button,
.asana-dynamic-form .file-input:focus-visible::-webkit-file-upload-button {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.14);
}

.asana-dynamic-form .add-file-btn {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%) !important;
  color: white !important;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(37,99,235,0.3);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.asana-dynamic-form .add-file-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(37,99,235,0.4);
}

.asana-dynamic-form .remove-file-btn {
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-weight: 500;
  cursor: pointer;
}

.asana-dynamic-form .remove-file-btn:hover {
  color: #ef4444;
  border-color: #fecaca;
  background: #fef2f2;
}

/* ════════════════════════════════════════════════════════════
   11. CHECKBOXES (multi-enum)
   ════════════════════════════════════════════════════════════ */

.asana-dynamic-form input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  border: 1px solid #d1d5db;
  accent-color: #2563eb;
  cursor: pointer;
}

/* ════════════════════════════════════════════════════════════
   12. PROGRESS BAR
   ════════════════════════════════════════════════════════════ */

.afb-progress-container {
  overflow: hidden;
  border-radius: 9999px;
}

.afb-progress-bar {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  width: 0%;
  transition: width 0.25s ease;
}

.afb-progress-bar--indeterminate {
  position: relative;
  width: 100%;
}

.afb-progress-bar--indeterminate::before {
  content: "";
  position: absolute;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  opacity: 0.9;
  border-radius: 9999px;
  animation: afb-indet 1.2s infinite linear;
}

@keyframes afb-indet { 0% { left: -40%; } 100% { left: 100%; } }

/* ════════════════════════════════════════════════════════════
   13. SUCCESS / STATUS
   ════════════════════════════════════════════════════════════ */

.asana-form-container .text-center.space-y-4 {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  padding: 2.5rem 2.25rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  max-width: 860px;
  margin: 0 auto;
}

.asana-form-container .text-center.space-y-4 .text-xl.font-semibold {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

/* Copy / Email action buttons (inside success box) */
#copy-job-number-btn,
#email-copy-inline button[type="submit"] {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

#copy-job-number-btn:hover,
#email-copy-inline button[type="submit"]:hover {
  border-color: #2563eb;
  color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}

/* ════════════════════════════════════════════════════════════
   14. LOADING SPINNER
   ════════════════════════════════════════════════════════════ */

.asana-dynamic-form .animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ════════════════════════════════════════════════════════════
   15. FIELD ENTRANCE ANIMATION (matches triage msgIn)
   ════════════════════════════════════════════════════════════ */

.asana-fields > * {
  animation: afbFieldIn 0.22s cubic-bezier(0.4,0,0.2,1) both;
}

@keyframes afbFieldIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* ════════════════════════════════════════════════════════════
   16. COMPACT SUBMIT VIEW
   ════════════════════════════════════════════════════════════ */

.asana-dynamic-form.afb-submitting-compact > * {
  display: none !important;
}

/* Keep the submit button (shows "Working…") and the status/progress block visible */
.asana-dynamic-form.afb-submitting-compact > .header-and-submit,
.asana-dynamic-form.afb-submitting-compact > .afb-submit-status {
  display: block !important;
  margin-top: 0 !important;
}

/* Hide wizard nav controls (Back/Next) once submit starts */
.asana-dynamic-form.afb-submitting-compact .afb-step-nav {
  display: none !important;
}

/* Status text should be clearly visible */
.asana-dynamic-form.afb-submitting-compact .afb-submit-status {
  font-size: 0.9rem;
  padding: 0.5rem 0;
}

/* ════════════════════════════════════════════════════════════
   17. CLIENT GATEWAY — Portal Design System
   ════════════════════════════════════════════════════════════ */

/* Hero header */
.gateway-hero {
  background: #f8fafc;
  position: relative;
  overflow: hidden;
}
.gateway-hero::before {
  content: none;
  position: absolute;
  top: -60%;
  right: -15%;
  width: 55%;
  height: 220%;
  background: radial-gradient(circle, rgba(0,133,195,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.gateway-hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: #e2e8f0;
}

/* Tab nav scroll container */
.gateway-tabs-nav {
  display: flex;
  gap: 0;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.gateway-tabs-nav::-webkit-scrollbar { display: none; }

/* Tab items */
.gateway-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.6875rem 1.125rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  text-decoration: none !important;
  transition: color 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
  background: transparent;
  box-sizing: border-box;
}
.gateway-tab:hover { color: #334155; }
.gateway-tab.active {
  color: #0f172a;
  border-bottom-color: #38bdf8;
  font-weight: 600;
}

/* Gateway chips */
.gateway-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: #ffffff;
  border: 1px solid #dbe3ee;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
  color: #334155;
  box-sizing: border-box;
}
.gateway-chip-gold {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: rgba(251,191,36,0.18);
  border: 1px solid rgba(251,191,36,0.35);
  border-radius: 9999px;
  padding: 0.25rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #92400e;
  letter-spacing: 0.025em;
}

/* Ghost button (light header) */
.gateway-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: #ffffff;
  border: 1px solid #dbe3ee;
  color: #334155;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.375rem 0.875rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}
.gateway-btn-ghost:hover { background: #f1f5f9; }

/* Content cards */
.gateway-card {
  background: #ffffff;
  border-radius: 1rem;
  border: 1px solid #f1f5f9;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-sizing: border-box;
}

/* Section label */
.gateway-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin: 0 0 0.25rem;
  display: block;
}

/* Meta item rows */
.gateway-meta-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid #f8fafc;
  box-sizing: border-box;
}
.gateway-meta-item:last-child { border-bottom: none; }
.gateway-meta-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  flex-shrink: 0;
  margin-top: 2px;
}
.gateway-meta-key {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.2;
  margin: 0 0 0.2rem;
}
.gateway-meta-val {
  font-size: 0.875rem;
  color: #1e293b;
  font-weight: 500;
  line-height: 1.4;
  margin: 0;
}

/* Additional Details (large field sets) */
.gateway-details-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
}
.gateway-details-count {
  margin: 0;
  font-size: 0.75rem;
  color: #94a3b8;
}
.gateway-details-filter {
  width: min(100%, 15rem);
  background: #ffffff;
  border: 1px solid #dbe3ee;
  border-radius: 0.625rem;
  padding: 0.45rem 0.625rem;
  font-size: 0.8125rem;
  color: #0f172a;
}
.gateway-details-filter:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.gateway-details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.625rem;
  margin: 0;
}
.gateway-details-list {
  margin: 0;
}
.gateway-details-row {
  padding: 0.65rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.gateway-details-row:last-child {
  border-bottom: none;
}
.gateway-details-sections {
  max-height: min(68vh, 62rem);
  overflow: auto;
  padding-right: 0.25rem;
}
.gateway-asana-btn--header {
  width: auto;
  padding: 0.375rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
}
.gateway-detail-section {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  margin-bottom: 0.625rem;
  background: #ffffff;
  overflow: hidden;
}
.gateway-detail-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
  cursor: pointer;
  text-align: left;
}
.gateway-detail-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.gateway-detail-section-count {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}
.gateway-detail-chevron {
  width: 0.9rem;
  height: 0.9rem;
  color: #94a3b8;
  transition: transform 0.2s ease;
}
.gateway-detail-section.is-collapsed .gateway-detail-chevron {
  transform: rotate(-90deg);
}
.gateway-detail-section-body {
  overflow: hidden;
  transition: max-height 0.22s ease;
  padding: 0.625rem;
}
.gateway-detail-item {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 0.75rem;
  padding: 0.625rem 0.75rem;
}
.gateway-detail-key {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.25rem;
}
.gateway-detail-val {
  font-size: 0.875rem;
  color: #1e293b;
  line-height: 1.4;
  margin: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Comment layout */
.gateway-comment {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem 0;
}
.gateway-comment-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  margin-top: 2px;
}
.gateway-comment-bubble {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 0 0.75rem 0.75rem 0.75rem;
  padding: 0.75rem 1rem;
  flex: 1;
  min-width: 0;
}
.gateway-comment-bubble.is-guest {
  background: #f0f9ff;
  border-color: #e0f2fe;
  border-radius: 0.75rem 0 0.75rem 0.75rem;
}

/* File cards */
.gateway-file-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  border: 1px solid #f1f5f9;
  border-radius: 0.75rem;
  background: #ffffff;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  box-sizing: border-box;
  text-decoration: none !important;
}
.gateway-file-card:hover {
  border-color: #e2e8f0;
  box-shadow: 0 4px 14px rgba(0,0,0,0.07);
}
.gateway-file-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

/* Drop zone */
.gateway-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 0.875rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  box-sizing: border-box;
}
.gateway-dropzone:hover {
  border-color: #818cf8;
  background: #f5f3ff;
}

/* Primary gradient button */
.gateway-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.6875rem 1.5rem;
  border-radius: 0.625rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79,70,229,0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none !important;
  box-sizing: border-box;
  width: 100%;
}
.gateway-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(79,70,229,0.45);
  color: #ffffff;
}
.gateway-btn-primary:active { transform: translateY(0); }

/* Asana orange button */
.gateway-asana-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #f97316;
  color: #ffffff !important;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5625rem 1.125rem;
  border-radius: 0.625rem;
  text-decoration: none !important;
  transition: background 0.15s ease, transform 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}
.gateway-asana-btn:hover {
  background: #ea580c;
  transform: translateY(-1px);
}

/* Progress bar */
.gateway-progress-bar {
  height: 5px;
  border-radius: 9999px;
  background: #f1f5f9;
  overflow: hidden;
}
.gateway-progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}

/* Subtask section heading */
.gateway-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0 0.375rem;
}
.gateway-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  margin: 0;
}

/* Subtask row */
.gateway-subtask-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6875rem 0;
  border-bottom: 1px solid #f8fafc;
}
.gateway-subtask-row:last-child { border-bottom: none; }

/* Collaborator chip */
.gateway-collab-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 9999px;
  padding: 0.3125rem 0.75rem 0.3125rem 0.3125rem;
  font-size: 0.8125rem;
  color: #475569;
  transition: border-color 0.15s ease;
}
.gateway-collab-chip:hover { border-color: #e2e8f0; }
.gateway-collab-avatar {
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

@media (min-width: 900px) {
  .gateway-details-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .gateway-details-head {
    flex-direction: column;
    align-items: stretch;
  }
  .gateway-details-filter {
    width: 100%;
  }
}

/* Page background */
#afb-root {
  background: #f8fafc;
  min-height: 100vh;
}
