/* ============================================================
   BUREAU OF LOST TIMELINES — PERSONNEL TERMINAL SHEET
   Version: 2.0 (Dossier system)

   The dashboard is one operative's file opened to their own page: a
   record card with a red spine, four counters under it, then the
   sections of work. Authority is red (the role stamp, the section
   rules); the only green is the XP and badge meters, which are machine
   counters and read like them.

   The profile chrome (.profile-avatar, .avatar-edit-btn, .verify-banner)
   lives in css/style.css; this sheet owns the layout and the rows.
   ============================================================ */

.dash-main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-5) var(--gutter) var(--s-7);
}

/* ---------- the record card ---------- */
.dash-profile {
  margin-bottom: var(--s-6);
}

.profile-card {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  background: var(--ink-1);
  background-image: var(--fibre);
  border: 1px solid var(--line-strong);
  border-left: var(--spine) solid var(--alert);
  border-radius: var(--r-2);
  box-shadow: var(--shadow-1), var(--shadow-inset);
  padding: var(--s-4) var(--s-5);
  margin-bottom: var(--s-3);
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-info h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-h2);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-flat);
  color: var(--paper-bright);
  margin-bottom: var(--s-0);
  overflow-wrap: anywhere;
}

.profile-email {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tr-mono);
  color: var(--muted-strong);
  margin-bottom: var(--s-2);
  overflow-wrap: anywhere;
}

.profile-role {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
  margin-bottom: var(--s-2);
}

/* The role is the one thing on this page that states a rank out loud,
   so it is the stamp: red plate, ink type, wide tracking. */
.role-badge {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  background: var(--alert);
  color: var(--ink-0);
  padding: 4px 9px;
  border-radius: var(--r-1);
}

.role-my {
  font-family: var(--font-my);
  font-size: var(--fs-label);
  line-height: 1.7;
  color: var(--paper-dim);
}

/* The posting stamp under the rank: division code, then where you stand. It is
   smaller than the role plate on purpose — the rank is what the Bureau pays
   attention to, the posting is what it assigns work from. */
.profile-posting {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-bottom: var(--s-2);
  padding-top: var(--s-1);
  border-top: 1px solid var(--line-hair);
}

.profile-posting:empty {
  display: none;
}

.pp-code {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--cat-timeline);
}

.pp-name {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tr-mono);
  text-transform: uppercase;
  color: var(--muted-strong);
}

.pp-my {
  font-family: var(--font-my);
  font-size: var(--fs-label);
  line-height: 1.7;
  color: var(--paper-dim);
}

/* ---------- the counters: XP is a machine readout ---------- */
.xp-bar {
  height: 6px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin-bottom: 5px;
  box-shadow: var(--shadow-inset);
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--phosphor-dim), var(--phosphor));
  box-shadow: 0 0 12px rgba(51, 255, 102, 0.35);
  transition: width var(--dur-4) var(--ease-out);
}

.xp-text {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tr-mono);
  text-transform: uppercase;
  color: var(--muted-strong);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-1);
}

.stat {
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: var(--s-3) var(--s-2);
  text-align: center;
}

.stat-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-h2);
  line-height: 1;
  color: var(--paper-bright);
}

.stat-label {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 5px;
}

/* ---------- sections ---------- */
.dash-section {
  margin-bottom: var(--s-6);
}

.dash-section h3 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-bright);
  padding-bottom: var(--s-1);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--s-3);
}

/* Every section title gets the same short red tick the header rule uses —
   it is the Bureau's mark that a line of the file is a heading. */
.dash-section h3::before {
  content: "";
  flex: none;
  width: 18px;
  height: 2px;
  background: var(--alert);
  transform: translateY(-3px);
}

.dash-section h3 .my {
  font-family: var(--font-my);
  font-weight: 400;
  font-size: var(--fs-label);
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted-strong);
}

.dash-section .badges-progress {
  margin-bottom: var(--s-3);
}

/* ---------- missions ---------- */
.dash-missions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s-2);
  margin-bottom: var(--s-2);
}

.mission-mini {
  position: relative;
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4);
  transition: border-color var(--dur-1) var(--ease),
              background var(--dur-1) var(--ease);
}

.mission-mini::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--spine);
  background: var(--folklore);
  opacity: 0.7;
}

.mission-mini:hover {
  border-color: var(--line-strong);
  background: var(--ink-2);
}

.mission-mini.done::before {
  background: var(--phosphor-dim);
}

.mission-mini.done {
  border-color: var(--phosphor-dim);
  background: var(--phosphor-wash);
}

.mission-mini .mm-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-label);
  line-height: var(--lh-snug);
  color: var(--paper-bright);
  margin-bottom: 3px;
  padding-right: 62px;
  overflow-wrap: anywhere;
}

.mission-mini .mm-my {
  font-family: var(--font-my);
  font-size: var(--fs-label);
  line-height: 1.7;
  color: var(--paper-dim);
  margin-bottom: var(--s-1);
}

.mission-mini .mm-xp {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tr-mono);
  text-transform: uppercase;
  color: var(--phosphor);
}

.mission-mini .mm-status {
  position: absolute;
  top: var(--s-2);
  right: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tr-label);
  padding: 2px 6px;
  border-radius: var(--r-1);
}

.mission-mini:not(.done) .mm-status {
  border: 1px solid var(--folklore-line);
  color: var(--folklore);
}

/* A duty that came from this operative's posting is not an open suggestion — it is
   an order, and the Bureau marks an assigned thing in the division colour. */
.mission-mini .mm-status.assigned {
  border-color: var(--cat-timeline);
  color: var(--cat-timeline);
}

.mission-mini.done .mm-status {
  background: var(--phosphor-dim);
  border-color: var(--phosphor-dim);
  color: var(--ink-0);
}

/* ---------- submissions ---------- */
.dash-submissions {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line-hair);
  border-radius: var(--r-1);
  overflow: hidden;
}

.submission-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  flex-wrap: wrap;
  background: var(--ink-1);
  padding: var(--s-2) var(--s-3);
}

.submission-row .sr-title {
  flex: 1;
  min-width: 150px;
  font-size: var(--fs-label);
  line-height: var(--lh-snug);
  color: var(--paper);
  overflow-wrap: anywhere;
}

.submission-row .sr-status {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--r-1);
  border: 1px solid transparent;
}

.sr-status.pending {
  border-color: var(--folklore-line);
  color: var(--folklore);
}

.sr-status.approved {
  background: var(--phosphor-dim);
  color: var(--ink-0);
}

.sr-status.rejected {
  border-color: var(--alert);
  color: var(--alert-bright);
}

/* ---------- a section with nothing in it is an invitation, not a gap ---------- */
.dash-empty {
  font-family: var(--font-my);
  font-size: var(--fs-label);
  line-height: 1.7;
  color: var(--muted-strong);
  background: var(--ink-1);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-1);
  padding: var(--s-3);
}

.dash-empty a {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tr-mono);
  text-transform: uppercase;
  color: var(--alert-bright);
  text-decoration: none;
  border-bottom: 1px solid var(--alert-deep);
}

.dash-empty a:hover {
  color: var(--paper-bright);
  border-bottom-color: var(--alert);
}

/* ---------- links out ---------- */
.dash-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--muted-strong);
  text-decoration: none;
  margin-top: var(--s-2);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease);
}

.dash-link:hover {
  color: var(--paper-bright);
  border-bottom-color: var(--alert);
}

/* ---------- the posting order sheet ----------
   The one section of this page that is a form the Bureau has to have on file:
   two selects and the rule that comes with the division you picked. */
.po-lead {
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--muted-strong);
  margin-bottom: var(--s-3);
}

.po-lead .my {
  font-family: var(--font-my);
  line-height: 1.7;
  color: var(--paper-dim);
}

.posting-order form {
  display: grid;
  gap: var(--s-3);
  max-width: 560px;
}

.po-row label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--muted-strong);
  margin-bottom: 5px;
}

.po-row select {
  display: block;
  width: 100%;
  background: var(--ink-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  color: var(--paper);
  padding: 10px var(--s-2);
  font-family: var(--font-my);
  font-size: var(--fs-label);
  box-shadow: var(--shadow-inset);
}

.po-row select:focus {
  outline: none;
  border-color: var(--alert);
  box-shadow: 0 0 0 3px var(--alert-wash);
}

.po-note {
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--paper-dim);
  border-left: var(--spine) solid var(--cat-timeline);
  background: var(--ink-1);
  padding: var(--s-2) var(--s-3);
}

.po-note .my {
  display: inline-block;
  font-family: var(--font-my);
  line-height: 1.7;
  color: var(--paper-dim);
  margin-top: 4px;
}

.po-btn {
  justify-self: start;
  background: var(--alert);
  border: 1px solid var(--alert);
  border-radius: var(--r-1);
  color: var(--ink-0);
  padding: 12px var(--s-4);
  min-height: 42px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease);
}

.po-btn:hover { background: var(--alert-bright); border-color: var(--alert-bright); }
.po-btn:focus-visible { outline: 2px solid var(--alert-bright); outline-offset: 2px; }

/* ---------- security ---------- */
.sec-form {
  display: grid;
  gap: var(--s-1);
  max-width: 420px;
}

.sec-form input {
  background: var(--ink-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  color: var(--paper);
  padding: 10px var(--s-2);
  font-family: var(--font-body);
  font-size: var(--fs-label);
  outline: none;
  box-shadow: var(--shadow-inset);
  transition: border-color var(--dur-1) var(--ease),
              box-shadow var(--dur-1) var(--ease);
}

.sec-form input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.sec-form input:focus {
  border-color: var(--alert);
  box-shadow: 0 0 0 3px var(--alert-wash);
}

.sec-btn {
  justify-self: start;
  background: transparent;
  border: 1px solid var(--alert);
  border-radius: var(--r-1);
  color: var(--alert-bright);
  padding: 10px var(--s-4);
  min-height: 40px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease),
              color var(--dur-1) var(--ease);
}

.sec-btn:hover {
  background: var(--alert);
  color: var(--ink-0);
}

.sec-btn:focus-visible {
  outline: 2px solid var(--alert-bright);
  outline-offset: 2px;
}

.sec-result {
  font-family: var(--font-my);
  font-size: var(--fs-label);
  line-height: 1.7;
  min-height: 18px;
}

.sec-result.good { color: var(--phosphor); }
.sec-result.bad  { color: var(--alert-bright); }

/* ---------- narrow screens ---------- */
@media (max-width: 720px) {
  .dash-main {
    padding-top: var(--s-3);
  }

  .profile-card {
    padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4);
  }

  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .dash-missions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .profile-card {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .mission-mini .mm-title {
    padding-right: 0;
  }

  .mission-mini .mm-status {
    position: static;
    display: inline-block;
    margin-bottom: var(--s-1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .xp-fill,
  .mission-mini,
  .dash-link,
  .sec-btn,
  .sec-form input {
    transition: none;
  }
}
