/* Requests page styles (scoped to .reqx-*) and aligned with global.css look */

/* Layout + header */
.reqx-page { background: var(--bg); }
.reqx-head { margin: 0 0 10px 2px; }
.reqx-title {
  margin: 0 0 6px;
  font-size: clamp(18px, 3.2vw, 28px);
  line-height: 1.15;
  font-weight: 700;
  color: #0f172a;
}
/* Base layout: show only the list; thread/details appear after selection */
.reqx-list{
  display:block;
}


.reqx-thread,
.reqx-details{
  display:none;
}

/* Grid: start as a single column (list only) */
.reqx-grid{
  grid-template-columns: 1fr;
  gap:16px;
  align-items:start;
  margin-top: clamp(12px, 2.5vw, 18px);
  padding-bottom: clamp(40px, 6vw, 96px);
}

/* On larger screens, expand to 3 columns only when a thread is selected */
@media (min-width:1061px){
  .reqx-grid.reqx--show-thread{
    grid-template-columns: 280px 1fr 320px;
  }

  .reqx-grid.reqx--show-thread .reqx-thread,
  .reqx-grid.reqx--show-thread .reqx-details{
    display:block;
  }
}

/* Middle + right panes are hidden until a request is selected */
.reqx-thread,
.reqx-details{
  display:none;
}
/* Cards match global “card” look */
.reqx-card{
  background:#fff;
  border:1px solid #e6e9ef;
  border-radius:14px;
  box-shadow:0 1px 2px rgba(0,0,0,.04);
}
.reqx-pad{ padding:14px 16px; }

/* Search in list (reuse global input style) */
.reqx-search { margin-bottom: 0; }
/* Hide legacy status dropdown (we use chips instead) */
.reqx-list select{
  display:none;
}
/* Search bar: icon inside the input */
.reqx-search .input-icon{
  position: relative;
  width: 100%;
}

.reqx-search .input-icon svg{
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #0f172a;
  pointer-events: none;
}

/* give the text room so it doesn't overlap the icon */
.reqx-input{
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px 10px 36px; /* <-- keep the left padding for icon */
}

.reqx-input{
  width:100%;
  box-sizing:border-box;
  padding:10px 12px 10px 36px; /* icon room (we use .input-icon wrapper) */
  border:1px solid #e2e8f0;
  border-radius:8px;
  background:#f8fafc;
  font-family:'Poppins',sans-serif;
  font-size:14px; font-weight:500; color:#0f172a;
  outline:none;
  transition:border-color .2s, box-shadow .2s;
}
.reqx-input:focus{
  border-color:#025fbc;
  box-shadow:0 0 0 3px rgba(2,95,188,.12);
}

/* Filter chips (styled like your chips) */
.reqx-chips{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:0;
}
/* Filters bar: search + chips + sort on one line */
.reqx-filters-bar{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:10px;
  flex-wrap:wrap;
}

/* Search should grow */
.reqx-filters-bar .reqx-search{
  flex:1 1 220px;
}

/* Search icon inside input */
.reqx-filters-bar .reqx-search .input-icon{
  position:relative;
  width:100%;
}

.reqx-filters-bar .reqx-search .input-icon svg{
  position:absolute;
  left:10px;
  top:50%;
  transform:translateY(-50%);
  width:16px;
  height:16px;
  color:#0f172a;
  pointer-events:none;
}

/* Adjust padding so text clears the icon */
.reqx-filters-bar .reqx-search .reqx-input{
  padding:8px 10px 8px 32px;
  font-size:13px;
}

/* Sort on the right */
.reqx-sort{
  flex:0 0 auto;
  margin-left:auto;
}

.reqx-sort select{
  display:inline-block;     /* override the generic hide */
  padding:7px 10px;
  border-radius:999px;
  border:1px solid #e2e8f0;
  background:#fff;
  font-size:13px;
  font-family:'Poppins', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color:#0f172a;
}

/* Mobile: let them wrap nicely */
@media (max-width:640px){
  .reqx-filters-bar{
    align-items:flex-start;
  }
  .reqx-sort{
    margin-left:0;
  }
}

.reqx-chip{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  color:var(--muted);
  cursor:pointer;
  font-weight:600;
}
.reqx-chip.is-active{
  background:#eef2ff;
  color:#4338ca;
  border-color:transparent;
}

/* Rows list */
.reqx-rows{ margin-top:10px; }

/* Each request row: left info + right actions on a single line */
.reqx-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:8px 10px;
  border-top:1px solid #e6e9ef;
  cursor:pointer;
}
.reqx-row:first-child{
  border-top:none;
}

/* Row layout: thumb + text on the left, status + actions on the right */
.reqx-row-left{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  flex:1;
}

.reqx-row-main{
  min-width:0;
}

.reqx-row-right{
  display:flex;
  gap:4px;
  margin-left:8px;
}

/* Small square thumbnail */
.reqx-thumb{
  flex:0 0 46px;
  width:46px;
  height:46px;
  border-radius:12px;
  overflow:hidden;
  background:#e5e7eb;
}
.reqx-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

/* Compact “Open” button on each row */
.reqx-row-open{
  padding:4px 10px;
  border-radius:999px;
  border:1px solid #e5e7eb;
  background:#ffffff;
  font-size:11px;
  font-weight:500;
  cursor:pointer;
}
.reqx-row-open:hover{
  background:#f9fafb;
}

.reqx-badge{
  font-size:11px;
  padding:2px 8px;
  border-radius:999px;
  background:#eef2f7;
  color:#334155;
}
/* Status pill on the right side */
.reqx-status-pill{
  font-size:11px;
  padding:3px 8px;
  border-radius:999px;
  border:1px solid #e2e8f0;
  background:#f8fafc;
  color:#334155;
  text-transform:capitalize;
  white-space:nowrap;
}

/* Tone variants */
.reqx-status-pill.status-new{
  background:#eff6ff;
  border-color:#bfdbfe;
  color:#1d4ed8;
}
.reqx-status-pill.status-offer{
  background:#ecfeff;
  border-color:#a5f3fc;
  color:#0e7490;
}
.reqx-status-pill.status-pay{
  background:#fef9c3;
  border-color:#fde68a;
  color:#854d0e;
}
.reqx-status-pill.status-booked{
  background:#ecfdf5;
  border-color:#bbf7d0;
  color:#166534;
}
.reqx-status-pill.status-completed{
  background:#f1f5f9;
  border-color:#cbd5f5;
  color:#0f172a;
}
.reqx-status-pill.status-cancelled,
.reqx-status-pill.status-closed{
  background:#fef2f2;
  border-color:#fecaca;
  color:#b91c1c;
}

/* Thread */
.reqx-thread-head{
  align-items:center; justify-content:space-between; gap:12px;
  border-bottom:1px solid #e6e9ef; padding-bottom:10px;
}
.reqx-status{
  font-size:12px; text-transform:capitalize;
  background:#ecfeff; color:#0e7490;
  border:1px solid #cffafe;
  padding:4px 8px; border-radius:999px;
}
.reqx-bubbles{ padding-top:12px; }
.reqx-bubble{
  max-width:78%; background:#f1f5f9; border-radius:14px; padding:10px 12px; margin:8px 0;
}
.reqx-bubble.me{ margin-left:auto; background:#e0f2fe; }
.reqx-meta{ font-size:12px; color:#64748b; margin-top:4px; }

/* Timeline */
.reqx-timeline{ margin-top:12px; }
.reqx-tl-row{ display:flex; gap:10px; align-items:flex-start; margin:8px 0; }
.reqx-tl-dot{ width:8px; height:8px; border-radius:50%; background:#94a3b8; margin-top:6px; }
.reqx-tl-text{ font-size:13px; color:#334155; }

/* Composer (disabled for now) */
.reqx-composer{
  border-top:1px solid #e6e9ef; margin-top:12px; padding-top:10px;
  display:flex; gap:8px;
}
.reqx-composer .btn[disabled]{ opacity:.6; pointer-events:none; }

/* Details panel (key-value, app-like) */
.reqx-kv{
  display:grid;
  grid-template-columns:110px 1fr;
  gap:6px 12px;
  margin-top:10px;
  padding:10px 12px;
  border-radius:12px;
  background:#f9fafb;
  border:1px solid #e5e7eb;
}

.reqx-kv dt{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:#9ca3af;
}

.reqx-kv dd{
  margin:0;
  font-size:14px;
  font-weight:500;
  color:#111827;
}

/* Skeleton shimmer */
.reqx-skel{ position:relative; background:#eef2f7; border-radius:10px; overflow:hidden; }
.reqx-skel::after{
  content:""; position:absolute; inset:0;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
  animation:reqx-s 1.1s infinite; transform:translateX(-100%);
}
@keyframes reqx-s{ to { transform:translateX(100%);} }

/* Mobile behaviour (match venues’ responsive expectations) */
@media (max-width:1060px){
  .reqx-list{ display:block; }
  .reqx-thread, .reqx-details{ display:none; }
  .reqx-grid.reqx--show-thread .reqx-list{ display:none; }
  .reqx-grid.reqx--show-thread .reqx-thread{ display:block; }
  .reqx-grid.reqx--show-thread .reqx-details{ display:block; margin-top:12px; }
  .reqx-back{ display:inline-flex; align-items:center; gap:6px; margin-bottom:10px; }
}
@media (min-width:1061px){ .reqx-back{ display:none; } }
@media (min-width:1061px){
  .reqx-grid.reqx--show-thread .reqx-thread,
  .reqx-grid.reqx--show-thread .reqx-details{
    display:block;
  }
}

/* ===== Requests tweaks: fit text + smaller business title ===== */

/* 1) Left list row — clamp titles + meta */
.reqx-row .reqx-title{
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reqx-row .reqx-sub{
  font-size: 12px;
  color: #6b7280;           /* slate-500 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 2) Middle thread header — smaller business name + clamp */
.reqx-thread h3{
  font-size: clamp(15px, 1.8vw, 17px);
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80%;           /* leave room for status chip */
}

/* 3) Message bubble text should wrap nicely, never blow width */
.reqx-bubble{
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;  /* modern, handles long words/URLs */
  word-break: break-word;
}

/* 4) Details pane — wrap long URLs/values */
.reqx-details dd{
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

/* 5) Make the “New” chip compact so it doesn’t push content */
.reqx-status{
  padding: 3px 8px;
  font-size: 12px;
}

/* Requests: keep bubbles visible and timeline tidy */
#reqxBubbles { min-height: 120px; }
.reqx-thread-head { justify-content:space-between; align-items:center; gap:8px; }
.reqx-timeline { margin-top:8px; }
.reqx-tl-row { display:flex; align-items:flex-start; gap:10px; margin:6px 0; }
.reqx-tl-dot { width:8px; height:8px; border-radius:9999px; background:#0f172a; margin-top:6px; }

/* Inline expander row */
tr.rq-inline > td { padding: 0 !important; }
.rq-inline-box {
  margin: 8px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 12px;
  background: #fff;
}
.rq-thread { max-height: 240px; overflow: auto; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px; }
.rq-bubble { display:inline-block; border-radius:14px; padding:6px 10px; font-size:13px; background:#f1f5f9; color:#0f172a; }
.rq-bubble.me { background:#0f172a; color:#fff; }
.rq-when { font-size:11px; opacity:.7; margin-top:3px; }

/* === Combined request view (no left list when a thread is open) === */

/* Main combined card is hidden until a request is selected */
.reqx-main-card{
  display: none;
}

/* When .reqx--show-thread is set, show only the main view */
.reqx-grid.reqx--show-thread{
  grid-template-columns: minmax(0, 1fr);
}

.reqx-grid.reqx--show-thread .reqx-list{
  display: none !important;
}

.reqx-grid.reqx--show-thread .reqx-main-card{
  display: block;
}

/* Make sure chat + details are visible in this state */
.reqx-grid.reqx--show-thread .reqx-thread,
.reqx-grid.reqx--show-thread .reqx-details{
  display: block;
}

/* Back button visible in "request view" on all screen sizes */
.reqx-back{
  display: none;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
}

.reqx-grid.reqx--show-thread .reqx-back{
  display: inline-flex;
}

/* Layout inside the main card */
.reqx-main-body{
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Desktop: chat + details side-by-side */
@media (min-width: 1061px){
  .reqx-main-body{
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.2fr);
    gap: 20px;
    align-items: flex-start;
  }
}

/* Mobile: listing info on top, chat below */
@media (max-width: 1060px){
  .reqx-details{ order: 1; }
  .reqx-thread{ order: 2; }
}
/* Helper “what happens next” hint under thread header */
.reqx-next{
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
}

/* Empty-state bubble tweak */
.reqx-bubble-empty{
  background: #e0f2fe;
  text-align: left;
}
.reqx-bubble-empty strong{
  display: block;
  margin-bottom: 4px;
}
.reqx-empty-sub{
  font-size: 13px;
  color: #64748b;
}

/* Timeline label */
.reqx-timeline-title{
  margin-top: 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #94a3b8;
}

/* Details: inner layout wrapper */
.reqx-details-inner{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Booking summary block */
.reqx-summary{
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  font-size: 13px;
}
.reqx-summary-label{
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #9ca3af;
  margin-bottom: 2px;
}
.reqx-summary-value{
  font-weight: 600;
  color: #111827;
}
/* Summary + hero cluster (top of details card) */
.reqx-hero-cluster{
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 12px;
  align-items: stretch;
}

/* Let the summary fill its side nicely */
.reqx-hero-cluster .reqx-summary{
  height: 100%;
}

/* Make the cover a bit smaller and softer when in the cluster */
.reqx-hero-cluster .reqx-cover{
  margin: 0;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
}

/* Mobile: stack summary above the photo */
@media (max-width: 768px){
  .reqx-hero-cluster{
    grid-template-columns: minmax(0, 1fr);
  }
  .reqx-hero-cluster .reqx-cover{
    aspect-ratio: 16 / 9;
  }
}

/* Partner micro-profile */
.reqx-partner-meta{
  display: flex;
  align-items: center;
  gap: 10px;
}
.reqx-partner-meta-avatar{
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}
.reqx-partner-meta-avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.reqx-partner-meta-main{
  min-width: 0;
}
.reqx-partner-meta-name{
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}
.reqx-partner-meta-tag{
  font-size: 12px;
  color: #64748b;
}

/* Trust & safety strip */
.reqx-trust{
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  font-size: 12px;
  color: #166534;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.reqx-trust-icon{
  font-size: 14px;
  line-height: 1;
  margin-top: 1px;
}
/* Summary + hero cluster (top of details card) */
.reqx-hero-cluster{
  display:grid;
  grid-template-columns:minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap:12px;
  align-items:stretch;
  margin-top:8px;
}

.reqx-hero-cluster .reqx-summary{
  height:100%;
}

.reqx-hero-cluster .reqx-cover{
  margin:0;
  aspect-ratio:4 / 3;
  border-radius:12px;
}

/* Mobile: stack summary above photo */
@media (max-width:768px){
  .reqx-hero-cluster{
    grid-template-columns:minmax(0, 1fr);
  }
  .reqx-hero-cluster .reqx-cover{
    aspect-ratio:16 / 9;
  }
}

/* Bottom actions row (primary + secondary) */
.reqx-actions-row{
  margin-top:12px;
  padding-top:10px;
  border-top:1px solid #e5e7eb;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:space-between;
  align-items:center;
}

.reqx-actions-primary{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

/* Secondary actions inline with primaries */
.reqx-actions-secondary{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.reqx-actions-secondary .btn-link{
  border-radius:999px;
  border:1px solid #e5e7eb;
  padding:6px 12px;
  font-size:12px;
  background:#fff;
  cursor:pointer;
  text-decoration:none;
  color:#111827;
}
.reqx-actions-secondary .btn-link:hover{
  background:#f9fafb;
}

/* Stack actions nicely on small screens */
@media (max-width:640px){
  .reqx-actions-row{
    flex-direction:column;
    align-items:flex-start;
  }
}
/* Bottom actions row in details card */
.reqx-actions-row{
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}

.reqx-actions-primary{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Secondary actions (view photos / support) */
.reqx-actions-secondary{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reqx-actions-secondary .btn-link{
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  padding: 6px 12px;
  font-size: 12px;
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  color: #111827;
}
.reqx-actions-secondary .btn-link:hover{
  background: #f9fafb;
}

/* Stack nicely on smaller screens */
@media (max-width: 640px){
  .reqx-actions-row{
    flex-direction: column;
    align-items: flex-start;
  }
}
/* Request details card (wraps heading + dl.reqx-kv) */
.reqx-request-card{
  margin-top: 10px;
  padding: 12px 12px;
  border-radius: 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reqx-request-card h3,
.reqx-request-card h4{
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Listing preview section (label + hero image) */
.reqx-listing-preview{
  margin-top: 12px;
}

.reqx-listing-label{
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #9ca3af;
  margin-bottom: 4px;
}

.reqx-listing-preview .reqx-cover{
  margin: 0;
}
/* Avatar image inside the listing circle */
.reqx-partner-meta-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  flex-shrink: 0;
}

.reqx-partner-meta-avatar img.reqx-partner-meta-photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
    /* Activity (collapsible timeline in right pane) */
    .reqx-activity{
      margin-top: 8px;
    }

    .reqx-activity-head{
      width: 100%;
      padding: 6px 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      border: none;
      background: none;
      font: 600 13px/1.3 "Poppins", ui-sans-serif, system-ui;
      cursor: pointer;
      color: #0f172a;
    }

    .reqx-activity-title{
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .reqx-activity-title::before{
      content: '●';
      font-size: 10px;
      color: #10b981;
    }

    .reqx-activity-toggle{
      font-size: 12px;
      color: #64748b;
    }

    .reqx-activity-body{
      border-radius: 12px;
      border: 1px solid #e5e7eb;
      background: #f9fafb;
      padding: 10px 12px;
      margin-top: 4px;
      max-height: 220px;
      overflow: auto;
      font-size: 12px;
    }

    /* Requests page subtitle scaling */
.reqx-head .muted{
  font-size:14px;
}

/* Tablet */
@media (max-width: 1024px){
  .reqx-head .muted{
    font-size:13px;
  }
}

/* Mobile */
@media (max-width: 640px){
  .reqx-head .muted{
    font-size:12px;
  }
}
