/* Raeve Marketing — client portal styles. Matches the main site brand. */
:root {
  --cream: #faf7f2;
  --cream-2: #f0ece3;
  --ink: #111111;
  --ink-soft: #2A2926;
  --muted: #6b6356;
  --line: #e2ddd6;
  --line-strong: #c9c3b7;
  --peach-1: #f4a261;
  --peach-2: #e76f51;
  --white: #ffffff;
  --good: #2a9d8f;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
/* never let a long word / url / filename push the layout sideways */
.req-details, .review-note, .bubble-body, .t-title, .t-sub,
.review-link, .att-file, .group-title { overflow-wrap: anywhere; word-break: break-word; }
h1, h2, h3, h4 { font-family: "Onest", sans-serif; letter-spacing: -0.02em; }
a { color: inherit; text-decoration: none; }

.accent {
  font-family: "Onest", sans-serif;
  font-style: italic;
  font-weight: 700;
  background: linear-gradient(95deg, var(--peach-1), var(--peach-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mono {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- top bar ---------- */
.portal-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--cream);
}
.logo { display: flex; align-items: baseline; gap: 0.45rem; font-family: "Onest", sans-serif; }
.logo-name { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.03em; }
.logo-flip { display: inline-block; transform: scaleX(-1); color: var(--peach-2); }
.logo-sub { font-family: "JetBrains Mono", monospace; font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  border-radius: 999px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--cream);
  cursor: pointer; transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); background: var(--peach-2); border-color: var(--peach-2); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.btn-sm { padding: 0.55rem 1rem; font-size: 0.66rem; }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }

/* ---------- auth (login / reset) ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1.25rem; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--white);
  border: 1px solid var(--line); border-radius: 20px; padding: 2.4rem 2.2rem;
  box-shadow: 0 24px 60px -40px rgba(17,17,17,0.45);
}
.auth-card .logo { justify-content: center; margin-bottom: 1.6rem; }
.auth-card h1 { font-size: 1.7rem; font-weight: 800; margin-bottom: 0.4rem; }
.auth-card .sub { color: var(--muted); font-size: 0.95rem; margin-bottom: 1.8rem; }

label { display: block; }
.field { margin-bottom: 1.1rem; }
.field-label { font-family: "JetBrains Mono", monospace; font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.4rem; }
input, select, textarea {
  width: 100%; font-family: "DM Sans", sans-serif; font-size: 0.98rem; color: var(--ink);
  background: var(--cream); border: 1px solid var(--line); border-radius: 12px;
  padding: 0.8rem 0.9rem; transition: border-color 0.2s ease, background 0.2s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--peach-2); background: var(--white); }
textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.auth-card .btn { width: 100%; margin-top: 0.4rem; }
.auth-foot { text-align: center; margin-top: 1.3rem; font-size: 0.86rem; color: var(--muted); }
.auth-foot a { color: var(--peach-2); border-bottom: 1px solid transparent; }
.auth-foot a:hover { border-color: var(--peach-2); }

/* ---------- messages ---------- */
.msg { border-radius: 12px; padding: 0.75rem 0.9rem; font-size: 0.88rem; margin-bottom: 1.1rem; display: none; }
.msg.show { display: block; }
.msg.error { background: rgba(231,111,81,0.12); color: #b34a35; border: 1px solid rgba(231,111,81,0.3); }
.msg.success { background: rgba(42,157,143,0.12); color: #1f7167; border: 1px solid rgba(42,157,143,0.3); }

/* ---------- dashboard ---------- */
.dash { max-width: 1000px; margin: 0 auto; padding: 2.4rem 1.5rem 4rem; }
.dash-head { margin-bottom: 2.2rem; }
.dash-head h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; }
.dash-head p { color: var(--muted); margin-top: 0.4rem; }

.grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 1.6rem;
}
.card-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.3rem; }
.card-note { color: var(--muted); font-size: 0.88rem; margin-bottom: 1.3rem; }

/* request list */
.req { border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; margin-bottom: 0.9rem; }
.req:last-child { margin-bottom: 0; }
.req-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.req-title { font-weight: 600; font-size: 1rem; }
.req-meta { color: var(--muted); font-size: 0.8rem; margin-top: 0.35rem; }
.req-details { color: var(--ink-soft); font-size: 0.92rem; margin-top: 0.6rem; white-space: pre-wrap; }
.empty { color: var(--muted); font-size: 0.92rem; text-align: center; padding: 1.5rem 0; }

/* review box (shown on a request when it's ready for review) */
.review-box { margin-top: 0.9rem; padding: 1rem 1.1rem; border: 1px solid rgba(244,162,97,0.45); background: rgba(244,162,97,0.08); border-radius: 12px; }
.review-box .mono { color: #b34a35; margin-bottom: 0.5rem; }
.review-note { font-size: 0.92rem; color: var(--ink-soft); margin-bottom: 0.6rem; white-space: pre-wrap; }
.review-link { display: inline-block; color: var(--peach-2); font-weight: 600; font-size: 0.9rem; margin-bottom: 0.9rem; }
.review-link:hover { text-decoration: underline; }
.review-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* status pills */
.status { font-family: "JetBrains Mono", monospace; font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 0.3rem 0.6rem; border-radius: 999px; white-space: nowrap; }
.status-new { background: rgba(244,162,97,0.18); color: #b34a35; }
.status-in_progress { background: rgba(42,157,143,0.16); color: #1f7167; }
.status-review { background: rgba(38,70,83,0.14); color: #264653; }
.status-done { background: rgba(17,17,17,0.08); color: var(--muted); }

/* billing */
.bill-row { display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.bill-row:last-child { border-bottom: none; }
.bill-label { color: var(--muted); font-size: 0.86rem; }
.bill-value { font-weight: 600; }

.stack > * + * { margin-top: 1.5rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.muted-link { color: var(--peach-2); font-size: 0.84rem; cursor: pointer; }
.muted-link:hover { text-decoration: underline; }

/* ---------- admin dashboard ---------- */
.dash-wide { max-width: 760px; }
.needs-count { font-family: "JetBrains Mono", monospace; font-size: 0.8rem; color: var(--peach-2); }
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filters select { width: auto; padding: 0.5rem 0.7rem; font-size: 0.85rem; }
.client-tag { font-weight: 600; color: var(--ink); }

/* per-request admin controls */
.admin-edit { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px dashed var(--line); }
.ae-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.ae-field { display: block; flex: 1 1 200px; margin-bottom: 0.7rem; }
.ae-field .field-label { margin-bottom: 0.3rem; }
.ae-field select, .ae-field input, .ae-field textarea { font-size: 0.9rem; padding: 0.6rem 0.7rem; }
.admin-edit .btn { margin-top: 0.2rem; }
.save-msg { margin-left: 0.7rem; color: var(--good); }

/* comment thread (both sides) */
.thread { margin-top: 0.9rem; display: flex; flex-direction: column; gap: 0.5rem; }
.bubble { max-width: 85%; padding: 0.55rem 0.8rem; border-radius: 13px; font-size: 0.9rem; }
.bubble-who { font-family: "JetBrains Mono", monospace; font-size: 0.6rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.2rem; }
.bubble-body { color: var(--ink-soft); white-space: pre-wrap; line-height: 1.45; }
.bubble-me { align-self: flex-end; background: var(--ink); }
.bubble-me .bubble-who { color: rgba(250,247,242,0.6); }
.bubble-me .bubble-body { color: var(--cream); }
.bubble-them { align-self: flex-start; background: var(--cream-2); border: 1px solid var(--line); }

/* reply box */
.reply { margin-top: 0.8rem; display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-end; }
.reply textarea { width: 100%; min-height: 60px; font-size: 0.9rem; }

/* admin board: status columns (stacked sections) */
#board { display: flex; flex-direction: column; gap: 1.5rem; }
.col { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 1.4rem; }
.col-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--line); }
.col-title { font-family: "Onest", sans-serif; font-size: 1.1rem; font-weight: 700; }
.col-count { font-family: "JetBrains Mono", monospace; font-size: 0.78rem; color: var(--muted); }
.col-flag { color: var(--peach-2); }
.col-empty { padding: 0.6rem 0; text-align: left; }
.req-flag { border-color: var(--peach-2); box-shadow: 0 0 0 1px var(--peach-2) inset; }
.reply-flag { font-family: "JetBrains Mono", monospace; font-size: 0.58rem; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; background: var(--peach-2); padding: 0.25rem 0.5rem; border-radius: 999px; white-space: nowrap; }

/* status groups (admin board + client dashboard) */
.status-group + .status-group { margin-top: 1.6rem; }
.group-title { font-family: "Onest", sans-serif; font-size: 1rem; font-weight: 700; margin-bottom: 0.8rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.group-count { font-family: "JetBrains Mono", monospace; font-size: 0.7rem; color: var(--muted); background: var(--cream-2); padding: 0.15rem 0.5rem; border-radius: 999px; }
.group-flag { font-family: "JetBrains Mono", monospace; font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; background: var(--peach-2); padding: 0.15rem 0.5rem; border-radius: 999px; }
.group-empty { padding: 0.4rem 0 0.2rem; text-align: left; }

/* ---------- collapsible ticket (admin + client) ---------- */
.ticket { background: var(--white); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 0.7rem; overflow: hidden; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.ticket:last-child { margin-bottom: 0; }
.ticket.open { border-color: var(--line-strong); box-shadow: 0 14px 40px -30px rgba(17,17,17,0.5); }
.ticket-flag { border-color: var(--peach-2); }
.ticket-row {
  width: 100%; display: flex; align-items: center; gap: 0.85rem;
  padding: 0.95rem 1.1rem; background: transparent; border: 0; cursor: pointer; text-align: left;
  font-family: inherit; color: inherit;
}
.ticket-row:hover { background: var(--cream); }
.t-main { flex: 1; min-width: 0; }
.t-title { display: block; font-weight: 600; font-size: 1rem; }
.t-sub { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 0.2rem; }
.t-sub strong { color: var(--ink-soft); font-weight: 600; }
.t-flag { font-family: "JetBrains Mono", monospace; font-size: 0.56rem; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; background: var(--peach-2); padding: 0.18rem 0.45rem; border-radius: 999px; vertical-align: middle; white-space: nowrap; }
.t-chev { color: var(--muted); font-size: 0.9rem; transition: transform 0.2s ease; flex-shrink: 0; }
.ticket.open .t-chev { transform: rotate(180deg); }
.ticket-body { display: none; padding: 0 1.1rem 1.1rem; }
.ticket.open .ticket-body { display: block; }
.ticket-body .req-details { margin-top: 0; }

/* ---------- attachments ---------- */
.attach { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 0.8rem; }
.att-img { display: block; width: 92px; height: 92px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.att-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-file { display: inline-flex; align-items: center; gap: 0.35rem; max-width: 100%; padding: 0.45rem 0.7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--cream); font-size: 0.82rem; color: var(--ink-soft); }
.att-file:hover { border-color: var(--peach-2); color: var(--peach-2); }
.file-hint { font-size: 0.78rem; color: var(--muted); margin-top: 0.45rem; overflow-wrap: anywhere; }
input[type="file"] { padding: 0.6rem; font-size: 0.86rem; background: var(--cream); }
