:root {
  --bg-body: #000000;
  --bg-sidebar: #0a0a0a;
  --bg-surface: #111111;
  --bg-surface-hover: #1a1a1a;

  --border-subtle: #222222;
  --border-strong: #333333;

  --text-main: #ffffff;
  --text-muted: #888888;
  --text-dim: #555555;

  --accent-primary: #ffffff;
  --accent-secondary: #444444;

  --status-success: #4ade80;
  --status-warning: #fbbf24;
  --status-danger: #f87171;
  --status-info: #60a5fa;

  --font-main: "Noto Sans JP", sans-serif;
  --sidebar-width: 240px;
}

* {
  box-sizing: border-box;
}

body.admin-console-page {
  margin: 0;
  padding: 0;
  height: 100vh;
  width: 100%;
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-main);
  font-weight: 500;
  overflow: hidden;
  display: flex;
}

body.admin-console-page
  :where(
    p,
    a,
    span,
    button,
    label,
    small,
    li,
    dt,
    dd,
    th,
    td,
    legend,
    summary,
    div
  ) {
  font-weight: 500;
}

body.admin-console-page :where(h1, h2, h3, h4, h5, h6, strong, b) {
  font-weight: 600;
}

/* Sidebar */
.console-sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sidebar-brand-logo {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.05em;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0 0;
}

.sidebar-nav {
  padding: 1rem;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  text-align: left;
}

.sidebar-link:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-main);
}

.sidebar-link.is-active {
  background-color: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.sidebar-link-external::after {
  content: "↗";
  margin-left: auto;
  font-size: 0.8em;
  opacity: 0.5;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.sidebar-footer p {
  margin-bottom: 0.5rem;
}

.sidebar-role-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.role-chip--admin {
  color: #e8d5ff;
  background: rgba(168, 85, 247, 0.24);
  border-color: rgba(192, 132, 252, 0.44);
}

.role-chip--staff {
  color: #b8ffd2;
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(74, 222, 128, 0.42);
}

.role-chip--user {
  color: #d1d5db;
  background: rgba(107, 114, 128, 0.2);
  border-color: rgba(148, 163, 184, 0.32);
}

.role-chip--compact {
  min-width: auto;
  padding: 0.1rem 0.42rem;
  font-size: 0.67rem;
}

/* Main Content Area */
.console-main {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg-body);
}

.console-topbar {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.console-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.console-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.console-topbar-actions {
  display: flex;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: 99px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-light {
  background-color: var(--accent-primary);
  color: #000;
  border: 1px solid var(--accent-primary);
}

.btn-light:hover {
  opacity: 0.9;
}

.btn-outline-light {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-strong);
}

.btn-outline-light:hover,
.btn-outline-light:focus,
.btn-outline-light:active,
.btn-outline-light:focus-visible {
  border-color: var(--text-main);
  background-color: var(--bg-surface-hover);
  color: var(--text-main);
}

.btn-outline-danger {
  background: transparent;
  color: var(--status-danger);
  border: 1px solid var(--border-strong);
}

.btn-outline-danger:hover {
  border-color: var(--status-danger);
  background-color: rgba(248, 113, 113, 0.1);
}

.btn-sm {
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
}

.btn-outline-warning {
  background: transparent;
  color: var(--status-warning);
  border: 1px solid var(--border-strong);
}

.btn-outline-warning:hover {
  border-color: var(--status-warning);
  background-color: rgba(251, 191, 36, 0.1);
}

.btn-outline-info {
  background: transparent;
  color: var(--status-info);
  border: 1px solid var(--border-strong);
}

.btn-outline-info:hover,
.btn-outline-info:focus,
.btn-outline-info:active,
.btn-outline-info:focus-visible {
  border-color: var(--status-info);
  background-color: rgba(96, 165, 250, 0.1);
  color: var(--status-info);
}

/* Panels */
.console-panel {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

.console-panel.is-active {
  display: block;
}

/* Grid Layouts */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.console-layout-two-column {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
}

.console-stack-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

/* Cards */
.surface-card,
.kpi-card,
.mini-card,
.quick-link-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1.25rem;
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0.5rem 0 0 0;
  color: var(--text-main);
}

.surface-head {
  margin-bottom: 1rem;
}

.surface-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.surface-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.console-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.console-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border-strong);
  padding: 0.75rem 0.5rem;
}

.console-table td {
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 0.5rem;
  color: var(--text-main);
  vertical-align: middle;
}

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

.th-checkbox {
  width: 36px;
}

.console-table input[type="checkbox"] {
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.console-table--audit {
  min-width: 1020px;
}

.console-table--audit tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.012);
}

.console-table--audit td {
  padding-top: 0.88rem;
  padding-bottom: 0.88rem;
}

.console-table--audit th:nth-child(1),
.console-table--audit td:nth-child(1) {
  width: 134px;
}

.console-table--audit th:nth-child(2),
.console-table--audit td:nth-child(2) {
  width: 250px;
}

.console-table--audit th:nth-child(3),
.console-table--audit td:nth-child(3) {
  width: 280px;
}

.console-table--audit th:nth-child(4),
.console-table--audit td:nth-child(4) {
  width: 215px;
}

.audit-cell {
  vertical-align: top;
}

.audit-cell-block {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.audit-label-ja {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
}

.audit-label-code {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  line-height: 1.35;
  word-break: break-word;
}

.audit-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.2rem 0.58rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.audit-badge--release-admin {
  color: #9ad6ff;
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.34);
}

.audit-badge--user-admin {
  color: #e8d5ff;
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(192, 132, 252, 0.44);
}

.audit-badge--entitlement-admin {
  color: #ffd39f;
  background: rgba(251, 146, 60, 0.16);
  border-color: rgba(251, 146, 60, 0.4);
}

.audit-badge--point-admin {
  color: #b8ffd2;
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(74, 222, 128, 0.42);
}

.audit-badge--unknown {
  color: #d1d5db;
  background: rgba(100, 116, 139, 0.2);
  border-color: rgba(148, 163, 184, 0.28);
}

.audit-badge--action-point-grant {
  color: #ffd8de;
  background: rgba(244, 63, 94, 0.2);
  border-color: rgba(251, 113, 133, 0.48);
}

.audit-badge--action-point-deduct {
  color: #cbe4ff;
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(96, 165, 250, 0.46);
}

.audit-badge--action-update {
  color: #bff2ff;
  background: rgba(14, 165, 233, 0.2);
  border-color: rgba(56, 189, 248, 0.44);
}

.audit-badge--action-pro-deactivate {
  color: #ffe1b6;
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(251, 191, 36, 0.46);
}

.audit-badge--action-role-change {
  color: #edd8ff;
  background: rgba(168, 85, 247, 0.24);
  border-color: rgba(196, 132, 252, 0.46);
}

.audit-pill-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.audit-actor-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.audit-actor-name {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.audit-summary {
  font-size: 0.84rem;
  line-height: 1.45;
  word-break: break-word;
}

.audit-summary-sub {
  font-size: 0.74rem;
  line-height: 1.4;
  color: var(--text-muted);
  word-break: break-word;
}

.audit-date-main {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

/* Forms */
.console-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.console-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.console-form label.form-inline-check {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  color: var(--text-main);
  min-height: 2.25rem;
}

.console-form label.form-inline-check .form-check-input {
  margin-top: 0;
  flex-shrink: 0;
}

#point-rule-enabled-input {
  appearance: none;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(252, 197, 63, 0.42);
  background: rgba(252, 197, 63, 0.35);
  position: relative;
  cursor: pointer;
  transition: all 0.18s ease;
}

#point-rule-enabled-input::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}

#point-rule-enabled-input:checked {
  border-color: rgba(45, 220, 128, 0.42);
  background: rgba(45, 220, 128, 0.35);
}

#point-rule-enabled-input:checked::before {
  transform: translateX(20px);
}

.console-form .wide {
  grid-column: 1 / -1;
}

.console-form input,
.console-form textarea,
.console-form select {
  background-color: #000;
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  padding: 0.6rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
}

.console-form input:focus,
.console-form textarea:focus,
.console-form select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.clubnavi-create-flags {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.4rem 0.75rem;
  padding: 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
}

.clubnavi-create-flags legend {
  float: none;
  width: auto;
  padding: 0 0.25rem;
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.clubnavi-create-result {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.25rem;
}

.clubnavi-credential-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 0;
}

.clubnavi-credential-list div {
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
}

.clubnavi-credential-list dt {
  margin-bottom: 0.35rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.clubnavi-credential-list dd {
  margin: 0;
  color: var(--text-main);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow-wrap: anywhere;
}

/* Badges */
.badge-chip {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border-subtle);
}

.badge-chip.PUBLISHED,
.badge-chip.RESOLVED {
  color: var(--status-success);
  border-color: rgba(74, 222, 128, 0.2);
  background: rgba(74, 222, 128, 0.05);
}

.badge-chip.SCHEDULED,
.badge-chip.IN_PROGRESS {
  color: var(--status-info);
  border-color: rgba(96, 165, 250, 0.2);
  background: rgba(96, 165, 250, 0.05);
}

.badge-chip.DRAFT,
.badge-chip.UNRESOLVED {
  color: var(--text-muted);
  border-color: var(--border-subtle);
  background: var(--bg-surface-hover);
}

/* Release Preview */
.release-preview {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-subtle);
}

.release-preview-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  background: #000;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
}

.release-preview-media {
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

.release-preview-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.release-preview-placeholder {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.release-preview-body {
  padding: 1rem;
}

.release-preview-title {
  font-weight: 700;
  margin: 0 0 0.5rem 0;
}

.release-preview-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.release-preview-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.release-preview-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--status-info);
  text-decoration: none;
  margin-top: 0.5rem;
}

.release-preview-link:hover {
  text-decoration: underline;
}

.release-preview-link.is-disabled {
  color: var(--text-dim);
  pointer-events: none;
  text-decoration: none;
}

/* Details/Advanced */
.console-advanced {
  margin-top: 0.5rem;
}

.console-advanced-summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.console-advanced-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}

/* Modal */
.console-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.console-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 2rem;
  border-radius: 12px;
  width: min(90vw, 500px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.console-modal-title {
  margin-top: 0;
}

.console-modal-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

[hidden] {
  display: none;
}

/* Quick Links */
.quick-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}

.quick-link-card {
  display: block;
  text-decoration: none;
  color: var(--text-main);
  transition: border-color 0.2s;
  padding: 1rem;
}

.quick-link-card:hover {
  border-color: var(--accent-primary);
}

.quick-link-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

/* Status Line */
.status-line {
  font-size: 0.9rem;
  margin-top: 0.5rem;
  min-height: 1.5em;
  color: var(--text-muted);
}

.status-line.is-error {
  color: var(--text-main);
  background-color: rgba(248, 113, 113, 0.1);
  border: 1px solid var(--status-danger);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  display: inline-block;
}

.status-line.is-success {
  color: var(--status-success);
}

.console-permission-warning {
  margin: 0 2rem 0.75rem;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.point-rule-key-callout {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #2f3744;
  background: #10161f;
}

.point-rule-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.point-rule-status-chip--use {
  color: #8bd0ff;
  background: rgba(70, 166, 255, 0.18);
  border-color: rgba(70, 166, 255, 0.45);
}

.point-rule-status-chip--get {
  color: #ff8b8b;
  background: rgba(255, 92, 92, 0.18);
  border-color: rgba(255, 92, 92, 0.45);
}

.point-rule-enabled-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.point-rule-enabled-chip.is-enabled {
  color: #86f7b9;
  background: rgba(45, 220, 128, 0.14);
  border-color: rgba(45, 220, 128, 0.4);
}

.point-rule-enabled-chip.is-disabled {
  color: #ffd86c;
  background: rgba(252, 197, 63, 0.14);
  border-color: rgba(252, 197, 63, 0.4);
}

.point-rule-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.22rem 0.55rem 0.22rem 0.32rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #0a0a0a;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.18s ease;
}

.point-rule-toggle-track {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #50545c;
  transition: background 0.18s ease;
}

.point-rule-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}

.point-rule-toggle-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.point-rule-toggle-btn.is-on .point-rule-toggle-track {
  background: #33c764;
}

.point-rule-toggle-btn.is-off .point-rule-toggle-track {
  background: #d4ab36;
}

.point-rule-toggle-btn.is-on .point-rule-toggle-thumb {
  transform: translateX(14px);
}

.point-rule-toggle-btn:hover,
.point-rule-toggle-btn:focus-visible {
  border-color: var(--text-main);
  outline: none;
}

.point-purchase-control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.point-purchase-state-card,
.point-purchase-meta-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.point-purchase-state-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.point-purchase-state-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 0.2rem 0.62rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.point-purchase-state-pill.is-on {
  color: #b8ffd2;
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(74, 222, 128, 0.42);
}

.point-purchase-state-pill.is-off {
  color: #ffd6b3;
  background: rgba(251, 146, 60, 0.18);
  border-color: rgba(251, 146, 60, 0.4);
}

.point-purchase-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.point-purchase-meta-block strong {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.45;
  word-break: break-word;
}

.point-purchase-runtime-note {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.console-table--point-rules {
  min-width: 980px;
}

.console-table--point-rules th:nth-child(1),
.console-table--point-rules td:nth-child(1) {
  width: 38%;
}

.console-table--point-rules th:nth-child(2),
.console-table--point-rules td:nth-child(2) {
  width: 10%;
}

.console-table--point-rules th:nth-child(3),
.console-table--point-rules td:nth-child(3) {
  width: 10%;
}

.console-table--point-rules th:nth-child(4),
.console-table--point-rules td:nth-child(4) {
  width: 14%;
}

.console-table--point-rules th:nth-child(5),
.console-table--point-rules td:nth-child(5) {
  width: 16%;
}

.console-table--point-rules th:nth-child(6),
.console-table--point-rules td:nth-child(6) {
  width: 12%;
}

.point-rule-summary-cell {
  vertical-align: top;
}

.point-rule-summary-main {
  color: var(--text-main);
  font-weight: 600;
  line-height: 1.35;
}

.point-rule-summary-sub {
  margin-top: 0.25rem;
  color: var(--text-dim);
  font-size: 0.76rem;
  line-height: 1.35;
}

.point-rule-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  flex-wrap: wrap;
}

.console-table--ptx {
  min-width: 980px;
}

.console-table--ptx tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.012);
}

.ptx-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.08);
}

.ptx-status-chip--get {
  color: #ffd0d0;
  border-color: rgba(248, 113, 113, 0.46);
  background: rgba(248, 113, 113, 0.16);
}

.ptx-status-chip--use {
  color: #cfe4ff;
  border-color: rgba(96, 165, 250, 0.46);
  background: rgba(96, 165, 250, 0.15);
}

.ptx-amount {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.ptx-amount--get {
  color: #fca5a5;
}

.ptx-amount--use {
  color: #93c5fd;
}

.ptx-balance {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ptx-idempotency-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.45rem;
  border-radius: 0.5rem;
  border: 1px solid #2f3744;
  background: #0f131a;
  color: #d1f5ff;
  cursor: pointer;
}

.ptx-idempotency-btn:hover,
.ptx-idempotency-btn:focus-visible {
  border-color: #58b7e4;
  outline: none;
}

/* Point Rule Chip */
.point-rule-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background-color: #000;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  margin-top: 0.5rem;
}

.point-rule-chip span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.point-rule-chip strong {
  color: var(--accent-primary);
  font-weight: 700;
}

.point-rule-qr-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.point-rule-qr-preview img {
  width: min(260px, 68vw);
  height: auto;
  border-radius: 0.8rem;
  border: 1px solid var(--border-subtle);
  background: #fff;
  padding: 0.4rem;
}

.point-rule-qr-code {
  margin: 0;
}

.point-rule-qr-code code {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #2f3744;
  background: #10161f;
  color: #d1f5ff;
  font-weight: 700;
}

/* Email Alert Styles */
.kpi-card--alert {
  border-color: var(--status-danger);
  background: rgba(248, 113, 113, 0.06);
}

.kpi-card--alert .kpi-label {
  color: var(--status-danger);
  font-weight: 600;
}

.kpi-card--alert .kpi-value {
  color: var(--status-danger);
}

.badge-severity-critical {
  color: var(--status-danger);
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.08);
}

.badge-severity-warning {
  color: var(--status-warning);
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.08);
}

.alert-row-unacked {
  background-color: rgba(248, 113, 113, 0.04);
}

.alert-row-unacked td {
  font-weight: 500;
}

/* ===== NEW: Filter Bar (#4) ===== */
.table-filter-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.table-filter-stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.table-filter-chips {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 38px;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.filter-toggle input {
  accent-color: #22c55e;
}

.filter-toggle:has(input:checked) {
  color: #b8ffd2;
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.14);
}

.filter-input {
  background: #000;
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  flex: 1;
  min-width: 140px;
}

.filter-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.filter-input::placeholder {
  color: var(--text-dim);
}

.filter-chips {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 0.3rem 0.7rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.filter-chip:hover {
  border-color: var(--text-main);
  color: var(--text-main);
}

.filter-chip.is-active {
  background: var(--accent-primary);
  color: #000;
  border-color: var(--accent-primary);
}

/* ===== NEW: Global Alert Banner (#5) ===== */
.global-alert-banner {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--status-danger);
  font-size: 0.9rem;
  font-weight: 500;
  animation: bannerPulse 2s ease-in-out infinite;
}

@keyframes bannerPulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.85;
  }
}

/* ===== NEW: User Search Results (#2) ===== */
.user-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.user-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.user-card-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.user-card-email {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.user-card-badges {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.user-card-stats {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== NEW: Admin Lookup Card (#1) ===== */
.admin-lookup-card {
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.admin-lookup-card .text-muted {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

.access-add-flow label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== NEW: Auto-refresh indicator (#7) ===== */
.auto-refresh-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-success);
  margin-left: 0.5rem;
  vertical-align: middle;
  animation: refreshPulse 2s ease-in-out infinite;
}

@keyframes refreshPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(0.8);
  }
}

/* ===== Mobile Menu Button ===== */
.console-mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  border-radius: 6px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  margin-right: 0.75rem;
}

/* ===== Mobile Sidebar Overlay ===== */
.console-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 199;
}
.console-sidebar-overlay.is-visible {
  display: block;
}

/* Responsive */
@media (max-width: 900px) {
  .console-layout-two-column {
    grid-template-columns: 1fr;
  }
}

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

@media (max-width: 768px) {
  body.admin-console-page {
    overflow: hidden;
  }

  /* Hamburger button */
  .console-mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  /* Sidebar: slide in from left */
  .console-sidebar {
    position: fixed;
    left: calc(-1 * var(--sidebar-width));
    top: 0;
    height: 100%;
    z-index: 200;
    transition: left 0.25s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
  }
  .console-sidebar.is-open {
    left: 0;
  }

  /* Topbar */
  .console-topbar {
    padding: 0.85rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .console-permission-warning {
    margin: 0 1rem 0.5rem;
  }

  .console-topbar > div:first-child {
    flex: 1;
    min-width: 0;
  }

  .console-title {
    font-size: 1.1rem;
  }

  .console-sub {
    font-size: 0.78rem;
  }

  .console-topbar-actions {
    flex-wrap: wrap;
    gap: 0.4rem;
    width: 100%;
  }

  .console-topbar-actions .btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.65rem;
  }

  /* Panel padding */
  .console-panel {
    padding: 1rem;
  }

  /* KPI grid: 2 columns on mobile */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 2-column layouts → 1 column */
  .console-form {
    grid-template-columns: 1fr;
  }

  .point-purchase-control-grid,
  .point-purchase-meta-grid {
    grid-template-columns: 1fr;
  }

  .console-advanced-grid {
    grid-template-columns: 1fr;
  }

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

  .release-preview-media {
    height: 180px;
  }

  /* Filter bar */
  .table-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-chips {
    justify-content: flex-start;
  }

  /* User cards */
  .user-card {
    flex-wrap: wrap;
  }

  .user-card-stats {
    text-align: left;
  }

  .admin-lookup-card {
    flex-wrap: wrap;
  }

  /* Modal */
  .console-modal {
    width: min(96vw, 500px);
    padding: 1.25rem;
  }

  .console-modal-actions {
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .console-modal-actions .btn {
    flex: 1;
    justify-content: center;
  }

  /* Global alert banner */
  .global-alert-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

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

/* ===== Release Modal (wide) ===== */
.console-modal--wide {
  width: min(96vw, 1140px);
  max-height: 92vh;
  overflow-y: auto;
}

.release-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr);
  gap: 1.25rem;
  align-items: start;
}

.release-modal-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.release-modal-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.release-modal-form .wide {
  grid-column: 1 / -1;
}

.release-modal-form input,
.release-modal-form textarea,
.release-modal-form select {
  background: #000;
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  padding: 0.5rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
}

.release-modal-form input:focus,
.release-modal-form textarea:focus,
.release-modal-form select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.release-modal-preview {
  border-left: 1px solid var(--border-subtle);
  padding-left: 1.5rem;
  min-width: 0;
}

.release-modal-preview .release-preview-card {
  grid-template-columns: minmax(130px, 36%) 1fr;
}

.release-modal-preview .release-preview-body {
  padding: 0.85rem;
}

.release-modal-preview .release-preview-title {
  font-size: 1.05rem;
  line-height: 1.25;
}

.release-modal-preview .release-preview-description {
  font-size: 0.82rem;
}

.release-preview-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

@media (max-width: 1024px) {
  .release-modal-body {
    grid-template-columns: 1fr;
  }

  .release-modal-preview {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--border-subtle);
    padding-top: 1rem;
  }
}

.mb-3 {
  margin-bottom: 1rem;
}

/* ===== Release Image Upload Zone ===== */
.form-section-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.release-image-upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.release-image-upload-zone:hover,
.release-image-upload-zone.is-drag-over {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.03);
}

.upload-hint {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0;
}

.release-image-upload-zone img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 6px;
  object-fit: contain;
}

/* Clickable date/datetime inputs */
input[type="date"],
input[type="datetime-local"] {
  cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(1);
  opacity: 0.6;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.admin-console-file-input {
  display: none;
}

.admin-console-filter-category {
  max-width: 240px;
}

.admin-console-target-role {
  width: auto;
}

.admin-console-role-reason {
  min-width: 220px;
}
