:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
}

.creds-app {
  min-height: 100vh;
  width: min(1480px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 16px 0 40px;
}

.list-panel,
.detail-panel,
.token-panel {
  min-width: 0;
}

.workspace-surface {
  display: grid;
  gap: 15px;
  width: 100%;
  min-width: 0;
}

.inset-surface {
  padding: 0;
}

@media (hover: hover) and (pointer: fine) {
  .btn-icon:not(.without-hover):hover .ph,
  .btn-icon:not(.without-hover):hover .ph-bold {
    transform: none;
  }
}

@media (hover: none) and (pointer: coarse) {
  .btn-icon:not(.without-hover):active .ph,
  .btn-icon:not(.without-hover):active .ph-bold {
    transform: none;
  }
}

.modal.a-show .modal-backdrop {
  animation: gnexus-creds-modal-backdrop 0.18s ease-out both;
}

.modal.a-show .modal-dialog {
  animation: gnexus-creds-modal-dialog 0.22s ease-out both;
}

.modal.a-hide .modal-backdrop {
  animation: gnexus-creds-modal-backdrop-out 0.22s ease-in both;
}

.modal.a-hide .modal-dialog {
  animation: gnexus-creds-modal-dialog-out 0.28s ease-in both;
}

.secrets-page {
  display: grid;
  gap: 15px;
  align-items: start;
  width: 100%;
}

.panel-stack {
  display: grid;
  gap: 15px;
  width: 100%;
}

.settings-metrics {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.list-panel {
  overflow: auto;
  padding-bottom: 40px;
}

.secrets-table {
  min-width: 100%;
}

.secrets-table th:last-child,
.secrets-table td:last-child {
  width: 44px;
  text-align: right;
}

.audit-table {
  min-width: 100%;
}

.audit-table th,
.audit-table td {
  white-space: nowrap;
}

.audit-table td:last-child {
  white-space: normal;
  min-width: 200px;
}

.nav-topbar-brand img {
  width: 42px;
  height: 42px;
}

.import-preview {
  display: flex;
  gap: 10px;
  align-items: center;
}

.extension-builds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.extension-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--gn-border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  background: var(--gn-surface-2, rgba(255, 255, 255, 0.02));
}

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

.extension-card-sha {
  display: flex;
  align-items: center;
  gap: 8px;
}

.extension-loading {
  margin-top: 16px;
}

.danger-zone {
  border: 2px solid rgba(247, 118, 142, 0.28);
  background: rgba(247, 118, 142, 0.04);
  padding: 15px;
}

.selected-secret-title {
  color: #7aa2f7;
}

.card-title-actions,
.controls-line,
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}


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

.secret-dropdown .dropdown-menu {
  right: 0;
  left: auto;
  transform-origin: top right;
}

.sort-dropdown .dropdown-menu {
  right: 0;
  left: auto;
  transform-origin: top right;
}

.detail-panel .description-list {
  max-width: none;
}

.create-actions {
  display: flex;
  justify-content: flex-end;
}

.form-grid {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: none;
}

.form-grid > .form-group {
  max-width: none;
}

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

.form-grid.two .form-row-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  grid-column: 1 / -1;
}

.form-grid.two .form-col-full {
  grid-column: 1 / -1;
}

.create-modal-body {
  display: grid;
  gap: 12px;
  width: min(900px, calc(100vw - 48px));
  max-width: 100%;
}

.create-modal-body .form-group {
  max-width: none;
  margin-bottom: 0;
}

.create-modal-body .form-group .label .input {
  min-height: 48px;
}

.create-modal-body .form-group .label textarea.input {
  height: 92px;
}

.create-modal-body .form-group .input-info {
  font-size: 13px;
  line-height: 1.45;
}

.modal-help {
  margin: 0;
}

.modal-section {
  display: grid;
  gap: 10px;
}

.create-fields {
  display: grid;
  gap: 8px;
}

.create-field-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(220px, 1fr) minmax(120px, auto);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 2px solid rgba(192, 202, 245, 0.14);
  background: rgba(22, 22, 30, 0.22);
}

.field-row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding-top: 28px;
}

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

.access-option {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 10px;
  border: 2px solid rgba(192, 202, 245, 0.14);
  background: rgba(22, 22, 30, 0.22);
}

.profile-identity {
  display: block;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.profile-identity:hover {
  color: inherit;
}

.identity-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.identity-cell strong,
.identity-cell small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

code {
  max-width: 100%;
  overflow: auto;
}

.admin-user-cards {
  display: grid;
  gap: 10px;
}

/* Timeline card hover override */
@media (hover: hover) and (pointer: fine) {
  .timeline .timeline-item:hover .timeline-card {
    background: #1f2335;
    transform: none;
  }
}

@media (hover: none) and (pointer: coarse) {
  .timeline .timeline-item:active .timeline-card {
    background: #1f2335;
    transform: none;
  }
}

/* Page header compact fixes */
.page-header.page-header-compact {
  overflow: initial;
}

.page-header.page-header-compact .page-header-content {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.page-header.page-header-compact .page-header-title {
  margin: 0;
}

/* Toolbar actions row */
.toolbar-actions-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.revealed-fields-list.list-actions {
  max-width: none;
  gap: 0;
}

.revealed-fields-list.list-actions .list-item {
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(260px, 1fr);
  align-items: center;
  gap: 18px;
}

.revealed-fields-list .list-controls {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}

.secret-value {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  min-width: 220px;
  max-width: min(520px, 100%);
  padding: 0 8px;
  white-space: nowrap;
}

.error {
  margin: 0;
  color: #f7768e;
}

.secret-title-link {
  cursor: pointer;
}

.secret-title-link:hover {
  color: #7aa2f7;
}

.empty-state.large {
  min-height: 240px;
  align-content: center;
  justify-items: center;
  text-align: center;
}

@media (max-width: 1260px) {
  .list-panel {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .creds-app {
    width: min(100vw - 24px, 1480px);
    padding-top: 12px;
  }

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

  .form-grid.two,
  .create-field-row,
  .create-access-grid {
    grid-template-columns: 1fr;
  }

  .create-modal-body {
    width: calc(100vw - 28px);
  }
}

@keyframes gnexus-creds-modal-backdrop {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes gnexus-creds-modal-dialog {
  from {
    opacity: 0;
    transform: translateY(-18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gnexus-creds-modal-backdrop-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes gnexus-creds-modal-dialog-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-18px);
  }
}

@keyframes gnexus-creds-toast-in {
  from {
    bottom: -100px;
    opacity: 0;
  }

  to {
    bottom: 15px;
    opacity: 1;
  }
}

.toast.a-show {
  animation: gnexus-creds-toast-in 0.28s ease both;
}
