:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  --bg: #0b0d10;
  --panel: #111419;
  --panel-strong: #171b21;
  --panel-soft: #0e1115;
  --border: #292f38;
  --border-soft: #20252c;
  --text: #f3f5f7;
  --muted: #929ba7;
  --quiet: #68727e;
  --blue: #4387f5;
  --blue-hover: #5795f7;
  --green: #40b981;
  --amber: #d6a747;
  --red: #e45b62;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button {
  color: inherit;
}

.hidden {
  display: none !important;
}

.session-pending .auth-shell {
  visibility: hidden;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(430px, 1.18fr);
  min-height: 100vh;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 8vw, 112px);
  background: #10141a;
  border-right: 1px solid var(--border);
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  margin-bottom: 36px;
  background: var(--blue);
  border-radius: 8px;
  color: #fff;
  font-size: 19px;
  font-weight: 800;
}

.brand-mark.small {
  width: 36px;
  height: 36px;
  margin: 0;
  border-radius: 6px;
  font-size: 13px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue-hover);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.auth-brand h1 {
  max-width: 440px;
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 650;
  line-height: 1.05;
}

.brand-copy {
  max-width: 420px;
  margin: 20px 0 0;
  color: #b2bac4;
  font-size: 17px;
  line-height: 1.6;
}

.service-state,
.header-status,
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.service-state {
  margin-top: 54px;
  color: var(--muted);
  font-size: 13px;
}

.service-state span,
.header-status > span:first-child {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 40px 24px;
  background: var(--bg);
}

.auth-inner {
  width: min(100%, 420px);
}

.form-header {
  margin-bottom: 30px;
}

.form-header h2 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 600;
}

.form-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field span {
  color: #c8ced5;
  font-size: 13px;
  font-weight: 600;
}

.field input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  background: #0e1115;
  border: 1px solid #343b45;
  border-radius: 5px;
  color: var(--text);
  outline: 0;
}

.field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(67, 135, 245, 0.14);
}

.primary-button,
.secondary-button {
  height: 42px;
  padding: 0 18px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 650;
}

.primary-button {
  width: 100%;
  background: var(--blue);
  border: 1px solid var(--blue);
  color: #fff;
}

.primary-button:hover {
  background: var(--blue-hover);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.secondary-button {
  background: transparent;
  border: 1px solid var(--border);
}

.form-message {
  min-height: 20px;
  margin: 4px 0 14px;
  color: var(--red);
  font-size: 13px;
}

.form-message.success {
  color: var(--green);
}

.portal-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  background: #0e1115;
  border-right: 1px solid var(--border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 78px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-soft);
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand strong {
  font-size: 14px;
}

.sidebar-brand span {
  margin-top: 3px;
  color: var(--quiet);
  font-size: 11px;
}

.main-nav {
  padding: 22px 12px;
}

.nav-item {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}

.nav-item:hover {
  background: #15191f;
  color: var(--text);
}

.nav-item.active {
  background: #171d25;
  border-left-color: var(--blue);
  color: #fff;
}

.sidebar-footer {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-soft);
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  background: #263445;
  border-radius: 50%;
  color: #bcd5ff;
  font-size: 11px;
  font-weight: 800;
}

.identity {
  min-width: 0;
}

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

.identity strong {
  font-size: 12px;
}

.identity span {
  margin-top: 4px;
  color: var(--quiet);
  font-size: 10px;
}

.icon-button {
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
}

.icon-button:hover {
  background: var(--panel-strong);
  border-color: var(--border);
  color: #fff;
}

.workspace {
  min-width: 0;
  background: var(--bg);
}

.workspace-header {
  display: flex;
  min-height: 116px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 28px clamp(24px, 5vw, 68px) 24px;
  border-bottom: 1px solid var(--border);
}

.workspace-header h1 {
  margin: 0;
  font-size: 27px;
  font-weight: 600;
}

.header-status {
  padding-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.content {
  width: min(1180px, 100%);
  padding: 30px clamp(24px, 5vw, 68px) 60px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: 6px;
}

.metric {
  min-width: 0;
  padding: 18px 20px;
  background: var(--panel);
  border-right: 1px solid var(--border);
}

.metric:last-child {
  border-right: 0;
}

.metric span,
.fact-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  overflow: hidden;
  font-size: 20px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 34px 0 12px;
}

.section-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.section-header span {
  color: var(--muted);
  font-size: 12px;
}

.data-table {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.data-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) minmax(120px, 0.8fr) minmax(130px, 0.8fr) 110px;
  min-height: 58px;
  align-items: center;
  padding: 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border-soft);
}

.data-row:last-child {
  border-bottom: 0;
}

.data-row.header {
  min-height: 38px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

.primary-cell strong,
.primary-cell span {
  display: block;
}

.primary-cell strong {
  font-size: 13px;
}

.primary-cell span,
.cell-muted {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.status {
  width: max-content;
  color: #cdd3da;
  font-size: 12px;
  text-transform: capitalize;
}

.status::before {
  width: 7px;
  height: 7px;
  background: var(--quiet);
  border-radius: 50%;
  content: "";
}

.status.active::before {
  background: var(--green);
}

.status.pending::before {
  background: var(--amber);
}

.status.expired::before,
.status.revoked::before,
.status.suspended::before,
.status.blocked::before {
  background: var(--red);
}

.empty-state {
  padding: 42px 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 7px;
  font-size: 15px;
}

.empty-state span {
  color: var(--muted);
  font-size: 13px;
}

.product-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.product-list {
  min-height: 440px;
  background: var(--panel-soft);
  border-right: 1px solid var(--border);
}

.product-item {
  width: 100%;
  min-height: 74px;
  padding: 14px 16px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  text-align: left;
}

.product-item:hover,
.product-item.active {
  background: var(--panel-strong);
}

.product-item.active {
  box-shadow: inset 3px 0 var(--blue);
}

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

.product-item span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.product-detail {
  min-height: 440px;
  padding: 24px;
  background: var(--panel);
}

.product-detail h2 {
  margin: 0;
  font-size: 21px;
}

.product-detail > p {
  margin: 8px 0 24px;
  color: var(--muted);
  line-height: 1.5;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.fact {
  min-height: 74px;
  padding: 14px;
  background: var(--panel-soft);
}

.fact strong {
  font-size: 13px;
  font-weight: 600;
}

.document-list {
  margin-top: 20px;
  border-top: 1px solid var(--border);
}

.document-row {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-soft);
}

.document-row strong {
  font-size: 12px;
}

.document-row span {
  color: var(--muted);
  font-size: 11px;
}

.account-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 20px;
}

.panel {
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.panel h2 {
  margin: 0 0 20px;
  font-size: 17px;
}

.detail-line {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  min-height: 42px;
  align-items: center;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
}

.detail-line:last-child {
  border-bottom: 0;
}

.detail-line span {
  color: var(--muted);
}

.loading {
  display: grid;
  min-height: 280px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

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

  .metric:nth-child(2) {
    border-right: 0;
  }

  .metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .product-layout,
  .account-layout {
    grid-template-columns: 1fr;
  }

  .product-list {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .data-row {
    grid-template-columns: minmax(160px, 1.4fr) 1fr 100px;
  }

  .data-row > :nth-child(3) {
    display: none;
  }
}

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

  .auth-brand {
    min-height: 240px;
    justify-content: flex-end;
    padding: 32px 24px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .auth-brand h1 {
    font-size: 32px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    margin-bottom: 24px;
  }

  .brand-copy {
    margin-top: 12px;
    font-size: 14px;
  }

  .service-state {
    display: none;
  }

  .auth-panel {
    place-items: start center;
  }

  .portal-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    display: block;
    height: auto;
  }

  .sidebar-brand {
    height: 64px;
  }

  .main-nav {
    display: flex;
    overflow-x: auto;
    padding: 0 12px;
    border-bottom: 1px solid var(--border);
  }

  .nav-item {
    width: auto;
    min-width: max-content;
    border-bottom: 2px solid transparent;
    border-left: 0;
    border-radius: 0;
  }

  .nav-item.active {
    border-bottom-color: var(--blue);
    border-left: 0;
  }

  .sidebar-footer {
    position: absolute;
    top: 0;
    right: 0;
    min-height: 64px;
    border: 0;
  }

  .sidebar-footer .avatar,
  .sidebar-footer .identity {
    display: none;
  }

  .workspace-header {
    min-height: 104px;
    padding: 22px 18px 18px;
  }

  .content {
    padding: 20px 18px 44px;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }

  .metric {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .metric:last-child {
    border-bottom: 0;
  }

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

  .data-row {
    min-width: 560px;
  }

  .fact-grid {
    grid-template-columns: 1fr;
  }
}
.admin-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(420px, 1.3fr);
  gap: 20px;
}

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

.admin-user-form .field {
  min-width: 0;
}

.admin-user-form input,
.admin-user-form select {
  width: 100%;
  min-width: 0;
}

.admin-user-form .field:first-child,
.admin-user-form .form-message,
.admin-user-form .primary-button {
  grid-column: 1 / -1;
}

.credential-box {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  padding: 16px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.credential-box code {
  padding: 10px;
  background: #090b0e;
  border: 1px solid var(--border-soft);
  color: #d9e8ff;
  overflow-wrap: anywhere;
}

.credential-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

.credential-box .secondary-button {
  width: max-content;
  margin-top: 6px;
  padding: 0 14px;
}

@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .admin-user-form {
    grid-template-columns: 1fr;
  }

  .admin-user-form .field {
    grid-column: 1;
  }
}
.admin-stack {
  display: grid;
  gap: 22px;
}

.admin-stack .admin-layout {
  grid-template-columns: minmax(220px, 0.65fr) repeat(3, minmax(260px, 1fr));
}

.admin-directory {
  overflow: hidden;
}

.admin-section + .admin-section {
  margin-top: 30px;
}

.admin-row {
  display: grid;
  min-height: 58px;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border-soft);
}

.admin-row:last-child {
  border-bottom: 0;
}

.admin-row.header {
  min-height: 38px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

.admin-user-row {
  grid-template-columns: minmax(210px, 1.1fr) minmax(180px, 0.9fr) minmax(170px, 0.8fr) 100px minmax(280px, 1.2fr);
}

.admin-access-editor {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(180px, 0.35fr) minmax(360px, 1fr);
  gap: 16px;
  align-items: start;
}

.admin-permission-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.admin-permission-field legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.admin-permission-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.admin-permission-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.admin-permission-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.admin-license-row {
  grid-template-columns: minmax(260px, 1.25fr) minmax(220px, 1fr) minmax(200px, 1fr) minmax(270px, 1.1fr);
}

.action-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.secondary-button.compact {
  width: auto;
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

@media (max-width: 680px) {
  .admin-access-editor {
    grid-template-columns: 1fr;
  }
}

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

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

  .admin-user-row,
  .admin-license-row {
    min-width: 900px;
  }
}
.admin-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
}

.admin-search {
  width: min(420px, 100%);
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}

.icon-button {
  width: 30px;
  min-width: 30px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.admin-row-empty {
  grid-template-columns: 1fr;
  color: var(--muted);
}

.credential-box.visible {
  display: grid;
}

.field select {
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #0c1016;
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}

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

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
}

.admin-modal {
  width: min(560px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.modal-header,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h2 {
  margin: 0;
}

.modal-actions {
  justify-content: flex-end;
}

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

.release-form {
  grid-template-columns: 1fr;
}

.release-form .field,
.release-form .form-message,
.release-form .primary-button {
  grid-column: 1;
}
/* Admin control panel */
.admin-console {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.admin-access-panel {
  position: static;
  top: 24px;
}

.admin-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.admin-provisioning {
  min-height: 100%;
}

.admin-provisioning h2,
.admin-directory > h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 1px;
  margin: 2px 0 26px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--border);
}

.admin-stat {
  min-height: 82px;
  padding: 16px;
  background: var(--panel-soft);
}

.admin-stat span {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

.admin-stat strong {
  display: block;
  font-size: 24px;
  font-weight: 650;
}

.admin-stat.success strong {
  color: #7bd8ac;
}

.admin-stat.warning strong {
  color: #e6c46c;
}

.admin-stat.danger strong {
  color: #ee8186;
}

.admin-directory {
  padding: 0;
}

.admin-directory > h2 {
  min-height: 66px;
  margin: 0;
  padding: 0 22px;
  border-bottom: 1px solid var(--border-soft);
}

.admin-directory > .admin-summary,
.admin-directory > .admin-section,
.admin-directory > .empty-state,
.admin-directory > .loading {
  margin-left: 22px;
  margin-right: 22px;
}

.admin-section:last-child {
  padding-bottom: 22px;
}

.admin-section .section-header {
  margin-top: 22px;
}

.admin-tools {
  justify-content: space-between;
}

.admin-search {
  width: min(520px, 100%);
}

.admin-filter {
  width: min(240px, 100%);
  height: 38px;
  padding: 0 10px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

.admin-table .admin-row.header {
  position: sticky;
  top: 0;
  z-index: 1;
}

.admin-row {
  min-height: 64px;
}

.admin-row:not(.header):hover {
  background: #141922;
}

.action-strip {
  justify-content: flex-start;
}

.action-strip .secondary-button.compact {
  min-width: 62px;
}

.action-strip .secondary-button.compact.danger-action {
  border-color: rgba(228, 91, 98, 0.5);
  color: #f3a0a4;
}

.admin-user-form .field input[type="file"] {
  padding: 10px 12px;
}

.release-form {
  gap: 0;
}

.release-form .primary-button {
  margin-top: 4px;
}

@media (max-width: 1320px) {
  .admin-console {
    grid-template-columns: 1fr;
  }

  .admin-access-panel {
    position: static;
  }
}

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

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

@media (max-width: 680px) {
  .admin-directory > .admin-summary,
  .admin-directory > .admin-section,
  .admin-directory > .empty-state,
  .admin-directory > .loading {
    margin-left: 14px;
    margin-right: 14px;
  }

  .admin-directory > h2 {
    padding: 0 14px;
  }

  .admin-summary {
    grid-template-columns: 1fr;
  }
}


.admin-device-row {
  grid-template-columns: minmax(220px, 1.2fr) minmax(210px, 1fr) minmax(180px, 0.9fr) minmax(150px, 0.75fr) 110px;
}

.device-inventory .loading {
  min-height: 220px;
}

@media (max-width: 1100px) {
  .admin-device-row {
    min-width: 920px;
  }
}

.admin-product-catalog .loading {
  min-height: 220px;
}

.admin-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.admin-product-card {
  display: grid;
  gap: 18px;
  min-height: 260px;
}

.product-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-product-card > p {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

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

.product-plan-list {
  margin-top: 0;
}

.product-summary {
  margin-top: 0;
}

.admin-access-panel .detail-line {
  grid-template-columns: 140px minmax(0, 1fr);
}

.admin-access-panel {
  min-height: auto;
}

.admin-provisioning .primary-button {
  align-self: end;
}

.admin-user-form input[type="datetime-local"] {
  padding-right: 8px;
}

.admin-user-form input[type="file"] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-form input[type="file"]::file-selector-button {
  height: 28px;
  margin-right: 10px;
  border: 0;
  border-radius: 4px;
  background: #2d333c;
  color: var(--text);
  font-weight: 650;
}

@media (max-width: 760px) {
  .admin-action-grid,
  .admin-product-grid {
    grid-template-columns: 1fr;
  }
}
/* Administrative workspace */
.nav-group-label {
  display: block;
  margin: 20px 12px 8px;
  color: var(--quiet);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-group-label:first-child {
  margin-top: 0;
}

.admin-portal .content {
  width: min(1480px, 100%);
}

.admin-module-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--border);
  gap: 1px;
}

.admin-shortcut {
  display: grid;
  min-height: 88px;
  align-content: center;
  gap: 7px;
  padding: 16px 18px;
  background: var(--panel);
  border: 0;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.admin-shortcut:hover,
.admin-shortcut:focus-visible {
  background: #171d25;
  outline: 0;
}

.admin-shortcut strong {
  font-size: 14px;
}

.admin-shortcut span {
  color: var(--muted);
  font-size: 12px;
}

.admin-attention {
  margin-top: 24px;
}

.admin-primary-action {
  display: grid;
  grid-template-columns: minmax(0, 760px);
}

.admin-module-directory {
  margin-top: 2px;
}

.admin-module-directory > .admin-section {
  margin: 0 22px;
  padding-bottom: 22px;
}

.admin-module-directory .admin-section > .section-header {
  margin-top: 22px;
}

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

.license-create-form .field:first-child {
  grid-column: span 2;
}

.license-create-form .form-message,
.license-create-form .primary-button {
  grid-column: 1 / -1;
}

.admin-release-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.4fr) minmax(280px, 0.6fr);
  gap: 20px;
  align-items: start;
}

.release-status-panel {
  min-height: 100%;
}

@media (max-width: 1180px) {
  .admin-module-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-release-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .portal-shell,
  .sidebar,
  .workspace,
  .content,
  .admin-stack,
  .admin-directory,
  .admin-section,
  .data-table {
    min-width: 0;
    max-width: 100%;
  }

  .portal-shell {
    width: 100%;
    overflow-x: hidden;
  }

  .main-nav {
    width: 100vw;
    min-width: 0;
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .admin-module-grid,
  .license-create-form {
    grid-template-columns: 1fr;
  }

  .license-create-form .field:first-child,
  .license-create-form .field,
  .license-create-form .form-message,
  .license-create-form .primary-button {
    grid-column: 1;
  }

  .admin-module-directory > .admin-section {
    margin-right: 14px;
    margin-left: 14px;
  }
}

/* CoreBot server profile administration */
.corebot-summary {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.corebot-create-panel {
  max-width: 980px;
}

.corebot-import-panel {
  display: grid;
  gap: 14px;
}

.corebot-import-head,
.corebot-import-actions,
.corebot-import-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.corebot-import-head h2,
.corebot-import-message,
.corebot-import-summary,
.corebot-import-progress {
  margin: 0;
}

.corebot-import-actions .primary-button {
  width: auto;
}

.corebot-directory-input {
  display: none;
}

.corebot-import-message:empty {
  display: none;
}

.corebot-import-list {
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
}

.corebot-import-row {
  min-height: 58px;
  padding: 10px 12px;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--border-soft);
}

.corebot-import-row:last-child {
  border-bottom: 0;
}

.corebot-import-operation,
.corebot-import-summary,
.corebot-import-progress {
  color: var(--text-muted);
  font-size: 13px;
}

.corebot-import-operation {
  flex: 0 0 auto;
  text-align: right;
}
.corebot-server-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.corebot-server-form .corebot-description-field {
  grid-column: span 2;
}

.corebot-server-form .form-message,
.corebot-server-form .primary-button {
  grid-column: 1 / -1;
}

.corebot-server-list {
  display: grid;
  gap: 1px;
  background: var(--border-soft);
}

.corebot-server-block {
  display: grid;
  gap: 12px;
  padding: 20px 22px;
  background: var(--panel);
}

.corebot-server-head,
.corebot-release-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.corebot-server-block .detail-line {
  grid-template-columns: 110px minmax(0, 1fr);
}

.corebot-release-list {
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
}

.corebot-release-row {
  min-height: 58px;
  padding: 10px 12px;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--border-soft);
}

.corebot-release-row:last-child {
  border-bottom: 0;
}

.corebot-profile-json {
  width: 100%;
  min-height: 300px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--text);
  font: 12px/1.5 Consolas, monospace;
}

@media (max-width: 900px) {
  .corebot-summary,
  .corebot-server-form {
    grid-template-columns: 1fr 1fr;
  }

  .corebot-server-form .corebot-description-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .corebot-summary,
  .corebot-server-form {
    grid-template-columns: 1fr;
  }

  .corebot-server-form .corebot-description-field,
  .corebot-server-form .form-message,
  .corebot-server-form .primary-button {
    grid-column: 1;
  }

  .corebot-server-head,
  .corebot-release-row,
  .corebot-import-head,
  .corebot-import-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .corebot-import-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .corebot-import-actions .primary-button,
  .corebot-import-actions .secondary-button {
    width: 100%;
  }

  .corebot-import-operation {
    text-align: left;
  }
}

/* Product-scoped administration */
.workspace {
  background: #0a0c0f;
}

.admin-portal .workspace-header {
  min-height: 96px;
  align-items: center;
  padding-top: 18px;
  padding-bottom: 18px;
  background: #0d1014;
}

.workspace-controls {
  display: flex;
  align-items: center;
  gap: 18px;
}

.product-scope {
  display: grid;
  grid-template-columns: auto minmax(190px, 260px);
  align-items: center;
  gap: 10px;
}

.product-scope > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.product-scope select {
  width: 100%;
  height: 38px;
  padding: 0 34px 0 11px;
  background: #15191e;
  border: 1px solid #343a43;
  border-radius: 5px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: 0;
}

.product-scope select:focus {
  border-color: #45a4a1;
  box-shadow: 0 0 0 3px rgba(69, 164, 161, 0.14);
}

.admin-portal .header-status {
  padding: 0 0 0 18px;
  border-left: 1px solid var(--border);
}

.admin-portal .header-status > span:first-child {
  background: #45b98f;
}

.admin-portal .sidebar {
  background: #0c0e11;
}

.admin-portal .sidebar-brand {
  height: 70px;
}

.admin-portal .brand-mark.small {
  background: #318985;
}

.admin-portal .main-nav {
  padding-top: 16px;
}

.admin-portal .nav-item {
  height: 42px;
  margin-bottom: 3px;
  border-left: 0;
  border-radius: 5px;
}

.admin-portal .nav-item.active {
  background: #1a2024;
  box-shadow: inset 3px 0 #45a4a1;
}

.admin-portal .content {
  padding-top: 26px;
}

.admin-portal .admin-summary {
  border-color: #30363d;
  background: #30363d;
}

.admin-portal .admin-stat {
  min-height: 88px;
  background: #101419;
}

.admin-portal .admin-stat strong {
  font-size: 25px;
}

.admin-portal .admin-shortcut {
  min-height: 94px;
  background: #11151a;
  border-bottom: 2px solid transparent;
}

.admin-portal .admin-shortcut:hover,
.admin-portal .admin-shortcut:focus-visible {
  background: #171d21;
  border-bottom-color: #45a4a1;
}

.product-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

.update-center {
  padding: 0;
  overflow: hidden;
}

.update-center > h2 {
  min-height: 66px;
  margin: 0;
  padding: 0 22px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-soft);
}

.update-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.update-product-option {
  min-height: 92px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #111419;
  border: 0;
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  text-align: left;
}

.update-product-option:nth-child(2n) {
  border-right: 0;
}

.update-product-option:hover,
.update-product-option:focus-visible {
  background: #181e22;
  box-shadow: inset 3px 0 #45a4a1;
  outline: 0;
}

.corebot-directory {
  margin-top: 0;
}

.corebot-create-panel {
  max-width: none;
}

@media (max-width: 900px) {
  .admin-portal .workspace-header {
    align-items: flex-start;
  }

  .workspace-controls {
    align-items: flex-end;
    flex-direction: column-reverse;
    gap: 10px;
  }

  .admin-portal .header-status {
    padding-left: 0;
    border-left: 0;
  }

  .product-scope {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .product-scope select {
    min-width: 220px;
  }
}

@media (max-width: 760px) {
  .admin-portal .workspace-header {
    min-height: 128px;
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .admin-portal .nav-group-label {
    display: none;
  }

  .admin-portal .nav-item {
    margin-bottom: 0;
    border-radius: 0;
  }

  .admin-portal .nav-item.active {
    border-bottom-color: #45a4a1;
    box-shadow: none;
  }

  .workspace-controls {
    align-items: stretch;
  }

  .product-scope select {
    min-width: 0;
  }

  .update-product-grid {
    grid-template-columns: 1fr;
  }

  .update-product-option,
  .update-product-option:nth-child(2n) {
    border-right: 0;
  }
}
