* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:root {
  --bg: #0a0a0a;
  --bg-alt: #111;
  --surface: #1a1a1a;
  --surface-2: #222;
  --surface-3: #2a2a2a;
  --border: #333;
  --border-subtle: #272727;
  --text: #f0f0f0;
  --text-main: #e5e5e5;
  --text-muted: #888;
  --text-subtle: #aaa;
  --primary: #ff6f4d;
  --primary-hover: #ff845f;
  --primary-dim: rgba(255, 111, 77, 0.16);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --transition: 150ms ease;
  --sidebar-w: 240px;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  height: 100%;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.5;
}

body {
  position: relative;
  background:
    linear-gradient(rgba(255, 111, 77, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 111, 77, 0.03) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    #141414;
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
  background-position: -8px -6px, -8px -6px, -8px -6px, -8px -6px;
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 111, 77, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(20, 20, 20, 0.08), rgba(20, 20, 20, 0.7));
}

::selection { background: var(--primary-dim); color: var(--primary); }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

.hidden { display: none !important; }
.muted { color: var(--text-muted); }

a { color: var(--primary); cursor: pointer; text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 22px; }
h3 { font-size: 16px; color: var(--text); }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 16px;
}
label.row {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
label.row input[type="checkbox"] { margin: 0; }

input, select, textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  width: 100%;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  accent-color: var(--primary);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-dim);
}
input::placeholder, textarea::placeholder { color: #555; }
input[readonly] { background: var(--surface); cursor: default; }
input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

select { cursor: pointer; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  transition: all var(--transition);
  user-select: none;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: #555; }
.btn:active { transform: scale(0.97); }

.btn.primary {
  background: var(--primary);
  border-color: transparent;
  color: #fff;
}
.btn.primary:hover { background: var(--primary-hover); }
.btn.primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn.danger { color: var(--danger); border-color: rgba(239, 68, 68, 0.3); }
.btn.danger:hover { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.5); }

.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }

.btn.small { padding: 5px 10px; font-size: 12px; border-radius: var(--radius-sm); }
.btn.block { width: 100%; }

.link-btn {
  width: fit-content;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.link-btn:hover { color: var(--primary); }
.auth-link {
  margin: -4px 0 14px auto;
  font-size: 12px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 120;
  display: grid;
  grid-template-columns: 4px 38px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: min(420px, calc(100vw - 32px));
  min-height: 70px;
  overflow: hidden;
  background: linear-gradient(155deg, rgba(34, 38, 43, 0.98), rgba(16, 18, 20, 0.98));
  border: 1px solid var(--border);
  padding: 12px 14px 12px 0;
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255,255,255,0.025) inset;
  font-size: 13px;
  transform: translateY(0);
  animation: toastIn 0.22s ease-out;
}
.toast.hidden {
  display: none;
}
.toast-mark {
  width: 4px;
  height: 100%;
  min-height: 70px;
  background: var(--success);
}
.toast-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--success);
  background: rgba(34, 197, 94, 0.12);
}
.toast-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.toast-body strong {
  color: var(--text);
  font-size: 13px;
}
.toast-body span,
.toast-body small {
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.toast-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--success);
  animation: toastProgress 3.6s linear forwards;
}
.toast.ok { border-color: rgba(34, 197, 94, 0.34); }
.toast.err { border-color: rgba(239, 68, 68, 0.38); }
.toast.warn { border-color: rgba(245, 158, 11, 0.38); }
.toast.info { border-color: rgba(59, 130, 246, 0.38); }
.toast.err .toast-mark,
.toast.err .toast-progress { background: var(--danger); }
.toast.err .toast-icon { color: var(--danger); background: rgba(239, 68, 68, 0.12); }
.toast.warn .toast-mark,
.toast.warn .toast-progress { background: var(--warning); }
.toast.warn .toast-icon { color: var(--warning); background: rgba(245, 158, 11, 0.12); }
.toast.info .toast-mark,
.toast.info .toast-progress { background: #3b82f6; }
.toast.info .toast-icon { color: #60a5fa; background: rgba(59, 130, 246, 0.12); }

.error { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 10px; }

/* Auth Page */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.auth-wrap::before {
  content: "";
  position: absolute;
  width: min(720px, 80vw);
  aspect-ratio: 1;
  top: -28%;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 111, 77, 0.18), rgba(255, 111, 77, 0.055) 34%, transparent 66%);
  filter: blur(2px);
  animation: authSpotlight 8s ease-in-out infinite alternate;
}

.auth-card {
  width: 400px;
  max-width: 100%;
  position: relative;
  background: linear-gradient(165deg, rgba(26, 30, 33, 0.94), rgba(17, 19, 21, 0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(255,255,255,0.03) inset;
  animation: authCardIn 0.42s ease-out both;
}

.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}
.auth-brand .brand-logo {
  display: block;
  width: 84px;
  height: 84px;
  margin: 0 auto 14px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(255, 111, 77, 0.22));
  animation: brandPulse 3.2s ease-in-out infinite;
}
.auth-title { font-size: 24px; font-weight: 750; color: var(--primary); }
.auth-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

body.login-intro-off .auth-wrap::before,
body.login-intro-off .auth-card,
body.login-intro-off .auth-brand .brand-logo {
  animation: none;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  padding: 10px 8px;
  border-radius: calc(var(--radius-md) - 3px);
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
  font-size: 13px;
  line-height: 1;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}
.auth-tab i { font-size: 12px; }
.auth-tab span { overflow: hidden; text-overflow: ellipsis; }
.auth-tab:hover { color: var(--text); }
.auth-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.divider {
  text-align: center;
  color: #555;
  font-size: 12px;
  margin: 20px 0;
  position: relative;
}
.divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}
.divider span { background: var(--surface); padding: 0 14px; position: relative; }

.devcode {
  background: var(--primary-dim);
  border: 1px dashed rgba(255, 111, 77, 0.3);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 16px;
  font-size: 12px;
  font-family: "SF Mono", Consolas, monospace;
}

/* Sidebar Layout */
#app-view {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 30;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.sidebar-logo {
  display: block;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  object-fit: contain;
}

.sidebar-nav {
  flex: 1;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.nav-item i { width: 18px; text-align: center; font-size: 15px; }
.nav-item:hover { color: var(--text); background: var(--surface-2); }
.nav-item.active { color: var(--primary); background: rgba(255, 111, 77, 0.14); }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.sidebar-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-user-info {
  min-width: 0;
}
.sidebar-username { font-size: 12px; font-weight: 500; color: var(--text); }
.sidebar-role { font-size: 11px; color: var(--text-muted); }

.logout-btn {
  flex-shrink: 0;
  color: var(--text-muted);
  border-color: transparent;
}
.logout-btn:hover { color: var(--danger); background: rgba(239, 68, 68, 0.1); border-color: transparent; }

/* Main content area */
.app-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px 0;
}
.app-header h2 { font-size: 22px; font-weight: 600; color: var(--text); }

.main {
  flex: 1;
  padding: 20px 32px 80px;
  max-width: 1200px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.stat .ic { font-size: 18px; margin-bottom: 8px; color: var(--text-muted); }
.stat .num { font-size: 28px; font-weight: 600; color: var(--text); line-height: 1.2; }
.stat .lbl { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card + .card { margin-top: 16px; }

.card h3 {
  margin-bottom: 16px;
  font-size: 15px;
  color: var(--text);
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* Grid helpers */
.grid { display: grid; gap: 12px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }

.row { display: flex; gap: 10px; align-items: center; }
.spread { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt { margin-top: 20px; }
.gap { gap: 10px; }

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface-2);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 111, 77, 0.045); }

.mono { font-family: "SF Mono", "Cascadia Code", Consolas, monospace; font-size: 12px; }

/* Badge */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid transparent;
}
.badge.active, .badge.live { color: var(--success); border-color: rgba(34, 197, 94, 0.3); background: rgba(34, 197, 94, 0.08); }
.badge.banned, .badge.paused { color: var(--danger); border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.08); }
.badge.expired { color: var(--warning); border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.08); }
.badge.unused { color: #888; border-color: rgba(136, 136, 136, 0.3); background: rgba(136, 136, 136, 0.08); }
.badge.role { color: var(--primary); border-color: rgba(255, 111, 77, 0.3); background: var(--primary-dim); }

.role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 42px;
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.role-badge.admin {
  color: #ff8a66;
  border-color: rgba(255, 111, 77, 0.38);
  background: rgba(255, 111, 77, 0.14);
}

.role-badge.dev {
  color: #54d6a0;
  border-color: rgba(76, 195, 138, 0.34);
  background: rgba(76, 195, 138, 0.12);
}

.role-badge.user {
  color: #8fb9ff;
  border-color: rgba(143, 185, 255, 0.34);
  background: rgba(143, 185, 255, 0.12);
}

.mt-mini { margin-top: 6px; }

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab {
  padding: 10px 18px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13px;
  margin-bottom: -1px;
  transition: all var(--transition);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: grid;
  place-items: center;
  z-index: 200;
  animation: fadeIn 0.15s ease-out;
}
.modal {
  width: 480px;
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
}
.modal.modal-wide {
  width: min(760px, 94vw);
}
.modal .actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.modal h3 { margin-bottom: 16px; }

.verify-modal {
  display: grid;
  gap: 16px;
  min-width: min(440px, calc(100vw - 56px));
}
.verify-hero {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.verify-hero h3 { margin-bottom: 4px; }
.verify-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--primary);
  background: var(--primary-dim);
  border: 1px solid rgba(255, 111, 77, 0.28);
}
.code-input {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 8px;
}
.verify-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -6px;
}
.verify-tools .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.field { margin-bottom: 16px; }
.small-text { font-size: 11px; margin-top: 4px; }

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.modal-head h3 {
  margin-bottom: 6px;
}

.modern-form label {
  margin-bottom: 0;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.option-grid.two {
  margin-top: 12px;
}

.field-group {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: #121619;
}

.field-title {
  margin-bottom: 12px;
  color: var(--text);
  font-weight: 650;
}

.preset-grid,
.choice-grid {
  display: grid;
  gap: 10px;
}

.preset-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.preset,
.choice-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #101315;
  color: var(--text-main);
}

.preset {
  min-height: 38px;
  cursor: pointer;
  font: inherit;
}

.preset.active,
.choice-card:has(input:checked) {
  border-color: rgba(255, 111, 77, 0.45);
  background: rgba(255, 111, 77, 0.12);
  color: #fff;
}

.choice-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  padding: 12px;
  cursor: pointer;
}

.choice-card input {
  width: auto;
  min-height: auto;
  margin-top: 3px;
}

.choice-card span {
  color: var(--text);
  font-weight: 650;
}

.choice-card small {
  grid-column: 2;
  color: var(--text-muted);
  line-height: 1.45;
}

.inline-field {
  margin-top: 12px;
}

.config-summary {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 111, 77, 0.25);
  border-radius: 8px;
  background: rgba(255, 111, 77, 0.08);
  color: var(--text-main);
}

.result-box {
  max-height: 320px;
  overflow: auto;
}

.code-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 12px;
  line-height: 1.5;
  max-height: 300px;
  overflow: auto;
}

/* Checkbox */
input[type="checkbox"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid #555;
  border-radius: 4px;
  background: var(--surface-2);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  padding: 0;
  transition: all var(--transition);
}
input[type="checkbox"]:hover { border-color: var(--primary); }
input[type="checkbox"]:checked { background: var(--primary); border-color: var(--primary); }
input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

/* Progress bar */
.progress {
  height: 4px;
  background: var(--surface-3);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #ffb347);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Divider */
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }

/* Info rows */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}
.info-row:last-child { border-bottom: 0; }
.info-row .label { color: var(--text-muted); }
.info-row .value { color: var(--text); font-weight: 500; }

/* Key preview */
.key-preview {
  font-family: "SF Mono", Consolas, monospace;
  font-size: 12px;
  color: var(--text-muted);
}

/* Copy button inline */
.copy-btn {
  background: none;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.copy-btn:hover { color: var(--primary); background: var(--primary-dim); }

/* SDK integration */
.sdk-lang-select {
  min-width: 180px;
}

/* Animations */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(18px, 10px) scale(0.98); }
  to { opacity: 1; transform: translate(0, 0) scale(1); }
}
@keyframes toastProgress {
  from { transform: scaleX(1); transform-origin: left; }
  to { transform: scaleX(0); transform-origin: left; }
}
@keyframes authCardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes authSpotlight {
  from { opacity: 0.55; transform: translateX(-50%) translateY(0) scale(0.96); }
  to { opacity: 0.95; transform: translateX(-50%) translateY(18px) scale(1.04); }
}
@keyframes brandPulse {
  0%, 100% { transform: translateY(0); filter: drop-shadow(0 10px 18px rgba(255, 111, 77, 0.22)); }
  50% { transform: translateY(-3px); filter: drop-shadow(0 16px 26px rgba(255, 111, 77, 0.34)); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.stat { animation: fadeUp 0.3s ease-out; }
.stat:nth-child(2) { animation-delay: 0.05s; }
.stat:nth-child(3) { animation-delay: 0.1s; }
.stat:nth-child(4) { animation-delay: 0.15s; }

/* Responsive */
@media (max-width: 900px) {
  .sidebar { width: 56px; }
  .sidebar-brand span:last-child,
  .sidebar-name,
  .sidebar-user-info,
  .nav-item span { display: none; }
  .sidebar-nav .nav-item { justify-content: center; padding: 10px; }
  .sidebar-nav .nav-item i { margin: 0; }
  .app-main { margin-left: 56px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .cols-4, .cols-3 { grid-template-columns: 1fr 1fr; }
  .main { padding: 16px; }
  .app-header { padding: 16px 16px 0; }
}
@media (max-width: 540px) {
  .sidebar { width: 0; overflow: hidden; border: 0; }
  .app-main { margin-left: 0; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .cols-2 { grid-template-columns: 1fr; }
}

/* Professional operations UI refresh */
:root {
  --bg: #0d0f10;
  --bg-alt: #111416;
  --surface: #16191b;
  --surface-2: #1e2225;
  --surface-3: #272d31;
  --border: #2d3338;
  --border-subtle: #23282c;
  --text: #f4f6f7;
  --text-main: #dce2e6;
  --text-muted: #8d99a3;
  --text-subtle: #b5c0c8;
  --primary: #ff6f4d;
  --primary-hover: #ff845f;
  --primary-dim: rgba(255, 111, 77, 0.16);
  --success: #4cc38a;
  --warning: #d89b38;
  --danger: #e45f5f;
  --radius-sm: 5px;
  --radius-md: 7px;
  --radius-lg: 8px;
  --radius-xl: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.28);
}

body[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --surface-3: #e4e8ec;
  --border: #cfd6dd;
  --border-subtle: #dde3e8;
  --text: #161a1d;
  --text-main: #232a30;
  --text-muted: #64707b;
  --text-subtle: #3d4852;
  --primary-dim: rgba(255, 111, 77, 0.14);
  --shadow-md: 0 14px 30px rgba(25, 32, 38, 0.12);
}

body {
  background:
    linear-gradient(rgba(255, 111, 77, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 111, 77, 0.03) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    #141414;
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
  background-position: -8px -6px, -8px -6px, -8px -6px, -8px -6px;
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 111, 77, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(20, 20, 20, 0.08), rgba(20, 20, 20, 0.7));
  opacity: 1;
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

#modal-root {
  position: relative;
  z-index: 200;
}

.global-controls {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 160;
  display: flex;
  align-items: center;
  gap: 8px;
}

body.app-mode .global-controls {
  top: auto;
  right: auto;
  left: 18px;
  bottom: 96px;
  width: auto;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: rgba(18, 21, 23, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(14px);
}

body.app-mode .global-controls .control-btn {
  display: none;
}

body.app-mode .global-controls .custom-select {
  flex: 0 0 118px;
  width: 118px;
  min-width: 118px;
}

body.app-mode .global-controls .custom-select-menu {
  inset: auto 0 calc(100% + 8px) 0;
}

.control-btn,
.control-select {
  width: auto;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(22, 25, 27, 0.86);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.control-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  cursor: pointer;
}

.control-select {
  padding: 0 10px;
}

body[data-theme="light"] .control-btn,
body[data-theme="light"] .control-select {
  background: rgba(255, 255, 255, 0.9);
}

body[data-theme="light"].app-mode .global-controls {
  background: rgba(255, 255, 255, 0.86);
  border-color: var(--border);
}

h1, h2, h3, h4 {
  letter-spacing: 0;
}

h2 {
  font-size: 24px;
  font-weight: 650;
}

.auth-wrap {
  background:
    linear-gradient(180deg, rgba(255, 125, 82, 0.05), transparent 42%),
    var(--bg);
}

.auth-card {
  width: 430px;
  padding: 34px;
  background: #171a1d;
  border-color: #31383f;
  box-shadow: var(--shadow-md);
}

.auth-brand .brand-logo,
.sidebar-logo {
  background: transparent;
  border-radius: 0;
}

.auth-brand .brand-logo {
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
}

.sidebar-logo {
  width: 58px;
  height: 58px;
  margin: 0;
}

.auth-title {
  font-size: 24px;
  color: #ff7c57;
  letter-spacing: 0;
}

.auth-sub {
  color: var(--text-muted);
}

.auth-tabs {
  padding: 4px;
  gap: 4px;
  background: #14181b;
  border-radius: 8px;
}

.auth-tab {
  min-height: 42px;
  padding: 0 10px;
  border-radius: 6px;
}

.auth-tab.active {
  background: #24292d;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 111, 77, 0.12);
}

input, select, textarea {
  min-height: 38px;
  background: #111416;
  border-color: #30373d;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.btn {
  min-height: 36px;
  border-color: #323a40;
  background: #20252a;
}

.btn.primary {
  background: var(--primary);
  box-shadow: 0 10px 24px rgba(255, 111, 77, 0.22);
}

.btn.danger {
  background: rgba(228, 95, 95, 0.08);
}

.sidebar {
  background: #121517;
  border-right-color: #252b30;
}

.sidebar-brand {
  min-height: 104px;
  padding: 22px 20px;
}

.sidebar-name {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: 0;
}

.sidebar-nav {
  padding: 12px 10px;
}

.nav-item {
  min-height: 40px;
  border-radius: 7px;
  color: #a6b0b8;
}

.nav-item.active {
  color: #fff;
  background: rgba(255, 111, 77, 0.12);
  box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-footer {
  min-height: 70px;
}

.sidebar-avatar {
  background: #26313d;
  border: 1px solid #344252;
}

.app-main {
  background: var(--bg);
}

.app-header {
  padding: 24px 36px 0;
}

.main {
  width: 100%;
  max-width: 1440px;
  padding: 26px 36px 88px;
}

.page-head {
  min-height: 44px;
  margin-bottom: 22px;
}

.grid {
  gap: 14px;
}

.card {
  border-radius: 8px;
  border-color: #2c3338;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(255,255,255,0.025);
}

.stat {
  min-height: 126px;
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-areas:
    "icon num"
    "icon label";
  align-items: center;
  column-gap: 14px;
  padding: 18px;
}

.stat .ic {
  grid-area: icon;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 111, 77, 0.15);
  color: var(--primary);
  font-size: 16px;
  margin: 0;
}

.stat.good .ic {
  background: rgba(76, 195, 138, 0.12);
  color: var(--success);
}

.stat.warn .ic {
  background: rgba(216, 155, 56, 0.14);
  color: var(--warning);
}

.stat.bad .ic {
  background: rgba(228, 95, 95, 0.13);
  color: var(--danger);
}

.stat .num {
  grid-area: num;
  font-size: 30px;
  line-height: 1;
}

.stat .lbl {
  grid-area: label;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
}

.table-wrap {
  border-color: var(--border-subtle);
  background: #111416;
}

table {
  min-width: 760px;
}

th {
  background: #1a1f22;
  color: #98a4ad;
  letter-spacing: 0.04em;
}

td {
  color: var(--text-main);
}

tbody tr:hover {
  background: rgba(255, 111, 77, 0.045);
}

.badge {
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
}

.tabs {
  gap: 6px;
  border-bottom: 0;
  background: #111416;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 5px;
}

.tab {
  border: 0;
  margin: 0;
  border-radius: 6px;
}

.tab.active {
  background: var(--surface-3);
  color: var(--primary);
}

.modal-backdrop {
  background: rgba(2, 4, 6, 0.78);
}

.modal {
  border-color: #394047;
}

.code-box {
  background: #0f1214;
  border-color: #2e363c;
}

.sdk-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 111, 77, 0.12), transparent 34%),
    #14181b;
}

.sdk-hero h3 {
  font-size: 22px;
  margin: 4px 0 6px;
}

.eyebrow {
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sdk-count {
  min-width: 92px;
  min-height: 76px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 111, 77, 0.24);
  border-radius: 8px;
  color: #fff;
  font-size: 34px;
  font-weight: 750;
  background: rgba(255, 111, 77, 0.12);
}

.sdk-count span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.sdk-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.sdk-info-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 10px;
  align-items: center;
  padding: 16px;
}

.sdk-info-card span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sdk-info-card code {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--text);
  font-family: "SF Mono", Consolas, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sdk-info-card .btn {
  grid-row: 1;
  grid-column: 2;
  width: 34px;
  padding: 0;
}

.credentials-card {
  padding: 24px;
}

.keyauth-card {
  padding: 24px;
  border-color: rgba(255, 111, 77, 0.32);
  background:
    linear-gradient(135deg, rgba(255, 111, 77, 0.09), transparent 38%),
    var(--surface);
}

.keyauth-values {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.keyauth-snippet {
  margin: 16px 0 0;
  max-height: 360px;
}

.credentials-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.credentials-head h3 {
  font-size: 20px;
  margin: 0 0 6px;
}

.snippet-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
}

.snippet-toggle input {
  width: auto;
  min-height: auto;
}

.credentials-list {
  display: grid;
  gap: 10px;
}

.credential-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 74px;
  padding: 14px 14px 14px 18px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
    #121619;
  box-shadow: inset 3px 0 0 rgba(255, 111, 77, 0.36);
}

.credential-row span {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
}

.credential-row code {
  display: block;
  max-width: 100%;
  overflow: auto hidden;
  color: var(--text);
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}

.credential-row .btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
}

.credential-snippet {
  margin: 14px 0 0;
}

.sdk-workbench {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #101315;
}

.sdk-language-panel {
  padding: 16px;
  border-right: 1px solid var(--border-subtle);
  background: #121619;
}

.sdk-panel-title {
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sdk-lang-grid {
  display: grid;
  gap: 8px;
}

.sdk-lang {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.sdk-lang:hover {
  background: rgba(255, 255, 255, 0.035);
}

.sdk-lang.active {
  border-color: rgba(255, 111, 77, 0.35);
  background: rgba(255, 111, 77, 0.12);
  color: #fff;
}

.sdk-lang small {
  color: var(--text-muted);
  font-family: "SF Mono", Consolas, monospace;
  font-size: 11px;
}

.sdk-code-panel {
  min-width: 0;
  padding: 16px;
}

.sdk-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.sdk-toolbar h3 {
  margin-bottom: 3px;
}

.sdk-code {
  min-height: 470px;
  max-height: 560px;
  margin: 0;
  overflow: auto;
}

.sdk-guide {
  margin-top: 14px;
}

.sdk-guide h4 {
  margin: 0 0 8px;
}

.sdk-guide .code-box {
  margin: 0;
}

.sdk-note .code-box {
  margin: 12px 0 0;
}

.sdk-simple {
  display: grid;
  gap: 14px;
}

.sdk-simple-hero {
  margin-bottom: 0;
}

.sdk-language-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  overflow: visible;
  padding: 4px 0 8px;
}

.sdk-lang-pill {
  display: grid;
  gap: 2px;
  width: 100%;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-main);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.sdk-lang-pill:hover {
  border-color: rgba(255, 111, 77, 0.36);
  background: rgba(255, 111, 77, 0.06);
}

.sdk-lang-pill.active {
  border-color: rgba(255, 111, 77, 0.58);
  background:
    linear-gradient(135deg, rgba(255, 111, 77, 0.2), rgba(255, 111, 77, 0.06)),
    #15181b;
  box-shadow: inset 3px 0 0 var(--primary);
  color: #fff;
}

.sdk-lang-pill span {
  font-weight: 800;
}

.sdk-lang-pill small {
  color: var(--text-muted);
  font-family: "SF Mono", Consolas, monospace;
  font-size: 11px;
}

.sdk-simple-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  align-items: stretch;
}

.sdk-connect-card,
.sdk-main-code-card {
  padding: 20px;
}

.credentials-head.compact {
  margin-bottom: 14px;
}

.credential-row.compact {
  min-height: 58px;
  padding: 11px 12px 11px 15px;
  border-radius: 12px;
}

.credential-row.compact span {
  margin-bottom: 4px;
}

.credential-row.compact code {
  font-size: 12px;
  font-weight: 700;
}

.sdk-starter-code {
  min-height: 420px;
  max-height: 520px;
  margin: 0;
  overflow: auto;
}

.sdk-full-toolbar {
  margin: 0 20px 14px;
}

.sdk-keyauth-lite .sdk-map-grid,
.sdk-source-fold .sdk-full-toolbar,
.sdk-source-fold .sdk-code,
.sdk-rest-card .rest-grid,
.sdk-rest-card > p {
  margin-left: 20px;
  margin-right: 20px;
}

.sdk-source-fold .sdk-code {
  margin-bottom: 20px;
}

.sdk-rest-card > .code-box {
  margin-left: 20px;
  margin-right: 20px;
  margin-bottom: 20px;
}

.section-head {
  margin-bottom: 4px;
}

.section-head h3 {
  margin: 0 0 6px;
}

.field-help {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 450;
  line-height: 1.45;
}

.settings-switches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-switches label {
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  margin: 0;
}

.switch-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.switch-card input {
  width: auto;
  min-height: auto;
  margin-top: 3px;
}

.switch-card strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 5px;
}

.switch-card small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.config-help {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.config-help h3 {
  margin: 0 0 6px;
}

.config-scope-grid {
  display: grid;
  gap: 8px;
}

.config-scope-grid div {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
  font-size: 12px;
}

.config-scope-grid i {
  color: var(--primary);
}

.advanced-signing {
  padding: 0;
  overflow: hidden;
}

.advanced-signing summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}

.advanced-signing summary::-webkit-details-marker {
  display: none;
}

.advanced-signing summary h3 {
  margin: 0 0 4px;
}

.advanced-signing > p,
.advanced-signing > pre {
  margin-left: 20px;
  margin-right: 20px;
}

.advanced-signing > pre {
  margin-bottom: 20px;
}

.advanced-chevron {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-muted);
  transition: transform var(--transition), color var(--transition), border-color var(--transition);
}

.advanced-signing[open] .advanced-chevron {
  color: var(--primary);
  border-color: rgba(255, 111, 77, 0.38);
  transform: rotate(180deg);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.settings-wide {
  grid-column: 1 / -1;
}

.settings-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.settings-title h3 {
  margin-bottom: 4px;
}

.profile-row {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  flex: 0 0 64px;
  border: 1px solid rgba(255, 111, 77, 0.3);
  border-radius: 8px;
  background: rgba(255, 111, 77, 0.12);
  color: #fff;
  font-size: 24px;
  font-weight: 750;
}

.profile-meta {
  display: grid;
  gap: 3px;
}

.profile-meta span {
  color: var(--text-muted);
}

.verify-grid {
  display: grid;
  gap: 14px;
}

.verify-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: #121619;
}

.verify-item p {
  margin: 4px 0 0;
}

.mail-card {
  gap: 16px;
}
.mail-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.mail-provider {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.018);
}
.mail-provider span,
.mail-provider small {
  color: var(--text-muted);
}
.mail-provider strong {
  color: var(--text);
  overflow-wrap: anywhere;
}
.mail-test-row {
  align-items: stretch;
}
.mail-test-row .btn {
  min-width: 150px;
}
.mail-log-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}
.mail-log {
  display: grid;
  grid-template-columns: 76px 118px 72px minmax(140px, 1fr) minmax(120px, 1.2fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.018);
}
.mail-log strong,
.mail-log span,
.mail-log small,
.mail-log em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-log small,
.mail-log em {
  color: var(--text-muted);
  font-style: normal;
}

.connector-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.connector-card {
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: #121619;
}

.connector-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 8px;
  background: rgba(255, 111, 77, 0.14);
  color: var(--primary);
}

.connector-card h4 {
  margin: 0 0 12px;
}

.connector-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.connector-panel {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.connector-events {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.connector-events div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(10, 13, 15, 0.58);
}

.connector-events b {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--text);
}

.connector-events i {
  color: var(--primary);
}

.connector-events small {
  display: block;
  color: var(--text-muted);
  line-height: 1.45;
}

.connector-preview {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-alt);
}

.connector-preview-card {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 107, 69, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 107, 69, 0.12), rgba(255, 107, 69, 0.02)),
    rgba(7, 10, 12, 0.78);
}

.connector-preview-card span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.connector-preview-card small {
  color: var(--text-muted);
}

.connector-preview-card code {
  width: fit-content;
  margin-top: 4px;
  padding: 6px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text);
  background: #080b0d;
}

.connector-results {
  margin-top: 12px;
}

.connector-result-list {
  display: grid;
  gap: 8px;
}

.connector-result-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.connector-result-list .ok {
  border-color: rgba(34, 197, 94, 0.32);
}

.connector-result-list .bad {
  border-color: rgba(239, 68, 68, 0.32);
}

.connector-result-list strong {
  color: var(--text);
  text-transform: uppercase;
}

.connector-result-list span {
  color: var(--text-muted);
  text-align: right;
}

.bot-command-center {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 111, 77, 0.22);
  border-radius: 10px;
  background:
    radial-gradient(circle at 82% 0%, rgba(255, 111, 77, 0.14), transparent 34%),
    linear-gradient(135deg, rgba(255, 111, 77, 0.06), rgba(15, 18, 20, 0.92));
}

.bot-command-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.bot-command-head h3 {
  margin-bottom: 5px;
}

.bot-assets {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 12px;
  margin-bottom: 14px;
}

.bot-asset-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: rgba(8, 10, 11, 0.56);
}

.bot-asset-card.wide {
  grid-template-columns: 142px minmax(0, 1fr);
}

.bot-asset-card img {
  width: 74px;
  height: 74px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(255, 111, 77, 0.24);
  background: rgba(0, 0, 0, 0.35);
}

.bot-asset-card.wide img {
  width: 142px;
  height: 80px;
  border-radius: 10px;
}

.bot-asset-card b {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.bot-asset-card small {
  display: block;
  margin-bottom: 10px;
  color: var(--text-muted);
  line-height: 1.45;
}

.mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bot-command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bot-command {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(13, 16, 18, 0.72);
}

.bot-command code {
  color: #fff;
  font-size: 12px;
}

.bot-command span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.notify-row {
  margin: 16px 0 0;
}

.empty-state {
  padding: 28px;
  border: 1px dashed #343c43;
  border-radius: 8px;
  background: #121618;
  text-align: center;
}

.empty-title {
  color: var(--text);
  font-weight: 650;
}

.empty-detail {
  color: var(--text-muted);
  margin-top: 6px;
}

body[data-theme="light"]::before {
  background-image:
    linear-gradient(rgba(255, 111, 77, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 111, 77, 0.09) 1px, transparent 1px),
    linear-gradient(rgba(20, 26, 31, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 26, 31, 0.05) 1px, transparent 1px);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.14));
}

body[data-theme="light"] .auth-card,
body[data-theme="light"] .sidebar,
body[data-theme="light"] .card,
body[data-theme="light"] .modal,
body[data-theme="light"] .table-wrap,
body[data-theme="light"] .tabs,
body[data-theme="light"] .field-group,
body[data-theme="light"] .verify-item,
body[data-theme="light"] .connector-card,
body[data-theme="light"] .credential-row,
body[data-theme="light"] .empty-state {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

body[data-theme="light"] input,
body[data-theme="light"] select,
body[data-theme="light"] textarea {
  background: #ffffff;
  color: var(--text);
  border-color: var(--border);
}

body[data-theme="light"] th,
body[data-theme="light"] .table-wrap,
body[data-theme="light"] .tabs,
body[data-theme="light"] .connector-preview {
  background: var(--surface-2);
}

body[data-theme="light"] tbody tr:hover,
body[data-theme="light"] .nav-item:hover {
  background: rgba(255, 111, 77, 0.09);
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

select:hover {
  border-color: rgba(255, 111, 77, 0.38);
}

select option {
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
}

select option:checked,
select option:hover {
  background: var(--surface-3);
  color: var(--text);
}

.native-select-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.custom-select {
  position: relative;
  width: 100%;
  min-width: 150px;
}

.custom-select-trigger {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px 0 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    #171c20;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.custom-select-trigger i {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 11px;
  transition: transform var(--transition), color var(--transition);
}

.custom-select-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select.open .custom-select-trigger,
.custom-select-trigger:hover {
  border-color: rgba(255, 111, 77, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 111, 77, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.custom-select.open .custom-select-trigger i {
  color: var(--primary);
  transform: rotate(180deg);
}

.custom-select-menu {
  position: absolute;
  inset: calc(100% + 8px) 0 auto 0;
  z-index: 180;
  display: none;
  max-height: 250px;
  overflow: auto;
  padding: 7px;
  border: 1px solid rgba(255, 111, 77, 0.22);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 111, 77, 0.055), transparent),
    #12171a;
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.42);
}

.custom-select.open .custom-select-menu {
  display: grid;
  gap: 3px;
}

.custom-select-option {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
}

.custom-select-option:hover {
  background: rgba(255, 111, 77, 0.1);
  color: #fff;
}

.custom-select-option.active {
  background: rgba(255, 111, 77, 0.18);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--primary);
}

.global-controls .custom-select {
  width: 92px;
  min-width: 92px;
}

.global-controls .custom-select-trigger {
  min-height: 36px;
  border-radius: 10px;
  padding: 0 10px;
}

body[data-theme="light"] .custom-select-trigger {
  background: #ffffff;
  color: var(--text);
}

body[data-theme="light"] .custom-select-menu {
  background: #ffffff;
  border-color: rgba(255, 111, 77, 0.28);
  box-shadow: 0 20px 42px rgba(25, 32, 38, 0.18);
}

body[data-theme="light"] .custom-select-option:hover,
body[data-theme="light"] .custom-select-option.active {
  color: var(--text);
}

.badge {
  text-transform: none;
  letter-spacing: 0;
}

th,
.stat .lbl,
.eyebrow,
.sdk-panel-title,
.sdk-count span,
.sdk-info-card span {
  text-transform: none;
  letter-spacing: 0;
}

@media (max-width: 900px) {
  .main {
    padding: 18px 18px 72px;
  }

  .cols-2,
  .cols-3,
  .cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sdk-info-grid,
  .sdk-workbench,
  .keyauth-values,
  .settings-grid,
  .connector-grid,
  .connector-events,
  .bot-assets,
  .bot-command-grid {
    grid-template-columns: 1fr;
  }

  .bot-command-head {
    display: grid;
  }

  .bot-asset-card,
  .bot-asset-card.wide {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .bot-asset-card.wide img {
    width: 72px;
    height: 72px;
  }

  .option-grid,
  .choice-grid {
    grid-template-columns: 1fr;
  }

  .sdk-language-panel {
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  .sdk-lang-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat {
    min-height: 112px;
  }
}

@media (max-width: 540px) {
  .sidebar {
    width: 56px;
    overflow: visible;
    border-right: 1px solid var(--border);
  }

  .app-main {
    margin-left: 56px;
  }

  .cols-2,
  .cols-3,
  .cols-4 {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 24px;
  }

  .sdk-hero,
  .sdk-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .sdk-info-grid,
  .sdk-lang-grid {
    grid-template-columns: 1fr;
  }

  .settings-switches {
    grid-template-columns: 1fr;
  }

  .config-help {
    grid-template-columns: 1fr;
  }

  .preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-head,
  .row.spread {
    align-items: flex-start;
    flex-direction: column;
  }

  .row.gap.wrap {
    width: 100%;
  }

  .row.gap.wrap > * {
    width: 100%;
  }
}

/* Final UI hardening: native checks and stronger brand mark */
input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: auto !important;
  -moz-appearance: auto !important;
  appearance: auto !important;
  accent-color: var(--primary);
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  padding: 0 !important;
  margin: 0;
  border: 0 !important;
  border-radius: initial;
  background: transparent !important;
  box-shadow: none;
  flex: 0 0 auto;
  cursor: pointer;
  vertical-align: middle;
}

input[type="checkbox"]::after,
input[type="radio"]::after {
  content: none !important;
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.choice-card input,
.switch-card input,
label.row input[type="checkbox"],
label.row input[type="radio"] {
  margin-top: 3px;
}

.auth-brand .brand-logo {
  width: 128px;
  height: 128px;
  margin-bottom: 18px;
}

.sidebar-brand {
  min-height: 132px;
  padding: 24px 20px;
}

.sidebar-logo {
  width: 78px;
  height: 78px;
  flex-basis: 78px;
}

.sidebar-name {
  font-size: 20px;
}

@media (max-width: 900px) {
  .sidebar-brand {
    min-height: 76px;
    padding: 16px 10px;
  }

  .sidebar-logo {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }
}

/* Final interface polish */
.auth-wrap {
  grid-template-columns: minmax(320px, 1fr) minmax(380px, 460px);
  gap: clamp(36px, 7vw, 110px);
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 5vw, 72px);
}

.auth-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 111, 77, 0.42) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(143, 185, 255, 0.22) 0 1px, transparent 2px);
  background-size: 190px 190px, 130px 130px;
  background-position: 18px 30px, 80px 20px;
  opacity: 0.38;
  animation: introStars 14s linear infinite;
}

.auth-hero,
.auth-card {
  position: relative;
  z-index: 1;
}

.auth-hero {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 18px;
  max-width: 620px;
}

.auth-hero-logo {
  width: 138px;
  height: 138px;
  object-fit: contain;
  filter: drop-shadow(0 24px 46px rgba(255, 111, 77, 0.28));
  animation: brandPulse 3.2s ease-in-out infinite;
}

.auth-hero h1 {
  font-size: clamp(34px, 4vw, 58px);
  line-height: 1;
  font-weight: 850;
  color: #fff;
}

.auth-hero p {
  max-width: 560px;
  margin: 0;
  color: var(--text-subtle);
  font-size: 17px;
  line-height: 1.55;
}

.auth-feature-row,
.auth-metric-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.auth-feature-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(18, 21, 23, 0.66);
  color: var(--text);
  font-weight: 750;
}

.auth-feature-row i {
  color: var(--primary);
}

.auth-metric-row {
  margin-top: 28px;
  gap: clamp(24px, 4vw, 58px);
}

.auth-metric-row div {
  display: grid;
  gap: 6px;
}

.auth-metric-row strong {
  font-size: 32px;
  line-height: 1;
  color: #fff;
}

.auth-metric-row small {
  color: var(--text-muted);
}

.auth-card {
  width: min(460px, 100%);
}

body.login-intro-off .auth-wrap::after,
body.login-intro-off .auth-hero-logo {
  animation: none;
}

.sidebar {
  background: rgba(18, 21, 23, 0.96);
}

.sidebar-footer {
  padding: 14px 14px max(14px, env(safe-area-inset-bottom));
  background: rgba(18, 21, 23, 0.98);
}

.main {
  max-width: none;
  width: 100%;
  padding: 44px 38px 96px;
}

.page-head {
  min-height: 54px;
}

.card {
  border-radius: 10px;
}

.table-wrap {
  overflow: auto;
}

.admin-users-table {
  width: 100%;
  min-width: 1060px;
  table-layout: fixed;
}

.admin-users-table th,
.admin-users-table td {
  padding: 14px 16px;
  vertical-align: middle;
}

.admin-users-table tbody tr {
  min-height: 76px;
}

.admin-users-table th:first-child,
.admin-users-table td:first-child {
  width: 120px;
}

.admin-users-table th:nth-child(2),
.admin-users-table td:nth-child(2) {
  width: 180px;
}

.admin-users-table th:last-child,
.admin-users-table td:last-child {
  width: 220px;
}

.role-cell {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.role-choice-group {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  min-width: 148px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #12171a;
}

.role-choice {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.role-choice:hover {
  color: #fff;
  background: rgba(255, 111, 77, 0.1);
}

.role-choice.active {
  color: #fff;
  background: rgba(255, 111, 77, 0.24);
  box-shadow: inset 0 0 0 1px rgba(255, 111, 77, 0.38);
}

.toast {
  top: 22px;
  right: 22px;
  bottom: auto;
  border-radius: 12px;
  min-height: 76px;
}

.toast-mark {
  min-height: 76px;
}

.toast-body strong {
  font-size: 14px;
}

.toast-body span {
  color: var(--text-main);
}

@keyframes introStars {
  from { background-position: 18px 30px, 80px 20px; }
  to { background-position: 208px 220px, 210px 150px; }
}

@media (max-width: 1100px) {
  .auth-wrap {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    display: none;
  }

  .table-wrap {
    overflow-x: auto;
  }
}

@media (max-height: 760px) {
  .sidebar-brand {
    min-height: 78px;
    padding: 14px 16px;
  }

  .sidebar-logo {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .sidebar-name {
    font-size: 17px;
  }

  .nav-item {
    min-height: 38px;
    padding: 9px 12px;
  }

  body.app-mode .global-controls {
    bottom: 82px;
    padding: 8px;
  }

  .sidebar-footer {
    padding-top: 10px;
    padding-bottom: 10px;
  }
}

/* Compact production toast */
.toast {
  top: 18px;
  right: 18px;
  bottom: auto;
  grid-template-columns: 3px 30px minmax(0, 1fr);
  gap: 10px;
  width: min(340px, calc(100vw - 28px));
  min-height: 54px;
  padding: 9px 12px 9px 0;
  border-radius: 12px;
}

.toast-mark {
  width: 3px;
  min-height: 54px;
}

.toast-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.toast-body {
  gap: 0;
}

.toast-body strong {
  font-size: 12px;
}

.toast-body span {
  font-size: 12px;
  color: var(--text-main);
}

.toast-body small {
  display: none;
}

.toast-progress {
  height: 2px;
}

.admin-users-table td:last-child .row,
.admin-users-table .row.gap {
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 8px;
}

.settings-page-head {
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 22px;
}

.settings-page-head p {
  margin: 0;
  max-width: 780px;
}

.settings-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.settings-metric {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(20, 24, 27, 0.82);
}

.settings-metric span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.settings-metric strong {
  color: var(--text-main);
  font-size: 18px;
}

.admin-avatar {
  color: #ff805f;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 128, 95, 0.24), transparent 42%),
    linear-gradient(145deg, rgba(255, 111, 77, 0.18), rgba(21, 25, 29, 0.94));
  border-color: rgba(255, 111, 77, 0.55);
  box-shadow: 0 0 24px rgba(255, 111, 77, 0.18);
}

.admin-avatar svg {
  width: 16px;
  height: 16px;
}

.detail-section {
  margin-top: 18px;
}

.detail-section h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

.mini-table {
  display: grid;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(10, 13, 15, 0.42);
}

.mini-table > div {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) repeat(3, minmax(90px, 1fr));
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.mini-table > div:last-child {
  border-bottom: 0;
}

.mini-table span {
  color: var(--text-muted);
  font-size: 12px;
}

.policy-panel {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(18, 23, 26, 0.72);
}

.policy-panel .settings-title {
  margin-bottom: 12px;
}

.policy-panel .settings-title h4 {
  margin-bottom: 4px;
}

.policy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.policy-grid .switch-card {
  grid-column: span 3;
}

.policy-grid label:not(.switch-card) {
  display: grid;
  gap: 8px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 12px;
}

.policy-grid input[type="number"] {
  width: 100%;
}

.captcha-field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.captcha-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.captcha-row {
  display: grid;
  grid-template-columns: minmax(92px, 120px) 1fr 40px;
  gap: 8px;
  align-items: stretch;
}

.captcha-question {
  min-height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #111416;
  color: #fff;
  font-weight: 800;
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
}

.captcha-row input {
  min-height: 40px;
}

.captcha-row .btn {
  min-height: 40px;
  padding: 0;
}

.remember-row {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: -2px 0 16px;
  color: var(--text-subtle);
}

.remember-row input {
  width: 18px;
  margin: 0;
}

body.app-mode {
  background:
    linear-gradient(rgba(255, 111, 77, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 111, 77, 0.025) 1px, transparent 1px),
    #141414;
  background-size: 84px 84px, 84px 84px;
  background-position: 0 0;
}

body.app-mode::before {
  background:
    radial-gradient(circle at 28% 4%, rgba(255, 111, 77, 0.07), transparent 34%),
    linear-gradient(180deg, rgba(20, 20, 20, 0.18), rgba(20, 20, 20, 0.72));
}

.app-main {
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px);
  background-size: 84px 84px;
}

.user-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.user-detail-grid > div {
  min-height: 74px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #12171a;
}

.user-detail-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

.user-detail-grid strong {
  color: var(--text);
  font-size: 16px;
  overflow-wrap: anywhere;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ops-panel {
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h3 {
  margin: 0;
  font-size: 17px;
}

.ops-list {
  display: grid;
  gap: 8px;
}

.ops-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
}

.ops-row > div {
  min-width: 0;
}

.ops-row strong,
.ops-row span,
.ops-row small {
  overflow-wrap: anywhere;
}

.ops-row small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
}

.ops-row > span {
  color: var(--text-subtle);
  font-weight: 800;
  white-space: nowrap;
}

.ops-row.warning {
  border-color: rgba(245, 158, 11, 0.26);
  background: rgba(245, 158, 11, 0.055);
}

.ops-row.warning.danger {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.055);
}

.audit-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(130px, 0.7fr) minmax(130px, 0.8fr) auto auto;
  gap: 10px;
  margin-bottom: 16px;
}

.audit-table td {
  vertical-align: top;
}

.audit-detail {
  max-width: 420px;
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--text-subtle);
}

.badge.neutral {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(148, 163, 184, 0.08);
}

.sdk-map-grid,
.rest-grid {
  display: grid;
  gap: 10px;
}

.sdk-map-row,
.rest-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.6fr) minmax(0, 1.4fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
}

.sdk-map-row span,
.rest-row span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.sdk-map-row code,
.rest-row code {
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.rest-row {
  grid-template-columns: minmax(140px, 0.5fr) 70px minmax(0, 1.4fr) auto;
}

.rest-row strong {
  overflow-wrap: anywhere;
}

.sdk-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.sdk-steps > div {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 111, 77, 0.2);
  border-radius: 10px;
  background: rgba(255, 111, 77, 0.045);
}

.sdk-steps strong {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--primary);
  background: rgba(255, 111, 77, 0.12);
}

.sdk-steps span {
  color: var(--text-subtle);
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .captcha-row {
    grid-template-columns: 1fr 1fr 40px;
  }

  .user-detail-grid {
    grid-template-columns: 1fr;
  }

  .ops-grid,
  .audit-filter,
  .sdk-steps {
    grid-template-columns: 1fr;
  }

  .sdk-simple-grid {
    grid-template-columns: 1fr;
  }

  .sdk-map-row,
  .rest-row {
    grid-template-columns: 1fr;
  }

  .ops-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .ops-row > span {
    white-space: normal;
  }
}

@media (max-width: 1100px) {
  .settings-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .settings-overview,
  .mini-table > div,
  .policy-grid {
    grid-template-columns: 1fr;
  }

  .policy-grid .switch-card {
    grid-column: auto;
  }
}

/* Final UI polish: compact admin table and clean SDK folds */
.admin-users-table {
  min-width: 1140px;
  width: 100%;
  table-layout: fixed;
}

.admin-users-table .col-user { width: 130px; }
.admin-users-table .col-role { width: 170px; }
.admin-users-table .col-email { width: 86px; }
.admin-users-table .col-num { width: 62px; }
.admin-users-table .col-today { width: 92px; }
.admin-users-table .col-app-users { width: 92px; }
.admin-users-table .col-status { width: 118px; }
.admin-users-table .col-login { width: 160px; }
.admin-users-table .col-actions { width: 178px; }

.admin-users-table th,
.admin-users-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-users-table th,
.admin-users-table td {
  padding-left: 14px;
  padding-right: 14px;
}

.admin-users-table td:nth-child(2) {
  overflow: visible;
}

.admin-users-table .num-cell,
.admin-users-table th:nth-child(4),
.admin-users-table th:nth-child(5),
.admin-users-table th:nth-child(6),
.admin-users-table th:nth-child(7) {
  text-align: center;
}

.admin-users-table .date-cell {
  white-space: nowrap;
  color: var(--text);
  font-weight: 750;
}

.admin-users-table .email-cell {
  color: var(--text-subtle);
  overflow-wrap: anywhere;
  padding-left: 18px;
}

.admin-users-table .actions-cell {
  overflow: visible;
}

.admin-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.admin-actions .btn.small {
  min-height: 34px;
  padding: 0 10px;
  white-space: nowrap;
}

.role-choice-group {
  width: 132px;
  border-radius: 11px;
}

.role-choice {
  min-height: 32px;
  padding: 0 8px;
}

.role-cell .role-badge {
  min-height: 22px;
  padding: 2px 10px;
  font-size: 11px;
}

.admin-avatar {
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  background:
    radial-gradient(circle at 38% 24%, rgba(255, 255, 255, 0.2), transparent 24%),
    linear-gradient(145deg, rgba(255, 111, 77, 0.34), rgba(26, 31, 35, 0.98));
}

.sdk-fold {
  padding: 0;
  overflow: hidden;
}

.sdk-fold summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}

.sdk-fold summary::marker {
  content: "";
  font-size: 0;
}

.sdk-fold summary::-webkit-details-marker {
  display: none;
}

.sdk-fold summary h3 {
  margin: 0 0 4px;
}

.sdk-fold > .credentials-head,
.sdk-fold > .credentials-list,
.sdk-fold > .code-box,
.sdk-fold > .rest-grid,
.sdk-fold > .sdk-workbench,
.sdk-fold > p {
  margin-left: 20px;
  margin-right: 20px;
}

.sdk-fold > .credentials-head {
  padding-top: 4px;
}

.sdk-fold > .code-box,
.sdk-fold > .rest-grid,
.sdk-fold > .sdk-workbench,
.sdk-fold > p:last-child {
  margin-bottom: 20px;
}

.sdk-fold[open] .advanced-chevron {
  color: var(--primary);
  border-color: rgba(255, 111, 77, 0.38);
  transform: rotate(180deg);
}

.sdk-source-fold .sdk-workbench {
  margin-top: 0;
}

.sdk-rest-card .rest-grid {
  padding-bottom: 0;
}

.keyauth-card .credentials-head h4 {
  margin: 0 0 4px;
  font-size: 14px;
}

@media (max-width: 900px) {
  .admin-users-table {
    min-width: 1140px;
  }
}

/* LONGAUTH SECURITY: brand system and cinematic login sequence */
:root {
  --security-orange: #ff6a3d;
  --security-amber: #ffad66;
  --security-cold: #76b6cf;
  --security-black: #07090b;
}

.brand-intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  isolation: isolate;
  background: #050607;
  color: #f7f8f8;
  clip-path: inset(0 0 0 0);
}

.intro-background,
.intro-grid,
.intro-scanner,
.intro-data {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.intro-background {
  z-index: -4;
  background:
    linear-gradient(90deg, rgba(4, 6, 7, 0.08) 0%, rgba(4, 6, 7, 0.18) 47%, rgba(4, 6, 7, 0.72) 72%, rgba(4, 6, 7, 0.96) 100%),
    linear-gradient(180deg, rgba(3, 4, 5, 0.08), rgba(3, 4, 5, 0.56)),
    url("/intro-dragon.webp") center / cover no-repeat;
  transform: scale(1.08);
  filter: saturate(0.88) contrast(1.08);
}

.intro-grid {
  z-index: -3;
  opacity: 0;
  background-image:
    linear-gradient(rgba(255, 106, 61, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 106, 61, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(118, 182, 207, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(118, 182, 207, 0.035) 1px, transparent 1px);
  background-size: 112px 112px, 112px 112px, 28px 28px, 28px 28px;
  mask-image: linear-gradient(90deg, transparent 2%, #000 34%, #000 100%);
}

.intro-grid::before,
.intro-grid::after {
  content: "";
  position: absolute;
  width: 34vw;
  height: 1px;
  right: 7vw;
  background: linear-gradient(90deg, transparent, rgba(255, 106, 61, 0.7), transparent);
  box-shadow: 0 0 18px rgba(255, 106, 61, 0.34);
}

.intro-grid::before { top: 28%; }
.intro-grid::after { bottom: 25%; }

.intro-scanner {
  z-index: -1;
  height: 2px;
  top: -4px;
  background: linear-gradient(90deg, transparent, rgba(255, 173, 102, 0.92) 46%, rgba(118, 182, 207, 0.74) 52%, transparent);
  box-shadow: 0 0 26px rgba(255, 106, 61, 0.55);
  opacity: 0;
}

.intro-data {
  z-index: -2;
  width: 1px;
  height: 64vh;
  top: 18vh;
  background: linear-gradient(transparent, rgba(255, 106, 61, 0.68), transparent);
  opacity: 0;
}

.intro-data::before,
.intro-data::after {
  content: "";
  position: absolute;
  left: -3px;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(255, 173, 102, 0.86);
  background: #0b0d0f;
  transform: rotate(45deg);
}

.intro-data::before { top: 18%; }
.intro-data::after { bottom: 14%; }
.intro-data-left { left: 7vw; }
.intro-data-right { left: auto; right: 7vw; }

.intro-stage {
  position: absolute;
  top: 50%;
  left: 69%;
  width: min(520px, 42vw);
  display: grid;
  justify-items: center;
  gap: 22px;
  transform: translate(-50%, -50%);
  text-align: center;
}

.intro-seal {
  position: relative;
  width: 196px;
  height: 196px;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.58) rotate(-8deg);
}

.intro-emblem {
  width: 132px;
  height: 132px;
  object-fit: contain;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.76)) drop-shadow(0 0 22px rgba(255, 106, 61, 0.28));
  clip-path: inset(100% 0 0 0);
}

.intro-orbit,
.intro-crosshair {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.intro-orbit::before,
.intro-orbit::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
}

.orbit-one {
  border: 1px solid rgba(255, 106, 61, 0.34);
  border-left-color: var(--security-orange);
  border-right-color: var(--security-orange);
}

.orbit-one::before {
  inset: 15px;
  border: 1px dashed rgba(255, 173, 102, 0.42);
}

.orbit-two {
  inset: 30px;
  border: 1px solid rgba(118, 182, 207, 0.28);
  border-top-color: var(--security-cold);
  border-bottom-color: var(--security-cold);
}

.intro-crosshair {
  inset: -18px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(255, 106, 61, 0.25) 50%, transparent calc(50% + 1px)),
    linear-gradient(transparent calc(50% - 1px), rgba(255, 106, 61, 0.25) 50%, transparent calc(50% + 1px));
}

.intro-lockup {
  display: grid;
  justify-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(18px);
}

.intro-overline {
  color: #9aa4aa;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

.intro-wordmark {
  display: flex;
  align-items: baseline;
  gap: 12px;
  line-height: 1;
}

.intro-wordmark span {
  color: #fff;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 0;
}

.intro-wordmark strong {
  color: var(--security-orange);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
}

.intro-rule {
  width: 100%;
  max-width: 340px;
  height: 1px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.intro-rule span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--security-orange), var(--security-cold), transparent);
  transform: translateX(-104%);
}

.intro-statuses {
  min-height: 22px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.intro-statuses span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #9ba5aa;
  font-size: 10px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(6px);
}

.intro-statuses span::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--security-orange);
  box-shadow: 0 0 9px rgba(255, 106, 61, 0.72);
  transform: rotate(45deg);
}

.intro-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.04);
}

.intro-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, #9f2c18, var(--security-orange), var(--security-amber));
  box-shadow: 0 0 22px rgba(255, 106, 61, 0.55);
}

.intro-skip {
  position: absolute;
  right: 24px;
  bottom: 22px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(7, 9, 11, 0.62);
  color: #aeb7bc;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  backdrop-filter: blur(12px);
}

.intro-skip:hover {
  color: #fff;
  border-color: rgba(255, 106, 61, 0.62);
}

.brand-intro.is-running .intro-background { animation: securityCamera 4.7s cubic-bezier(0.2, 0.75, 0.2, 1) both; }
.brand-intro.is-running .intro-grid { animation: securityGrid 0.7s 0.25s ease-out forwards, securityGridDrift 8s 0.9s linear infinite; }
.brand-intro.is-running .intro-scanner { animation: securityScan 1.25s 0.18s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.brand-intro.is-running .intro-data { animation: securityData 0.55s 0.42s ease-out forwards; }
.brand-intro.is-running .intro-seal { animation: securitySeal 0.76s 0.68s cubic-bezier(0.18, 0.8, 0.22, 1.2) forwards; }
.brand-intro.is-running .intro-emblem { animation: securityEmblem 0.72s 0.92s cubic-bezier(0.2, 0.75, 0.2, 1) forwards; }
.brand-intro.is-running .orbit-one { animation: securityOrbit 5.6s 0.9s linear infinite; }
.brand-intro.is-running .orbit-two { animation: securityOrbitReverse 4.2s 0.9s linear infinite; }
.brand-intro.is-running .intro-lockup { animation: securityLockup 0.6s 1.18s ease-out forwards; }
.brand-intro.is-running .intro-rule span { animation: securityRule 0.8s 1.36s ease-out forwards; }
.brand-intro.is-running .intro-statuses span { animation: securityStatus 0.36s var(--intro-delay) ease-out forwards; }
.brand-intro.is-running .intro-progress span { animation: securityProgress 4.15s 0.1s linear forwards; }
.brand-intro.is-running .intro-skip { animation: securityStatus 0.35s 1.1s ease-out forwards; }
.brand-intro.is-exiting { animation: securityRelease 0.76s cubic-bezier(0.76, 0, 0.24, 1) forwards; }
.brand-intro.is-exiting .intro-stage { animation: securityStageExit 0.42s ease-in forwards; }

body.brand-intro-active {
  overflow: hidden;
}

body.auth-mode {
  background: var(--security-black);
}

body.auth-mode .global-controls {
  z-index: 80;
}

.auth-wrap {
  grid-template-columns: minmax(460px, 1fr) minmax(390px, 460px);
  gap: 70px;
  place-items: center stretch;
  padding: 44px 64px;
  isolation: isolate;
  background: #07090b;
}

.auth-wrap::before {
  inset: 0;
  width: auto;
  aspect-ratio: auto;
  top: 0;
  left: 0;
  transform: none;
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(3, 5, 6, 0.12) 0%, rgba(3, 5, 6, 0.32) 48%, rgba(3, 5, 6, 0.74) 75%, rgba(3, 5, 6, 0.96) 100%),
    linear-gradient(180deg, rgba(4, 5, 6, 0.04), rgba(4, 5, 6, 0.62)),
    url("/intro-dragon.webp") center / cover no-repeat;
  filter: none;
  animation: authSecurityDrift 18s ease-in-out infinite alternate;
}

.auth-wrap::after {
  z-index: -2;
  opacity: 0.72;
  background-image:
    linear-gradient(rgba(255, 106, 61, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 106, 61, 0.038) 1px, transparent 1px),
    linear-gradient(180deg, transparent 70%, rgba(4, 5, 6, 0.8));
  background-size: 112px 112px, 112px 112px, 100% 100%;
  background-position: 0 0;
  animation: none;
}

.auth-hero {
  justify-self: start;
  justify-items: start;
  align-content: end;
  align-self: stretch;
  width: min(680px, 100%);
  max-width: none;
  padding: 8vh 0 4vh;
  text-align: left;
}

.hero-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: auto;
}

.auth-hero-logo {
  width: 92px;
  height: 92px;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.62)) drop-shadow(0 0 20px rgba(255, 106, 61, 0.2));
  animation: securityLogoIdle 5s ease-in-out infinite;
}

.hero-brand-lockup div {
  display: grid;
  gap: 2px;
  line-height: 1;
}

.hero-brand-lockup strong {
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0;
}

.hero-brand-lockup span {
  color: var(--security-orange);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.hero-kicker {
  position: relative;
  margin-top: 26vh;
  padding-left: 44px;
  color: var(--security-amber);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.hero-kicker::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 30px;
  height: 1px;
  background: var(--security-orange);
  box-shadow: 0 0 12px rgba(255, 106, 61, 0.5);
}

.auth-hero h1 {
  max-width: 650px;
  color: #fff;
  font-size: 58px;
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: 0;
  text-wrap: balance;
}

.auth-hero p {
  max-width: 620px;
  color: #aab2b7;
  font-size: 16px;
  line-height: 1.7;
}

.auth-feature-row {
  justify-content: flex-start;
  gap: 12px 26px;
}

.auth-feature-row span {
  min-height: 26px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #d8dcdf;
  font-size: 12px;
}

.auth-feature-row span b { font-weight: 700; }
.auth-feature-row i { color: var(--security-orange); }

.auth-telemetry {
  width: min(620px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-telemetry > span {
  min-height: 62px;
  display: grid;
  grid-template-columns: 8px auto;
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 10px;
  padding: 0 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-telemetry > span:first-child { padding-left: 0; }
.auth-telemetry > span:last-child { border-right: 0; }
.auth-telemetry i {
  grid-row: 1 / 3;
  align-self: center;
  width: 6px;
  height: 6px;
  background: var(--security-orange);
  box-shadow: 0 0 10px rgba(255, 106, 61, 0.72);
  transform: rotate(45deg);
}
.auth-telemetry b { color: #fff; font-size: 11px; }
.auth-telemetry small { color: #78838a; font-size: 9px; }

.auth-card {
  justify-self: end;
  width: min(460px, 100%);
  padding: 28px;
  border-radius: 8px;
  border-color: rgba(255, 255, 255, 0.13);
  background:
    linear-gradient(145deg, rgba(25, 29, 32, 0.9), rgba(10, 12, 14, 0.96));
  box-shadow:
    0 38px 90px rgba(0, 0, 0, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(255, 106, 61, 0.04);
  backdrop-filter: blur(22px) saturate(1.08);
  animation: authSecurityCardIn 0.62s 0.08s cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 22px;
  width: 96px;
  height: 2px;
  background: linear-gradient(90deg, var(--security-orange), transparent);
  box-shadow: 0 0 16px rgba(255, 106, 61, 0.42);
}

.auth-brand {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  text-align: left;
}

.auth-brand .brand-logo {
  width: 62px;
  height: 62px;
  margin: 0;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 10px rgba(255, 106, 61, 0.16));
  animation: none;
}

.auth-brand-copy { min-width: 0; }
.auth-title {
  color: #fff;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}
.auth-title span { color: var(--security-orange); }
.auth-sub { margin-top: 4px; color: #818b91; font-size: 11px; }

.auth-live {
  display: grid;
  justify-items: center;
  gap: 5px;
  color: #768188;
  font-size: 9px;
  text-align: center;
}
.auth-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #45d483;
  box-shadow: 0 0 12px rgba(69, 212, 131, 0.64);
}

.auth-tabs {
  min-height: 48px;
  border-radius: 8px;
  background: rgba(7, 9, 11, 0.62);
}
.auth-tab { border-radius: 5px; }
.auth-tab.active {
  background: linear-gradient(145deg, rgba(255, 106, 61, 0.2), rgba(255, 106, 61, 0.08));
  box-shadow: inset 0 0 0 1px rgba(255, 106, 61, 0.26);
}

.auth-card input {
  min-height: 46px;
  background: rgba(8, 10, 12, 0.78);
  border-color: rgba(255, 255, 255, 0.12);
}
.auth-card input:focus {
  border-color: rgba(255, 106, 61, 0.78);
  box-shadow: 0 0 0 3px rgba(255, 106, 61, 0.12);
}
.auth-card .btn.primary {
  min-height: 45px;
  background: linear-gradient(135deg, #ff7b4d, #e84724);
  box-shadow: 0 12px 28px rgba(232, 71, 36, 0.24);
}

.sidebar-brand {
  min-height: 88px;
  gap: 12px;
}
.sidebar-logo {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  filter: drop-shadow(0 8px 13px rgba(0, 0, 0, 0.46));
}
.sidebar-name {
  display: grid;
  gap: 2px;
  line-height: 1;
}
.sidebar-name strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
}
.sidebar-name small {
  color: var(--security-orange);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
}

body.login-intro-off .auth-wrap::before,
body.login-intro-off .auth-card,
body.login-intro-off .auth-hero-logo {
  animation: none;
}

@keyframes securityCamera {
  0% { transform: scale(1.08); filter: saturate(0.42) contrast(1.18) brightness(0.38); }
  36% { filter: saturate(0.82) contrast(1.1) brightness(0.82); }
  100% { transform: scale(1); filter: saturate(0.94) contrast(1.08) brightness(0.92); }
}
@keyframes securityGrid {
  from { opacity: 0; transform: scale(1.03); }
  to { opacity: 0.56; transform: scale(1); }
}
@keyframes securityGridDrift {
  to { background-position: 112px 112px, 112px 112px, 28px 28px, 28px 28px; }
}
@keyframes securityScan {
  0% { top: -4px; opacity: 0; }
  10% { opacity: 1; }
  84% { opacity: 0.7; }
  100% { top: calc(100% + 4px); opacity: 0; }
}
@keyframes securityData { from { opacity: 0; transform: scaleY(0); } to { opacity: 0.72; transform: scaleY(1); } }
@keyframes securitySeal { to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes securityEmblem { to { clip-path: inset(0 0 0 0); } }
@keyframes securityOrbit { to { transform: rotate(360deg); } }
@keyframes securityOrbitReverse { to { transform: rotate(-360deg); } }
@keyframes securityLockup { to { opacity: 1; transform: translateY(0); } }
@keyframes securityRule { to { transform: translateX(104%); } }
@keyframes securityStatus { to { opacity: 1; transform: translateY(0); } }
@keyframes securityProgress { to { transform: scaleX(1); } }
@keyframes securityStageExit { to { opacity: 0; transform: translate(-50%, -54%) scale(0.96); } }
@keyframes securityRelease {
  0% { clip-path: inset(0 0 0 0); opacity: 1; }
  68% { clip-path: inset(0 0 82% 0); opacity: 1; }
  100% { clip-path: inset(0 0 100% 0); opacity: 0; }
}
@keyframes authSecurityDrift {
  from { background-position: center; }
  to { background-position: 48% center; }
}
@keyframes authSecurityCardIn {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes securityLogoIdle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@media (max-width: 1180px) {
  .auth-wrap {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 440px);
    gap: 36px;
    padding: 38px;
  }
  .auth-hero h1 { font-size: 46px; }
  .hero-kicker { margin-top: 22vh; }
}

@media (max-width: 980px) {
  .auth-wrap {
    grid-template-columns: 1fr;
    place-items: center;
    padding: 78px 24px 28px;
  }
  .auth-wrap::before {
    background:
      linear-gradient(180deg, rgba(3, 5, 6, 0.2), rgba(3, 5, 6, 0.86)),
      linear-gradient(90deg, rgba(3, 5, 6, 0.22), rgba(3, 5, 6, 0.58)),
      url("/intro-dragon.webp") 37% center / cover no-repeat;
  }
  .auth-hero { display: none; }
  .auth-card { justify-self: center; }
  .intro-stage { left: 68%; width: min(520px, 58vw); }
}

@media (max-width: 640px) {
  .auth-wrap { padding: 74px 12px 18px; }
  .auth-card { padding: 20px; }
  .auth-brand {
    grid-template-columns: 54px minmax(0, 1fr);
  }
  .auth-brand .brand-logo { width: 54px; height: 54px; }
  .auth-live { display: none; }
  .auth-title { font-size: 17px; }
  .intro-background {
    background:
      linear-gradient(180deg, rgba(4, 6, 7, 0.16), rgba(4, 6, 7, 0.88)),
      url("/intro-dragon.webp") 34% center / cover no-repeat;
  }
  .intro-stage {
    left: 50%;
    width: calc(100vw - 32px);
    top: 56%;
  }
  .intro-seal { width: 152px; height: 152px; }
  .intro-emblem { width: 102px; height: 102px; }
  .intro-wordmark { display: grid; justify-items: center; gap: 5px; }
  .intro-wordmark span { font-size: 34px; }
  .intro-wordmark strong { font-size: 13px; }
  .intro-statuses { display: grid; justify-items: center; }
  .intro-skip { right: 14px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-intro,
  .brand-intro *,
  .auth-wrap::before,
  .auth-card,
  .auth-hero-logo {
    animation: none !important;
  }
}

/* Focus transition: no vertical wipe and no running border */
.brand-intro {
  clip-path: none;
  transform: scale(1);
  filter: blur(0);
}

.brand-intro.is-exiting {
  animation: securityFocusRelease 0.76s cubic-bezier(0.22, 0.72, 0.22, 1) forwards;
}

.brand-intro.is-exiting .intro-stage {
  animation: securityFocusStageExit 0.5s ease-in forwards;
}

.intro-progress {
  display: none;
}

.auth-card {
  transform: scale(0.965);
}

.auth-brand,
.auth-tabs,
.auth-form:not(.hidden) > * {
  transform: scale(0.985);
}

.auth-brand:hover .brand-logo {
  transform: rotate(-1deg) scale(1.035);
}

.auth-tab:hover {
  transform: none;
}

.auth-tab:hover i {
  transform: scale(1.12);
}

.auth-form > label:focus-within > span,
.captcha-field:focus-within .captcha-label {
  transform: none;
}

.auth-card input:focus,
.captcha-field:focus-within .captcha-question {
  transform: none;
}

.auth-card .btn.primary:hover {
  transform: scale(1.008);
}

.auth-card .btn.primary:active {
  transform: scale(0.988);
}

@keyframes securityFocusRelease {
  0% { opacity: 1; transform: scale(1); filter: blur(0) brightness(1); }
  44% { opacity: 0.76; transform: scale(1.012); filter: blur(3px) brightness(1.08); }
  100% { opacity: 0; transform: scale(1.035); filter: blur(13px) brightness(0.78); }
}

@keyframes securityFocusStageExit {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: blur(0); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(1.08); filter: blur(10px); }
}

@keyframes authPanelReveal {
  0% { opacity: 0; transform: scale(0.965); filter: blur(13px); }
  58% { opacity: 0.88; filter: blur(2px); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes authElementReveal {
  from { opacity: 0; transform: scale(0.985); filter: blur(7px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}

/* App interior polish: aligned dark command UI */
.app-main {
  background:
    radial-gradient(circle at 72% -8%, rgba(255, 111, 77, 0.08), transparent 34%),
    radial-gradient(circle at 18% 12%, rgba(255, 111, 77, 0.045), transparent 24%),
    linear-gradient(rgba(255, 111, 77, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 111, 77, 0.022) 1px, transparent 1px),
    var(--bg);
  background-size: auto, auto, 64px 64px, 64px 64px;
}

.main {
  max-width: 1480px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 280px);
  grid-template-areas:
    "copy status"
    "rail rail";
  align-items: end;
  gap: 22px 26px;
  margin: 0 0 22px;
  min-height: 260px;
  padding: 26px 30px;
  border: 1px solid rgba(255, 111, 77, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 111, 77, 0.105), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.042), rgba(255, 255, 255, 0.012)),
    rgba(18, 22, 25, 0.82);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.052);
  overflow: hidden;
  position: relative;
}

.dashboard-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: min(62%, 760px);
  height: 100%;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(18, 22, 25, 0.96), rgba(18, 22, 25, 0.2) 36%, rgba(18, 22, 25, 0.66) 100%),
    linear-gradient(180deg, rgba(18, 22, 25, 0.78), rgba(18, 22, 25, 0.1) 48%, rgba(18, 22, 25, 0.84)),
    url("/intro-dragon.webp") 58% center / cover no-repeat;
  opacity: 0.26;
  filter: saturate(0.9) contrast(1.12) brightness(0.9);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 92%);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 92%);
}

.dashboard-hero > div:first-child {
  grid-area: copy;
  align-self: end;
  max-width: 680px;
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 111, 77, 0.55), transparent);
  opacity: 0.7;
}

.dashboard-hero > * {
  position: relative;
  z-index: 1;
}

.dashboard-hero .hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.dashboard-hero .hero-kicker::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--primary);
  box-shadow: 0 0 14px rgba(255, 111, 77, 0.52);
}

.dashboard-hero h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(28px, 3.1vw, 46px);
  line-height: 1.04;
  font-weight: 800;
}

.dashboard-hero p {
  max-width: 760px;
  margin: 12px 0 0;
  color: #aeb7bf;
  font-size: 15px;
}

.hero-rail {
  grid-area: rail;
  align-self: end;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(255, 111, 77, 0.095), transparent 54%),
    rgba(9, 12, 14, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
}

.hero-rail span {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-left: 2px solid rgba(255, 111, 77, 0.55);
  border-radius: 10px;
  background: rgba(16, 20, 23, 0.55);
}

.hero-rail b {
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  flex: 0 0 auto;
}

.hero-rail small {
  color: #8f9ba5;
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}

.hero-status-stack {
  grid-area: status;
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 210px;
}

.hero-status-stack span {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 12px;
  background: rgba(10, 13, 15, 0.46);
  color: #e7eaec;
  font-weight: 750;
}

.hero-status-stack i {
  color: var(--primary);
}

.grid.cols-3,
.grid.cols-4 {
  align-items: stretch;
}

.card.stat {
  min-height: 132px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background:
    radial-gradient(circle at 18% 24%, rgba(255, 111, 77, 0.12), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    rgba(18, 22, 25, 0.88);
  box-shadow:
    0 16px 42px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.card.stat .ic {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: rgba(255, 111, 77, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.card.stat .num {
  color: #fff;
  font-size: 34px;
  font-weight: 800;
}

.card.stat .lbl {
  color: #aeb7bf;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.dashboard-panel {
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    rgba(18, 22, 25, 0.86);
}

.dashboard-panel h3,
.ops-panel h3 {
  color: #fff;
  font-weight: 800;
}

.sidebar-footer {
  padding: 14px;
  background: linear-gradient(180deg, transparent, rgba(255, 111, 77, 0.035));
}

.sidebar-user.is-admin {
  gap: 0;
}

.sidebar-user.is-admin .sidebar-avatar,
.sidebar-user.is-admin .sidebar-username {
  display: none;
}

.sidebar-user.is-admin .sidebar-user-info {
  display: flex;
  align-items: center;
}

.sidebar-user.is-admin .sidebar-role.role-badge {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 12px;
  letter-spacing: 0.06em;
  box-shadow: 0 0 0 1px rgba(255, 111, 77, 0.16), 0 12px 28px rgba(255, 111, 77, 0.09);
}

.sidebar-user:not(.is-admin) .sidebar-role.role-badge {
  width: fit-content;
}

@media (max-width: 900px) {
  .dashboard-hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "status"
      "rail";
  }

  .dashboard-hero::before {
    inset: 0;
    width: 100%;
    opacity: 0.1;
  }

  .hero-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-status-stack {
    min-width: 0;
    grid-template-columns: 1fr;
  }
}

.auth-tab:focus {
  outline: none;
}

.auth-tab:focus-visible {
  box-shadow:
    inset 0 0 0 1px rgba(255, 106, 61, 0.42),
    0 0 0 2px rgba(8, 10, 12, 0.86);
}

/* LONGAUTH SECURITY: interactive login reveal */
body.auth-mode {
  height: 100svh;
  overflow: hidden;
}

.auth-wrap {
  --cursor-x: 76%;
  --cursor-y: 28%;
  --parallax-x: 0px;
  --parallax-y: 0px;
  height: 100svh;
  min-height: 0;
  overflow: hidden;
}

.auth-wrap::before {
  transform: translate3d(var(--parallax-x), var(--parallax-y), 0) scale(1.025);
  transition: transform 0.7s cubic-bezier(0.2, 0.75, 0.2, 1);
}

.auth-card {
  isolation: isolate;
  overflow: hidden;
  opacity: 0;
  transform: translateX(30px) scale(0.985);
  animation: none;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.3s ease;
}

body.auth-reveal-ready .auth-card {
  animation: authPanelReveal 0.72s cubic-bezier(0.18, 0.82, 0.24, 1) forwards;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  z-index: 0;
  border-radius: inherit;
  background:
    radial-gradient(280px circle at var(--cursor-x) var(--cursor-y), rgba(255, 106, 61, 0.11), transparent 62%),
    radial-gradient(180px circle at 12% 92%, rgba(118, 182, 207, 0.055), transparent 68%);
  box-shadow: none;
  opacity: 0.9;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.auth-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(circle at 0 0, rgba(255, 106, 61, 0.2), transparent 92px),
    radial-gradient(circle at 100% 100%, rgba(118, 182, 207, 0.09), transparent 110px);
  opacity: 0.55;
}

.auth-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow:
    0 42px 100px rgba(0, 0, 0, 0.64),
    inset 0 1px 0 rgba(255, 255, 255, 0.065),
    0 0 42px rgba(255, 106, 61, 0.055);
}

.auth-card > * {
  position: relative;
  z-index: 1;
}

.auth-brand,
.auth-tabs,
.auth-form:not(.hidden) > * {
  opacity: 0.28;
  transform: scale(0.985);
  filter: blur(5px);
}

body.auth-reveal-ready .auth-brand {
  animation: authElementReveal 0.52s 0.14s ease-out forwards;
}

body.auth-reveal-ready .auth-tabs {
  animation: authElementReveal 0.52s 0.24s ease-out forwards;
}

body.auth-reveal-ready .auth-form:not(.hidden) > :nth-child(1) { animation: authElementReveal 0.46s 0.32s ease-out forwards; }
body.auth-reveal-ready .auth-form:not(.hidden) > :nth-child(2) { animation: authElementReveal 0.46s 0.39s ease-out forwards; }
body.auth-reveal-ready .auth-form:not(.hidden) > :nth-child(3) { animation: authElementReveal 0.46s 0.46s ease-out forwards; }
body.auth-reveal-ready .auth-form:not(.hidden) > :nth-child(4) { animation: authElementReveal 0.46s 0.53s ease-out forwards; }
body.auth-reveal-ready .auth-form:not(.hidden) > :nth-child(5) { animation: authElementReveal 0.46s 0.6s ease-out forwards; }
body.auth-reveal-ready .auth-form:not(.hidden) > :nth-child(6) { animation: authElementReveal 0.46s 0.67s ease-out forwards; }

.auth-brand .brand-logo {
  transition: transform 0.42s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.3s ease;
}

.auth-brand:hover .brand-logo {
  transform: translateY(-3px) rotate(-2deg) scale(1.04);
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.62)) drop-shadow(0 0 16px rgba(255, 106, 61, 0.24));
}

.auth-tab {
  position: relative;
  overflow: hidden;
  transition: color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.auth-tab::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 50% 120%, rgba(255, 106, 61, 0.2), transparent 58%);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.auth-tab:hover {
  color: #fff;
  transform: translateY(-1px);
}

.auth-tab:hover::after,
.auth-tab.active::after {
  opacity: 1;
  transform: translateY(0);
}

.auth-tab i {
  transition: transform 0.28s cubic-bezier(0.18, 0.82, 0.24, 1), color 0.22s ease;
}

.auth-tab:hover i { transform: translateY(-1px) scale(1.12); }
.auth-tab.active i {
  color: var(--security-amber);
  animation: authIconPulse 2.8s ease-in-out infinite;
}

.auth-form > label > span,
.captcha-label {
  transition: color 0.2s ease, transform 0.2s ease;
}

.auth-form > label:focus-within > span,
.captcha-field:focus-within .captcha-label {
  color: var(--security-amber);
  transform: translateX(3px);
}

.auth-card input {
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease,
    transform 0.22s ease;
}

.auth-card input:hover:not(:focus) {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(12, 15, 17, 0.9);
}

.auth-card input:focus {
  transform: translateY(-1px);
  background: rgba(13, 16, 18, 0.96);
}

.captcha-question {
  border-radius: 7px;
  transition: border-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.captcha-field:focus-within .captcha-question {
  color: var(--security-amber);
  border-color: rgba(255, 106, 61, 0.42);
  box-shadow: inset 0 0 18px rgba(255, 106, 61, 0.07);
  transform: translateY(-1px);
}

.captcha-row .btn i {
  transition: transform 0.35s ease, color 0.22s ease;
}

.captcha-row .btn:hover i {
  color: var(--security-amber);
  transform: rotate(135deg);
}

.remember-row {
  transition: color 0.22s ease;
}

.remember-row:hover { color: #e2e5e7; }
.remember-row input {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.remember-row:hover input { transform: scale(1.06); }
.remember-row input:checked { box-shadow: 0 0 12px rgba(255, 106, 61, 0.34); }

.auth-card .btn.primary {
  position: relative;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.auth-card .btn.primary::before {
  content: "";
  position: absolute;
  top: -60%;
  left: -34%;
  width: 24%;
  height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  transform: rotate(18deg) translateX(-180%);
  transition: transform 0.65s ease;
}

.auth-card .btn.primary:hover {
  transform: translateY(-2px);
  filter: saturate(1.12);
  box-shadow: 0 17px 34px rgba(232, 71, 36, 0.34);
}

.auth-card .btn.primary:hover::before {
  transform: rotate(18deg) translateX(760%);
}

.auth-card .btn.primary:active {
  transform: translateY(0) scale(0.985);
}

.auth-link,
#forgot-password-link {
  display: none !important;
}

@keyframes authPanelReveal {
  0% { opacity: 0; transform: translateX(30px) scale(0.985); filter: blur(5px); }
  55% { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: translateX(0) scale(1); filter: blur(0); }
}

@keyframes authElementReveal {
  from { opacity: 0; transform: translateY(14px); filter: blur(3px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes authIconPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(255, 106, 61, 0)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 6px rgba(255, 106, 61, 0.4)); }
}

@media (max-height: 760px) {
  .auth-wrap { padding-top: 12px; padding-bottom: 12px; }
  .auth-card {
    max-height: calc(100svh - 24px);
    padding: 17px 20px;
  }
  .auth-brand { margin-bottom: 12px; }
  .auth-brand .brand-logo { width: 48px; height: 48px; }
  .auth-tabs { min-height: 42px; margin-bottom: 13px; }
  .auth-tab { padding-top: 8px; padding-bottom: 8px; }
  .auth-form label { margin-bottom: 10px; }
  .auth-card input { min-height: 40px; }
  .captcha-field { margin-bottom: 9px; }
  .captcha-question,
  .captcha-row input,
  .captcha-row .btn { min-height: 38px; }
  .remember-row { margin-bottom: 10px; }
  .auth-card .btn.primary { min-height: 41px; }
}

@media (max-width: 640px) {
  .auth-wrap { padding-top: 62px; padding-bottom: 10px; }
  .auth-card {
    max-height: calc(100svh - 72px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card,
  .auth-brand,
  .auth-tabs,
  .auth-form:not(.hidden) > * {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}

/* Cinematic focus motion: stable layout, no wipe, scan line, or running border */
.intro-scanner,
.intro-data,
.intro-grid::before,
.intro-grid::after,
.intro-rule,
.intro-progress,
.intro-crosshair {
  display: none !important;
}

.intro-emblem {
  clip-path: none;
  opacity: 0;
  transform: scale(0.92);
}

.intro-orbit {
  border: 0 !important;
  background: radial-gradient(circle, rgba(255, 106, 61, 0.13) 0, rgba(255, 106, 61, 0.04) 44%, transparent 72%);
}

.intro-orbit::before,
.intro-orbit::after {
  border: 0 !important;
}

.orbit-one,
.orbit-two,
.brand-intro.is-running .orbit-one,
.brand-intro.is-running .orbit-two {
  animation: securityAmbientPulse 2.8s 1s ease-in-out infinite;
}

.orbit-two {
  animation-delay: 1.34s !important;
}

.intro-lockup,
.intro-statuses span {
  transform: scale(0.985);
  filter: blur(7px);
}

.auth-card {
  transform: scale(0.985);
}

.auth-brand:hover .brand-logo,
.auth-tab:hover,
.auth-tab:hover i,
.auth-form > label:focus-within > span,
.captcha-field:focus-within .captcha-label,
.auth-card input:focus,
.captcha-field:focus-within .captcha-question,
.auth-card .btn.primary:hover,
.auth-card .btn.primary:active {
  transform: none;
}

.auth-tab::after {
  transform: scale(0.82);
}

.auth-tab:hover::after,
.auth-tab.active::after {
  transform: scale(1);
}

@keyframes securityEmblem {
  from { opacity: 0; transform: scale(0.92); filter: blur(10px) brightness(1.45); }
  to { opacity: 1; transform: scale(1); filter: blur(0) brightness(1); }
}

@keyframes securityLockup {
  from { opacity: 0; transform: scale(0.985); filter: blur(9px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes securityStatus {
  from { opacity: 0; transform: scale(0.97); filter: blur(5px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes securityAmbientPulse {
  0%, 100% { opacity: 0.42; transform: scale(0.96); filter: blur(1px); }
  50% { opacity: 0.86; transform: scale(1.04); filter: blur(4px); }
}

@keyframes authPanelReveal {
  0% { opacity: 0; transform: scale(0.985); filter: blur(12px); }
  62% { opacity: 0.92; transform: scale(1.004); filter: blur(2px); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes authElementReveal {
  from { opacity: 0.28; transform: scale(0.985); filter: blur(6px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}

.shared-apps-head h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.shared-apps-card {
  border-color: rgba(255, 111, 77, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 111, 77, 0.055), transparent 42%),
    var(--surface);
}

.share-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border-color: rgba(255, 111, 77, 0.24);
  background:
    radial-gradient(circle at 82% 15%, rgba(255, 111, 77, 0.13), transparent 30%),
    linear-gradient(135deg, rgba(255, 111, 77, 0.075), rgba(18, 22, 25, 0.92) 42%),
    var(--surface);
}

.share-hero h3 {
  margin: 8px 0 8px;
  font-size: 20px;
}

.share-hero .eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.admin-gate-modal .verify-icon {
  color: var(--primary);
  background: rgba(255, 111, 77, 0.14);
  border-color: rgba(255, 111, 77, 0.34);
}

@media (max-width: 780px) {
  .share-hero {
    grid-template-columns: 1fr;
  }
}
/* Loader release manager */
.loader-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  gap: 18px;
  align-items: start;
}

.loader-upload-card input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01));
  color: var(--text);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.file-picker:hover,
.file-picker:focus-within {
  border-color: rgba(255, 111, 77, 0.56);
  background: rgba(255, 111, 77, 0.055);
  box-shadow: 0 0 0 3px rgba(255, 111, 77, 0.1);
}

.file-picker-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--primary);
  background: rgba(255, 111, 77, 0.13);
  border: 1px solid rgba(255, 111, 77, 0.2);
  flex: 0 0 auto;
}

.file-picker-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.loader-upload-card textarea {
  min-height: 92px;
  resize: vertical;
}

.loader-upload-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 4px;
}

.loader-limit {
  margin: 0;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  width: auto;
  flex: 1 1 auto;
}

.loader-manifest-card .credentials-list {
  margin-top: 14px;
}

.loader-manifest-actions {
  margin-top: 18px;
  gap: 10px;
}

.loader-release-list {
  margin-top: 18px;
}

.loader-control-card,
.loader-build-list {
  margin-top: 18px;
}

.loader-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.loader-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.loader-switch-row span {
  display: grid;
  gap: 4px;
}

.loader-switch-row small {
  color: var(--muted);
  line-height: 1.45;
}

.loader-switch-row select {
  width: 88px;
  flex: 0 0 auto;
}

.loader-maintenance-message {
  grid-column: 1 / -1;
}

.loader-control-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.loader-build-total {
  display: grid;
  min-width: 82px;
  padding: 9px 12px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
}

.loader-build-total strong {
  font-size: 20px;
}

.loader-build-total span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.loader-build-code {
  color: var(--primary);
  letter-spacing: 0.16em;
}

.hash-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .loader-grid {
    grid-template-columns: 1fr;
  }

  .loader-upload-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .loader-control-grid {
    grid-template-columns: 1fr;
  }

  .loader-maintenance-message {
    grid-column: auto;
  }
}
