/* Dashboard layout — reuses the theme tokens from styles.css (cream/mono). */
.dash {
  max-width: 1140px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 44px) clamp(16px, 4vw, 36px) 80px;
}

/* Sidebar layout */
.dash-shell {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: clamp(20px, 4vw, 40px);
  align-items: start;
}

.dash-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 90px;
}

.dash-tab {
  text-align: left;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.dash-tab:hover {
  background: var(--paper-soft);
  color: var(--ink);
}

.dash-tab.active {
  background: var(--panel);
  border-color: var(--line-strong);
  color: var(--ink);
  font-weight: 700;
}

.dash-tab-logout {
  margin-top: 14px;
  color: var(--muted-soft);
}

.dash-content {
  min-width: 0;
}

.dash-content h1 {
  font-size: clamp(24px, 3vw, 32px);
  margin-bottom: 18px;
}

.dash-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
}

.dash-stat {
  flex: 1;
  min-width: 120px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel);
  padding: 18px;
  text-align: center;
}

.dash-stat span {
  display: block;
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
}

.dash-stat label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 760px) {
  .dash-shell {
    grid-template-columns: 1fr;
  }
  .dash-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
  }
  .dash-tab {
    padding: 8px 12px;
    font-size: 12px;
  }
  .dash-tab-logout {
    margin-top: 0;
  }
}

.dash-loading {
  color: var(--muted);
  font-family: var(--mono);
}

.dash-login {
  display: grid;
  place-items: center;
  gap: 18px;
  min-height: 50vh;
  text-align: center;
}

.dash-section {
  margin-top: 32px;
  padding: 22px 24px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel);
}

.dash-section h2 {
  font-size: 18px;
  margin-bottom: 14px;
}

.dash-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.dash-balance {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
}

.dash-balance small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.dash-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.dash-input {
  flex: 1;
  min-width: 180px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
}

.dash-btn {
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.dash-btn.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.dash-btn:hover {
  opacity: 0.9;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12.5px;
}

.dash-table th,
.dash-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.dash-table th {
  color: var(--ink);
  font-weight: 600;
}

.dash-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-top: 12px;
  background: var(--paper);
}

.dash-card .title {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--ink);
}

.dash-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-soft);
  margin: 4px 0 8px;
}

.dash-pre {
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-top: 8px;
}

.dash-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--badge-bg);
  color: var(--badge-ink);
  font-family: var(--mono);
  font-size: 11px;
}

.pr-pill {
  background: #a9fc03;
  color: #16202b;
  border: 1px solid #8fce28;
  font-weight: 600;
}

.pr-pill:hover {
  background: #9be800;
}

.dash-note {
  color: var(--muted);
  font-size: 13px;
}

.dash-error {
  color: #b4451f;
  font-family: var(--mono);
  font-size: 12px;
  margin-top: 8px;
}

/* Expert applicant cards (admin) */
.applicant-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.applicant-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gh-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line);
  object-fit: cover;
  flex: none;
}

.gh-avatar-blank {
  background: var(--paper-soft);
}

.applicant-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.dash-pill.pill-ok {
  background: #e7f7d4;
  color: #2f5d00;
  border: 1px solid #b7e08a;
}

.dash-pill.pill-warn {
  background: #fbe6cf;
  color: #8a3b00;
  border: 1px solid #e8b483;
}

/* Expert availability toggle */
.dash-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-strong);
  background: var(--paper-soft);
  border-radius: 999px;
  padding: 6px 14px 6px 8px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.dash-toggle .dash-toggle-knob {
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: var(--line-strong);
  position: relative;
  transition: background 0.15s;
  flex: none;
}

.dash-toggle .dash-toggle-knob::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fffdf8;
  transition: transform 0.15s;
}

.dash-toggle.on {
  background: #a9fc03;
  border-color: #8fce28;
  color: #16202b;
  font-weight: 600;
}

.dash-toggle.on .dash-toggle-knob {
  background: #5c8a00;
}

.dash-toggle.on .dash-toggle-knob::after {
  transform: translateX(16px);
}

/* Request list */
.req-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.req {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}

.req[open] {
  background: var(--paper);
}

.req-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.req-summary::-webkit-details-marker {
  display: none;
}

.req-summary::before {
  content: "▸";
  color: var(--muted-soft);
  margin-right: 4px;
  transition: transform 0.15s ease;
}

.req[open] .req-summary::before {
  content: "▾";
}

.req-subject {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.req[open] .req-subject {
  white-space: normal;
}

.req-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.req-count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--badge-ink);
  font-weight: 600;
}

.req-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-soft);
}

.req-body {
  padding: 4px 16px 18px;
  border-top: 1px solid var(--line);
}

.req-h3 {
  font-size: 13px;
  margin: 14px 0 8px;
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.req-links {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.resp {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.resp > summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
  list-style: none;
}

.resp > summary::-webkit-details-marker {
  display: none;
}

.resp-preview {
  color: var(--muted);
  font-weight: 400;
}

.req-prompt {
  margin-top: 16px;
}

.req-prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

@media (max-width: 640px) {
  .req-summary {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .dash {
    padding: 20px 14px 64px;
  }
  .dash-section {
    padding: 16px 16px;
    margin-top: 20px;
  }
  .dash-content h1 {
    font-size: 24px;
  }
  /* Wide tables scroll inside their card instead of widening the page. */
  .dash-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .dash-table thead,
  .dash-table tbody,
  .dash-table tr {
    display: table;
    width: 100%;
    table-layout: fixed;
  }
  /* Inputs and buttons go full width and stack cleanly. */
  .dash-row {
    gap: 8px;
  }
  .dash-row .dash-input {
    min-width: 0;
    flex: 1 1 100%;
  }
  .dash-row .dash-btn {
    width: 100%;
  }
  .dash-stat {
    min-width: 100%;
  }
  .dash-balance {
    font-size: 24px;
  }
  .gh-avatar {
    width: 40px;
    height: 40px;
  }
}
