/* The management portal in the app's look (apps/app/src/theme): its palette, fonts, fields, pill
   buttons, badges and dropdown list. Everything is served from this host; nothing from elsewhere. */

@font-face {
  font-family: "Inter";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter/inter-latin-400-normal.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC,
    U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter/inter-latin-ext-400-normal.woff2") format("woff2");
  unicode-range:
    U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/inter/inter-latin-500-normal.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC,
    U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/inter/inter-latin-ext-500-normal.woff2") format("woff2");
  unicode-range:
    U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter/inter-latin-600-normal.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC,
    U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter/inter-latin-ext-600-normal.woff2") format("woff2");
  unicode-range:
    U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk";
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/space-grotesk/space-grotesk-latin-600-normal.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC,
    U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk";
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/space-grotesk/space-grotesk-latin-ext-600-normal.woff2") format("woff2");
  unicode-range:
    U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/jetbrains-mono/jetbrains-mono-latin-500-normal.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC,
    U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/jetbrains-mono/jetbrains-mono-latin-ext-500-normal.woff2") format("woff2");
  unicode-range:
    U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #0a0b0d;
  --s1: #111215;
  --s2: #16181c;
  --s3: #1e2025;
  --line: #25272d;
  --line2: #34373e;
  --text: #f1f2f4;
  --n100: #f7f8f9;
  --n200: #e4e6ea;
  --n300: #d5d7dc;
  --n400: #a9adb6;
  --n500: #8a8e98;
  --n600: #6b6f78;
  --n700: #4a4e57;
  --accent: #c9f24d;
  --accent2: #e2ff8a;
  --info: #7da8ff;
  --info300: #b5ccff;
  --wait: #f3b647;
  --wait300: #f7cd7f;
  --brand: #ff6464;
  --brand300: #ffb0b0;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Space Grotesk", var(--sans);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --popover:
    inset 0 0 0 1px var(--line2), 0 4px 12px rgba(0, 0, 0, 0.4),
    0 24px 56px -12px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
/* Above the rules that give these a display of their own. */
[hidden],
.card[hidden],
.tab[hidden],
.who[hidden],
.field[hidden],
.login[hidden] {
  display: none;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(201, 242, 77, 0.06), transparent 60%), var(--bg);
  color: var(--text);
  font: 400 14px / 1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button,
input {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(201, 242, 77, 0.35);
}

/* --- Header ------------------------------------------------------------------------------------ */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  /* The logo on the left, MANAGEMENT PORTAL in the middle of the screen, the person and the gear
     on the right. */
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(10, 11, 13, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mark {
  width: 36px;
  height: 36px;
}
.brand-name {
  font: 600 20px var(--display);
  letter-spacing: -0.4px;
  color: var(--text);
}
/* The MANAGEMENT PORTAL title: Space Grotesk capitals, lime fading to white. */
.portal-title {
  font: 600 24px var(--display);
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent2) 45%, var(--text) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* Signed out, the empty right side keeps the title centred; signed in, the person takes its place. */
.top-side:has(+ .who:not([hidden])) {
  display: none;
}
.who {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}
.gear-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--n300);
  cursor: pointer;
}
.gear-btn svg {
  width: 22px;
  height: 22px;
}
.gear-btn:hover {
  background: var(--s3);
  color: var(--text);
}
.gear-btn[aria-pressed="true"] {
  background: var(--s3);
  color: var(--accent);
}
.page-title {
  margin-bottom: 4px;
}
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font: 600 12px var(--sans);
}
.who-name {
  color: var(--n300);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The whole width of the window: the tables have many columns. */
main {
  padding: 28px 32px 80px;
}

/* --- Cards, headings --------------------------------------------------------------------------- */
.card {
  display: grid;
  gap: 18px;
  padding: 22px;
  background: var(--s2);
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px var(--line);
}
h1,
h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  color: var(--text);
}
h1 {
  font-size: 30px;
  line-height: 36px;
  letter-spacing: -0.8px;
}
h2 {
  font-size: 19px;
  line-height: 24px;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.count {
  font: 500 11px var(--mono);
  color: var(--n400);
  background: var(--s3);
  padding: 2px 7px;
  border-radius: 2px;
}
.count:empty {
  display: none;
}

/* --- Sign-in ----------------------------------------------------------------------------------- */
.login {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 36px;
  min-height: calc(100vh - 200px);
}
.login-card {
  width: min(420px, 100%);
  gap: 18px;
  padding: 32px;
  background: rgba(22, 24, 28, 0.88);
  box-shadow:
    inset 0 0 0 1px var(--line2),
    0 8px 24px rgba(0, 0, 0, 0.5);
}

/* --- Fields (the app's TextField) -------------------------------------------------------------- */
.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.field > span {
  font: 500 13px var(--sans);
  color: var(--n300);
  letter-spacing: 0.1px;
}
.field input,
.search {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 2px;
  background: var(--s3);
  box-shadow: inset 0 -1px 0 var(--line2);
  color: var(--text);
  font-size: 15px;
  transition: box-shadow 200ms var(--ease);
}
.field input:hover,
.search:hover {
  box-shadow: inset 0 -1px 0 var(--n600);
}
.field input:focus,
.search:focus {
  outline: none;
  box-shadow: inset 0 -2px 0 var(--accent);
}
.field input.invalid {
  box-shadow: inset 0 -2px 0 var(--brand);
}
.field input::placeholder,
.search::placeholder {
  color: var(--n600);
}
.search {
  width: min(280px, 100%);
  min-height: 38px;
  font-size: 14px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
}

/* --- Buttons (the app's Button: pills) --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 600 14px var(--sans);
  cursor: pointer;
  transition:
    background-color 160ms var(--ease),
    border-color 160ms var(--ease),
    color 160ms var(--ease);
}
.btn.lg {
  min-height: 54px;
  font-size: 15px;
}
.btn.sm {
  min-height: 36px;
  padding: 0 16px;
  font-size: 13px;
}
.btn.xs {
  min-height: 28px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 500;
}
.btn.primary {
  background: var(--accent);
  color: var(--bg);
}
.btn.primary:hover {
  background: var(--accent2);
}
.btn.ghost {
  background: var(--s3);
  color: var(--n300);
}
.btn.ghost:hover {
  background: var(--line2);
  color: var(--text);
}
.btn.danger {
  background: rgba(255, 100, 100, 0.14);
  color: var(--brand);
}
.btn.danger:hover {
  background: rgba(255, 100, 100, 0.24);
  color: var(--brand300);
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* --- Tabs (the app's Segmented) ---------------------------------------------------------------- */
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  margin-bottom: 20px;
  background: var(--s2);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line);
  max-width: 100%;
  overflow-x: auto;
}
.segmented button {
  min-height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--n400);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 160ms var(--ease),
    color 160ms var(--ease);
}
.segmented button:hover {
  color: var(--text);
}
.segmented button[aria-selected="true"] {
  background: var(--s3);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line2);
}
.tab {
  display: grid;
  gap: 20px;
}

/* --- Tables ------------------------------------------------------------------------------------ */
.table-wrap {
  overflow-x: auto;
  margin: 0 -22px -22px;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  padding: 10px 14px;
  text-align: left;
  font: 500 10.5px var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--n500);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
  color: var(--n200);
}
th:first-child,
td:first-child {
  padding-left: 22px;
}
th:last-child,
td:last-child {
  padding-right: 22px;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr {
  transition: background-color 120ms var(--ease);
}
tbody tr:hover {
  background: rgba(241, 242, 244, 0.025);
}
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.primary-text {
  display: block;
  color: var(--text);
  font-weight: 500;
}
.sub {
  display: block;
  color: var(--n500);
  font-size: 12.5px;
}
.muted {
  color: var(--n600);
}
.over {
  color: var(--wait);
}
.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.empty {
  padding: 36px 22px;
  text-align: center;
  color: var(--n500);
}
.bar {
  display: block;
  width: 120px;
  height: 4px;
  margin-top: 6px;
  background: var(--s3);
  border-radius: 2px;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
}
.bar.over > span {
  background: var(--wait);
}

/* --- Badges (the app's Badge: a tinted label in mono capitals) ---------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  border-radius: 2px;
  font: 500 11px var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  background: currentColor;
}

/* --- The dropdown (the app's components/ui/dropdown.tsx) ------------------------------------- */
.picker {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 2px;
  background: var(--s3);
  box-shadow: inset 0 -1px 0 var(--line2);
  color: var(--text);
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  user-select: none;
  transition:
    box-shadow 200ms var(--ease),
    background-color 200ms var(--ease);
}
.picker:hover {
  box-shadow: inset 0 -1px 0 var(--n600);
}
.picker[aria-expanded="true"] {
  box-shadow: inset 0 -2px 0 var(--accent);
}
.picker.pill {
  width: auto;
  min-height: 34px;
  padding: 0 12px 0 14px;
  border-radius: 999px;
  box-shadow: none;
  font: 500 13.5px var(--sans);
  color: var(--n200);
}
.picker.pill:hover,
.picker.pill[aria-expanded="true"] {
  background: var(--line2);
  box-shadow: none;
}
.picker .value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.picker .caret {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--n500);
  transition: transform 160ms var(--ease);
}
.picker[aria-expanded="true"] .caret {
  transform: rotate(180deg);
}
.dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.list {
  position: fixed;
  z-index: 50;
  display: grid;
  gap: 1px;
  padding: 6px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--s2);
  border-radius: 2px;
  box-shadow: var(--popover);
  animation: pop-in 140ms var(--ease);
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.985);
  }
}
.option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 2px;
  font: 500 14px var(--sans);
  color: var(--n200);
  cursor: pointer;
  transition: background-color 120ms var(--ease);
}
.option[aria-selected="true"] {
  background: rgba(201, 242, 77, 0.1);
  color: var(--n100);
}
.option.active {
  background: rgba(241, 242, 244, 0.07);
}
.option .label {
  flex: 1;
}
.option .check {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

/* --- Dialog and notifications ------------------------------------------------------------------ */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(10, 11, 13, 0.7);
  backdrop-filter: blur(4px);
  animation: fade-in 140ms var(--ease);
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
.dialog {
  display: grid;
  gap: 14px;
  width: min(440px, 100%);
  padding: 26px;
  background: var(--s2);
  border-radius: 2px;
  box-shadow:
    inset 0 0 0 1px var(--line2),
    0 20px 48px rgba(0, 0, 0, 0.7);
  animation: pop-in 160ms var(--ease);
}
.dialog p {
  margin: 0;
  color: var(--n400);
}
.dialog .actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}
.banner {
  margin: 0;
  padding: 10px 14px;
  border-radius: 2px;
  font-size: 13.5px;
}
.banner.error {
  background: rgba(255, 100, 100, 0.12);
  color: var(--brand300);
}
.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 70;
  display: grid;
  gap: 8px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--s3);
  box-shadow: var(--popover);
  font-weight: 500;
  animation: pop-in 160ms var(--ease);
}
.toast::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}
.toast.error::before {
  background: var(--brand);
}

@media (max-width: 640px) {
  .top {
    gap: 8px;
    padding: 10px 16px;
  }
  .brand-name {
    display: none;
  }
  .who-name {
    display: none;
  }
  .portal-title {
    font-size: 15px;
  }
  .mark {
    width: 30px;
    height: 30px;
  }
  main {
    padding: 20px 16px 64px;
  }
  .card {
    padding: 18px;
  }
  .table-wrap {
    margin: 0 -18px -18px;
  }
  th:first-child,
  td:first-child {
    padding-left: 18px;
  }
  .login-card {
    padding: 24px;
  }
}

.admin {
  display: block;
}
.admin + .admin {
  margin-top: 8px;
}

.login-card .btn {
  margin-top: 6px;
}

.storage {
  display: flex;
  align-items: center;
  gap: 10px;
}
.icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--n500);
  cursor: pointer;
  transition:
    background-color 160ms var(--ease),
    color 160ms var(--ease);
}
.icon-btn:hover {
  background: var(--s3);
  color: var(--text);
}
.icon-btn svg {
  width: 14px;
  height: 14px;
}
.dialog .field input {
  -moz-appearance: textfield;
}
.dialog .field input::-webkit-inner-spin-button,
.dialog .field input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* --- The invitation page ----------------------------------------------------------------------- */
.stack {
  display: grid;
  gap: 16px;
}
.kicker {
  font: 500 11px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.lead {
  margin: -6px 0 0;
  color: var(--n400);
}
.qr {
  justify-self: center;
  width: 200px;
  height: 200px;
  padding: 10px;
  background: #ffffff;
  border-radius: 2px;
}
.secret {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--s3);
  border-radius: 2px;
}
.secret code,
.link-box {
  font: 500 12.5px var(--mono);
  color: var(--n200);
  word-break: break-all;
}
.link-box {
  display: block;
  padding: 10px 12px;
  background: var(--s3);
  border-radius: 2px;
}

/* --- Statisztika ------------------------------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.stat {
  gap: 12px;
}
.stat-label {
  font: 500 10.5px var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--n500);
}
.stat-figure {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.stat-value {
  font: 600 28px / 1.1 var(--display);
  letter-spacing: -0.5px;
  color: var(--text);
}
.stat-percent {
  margin-left: auto;
  font: 500 13px var(--mono);
}
.stat-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  font-size: 12.5px;
  color: var(--n400);
}
.bar.wide {
  width: 100%;
  height: 6px;
  margin-top: 0;
}
.count-row {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
}
.count-item {
  display: grid;
  gap: 8px;
  justify-items: start;
}
.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 20px;
}
.chart {
  width: 100%;
  height: 120px;
}
.legend {
  display: flex;
  gap: 16px;
  font-size: 12.5px;
  color: var(--n400);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mono {
  font: 500 12.5px var(--mono);
}
@media (max-width: 640px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}
