/* Vybld Labs portal — brand palette only (teal, orange, peach, powder, white, ink, text). */
:root {
  --teal: #004340;
  --orange: #ff5f2e;
  --peach: #feb370;
  --powder: #afd9e4;
  --white: #ffffff;
  --ink: #062f2c;
  --text: #3e5a57;
  --line: rgb(0 67 64 / 0.14);
  --line-strong: rgb(0 67 64 / 0.28);
  --powder-soft: rgb(175 217 228 / 0.35);
  --peach-soft: rgb(254 179 112 / 0.28);
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 0 rgb(6 47 44 / 0.04), 0 12px 32px -18px rgb(6 47 44 / 0.35);
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-ar: 'Readex Pro', 'Poppins', Tahoma, sans-serif;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: linear-gradient(180deg, var(--powder) 0, var(--white) 520px) no-repeat, var(--white);
}

:lang(ar) body,
html[lang='ar'] body {
  font-family: var(--font-ar);
}

h1,
h2,
h3 {
  color: var(--ink);
  line-height: 1.25;
  margin: 0 0 0.6em;
  font-weight: 600;
}
h1 {
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem);
  letter-spacing: -0.01em;
}
h2 {
  font-size: 1.15rem;
}
h3 {
  font-size: 1rem;
}
p {
  margin: 0 0 0.8em;
}
a {
  color: var(--teal);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--ink);
}
:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  background: var(--white);
  padding: 8px 14px;
  border-radius: 10px;
  z-index: 10;
}
.skip:focus {
  top: 10px;
}

/* ---------- top bar ---------- */
.topbar {
  background: var(--teal);
  color: var(--white);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  text-decoration: none;
}
.brand:hover {
  color: var(--white);
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-text strong {
  font-family: var(--font);
  font-weight: 600;
  font-size: 1rem;
}
.brand-text small {
  color: var(--peach);
  font-size: 0.78rem;
}
.mainnav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.mainnav a {
  color: var(--white);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 500;
}
.mainnav a:hover {
  background: rgb(255 255 255 / 0.1);
  color: var(--white);
}
.mainnav a[aria-current='page'] {
  background: var(--white);
  color: var(--teal);
}
.topbar-tools {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.topbar-tools form {
  margin: 0;
}
.who {
  font-size: 0.8rem;
  color: var(--powder);
}
.lang-switch {
  color: var(--ink);
  background: var(--peach);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
}
.lang-switch:hover {
  background: var(--white);
  color: var(--ink);
}
.lang-switch:lang(ar) {
  font-family: var(--font-ar);
}
.lang-switch:lang(en) {
  font-family: var(--font);
}
.topbar .btn-ghost {
  color: var(--white);
  border-color: rgb(255 255 255 / 0.4);
}
.topbar .btn-ghost:hover {
  background: var(--white);
  color: var(--teal);
}

/* ---------- layout ---------- */
.main {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 20px 56px;
}
.foot {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  border-top: 1px solid var(--line);
}
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.row-2,
.row-3 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 860px) {
  .grid-2,
  .row-2,
  .row-3 {
    grid-template-columns: 1fr;
  }
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}
.inline {
  display: inline-flex;
  align-items: flex-end;
  gap: 8px;
  margin: 0;
  flex-wrap: wrap;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head h1 {
  margin-bottom: 4px;
}
.head-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.narrow {
  max-width: 640px;
}
.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- surfaces ---------- */
.panel,
.card,
.hero,
.goal,
.auth-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel {
  padding: 22px;
  margin-bottom: 24px;
}
.hero {
  padding: 28px;
  margin-bottom: 28px;
}
.eyebrow {
  color: var(--teal);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
:lang(ar) .eyebrow {
  letter-spacing: 0;
  text-transform: none;
}
.lead {
  font-size: 1.05rem;
  color: var(--text);
}
.muted {
  color: var(--text);
  opacity: 0.85;
}
.small {
  font-size: 0.82rem;
  color: var(--text);
}
.block {
  display: block;
}
.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 2px 0;
}
.back {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-weight: 500;
  text-decoration: none;
}
.back::before {
  content: '←';
}
[dir='rtl'] .back::before {
  content: '→';
}
.empty {
  padding: 18px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--powder-soft);
  color: var(--text);
}

/* ---------- auth ---------- */
.auth-card {
  max-width: 460px;
  margin: 6vh auto;
  padding: 36px 32px;
  text-align: center;
}
.auth-card .stack {
  text-align: start;
  margin-top: 18px;
}
.auth-mark {
  display: block;
  margin: 0 auto 14px;
}
.auth-card .btn-ghost {
  margin-top: 10px;
}

/* ---------- controls ---------- */
.btn,
.btn-ghost {
  font: inherit;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 20px;
  border: 1.5px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn {
  background: var(--orange);
  color: var(--ink);
}
.btn:hover {
  background: var(--peach);
  color: var(--ink);
}
.btn-ghost {
  background: transparent;
  color: var(--teal);
  border-color: var(--line-strong);
  min-height: 38px;
  padding: 7px 16px;
}
.btn-ghost:hover {
  background: var(--teal);
  color: var(--white);
  border-color: var(--teal);
}
.link-danger {
  font: inherit;
  font-size: 0.8rem;
  background: none;
  border: 0;
  padding: 2px 0;
  color: var(--text);
  text-decoration: underline;
  cursor: pointer;
}
.link-danger:hover {
  color: var(--ink);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 500;
  color: var(--ink);
  font-size: 0.88rem;
}
.field-compact {
  min-width: 140px;
}
.field-grow {
  flex: 1 1 260px;
}
input,
select,
textarea {
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: 42px;
  width: 100%;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  outline: 3px solid var(--powder);
  outline-offset: 0;
}
input:disabled {
  background: var(--powder-soft);
}
input[type='checkbox'] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--teal);
}
input[type='file'] {
  padding: 8px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--ink);
}
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--ink);
}
.flash-ok {
  background: var(--powder);
}
.flash-error {
  background: var(--peach);
}

/* ---------- badges + chips ---------- */
.badge,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 11px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--powder-soft);
  border: 1px solid var(--line);
}
.chip {
  font-weight: 500;
  margin: 2px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 14px 0 0;
}
.badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
}
.badge-stage-idea::before,
.badge-mst-todo::before,
.badge-pst-planning::before,
.badge-svcst-open::before {
  background: var(--powder);
  box-shadow: inset 0 0 0 1.5px var(--teal);
}
.badge-stage-first_call::before,
.badge-stage-proposal::before,
.badge-pst-review::before {
  background: var(--peach);
}
.badge-stage-active,
.badge-pst-in_progress,
.badge-mst-doing,
.badge-svcst-in_progress {
  background: var(--peach-soft);
}
.badge-stage-active::before,
.badge-pst-in_progress::before,
.badge-mst-doing::before,
.badge-svcst-in_progress::before {
  background: var(--orange);
}
.badge-stage-delivered,
.badge-pst-delivered,
.badge-mst-done,
.badge-svcst-done {
  background: var(--teal);
  color: var(--white);
}
.badge-stage-delivered::before,
.badge-pst-delivered::before,
.badge-mst-done::before,
.badge-svcst-done::before {
  background: var(--peach);
}
.badge-stage-tool_user {
  background: var(--powder);
}
.badge-pst-paused::before,
.badge-svcst-cancelled::before {
  background: var(--text);
}

/* ---------- progress ---------- */
.progress {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: var(--powder-soft);
  overflow: hidden;
  margin: 10px 0 4px;
}
.progress::-webkit-progress-bar {
  background: var(--powder-soft);
  border-radius: 999px;
}
.progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--orange), var(--peach));
  border-radius: 999px;
}
.progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--orange), var(--peach));
  border-radius: 999px;
}
[dir='rtl'] .progress::-webkit-progress-value {
  background: linear-gradient(270deg, var(--orange), var(--peach));
}

/* ---------- portal: journey ---------- */
.hero h1 {
  margin-bottom: 18px;
}
.journey {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  counter-reset: j;
}
.journey li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
}
.journey li::before {
  content: '';
  position: absolute;
  top: 15px;
  inset-inline-start: calc(-50% + 18px);
  inline-size: calc(100% - 36px);
  height: 2px;
  background: var(--line-strong);
}
.journey li:first-child::before {
  display: none;
}
.journey li.done::before,
.journey li.current::before {
  background: var(--orange);
}
.journey .dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-family: var(--font);
  background: var(--white);
  border: 2px solid var(--line-strong);
  color: var(--text);
  position: relative;
}
.journey li.done .dot {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white);
}
.journey li.current .dot {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--ink);
  box-shadow: 0 0 0 5px var(--peach-soft);
}
.journey li.current {
  color: var(--ink);
  font-weight: 600;
}
@media (max-width: 560px) {
  .journey span:not(.dot) {
    font-size: 0.7rem;
  }
}

/* ---------- cards + lists ---------- */
.cards {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: grid;
  gap: 14px;
}
.card {
  padding: 18px 20px;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.card-head h3 {
  margin: 0;
  font-size: 1.05rem;
}
.card h3 a {
  color: var(--ink);
  text-decoration: none;
}
.card h3 a:hover {
  text-decoration: underline;
}
.list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.list > li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.list > li.row-between {
  flex-direction: row;
}
.list > li:last-child {
  border-bottom: 0;
}
.list a {
  font-weight: 600;
}
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 18px;
  margin: 0;
}
.facts dt {
  font-weight: 600;
  color: var(--ink);
}
.facts dd {
  margin: 0;
}

/* ---------- milestones ---------- */
.milestones {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}
.ms {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  position: relative;
}
.ms:not(:last-child)::after {
  content: '';
  position: absolute;
  inset-inline-start: 8px;
  top: 30px;
  bottom: -8px;
  width: 2px;
  background: var(--line);
}
.ms-dot {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 4px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: var(--white);
}
.ms-doing .ms-dot {
  border-color: var(--orange);
  background: var(--peach);
}
.ms-done .ms-dot {
  border-color: var(--teal);
  background: var(--teal);
}
.ms strong {
  display: block;
  color: var(--ink);
}
.ms-done strong {
  color: var(--text);
}
.ms-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ---------- timeline ---------- */
.timeline {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  border-inline-start: 2px solid var(--powder);
}
.timeline li {
  position: relative;
  padding: 0 0 18px;
  padding-inline-start: 18px;
}
.timeline li::before {
  content: '';
  position: absolute;
  inset-inline-start: -7px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--orange);
  border: 2px solid var(--white);
}
.timeline time {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--teal);
  margin-inline-end: 8px;
}
.timeline p {
  margin: 4px 0 0;
  white-space: pre-line;
  color: var(--ink);
}
.tl-project {
  display: block;
  color: var(--ink);
  font-size: 0.9rem;
}

/* ---------- files ---------- */
.files {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  gap: 8px;
}
.files li {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--powder-soft);
}
.files a {
  font-weight: 600;
  word-break: break-all;
}
.files a::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 12px;
  margin-inline-end: 8px;
  border-radius: 2px;
  background: var(--teal);
  vertical-align: -1px;
}
.upload {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

/* ---------- admin: overview ---------- */
.goal {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px 24px;
  padding: 28px;
  margin-bottom: 28px;
  background: var(--teal);
  border: 0;
  color: var(--white);
}
.goal .eyebrow {
  color: var(--peach);
}
.goal .muted {
  color: var(--powder);
  opacity: 1;
  margin: 0;
}
.goal-number {
  margin: 0;
  font-family: var(--font);
}
.goal-number strong {
  font-size: clamp(2.4rem, 1.8rem + 2.5vw, 3.6rem);
  font-weight: 600;
  color: var(--white);
  line-height: 1;
}
.goal-number span {
  font-size: 1.2rem;
  color: var(--powder);
}
.goal-stats {
  display: flex;
  gap: 14px;
  align-self: center;
}
.goal-stats div {
  background: rgb(255 255 255 / 0.08);
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  min-width: 130px;
  display: flex;
  flex-direction: column;
}
.goal-stats strong {
  font-size: 1.6rem;
  color: var(--white);
  font-family: var(--font);
  line-height: 1.2;
}
.goal-stats span {
  font-size: 0.8rem;
  color: var(--powder);
}
.goal .progress {
  grid-column: 1 / -1;
  background: rgb(255 255 255 / 0.15);
  margin: 0;
}
.goal .progress::-webkit-progress-bar {
  background: rgb(255 255 255 / 0.15);
}
@media (max-width: 700px) {
  .goal {
    grid-template-columns: 1fr;
  }
  .goal-stats div {
    min-width: 0;
    flex: 1;
  }
}
.pipeline {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 960px) {
  .pipeline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .pipeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.pipeline a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  height: 100%;
}
.pipeline a:hover {
  border-color: var(--teal);
}
.pipe-label {
  font-size: 0.82rem;
  font-weight: 500;
}
.pipeline strong {
  font-size: 1.9rem;
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.1;
}
.pipeline meter {
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: var(--powder-soft);
}
.pipeline meter::-webkit-meter-bar {
  background: var(--powder-soft);
  border: 0;
  border-radius: 999px;
  height: 6px;
}
.pipeline meter::-webkit-meter-optimum-value {
  background: var(--teal);
  border-radius: 999px;
}
.pipeline meter::-moz-meter-bar {
  background: var(--teal);
}

/* ---------- admin: list ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 16px;
  margin-bottom: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.table-wrap {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
.table th,
.table td {
  text-align: start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.table th {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--teal);
  background: var(--powder-soft);
}
.table tr:last-child td {
  border-bottom: 0;
}
.table td a {
  font-weight: 600;
  color: var(--ink);
}

/* ---------- admin: founder ---------- */
.stage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 16px;
  margin-bottom: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.adder {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.adder summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--teal);
  margin-bottom: 12px;
  list-style: none;
}
.adder summary::-webkit-details-marker {
  display: none;
}
.adder summary::before {
  content: '+';
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-inline-end: 8px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--ink);
}
.idea {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-inline-start: 4px solid var(--peach);
  background: var(--peach-soft);
  border-radius: var(--radius-sm);
  color: var(--ink);
  white-space: pre-line;
}
.idea strong,
.idea span {
  display: block;
}
.notes .timeline li::before {
  background: var(--teal);
}
pre {
  white-space: pre-wrap;
  font-family: inherit;
}

/* Row-level status controls: keep the label for screen readers only. */
.inline .field-compact > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.inline .field-compact {
  min-width: 130px;
}
.inline select {
  min-height: 36px;
  padding: 6px 10px;
}

@media (max-width: 640px) {
  .topbar-inner {
    gap: 10px 14px;
    padding: 10px 16px;
  }
  .mainnav {
    order: 3;
    width: 100%;
  }
  .mainnav a {
    padding: 5px 12px;
    font-size: 0.9rem;
  }
  .who {
    display: none;
  }
  .topbar .btn-ghost {
    min-height: 32px;
    padding: 4px 12px;
    font-size: 0.85rem;
  }
  .main {
    padding: 20px 16px 40px;
  }
  .hero,
  .panel,
  .goal {
    padding: 18px;
  }
}
