:root {
  --bg: #0b1020;
  --bg-soft: #131a2e;
  --panel: #161f36;
  --panel-alt: #1b2642;
  --border: #2a365a;
  --text: #edf2ff;
  --muted: #9aa8cb;
  --accent: #7c8dff;
  --accent-strong: #5d71ff;
  --success: #49dcb1;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at 15% -10%, rgba(124, 141, 255, 0.18), transparent 38%),
    radial-gradient(circle at 100% 0%, rgba(73, 220, 177, 0.08), transparent 32%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2000;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 24px));
}

.toast {
  position: relative;
  padding: 12px 40px 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  color: var(--text);
  background: linear-gradient(160deg, rgba(22, 31, 54, 0.98), rgba(15, 22, 38, 0.98));
  box-shadow: var(--shadow);
  animation: toast-enter 0.22s ease;
}

.toast-success {
  border-color: rgba(73, 220, 177, 0.45);
}

.toast-error {
  border-color: rgba(255, 156, 168, 0.45);
}

.toast-close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.toast-leave {
  opacity: 0;
  transform: translateX(14px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: linear-gradient(130deg, rgba(12, 18, 35, 0.9), rgba(17, 26, 48, 0.86));
  border-bottom: 1px solid rgba(124, 141, 255, 0.28);
  box-shadow: 0 14px 34px rgba(2, 6, 16, 0.45);
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(124, 141, 255, 0.26);
  background: linear-gradient(160deg, rgba(124, 141, 255, 0.12), rgba(73, 220, 177, 0.08));
}

.topbar-brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #9af8d6, #49dcb1);
  box-shadow: 0 0 0 5px rgba(73, 220, 177, 0.14);
}

.topbar-brand-text {
  display: grid;
  line-height: 1.05;
}

.topbar-brand-text strong {
  font-size: 0.86rem;
  color: #e6ecff;
  letter-spacing: 0.03em;
}

.topbar-brand-text small {
  font-size: 0.68rem;
  color: #9eb0da;
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.topbar a {
  color: #b3c1e8;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.topbar a:hover,
.topbar a.active {
  color: #f2f6ff;
  background: linear-gradient(155deg, rgba(124, 141, 255, 0.28), rgba(93, 113, 255, 0.34));
  border-color: rgba(145, 160, 255, 0.55);
  box-shadow: 0 8px 18px rgba(17, 24, 48, 0.46);
}

.topbar .nav-form {
  margin: 0;
}

.topbar .nav-link-button {
  color: #b3c1e8;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.topbar .nav-link-button:hover,
.topbar .nav-link-button.active {
  color: #f2f6ff;
  background: linear-gradient(155deg, rgba(124, 141, 255, 0.28), rgba(93, 113, 255, 0.34));
  border-color: rgba(145, 160, 255, 0.55);
  box-shadow: 0 8px 18px rgba(17, 24, 48, 0.46);
}

.logout {
  border: 1px solid rgba(124, 141, 255, 0.36);
  background: linear-gradient(160deg, #6f82ff, #5d71ff);
  color: #fff;
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 15px;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.user-menu {
  position: relative;
}

.user-menu-trigger {
  border: 1px solid rgba(124, 141, 255, 0.3);
  background: rgba(124, 141, 255, 0.12);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px 6px 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(160deg, #6f82ff, #5d71ff);
}

.user-name {
  font-weight: 600;
  line-height: 1;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  display: none;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(22, 31, 54, 0.98), rgba(15, 22, 38, 0.98));
  box-shadow: var(--shadow);
  z-index: 20;
}

.user-menu-dropdown.open {
  display: block;
}

.user-menu-dropdown .logout {
  width: 100%;
}

.user-menu-link {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  border: 1px solid rgba(124, 141, 255, 0.32);
  background: rgba(124, 141, 255, 0.12);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
  text-decoration: none;
  font-weight: 600;
}

.user-menu-link-button {
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.user-menu-link-form {
  margin: 0 0 10px 0;
}

.user-menu-link:hover {
  background: rgba(124, 141, 255, 0.22);
}

.settings-inline-form {
  margin: 0;
}

.settings-block-form {
  display: grid;
  gap: 12px;
}

.settings-block-form small {
  color: var(--muted);
  font-size: 0.82rem;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(124, 141, 255, 0.25);
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(124, 141, 255, 0.14), rgba(73, 220, 177, 0.08));
}

.service-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.service-toggle-info span {
  font-weight: 700;
}

.service-toggle-info small {
  color: var(--muted);
  font-size: 0.82rem;
}

.api-key-badge {
  width: 100%;
  border: 1px solid rgba(124, 141, 255, 0.4);
  background: rgba(124, 141, 255, 0.16);
  color: #dfe6ff;
  border-radius: 999px;
  padding: 8px 10px;
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-key-badge:hover {
  background: rgba(124, 141, 255, 0.22);
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 14px;
}

.settings-tab {
  border: 1px solid rgba(124, 141, 255, 0.35);
  background: rgba(124, 141, 255, 0.08);
  color: var(--muted);
  border-radius: 10px;
  padding: 9px 13px;
  font-weight: 600;
  cursor: pointer;
}

.settings-tab.active {
  color: var(--text);
  background: rgba(124, 141, 255, 0.24);
}

.settings-tabpanel {
  display: none;
  margin-bottom: 14px;
}

.settings-tabpanel.active {
  display: block;
}

.ticket-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 14px;
}

.ticket-dedupe-button {
  margin-left: auto;
}

.ticket-tab {
  border: 1px solid rgba(124, 141, 255, 0.35);
  background: rgba(124, 141, 255, 0.08);
  color: var(--muted);
  border-radius: 10px;
  padding: 9px 13px;
  font-weight: 600;
  cursor: pointer;
}

.ticket-tab.active {
  color: var(--text);
  background: rgba(124, 141, 255, 0.24);
}

.ticket-tabpanel {
  display: none;
}

.ticket-tabpanel.active {
  display: block;
}


.profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 14px;
}

.profile-tab {
  border: 1px solid rgba(124, 141, 255, 0.35);
  background: rgba(124, 141, 255, 0.08);
  color: var(--muted);
  border-radius: 10px;
  padding: 9px 13px;
  font-weight: 600;
  cursor: pointer;
}

.profile-tab.active {
  color: var(--text);
  background: rgba(124, 141, 255, 0.24);
}

.profile-tabpanel {
  display: none;
}

.profile-tabpanel.active {
  display: block;
}

.profile-tabs-action-inline {
  margin-left: auto;
  flex-shrink: 0;
}

.mini-button-png-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

.settings-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.settings-grid label {
  display: grid;
  gap: 7px;
}

.settings-uuid-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.settings-uuid-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(124, 141, 255, 0.28);
  border-radius: 10px;
  background: rgba(124, 141, 255, 0.1);
}

.settings-uuid-list code {
  font-size: 0.84rem;
  word-break: break-all;
}

input,
select,
textarea {
  border: 1px solid rgba(124, 141, 255, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  color: var(--text);
  background: linear-gradient(160deg, rgba(11, 16, 32, 0.95), rgba(15, 23, 44, 0.92));
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(154, 168, 203, 0.8);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(124, 141, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(124, 141, 255, 0.2);
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #b9c6ff 50%), linear-gradient(135deg, #b9c6ff 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 3px), calc(100% - 10px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

select option {
  background: #111a32;
  color: #e8eeff;
  padding: 10px;
}

select option:checked {
  background: linear-gradient(140deg, #5f74ff, #7b8cff);
  color: #fff;
}

.container {
  max-width: 1100px;
  margin: 36px auto;
  padding: 0 16px 60px;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 4vw, 2.2rem);
}

.header-row p {
  margin: 0;
  color: var(--muted);
}

.api-link {
  margin-top: 8px;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid rgba(124, 141, 255, 0.3);
  border-radius: 10px;
  padding: 10px 14px;
  transition: 0.2s ease;
}

.api-link:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(124, 141, 255, 0.12);
}

.card,
.api-info {
  margin-top: 24px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(22, 31, 54, 0.96), rgba(15, 22, 38, 0.96));
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

h2 {
  margin: 4px 0 14px;
  font-size: clamp(1.8rem, 5vw, 2.3rem);
  font-weight: 800;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 12px;
}

thead th {
  background: #0f1730;
  color: #dde5ff;
  text-align: left;
  padding: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

thead th.has-column-filter {
  vertical-align: top;
}

.column-filter-input {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(124, 141, 255, 0.35);
  background: rgba(10, 16, 32, 0.9);
  color: #dde5ff;
  font-size: 0.8rem;
}

.column-filter-input::placeholder {
  color: rgba(221, 229, 255, 0.6);
}

tbody td {
  padding: 12px;
  border-bottom: 1px solid rgba(72, 89, 129, 0.5);
  background: rgba(27, 38, 66, 0.72);
}

tbody tr:nth-child(even) td {
  background: rgba(20, 30, 52, 0.72);
}

.profiles-data-table thead th,
.profiles-data-table tbody td {
  text-align: center;
}


tbody tr:hover td {
  background: rgba(124, 141, 255, 0.1);
}

tfoot td {
  padding: 12px;
  border-top: 1px solid rgba(72, 89, 129, 0.5);
  background: rgba(15, 23, 48, 0.82);
}

.table-footer-pagination {
  margin-top: 0;
}

.ticket-image {
  width: 40px;
  max-height: 40px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  border: 1px solid rgba(124, 141, 255, 0.25);
  cursor: zoom-in;
}

.image-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 5, 11, 0.85);
  z-index: 999;
  padding: 20px;
}

.image-modal.open {
  display: flex;
}

.image-modal-content {
  position: relative;
  border-radius: 12px;
  padding: 20px;
  max-width: min(450px, 350px);
  max-height: 90vh;
  width: fit-content;
}

.image-modal-content img {
  border-radius: 10px;
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 60px);
  object-fit: contain;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.82rem;
  font-weight: 600;
}

.status-badge.used {
  color: #042b1f;
  background: rgba(73, 220, 177, 0.92);
}

.status-badge.unused {
  color: #d6ddff;
  background: rgba(124, 141, 255, 0.2);
  border: 1px solid rgba(124, 141, 255, 0.36);
}

.image-modal-controls {
  position: absolute;
  left: -70px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(248, 251, 255, 0.96);
  border: 1px solid rgba(93, 113, 255, 0.22);
  box-shadow: 0 8px 24px rgba(11, 20, 47, 0.2);
  backdrop-filter: blur(2px);
}

.usage-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  user-select: none;
}

.usage-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.usage-slider {
  position: relative;
  width: 48px;
  height: 27px;
  border-radius: 999px;
  background: rgba(172, 185, 228, 0.35);
  border: 1px solid rgba(124, 141, 255, 0.45);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.18);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.usage-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: linear-gradient(160deg, #ffffff, #edf2ff);
  box-shadow: 0 2px 8px rgba(3, 7, 18, 0.35);
  transition: transform 0.2s ease;
}

.usage-switch input:checked + .usage-slider {
  background: linear-gradient(135deg, rgba(73, 220, 177, 0.8), rgba(91, 113, 255, 0.78));
  border-color: rgba(83, 214, 179, 0.9);
}

.usage-switch input:checked + .usage-slider::before {
  transform: translateX(21px);
}

.usage-switch input:focus-visible + .usage-slider {
  outline: 2px solid #5d71ff;
  outline-offset: 2px;
}

.usage-switch input:checked + .usage-slider {
  background: linear-gradient(135deg, rgba(73, 220, 177, 0.8), rgba(91, 113, 255, 0.78));
}

.usage-switch-text {
  display: inline-flex;
  min-width: 54px;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(124, 141, 255, 0.32);
  background: rgba(124, 141, 255, 0.12);
  font-size: 0.8rem;
  line-height: 1.2;
}

.usage-switch-text.is-on {
  color: #96f0d3;
  border-color: rgba(73, 220, 177, 0.55);
  background: rgba(73, 220, 177, 0.14);
}

.usage-switch-text.is-off {
  color: #c9d3ff;
}

.image-modal-close {
  position: absolute;
  top: -5px;
  right: 0px;
  border: 0;
  background: transparent;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  color: #ffffff;
}

.empty {
  text-align: center;
  color: var(--muted);
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  border: 1px solid rgba(124, 141, 255, 0.34);
  text-decoration: none;
  color: #d4ddff;
  padding: 0 11px;
  border-radius: 12px;
  background: rgba(7, 16, 41, 0.65);
  transition: 0.2s ease;
  font-weight: 600;
}

.page-link:hover,
.page-link.active {
  border-color: var(--accent-strong);
  background: rgba(124, 141, 255, 0.2);
  color: var(--text);
  box-shadow: 0 10px 22px rgba(54, 82, 255, 0.25);
}

.page-arrow {
  font-size: 1.2rem;
  line-height: 1;
}

.page-link.is-disabled {
  opacity: 0.4;
  pointer-events: none;
  box-shadow: none;
}

.page-ellipsis {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 2px;
  padding: 0 2px;
}

.api-info h3 {
  margin-top: 0;
}

.api-accordion summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.api-accordion summary::-webkit-details-marker {
  display: none;
}

.api-accordion summary::after {
  content: '▾';
  color: var(--muted);
  font-size: 1.1rem;
  transform: rotate(-90deg);
  transition: transform 0.2s ease;
}

.api-accordion[open] summary::after {
  transform: rotate(0deg);
}

.api-accordion summary h3 {
  margin: 0;
}

.api-tester-card {
  display: grid;
  gap: 10px;
}

.api-tester-card label {
  color: var(--muted);
  font-weight: 600;
}

.api-tester-card textarea {
  min-height: 180px;
  resize: vertical;
}

#apiTesterResponse {
  min-height: 90px;
}

pre {
  white-space: pre-wrap;
  margin: 0;
  background: rgba(10, 16, 32, 0.95);
  border: 1px solid var(--border);
  color: #d3ddff;
  border-radius: 12px;
  padding: 14px;
  line-height: 1.5;
}

.token-cell-pre {
  max-width: 260px;
  max-height: 96px;
  overflow: auto;
  white-space: pre;
  margin: 0;
  padding: 8px 10px;
}

@media (max-width: 700px) {
  .topbar-inner {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .topbar-brand {
    justify-content: center;
  }

  .topbar nav {
    justify-content: flex-start;
  }

  .logout {
    width: 100%;
  }

  table {
    font-size: 0.92rem;
  }
}
.login-card {
  max-width: 480px;
  margin: 80px auto 0;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
}

.login-error {
  margin-top: 12px;
  color: #ff9ca8;
}

.login-help {
  margin-top: 16px;
  color: var(--muted);
  line-height: 1.6;
}

.success-message {
  margin-top: 12px;
  color: var(--success);
}

.users-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.users-header-row h2 {
  margin-bottom: 6px;
}

.users-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-icon-button {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  border: 1px solid rgba(124, 141, 255, 0.45);
  background: linear-gradient(155deg, rgba(124, 141, 255, 0.24), rgba(93, 113, 255, 0.34));
  color: #dfe6ff;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(6, 10, 20, 0.4);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.mini-icon-button svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mini-icon-button:hover {
  transform: translateY(-1px);
  background: linear-gradient(155deg, rgba(124, 141, 255, 0.36), rgba(93, 113, 255, 0.48));
  border-color: rgba(153, 169, 255, 0.65);
}

.gift-txt-upload-button {
  width: auto;
  min-width: 42px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.profile-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inline-icon-form {
  margin: 0;
}

.mini-action-button {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 0.95rem;
}

.badge-only-cell {
  text-align: center;
}

.badge-only-cell .field-presence-badge {
  margin: 0 auto;
}
.field-presence-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.field-presence-badge.is-filled {
  background: rgba(67, 197, 139, 0.2);
  border: 1px solid rgba(67, 197, 139, 0.55);
  color: #87f9ca;
}

.field-presence-badge.is-empty {
  background: rgba(255, 111, 129, 0.17);
  border: 1px solid rgba(255, 111, 129, 0.44);
  color: #ffc8d1;
}

.field-data-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid rgba(137, 180, 255, 0.45);
  color: #d5e5ff;
  background: rgba(137, 180, 255, 0.16);
  white-space: nowrap;
}

.profile-email-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gmail-mini-logo {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex-shrink: 0;
}

.profile-preview-list {
  display: grid;
  gap: 10px;
  font-size: 0.92rem;
  max-height: min(58vh, 520px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 141, 255, 0.75) rgba(10, 18, 36, 0.88);
}

.profile-preview-list::-webkit-scrollbar {
  width: 10px;
}

.profile-preview-list::-webkit-scrollbar-track {
  background: rgba(10, 18, 36, 0.88);
  border-radius: 999px;
}

.profile-preview-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(124, 141, 255, 0.9), rgba(93, 113, 255, 0.86));
  border-radius: 999px;
  border: 2px solid rgba(10, 18, 36, 0.88);
}

.profile-preview-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(141, 156, 255, 0.96), rgba(110, 129, 255, 0.92));
}

.preview-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(96, 124, 255, 0.22);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(9, 16, 34, 0.82), rgba(14, 24, 46, 0.68));
}

.preview-label {
  color: #c3cff6;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 600;
  flex-shrink: 0;
}

.preview-value {
  color: var(--text);
  text-align: right;
  word-break: break-word;
}

.preview-item-token {
  display: grid;
}

.preview-token {
  margin-top: 8px;
  margin-bottom: 0;
  max-width: 100%;
  max-height: 150px;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: pre;
  border-color: rgba(124, 141, 255, 0.35);
  background: rgba(6, 12, 26, 0.94);
}

.mini-action-button.danger {
  border-color: rgba(255, 103, 118, 0.46);
  background: linear-gradient(160deg, rgba(255, 103, 118, 0.3), rgba(200, 54, 69, 0.3));
}

.mini-action-button.danger:hover {
  background: linear-gradient(160deg, rgba(255, 103, 118, 0.45), rgba(200, 54, 69, 0.44));
}

.admin-create-form {
  margin: 18px 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.admin-create-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.admin-create-form input,
.admin-create-form select,
.inline-row-form input,
.inline-row-form select {
  font-size: 0.9rem;
  padding: 8px 10px;
}

.admin-actions {
  display: grid;
  gap: 8px;
}

.admin-modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 15, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 900;
  padding: 16px;
}

.admin-modal.open {
  display: flex;
}

.admin-modal-content {
  width: min(560px, 94vw);
  border: 1px solid rgba(118, 143, 255, 0.34);
  background: linear-gradient(160deg, rgba(8, 16, 34, 0.98), rgba(13, 24, 48, 0.95));
  border-radius: 16px;
  padding: 20px;
  position: relative;
  box-shadow: 0 24px 45px rgba(2, 8, 25, 0.62);
}

.profile-preview-modal-content {
  max-height: min(80vh, 720px);
  overflow-y: hidden;
  overflow-x: hidden;
}

.admin-modal-content h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.modal-description {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ticket-download-fields-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 10px;
}

.ticket-download-fields-row label {
  display: grid;
  gap: 6px;
}

.ticket-download-custom-field.is-hidden {
  display: none;
}

@media (max-width: 640px) {
  .ticket-download-fields-row {
    grid-template-columns: 1fr;
  }
}

.operation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.operation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(96, 124, 255, 0.2);
  border-radius: 10px;
  background: rgba(5, 12, 28, 0.62);
}

.operation-label {
  font-size: 0.82rem;
  color: var(--muted);
  min-width: 92px;
}

.operation-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1;
}

.modal-create-form {
  margin: 0;
}

.inline-row-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.operation-control input,
.operation-control select {
  width: 100%;
  max-width: 230px;
  min-height: 32px;
}

.operation-control.token-control {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.token-input {
  width: 100%;
  max-width: 100%;
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  letter-spacing: 0.01em;
}

.token-input-hint {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.compact-button {
  min-height: 32px;
  padding: 6px 10px;
  white-space: nowrap;
}

.action-button {
  border: 1px solid rgba(124, 141, 255, 0.48);
  background: rgba(124, 141, 255, 0.22);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 12px;
  min-height: 34px;
  cursor: pointer;
}

.action-button:hover {
  background: rgba(124, 141, 255, 0.28);
}

.api-key-cell {
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 0.82rem;
  word-break: break-all;
  max-width: 240px;
}
@media (max-width: 640px) {
  .operation-row {
    flex-direction: column;
    align-items: stretch;
  }

  .operation-label {
    min-width: auto;
  }

  .operation-control {
    width: 100%;
  }

  .operation-control input,
  .operation-control select {
    max-width: none;
  }
}
.extension-upload-form {
  margin-top: 16px;
  display: grid;
  gap: 12px;
  max-width: 640px;
}

.extension-upload-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.extension-download-box {
  margin-top: 18px;
  border: 1px solid rgba(124, 141, 255, 0.35);
  background: rgba(11, 16, 32, 0.55);
  border-radius: 12px;
  padding: 14px;
}

.extension-download-box p {
  margin: 0 0 8px;
}

.gift-image-preview-wrap {
  border: 1px dashed rgba(124, 141, 255, 0.35);
  border-radius: 12px;
  background: rgba(5, 12, 28, 0.55);
  padding: 10px;
  min-height: 140px;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.gift-image-preview-wrap:focus-visible {
  outline: 2px solid rgba(138, 161, 255, 0.9);
  outline-offset: 2px;
}

.gift-image-preview-wrap.drag-over {
  border-color: rgba(138, 161, 255, 0.95);
  background: rgba(20, 34, 72, 0.65);
}

.gift-image-editor-canvas {
  width: min(100%, 320px);
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  border: 1px solid rgba(118, 143, 255, 0.4);
  cursor: grab;
  touch-action: none;
}

.gift-image-editor-canvas:active {
  cursor: grabbing;
}

.gift-rotate-fine-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 1rem;
  z-index: 2;
}

.gift-rotate-fine-button-left {
  left: 14px;
}

.gift-rotate-fine-button-right {
  right: 14px;
}

.gift-rotate-fine-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gift-image-placeholder {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.gift-table-image {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(118, 143, 255, 0.34);
}

.gift-edit-cover-preview {
  margin: 0 0 14px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(108, 131, 255, 0.28);
  background: rgba(5, 11, 24, 0.88);
  display: flex;
  justify-content: center;
}

.gift-edit-cover-preview img {
  width: min(100%, 220px);
  max-height: 220px;
  border-radius: 8px;
  object-fit: contain;
}
.gift-edit-cover-preview {
  position: relative;
  overflow: hidden;
}

.gift-edit-zoom-image {
  transform-origin: center center;
  transition: transform 0.18s ease;
  cursor: zoom-in;
}

.gift-edit-cover-preview:hover .gift-edit-zoom-image,
.gift-edit-cover-preview:focus-within .gift-edit-zoom-image {
  transform: scale(3);
  cursor: zoom-out;
}