/* ═══════════════════════════════════════════════════════════════════════════
   LAB·AUTH — Universal Design System
   Warm minimal palette: light orange, red, gray, brown, light green
   Font: Inter (friendly, modern, highly readable)
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── DESIGN TOKENS ─────────────────────────────────────────────────────── */
:root {
  /* Backgrounds — warm cream/stone tones */
  --bg: #faf7f4;
  /* page background — warm cream */
  --bg2: #ffffff;
  /* cards, panels */
  --bg3: #ffffff;
  /* subtle fill — white */
  --bg4: #ebe5de;
  /* muted fill — warm sand */

  /* Borders */
  --border: #e8e0d8;
  /* default border — warm */
  --border2: #d4c9be;
  /* focus/hover border */

  /* Text */
  --text: #2d2216;
  /* primary — dark brown */
  --text2: #6b5d4f;
  /* secondary — warm gray-brown */
  --text3: #a89888;
  /* caption/placeholder — muted warm */

  /* Accent — warm orange */
  --accent: #e07a35;
  /* primary action — warm orange */
  --accent2: #c96a2a;
  /* hover state — deeper orange */
  --accent-bg: #fef3e8;
  /* tint fill — light orange */
  --accent-bd: #f9c89a;
  /* tint border */

  /* Green — soft sage */
  --green: #5a9a5f;
  /* success — sage green */
  --green-bg: #f1f8f2;
  /* success tint */
  --green-bd: #b8dbb9;
  /* success border */

  /* Red — warm red */
  --red: #c94a3d;
  /* error/danger — warm red */
  --red-bg: #fdf0ee;
  /* error tint */
  --red-bd: #f0b4ac;
  /* error border */

  /* Yellow / Amber — warm amber */
  --yellow: #c08b30;
  /* warning — amber */
  --yel-bg: #fdf8ed;
  /* warning tint */
  --yel-bd: #ecd49a;
  /* warning border */

  /* Purple — warm plum */
  --purple: #8b5e8b;
  /* special — plum */
  --pur-bg: #f8f2f8;
  /* plum tint */
  --pur-bd: #d4b8d4;
  /* plum border */

  /* Shadows */
  --shadow: 0 1px 3px rgba(45, 34, 22, .06);
  --shadow-md: 0 4px 16px rgba(45, 34, 22, .10);

  /* Typography */
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Radii */
  --r: 8px;
}

/* ── RESET ─────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

html,
body {
  height: 100%;
  overflow: hidden
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── TOPBAR ────────────────────────────────────────────────────────────── */
.topbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  box-shadow: var(--shadow);
  z-index: 100;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
}

.back-btn:hover {
  border-color: var(--accent);
  color: var(--accent)
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
}

.logo-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2.5s ease-in-out infinite;
  box-shadow: 0 0 0 2px var(--green-bg);
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .4
  }
}

.page-badge {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text3);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px 4px 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
}

.avatar {
  width: 26px;
  height: 26px;
  background: var(--accent-bg);
  border: 1.5px solid var(--accent-bd);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

/* ── BUTTONS ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 34px;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent2);
  color: #fff
}

.btn-primary:hover {
  background: var(--accent2)
}

.btn-primary:disabled {
  opacity: .45;
  cursor: not-allowed
}

.btn-success {
  background: var(--green);
  color: #fff;
  border-color: var(--green)
}

.btn-success:hover {
  background: #4d8a52
}

.btn-danger {
  background: var(--red);
  color: #fff;
  border-color: var(--red)
}

.btn-danger:hover {
  background: #b5403a
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text2)
}

.btn-ghost:hover {
  background: var(--bg3)
}

.btn-purple {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple)
}

.btn-purple:hover {
  background: #7a4f7a
}

/* ── FORM FIELDS ───────────────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px
}

.field label {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 500;
}

.field input,
.field select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  padding: 6px 10px;
  height: 34px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(224, 122, 53, .12);
}

.test-item {
  transition: background .1s;
  cursor: pointer;
}

.test-item:hover {
  background: var(--bg4);
}

.test-item.highlight {
  background: var(--bg4);
  border-left: 3px solid var(--accent);
}

/* ── FILTER BAR ────────────────────────────────────────────────────────── */
.filter-bar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  flex-shrink: 0;
}

/* ── STATE MESSAGES ────────────────────────────────────────────────────── */
.state-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px 20px;
  color: var(--text3);
  font-size: 12px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

/* ── TOAST ──────────────────────────────────────────────────────────────── */
.twrap {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toast {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text);
  box-shadow: var(--shadow-md);
  animation: tIn .2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 240px;
}

@keyframes tIn {
  from {
    opacity: 0;
    transform: translateY(5px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.toast.success {
  border-color: var(--green-bd);
  background: var(--green-bg)
}

.toast.error {
  border-color: var(--red-bd);
  background: var(--red-bg)
}

.toast.info {
  border-color: var(--accent-bd);
  background: var(--accent-bg)
}

.tdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0
}

.toast.success .tdot {
  background: var(--green)
}

.toast.error .tdot {
  background: var(--red)
}

.toast.info .tdot {
  background: var(--accent)
}

/* ── MODALS ─────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 34, 22, .45);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay.hidden {
  display: none
}

.modal {
  background: var(--bg2);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(45, 34, 22, .18);
  width: 94%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 14px;
  font-weight: 700
}

.modal-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text3);
  padding: 4px;
}

.modal-close:hover {
  color: var(--red)
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 13px;
  color: var(--text2)
}

.modal-actions {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── SCROLLBAR ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px
}

::-webkit-scrollbar-track {
  background: transparent
}

::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 3px
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text3)
}

/* ── LOGOUT BUTTON ──────────────────────────────────────────────────────── */
.btn-logout {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text3);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.btn-logout:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-bg)
}

/* ── MOBILE ─────────────────────────────────────────────────────────────── */
@media(max-width:768px) {

  html,
  body {
    height: auto;
    overflow: auto
  }

  .topbar {
    padding: 0 12px;
    height: 46px
  }
}