/* Valuehub HQ. Brand tokens from valuehubit.com: Poppins, navy, bright blue, pale blue, yellow accent. */
:root {
  --navy: #002e5b; --navy-2: #032e61; --blue: #00a1e0; --blue-dark: #0085ba; --pale: #eef8ff; --yellow: #ffd61f;
  --bg: #f6f9fc; --surface: #ffffff; --text: #0f2438; --muted: #5b6b7c; --line: #dfe7ef;
  --ok: #1a8f5a; --warn: #c77700; --bad: #c8322d;
  --radius: 12px; --shadow: 0 1px 2px rgba(0,46,91,.06), 0 8px 24px rgba(0,46,91,.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.55; }
h1 { font-size: 1.6rem; font-weight: 600; margin: 0 0 .25rem; color: var(--navy); }
h2 { font-size: 1.1rem; font-weight: 600; margin: 0 0 .35rem; color: var(--navy); }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
a { color: var(--blue-dark); }

.badge-pilot { display: inline-block; background: var(--yellow); color: var(--navy); font-weight: 600; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; padding: .12rem .5rem; border-radius: 999px; margin-right: .4rem; }

/* ── Sign-in and "access not open" ── */
body.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(0,161,224,.35), transparent 60%), linear-gradient(160deg, var(--navy) 0%, #001a36 100%); color: #fff; }
.auth-card { width: 100%; max-width: 420px; text-align: center; padding: 36px 32px 32px; border-radius: 20px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(6px); }
.auth-logo { display: block; margin: 0 auto 8px; height: auto; }
.auth-card h1 { color: #fff; font-size: 1.5rem; }
.auth-sub { color: rgba(255,255,255,.78); margin-bottom: 1.5rem; }
.auth-note { color: rgba(255,255,255,.7); font-size: .85rem; margin: 1.25rem 0 0; }
.auth-error { background: rgba(200,50,45,.25); border: 1px solid rgba(255,120,110,.5); border-radius: 10px; padding: .6rem .8rem; font-size: .9rem; }
.auth-foot { margin-top: 20px; color: rgba(255,255,255,.5); font-size: .8rem; }
.btn-ms { display: inline-flex; align-items: center; justify-content: center; gap: .7rem; width: 100%; padding: .85rem 1rem; border-radius: 10px;
  background: #fff; color: var(--navy); font-weight: 600; text-decoration: none; transition: transform .08s ease, box-shadow .15s ease; }
.btn-ms:hover { box-shadow: 0 6px 20px rgba(0,161,224,.45); transform: translateY(-1px); }
.btn-ms:focus-visible, .btn-ghost:focus-visible, .btn-link:focus-visible, .side-nav a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.ms-mark { display: grid; grid-template-columns: 9px 9px; gap: 2px; }
.ms-mark i { width: 9px; height: 9px; display: block; }
.ms-mark i:nth-child(1) { background: #f25022; } .ms-mark i:nth-child(2) { background: #7fba00; }
.ms-mark i:nth-child(3) { background: #00a4ef; } .ms-mark i:nth-child(4) { background: #ffb900; }
.btn-ghost { display: inline-block; margin-top: 1.25rem; padding: .6rem 1rem; border-radius: 10px; border: 1px solid rgba(255,255,255,.35); color: #fff; text-decoration: none; }

/* ── App shell ── */
body.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #fff; display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: flex-end; gap: .4rem; text-decoration: none; color: #fff; padding: 0 8px 18px; border-bottom: 1px solid rgba(255,255,255,.12); }
.side-brand img { width: 96px; height: auto; }
.side-brand span { font-weight: 700; color: var(--blue); letter-spacing: .06em; padding-bottom: 14px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 16px; flex: 1; }
.side-nav a, .side-nav span { padding: .6rem .8rem; border-radius: 8px; color: rgba(255,255,255,.85); text-decoration: none; font-weight: 500; }
.side-nav a:hover { background: rgba(255,255,255,.08); }
.side-nav a.is-active { background: rgba(0,161,224,.22); color: #fff; box-shadow: inset 3px 0 0 var(--blue); }
.side-nav .is-soon { color: rgba(255,255,255,.35); }
.side-user { border-top: 1px solid rgba(255,255,255,.12); padding: 14px 8px 0; font-size: .85rem; }
.side-user-name { font-weight: 600; }
.side-user-role { color: rgba(255,255,255,.6); margin-bottom: .4rem; overflow: hidden; text-overflow: ellipsis; }
.btn-link { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; cursor: pointer; }
.main { padding: 28px 32px 48px; min-width: 0; }
.banner { background: var(--pale); border: 1px solid #cfe9f8; color: var(--navy); border-radius: var(--radius); padding: .6rem .9rem; margin-bottom: 20px; font-size: .9rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 48px 24px; text-align: center; box-shadow: var(--shadow); }


/* ── Sidebar extras ── */
.side { overflow-y: auto; }
.side-user-name { color: #fff; text-decoration: none; display: block; }
.nav-group { margin: 14px 0 4px; padding: 0 .8rem; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.45); }
.nav-back { font-size: .85rem; color: rgba(255,255,255,.7) !important; }
.nav-project { padding: .5rem .8rem .8rem; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 8px; }
.nav-project strong { display: block; line-height: 1.3; }
.nav-project span { font-size: .78rem; color: rgba(255,255,255,.6); }
.nav-docs { margin-top: auto; font-size: .85rem; color: rgba(255,255,255,.6) !important; }

/* ── Buttons ── */
.btn { font: inherit; font-weight: 500; padding: .5rem .95rem; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--navy); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.btn:hover { border-color: var(--blue); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-sm { padding: .28rem .6rem; font-size: .82rem; border-radius: 7px; }
.btn:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid rgba(0,161,224,.45); outline-offset: 1px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Cards, grids, sections ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card h2 { margin-bottom: .6rem; }
a.card { display: block; color: inherit; text-decoration: none; transition: transform .08s ease, border-color .15s ease; }
a.card:hover { border-color: var(--blue); transform: translateY(-1px); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: inherit; }
.tile b { display: block; font-size: 1.6rem; font-weight: 600; color: var(--navy); line-height: 1.2; }
.tile span { color: var(--muted); font-size: .82rem; }
.section { margin-top: 24px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stack > * + * { margin-top: 10px; }
.small { font-size: .85rem; }

/* ── Tables ── */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: .7rem .9rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .65rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--pale); }
td a { text-decoration: none; font-weight: 500; }
.key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; color: var(--muted); white-space: nowrap; }

/* ── Chips, health, progress, avatar ── */
.chip { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 500; white-space: nowrap; background: #e8eef4; color: #3d4f61; }
.chip-ready { background: #e3f4fd; color: #00699a; } .chip-in_progress { background: #fff3c4; color: #7a5b00; }
.chip-review { background: #ece6ff; color: #4b32a8; } .chip-done { background: #daf3e6; color: #12683f; }
.chip-blocked { background: #fde2e0; color: #9b1c17; } .chip-dropped { background: #eee; color: #777; text-decoration: line-through; }
.chip-P1 { background: #fde2e0; color: #9b1c17; } .chip-P2 { background: #e8eef4; color: #3d4f61; } .chip-P3 { background: #f1f1f1; color: #777; }
.chip-active { background: #daf3e6; color: #12683f; } .chip-pipeline { background: #e3f4fd; color: #00699a; } .chip-on_hold { background: #fff3c4; color: #7a5b00; } .chip-closed { background: #eee; color: #666; }
.chip-planned { background: #e8eef4; color: #3d4f61; }
.chip-role { background: var(--navy); color: #fff; }
.health { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }
.health-amber { background: var(--warn); } .health-red { background: var(--bad); }
progress.progress { appearance: none; -webkit-appearance: none; width: 100%; height: 8px; border: 0; border-radius: 999px; background: #e6edf3; overflow: hidden; display: block; }
progress.progress::-webkit-progress-bar { background: #e6edf3; border-radius: 999px; }
progress.progress::-webkit-progress-value { background: var(--blue); border-radius: 999px; }
progress.progress::-moz-progress-bar { background: var(--blue); border-radius: 999px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; font-size: .68rem; font-weight: 600; }
.avatars .avatar + .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }

/* ── Forms, filters, modal, toast ── */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: .82rem; font-weight: 500; margin-bottom: 4px; color: var(--navy); }
.field small { display: block; color: var(--muted); font-size: .78rem; margin-top: 3px; }
.field-check { display: flex; align-items: center; gap: 8px; } .field-check > span { margin: 0; order: 2; }
input[type=text], input[type=date], input[type=number], input[type=search], input[type=email], select, textarea { font: inherit; width: 100%; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); }
textarea { resize: vertical; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters input, .filters select { width: auto; min-width: 150px; }
.filters input[type=checkbox], .filters input[type=radio] { min-width: 0; }
select.inline { width: auto; padding: .2rem .4rem; font-size: .82rem; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,26,54,.55); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 16px; padding: 24px; width: 100%; max-width: 560px; box-shadow: 0 24px 64px rgba(0,26,54,.35); }
.modal h2 { font-size: 1.2rem; margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.form-error { color: var(--bad); font-size: .88rem; margin: 8px 0 0; }
#toast-root { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--navy); color: #fff; padding: .65rem 1rem; border-radius: 10px; box-shadow: var(--shadow); font-size: .9rem; max-width: 360px; }
.toast-error { background: var(--bad); }
pre, code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .84rem; }
pre { background: #0b2440; color: #e6f3fb; padding: 14px 16px; border-radius: 10px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
:not(pre) > code { background: var(--pale); padding: .08rem .35rem; border-radius: 5px; color: var(--navy); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: .5rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500; }
.tabs a.is-active { color: var(--navy); border-color: var(--blue); }

/* ── Public API docs page ── */
body.docs { background: var(--surface); }
.docs-head { display: flex; align-items: center; gap: 12px; background: var(--navy); color: #fff; padding: 10px 24px; font-weight: 600; }
.docs-head .docs-raw { margin-left: auto; color: var(--blue); font-weight: 500; font-size: .9rem; }
.docs-main { max-width: 860px; margin: 0 auto; padding: 28px 20px 80px; }
.docs-main h1 { margin-top: 2rem; } .docs-main h2 { margin-top: 2rem; font-size: 1.25rem; border-bottom: 1px solid var(--line); padding-bottom: .3rem; }
.docs-main h3 { margin: 1.6rem 0 .3rem; font-size: 1rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--blue-dark); }

@media (max-width: 760px) {
  body.shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 16px; }
  .side-brand { border: 0; padding: 0; } .side-brand img { width: 56px; } .side-brand span { padding-bottom: 8px; }
  .side-nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; margin: 0; width: 100%; order: 3; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .side-nav a { white-space: nowrap; } .side-nav a.is-active { box-shadow: inset 0 -3px 0 var(--blue); }
  .nav-group, .nav-docs, .nav-project { display: none; }
  .side-user { border: 0; padding: 0; text-align: right; } .side-user-role { display: none; }
  .main { padding: 20px 16px 40px; }
}
