/* nav pages: added in the usability pass; merged into style.css afterwards.
   Top menu count badges and participant search, idle sign-out notice, dashboard, studies list,
   error pages. */

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
                   overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ------------------------------------------------------------------ menu count badges */
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
             padding: 0 5px; margin-left: 6px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
             line-height: 1; font-variant-numeric: tabular-nums; background: #e9c46a; color: var(--ink); }
.dd-menu .nav-badge { background: var(--accent); color: #fff; }

/* ------------------------------------------------------------------ participant search */
.nav-search { margin: 0 0 0 auto; display: flex; align-items: center; }
.nav-search + .usermenu { margin-left: 4px; }
.nav-search input[type=search] {
  width: 150px; padding: 6px 10px; border-radius: 999px; font: inherit; font-size: 12.5px;
  border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
  background: color-mix(in srgb, currentColor 10%, transparent); color: inherit;
  transition: width .15s, background .12s; }
.nav-search input[type=search]::placeholder { color: inherit; opacity: .7; }
.nav-search input[type=search]:focus { width: 190px; outline: none; background: #fff; color: var(--text);
                                       border-color: #fff; box-shadow: var(--focus); }
.nav-search input[type=search]:focus::placeholder { color: var(--muted); }
@media (max-width: 1180px) { .nav-search input[type=search] { width: 120px; } }
@media (max-width: 960px) {
  .nav-search { display: none; }
  .topbar.nav-open .nav-search { display: flex; flex-basis: 100%; order: 4; margin: 6px 0 0; }
  .topbar.nav-open .nav-search input[type=search], .topbar.nav-open .nav-search input[type=search]:focus { width: 100%; }
}

/* ------------------------------------------------------------------ idle sign-out notice */
.idle-warning { position: fixed; right: 20px; bottom: 20px; z-index: 100; max-width: 380px;
                background: var(--surface); color: var(--text); border: 1px solid #f2dc9f; border-left: 4px solid #d69e2e;
                border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px 16px; font-size: 13px; }
.idle-warning p { margin: 0 0 10px; }
.idle-left { font-variant-numeric: tabular-nums; color: var(--warning); font-weight: 600; }
@media (max-width: 600px) { .idle-warning { left: 16px; right: 16px; bottom: 16px; max-width: none; } }

/* ------------------------------------------------------------------ dashboard */
.dash-warnings { margin-bottom: 18px; }
.dash-warnings .flash .muted { color: inherit; opacity: .75; }
.dash-sub { margin: 4px 0 8px; }
.dash-more { margin: 8px 0 0; font-size: 12.5px; }
.dash-oversight { margin-top: 4px; }
.num-cell { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.plain th.num-cell { text-align: right; }
.dash-work { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.dash-task { display: flex; align-items: center; gap: 12px; flex: 1 1 240px; max-width: 420px; color: inherit;
             text-decoration: none; padding: 14px 18px; }
a.dash-task:hover { text-decoration: none; border-color: var(--steel); }
.dash-task-num { font-family: var(--serif); font-size: 26px; font-weight: 600; color: var(--ink); min-width: 1.6em; }
.dash-details > summary { cursor: pointer; font-weight: 650; color: var(--ink); }
.dash-details[open] > summary { margin-bottom: 6px; }
.dash-details h3 { margin-top: 16px; }
.dash-empty { color: var(--muted); }

/* ------------------------------------------------------------------ studies list */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.study-card-multi { display: flex; flex-direction: column; padding: 0; }
.study-card-main { display: block; color: inherit; padding: 20px 22px 12px; flex: 1; border-radius: var(--radius) var(--radius) 0 0; }
.study-card-main:hover { text-decoration: none; }
.study-card-main:hover .study-card-id { color: var(--accent); }
.study-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
                   padding: 10px 22px 16px; }
.env-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
a.env-chip { padding: 3px 10px; border: 1px solid transparent; }
a.env-chip:hover { text-decoration: none; border-color: currentColor; }

/* ------------------------------------------------------------------ error pages */
.error-page { max-width: 640px; margin: 32px auto; }
.error-code { color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.error-page .pill-row { margin: 18px 0 0; }

/* ------------------------------------------------------------------ sign-in: the Isthmus logo and the platform's name */
.content.content-signin { max-width: none; padding: 0; }
.signin { display: grid; grid-template-columns: minmax(320px, 5fr) 7fr; min-height: calc(100vh - 140px); }
.signin-brand { background: #fff; border-right: 1px solid var(--border); display: flex; align-items: center;
                justify-content: center; padding: 48px 32px; }
.signin-logo { width: min(100%, 400px); height: auto; display: block; }
.signin-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 8vw, 120px);
                max-width: 620px; }
.signin-product { margin: 0 0 34px; color: var(--muted); font-size: 15px; }
.signin-name { display: block; font-family: var(--serif); font-size: 40px; font-weight: 500; letter-spacing: .18em;
               text-transform: uppercase; color: var(--ink); line-height: 1.1; margin-bottom: 6px; }
.signin-panel h1 { font-size: 24px; margin-bottom: 18px; }
.signin-form .field input { max-width: 360px; }
.signin-submit { padding: 9px 22px; margin-top: 4px; }
.signin-forgot { margin-left: 16px; font-size: 14px; }
.signin-note { color: var(--muted); font-size: 13px; max-width: 46ch; margin: 26px 0 0; }
@media (max-width: 760px) {
  .signin { grid-template-columns: 1fr; min-height: 0; }
  .signin-brand { padding: 24px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .signin-logo { width: min(100%, 240px); }
  .signin-name { font-size: 30px; }
  .signin-panel { padding: 28px 16px 40px; }
}

/* ------------------------------------------------------------------ dashboard: participants bar and work waiting */
.dash-people { margin: 6px 0 22px; }
.dash-people-head { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.dash-people-head a { color: var(--ink); }
.dash-big { font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--ink); line-height: 1; margin-right: 4px; }
.dash-bar { display: flex; height: 14px; border-radius: 2px; overflow: hidden; background: var(--border); gap: 2px; max-width: 980px; }
.dash-seg { display: block; min-width: 6px; }
.dash-seg:hover { filter: brightness(1.15); }
.dash-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 0; margin: 10px 0 0; font-size: 14px; }
.dash-legend a { color: var(--text); }
.dash-legend strong { font-weight: 650; color: var(--ink); }
.dash-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 7px; vertical-align: 0; }
/* participant statuses: navy for the finished, slate and steel for those taking part, greys for those who left */
.st-SCREENING { background: #b7c9d9; }
.st-ON_TREATMENT { background: var(--slate); }
.st-FOLLOW_UP { background: var(--steel); }
.st-COMPLETED { background: var(--ink); }
.st-SCREEN_FAILED { background: #c9c3bb; }
.st-WITHDRAWN, .st-LOST_TO_FOLLOW_UP, .st-STUDY_ENDED { background: #8f877d; }
.st-DIED { background: #4b4540; }
.dash-todo { display: flex; flex-wrap: wrap; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
             margin: 0 0 22px; }
.dash-todo a { flex: 1 1 170px; padding: 14px 18px; color: var(--muted); font-size: 14px; border-right: 1px solid var(--border);
               display: flex; flex-direction: column; gap: 6px; }
.dash-todo a:last-child { border-right: 0; }
.dash-todo a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.dash-todo a.dash-alert .dash-big { color: var(--danger); }
@media (max-width: 720px) { .dash-todo a { flex-basis: 45%; border-bottom: 1px solid var(--border); } }
