/* ============================================================
   BUREAU OF LOST TIMELINES — DIRECTORATE CONSOLE SHEET
   Version: 2.0 (Dossier system)

   admin.html is the one surface in the site that *grants* rather than
   *records*, so it wears the stamp red of the authority that signs
   things out — never the phosphor of the vault, which is a machine
   talking. The gate is a sealed envelope; the workspace under it is
   ordinary paper: ink panels, hairline dividers, a red active tab and
   a red filled action. Deleting is the only place red is allowed to
   arrive as a hazard stripe instead of a fill.

   Colour, size and spacing come from css/tokens.css. Nothing here
   repeats a hex value, and nothing here is emoji: the plates carry
   three-letter codes in the display face.
   ============================================================ */

.admin-body {
  min-height: 100vh;
}

/* ---------- the gate ---------- */
.admin-login {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  padding: var(--s-5) var(--gutter);
}

.login-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  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-2);
  padding: var(--s-6) var(--s-5) var(--s-5);
  text-align: center;
}

/* The seal plate: the same doubled frame a badge card carries, used
   here for the one thing the console is for — a key. */
.login-box .lock-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto var(--s-4);
  border: 2px solid var(--alert-deep);
  box-shadow: inset 0 0 0 1px var(--line-red);
  border-radius: var(--r-1);
  transform: rotate(-2deg);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-h3);
  letter-spacing: 0.04em;
  color: var(--alert-bright);
}

.login-box .vault-label {
  display: block;
  color: var(--paper-bright);
  margin-bottom: var(--s-4);
}

.login-box input {
  display: block;
  width: 100%;
  background: var(--ink-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  color: var(--paper);
  padding: 11px var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.3em;
  text-align: center;
  margin-bottom: var(--s-2);
  box-shadow: var(--shadow-inset);
  transition: border-color var(--dur-1) var(--ease),
              box-shadow var(--dur-1) var(--ease);
}

.login-box input:focus {
  outline: none;
  border-color: var(--alert);
  box-shadow: 0 0 0 3px var(--alert-wash);
}

.login-box button {
  width: 100%;
  background: var(--alert);
  border: 1px solid var(--alert);
  border-radius: var(--r-1);
  color: var(--ink-0);
  padding: 12px var(--s-4);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease),
              box-shadow var(--dur-2) var(--ease);
}

.login-box button:hover {
  background: var(--alert-bright);
  border-color: var(--alert-bright);
  box-shadow: 0 8px 24px var(--alert-glow);
}

.login-box button:focus-visible {
  outline: 2px solid var(--alert-bright);
  outline-offset: 3px;
}

.login-box .hint {
  margin-top: var(--s-4);
  font-family: var(--font-my);
  font-size: var(--fs-micro);
  line-height: 1.7;
  color: var(--muted);
}

.login-box .hint code {
  font-family: var(--font-mono);
  color: var(--folklore);
  background: var(--folklore-wash);
  border: 1px solid var(--folklore-line);
  border-radius: var(--r-1);
  padding: 1px 6px;
}

/* ---------- the console ---------- */
.admin-dashboard {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-5) var(--gutter) var(--s-8);
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1);
  margin-bottom: var(--s-5);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--line);
}

.admin-tab {
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  color: var(--muted-strong);
  padding: 9px var(--s-3);
  min-height: 36px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease),
              background var(--dur-1) var(--ease);
}

.admin-tab:hover {
  color: var(--paper-bright);
  border-color: var(--alert);
}

.admin-tab:focus-visible {
  outline: 2px solid var(--alert-bright);
  outline-offset: 2px;
}

.admin-tab.active {
  background: var(--alert);
  border-color: var(--alert);
  color: var(--ink-0);
}

.admin-panel {
  display: none;
}

.admin-panel.active {
  display: block;
  animation: fadeIn var(--dur-4) var(--ease-out);
}

.admin-panel h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-h2);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-flat);
  text-transform: uppercase;
  color: var(--paper-bright);
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-2);
  border-bottom: var(--spine) solid var(--alert);
}

/* ---------- the intake form ---------- */
.admin-form {
  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);
  padding: var(--s-4);
  margin-bottom: var(--s-5);
}

.admin-form h3 {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--paper-dim);
  margin-bottom: var(--s-3);
}

/* Each settings block is a new question on the same sheet. */
.admin-form h3:not(:first-child) {
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
}

/* The last heading on the settings panel is the one that can hurt. */
.admin-form h3.danger {
  color: var(--alert-bright);
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  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-3);
  font-family: var(--font-body);
  font-size: var(--fs-label);
  line-height: 1.5;
  margin-bottom: var(--s-2);
  box-shadow: var(--shadow-inset);
  transition: border-color var(--dur-1) var(--ease),
              box-shadow var(--dur-1) var(--ease);
}

.admin-form input::placeholder,
.admin-form textarea::placeholder {
  color: var(--muted);
}

/* Burmese fields set in the Myanmar face, like every other page. */
.admin-form input[id$="-my"],
.admin-form textarea[id$="my"] {
  font-family: var(--font-my);
  font-size: var(--fs-label);
  line-height: 1.7;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  outline: none;
  border-color: var(--alert);
  box-shadow: 0 0 0 3px var(--alert-wash);
}

.admin-form textarea {
  resize: vertical;
}

.admin-form select {
  cursor: pointer;
  font-family: var(--font-mono);
  letter-spacing: var(--tr-mono);
  text-transform: uppercase;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted-strong) 50%),
    linear-gradient(135deg, var(--muted-strong) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: var(--s-6);
}

.admin-form select option {
  background: var(--ink-2);
  color: var(--paper);
}

/* ---------- the actions ---------- */
.admin-btn {
  background: transparent;
  border: 1px solid var(--alert);
  border-radius: var(--r-1);
  color: var(--alert-bright);
  padding: 11px var(--s-4);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease),
              color var(--dur-1) var(--ease),
              box-shadow var(--dur-2) var(--ease);
}

.admin-btn:hover {
  background: var(--alert);
  color: var(--ink-0);
  box-shadow: 0 8px 20px var(--alert-glow);
}

.admin-btn:focus-visible {
  outline: 2px solid var(--alert-bright);
  outline-offset: 3px;
}

/* Deleting is red stated as a hazard: the stripe is the warning, the
   fill on hover is the decision. */
.admin-btn.danger {
  margin-top: var(--s-1);
  border-color: var(--alert-deep);
  background-image: repeating-linear-gradient(
      -45deg,
      var(--alert-wash) 0 6px,
      transparent 6px 12px);
}

.danger-note {
  font-family: var(--font-my);
  font-size: var(--fs-micro);
  line-height: 1.7;
  color: var(--muted-strong);
  margin-top: var(--s-2);
  padding-left: var(--s-3);
  border-left: 1px solid var(--line-red);
}

/* ---------- the upload well ---------- */
.file-input {
  /* Kept in the DOM for the label to aim at; the label is the control. */
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.file-label {
  display: block;
  width: 100%;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-1);
  color: var(--paper-dim);
  padding: 11px var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tr-mono);
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  margin-bottom: var(--s-2);
  transition: border-color var(--dur-1) var(--ease),
              background var(--dur-1) var(--ease);
}

.file-label:hover {
  border-color: var(--alert);
  background: var(--alert-wash);
  color: var(--paper-bright);
}

.file-input:focus-visible + .file-label {
  outline: 2px solid var(--alert-bright);
  outline-offset: 3px;
}

.photo-preview {
  margin-bottom: var(--s-2);
  min-height: 0;
}

/* Evidence prints as a record: duller and flatter than the original. */
.photo-preview img {
  display: block;
  max-width: 100%;
  max-height: 200px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  filter: saturate(0.55) contrast(1.05);
}

/* ---------- the register of custom records ---------- */
.admin-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.admin-item {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  background: var(--ink-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  padding: var(--s-3) var(--s-4);
}

/* Everything in this list was typed by someone and filed by this
   console, so every row carries the same authorship rail. */
.admin-item::before {
  content: "";
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: 0;
  width: var(--spine);
  border-radius: var(--r-2) 0 0 var(--r-2);
  background: var(--alert-deep);
}

.admin-item .item-info {
  flex: 1;
  min-width: 0;
}

.admin-item .item-title {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tr-mono);
  color: var(--paper-bright);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-item .item-my {
  font-family: var(--font-my);
  font-size: var(--fs-label);
  line-height: 1.7;
  color: var(--paper);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-item .item-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tr-mono);
  text-transform: uppercase;
  color: var(--muted);
  margin-top: var(--s-1);
}

.admin-item .item-actions {
  display: flex;
  gap: var(--s-1);
  flex-shrink: 0;
}

.admin-item .item-actions button {
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  color: var(--muted-strong);
  padding: 7px var(--s-2);
  min-height: 32px;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tr-mono);
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color var(--dur-1) var(--ease),
              color var(--dur-1) var(--ease);
}

.admin-item .item-actions button:hover {
  border-color: var(--alert);
  color: var(--alert-bright);
}

.admin-item .item-actions button:focus-visible {
  outline: 2px solid var(--alert-bright);
  outline-offset: 2px;
}

.admin-item .item-actions button.view:hover {
  border-color: var(--folklore-line);
  color: var(--folklore);
}

/* (.empty-note lives in css/style.css.) */

/* ---------- narrow screens ---------- */
@media (max-width: 640px) {
  .login-box {
    padding: var(--s-5) var(--s-4) var(--s-4);
  }

  .admin-panel h2 {
    font-size: var(--fs-h3);
  }

  .admin-item {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-item .item-actions {
    justify-content: flex-end;
  }

  .admin-tab {
    flex: 1 1 auto;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-panel.active {
    animation: none;
  }

  .admin-tab,
  .admin-btn,
  .file-label,
  .login-box input,
  .login-box button,
  .admin-item .item-actions button {
    transition: none;
  }
}
