:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #242039;
  background: #f7f5fd;
  line-height: 1.55;
  --purple: #6d28d9;
  --line: #e6e0f3;
}
* { box-sizing: border-box; }
body { margin: 0; }
.bar { background: #fff; border-bottom: 1px solid var(--line); }
nav, main { width: min(100% - 2rem, 64rem); margin-inline: auto; }
nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; padding-block: .85rem; }
nav form { margin-left: auto; }
.brand { font-size: 1.25rem; font-weight: 800; text-decoration: none; }
main { padding-block: 1.8rem 3rem; }
h1, h2 { line-height: 1.2; }
h1 { margin-top: 0; font-size: clamp(1.65rem, 4vw, 2.5rem); }
h2 { margin-top: 0; font-size: 1.18rem; overflow-wrap: anywhere; }
a { color: var(--purple); }
.card { background: white; border: 1px solid var(--line); border-radius: 1rem; padding: clamp(1rem, 4vw, 1.65rem); margin-bottom: 1rem; }
.narrow { max-width: 28rem; }
.stack, .grid { display: grid; gap: .85rem; align-items: end; }
.grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
label { display: grid; gap: .3rem; font-weight: 600; }
input, select, button { font: inherit; min-height: 2.75rem; border-radius: .55rem; padding: .5rem .75rem; }
input, select { width: 100%; color: inherit; background: #fff; border: 1px solid #aaa2bb; }
button { color: white; background: var(--purple); border: 1px solid var(--purple); cursor: pointer; font-weight: 700; }
.secondary { color: var(--purple); background: #f4edff; border-color: var(--line); }
:focus-visible { outline: 3px solid #6d28d9; outline-offset: 3px; }
.notice { border-left: .25rem solid var(--purple); background: #f4edff; padding: .85rem; }
code { overflow-wrap: anywhere; }
dt, .muted { color: #625976; }
dd { font-weight: 650; margin: 0; }
details { margin-top: 1rem; }
summary { cursor: pointer; color: var(--purple); }

:root {
  font-family: Inter, system-ui, sans-serif;
  color: #0f172a;
  background: #f6f5fc;
  --purple: #7c3aed;
  --line: #e7e2f3;
}
.brand { display: inline-flex; align-items: center; gap: .5rem; color: #0f172a; }
.brand img { border-radius: .45rem; }
.dashboard-page main { width: min(100% - 2rem, 86rem); }
.dashboard-page h1 { font-size: clamp(1.65rem, 4vw, 2rem); }
.workspace { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 1.25rem; }
.workspace-content { min-width: 0; }
.sidebar { border: 1px solid var(--line); align-self: start; background: white; border-radius: 1rem; padding: .6rem; }
.side-nav { width: auto; display: grid; gap: .3rem; padding: 0; }
.side-nav a { padding: .65rem .75rem; border-radius: .6rem; color: #253049; text-decoration: none; font-weight: 600; }
.side-nav a:hover, .side-nav a[aria-current="page"] { background: #ede9fe; color: #5621bc; }
.workspace-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.workspace-heading h2, .workspace-heading p { margin: 0 0 .6rem; }
.dashboard-page .card { box-shadow: 0 4px 14px #2d185009; }
.stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: .75rem; }
.stat { display: grid; gap: .3rem; min-height: 6rem; background: linear-gradient(125deg, white 55%, #f3edff); }
.stat strong { color: #381077; font-size: clamp(1.25rem, 3vw, 2rem); line-height: 1.2; overflow-wrap: anywhere; }
.stat span, small { color: #526078; }
.primary-link { display: inline-block; padding: .65rem 1rem; border-radius: .65rem; background: #6d28d9; color: white; text-decoration: none; font-weight: 700; }
.list-row { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; padding: .7rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.list-row small { display: block; }
.pill { margin-inline-start: auto; background: #ede9fe; color: #4c1d95; border-radius: 2rem; padding: .2rem .6rem; font-size: .85rem; font-weight: 650; }
progress { accent-color: #7c3aed; max-width: 100%; }
.upload-empty { border: 1px dashed #a78bfa; background: #faf7ff; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; }
.check input { width: auto; min-height: 0; margin-top: .35rem; accent-color: #6d28d9; }
.document { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 75ch; }
.prose { line-height: 1.75; }
details form { margin-top: 1rem; }
@media (max-width: 760px) {
  .workspace { grid-template-columns: 1fr; }
  .side-nav { grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); }
  .side-nav a { font-size: .9rem; }
}
@media (max-width: 430px) {
  .stat-grid { grid-template-columns: 1fr; gap: 0; }
  .dashboard-page .stat { min-height: auto; }
}
.admin-nav { width: auto; margin: 0 0 1rem; padding: .35rem; gap: .4rem; }
.admin-nav a { border-radius: .6rem; padding: .4rem .7rem; text-decoration: none; font-weight: 600; }
.admin-nav a[aria-current="page"] { background: #ede9fe; color: #5621bc; }
.form-actions { display: flex; gap: .65rem; flex-wrap: wrap; align-items: center; margin-top: .65rem; }
textarea { width: 100%; resize: vertical; padding: .75rem; border: 1px solid #aaa2bb; border-radius: .55rem; background: white; color: inherit; font: inherit; }
button:disabled { opacity: .5; cursor: default; }
.invoice-fields { grid-column: 1 / -1; min-width: 0; border: 1px solid var(--line); border-radius: .65rem; padding: .8rem; }
.invoice-fields[hidden] { display: none; }
.language-picker { display: flex; align-items: end; flex-wrap: wrap; gap: .35rem; }
.language-picker label { font-size: .85rem; }
.bar .language-picker select, .bar .language-picker button { min-height: 2.25rem; padding: .3rem .5rem; }
.password-input-wrap { position: relative; display: block; }
.password-input-wrap input { width: 100%; padding-inline-end: 3.15rem; }
.password-visibility { position: absolute; inset-block: 0; inset-inline-end: .15rem; width: 2.75rem; min-height: 0; padding: 0; border: 0; background: transparent; color: var(--purple); display: grid; place-items: center; }
.password-visibility:hover { background: #f4edff; }
.password-meter { grid-column: 1 / -1; }
.password-meter p { margin: .2rem 0; }
.password-meter meter { width: min(100%, 20rem); height: 1rem; }
[data-install-help] { max-width: 24rem; margin: 0; }
[data-install-help] p { margin: .35rem 0; }

.password-field { display: grid; gap: .3rem; }
.password-visibility img { display: block; }
[data-install-help] summary { display: inline-flex; border: 1px solid var(--line); padding: .45rem .7rem; border-radius: .55rem; font-weight: 700; }

/* VideoReport client interface v1.1 — scoped to dashboard */
body.dashboard-page { background: #fff; color: #111827; font-family: Inter, "Segoe UI", system-ui, sans-serif; }
.dashboard-page .bar { max-width: 1600px; margin-inline: auto; border-inline: 1px solid #f1edf8; }
.dashboard-page .bar nav { width: min(100% - 2rem, 1500px); max-width: 100%; }
.dashboard-page main { width: min(100% - 2rem, 1600px); min-height: calc(100dvh - 84px); padding: 0 0 2rem; background: #fbfaff; border-inline: 1px solid #f1edf8; }
.dashboard-page main > h1 { display: none; }
.dashboard-page .workspace { grid-template-columns: 202px minmax(0, 1fr); gap: 0; min-height: calc(100dvh - 84px); }
.dashboard-page .sidebar { border: 0; border-right: 1px solid #eeeaf5; border-radius: 0; margin: 0; padding: 1.4rem .75rem; height: 100%; background: #fff; }
.dashboard-page .side-nav { display: flex; flex-direction: column; gap: .3rem; }
.dashboard-page .side-nav a { display: flex; gap: .8rem; align-items: center; min-height: 46px; padding: .75rem .8rem; border-radius: 12px; font-size: .9rem; color: #35405b; }
.dashboard-page .side-nav a i { width: 19px; text-align: center; font-size: 1.02rem; color: #6a6382; }
.dashboard-page .side-nav a:hover, .dashboard-page .side-nav a[aria-current="page"] { background: #eee6ff; color: #5b21b6; }
.dashboard-page .side-nav a:hover i, .dashboard-page .side-nav a[aria-current="page"] i { color: #6d28d9; }
.dashboard-page .workspace-content { min-width: 0; padding: clamp(1rem, 2.2vw, 2rem); }
.dashboard-topline { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.5rem; color: #65547f; font-size: .83rem; }
.dashboard-topline a { color: #4c326d; text-decoration: none; font-weight: 650; }
.dashboard-topline i { margin-right: .3rem; }
.dashboard-page .workspace-heading { margin-bottom: 1rem; }
.dashboard-page .workspace-heading h2 { font-size: clamp(1.45rem, 2.2vw, 2rem); font-weight: 800; letter-spacing: -.035em; margin: 0; }
.dashboard-page .workspace-heading .muted { margin: .4rem 0 0; font-size: .91rem; }
.dashboard-page .eyebrow { color: #7c3aed; font-weight: 750; font-size: .75rem; text-transform: uppercase; letter-spacing: .09em; }
.dashboard-page .card { border: 1px solid #eae6f2; border-radius: 16px; box-shadow: 0 4px 20px rgba(53,25,94,.045); padding: clamp(1rem, 1.8vw, 1.5rem); }
.dashboard-page .stat-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; margin: 1rem 0 1.35rem; align-items: stretch; }
.dashboard-page .stat { display: flex; flex-direction: column; gap: .35rem; min-height: 155px; background: #fff; }
.dashboard-page .stat strong { color: #1d1830; font-size: clamp(1.6rem,2.3vw,2.25rem); letter-spacing: -.04em; }
.dashboard-page .stat span:last-child { font-size: .86rem; color: #5e6478; }
.dashboard-page .stat-icon { width: 40px; height: 40px; border-radius: 12px; background: #f0e8ff; color: #6d28d9; display: grid; place-items: center; margin-bottom: .2rem; }
.dashboard-page .primary-link { display: inline-flex; gap: .55rem; align-items: center; justify-content: center; min-height: 44px; background: linear-gradient(120deg,#9333ea,#5b21b6); border-radius: 11px; box-shadow: 0 4px 12px #6d28d922; }
.dashboard-page .list-row { min-width: 0; gap: .85rem; padding: 1rem 0; }
.dashboard-page .list-row > div { flex: 1; min-width: 180px; }
.dashboard-page .list-row strong { overflow-wrap: anywhere; }
.dashboard-page .list-row small { font-size: .78rem; margin-top: .25rem; }
.dashboard-page .pill { background: #eee7ff; color: #5321a5; white-space: nowrap; }
.dashboard-page .materials-intro { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.2rem; background: #faf7ff; border: 1px dashed #c4b5fd; border-radius: 14px; margin: 1rem 0; }
.dashboard-page .materials-intro strong { display: inline-block; margin-left: .6rem; }
.dashboard-page .materials-intro > div > i { color: #7c3aed; }
.dashboard-page .materials-intro p { margin: .35rem 0 0; }
.dashboard-page .upload-empty { text-align: center; padding: clamp(1.5rem,4vw,4rem); background: #fff; }
.dashboard-page .upload-icon { margin: 0 auto 1rem; width: 66px; height: 66px; border-radius: 18px; display: grid; place-items: center; background: #f0e8ff; color: #6d28d9; font-size: 1.8rem; }
.dashboard-page .secondary-link { display: inline-flex; align-items: center; gap: .5rem; margin-top: .5rem; text-decoration: none; }
.dashboard-page .referral-stats { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .5rem 1rem; }
.dashboard-page input, .dashboard-page select, .dashboard-page textarea { min-width: 0; }
@media (min-width: 1700px) { .dashboard-page main { box-shadow: 0 0 0 1px #f8f7fb; } }
@media (max-width: 1024px) {
 .dashboard-page .workspace { grid-template-columns: 70px minmax(0,1fr); }
 .dashboard-page .sidebar { padding: 1rem .4rem; }
 .dashboard-page .side-nav a { justify-content: center; padding: .8rem .4rem; }
 .dashboard-page .side-nav a span { display: none; }
 .dashboard-page .side-nav a i { font-size: 1.12rem; }
}
@media (max-width: 767px) {
 .dashboard-page .bar nav { width: calc(100% - 1.2rem); gap: .45rem; }
 .dashboard-page .bar .brand { font-size: .95rem; }
 .dashboard-page main { width: 100%; min-height: 100dvh; padding-bottom: calc(6rem + env(safe-area-inset-bottom)); }
 .dashboard-page .workspace { display: block; }
 .dashboard-page .workspace-content { padding: 1rem; }
 .dashboard-page .sidebar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: auto; border: 0; border-top: 1px solid #e8e1f5; padding: .3rem .2rem calc(.35rem + env(safe-area-inset-bottom)); box-shadow: 0 -6px 24px #1b0a3a0a; }
 .dashboard-page .side-nav { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 0; }
 .dashboard-page .side-nav a { display: flex; flex-direction: column; gap: .1rem; min-height: 54px; padding: .35rem .05rem; border-radius: 9px; }
 .dashboard-page .side-nav a span { display: block; font-size: .61rem; text-align: center; line-height: 1.1; overflow-wrap: anywhere; }
 .dashboard-page .side-nav a i { font-size: 1rem; }
 .dashboard-page .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
 .dashboard-page .stat { min-height: 130px; }
 .dashboard-page .dashboard-topline { margin-bottom: 1rem; }
 .dashboard-page .materials-intro { align-items: stretch; flex-direction: column; }
 .dashboard-page .workspace-heading { align-items: flex-start; }
}
@media (max-width: 420px) {
 .dashboard-page .stat-grid { grid-template-columns: 1fr 1fr; }
 .dashboard-page .stat { padding: .9rem; }
 .dashboard-page .stat strong { font-size: 1.6rem; }
 .dashboard-page .side-nav a span { font-size: .55rem; }
}

/* All navigation items remain on one mobile row, including optional admin access. */
@media (max-width: 767px) {
 .dashboard-page .side-nav { grid-template-columns: repeat(7,minmax(0,1fr)); }
 .dashboard-page .side-nav:has(a[href="/admin/"]) { grid-template-columns: repeat(8,minmax(0,1fr)); }
}

[data-office-fields][hidden] { display: none; }

.pwa-update {
  width: min(28rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  padding: clamp(1.25rem, 5vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #fff;
  color: #242039;
  box-shadow: 0 1rem 3rem #25203933;
}
.pwa-update::backdrop { background: #242039aa; }
.pwa-update h2 { margin-top: 0; }
.pwa-update button { width: 100%; }
