:root {
  color-scheme: dark;
  --bg-app: #0a1017;
  --bg-sidebar: #0d141d;
  --bg-main: #101924;
  --surface: #131d28;
  --surface-strong: #172330;
  --surface-soft: #0f1721;
  --border: #263445;
  --border-strong: #32465d;
  --text: #e6edf5;
  --muted: #93a4b7;
  --subtle: #70859b;
  --primary: #3b82f6;
  --primary-strong: #2563eb;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --neutral: #94a3b8;
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --shadow-panel: 0 18px 48px rgba(0, 0, 0, 0.22);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 24%),
    radial-gradient(circle at left top, rgba(14, 165, 233, 0.08), transparent 20%),
    var(--bg-app);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

code {
  font-family: ui-monospace, SFMono-Regular, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.hidden {
  display: none !important;
}

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

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 28px 18px 22px;
  background: linear-gradient(180deg, rgba(13, 20, 29, 0.98), rgba(10, 16, 23, 0.98));
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  padding: 6px 6px 2px;
}

.brand__title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand__meta,
.panel__header p,
.seed-box,
.message,
.empty-state {
  color: var(--muted);
}

.brand__meta {
  margin-top: 8px;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.sidebar__section {
  display: grid;
  gap: 8px;
}

.sidebar__label {
  margin-bottom: 6px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--subtle);
}

.sidebar__item,
.ghost-btn,
.primary-btn,
.row-btn {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.sidebar__item {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px 11px 16px;
  text-align: left;
  background: transparent;
  color: var(--muted);
}

.sidebar__item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.sidebar__item--active {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.22);
  box-shadow: inset 3px 0 0 var(--primary);
  color: var(--text);
}

.sidebar__section--foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(112, 133, 155, 0.18);
}

.seed-box {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(19, 29, 40, 0.92);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  line-height: 1.6;
}

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

.seed-box__title {
  color: var(--text);
  font-weight: 700;
}

.seed-box__title--spaced {
  margin-top: 14px;
}

.seed-box__meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}

.seed-box__meta-label {
  color: var(--subtle);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.seed-box__meta-value {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(112, 133, 155, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 12px;
}

.seed-box__action {
  margin-top: 10px;
  width: 100%;
}

.main {
  padding: 32px 28px;
}

.shell--logged-out .main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.shell--logged-out .main > section {
  margin: 0;
}

.main > section,
#appPanel > .panel {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto 24px;
}

#appPanel > .panel:last-child {
  margin-bottom: 0;
}

.panel,
.card {
  background: linear-gradient(180deg, rgba(19, 29, 40, 0.96), rgba(16, 25, 36, 0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-panel);
}

.panel {
  padding: 24px;
}

.panel--login {
  max-width: 540px;
  width: min(540px, 100%);
  padding: 28px 26px 24px;
  border-radius: 28px;
}

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

.login-brand-card {
  display: grid;
  gap: 8px;
  padding: 4px 2px 0;
}

.login-brand-card__eyebrow {
  color: #6ed7d4;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.login-brand-card h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.12;
}

.login-brand-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.login-form-simple {
  display: grid;
  gap: 14px;
  padding: 20px 18px 18px;
  border: 1px solid rgba(112, 133, 155, 0.18);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02)),
    rgba(8, 14, 22, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 12px 30px rgba(3, 8, 14, 0.22);
}

.login-form-simple .field {
  width: 100%;
  gap: 7px;
}

.login-form-simple .field > span {
  color: #8ea5bc;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.login-form-simple .field input {
  min-height: 50px;
  padding: 13px 16px;
  border-radius: 16px;
  border-color: rgba(112, 133, 155, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.login-form-simple .field input:focus {
  border-color: rgba(110, 215, 212, 0.5);
  box-shadow: 0 0 0 3px rgba(110, 215, 212, 0.12);
}

.login-form-simple__submit {
  width: 100%;
  justify-content: center;
  min-height: 50px;
  margin-top: 4px;
  border-radius: 16px;
}

.card {
  padding: 18px;
  background: linear-gradient(180deg, rgba(23, 35, 48, 0.88), rgba(19, 29, 40, 0.94));
}

.panel__header {
  margin-bottom: 18px;
}

.panel__header h2 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.25;
}

.card__title {
  margin: 0 0 14px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.card__head .card__title {
  margin-bottom: 0;
}

.card__head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.panel__header p {
  margin: 0;
  max-width: 720px;
  font-size: 13px;
  line-height: 1.6;
}

.panel__header--row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(112, 133, 155, 0.18);
}

.panel__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-action-btn {
  display: inline-flex;
  align-items: center;
  min-width: 96px;
  justify-content: center;
  white-space: nowrap;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px;
  border: 1px solid rgba(112, 133, 155, 0.16);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
}

.toolbar--filters {
  margin-top: 18px;
  width: 100%;
}

.toolbar__field {
  flex: 0 1 280px;
  max-width: 280px;
}

.toolbar__field--sm {
  flex: 0 0 160px;
}

.toolbar__field--user-id {
  flex: 0 0 148px;
  max-width: 148px;
}

.toolbar__field--status {
  flex: 0 0 168px;
  max-width: 168px;
}

.toolbar__field--channel {
  flex: 0 0 176px;
  max-width: 176px;
}

.toolbar__field--code {
  flex: 0 0 220px;
  max-width: 220px;
}

.toolbar__field--search {
  flex: 0 1 320px;
  max-width: 320px;
}

.toolbar--wide {
  max-width: none;
}

.toolbar__search {
  position: relative;
}

.toolbar__search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  color: var(--subtle);
  transform: translateY(-50%);
  pointer-events: none;
}

.toolbar__search-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.toolbar input,
.toolbar select,
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.toolbar__search input {
  padding-left: 40px;
}

.toolbar input::placeholder,
.field input::placeholder,
.field textarea::placeholder {
  color: #607489;
}

.toolbar input:focus,
.toolbar select:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.toolbar input:hover,
.toolbar select:hover,
.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--border-strong);
}

.field textarea {
  min-height: 104px;
  resize: vertical;
  line-height: 1.6;
}

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

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

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field > span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.field-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
}

.form-section__title {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.primary-btn,
.ghost-btn {
  min-height: 44px;
  padding: 11px 16px;
  font-weight: 700;
}

.primary-btn {
  background: var(--primary);
  border-color: rgba(59, 130, 246, 0.45);
  color: #fff;
}

.primary-btn:hover {
  background: var(--primary-strong);
  border-color: rgba(59, 130, 246, 0.7);
  transform: translateY(-1px);
}

.btn-success {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.3);
  color: #b7f7ca;
}

.btn-success:hover {
  background: rgba(34, 197, 94, 0.24);
  border-color: rgba(34, 197, 94, 0.42);
  transform: translateY(-1px);
}

.btn-warning {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.3);
  color: #ffd89d;
}

.btn-warning:hover {
  background: rgba(245, 158, 11, 0.24);
  border-color: rgba(245, 158, 11, 0.42);
  transform: translateY(-1px);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(112, 133, 155, 0.24);
  color: var(--text);
}

.ghost-btn:hover,
.row-btn:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.28);
  color: #cfe0ff;
}

.ghost-btn--active {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
  color: #d9e7ff;
}

.ghost-btn--compact {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 12px;
}

.secondary-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  white-space: nowrap;
}

.form-submit-btn,
.form-danger-btn,
.form-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.form-submit-btn {
  min-width: 148px;
}

.form-danger-btn {
  min-width: 152px;
}

.form-tool-btn {
  min-width: 96px;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.28);
  color: #ffcbcb;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.btn-danger-soft {
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.22);
  color: #ffbcbc;
}

.btn-danger-soft:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.34);
  color: #ffd1d1;
}

.sidebar__item:focus-visible,
.ghost-btn:focus-visible,
.primary-btn:focus-visible,
.row-btn:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

.status-pill,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: fit-content;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(148, 163, 184, 0.12);
  color: #c5d0db;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.status-pill--online,
.status-badge--success {
  border-color: rgba(34, 197, 94, 0.24);
  background: rgba(34, 197, 94, 0.12);
  color: #89ecad;
}

.status-pill--offline,
.status-badge--neutral {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.12);
  color: #c5d0db;
}

.status-badge--warning {
  border-color: rgba(245, 158, 11, 0.24);
  background: rgba(245, 158, 11, 0.12);
  color: #ffd089;
}

.status-badge--danger {
  border-color: rgba(239, 68, 68, 0.24);
  background: rgba(239, 68, 68, 0.12);
  color: #ffb1b1;
}

.session-box__logout {
  margin-top: 18px;
  width: 100%;
}

.grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.95fr);
  gap: 20px;
  align-items: start;
}

.card--stack {
  display: grid;
  gap: 20px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(112, 133, 155, 0.2);
  border-radius: var(--radius-lg);
  background: rgba(10, 16, 23, 0.32);
}

.data-table {
  width: 100%;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(15, 23, 33, 0.98);
  color: var(--subtle);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table th,
.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(112, 133, 155, 0.14);
  text-align: left;
  font-size: 13px;
  line-height: 1.5;
}

.data-table th:first-child,
.data-table td:first-child {
  color: #c7d4e0;
}

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

.data-table tbody tr {
  transition: background-color 0.16s ease;
}

.data-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.05);
}

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

.row-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  min-width: 74px;
  padding: 7px 12px;
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.18);
  color: #a7c4ff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.row-btn--edit {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.22);
  color: #d8b4fe;
}

.row-btn--warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.24);
  color: #ffd089;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.inline-actions .ghost-btn {
  flex: 1 1 180px;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 0 0 20px;
}

.detail-list__row {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(112, 133, 155, 0.16);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
}

.detail-list__row--readonly {
  opacity: 0.72;
}

.detail-list dt {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 0;
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.detail-list dd input,
.detail-list dd select {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
}

.detail-edit-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-edit-group input,
.detail-edit-group select {
  flex: 1 1 auto;
}

.detail-edit-group--phone {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
}

.detail-status-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.detail-status-cell .btn-warning {
  margin-left: auto;
}

.status-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(112, 133, 155, 0.16);
}

.status-form + .status-form {
  margin-top: 22px;
}

.status-form .primary-btn,
.status-form .ghost-btn {
  justify-self: start;
  min-width: 132px;
}

.status-form .secondary-action-btn {
  min-width: 152px;
}

.status-form .form-submit-btn,
.status-form .form-danger-btn,
.status-form .form-tool-btn {
  justify-self: start;
}

.status-form .form-submit-btn {
  min-width: 148px;
}

.status-form .form-danger-btn {
  min-width: 152px;
}

.form-split-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.form-split-actions .form-submit-btn,
.form-split-actions .form-danger-btn {
  justify-self: auto;
}

.auto-qr-note {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(112, 133, 155, 0.2);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.qr-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.status-form .form-tool-btn {
  min-width: 96px;
}

.image-preview {
  display: block;
  width: 100%;
  max-width: 320px;
  min-height: 120px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  object-fit: cover;
}

.status-form--modal .form-tool-btn {
  min-width: 88px;
}

#userAuditBox.hidden {
  display: none !important;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  display: block;
  padding: 0;
  isolation: isolate;
  overflow: hidden;
}

.modal__overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  background: rgba(6, 10, 16, 0.72);
  backdrop-filter: blur(2px);
}

.modal__dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 24px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(19, 29, 40, 0.98), rgba(16, 25, 36, 0.98));
  box-shadow: var(--shadow-panel);
  overflow: auto;
  transform: translate(-50%, -50%);
}

.modal__dialog--address {
  width: min(720px, calc(100vw - 32px));
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal__title {
  font-size: 15px;
  font-weight: 700;
}

.modal__meta {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.status-form--modal {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.field--checkbox {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(112, 133, 155, 0.16);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
}

.field--checkbox span {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.field--checkbox input {
  width: auto;
}

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

.permission-grid--disabled {
  opacity: 0.58;
}

.permission-grid__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(112, 133, 155, 0.16);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
}

.permission-grid__item input {
  width: auto;
}

.permission-grid__item select {
  width: 120px;
  min-width: 120px;
}

.audit-box {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(112, 133, 155, 0.16);
}

.audit-box__title {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #d7e3ef;
}

.audit-list {
  margin: 0;
  padding-left: 0;
  color: #c2d0dc;
  list-style: none;
}

.audit-list li + li {
  margin-top: 8px;
}

.audit-list__item {
  list-style: none;
}

.audit-list__empty {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px dashed rgba(112, 133, 155, 0.2);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
}

.audit-list__summary {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid rgba(112, 133, 155, 0.18);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
  color: #dbe6f1;
  text-align: left;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.audit-list__summary:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.22);
  box-shadow: 0 8px 18px rgba(7, 12, 18, 0.16);
  transform: translateY(-1px);
}

.audit-list__summary--active {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.34);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.audit-list__summary--static {
  cursor: default;
}

.audit-list__summary--static:hover {
  transform: none;
  box-shadow: none;
}

.audit-list__line + .audit-list__line {
  margin-top: 6px;
}

.audit-list__json {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(112, 133, 155, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: #dbe6f1;
  white-space: pre-wrap;
  word-break: break-word;
}

.asset-preview {
  display: grid;
  gap: 10px;
}

.asset-preview__link {
  color: #8db8ff;
  text-decoration: none;
  word-break: break-all;
}

.asset-preview__link:hover {
  text-decoration: underline;
}

.asset-preview__image {
  max-width: 220px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(112, 133, 155, 0.18);
}

.upload-stack {
  display: grid;
  gap: 10px;
}

.upload-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.upload-preview {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(112, 133, 155, 0.2);
  background: rgba(255, 255, 255, 0.02);
}

.ghost-btn--danger {
  color: #ffcbcb;
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.07);
}

.ghost-btn--danger:hover {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.38);
  color: #ffd8d8;
}

.message,
.empty-state {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(112, 133, 155, 0.2);
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
  line-height: 1.5;
}

.message {
  margin-top: 12px;
}

.message::before,
.empty-state::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: rgba(148, 163, 184, 0.7);
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.12);
}

.message:empty {
  display: none;
}

.message--info {
  color: #c7d6e4;
  border-style: solid;
  border-color: rgba(96, 165, 250, 0.22);
  background: rgba(59, 130, 246, 0.08);
}

.message--info::before {
  background: #93c5fd;
  box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.12);
}

.message--loading {
  color: #d7e6ff;
  border-style: solid;
  border-color: rgba(96, 165, 250, 0.26);
  background: rgba(59, 130, 246, 0.1);
}

.message--loading::before {
  width: 12px;
  height: 12px;
  background: transparent;
  border: 2px solid rgba(147, 197, 253, 0.28);
  border-top-color: #93c5fd;
  box-shadow: none;
  animation: message-spin 0.9s linear infinite;
}

.message--error {
  color: #ffb2b2;
  border-style: solid;
  border-color: rgba(239, 68, 68, 0.24);
  background: rgba(239, 68, 68, 0.1);
}

.message--error::before {
  background: #fca5a5;
  box-shadow: 0 0 0 4px rgba(252, 165, 165, 0.12);
}

.message--success {
  color: #95edba;
  border-style: solid;
  border-color: rgba(34, 197, 94, 0.24);
  background: rgba(34, 197, 94, 0.1);
}

.message--success::before {
  background: #86efac;
  box-shadow: 0 0 0 4px rgba(134, 239, 172, 0.12);
}

.empty-state {
  justify-content: flex-start;
  color: #b7c5d3;
  border-style: solid;
  border-color: rgba(112, 133, 155, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.015));
}

.empty-state::before {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: none;
}

@keyframes message-spin {
  to {
    transform: rotate(360deg);
  }
}

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

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .main {
    padding: 22px 16px 32px;
  }

  .panel,
  .card {
    padding: 18px;
  }

  .panel__header--row,
  .toolbar,
  .seed-box__head,
  .seed-box__meta-row {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .field-row {
    grid-template-columns: 1fr;
  }

  .detail-edit-group,
  .card__head-actions,
  .detail-status-cell {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-edit-group--phone {
    grid-template-columns: 1fr;
  }

  .permission-grid {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 0;
  }

  .modal__dialog {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .detail-list__row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .inline-actions .ghost-btn,
  .session-box__logout {
    width: 100%;
  }
}
