/* ============================================================
   Q STUDIO — client portal
   Same brand, quieter register. The work is the hero here,
   not the studio.
   ============================================================ */

.portal {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 244px 1fr;
  gap: 0;
  min-height: 100svh;
}

/* ---------- side ---------- */

.side {
  position: sticky;
  top: 0;
  height: 100svh;
  padding: 22px 16px;
  border-inline-end: 1px solid var(--line);
  background: rgba(8, 8, 8, .58);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.side .brand { padding: 6px 8px 0; }

.side__group h5 {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gray-dim);
  margin: 0 0 8px;
  padding-inline-start: 10px;
  font-weight: 500;
}
.side__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--gray);
  transition: background .3s, color .3s;
}
.side__link svg { width: 11px; flex: none; opacity: .5; transition: opacity .3s, transform .5s var(--ease); }
.side__link:hover { background: rgba(255,255,255,.045); color: #fff; }
.side__link:hover svg { opacity: 1; transform: rotate(45deg); }
.side__link.on { background: rgba(139,92,255,.12); color: #fff; }
.side__link.on svg { opacity: 1; color: var(--accent); }
.side__link b {
  margin-inline-start: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--gray-dim);
}

.side__me {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
}
.side__me .quote__av { width: 30px; height: 30px; }
.side__me small { font-family: var(--font-mono); font-size: 9.5px; color: var(--gray-dim); }

/* ---------- main ---------- */

.main { padding: 26px clamp(18px, 3.2vw, 44px) 60px; min-width: 0; }

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}
.bar h1 { font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -.04em; }
.bar p { margin: 6px 0 0; font-size: 13px; color: var(--gray); }
.bar__act { display: flex; gap: 8px; }

.grid { display: grid; gap: 14px; }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-2 { grid-template-columns: 1.55fr 1fr; }

.tile {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: linear-gradient(160deg, rgba(255,255,255,.035), rgba(255,255,255,.006));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 18px;
  min-width: 0;
}
.tile__h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.tile__h h2 { font-size: 14px; letter-spacing: -.02em; }
.tile__h a { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; color: var(--gray-dim); transition: color .3s; }
.tile__h a:hover { color: var(--accent); }

.kpi__l { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gray-dim); }
.kpi__v { font-size: clamp(26px, 2.6vw, 34px); font-weight: 600; letter-spacing: -.045em; line-height: 1; margin-top: 12px; }
.kpi__d { font-size: 11.5px; color: var(--gray-dim); margin-top: 8px; }

/* spark line, drawn on view */
.spark path { stroke: var(--accent); stroke-width: 1.4; fill: none; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(139,92,255,.6)); }
.spark rect { fill: rgba(139,92,255,.08); }

/* ---------- orders ---------- */

.order {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 15px 0;
  border-top: 1px solid var(--line-soft);
  align-items: center;
}
.order:first-of-type { border-top: 0; padding-top: 0; }
.order__no { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; color: var(--gray-dim); }
.order__t { font-size: 14.5px; font-weight: 500; letter-spacing: -.02em; margin: 4px 0 10px; }
.order__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.order__meta span {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .06em;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gray-dim);
}
.order__right { text-align: end; display: grid; gap: 8px; justify-items: end; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill--live { color: var(--accent); border-color: rgba(139,92,255,.4); background: rgba(139,92,255,.1); }
.pill--wait { color: #e0b25a; border-color: rgba(224,178,90,.34); background: rgba(224,178,90,.08); }
.pill--done { color: var(--gray); }

.meter { height: 4px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.meter i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #fff);
  width: 0;
  transition: width 1.4s var(--ease);
}
.meter--done i { background: rgba(255,255,255,.28); }

/* ---------- feed / files ---------- */

.feed { display: grid; gap: 2px; }
.feed__row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--gray);
}
.feed__row:last-child { border-bottom: 0; }
.feed__row b { color: #fff; font-weight: 500; }
.feed__row time { margin-inline-start: auto; font-family: var(--font-mono); font-size: 10px; color: var(--gray-dim); flex: none; }
.feed__dot { width: 5px; height: 5px; border-radius: 50%; flex: none; align-self: center; }
.dot--live { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.dot--wait { background: #e0b25a; }
.dot--done { background: #3a3f47; }

.file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  transition: padding-left .35s var(--ease);
}
.file:last-child { border-bottom: 0; }
.file:hover { padding-left: 6px; }
.file__k {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
  width: 40px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--gray);
  flex: none;
}
.file__n { font-size: 13px; font-weight: 500; letter-spacing: -.01em; }
.file__m { font-family: var(--font-mono); font-size: 10px; color: var(--gray-dim); }
.file__d { margin-inline-start: auto; }

/* ---------- chat ---------- */

.chat { display: grid; gap: 10px; }
.msg { display: flex; gap: 9px; align-items: flex-end; }
.msg p, .msg__col { min-width: 0; }
.msg p {
  margin: 0;
  padding: 10px 13px;
  border-radius: 14px 14px 14px 4px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  font-size: 13px;
  max-width: 78%;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}
.msg--me { flex-direction: row-reverse; }
.msg--me p { border-radius: 14px 14px 4px 14px; background: rgba(139,92,255,.16); border-color: rgba(139,92,255,.3); }
.typing { display: inline-flex; gap: 3px; padding: 12px 13px; }
.typing i { width: 4px; height: 4px; border-radius: 50%; background: var(--gray); animation: blip 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .16s; }
.typing i:nth-child(3) { animation-delay: .32s; }
@keyframes blip { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.composer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px;
  padding-inline-start: 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.03);
}
.composer input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  color: #fff;
  font: inherit;
  font-size: 13px;
  outline: none;
}
.composer input::placeholder { color: var(--gray-dim); }
.composer button {
  width: 30px; height: 30px;
  padding: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #0d0618;
  display: grid; place-items: center;
  flex: none;
  transition: transform .3s var(--ease);
}
.composer button:hover { transform: scale(1.08); }
.composer button svg { width: 13px; height: 13px; }

/* ============================================================
   Staff panel: order editing + client inbox
   ============================================================ */
.staff__form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: end;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.staff__form .fld { gap: 5px; min-width: 118px; }
.staff__form .fld > span { font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--gray-dim); }
.staff__form input,
.staff__form select { padding: 8px 10px; font-size: 12.5px; }
.staff__check { flex-direction: row; align-items: center; gap: 6px; min-width: 0; }
.staff__check input { width: auto; }
.staff__form .btn { padding: 8px 16px; font-size: 12px; }

.staff__clients { display: grid; gap: 2px; align-content: start; }
.staff__client {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  transition: background .25s;
}
.staff__client:hover { background: rgba(255,255,255,.045); }
.staff__client.on { background: rgba(139,92,255,.12); }
.staff__client-b { display: grid; gap: 2px; min-width: 0; flex: 1; }
.staff__client-b b { font-size: 13px; font-weight: 500; }
.staff__client-b small { font-size: 11px; color: var(--gray-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff__unread {
  flex: none;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: grid;
  place-items: center;
}

/* ---------- responsive ---------- */

@media (max-width: 1080px) { .g-4 { grid-template-columns: repeat(2, 1fr); } .g-2 { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .portal { grid-template-columns: 1fr; }
  .side {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    gap: 14px;
  }
  .side__group { display: flex; gap: 4px; }
  .side__group h5, .side__me { display: none; }
  .side__link { white-space: nowrap; }
}
@media (max-width: 560px) { .g-4 { grid-template-columns: 1fr; } .order { grid-template-columns: 1fr; } .order__right { justify-items: start; text-align: start; } }


/* RTL: the sidebar, meters and bubbles mirror; the chat still reads as a chat */
[dir="rtl"] .msg p { border-radius: 14px 14px 4px 14px; }
[dir="rtl"] .msg--me p { border-radius: 14px 14px 14px 4px; }
[dir="rtl"] .file:hover { padding-inline-start: 6px; padding-left: 0; }
[dir="rtl"] .spark { direction: ltr; }

/* ============================================================
   Accounts: register / login / new request
   ============================================================ */
.gate {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 80px 22px;
}
.gate__card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .022);
  backdrop-filter: blur(14px);
}
.gate__card--wide { max-width: 560px; }
.gate__card .brand { margin-bottom: 26px; }
.gate__card h1 { font-size: clamp(26px, 3vw, 34px); letter-spacing: -.04em; margin: 0 0 8px; }
.gate__lede { color: var(--gray); font-size: 14px; margin: 0 0 24px; max-width: 42ch; }

.gate__err {
  margin: 0 0 18px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 92, 92, .34);
  border-radius: 10px;
  background: rgba(255, 92, 92, .08);
  color: #ffb4b4;
  font-size: 13px;
}

.gate__form { display: grid; gap: 16px; }
.fld { display: grid; gap: 7px; }
.fld > span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gray-dim);
}
.fld > span i { font-style: normal; opacity: .55; text-transform: none; letter-spacing: 0; }
.fld input,
.fld select,
.fld textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
  color: #fff;
  font: inherit;
  font-size: 14px;
  transition: border-color .3s, background .3s;
}
.fld textarea { resize: vertical; min-height: 110px; line-height: 1.55; }
.fld input:focus,
.fld select:focus,
.fld textarea:focus {
  outline: none;
  border-color: rgba(139, 92, 255, .6);
  background: rgba(139, 92, 255, .05);
}
.fld small { font-size: 11.5px; color: var(--gray-dim); }
.fld select option { background: #0b0b12; color: #fff; }

/* password field with a show/hide toggle */
.pass-wrap { position: relative; }
.pass-wrap input { padding-inline-end: 44px; }
.pass-toggle {
  position: absolute;
  top: 50%;
  inset-inline-end: 6px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--gray-dim);
  cursor: pointer;
  transition: color .2s, background-color .2s;
}
.pass-toggle:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.pass-toggle svg { width: 18px; height: 18px; display: block; }
.pass-toggle .eye-off { display: none; }
.pass-toggle[data-visible="1"] .eye-on  { display: none; }
.pass-toggle[data-visible="1"] .eye-off { display: block; }

/* live password requirement checklist */
.pass-req {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: grid;
  gap: 5px;
}
.pass-req li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--gray-dim);
  transition: color .25s;
}
.pass-req li::before {
  content: '';
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 92, 92, .5);
  background: rgba(255, 92, 92, .12) center/8px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ff8080' stroke-width='2.2' stroke-linecap='round' d='M4 4l8 8M12 4l-8 8'/%3E%3C/svg%3E");
  transition: border-color .25s, background-color .25s;
}
.pass-req li.ok {
  color: #b7f0c2;
}
.pass-req li.ok::before {
  border-color: #4fd67a;
  background-color: #4fd67a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23050505' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M3 8.5l3 3 7-7'/%3E%3C/svg%3E");
}

.gate__form .btn { justify-content: center; margin-top: 6px; }
.gate__alt { margin: 22px 0 0; font-size: 13px; color: var(--gray-dim); text-align: center; }
.gate__alt a { color: var(--accent-lo); }
.gate__alt a:hover { color: #fff; }

/* ---------- portal chrome added by the real data ---------- */
.side__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side__me {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.side__me b { display: block; font-size: 13px; }
.side__me small { display: block; font-size: 11px; color: var(--gray-dim); }
.side__out { margin: 0; }
.side__out .side__link {
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.flash {
  margin: 0 0 22px;
  padding: 12px 16px;
  border: 1px solid rgba(139, 92, 255, .34);
  border-radius: 10px;
  background: var(--accent-dim);
  font-size: 13.5px;
  color: var(--gray);
}
.flash b { color: #fff; font-family: var(--font-mono); }

/* An empty portal is the first thing a new client sees. It should read as a
   beginning, not as a broken page. */
.empty {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 38px 20px;
  text-align: center;
}
.empty__i { width: 34px; height: 34px; color: var(--gray-dim); opacity: .5; }
.empty p { margin: 0; max-width: 34ch; font-size: 13.5px; color: var(--gray-dim); }

.chat__hint {
  margin: auto;
  padding: 30px 16px;
  max-width: 34ch;
  text-align: center;
  font-size: 13.5px;
  color: var(--gray-dim);
}
.chat__err {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: #ffb4b4;
}

.order--link { display: grid; color: inherit; }
.order--link:hover .order__t { color: var(--accent-lo); }
.order__t a { color: inherit; display: inline-flex; align-items: center; gap: 6px; }
.order__t a svg { opacity: 0; transform: translateX(-4px); transition: opacity .3s, transform .3s; }
[dir="rtl"] .order__t a svg { transform: translateX(4px) scaleX(-1); }
.order__t a:hover svg { opacity: .8; transform: none; }

/* ============================================================
   order.php — details + edit form + live chat extras
   ============================================================ */
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0 0 6px; list-style: none; padding: 0; }
.facts div { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.facts dt { font-size: 11px; color: var(--gray-dim); }
.facts dd { margin: 0; font-size: 12.5px; text-align: end; }
.facts__h { margin: 18px 0 8px; font-size: 12px; font-weight: 600; color: var(--gray-dim); text-transform: uppercase; letter-spacing: .08em; }
.order__brief { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--gray-dim); white-space: pre-line; }

.edit { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; align-items: center; }
.edit select,
.edit input[type="date"],
.edit input[type="text"] {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
  color: #fff;
  font: inherit;
  font-size: 12px;
}
.edit input[type="text"] { min-width: 0; flex: 1 1 120px; }
.edit select option { background: #0b0b12; color: #fff; }
.edit select:focus,
.edit input:focus { outline: none; border-color: rgba(139, 92, 255, .6); }
.edit__paid { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gray-dim); cursor: pointer; }
.edit__paid input { accent-color: var(--accent); }
.edit .btn { padding: 7px 14px; font-size: 12px; }

.chat__typing {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: var(--gray-dim);
  font-style: italic;
}

.gate__note {
  margin: 0 0 18px;
  padding: 11px 14px;
  border: 1px solid rgba(139, 92, 255, .3);
  border-radius: 10px;
  background: var(--accent-dim);
  color: var(--gray);
  font-size: 13px;
}

/* ============================================================
   Chat attachments — the file picker, previews, and the studio's
   separate "deliver a file" form on the order page.
   ============================================================ */
.composer__attach {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gray-dim);
  cursor: pointer;
  transition: background .3s, color .3s;
}
.composer__attach:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.composer__attach svg { width: 15px; height: 15px; }

.composer__file {
  margin: 8px 0 0;
  padding: 0 6px;
  font-size: 11.5px;
  color: var(--gray-dim);
  font-family: var(--font-mono);
}

.composer--deliver { margin-top: 12px; }
.composer--deliver input[type="file"] {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--gray);
}
.composer--deliver .btn { flex: none; width: auto; height: auto; border-radius: 999px; padding: 8px 16px; font-size: 12px; }

.msg__col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.msg__col p { margin: 0; }

.msg__file { max-width: 260px; }
.msg__file img,
.msg__file video {
  display: block;
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.msg__doc {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
  color: inherit;
  transition: border-color .3s, background .3s;
}
.msg__doc:hover { border-color: rgba(139, 92, 255, .4); background: var(--accent-dim); }
.msg__doc span { font-size: 12.5px; word-break: break-word; }
.msg__doc small { font-family: var(--font-mono); font-size: 10px; color: var(--gray-dim); }
