:root {
  --bg: #09070f;
  --bg-soft: #120d1d;
  --bg-elevated: #171125;
  --panel: rgba(20, 14, 31, 0.92);
  --panel-strong: rgba(28, 19, 44, 0.96);
  --line: rgba(175, 138, 255, 0.18);
  --line-strong: rgba(185, 143, 255, 0.32);
  --text: #f5efff;
  --muted: #b7a8d8;
  --accent: #9f6fff;
  --accent-strong: #7b42f6;
  --accent-soft: rgba(159, 111, 255, 0.18);
  --ok: #59d68b;
  --warn: #ffc46b;
  --danger: #ff7c98;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

#seed-data {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(144, 86, 255, 0.24), transparent 28%),
    radial-gradient(circle at bottom right, rgba(78, 19, 163, 0.28), transparent 34%),
    linear-gradient(180deg, #05040a 0%, #0b0713 44%, #120a1e 100%);
  color: var(--text);
  font-family: Inter, "Segoe UI Variable", "Segoe UI", "Yu Gothic UI", sans-serif;
}

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

.inline-link {
  color: #d9c9ff;
  text-decoration: none;
}

.inline-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.shell {
  display: grid;
  grid-template-columns: 252px 1fr;
  min-height: 100vh;
}

.shell-modern {
  background:
    linear-gradient(90deg, #25264a 0 252px, transparent 252px),
    linear-gradient(180deg, rgba(116, 47, 178, 0.18), transparent 120px),
    radial-gradient(circle at top right, rgba(182, 70, 255, 0.2), transparent 22%),
    linear-gradient(180deg, #2a2348 0%, #3a2360 42%, #60238b 100%);
}

.sidebar {
  padding: 24px 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(7, 6, 12, 0.95), rgba(15, 10, 23, 0.94));
  backdrop-filter: blur(18px);
}

.sidebar-modern {
  background: linear-gradient(180deg, rgba(35, 38, 76, 0.98), rgba(33, 35, 68, 0.96));
  border-right-color: rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, #ff72d8, #8b57ff);
  box-shadow: 0 10px 24px rgba(129, 62, 242, 0.28);
}

.brand h1,
.topbar h2,
.panel-head h3 {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand p,
.eyebrow {
  margin: 4px 0 0;
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 12px;
}

.nav-item {
  width: 100%;
  padding: 15px 16px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: 0.18s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.04);
}

.nav-item strong,
.nav-item span {
  display: block;
}

.nav-item strong {
  font-size: 15px;
}

.nav-item span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.nav-item.active {
  border-color: rgba(255, 255, 255, 0.92);
  background: linear-gradient(90deg, #8e2dff 0%, #f00088 100%);
  box-shadow:
    inset 0 0 0 1px rgba(19, 13, 37, 0.8),
    0 8px 18px rgba(85, 20, 135, 0.18);
}

.nav-item.active span,
.nav-item.active strong {
  color: #ffffff;
}

.sidebar-card,
.panel,
.modal-card,
.login-card {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(25, 17, 38, 0.94), rgba(14, 10, 22, 0.95));
  box-shadow: var(--shadow);
}

.sidebar-card {
  margin-top: 22px;
  padding: 18px 18px;
}

.sidebar-card h2 {
  margin: 0 0 12px;
  font-size: 15px;
}

.sidebar-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.main {
  padding: 26px;
}

.main-modern {
  padding: 0 26px 26px;
}

.topbar,
.panel-head,
.toolbar,
.pagination,
.modal-actions,
.topbar-actions {
  display: flex;
  align-items: center;
}

.topbar,
.panel-head,
.pagination {
  justify-content: space-between;
}

.topbar {
  gap: 16px;
  margin-bottom: 18px;
}

.topbar-modern {
  margin: 0 -26px 24px;
  padding: 14px 26px 14px;
  min-height: 58px;
  background: linear-gradient(90deg, rgba(60, 47, 110, 0.94), rgba(110, 39, 170, 0.94));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.topbar-actions,
.toolbar,
.modal-actions {
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-modern .ghost-button,
.topbar-modern .primary-button {
  height: 40px;
  border-radius: 13px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.stats-grid,
.content-grid,
.form-grid {
  display: grid;
  gap: 16px;
}

.stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.compact-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 24px;
  gap: 14px;
}

.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 18px;
}

.panel {
  padding: 20px;
  background: linear-gradient(180deg, rgba(37, 27, 66, 0.96), rgba(25, 18, 45, 0.98));
  border-color: rgba(255, 255, 255, 0.06);
}

.panel-table {
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(55, 42, 95, 0.9), rgba(55, 39, 93, 0.9));
}

.panel-head {
  gap: 10px;
  margin-bottom: 14px;
}

.panel-head-spread {
  padding: 22px 22px 18px;
  margin-bottom: 0;
}

.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.section-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pill.low {
  background: rgba(89, 214, 139, 0.12);
  color: #9ff0bf;
}

.pill.high {
  background: rgba(255, 124, 152, 0.12);
  color: #ffadc0;
}

.pill.neutral {
  background: var(--accent-soft);
  color: #dbc8ff;
}

.stat-card,
.alert-card,
.launch-card,
.log-card,
.event-card {
  border-radius: 20px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.03);
}

.stat-card-modern {
  display: grid;
  grid-template-columns: 54px 1fr;
  grid-template-areas:
    "icon label"
    "value value";
  align-items: start;
  column-gap: 14px;
  row-gap: 14px;
  min-height: 116px;
  padding: 18px 20px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(58, 45, 102, 0.92), rgba(49, 36, 88, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.stat-icon {
  grid-area: icon;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  flex: 0 0 auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.stat-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tone-blue {
  background: linear-gradient(135deg, #1ca8ff, #306dff);
}

.tone-green {
  background: linear-gradient(135deg, #05d56d, #14ba54);
}

.tone-orange {
  background: linear-gradient(135deg, #ff9817, #ff5f2b);
}

.tone-pink {
  background: linear-gradient(135deg, #cf49ff, #ff4dbd);
}

.stat-copy {
  display: contents;
  min-width: 0;
}

.stat-copy span {
  grid-area: label;
  align-self: center;
  color: #d1c0f5;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.15;
}

.stat-card strong {
  grid-area: value;
  display: block;
  margin-top: 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-card span,
.stack small,
.info-list p {
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 12px;
}

.event-card,
.log-card {
  position: relative;
  overflow: hidden;
  border-left: 4px solid rgba(159, 111, 255, 0.95);
  background: linear-gradient(180deg, rgba(42, 31, 72, 0.94), rgba(33, 25, 57, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 10px 24px rgba(0, 0, 0, 0.16);
}

.event-card::after,
.log-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 42%);
}

.event-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.event-card-danger {
  border-left-color: #ff6c95;
}

.event-card-warn {
  border-left-color: #ff9856;
}

.event-card-success {
  border-left-color: #ff7fa6;
}

.event-card-accent {
  border-left-color: #9c6dff;
}

.event-card-neutral {
  border-left-color: #7f5cff;
}

.event-meta {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #d7c7ff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.event-card-danger .event-meta {
  background: rgba(255, 108, 149, 0.14);
  color: #ffb1c6;
}

.event-card-warn .event-meta {
  background: rgba(255, 152, 86, 0.14);
  color: #ffc499;
}

.event-card-success .event-meta {
  background: rgba(255, 127, 166, 0.12);
  color: #ffc0d7;
}

.event-card strong,
.log-card strong {
  display: block;
  margin-bottom: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.event-card p,
.log-card p {
  margin: 0;
  line-height: 1.65;
  color: #f2ebff;
  font-size: 14px;
}

.empty-state {
  padding: 22px;
  border: 1px dashed rgba(190, 148, 255, 0.24);
  border-radius: 18px;
  color: #b7a8d8;
  background: rgba(255, 255, 255, 0.025);
}

.audit-summary-card p {
  min-height: 46px;
}

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

.audit-mini-grid span,
.audit-field-grid span,
.audit-log-meta span {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: #f4efff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-mini-grid b,
.audit-field-grid b,
.audit-log-meta b {
  display: block;
  margin-bottom: 3px;
  color: #a896cf;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.audit-log-card {
  border-left-width: 3px;
  padding: 18px;
}

.audit-log-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
}

.audit-log-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, rgba(128, 83, 255, 0.95), rgba(197, 77, 255, 0.92));
  box-shadow: 0 0 22px rgba(163, 94, 255, 0.28);
}

.audit-log-body {
  min-width: 0;
}

.audit-log-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.audit-log-meta {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.audit-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

#alerts-list .event-card,
#launch-list .event-card {
  min-height: 108px;
}

#launch-list .event-card p {
  color: #f7f1ff;
}

.toolbar {
  margin-bottom: 14px;
}

.toolbar-split {
  justify-content: space-between;
  padding: 0 22px 18px;
  margin-bottom: 0;
  gap: 14px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}

.selection-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.045);
}

.selection-bar .ghost-button {
  height: 38px;
  padding: 0 14px;
  border-radius: 12px;
}

.table-count {
  margin-left: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(18, 13, 30, 0.72);
  color: #cabbeb;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.search-field {
  min-width: 320px;
  position: relative;
}

.search-field::before {
  content: "⌕";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #8d80ae;
  font-size: 15px;
  pointer-events: none;
}

.search-field .text-input {
  padding-left: 38px;
}

.filter-select {
  width: auto;
  min-width: 0;
  max-width: none;
}

.text-input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.text-input:focus,
textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(159, 111, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.text-input {
  height: 42px;
  padding: 0 14px;
}

select.text-input,
option {
  background: #1a1327;
  color: var(--text);
}

select.text-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, #ffffff 50%),
    linear-gradient(135deg, #ffffff 50%, transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08));
  background-position:
    calc(100% - 18px) 17px,
    calc(100% - 12px) 17px,
    calc(100% - 34px) 10px;
  background-size:
    5px 5px,
    5px 5px,
    1px 20px;
  background-repeat: no-repeat;
  border-color: rgba(255, 255, 255, 0.06);
  background-color: rgba(18, 13, 30, 0.9);
  font-size: 14px;
  width: fit-content;
  min-width: 158px;
}

select.text-input:hover {
  background-color: rgba(24, 17, 39, 0.96);
}

select.text-input:focus {
  background-color: rgba(44, 29, 74, 0.92);
  border-color: rgba(171, 131, 255, 0.34);
  box-shadow: 0 0 0 3px rgba(120, 74, 238, 0.14);
}

textarea {
  min-height: 240px;
  padding: 14px;
  resize: vertical;
  font: 13px/1.6 Consolas, monospace;
  background: #140f1f;
  color: #f7f2ff;
}

.primary-button,
.ghost-button {
  height: 44px;
  padding: 0 16px;
  border-radius: 15px;
  cursor: pointer;
  transition: 0.18s ease;
}

.primary-button {
  border: 1px solid rgba(196, 172, 255, 0.35);
  background: linear-gradient(180deg, #a970ff, #7337f2);
  color: #fff;
}

.primary-button-small {
  height: 38px;
  padding: 0 16px;
  border-radius: 12px;
  background: linear-gradient(90deg, #9f42ff, #ff1494);
}

.primary-button:hover {
  filter: brightness(1.06);
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.ghost-button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.ghost-button:disabled,
.primary-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.actions-col {
  position: relative;
}

.actions-col .ghost-button {
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
}

.manage-license-button {
  min-width: 92px;
  justify-content: center;
}

.table-wrap {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.table-wrap-modern {
  border-left: none;
  border-right: none;
  border-bottom: none;
  border-radius: 0;
}

.table-wrap-modern table {
  min-width: 980px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  padding: 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
}

.checkbox-col {
  width: 42px;
  text-align: center;
}

.row-selector,
.checkbox-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #c356ff;
  cursor: pointer;
}

.key-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(139, 82, 255, 0.18);
  color: #e8d7ff;
  font-family: Consolas, monospace;
  font-size: 13px;
  max-width: 100%;
  word-break: break-all;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill-active {
  background: rgba(34, 205, 112, 0.16);
  color: #87f0ba;
}

.status-pill-unused {
  background: rgba(163, 133, 255, 0.16);
  color: #d9c7ff;
}

.status-pill-danger {
  background: rgba(255, 86, 122, 0.16);
  color: #ff9db1;
}

.status-pill-warn {
  background: rgba(255, 176, 54, 0.16);
  color: #ffd18a;
}

.status-pill-muted {
  background: rgba(255, 255, 255, 0.08);
  color: #d0c4e6;
}

.muted-value {
  color: #8f83ac;
}

th {
  color: var(--muted);
  font-weight: 600;
  background: rgba(26, 21, 51, 0.72);
  letter-spacing: 0.04em;
  font-size: 11px;
}

tbody tr {
  transition: background 0.16s ease;
}

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

.table-action-button {
  height: 36px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 12px;
}

tr:last-child td {
  border-bottom: none;
}

.pagination,
.modal-actions {
  margin-top: 14px;
}

.modal-actions {
  padding: 0;
  margin-bottom: 0;
  list-style: none;
  justify-content: flex-end;
}

.modal-actions-split {
  justify-content: space-between;
  align-items: center;
}

.modal-actions-left,
.modal-actions-right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.danger-button {
  border-color: rgba(255, 124, 152, 0.3);
  color: #ffafc0;
}

.pagination {
  justify-content: flex-end;
  gap: 10px;
}

.info-list {
  display: grid;
  gap: 14px;
}

.info-list strong {
  display: block;
  margin-bottom: 5px;
}

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

.detail-item {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  min-width: 0;
}

.detail-item strong {
  display: block;
  margin-bottom: 8px;
}

.detail-item p {
  margin: 0;
  color: var(--muted);
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.6;
}

.modal {
  width: min(720px, calc(100vw - 24px));
  border: none;
  padding: 0;
  background: transparent;
  color: var(--text);
  margin: auto;
  inset: 0;
  overflow: hidden;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.68);
}

.modal-card {
  padding: 20px;
  margin: 0;
  width: 100%;
  max-height: min(86vh, 920px);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(33, 23, 52, 0.98), rgba(17, 12, 27, 0.99));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-card.wide {
  width: min(880px, calc(100vw - 24px));
}

#result-modal {
  width: min(880px, calc(100vw - 24px));
}

#reseller-result-modal {
  width: min(880px, calc(100vw - 24px));
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 6px;
}

.form-grid label {
  display: grid;
  gap: 8px;
}

.form-grid label span {
  color: var(--muted);
  font-size: 13px;
}

.hint,
.result-meta {
  color: var(--muted);
}

.hint {
  margin-top: 12px;
  line-height: 1.6;
}

.maintenance-panel {
  margin-bottom: 20px;
}

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

.info-tile {
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.info-tile strong {
  display: block;
  margin-bottom: 8px;
}

.info-tile p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.text-area-input {
  min-height: 92px;
  resize: vertical;
  padding: 14px 16px;
}

.result-meta {
  margin-bottom: 12px;
}

#result-keys {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 320px;
  max-height: 48vh;
  margin: 0;
  overflow: auto;
  resize: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#reseller-result-keys,
#reseller-result-credentials {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 320px;
  max-height: 48vh;
  margin: 0;
  overflow: auto;
  resize: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.login-body {
  display: grid;
  place-items: center;
  padding: 32px 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    radial-gradient(circle at top center, rgba(159, 111, 255, 0.18), transparent 28%),
    linear-gradient(180deg, #05040a, #11091c);
  background-size: 48px 48px, 48px 48px, auto, auto;
}

.login-shell {
  width: min(1040px, 100%);
  display: grid;
  gap: 28px;
}

.login-hero {
  text-align: center;
}

.login-kicker {
  margin: 0 0 12px;
  color: #ccb5ff;
  letter-spacing: 0.42em;
  font-size: 13px;
  text-transform: uppercase;
}

.login-hero h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.08;
}

.login-hero p,
.login-sub {
  color: var(--muted);
}

.login-card {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 26px;
}

.stack {
  gap: 14px;
}

.login-head {
  text-align: center;
  margin-bottom: 22px;
}

.login-head h2 {
  margin: 0;
  font-size: 42px;
}

.login-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 18px;
}

.login-form label {
  display: grid;
  gap: 8px;
}

.login-form label span {
  color: var(--text);
  font-weight: 700;
}

.login-input {
  height: 58px;
  border-radius: 16px;
  font-size: 16px;
}

.login-submit {
  height: 56px;
  border: 1px solid rgba(196, 172, 255, 0.35);
  border-radius: 16px;
  background: linear-gradient(180deg, #a970ff, #7337f2);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  cursor: pointer;
}

.login-note {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.login-note strong {
  display: block;
  margin-bottom: 6px;
}

.login-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 1120px) {
  .shell,
  .content-grid,
  .stats-grid,
  .form-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

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

  .audit-mini-grid,
  .audit-log-meta,
  .audit-field-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .main,
  .sidebar {
    padding: 18px;
  }

  .toolbar,
  .topbar-actions,
  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-split,
  .panel-head-spread,
  .panel-head-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-left {
    flex-wrap: wrap;
  }

  .table-count {
    margin-left: 0;
  }

  .search-field {
    min-width: 0;
  }

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

  .modal-actions-left,
  .modal-actions-right {
    width: 100%;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .manage-license-button {
    width: 100%;
  }
}

/* VILLAIN WebMenu inspired refinement layer. Keep markup stable and only tune surface quality. */
body {
  background:
    radial-gradient(circle at 6% 18%, rgba(168, 76, 255, 0.2), transparent 24%),
    radial-gradient(circle at 92% 12%, rgba(93, 42, 170, 0.22), transparent 30%),
    linear-gradient(135deg, rgba(120, 43, 190, 0.12) 0 1px, transparent 1px),
    linear-gradient(180deg, #050309 0%, #090611 44%, #0b0714 100%);
  background-size: auto, auto, 68px 68px, auto;
}

.shell-modern {
  background:
    linear-gradient(90deg, rgba(4, 4, 8, 0.98) 0 252px, rgba(7, 5, 12, 0.9) 252px),
    radial-gradient(circle at 100% 0%, rgba(184, 69, 255, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(90, 38, 150, 0.1), transparent 180px);
}

.sidebar-modern {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(7, 7, 12, 0.98), rgba(3, 3, 7, 0.98)),
    radial-gradient(circle at 0% 8%, rgba(179, 76, 255, 0.2), transparent 26%);
  border-right: 1px solid rgba(180, 98, 255, 0.18);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.025);
}

.sidebar-modern::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184, 120, 255, 0.22), transparent);
  pointer-events: none;
}

.brand-modern {
  padding: 6px 6px 18px;
  border-bottom: 1px solid rgba(180, 98, 255, 0.14);
}

.brand-mark {
  border-radius: 16px;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.24), transparent 22%),
    linear-gradient(135deg, #cc4cff, #6a38ff 58%, #23104b);
  border: 1px solid rgba(220, 170, 255, 0.32);
  box-shadow:
    0 0 22px rgba(178, 78, 255, 0.34),
    inset 0 0 18px rgba(255, 255, 255, 0.08);
}

.brand h1 {
  font-weight: 900;
  letter-spacing: 0.02em;
  text-shadow: 0 0 18px rgba(180, 112, 255, 0.28);
}

.nav-modern {
  gap: 9px;
}

.nav-item {
  position: relative;
  border-radius: 16px;
  border-color: transparent;
}

.nav-item::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 9px;
  height: 9px;
  transform: translateY(-50%) rotate(45deg);
  border: 1px solid rgba(200, 118, 255, 0.72);
  box-shadow: 0 0 12px rgba(190, 78, 255, 0.42);
}

.nav-item strong,
.nav-item span {
  padding-left: 24px;
}

.nav-item:hover {
  background: linear-gradient(90deg, rgba(176, 72, 255, 0.12), rgba(255, 255, 255, 0.02));
  border-color: rgba(190, 110, 255, 0.16);
}

.nav-item.active {
  border-color: rgba(211, 105, 255, 0.62);
  background:
    linear-gradient(90deg, rgba(180, 78, 255, 0.34), rgba(255, 255, 255, 0.04)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), transparent);
  box-shadow:
    0 0 28px rgba(172, 64, 255, 0.28),
    inset 3px 0 0 #d04cff,
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.main-modern {
  padding: 0 28px 28px;
}

.topbar-modern {
  margin: 0 -28px 26px;
  min-height: 76px;
  padding: 16px 28px;
  background:
    linear-gradient(90deg, rgba(8, 6, 13, 0.96), rgba(14, 9, 22, 0.92)),
    linear-gradient(180deg, rgba(173, 92, 255, 0.08), transparent);
  border-bottom: 1px solid rgba(176, 106, 255, 0.16);
}

.topbar h2 {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.panel,
.modal-card,
.login-card {
  border-color: rgba(176, 106, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(28, 25, 35, 0.9), rgba(10, 9, 15, 0.96)),
    radial-gradient(circle at 0% 0%, rgba(183, 78, 255, 0.12), transparent 36%);
  box-shadow:
    0 24px 72px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.panel-table {
  background:
    linear-gradient(180deg, rgba(22, 19, 29, 0.94), rgba(8, 7, 12, 0.97)),
    radial-gradient(circle at 100% 0%, rgba(182, 76, 255, 0.1), transparent 36%);
  border-radius: 24px;
}

.panel-head-spread {
  border-bottom: 1px solid rgba(176, 106, 255, 0.11);
}

.stat-card-modern,
.info-tile,
.event-card,
.log-card {
  border-color: rgba(176, 106, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(27, 25, 34, 0.9), rgba(12, 11, 17, 0.94)),
    radial-gradient(circle at 100% 0%, rgba(173, 72, 255, 0.1), transparent 42%);
}

.stat-card-modern {
  border-radius: 20px;
  min-height: 108px;
}

.stat-icon {
  border: 1px solid rgba(220, 170, 255, 0.2);
  box-shadow:
    0 0 18px rgba(168, 77, 255, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.primary-button,
.login-submit {
  border-color: rgba(226, 156, 255, 0.42);
  background: linear-gradient(135deg, #7d48ff, #ca4cff);
  box-shadow:
    0 0 24px rgba(182, 74, 255, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.ghost-button {
  border-color: rgba(176, 106, 255, 0.2);
  background: rgba(255, 255, 255, 0.035);
}

.ghost-button:hover,
.primary-button:hover,
.login-submit:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.text-input,
textarea {
  border-color: rgba(176, 106, 255, 0.22);
  background: rgba(255, 255, 255, 0.055);
}

.text-input:focus,
textarea:focus {
  border-color: rgba(210, 105, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(183, 78, 255, 0.13), 0 0 22px rgba(174, 80, 255, 0.1);
}

.table-wrap-modern,
.table-wrap {
  border-top: 1px solid rgba(176, 106, 255, 0.1);
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(12, 10, 18, 0.96);
  color: #cbb9f2;
  font-size: 11px;
  letter-spacing: 0.08em;
}

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

tbody tr:hover {
  background: rgba(176, 87, 255, 0.08);
}

td,
th {
  border-bottom-color: rgba(176, 106, 255, 0.095);
}

.key-chip {
  border: 1px solid rgba(187, 110, 255, 0.25);
  background: rgba(160, 95, 255, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.muted,
.section-subtitle,
.hint,
.result-meta {
  color: #a99ac5;
}

.login-body {
  background:
    radial-gradient(circle at 50% 0%, rgba(177, 76, 255, 0.18), transparent 34%),
    radial-gradient(circle at 0% 100%, rgba(112, 54, 220, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(140, 68, 255, 0.12) 0 1px, transparent 1px),
    linear-gradient(180deg, #050309, #0a0612 60%, #10091a);
  background-size: auto, auto, 58px 58px, auto;
}

@media (min-width: 1121px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
  }

  .compact-stats {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
  }
}

/* 2026 operations console — professional black-system layer */
:root {
  --bg: #050608;
  --bg-soft: #0a0c11;
  --bg-elevated: #10131a;
  --panel: rgba(12, 14, 19, 0.94);
  --panel-strong: rgba(16, 19, 26, 0.98);
  --line: rgba(151, 166, 196, 0.13);
  --line-strong: rgba(148, 118, 255, 0.34);
  --text: #f4f6fb;
  --muted: #858da0;
  --accent: #8b6cff;
  --accent-strong: #7251f5;
  --accent-soft: rgba(139, 108, 255, 0.12);
  --cyan: #44e1cc;
  --ok: #49d69a;
  --warn: #f4ba62;
  --danger: #ff6f8f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

body {
  background:
    radial-gradient(circle at 78% -10%, rgba(111, 74, 255, 0.12), transparent 28%),
    radial-gradient(circle at 18% 110%, rgba(36, 190, 174, 0.07), transparent 30%),
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    #050608;
  background-size: auto, auto, 52px 52px, 52px 52px, auto;
}

.shell,
.shell-modern {
  grid-template-columns: 272px minmax(0, 1fr);
  background: transparent;
}

.sidebar-modern {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 18px;
  background:
    linear-gradient(180deg, rgba(9, 11, 15, 0.99), rgba(5, 6, 9, 0.99)),
    radial-gradient(circle at 50% 0%, rgba(130, 91, 255, 0.12), transparent 34%);
  border-right: 1px solid rgba(139, 108, 255, 0.16);
}

.brand-modern {
  margin-bottom: 20px;
  padding: 4px 7px 20px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.17), transparent 42%),
    linear-gradient(135deg, #8264ff, #512bd4);
  border: 1px solid rgba(190, 174, 255, 0.34);
  box-shadow: 0 0 26px rgba(108, 74, 255, 0.24);
}

.brand h1 {
  font-size: 16px;
  letter-spacing: 0.075em;
  text-shadow: none;
}

.nav-modern {
  gap: 6px;
}

.nav-item {
  min-height: 62px;
  padding: 12px 14px;
  border-radius: 12px;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.nav-item::before {
  left: 14px;
  width: 7px;
  height: 7px;
  border-color: rgba(151, 166, 196, 0.36);
  box-shadow: none;
}

.nav-item strong,
.nav-item span {
  padding-left: 22px;
}

.nav-item strong {
  color: #dfe3ec;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.nav-item span {
  margin-top: 4px;
  color: #687083;
  font-size: 11px;
}

.nav-item:hover {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(151, 166, 196, 0.1);
}

.nav-item.active {
  transform: translateX(0);
  background:
    linear-gradient(90deg, rgba(128, 94, 255, 0.18), rgba(128, 94, 255, 0.035)),
    rgba(255, 255, 255, 0.018);
  border-color: rgba(139, 108, 255, 0.26);
  box-shadow: inset 2px 0 0 #9276ff, 0 8px 26px rgba(0, 0, 0, 0.18);
}

.nav-item.active::before {
  border-color: #9c84ff;
  background: #9c84ff;
  box-shadow: 0 0 12px rgba(148, 118, 255, 0.7);
}

.main-modern {
  min-width: 0;
  padding: 0 32px 36px;
}

.topbar-modern {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -32px 28px;
  min-height: 82px;
  padding: 16px 32px;
  background: rgba(7, 8, 12, 0.82);
  border-bottom: 1px solid rgba(151, 166, 196, 0.1);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(22px) saturate(130%);
}

.topbar h2 {
  font-size: 21px;
  letter-spacing: -0.025em;
}

.topbar-subtitle {
  margin: 5px 0 0;
  color: #747d91;
  font-size: 12px;
}

.view.active {
  display: block;
}

.view.view-entering {
  animation: consoleViewIn 360ms cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes consoleViewIn {
  from { opacity: 0; transform: translate3d(0, 12px, 0) scale(.994); filter: blur(2px); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); filter: blur(0); }
}

.panel,
.modal-card,
.login-card {
  border-color: rgba(151, 166, 196, 0.13);
  background:
    linear-gradient(180deg, rgba(17, 19, 25, 0.94), rgba(9, 11, 15, 0.97)),
    radial-gradient(circle at 100% 0%, rgba(124, 91, 255, 0.055), transparent 38%);
  box-shadow: 0 22px 68px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.panel {
  border-radius: 18px;
}

.panel-head h3 {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.panel-head-spread {
  padding-bottom: 18px;
  border-bottom-color: rgba(151, 166, 196, 0.09);
}

.section-subtitle,
.hint,
.result-meta,
.muted {
  color: #7e879b;
}

.stat-card-modern {
  min-height: 104px;
  padding: 19px;
  border-radius: 16px;
  border-color: rgba(151, 166, 196, 0.12);
  background: linear-gradient(145deg, rgba(17, 20, 27, 0.96), rgba(10, 12, 17, 0.96));
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.stat-card-modern:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 108, 255, 0.25);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}

.stat-copy span {
  color: #7e8798;
  font-size: 11px;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.stat-copy strong {
  font-size: 27px;
  letter-spacing: -0.04em;
}

.primary-button,
.ghost-button,
.login-submit {
  min-height: 38px;
  border-radius: 10px;
  transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.primary-button,
.login-submit {
  color: #fff;
  border-color: rgba(172, 151, 255, 0.38);
  background: linear-gradient(135deg, #7656ed, #9b6cff);
  box-shadow: 0 8px 24px rgba(90, 57, 211, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.ghost-button {
  color: #c7cdd9;
  border-color: rgba(151, 166, 196, 0.15);
  background: rgba(255, 255, 255, 0.025);
}

.ghost-button:hover,
.primary-button:hover,
.login-submit:hover {
  filter: none;
  transform: translateY(-1px);
  border-color: rgba(153, 126, 255, 0.42);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.primary-button:active,
.ghost-button:active {
  transform: translateY(0) scale(.98);
}

button:disabled {
  cursor: not-allowed;
  opacity: .42;
  transform: none !important;
}

.text-input,
textarea {
  min-height: 42px;
  color: #edf0f6;
  border-color: rgba(151, 166, 196, 0.15);
  border-radius: 10px;
  background: rgba(5, 7, 10, 0.72);
}

.text-input:hover,
textarea:hover {
  border-color: rgba(151, 166, 196, 0.24);
}

.text-input:focus,
textarea:focus {
  border-color: rgba(139, 108, 255, 0.58);
  box-shadow: 0 0 0 3px rgba(139, 108, 255, 0.11);
}

.table-wrap,
.table-wrap-modern {
  border-color: rgba(151, 166, 196, 0.09);
}

thead th {
  height: 44px;
  color: #858fa3;
  background: rgba(7, 9, 13, 0.96);
  border-bottom-color: rgba(151, 166, 196, 0.12);
}

tbody tr {
  background: rgba(255, 255, 255, 0.006);
  transition: background-color 140ms ease;
}

tbody tr:hover {
  background: rgba(139, 108, 255, 0.052);
}

td,
th {
  border-bottom-color: rgba(151, 166, 196, 0.075);
}

.key-chip {
  border-color: rgba(139, 108, 255, 0.23);
  background: rgba(139, 108, 255, 0.09);
  box-shadow: none;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.modal[open] .modal-card {
  animation: modalDeploy 300ms cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes modalDeploy {
  from { opacity: 0; transform: translateY(14px) scale(.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-card {
  border-radius: 20px;
}

/* Model commerce */
.model-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
  padding: 26px 28px;
  background:
    linear-gradient(100deg, rgba(18, 21, 28, 0.98), rgba(10, 12, 17, 0.96)),
    radial-gradient(circle at 80% 0%, rgba(69, 225, 204, 0.1), transparent 28%);
}

.model-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 50%, rgba(139, 108, 255, 0.06) 50.2%, transparent 72%);
}

.model-hero-copy,
.model-grant-cta {
  position: relative;
  z-index: 1;
}

.model-hero h3 {
  margin: 7px 0 8px;
  font-size: 22px;
  letter-spacing: -0.035em;
}

.model-hero p {
  max-width: 720px;
  margin: 0;
  color: #8c95a8;
  font-size: 13px;
  line-height: 1.7;
}

.eyebrow {
  color: #9d88ff;
  font-weight: 800;
  letter-spacing: .19em;
}

.model-grant-cta {
  min-width: 164px;
}

.model-stats {
  margin-bottom: 18px;
}

.model-entitlements-panel {
  padding-top: 22px;
}

.model-filter-actions {
  flex-wrap: wrap;
}

.model-filter-actions .search-field {
  min-width: 220px;
}

.model-filter-actions .filter-select {
  min-width: 150px;
}

.model-entitlement-table {
  min-width: 1260px;
}

.model-name-cell {
  color: #ece9ff;
  white-space: nowrap;
}

.model-user-line {
  margin-top: 6px;
}

.date-stack {
  white-space: nowrap;
  color: #c7cdd9;
  font-variant-numeric: tabular-nums;
}

.identity-lock-list {
  display: grid;
  gap: 4px;
  min-width: 154px;
}

.identity-lock-list span {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 7px;
  color: #aeb5c3;
  font-size: 11px;
}

.identity-lock-list b {
  color: #626c7e;
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.model-actions-col {
  display: flex;
  gap: 6px;
  min-width: 222px;
}

.model-actions-col .ghost-button {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 11px;
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.model-empty-state {
  display: grid;
  gap: 7px;
  min-height: 180px;
  place-content: center;
  text-align: center;
}

.model-empty-state strong {
  color: #dfe3eb;
  font-size: 15px;
}

.model-empty-state span {
  color: #737c8f;
}

.model-grant-card {
  width: min(1040px, calc(100vw - 40px));
  padding: 26px;
}

#model-grant-modal {
  width: min(1040px, calc(100vw - 40px));
  max-width: none;
  overflow: visible;
}

#model-grant-modal .model-grant-card {
  width: 100%;
  max-width: none;
  max-height: min(90dvh, 920px);
  overflow-x: hidden;
  overflow-y: auto;
}

.model-grant-head {
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(151, 166, 196, 0.1);
}

.model-grant-head h3 {
  margin-top: 7px;
  font-size: 20px;
}

.model-grant-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 22px;
  margin-top: 22px;
}

.model-grant-form {
  min-width: 0;
}

.field-label,
.model-grant-form label {
  display: grid;
  gap: 8px;
}

.field-label > span,
.model-grant-form label > span {
  color: #9aa3b4;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .055em;
}

.input-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

.model-form-grid {
  margin-top: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.identity-preview {
  margin-top: 13px;
  padding: 15px;
  border: 1px solid rgba(151, 166, 196, 0.12);
  border-radius: 12px;
  background: rgba(4, 6, 9, 0.54);
  transition: border-color 180ms ease, background-color 180ms ease;
}

.identity-preview.identity-ready {
  border-color: rgba(73, 214, 154, 0.28);
  background: rgba(34, 154, 107, 0.055);
}

.identity-preview.identity-error {
  border-color: rgba(255, 111, 143, 0.28);
  background: rgba(255, 111, 143, 0.045);
}

.identity-preview-state {
  display: flex;
  align-items: center;
  gap: 11px;
}

.identity-preview-state strong {
  font-size: 13px;
}

.identity-preview-state p {
  margin: 3px 0 0;
  color: #747e91;
  font-size: 11px;
}

.identity-orb {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border: 2px solid #768094;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(118, 128, 148, .3);
}

.identity-ready .identity-orb {
  border-color: var(--ok);
  box-shadow: 0 0 14px rgba(73, 214, 154, .55);
}

.identity-error .identity-orb {
  border-color: var(--danger);
  box-shadow: 0 0 14px rgba(255, 111, 143, .45);
}

.identity-preview-grid {
  display: grid;
  grid-template-columns: 1.35fr .8fr 1fr;
  gap: 8px;
  margin-top: 13px;
}

.identity-preview-grid span {
  min-width: 0;
  padding: 9px 10px;
  overflow: hidden;
  color: #bec5d1;
  border: 1px solid rgba(151, 166, 196, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-preview-grid b {
  display: block;
  margin-bottom: 4px;
  color: #606a7d;
  font-size: 8px;
  letter-spacing: .11em;
}

.model-security-card {
  padding: 20px;
  border: 1px solid rgba(68, 225, 204, 0.15);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(14, 27, 28, 0.68), rgba(8, 13, 16, 0.82)),
    radial-gradient(circle at 100% 0%, rgba(68, 225, 204, 0.11), transparent 38%);
}

.security-card-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #88f2e4;
  border: 1px solid rgba(68, 225, 204, 0.3);
  border-radius: 10px;
  background: rgba(68, 225, 204, 0.08);
  box-shadow: 0 0 22px rgba(68, 225, 204, 0.08);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
}

.model-security-card h4 {
  margin: 16px 0 8px;
  font-size: 15px;
}

.model-security-card > p,
.security-note {
  color: #7f9294;
  font-size: 11px;
  line-height: 1.65;
}

.model-security-card ul {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.model-security-card li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #c4d2d1;
  font-size: 11px;
}

.model-security-card li span {
  color: #54cdbd;
  font-size: 9px;
  font-weight: 800;
}

.security-note {
  padding-top: 14px;
  border-top: 1px solid rgba(68, 225, 204, 0.12);
}

@media (max-width: 1180px) {
  .shell,
  .shell-modern { grid-template-columns: 230px minmax(0, 1fr); }
  .model-grant-layout { grid-template-columns: 1fr; }
  .model-security-card { display: none; }
}

@media (max-width: 900px) {
  .shell,
  .shell-modern { display: block; }
  .sidebar-modern { position: relative; width: 100%; height: auto; }
  .nav-modern { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main-modern { padding: 0 18px 28px; }
  .topbar-modern { margin: 0 -18px 20px; padding: 14px 18px; }
  .model-hero { align-items: stretch; flex-direction: column; }
  .model-grant-cta { width: 100%; }
}

@media (max-width: 700px) {
  .model-form-grid,
  .identity-preview-grid { grid-template-columns: 1fr; }
  .input-with-action { grid-template-columns: 1fr; }
  .model-filter-actions { width: 100%; }
  .model-filter-actions > * { width: 100%; }
  #model-grant-modal { width: calc(100vw - 20px); }
  #model-grant-modal .model-grant-card { width: 100%; padding: 18px; }
  .topbar-subtitle { display: none; }
}

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