:root {
  color-scheme: dark;
  --bg: #070b14;
  --bg-soft: #0b1120;
  --surface: #101827;
  --surface-strong: #151f31;
  --surface-hover: #1a263a;
  --border: #26344b;
  --border-soft: #1d293d;
  --text: #eef4ff;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --primary: #7c6cff;
  --primary-strong: #968aff;
  --primary-soft: rgba(124, 108, 255, 0.14);
  --cyan: #36d4d8;
  --success: #35d49a;
  --success-soft: rgba(53, 212, 154, 0.12);
  --warning: #f6bd60;
  --warning-soft: rgba(246, 189, 96, 0.12);
  --danger: #ff7185;
  --danger-soft: rgba(255, 113, 133, 0.12);
  --info: #64b5ff;
  --info-soft: rgba(100, 181, 255, 0.12);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.16);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.34);
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --sidebar-width: 264px;
  --content-width: 1480px;
  --transition: 160ms ease;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 15% -10%, rgba(124, 108, 255, 0.16), transparent 32rem),
    radial-gradient(circle at 100% 10%, rgba(54, 212, 216, 0.08), transparent 26rem),
    var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.nav-open {
  overflow: hidden;
}

a {
  color: var(--primary-strong);
  text-decoration: none;
}

a:hover {
  color: #b3aaff;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h1 {
  margin-bottom: 0.45rem;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}

h2 {
  margin-bottom: 0.85rem;
  font-size: 1.15rem;
}

h3 {
  margin-bottom: 0.65rem;
  font-size: 1rem;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  color: #fff;
  background: var(--primary);
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
  transition: transform var(--transition);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(100, 181, 255, 0.82);
  outline-offset: 2px;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  height: 100vh;
  padding: 1.25rem 1rem;
  flex-direction: column;
  background: rgba(8, 13, 24, 0.96);
  border-right: 1px solid var(--border-soft);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  min-height: 48px;
  padding: 0 0.55rem;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  font-weight: 780;
  letter-spacing: -0.025em;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), #4f46e5 54%, #17b8bd);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(124, 108, 255, 0.22);
}

.brand-copy small {
  display: block;
  margin-top: 0.05rem;
  color: var(--text-subtle);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: grid;
  margin-top: 1.6rem;
  gap: 0.35rem;
}

.nav-label {
  padding: 0.55rem 0.65rem 0.2rem;
  color: var(--text-subtle);
  font-size: 0.71rem;
  font-weight: 720;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  min-height: 44px;
  padding: 0.65rem 0.7rem;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 610;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.nav-link svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  opacity: 0.82;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-soft);
}

.nav-link.is-active,
.nav-link[aria-current="page"] {
  color: #fff;
  background: linear-gradient(90deg, rgba(124, 108, 255, 0.2), rgba(124, 108, 255, 0.08));
  border-color: rgba(124, 108, 255, 0.32);
}

.nav-link.is-active svg,
.nav-link[aria-current="page"] svg {
  color: var(--primary-strong);
  opacity: 1;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
}

.sidebar-user {
  display: flex;
  padding: 0.75rem;
  align-items: center;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #35445e, #253149);
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.user-copy {
  min-width: 0;
  flex: 1;
}

.user-copy strong,
.user-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy strong {
  font-size: 0.84rem;
}

.user-copy span {
  color: var(--text-subtle);
  font-size: 0.72rem;
}

.main-column {
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  min-height: 68px;
  padding: 0 1.6rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(7, 11, 20, 0.78);
  border-bottom: 1px solid rgba(38, 52, 75, 0.74);
  backdrop-filter: blur(18px);
}

.topbar-title {
  min-width: 0;
}

.topbar-title strong {
  display: block;
  overflow: hidden;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-title span {
  color: var(--text-subtle);
  font-size: 0.73rem;
}

.topbar-actions,
.inline-actions,
.form-actions,
.page-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.sidebar-toggle {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

.page-content {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  padding: 1.7rem;
}

.page-header {
  display: flex;
  margin-bottom: 1.4rem;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.page-header p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--text-muted);
}

.breadcrumb {
  display: flex;
  margin: 0 0 0.5rem;
  padding: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  color: var(--text-subtle);
  font-size: 0.78rem;
  list-style: none;
}

.breadcrumb li + li::before {
  margin-right: 0.4rem;
  content: "/";
  color: #42506a;
}

.grid {
  display: grid;
  gap: 1rem;
}

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

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

.stats-grid {
  display: grid;
  margin-bottom: 1.25rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.card,
.panel,
.stat-card {
  background: linear-gradient(145deg, rgba(21, 31, 49, 0.84), rgba(14, 22, 36, 0.96));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card,
.panel {
  padding: 1.2rem;
}

.stat-card {
  position: relative;
  min-height: 132px;
  padding: 1.15rem;
  overflow: hidden;
}

.stat-card::after {
  position: absolute;
  width: 90px;
  height: 90px;
  right: -28px;
  bottom: -38px;
  background: var(--primary-soft);
  border-radius: 50%;
  content: "";
  filter: blur(2px);
}

.stat-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.79rem;
  font-weight: 650;
}

.stat-value {
  display: block;
  margin-top: 0.7rem;
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  font-weight: 790;
  letter-spacing: -0.045em;
}

.stat-note {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-subtle);
  font-size: 0.72rem;
}

.panel-header {
  display: flex;
  margin: -0.05rem 0 1rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.panel-header h2,
.panel-header p {
  margin-bottom: 0;
}

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

.subtle {
  color: var(--text-subtle);
}

.text-small {
  font-size: 0.82rem;
}

.text-danger {
  color: var(--danger);
}

.text-success {
  color: var(--success);
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 0.75rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mb-0 {
  margin-bottom: 0;
}

.w-full {
  width: 100%;
}

.justify-center {
  justify-content: center;
}

.fieldset-reset {
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.auth-heading {
  margin-top: 0.8rem;
}

.stack {
  display: grid;
  gap: 1rem;
}

.stack-sm {
  display: grid;
  gap: 0.55rem;
}

.divider {
  height: 1px;
  margin: 1rem 0;
  background: var(--border-soft);
  border: 0;
}

.badge {
  display: inline-flex;
  min-height: 25px;
  padding: 0.2rem 0.55rem;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 740;
  line-height: 1.2;
  white-space: nowrap;
}

.badge-success {
  color: #7ce7bd;
  background: var(--success-soft);
  border-color: rgba(53, 212, 154, 0.24);
}

.badge-warning {
  color: #ffd48c;
  background: var(--warning-soft);
  border-color: rgba(246, 189, 96, 0.24);
}

.badge-danger {
  color: #ff9cab;
  background: var(--danger-soft);
  border-color: rgba(255, 113, 133, 0.24);
}

.badge-info {
  color: #9bd1ff;
  background: var(--info-soft);
  border-color: rgba(100, 181, 255, 0.24);
}

.badge-primary {
  color: #c2bcff;
  background: var(--primary-soft);
  border-color: rgba(124, 108, 255, 0.28);
}

.status-dot {
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0 3px currentColor inset;
}

.alert {
  position: relative;
  display: flex;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  align-items: flex-start;
  gap: 0.7rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.alert p:last-child {
  margin-bottom: 0;
}

.alert-success {
  color: #a8efd3;
  background: var(--success-soft);
  border-color: rgba(53, 212, 154, 0.25);
}

.alert-warning {
  color: #f8d99d;
  background: var(--warning-soft);
  border-color: rgba(246, 189, 96, 0.26);
}

.alert-danger,
.alert-error {
  color: #ffb5c0;
  background: var(--danger-soft);
  border-color: rgba(255, 113, 133, 0.27);
}

.alert-info {
  color: #b7ddff;
  background: var(--info-soft);
  border-color: rgba(100, 181, 255, 0.25);
}

.alert-dismiss {
  width: 30px;
  height: 30px;
  margin: -0.25rem -0.35rem -0.25rem auto;
  padding: 0;
  flex: 0 0 auto;
  color: currentColor;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.alert-dismiss:hover {
  background: rgba(255, 255, 255, 0.06);
}

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

.field {
  min-width: 0;
}

.field-full {
  grid-column: 1 / -1;
}

label,
.field-label {
  display: block;
  margin-bottom: 0.38rem;
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 680;
}

.required::after {
  margin-left: 0.2rem;
  color: var(--danger);
  content: "*";
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="url"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.68rem 0.78rem;
  color: var(--text);
  background: rgba(6, 11, 20, 0.72);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025) inset;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

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

input:hover,
select:hover,
textarea:hover {
  border-color: #354761;
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  background: rgba(8, 14, 25, 0.94);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 108, 255, 0.14);
}

input::placeholder,
textarea::placeholder {
  color: #536177;
}

input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

select {
  appearance: none;
  padding-right: 2.35rem;
  background-image:
    linear-gradient(45deg, transparent 50%, #8fa0b8 50%),
    linear-gradient(135deg, #8fa0b8 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 50%,
    calc(100% - 12px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

.field-help,
.field-error {
  display: block;
  margin-top: 0.38rem;
  font-size: 0.73rem;
}

.field-help {
  color: var(--text-subtle);
}

.field-error {
  color: #ff9cab;
}

[aria-invalid="true"] {
  border-color: var(--danger) !important;
}

.input-group {
  position: relative;
}

.input-group input {
  padding-right: 3rem;
}

.input-action {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transform: translateY(-50%);
}

.input-action:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.checkbox,
.radio {
  display: inline-flex;
  margin: 0;
  align-items: flex-start;
  gap: 0.55rem;
  color: var(--text-muted);
  cursor: pointer;
}

.checkbox input,
.radio input {
  width: 17px;
  height: 17px;
  margin: 0.15rem 0 0;
  flex: 0 0 auto;
  accent-color: var(--primary);
}

.btn {
  display: inline-flex;
  min-height: 40px;
  padding: 0.58rem 0.85rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  color: #dce7f7;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 720;
  line-height: 1.2;
  cursor: pointer;
  transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
}

.btn:hover {
  color: #fff;
  background: var(--surface-hover);
  border-color: #3b4d68;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn svg {
  width: 17px;
  height: 17px;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(145deg, #8576ff, #6755ef);
  border-color: #8f82ff;
  box-shadow: 0 10px 25px rgba(103, 85, 239, 0.2);
}

.btn-primary:hover {
  color: #fff;
  background: linear-gradient(145deg, #9487ff, #7362f7);
  border-color: #aa9fff;
}

.btn-success {
  color: #06271d;
  background: var(--success);
  border-color: #68e0b4;
}

.btn-danger {
  color: #ffb8c2;
  background: var(--danger-soft);
  border-color: rgba(255, 113, 133, 0.28);
}

.btn-danger:hover {
  color: #fff;
  background: rgba(255, 113, 133, 0.2);
  border-color: rgba(255, 113, 133, 0.5);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-sm {
  min-height: 33px;
  padding: 0.42rem 0.62rem;
  font-size: 0.73rem;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.table-toolbar {
  display: flex;
  margin-bottom: 1rem;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.filter-grid {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(135px, 1fr)) auto;
  align-items: end;
  gap: 0.65rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

th,
td {
  padding: 0.78rem 0.85rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-soft);
}

th {
  color: var(--text-subtle);
  background: rgba(5, 10, 18, 0.48);
  font-size: 0.7rem;
  font-weight: 760;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.022);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.cell-primary {
  display: block;
  color: var(--text);
  font-weight: 680;
}

.cell-secondary {
  display: block;
  margin-top: 0.1rem;
  color: var(--text-subtle);
  font-size: 0.71rem;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  white-space: nowrap;
}

.empty-state {
  display: grid;
  min-height: 220px;
  padding: 2rem;
  place-items: center;
  text-align: center;
}

.empty-state-inner {
  max-width: 440px;
}

.empty-state-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 0.9rem;
  place-items: center;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border: 1px solid rgba(124, 108, 255, 0.25);
  border-radius: 15px;
}

.empty-state p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.pagination {
  display: flex;
  margin-top: 1rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--text-subtle);
  font-size: 0.76rem;
}

.pagination-links {
  display: flex;
  gap: 0.4rem;
}

.auth-body {
  display: grid;
  min-height: 100vh;
  padding: 1.25rem;
  place-items: center;
}

.auth-shell {
  width: min(100%, 440px);
}

.auth-brand {
  display: flex;
  margin-bottom: 1.25rem;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 780;
}

.auth-card {
  padding: clamp(1.25rem, 5vw, 2rem);
  background: rgba(15, 23, 38, 0.92);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.page-content > .auth-card {
  width: min(100%, 640px);
  margin-inline: auto;
}

.auth-card h1 {
  font-size: 1.55rem;
}

.auth-footer {
  margin-top: 1rem;
  color: var(--text-subtle);
  font-size: 0.72rem;
  text-align: center;
}

.code-input {
  min-height: 56px !important;
  font-size: 1.35rem !important;
  font-weight: 760;
  letter-spacing: 0.35em;
  text-align: center;
}

.secret-box,
.key-reveal {
  display: flex;
  padding: 0.8rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #080d17;
  border: 1px dashed #41516a;
  border-radius: 10px;
}

.secret-box code,
.key-reveal code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #d7e2f5;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
}

.qr-frame {
  width: min(220px, 100%);
  margin: 0 auto;
  padding: 0.75rem;
  background: #fff;
  border-radius: 14px;
}

.session-import {
  padding: 1rem;
  background: linear-gradient(145deg, rgba(124, 108, 255, 0.08), rgba(54, 212, 216, 0.035));
  border: 1px solid rgba(124, 108, 255, 0.25);
  border-radius: var(--radius);
}

.session-import textarea {
  min-height: 150px;
  color: #cbd5e1;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.76rem;
  line-height: 1.55;
}

.session-preview {
  display: grid;
  margin-top: 0.9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.preview-item {
  min-width: 0;
  padding: 0.7rem;
  background: rgba(5, 10, 18, 0.48);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}

.preview-item dt {
  margin-bottom: 0.18rem;
  color: var(--text-subtle);
  font-size: 0.66rem;
  font-weight: 720;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.preview-item dd {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.79rem;
  font-weight: 640;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-status {
  min-height: 1.2rem;
  margin: 0.65rem 0 0;
  color: var(--text-subtle);
  font-size: 0.74rem;
}

.import-status[data-state="success"] {
  color: var(--success);
}

.import-status[data-state="warning"] {
  color: var(--warning);
}

.import-status[data-state="error"] {
  color: var(--danger);
}

.definition-list {
  display: grid;
  margin: 0;
  grid-template-columns: minmax(135px, 0.45fr) minmax(0, 1fr);
  gap: 0;
}

.definition-list dt,
.definition-list dd {
  margin: 0;
  padding: 0.72rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.definition-list dt {
  color: var(--text-subtle);
  font-size: 0.75rem;
}

.definition-list dd {
  min-width: 0;
  color: var(--text);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.definition-list dt:last-of-type,
.definition-list dd:last-of-type {
  border-bottom: 0;
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-item {
  position: relative;
  padding: 0 0 1rem 1.35rem;
}

.timeline-item::before {
  position: absolute;
  top: 0.38rem;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border: 2px solid var(--surface);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(124, 108, 255, 0.28);
  content: "";
}

.timeline-item::after {
  position: absolute;
  top: 1rem;
  bottom: 0;
  left: 3px;
  width: 1px;
  background: var(--border);
  content: "";
}

.timeline-item:last-child::after {
  display: none;
}

.timeline-item p {
  margin-bottom: 0.12rem;
}

.timeline-item time {
  color: var(--text-subtle);
  font-size: 0.7rem;
}

.error-page {
  display: grid;
  min-height: 62vh;
  padding: 2rem;
  place-items: center;
  text-align: center;
}

.error-code {
  display: block;
  color: var(--primary-strong);
  font-size: clamp(4rem, 14vw, 8rem);
  font-weight: 850;
  letter-spacing: -0.08em;
  line-height: 0.9;
  opacity: 0.7;
}

.error-page p {
  max-width: 520px;
  margin-inline: auto;
  color: var(--text-muted);
}

[hidden] {
  display: none !important;
}

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

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

  .filter-grid .field:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(var(--sidebar-width), calc(100vw - 48px));
    transform: translateX(-105%);
    transition: transform 210ms ease;
  }

  .nav-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 35;
    inset: 0;
    display: block;
    visibility: hidden;
    background: rgba(0, 0, 0, 0.55);
    border: 0;
    opacity: 0;
    transition: opacity 210ms ease, visibility 210ms ease;
  }

  .nav-open .sidebar-backdrop {
    visibility: visible;
    opacity: 1;
  }

  .sidebar-toggle {
    display: inline-grid;
  }

  .topbar {
    padding: 0 1rem;
  }

  .topbar-left {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.65rem;
  }

  .page-content {
    padding: 1.2rem 1rem 2rem;
  }

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

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .page-actions .btn {
    flex: 1;
  }

  .stats-grid,
  .grid-2,
  .grid-3,
  .form-grid,
  .session-preview,
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .filter-grid .field:first-child,
  .field-full {
    grid-column: auto;
  }

  .card,
  .panel {
    padding: 1rem;
    border-radius: var(--radius);
  }

  .table-wrap {
    margin-inline: -1rem;
    width: calc(100% + 2rem);
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  th,
  td {
    padding: 0.7rem;
  }

  .definition-list {
    grid-template-columns: 1fr;
  }

  .definition-list dt {
    padding-bottom: 0.15rem;
    border-bottom: 0;
  }

  .definition-list dd {
    padding-top: 0.15rem;
  }

  .pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination-links .btn {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  .sidebar,
  .topbar,
  .page-actions,
  .table-actions,
  .btn,
  .alert-dismiss {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  body,
  .card,
  .panel {
    color: #111827;
    background: #fff;
    box-shadow: none;
  }

  .page-content {
    width: 100%;
    padding: 0;
  }
}

.totp-qr-wrap {
  text-align: center;
  margin: 1.25rem 0;
}
.totp-qr-box {
  display: inline-block;
  padding: 6px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.totp-details {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  padding: 0.75rem;
}
.totp-details summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: #94a3b8;
  user-select: none;
}
.totp-details .field {
  margin-top: 0.75rem;
}

