*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --ink: #07111c;
  --ink-soft: #1a2a3c;
  --foam: #e8eef4;
  --mint: #5ec8d4;
  --amber: #f5b942;
  --panel: rgba(12, 22, 36, 0.74);
  --line: rgba(94, 200, 212, 0.3);
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  color: var(--foam);
  font-family: 'Outfit', 'Avenir Next', 'Segoe UI', sans-serif;
  background: #0a121c;
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 15% 10%, rgba(64, 168, 196, 0.16), transparent 60%),
    radial-gradient(ellipse 50% 40% at 78% 18%, rgba(100, 140, 180, 0.14), transparent 55%),
    radial-gradient(ellipse 55% 45% at 90% 85%, rgba(245, 185, 66, 0.08), transparent 55%),
    linear-gradient(160deg, #0a121c 0%, #14202e 42%, #1a2b3d 70%, #1c3348 100%);
  animation: wash 14s ease-in-out infinite alternate;
}

.atmosphere::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(232, 238, 244, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 238, 244, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  animation: drift 22s linear infinite;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(3.5rem, 10vh, 6rem) 1.5rem 3rem;
}

.brand {
  margin-bottom: 2.25rem;
  animation: rise 0.7s ease-out both;
}

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 8vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: #f3f6fa;
}

.gate,
.apps {
  animation: rise 0.75s ease-out 0.12s both;
}

.login-form {
  display: grid;
  gap: 0.65rem;
  padding: 1.25rem 0 0;
}

.login-form label {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 243, 241, 0.7);
}

.login-row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.login-form input {
  flex: 1 1 14rem;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--panel);
  color: var(--foam);
  font: inherit;
  font-size: 1.05rem;
  padding: 0.85rem 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-form input:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(94, 200, 212, 0.18);
}

.login-form button[type='submit'],
.logout-btn {
  border: 0;
  border-radius: 0.4rem;
  background: var(--mint);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.login-form button[type='submit'] {
  padding: 0.85rem 1.35rem;
}

.reveal-btn {
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: transparent;
  color: var(--foam);
  font: inherit;
  font-weight: 600;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.reveal-btn:hover,
.reveal-btn[aria-pressed='true'] {
  background: rgba(94, 200, 212, 0.12);
  color: var(--mint);
  border-color: var(--mint);
}

.login-form button[type='submit']:hover,
.logout-btn:hover {
  background: #8edde8;
  transform: translateY(-1px);
}

.login-form button[type='submit']:active,
.logout-btn:active {
  transform: translateY(0);
}

.login-error {
  margin: 0.15rem 0 0;
  color: #fda4af;
  font-size: 0.92rem;
}

.apps-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.apps-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.page-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  text-align: center;
  animation: rise 0.75s ease-out 0.2s both;
}

.ghost-link-btn {
  border: 0;
  background: transparent;
  color: rgba(232, 243, 241, 0.45);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  transition: color 0.15s ease;
}

.ghost-link-btn:hover {
  color: var(--mint);
}

body.dialog-open {
  overflow: hidden;
}

.dialog[hidden] {
  display: none !important;
}

.dialog {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 18, 0.72);
  backdrop-filter: blur(4px);
}

.dialog-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 26rem);
  max-height: min(88vh, 36rem);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: rgba(10, 20, 32, 0.96);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: rise 0.25s ease-out both;
}

.dialog-panel--wide {
  width: min(100%, 40rem);
  max-height: min(88vh, 42rem);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem 0.85rem;
  border-bottom: 1px solid rgba(232, 243, 241, 0.08);
}

.dialog-header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #f3f6fa;
}

.dialog-close {
  border: 0;
  background: transparent;
  color: rgba(232, 243, 241, 0.55);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 0.25rem;
}

.dialog-close:hover {
  color: var(--foam);
  background: rgba(94, 200, 212, 0.1);
}

.dialog-form,
.dialog-body {
  padding: 1rem 1.1rem;
  overflow-y: auto;
}

.dialog-form {
  display: grid;
  gap: 0.55rem;
}

.dialog-form label {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 243, 241, 0.65);
}

.dialog-form input,
.dialog-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: rgba(4, 16, 24, 0.65);
  color: var(--foam);
  font: inherit;
  font-size: 0.98rem;
  padding: 0.75rem 0.85rem;
  outline: none;
  resize: vertical;
  min-height: 2.75rem;
}

.dialog-form textarea {
  min-height: 7rem;
}

.dialog-form input:focus,
.dialog-form textarea:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(94, 200, 212, 0.16);
}

.dialog-error {
  margin: 0.15rem 0 0;
  color: #fda4af;
  font-size: 0.88rem;
}

.dialog-success {
  margin: 0.15rem 0 0;
  color: #86efac;
  font-size: 0.88rem;
}

.dialog-hint {
  margin: 0;
  color: rgba(232, 243, 241, 0.65);
  font-size: 0.92rem;
  line-height: 1.45;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  padding: 0.85rem 1.1rem 1rem;
  border-top: 1px solid rgba(232, 243, 241, 0.08);
}

.dialog-actions--footer {
  margin-top: auto;
}

.dialog-primary,
.dialog-secondary {
  border-radius: 0.4rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
}

.dialog-primary {
  border: 0;
  background: var(--mint);
  color: var(--ink);
}

.dialog-primary:hover:not(:disabled) {
  background: #8edde8;
}

.dialog-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.dialog-secondary {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--foam);
}

.dialog-secondary:hover:not(:disabled) {
  background: rgba(94, 200, 212, 0.1);
  color: var(--mint);
}

.bug-report-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bug-report-item {
  border: 1px solid rgba(232, 243, 241, 0.1);
  border-radius: 0.45rem;
  background: rgba(4, 16, 24, 0.55);
  padding: 0.75rem 0.85rem;
}

.bug-report-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.bug-report-item-head strong {
  color: #f7fffc;
  font-size: 0.95rem;
}

.bug-report-item-head time {
  flex-shrink: 0;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: rgba(232, 243, 241, 0.5);
}

.bug-report-item-body {
  margin: 0;
  color: rgba(232, 243, 241, 0.88);
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.bug-report-item-meta {
  margin: 0.45rem 0 0;
  font-size: 0.75rem;
}

.bug-report-page {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  color: var(--mint);
  text-decoration: none;
  word-break: break-all;
}

.bug-report-page:hover {
  color: var(--amber);
}

.apps-label {
  margin: 0;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 243, 241, 0.7);
}

.logout-btn {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  background: transparent;
  color: var(--foam);
  border: 1px solid var(--line);
}

.logout-btn:hover {
  background: rgba(94, 200, 212, 0.12);
  color: var(--mint);
}

.apps-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(10px);
}

.apps-table th,
.apps-table td {
  padding: 1rem 1.1rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid rgba(232, 243, 241, 0.08);
}

.apps-table th {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(232, 243, 241, 0.55);
  background: rgba(4, 16, 24, 0.45);
}

.apps-table tbody tr {
  transition: background 0.2s ease;
}

.apps-table tbody tr:hover {
  background: rgba(94, 200, 212, 0.06);
}

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

.apps-table td:first-child {
  font-size: 1.08rem;
  font-weight: 700;
  width: 38%;
  color: #f7fffc;
}

.app-link {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.88rem;
  color: var(--mint);
  text-decoration: none;
  border-bottom: 1px solid rgba(94, 200, 212, 0.35);
  word-break: break-all;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.app-link:hover {
  color: var(--amber);
  border-bottom-color: rgba(245, 185, 66, 0.55);
}

@keyframes wash {
  from {
    filter: hue-rotate(-8deg) saturate(0.92);
  }
  to {
    filter: hue-rotate(2deg) saturate(1.02);
  }
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-24px, -16px, 0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .page {
    padding: 2.5rem 1rem 2.5rem;
  }

  .apps-table th,
  .apps-table td {
    padding: 0.8rem 0.75rem;
  }

  .apps-table td:first-child {
    width: auto;
  }

  .app-link {
    font-size: 0.78rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .atmosphere,
  .atmosphere::before,
  .brand,
  .gate,
  .apps {
    animation: none;
  }
}
