/*
  MyCU Staff Portal, internal IT/registrar tool for City University, Adversary City.
  Fictional facility, fictional city, built for the Adversary Wars simulation.

  This is an internal ops tool, not a marketing page: dense, utilitarian layout,
  a build/env strip like a real staff portal ships with. Signature device is the
  ticket/audit log (Recent Requests) on the dashboard. City University IT runs on
  service tickets (see the PORTAL-xxx references in the backend source), so account
  activity is framed as ticket rows rather than a generic terminal feed. Brand
  tokens (maroon, Georgia/Arial pairing, flat bordered surfaces) inherited from
  the public city.university site, see ../design.md.
*/

:root {
  --ink: #1c1c1a;
  --ink-soft: #57534d;
  --maroon: #6d1f2e;
  --maroon-dark: #4a1420;
  --paper: #ffffff;
  --tint: #f2f0ee;
  --line: #d8d5d1;

  --ok: #2f6b46;
  --warn: #9a5b12;
  --err: #8a2a2a;

  /* Ticket table zebra stripe/hairline, a touch warmer than the base tint/line
     so the audit log reads as its own surface without leaving the brand palette. */
  --ticket-bg: #faf7f2;
  --ticket-line: #ece6dc;

  --font-display: Georgia, Cambria, "Times New Roman", serif;
  --font-body: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --font-mono: "Courier New", Consolas, monospace;

  --radius: 3px;
  --max: 30rem;
  --max-wide: 58rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--tint);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.02rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  margin: 0 0 0.5rem;
  color: var(--ink);
}

a {
  color: var(--maroon);
}

:focus-visible {
  outline: 2px solid var(--maroon);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.25rem 1.5rem;
}

.wrap-wide {
  max-width: var(--max-wide);
}

/* Env/build strip. Real internal tools show you what you're looking at
   (env, version, upstream health) before anything branded. Quiet chrome,
   not the page's signature. */
.env-strip {
  background: var(--ink);
  color: #948d86;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.01em;
  padding: 0.4rem 0;
}

.env-strip .wrap {
  max-width: 60rem;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.env-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-soft);
  flex-shrink: 0;
  display: inline-block;
}

.env-dot.is-ok {
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(47, 107, 70, 0.5);
  animation: env-pulse 2.4s ease-out infinite;
}

@keyframes env-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(47, 107, 70, 0.45); }
  70%  { box-shadow: 0 0 0 5px rgba(47, 107, 70, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 107, 70, 0); }
}

.env-strip strong {
  color: #d7d2ca;
  font-weight: 400;
}

.env-strip .sep {
  color: #3a3532;
}

/* Branded header, sits below the env strip */
.topbar {
  background: var(--maroon);
  color: #fff;
  padding: 0.85rem 0;
}

.topbar .wrap {
  padding-top: 0;
  padding-bottom: 0;
  max-width: 70rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-mark {
  width: 27px;
  height: 27px;
  border-radius: 3px;
  background: #fff;
  color: var(--maroon);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 700;
  flex-shrink: 0;
}

.topnav a {
  color: #f2e6e8;
  text-decoration: none;
  margin-left: 1.25rem;
  font-size: 0.88rem;
  white-space: nowrap;
}

.topnav a:hover {
  color: #fff;
}

/* ---- Topbar nav: icon links, notifications, account chip ---- */
.topnav {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: space-between;
  gap: 1.5rem;
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.topnav-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.topnav-link svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.topnav-link.is-active {
  color: #fff;
  border-bottom-color: #fff;
}

.topnav-link.is-disabled {
  color: #d9b7bd;
  cursor: default;
}

.topnav-actions {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.topnav-actions a {
  margin-left: 0;
}

@media (max-width: 860px) {
  .topnav-links {
    display: none;
  }
}

.bell-wrap {
  position: relative;
}

.bell-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #f2e6e8;
  cursor: pointer;
}

.bell-btn:hover {
  color: #fff;
}

.bell-btn svg {
  width: 1.1rem;
  height: 1.1rem;
}

.bell-dot {
  position: absolute;
  top: 0.2rem;
  right: 0.25rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f0c04a;
  border: 1px solid var(--maroon);
}

.bell-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 16.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 2px solid var(--maroon);
  border-radius: var(--radius);
  z-index: 20;
}

.bell-panel-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  padding: 0.65rem 0.9rem 0.4rem;
}

.bell-item {
  padding: 0.55rem 0.9rem 0.65rem;
  border-top: 1px solid var(--line);
}

.bell-item p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink);
}

.bell-item time {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.avatar-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.avatar-circle {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.avatar-circle svg {
  width: 1rem;
  height: 1rem;
}

.avatar-name {
  color: #fff;
  font-size: 0.84rem;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .avatar-name {
    display: none;
  }
}

main {
  display: block;
}

/* ---- Auth: full-bleed tinted wash behind a single large sheet, a floating
   staff-directory card as the one bold moment on the page. ---- */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #f6ecec 0%, var(--tint) 55%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
}

.auth-sheet {
  width: 100%;
  max-width: 76rem;
  background: var(--paper);
  border-radius: 20px;
  padding: 1.75rem 2.5rem 3rem;
  overflow: hidden;
}

.auth-sheet-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 1rem;
}

.auth-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 1.1rem;
  line-height: 1;
}

.auth-close:hover {
  border-color: var(--ink-soft);
  color: var(--ink);
}

.auth-columns {
  display: grid;
  grid-template-columns: 0.85fr 1.25fr;
  gap: 3rem;
  align-items: center;
  padding-top: 2rem;
}

@media (max-width: 760px) {
  .auth-columns {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

.auth-form-col h1 {
  font-size: 2rem;
  line-height: 1.15;
  margin-bottom: 0.6rem;
}

.auth-lede {
  color: var(--ink-soft);
  font-size: 0.98rem;
  max-width: 26rem;
  margin-bottom: 1.5rem;
}

.auth-meta {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.email-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fbf1d9;
  padding: 0.15rem 0.55rem;
  border-radius: 5px;
  font-weight: 700;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.email-chip button {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 0.9rem;
  padding: 0;
}

.otp-boxes {
  display: flex;
  gap: 0.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6rem;
  margin-bottom: 1rem;
}

.otp-box {
  width: 2rem;
  height: 2.6rem;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 1.15rem;
  background: var(--tint);
}

.otp-box:focus {
  outline: none;
  border-color: var(--maroon);
  background: var(--paper);
}

@media (max-width: 480px) {
  .otp-box {
    width: 1.7rem;
  }
}

/* ---- Decorative dashboard preview, the page's one bold moment ---- */
.auth-decor-col {
  position: relative;
  min-height: 20rem;
  display: none;
}

@media (min-width: 761px) {
  .auth-decor-col {
    display: block;
  }
}

.auth-photo-frame {
  position: relative;
}

.auth-photo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 40px -18px rgba(28, 28, 26, 0.35);
}

.seal-glyph {
  position: absolute;
  top: -1.1rem;
  left: -1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.5rem 0.9rem 0.5rem 0.5rem;
  filter: drop-shadow(0 6px 14px rgba(74, 20, 32, 0.18));
}

.seal-glyph-mark {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 6px;
  background: var(--maroon);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.seal-glyph-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}


.field {
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.field input {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-mono);
  background: var(--tint);
}

.field input:focus {
  outline: none;
  border-color: var(--maroon);
  background: var(--paper);
}

.btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--maroon);
  background: var(--maroon);
  color: #fff;
  cursor: pointer;
}

.btn:hover {
  background: var(--maroon-dark);
  border-color: var(--maroon-dark);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.auth-fine-print {
  margin: 0.7rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
  text-align: center;
}

.auth-fine-print a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.status-line {
  margin-top: 1rem;
  font-size: 0.88rem;
  font-family: var(--font-mono);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.status-line.ok {
  border-color: var(--ok);
  color: var(--ok);
  background: #eef6f0;
}

.status-line.err {
  border-color: var(--err);
  color: var(--err);
  background: #fbeeee;
}

/* ---- Dashboard ---- */
.page-body {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 3rem;
}

.page-body-wide {
  max-width: 70rem;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}

.pill {
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
}

.pill:hover {
  border-color: var(--ink-soft);
  color: var(--ink);
}

.pill.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.session-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.75rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--maroon);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.5rem;
}

.session-item {
  display: flex;
  flex-direction: column;
  padding: 0.3rem 0;
}

.session-item .k {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.session-item .v {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

h2.section-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin: 1.5rem 0 0.6rem;
}

.hint {
  font-size: 0.86rem;
  color: var(--ink-soft);
  border-left: 3px solid var(--line);
  padding-left: 0.85rem;
  margin: 0.75rem 0;
}

/* Audit log: the dashboard's real content, framed as IT service tickets
   (this department tracks everything by ticket, see SR- prefix) rather
   than a generic terminal feed. */
.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.audit-table th {
  text-align: left;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  padding: 0.55rem 0.75rem;
  border-bottom: 2px solid var(--ink);
}

.audit-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--ticket-line);
  vertical-align: top;
}

.audit-table tbody tr:nth-child(even) {
  background: var(--ticket-bg);
}

.audit-table tbody tr:last-child td {
  border-bottom: none;
}

.audit-ticket {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.audit-desc {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  word-break: break-word;
}

.audit-status {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.audit-status.resolved {
  background: #eef6f0;
  color: var(--ok);
}

.audit-status.flagged {
  background: #fdf1e0;
  color: var(--warn);
}

.audit-status.error {
  background: #fbeeee;
  color: var(--err);
}

.audit-status.note {
  background: var(--tint);
  color: var(--ink-soft);
}

/* ---- Quick Access: card grid + status sidebar ---- */
.dashboard-columns {
  display: grid;
  grid-template-columns: 1fr 16rem;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 820px) {
  .dashboard-columns {
    grid-template-columns: 1fr;
  }
}

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 560px) {
  .quick-grid {
    grid-template-columns: 1fr;
  }
}

.quick-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.quick-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.quick-card-head svg {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--maroon);
  flex-shrink: 0;
}

.quick-card-head h3 {
  font-size: 0.95rem;
  margin: 0;
}

.quick-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--tint);
}

.quick-row:last-of-type {
  border-bottom: none;
}

.quick-row .k {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}

.quick-row .v {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.quick-note {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 0.5rem;
}

.btn-mini {
  display: inline-block;
  margin-top: 0.6rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--tint);
  color: var(--ink-soft);
  cursor: not-allowed;
}

.mini-ticket-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.32rem 0;
  border-bottom: 1px solid var(--tint);
  font-size: 0.8rem;
}

.mini-ticket-row:last-of-type {
  border-bottom: none;
}

.mini-ticket-row .t {
  font-family: var(--font-mono);
  color: var(--ink-soft);
}

.doc-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.doc-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.83rem;
}

.doc-row svg {
  width: 1rem;
  height: 1rem;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.doc-row .doc-meta {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.side-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.side-panel h3 {
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

/* ---- Status page: service rows, not a paragraph blob ---- */
.service-list {
  border-top: 1px solid var(--line);
}

.service-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.service-name {
  font-weight: 700;
}

.service-state {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ok);
  flex-shrink: 0;
}

.service-state .env-dot {
  animation: none;
}

.status-note {
  margin-top: 1.25rem;
  padding: 0.9rem 1rem;
  background: var(--tint);
  border-left: 3px solid var(--maroon);
  border-radius: var(--radius);
  font-size: 0.92rem;
}

.status-note p {
  margin: 0 0 0.4rem;
}

.status-note p:last-child {
  margin-bottom: 0;
}

.footer-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 2rem 0 1rem;
}
