:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --card-soft: #f2f3f7;
  --text: #151518;
  --muted: #7d7f88;
  --line: #e4e6ec;
  --accent: #151518;
  --accent-soft: #26262b;
  --danger: #c0392b;
  --warning: #b54708;
  --success: #067647;
  --radius: 22px;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(28, 28, 30, 0.08), transparent 36rem),
    var(--bg);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

.boot-screen,
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.boot-screen {
  gap: 14px;
  color: var(--muted);
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  font-size: 24px;
  box-shadow: var(--shadow);
}

.login-card {
  width: min(440px, 100%);
  padding: 34px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
}

.login-card h1,
.page-title h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: -0.05em;
}

.login-card p,
.page-title p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.field label {
  font-size: 13px;
  font-weight: 700;
  color: #474a53;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.field textarea {
  min-height: 90px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(28, 28, 30, 0.08);
}

.primary-button,
.ghost-button,
.danger-button,
.tiny-button {
  border: 0;
  border-radius: 14px;
  font-weight: 800;
  transition:
    transform 0.16s ease,
    opacity 0.16s ease,
    background 0.16s ease;
}

.primary-button {
  width: 100%;
  margin-top: 22px;
  padding: 14px 18px;
  background: var(--accent);
  color: #fff;
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.tiny-button:hover {
  transform: translateY(-1px);
}

.ghost-button,
.danger-button,
.tiny-button {
  padding: 10px 12px;
  background: var(--card-soft);
  color: var(--text);
}

.danger-button {
  background: #fef3f2;
  color: var(--danger);
}

.tiny-button {
  padding: 8px 10px;
  border-radius: 11px;
  font-size: 12px;
}

.error-box,
.notice-box {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  line-height: 1.5;
}

.error-box {
  background: #fef3f2;
  color: var(--danger);
}

.notice-box {
  background: #fff8e6;
  color: var(--warning);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: rgba(255, 255, 255, 0.85);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(20px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.sidebar-brand strong {
  display: block;
  font-size: 19px;
}

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

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 750;
}

.nav-button.active {
  background: var(--accent);
  color: #fff;
}

.sidebar-footer {
  position: absolute;
  right: 24px;
  bottom: 24px;
  left: 24px;
  display: grid;
  gap: 12px;
}

.admin-user {
  padding: 14px;
  border-radius: 16px;
  background: var(--card-soft);
  overflow: hidden;
}

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

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

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

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

.toolbar input,
.toolbar select {
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  background: #fff;
}

.tx-code {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.tx-code-full {
  white-space: normal;
  word-break: break-all;
  line-height: 1.45;
  display: inline-block;
  max-width: min(560px, 100%);
}

.payments-toolbar {
  align-items: stretch;
}

.payments-search-group {
  display: flex;
  align-items: stretch;
  flex: 1 1 360px;
  max-width: 520px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.payments-search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 11px 14px;
  background: transparent;
  font: inherit;
  color: var(--text);
}

.payments-search-input:focus {
  outline: none;
}

.payments-search-group:focus-within {
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.payments-search-button {
  flex-shrink: 0;
  border-radius: 0;
  padding: 0 18px;
  min-height: 44px;
  white-space: nowrap;
}

.payments-search-clear {
  flex-shrink: 0;
  min-width: 44px;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  font-size: 22px;
  line-height: 1;
}

.payments-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.payments-topbar {
  margin-bottom: 0;
}

.payments-stats-grid {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  margin-bottom: 18px;
}

.payments-stats-grid > .content-stat-card {
  flex: 1 1 0;
  min-width: 0;
  min-height: 88px;
  padding: 12px 10px;
}

.payments-stats-grid .content-stat-body {
  min-width: 0;
}

.payments-stats-grid .content-stat-main {
  align-items: baseline;
  gap: 8px;
}

.payments-stats-grid .content-stat-label {
  flex: 1;
  min-width: 0;
  font-size: 10px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.payments-stats-grid .content-stat-value {
  flex-shrink: 0;
  font-size: clamp(17px, 1.35vw, 22px);
}

.payments-stats-grid .content-stat-caption {
  margin-top: auto;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.3;
}

.content-stat-card.tone-rose .content-stat-icon {
  background: #fff1f2;
  color: #e11d48;
}

.payments-wallet-panel .panel-header,
.payments-orders-panel .panel-header,
.payments-conversion-panel .panel-header {
  border-bottom: 1px solid var(--line);
}

.payments-conversion-panel {
  margin-bottom: 18px;
}

.payments-conversion-grid {
  display: flex;
  align-items: center;
  gap: 20px 28px;
  padding: 20px 22px 22px;
  flex-wrap: wrap;
}

.payments-conversion-grid .payments-wallet-field {
  flex: 1 1 200px;
  min-width: 0;
}

.payments-conversion-arrow {
  flex: 0 0 auto;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  color: #94a3b8;
}

.payments-wallet-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px 24px;
  padding: 20px 22px 22px;
}

.payments-wallet-field.span-2 {
  grid-column: span 2;
}

.payments-field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.payments-wallet-address-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.payments-wallet-balance-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.payments-wallet-balance {
  font-size: 22px;
  letter-spacing: -0.03em;
}

.payments-wallet-balance-sub {
  color: var(--muted);
  font-size: 12px;
}

.payments-onchain-updated {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
}

.payments-onchain-sync-icon {
  width: 14px;
  height: 14px;
  color: #94a3b8;
  flex: 0 0 auto;
}

.payments-onchain-updated.is-loading .payments-onchain-sync-icon {
  animation: payments-onchain-spin 0.75s linear infinite;
  color: #2563eb;
}

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

.payments-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
}

.payments-table-toolbar .payments-search-group {
  flex: 1 1 320px;
  max-width: none;
}

.payments-filter-select {
  min-width: 140px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  font: inherit;
}

.payments-icon-refresh {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.payments-table-wrap {
  padding: 0 18px 12px;
}

.payments-orders-pagination {
  padding: 10px 18px 16px;
}

.payments-page-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.payments-page-number.is-active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.payments-page-ellipsis {
  min-width: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.payments-data-table {
  width: 100%;
  border-collapse: collapse;
}

.payments-data-table th,
.payments-data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.payments-data-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.payments-date-cell {
  white-space: nowrap;
  vertical-align: middle;
}

.payments-tx-cell {
  vertical-align: middle;
}

.payments-tx-cell-inner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
}

.payments-copy-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.payments-table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px 16px;
  color: var(--muted);
  font-size: 13px;
}

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

.payments-mini-panel .table-wrap {
  padding: 8px 16px 16px;
}

.payments-data-table-compact td {
  padding: 10px 8px;
}

.payments-mini-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 12px;
  color: var(--muted);
  text-align: center;
}

.payments-mini-empty-icon {
  width: 28px;
  height: 28px;
  opacity: 0.45;
}

.payments-methods-section .panel-title {
  margin-bottom: 12px;
}

.payments-methods-section .panel-title h2 {
  margin: 0;
  font-size: 18px;
}

.payments-methods-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.payments-method-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.payments-method-card.is-active {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%);
}

.payments-method-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eff6ff;
  color: #2563eb;
}

.payments-method-copy strong {
  display: block;
  margin-bottom: 4px;
}

.payments-method-copy small {
  color: var(--muted);
  line-height: 1.4;
}

.payments-method-settings {
  position: absolute;
  top: 14px;
  right: 14px;
}

/* --- Memberships admin --- */
.memberships-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.memberships-topbar {
  align-items: flex-start;
}

.memberships-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.memberships-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.memberships-preview-section .panel-title {
  margin-bottom: 12px;
}

.memberships-preview-section .panel-title h2 {
  margin: 0;
  font-size: 16px;
}

.membership-plan-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
}

.membership-plan-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(15, 23, 42, 0.48);
  cursor: pointer;
}

.membership-plan-dialog {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(90vh, 860px);
  overflow: auto;
  padding: 20px 22px 22px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

.membership-plan-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.membership-plan-dialog-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.membership-plan-dialog-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.memberships-preview-column .panel-title {
  margin-bottom: 12px;
}

.memberships-preview-column .panel-title h2 {
  margin: 0;
  font-size: 16px;
}

.memberships-plan-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.membership-preview-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  padding: 18px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff 0%, #fafbff 100%);
  box-shadow: 0 8px 24px rgba(20, 20, 30, 0.04);
}

.membership-preview-card.is-inactive {
  opacity: 0.72;
}

.membership-preview-card.cycle-yearly {
  border-color: #111;
}

.membership-preview-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.membership-preview-badge.tone-save {
  background: #fff4e5;
  color: #c56a00;
}

.membership-preview-badge.tone-best {
  background: #111;
  color: #fff;
}

.membership-preview-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #f3f0ff;
  color: #6d28d9;
  margin-bottom: 12px;
}

.membership-preview-icon-svg {
  width: 22px;
  height: 22px;
}

.membership-preview-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.membership-preview-price {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.membership-preview-price strong {
  font-size: 24px;
  letter-spacing: -0.4px;
}

.membership-preview-price span,
.membership-preview-credit,
.membership-preview-per-month {
  color: var(--muted);
  font-size: 13px;
}

.membership-preview-credit,
.membership-preview-per-month {
  margin: 4px 0 0;
}

.membership-preview-features {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  flex: 1;
}

.membership-preview-features li {
  position: relative;
  padding-left: 18px;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.35;
}

.membership-preview-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #16a34a;
  font-weight: 700;
}

.membership-preview-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.memberships-form-panel .panel-body {
  padding-top: 0;
}

.memberships-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.memberships-form .field.span-2,
.memberships-form-actions.span-2 {
  grid-column: span 2;
}

.memberships-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.field-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.memberships-table-wrap {
  padding: 0 18px 16px;
}

.memberships-data-table {
  width: 100%;
  border-collapse: collapse;
}

.memberships-data-table th,
.memberships-data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.memberships-data-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.membership-growth {
  color: #16a34a;
  font-size: 11px;
  font-weight: 700;
}

.membership-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.membership-toggle input {
  width: 16px;
  height: 16px;
  accent-color: #111;
}

.icon-button-danger {
  color: var(--danger);
}

.icon-button-danger:hover {
  background: #feecea;
}

@media (max-width: 1200px) {
  .memberships-stats-grid,
  .memberships-plan-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .memberships-form-modal .field.span-2,
  .memberships-form-modal .memberships-form-actions.span-2 {
    grid-column: span 1;
  }
}

@media (max-width: 1200px) {
  .payments-stats-grid {
    gap: 8px;
  }

  .payments-stats-grid > .content-stat-card {
    padding: 10px 8px;
  }

  .payments-stats-grid .content-stat-icon {
    width: 28px;
    height: 28px;
  }

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

  .payments-methods-grid,
  .payments-dual-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .payments-stats-grid {
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .payments-stats-grid > .content-stat-card {
    flex: 0 0 min(220px, 72vw);
  }

  .payments-wallet-grid {
    grid-template-columns: 1fr;
  }

  .payments-wallet-field.span-2 {
    grid-column: auto;
  }
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card,
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 18px;
}

.metric-card .metric-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.metric-card .metric-value {
  display: block;
  margin-top: 2px;
  font-size: 24px;
  letter-spacing: -0.05em;
}

.panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.03em;
}

.panel-body {
  padding: 20px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--card-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.badge.success {
  background: #ecfdf3;
  color: var(--success);
}

.badge.warning {
  background: #fff8e6;
  color: var(--warning);
}

.badge.danger {
  background: #feecea;
  color: var(--danger);
}

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

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

.form-grid .span-2 {
  grid-column: span 2;
}

.empty-state {
  padding: 36px 20px;
  color: var(--muted);
  text-align: center;
}

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

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

  .sidebar-footer {
    position: static;
    margin-top: 20px;
  }

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

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

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

  .topbar,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .metrics-grid,
  .form-grid,
  .nav-list {
    grid-template-columns: 1fr;
  }

  .form-grid .span-2 {
    grid-column: span 1;
  }
}


/* Modern admin console refresh */
:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --card-soft: #f7f8fb;
  --text: #141419;
  --muted: #777b88;
  --line: #e6e8ef;
  --accent: #101114;
  --accent-soft: #272a32;
  --danger: #c0392b;
  --warning: #b54708;
  --success: #067647;
  --radius: 24px;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

body {
  background:
    radial-gradient(circle at 8% 0%, rgba(16, 17, 20, 0.12), transparent 28rem),
    linear-gradient(135deg, #f9fafc 0%, #eef1f7 100%);
}

.login-card {
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.82)),
    #fff;
}

.brand-mark {
  background:
    linear-gradient(145deg, #101114, #2f333d);
  box-shadow: 0 14px 34px rgba(16, 17, 20, 0.22);
}

.primary-button {
  background: linear-gradient(145deg, #101114, #2b2d35);
  box-shadow: 0 16px 30px rgba(16, 17, 20, 0.18);
}

.app-shell {
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  padding: 22px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.78)),
    #fff;
  box-shadow: 10px 0 40px rgba(15, 23, 42, 0.04);
}

.sidebar-brand {
  padding: 0 6px 4px;
  margin-bottom: 18px;
}

.sidebar-brand strong {
  letter-spacing: -0.04em;
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 6px 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.sidebar-status strong,
.sidebar-status small {
  display: block;
}

.sidebar-status strong {
  font-size: 13px;
}

.sidebar-status small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #12b76a;
  box-shadow: 0 0 0 6px rgba(18, 183, 106, 0.12);
}

.nav-list {
  gap: 7px;
}

.nav-button {
  justify-content: flex-start;
  gap: 12px;
  min-height: 62px;
  padding: 11px 12px;
  color: #4b4f5c;
  border: 1px solid transparent;
}

.nav-button:hover {
  background: rgba(16, 17, 20, 0.04);
}

.nav-button.active {
  background:
    linear-gradient(145deg, #111216, #282b33);
  color: #fff;
  box-shadow: 0 14px 26px rgba(16, 17, 20, 0.18);
}

.nav-icon {
  width: 34px;
  height: 34px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: rgba(16, 17, 20, 0.07);
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.nav-button.active .nav-icon {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.nav-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.nav-copy strong,
.nav-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-copy strong {
  font-size: 14px;
  letter-spacing: -0.02em;
}

.nav-copy small {
  color: currentColor;
  opacity: 0.62;
  font-size: 11px;
  font-weight: 700;
}

.sidebar-footer {
  right: 18px;
  bottom: 18px;
  left: 18px;
}

.admin-user {
  border: 1px solid var(--line);
  background: #fff;
}

.main {
  padding: 24px 28px 34px;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
}

.admin-topbar strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
  letter-spacing: -0.04em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.role-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  margin-bottom: 22px;
  padding: 28px;
  border-radius: 32px;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.22), transparent 18rem),
    linear-gradient(145deg, #101114, #292d37);
  color: #fff;
  box-shadow: 0 24px 70px rgba(16, 17, 20, 0.18);
}

.hero-panel h1 {
  max-width: 720px;
  margin: 10px 0 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 0.96;
  letter-spacing: -0.075em;
}

.hero-panel p {
  max-width: 640px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.65;
}

.hero-panel .eyebrow {
  color: rgba(255, 255, 255, 0.58);
}

.hero-card {
  align-self: stretch;
  display: grid;
  align-content: end;
  gap: 7px;
  min-height: 170px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
}

.hero-card span,
.hero-card small {
  color: rgba(255, 255, 255, 0.62);
}

.hero-card strong {
  font-size: 22px;
}

.topbar.compact {
  margin-bottom: 16px;
}

.page-title h1 {
  font-size: clamp(28px, 4vw, 44px);
}

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

.quick-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 20px;
}

.panel {
  border-radius: 26px;
}

.panel-header {
  min-height: 66px;
  padding: 18px 22px;
  background: linear-gradient(180deg, #fff, #fbfcfe);
}

.panel-header h2 {
  letter-spacing: -0.045em;
}

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

.checklist div {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  padding: 14px;
  border-radius: 16px;
  background: var(--card-soft);
}

.checklist span {
  color: var(--muted);
  line-height: 1.55;
}

th {
  background: #fbfcfe;
}

td strong {
  letter-spacing: -0.02em;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: #fbfcfe;
}

.badge {
  border: 1px solid rgba(16, 17, 20, 0.06);
}

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

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

  .sidebar {
    height: auto;
  }

  .sidebar-status {
    display: none;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .admin-topbar {
    position: static;
  }
}

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

  .quick-grid {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .quick-card {
    flex: 0 0 min(220px, 78vw);
    scroll-snap-align: start;
  }

  .checklist div {
    grid-template-columns: 1fr;
  }

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


/* Reference dashboard layout inspired by the provided admin mockup */
:root {
  --admin-bg: #f7f8fb;
  --admin-sidebar: #ffffff;
  --admin-dark: #071226;
  --admin-dark-2: #101f3d;
  --admin-blue: #3b82f6;
  --admin-soft-blue: #edf5ff;
  --admin-soft-purple: #f3efff;
  --admin-soft-green: #ecfdf5;
  --admin-soft-orange: #fff7ed;
  --admin-soft-rose: #fff1f2;
}

body {
  background: var(--admin-bg);
}

.app-shell {
  grid-template-columns: 224px minmax(0, 1fr);
  background: var(--admin-bg);
}

.sidebar {
  padding: 16px 14px;
  background: var(--admin-sidebar);
  box-shadow: none;
  border-right: 1px solid #edf0f5;
}

.sidebar-brand {
  gap: 10px;
  margin-bottom: 18px;
  padding: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 18px;
  box-shadow: none;
}

.sidebar-brand strong {
  font-size: 15px;
  letter-spacing: -0.03em;
}

.sidebar-brand span {
  font-size: 11px;
}

.sidebar-status {
  margin: 0 0 16px;
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.nav-list {
  gap: 5px;
}

.nav-button {
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 11px;
  gap: 10px;
}

.nav-button.active {
  background: #090f1f;
  box-shadow: none;
}

.nav-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  font-size: 12px;
}

.nav-copy strong {
  font-size: 12px;
}

.nav-copy small {
  display: none;
}

.sidebar-footer {
  right: 14px;
  bottom: 14px;
  left: 14px;
}

.admin-user {
  padding: 10px;
  border-radius: 12px;
}

.admin-user strong {
  font-size: 12px;
}

.admin-user span {
  font-size: 10px;
}

.main {
  padding: 0 24px 28px;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 -24px 18px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid #edf0f5;
}

.sidebar-toggle {
  flex: 0 0 auto;
  position: relative;
  z-index: 51;
}

.top-search {
  flex: 1;
  min-width: 0;
  width: min(520px, 48vw);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid #e9edf5;
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
}

.top-search input {
  flex: 1;
  height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
}

.top-search kbd {
  padding: 2px 6px;
  border-radius: 6px;
  background: #f4f6fa;
  color: var(--muted);
  font-size: 11px;
}

.topbar-actions {
  flex-direction: row;
}

.icon-button {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #e9edf5;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.topbar-icon {
  width: 18px;
  height: 18px;
}

.notification-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px #fff;
}

.account-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 172px;
  padding: 6px 9px;
  border: 1px solid #e9edf5;
  border-radius: 13px;
  background: #fff;
}

.avatar-chip {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #0b1020;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.account-menu strong,
.account-menu small {
  display: block;
  line-height: 1.2;
}

.account-menu strong {
  font-size: 12px;
}

.account-menu small {
  color: var(--muted);
  font-size: 10px;
}

.topbar.compact {
  align-items: end;
  margin-bottom: 16px;
}

.page-title h1 {
  font-size: 26px;
  letter-spacing: -0.055em;
}

.page-title p {
  margin-top: 4px;
  font-size: 13px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(180px, 0.88fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 14px;
  padding: 22px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 94% 8%, rgba(90, 141, 255, 0.28), transparent 16rem),
    linear-gradient(135deg, #071226, #0b1730 58%, #111d36);
  box-shadow: none;
  color: #fff;
}

.hero-intro h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.hero-intro p {
  max-width: 520px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
  line-height: 1.6;
}

.hero-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  margin-top: 18px;
}

.hero-status-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.hero-status-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin: 0;
}

.hero-status-text strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.hero-status-text small {
  display: block;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
}

.hero-metrics {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 0 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-chart {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-width: 0;
}

.hero-chart-head {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 32px;
}

.hero-chart-filter {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.hero-chart-wrap {
  width: 100%;
  min-width: 0;
}

.sync-dot,
.hero-status-item .status-dot {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(96, 165, 250, 0.16);
  color: #9cc5ff;
  box-shadow: none;
}

.hero-status-item .status-dot {
  position: relative;
}

.hero-status-item .status-dot::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 2px rgba(7, 18, 38, 0.85);
}

.analytics-head {
  display: flex;
  align-items: center;
}

.analytics-head span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.chart-panel .panel-header button {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.analytics-numbers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.analytics-metric {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.analytics-label {
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.analytics-value {
  color: #fff;
  font-size: 18px;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.analytics-trend {
  font-size: 11px;
  font-weight: 800;
}

.analytics-trend.trend-up {
  color: #57d68d;
}

.line-chart {
  display: block;
  width: 100%;
  height: 96px;
}

.line-chart-axis {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-top: 8px;
}

.line-chart-axis span {
  color: rgba(255, 255, 255, 0.52);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.metrics-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric-card {
  min-height: 124px;
  padding: 14px;
  border-radius: 16px;
  box-shadow: none;
  display: grid;
  gap: 4px;
  align-content: start;
}

.metric-card::after {
  display: none;
}

.metric-icon,
.quick-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 11px;
}

.ui-icon,
.nav-icon-svg {
  width: 18px;
  height: 18px;
}

.nav-icon-svg {
  width: 16px;
  height: 16px;
}

.metric-card.tone-purple .metric-icon { background: #f3efff; color: #7c3aed; }
.metric-card.tone-rose .metric-icon { background: #fff1f2; color: #e11d48; }
.metric-card.tone-green .metric-icon { background: #ecfdf5; color: #059669; }
.metric-card.tone-orange .metric-icon { background: #fff7ed; color: #ea580c; }
.metric-card.tone-violet .metric-icon { background: #f5f3ff; color: #8b5cf6; }
.metric-card.tone-blue .metric-icon { background: #eff6ff; color: #2563eb; }
.metric-card.tone-cyan .metric-icon { background: #ecfeff; color: #0891b2; }

.metric-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.metric-value {
  margin-top: 2px;
  font-size: 24px;
  letter-spacing: -0.05em;
  line-height: 1.15;
}

.metric-trend {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
}

.metric-trend.trend-up { color: #059669; }
.metric-trend.trend-down { color: #dc2626; }
.metric-trend.trend-flat { color: #64748b; }

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

.quick-card {
  position: relative;
  min-height: 72px;
  min-width: 0;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: #fff;
}

.quick-card:hover {
  border-color: #d7deea;
  background: #fbfcfe;
}

.quick-card .quick-icon {
  flex: 0 0 auto;
  margin-bottom: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.quick-card.tone-purple .quick-icon { background: #f3efff; color: #7c3aed; }
.quick-card.tone-green .quick-icon { background: #ecfdf5; color: #059669; }
.quick-card.tone-violet .quick-icon { background: #f5f3ff; color: #8b5cf6; }
.quick-card.tone-orange .quick-icon { background: #fff7ed; color: #ea580c; }
.quick-card.tone-blue .quick-icon { background: #eff6ff; color: #2563eb; }

.quick-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.quick-copy strong {
  font-size: 12px;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-copy small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quick-card em {
  position: static;
  flex: 0 0 auto;
  color: #94a3b8;
  font-size: 18px;
  font-style: normal;
}

.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(16, 17, 20, 0.06);
}

.nav-button.active .nav-icon {
  background: rgba(255, 255, 255, 0.14);
}

.quick-panel {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.panel-title h2 {
  margin: 0;
  font-size: 16px;
}

.panel-title p {
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 14px;
  align-items: stretch;
}

.dashboard-bottom-grid > .panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dashboard-bottom-grid > .panel > .panel-body {
  flex: 1;
  min-height: 0;
  padding: 20px;
  padding-bottom: 14px;
}

.panel {
  border-radius: 18px;
  box-shadow: none;
}

.panel-header {
  min-height: 54px;
  padding: 14px 16px;
}

.panel-header h2 {
  font-size: 15px;
}

.task-list {
  display: grid;
  gap: 0;
}

.task-list div {
  position: relative;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.task-list div:last-child {
  border-bottom: 0;
}

.task-list i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--card-soft);
  color: #111827;
  font-style: normal;
}

.task-list strong {
  display: block;
  font-size: 13px;
}

.task-list small {
  grid-column: 2 / 4;
  color: var(--muted);
  font-size: 11px;
}

.task-status {
  align-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.task-status-pending {
  background: #fff7ed;
  color: #c2410c;
}

.task-status-progress {
  background: #eff6ff;
  color: #2563eb;
}

.task-status-done {
  background: #ecfdf5;
  color: #059669;
}

.chart-panel-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: 14px;
}

.activity-chart {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.activity-chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
  padding-top: 12px;
}

.activity-chart-shell {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  margin-top: auto;
}

.activity-chart-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 168px;
  padding-bottom: 0;
}

.activity-chart-main {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.activity-chart-grid {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.activity-chart-columns {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  height: auto;
  padding-bottom: 0;
}

.activity-chart-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.activity-chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 168px;
}

.activity-chart-date {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  min-height: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.legend-item::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend-users::before {
  background: linear-gradient(180deg, #93c5fd, #60a5fa);
}

.legend-tx::before {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
}

.activity-chart-y span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  text-align: right;
}

.activity-chart-grid span {
  display: block;
  height: 1px;
  background: #edf1f7;
}

.activity-chart-bars span {
  flex: 1;
  max-width: 18px;
  min-height: 4px;
  border-radius: 8px 8px 0 0;
}

.bar-users {
  background: linear-gradient(180deg, #93c5fd, #60a5fa);
}

.bar-tx {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
}

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

  .dashboard-bottom-grid,
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    padding: 18px 0 0;
    border-left: 0;
    border-right: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
  }

  .hero-chart {
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
  }

  .analytics-numbers {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

  .sidebar-footer {
    position: static;
    margin-top: 16px;
  }

  .top-search {
    width: 100%;
  }

  .admin-topbar {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Sidebar: desktop luôn hiện; mobile overlay có thể đóng/mở */
.app-shell {
  grid-template-columns: minmax(0, 1fr);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  border: 0;
  padding: 0;
  background: rgba(7, 18, 38, 0.42);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.app-shell.sidebar-open .sidebar-backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.main {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.sidebar {
  grid-column: 1;
  grid-row: 1;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 45;
  width: 224px;
  height: 100vh;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: none;
  will-change: transform;
}

.app-shell.sidebar-open .sidebar {
  transform: translateX(0);
  box-shadow: 16px 0 48px rgba(15, 23, 42, 0.12);
}

@media (min-width: 861px) {
  .app-shell {
    grid-template-columns: 224px minmax(0, 1fr);
  }

  .sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    transform: none;
    box-shadow: none;
    will-change: auto;
  }

  .main {
    grid-column: 2;
  }

  .sidebar-backdrop {
    display: none;
  }

  /* Desktop: ẩn sidebar chỉ khi user bấm đóng */
  .app-shell:not(.sidebar-open) {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-shell:not(.sidebar-open) .sidebar {
    position: fixed;
    transform: translateX(-100%);
  }

  .app-shell:not(.sidebar-open) .main {
    grid-column: 1;
  }

  .app-shell.sidebar-open {
    grid-template-columns: 224px minmax(0, 1fr);
  }

  .app-shell.sidebar-open .sidebar {
    position: sticky;
    transform: none;
  }

  .app-shell.sidebar-open .main {
    grid-column: 2;
  }
}

/* ── Admin UI design system (buttons, stats, typography) ── */
.main {
  --admin-btn-height: 36px;
  --admin-btn-padding-x: 14px;
  --admin-btn-radius: 8px;
  --admin-btn-font-size: 13px;
  --admin-btn-font-weight: 600;
  --admin-page-title-size: 20px;
  --admin-page-desc-size: 12px;
  --admin-stat-value-size: 26px;
  --admin-stat-label-size: 11px;
  --admin-stat-caption-size: 10px;
  --admin-stat-card-min-height: 96px;
  --admin-stat-card-padding: 14px 16px;
  --admin-stat-card-radius: 12px;
  --admin-pill-height: 32px;
  --admin-pill-font-size: 12px;
  --admin-icon-btn-size: 36px;
}

/* Unified action buttons across all modules */
.main .primary-button,
.main .ghost-button,
.main .danger-button,
.main .tiny-button,
.main .banner-admin__btn,
.main .content-btn-sm,
.main .content-page-btn,
.main .content-pick-btn,
.main .utilities-download-btn,
.main .users-guide-btn,
.main .content-datetime-action,
.main .toolbar .primary-button,
.main .toolbar .ghost-button {
  width: auto;
  margin-top: 0;
  min-height: var(--admin-btn-height);
  padding: 0 var(--admin-btn-padding-x);
  border-radius: var(--admin-btn-radius);
  font-size: var(--admin-btn-font-size);
  font-weight: var(--admin-btn-font-weight);
  line-height: 1.2;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: none;
  cursor: pointer;
}

.main .primary-button {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}

.main .primary-button:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  transform: translateY(-1px);
}

.main .ghost-button,
.main .danger-button,
.main .tiny-button {
  border: 1px solid var(--line);
  background: #fff;
  color: #374151;
}

.main .ghost-button:hover:not(:disabled),
.main .danger-button:hover:not(:disabled),
.main .tiny-button:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.main .danger-button,
.main .tiny-button.danger-button {
  background: #fef3f2;
  border-color: #fecaca;
  color: var(--danger);
}

.main .primary-button:disabled,
.main .ghost-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.main .form-grid .primary-button.span-2,
.main .form-grid .ghost-button.span-2 {
  width: 100%;
}

.main .banner-admin__btn--ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: #374151;
}

.main .banner-admin__btn--ghost:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #cbd5e1;
}

.main .banner-admin__btn--primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
}

.main .banner-admin__btn--primary:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
}

/* Toolbar / hero action rows */
.main .users-toolbar-actions,
.main .banner-admin__hero-actions,
.main .content-page-actions,
.main .users-pagination-actions,
.main .toolbar,
.main .admin-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.main .users-pagination-actions .ghost-button,
.main .content-page-btn {
  min-width: var(--admin-btn-height);
  padding: 0;
}

/* Pill tabs / filters */
.main .content-tab,
.main .banner-admin__tab,
.main .banner-admin__filter-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--admin-pill-height);
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: var(--admin-pill-font-size);
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.main .content-tab.active,
.main .banner-admin__tab.is-active,
.main .banner-admin__filter-tab.is-active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

/* Table icon actions */
.main #view .icon-button {
  width: var(--admin-icon-btn-size);
  height: var(--admin-icon-btn-size);
  min-height: var(--admin-icon-btn-size);
  padding: 0;
  border-radius: var(--admin-btn-radius);
}

/* Page titles & descriptions */
.main .page-title h1,
.main .content-page-title h1,
.main .banner-admin__hero h1 {
  margin: 0;
  font-size: var(--admin-page-title-size);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.main .page-title p,
.main .content-page-title p,
.main .banner-admin__hero p {
  margin: 4px 0 0;
  font-size: var(--admin-page-desc-size);
  line-height: 1.4;
  color: var(--muted);
}

/* Stat cards & numbers */
.main .metric-label,
.main .content-stat-label,
.main .banner-admin__stat-label {
  font-size: var(--admin-stat-label-size);
  font-weight: 700;
  color: #64748b;
  line-height: 1.3;
}

.main .metric-value,
.main .content-stat-value,
.main .banner-admin__stat-value {
  font-size: var(--admin-stat-value-size);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

.main .metric-trend,
.main .content-stat-caption {
  font-size: var(--admin-stat-caption-size);
  font-weight: 600;
  line-height: 1.35;
}

.main .metric-card,
.main .users-stats-grid .metric-card,
.main .content-stat-card,
.main .banner-admin__stat {
  min-height: var(--admin-stat-card-min-height);
  padding: var(--admin-stat-card-padding);
  border-radius: var(--admin-stat-card-radius);
}

.main .banner-admin__stat-value {
  margin-top: 6px;
}

.main .banner-admin__stat--live .banner-admin__stat-value {
  color: var(--success);
}

.main .banner-admin__stat--scheduled .banner-admin__stat-value {
  color: var(--warning);
}

.main .banner-admin__stat--expired .banner-admin__stat-value {
  color: #6b7280;
}

.main .banner-admin__stat--disabled .banner-admin__stat-value {
  color: #9ca3af;
}

.main .banner-admin__form-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Users management page */
.users-page {
  display: grid;
  gap: 14px;
}

.users-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.users-guide-btn {
  white-space: nowrap;
}

.users-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.users-stats-grid .metric-card {
  min-height: 124px;
  border: 1px solid var(--line);
  background: #fff;
}

.users-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.users-toolbar-filters,
.users-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.users-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(320px, 100%);
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
}

.users-search-field input {
  flex: 1;
  height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
}

.users-toolbar select {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.users-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.users-workspace.has-detail {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
}

.users-table-panel {
  overflow: hidden;
}

.users-table-head h2 {
  margin: 0;
}

.users-table-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.users-table {
  min-width: 1240px;
}

.users-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.users-row.selected {
  background: #f8fbff;
}

.users-row:hover {
  background: #fbfcfe;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar-wrap {
  position: relative;
  flex: 0 0 auto;
}

.user-avatar-wrap.is-vip .user-avatar {
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px #c4b5fd;
}

.user-avatar-vip-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 4px rgba(109, 40, 217, 0.35);
}

.user-avatar-vip-badge .package-icon {
  width: 9px;
  height: 9px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  background: #eef2ff;
  color: #4338ca;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-cell strong,
.user-detail-copy strong {
  display: block;
  font-size: 13px;
}

.user-cell small,
.user-detail-copy small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.user-pill-active { background: #ecfdf5; color: #059669; }
.user-pill-locked { background: #fef2f2; color: #dc2626; }
.user-pill-deleted { background: #f3f4f6; color: #6b7280; }

.user-role-chip,
.user-package-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.role-icon,
.package-icon,
.quick-action-icon {
  width: 14px;
  height: 14px;
}

.user-package-chip.is-vip {
  color: #7c3aed;
}

.user-package-chip.is-free {
  color: var(--muted);
}

.user-package-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  border: 1px solid #ddd6fe;
}

.users-table th:last-child,
.users-table td.users-vip-actions {
  text-align: left;
}

.user-row-vip-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}

.users-vip-actions {
  white-space: nowrap;
  width: 1%;
}

.user-credit-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.user-credit-balance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #0f766e;
}

.users-credit-actions {
  white-space: nowrap;
}

.user-credit-current {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.user-credit-current span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.user-credit-current strong {
  font-size: 18px;
  color: #047857;
}

.user-credit-preview {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.user-credit-preview.is-invalid {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.user-credit-modal {
  z-index: 96;
}

.user-payment-history-modal {
  z-index: 97;
}

.user-payment-history-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: min(82vh, 760px);
  display: flex;
  flex-direction: column;
}

.user-payment-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 2px;
}

.user-payment-history-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.user-payment-history-item-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.user-payment-history-item-head strong {
  font-size: 14px;
}

.user-payment-history-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.user-payment-history-status.status-success {
  background: #ecfdf5;
  color: #059669;
}

.user-payment-history-status.status-processing,
.user-payment-history-status.status-pending {
  background: #eff6ff;
  color: #2563eb;
}

.user-payment-history-status.status-expired,
.user-payment-history-status.status-cancelled {
  background: #f3f4f6;
  color: #6b7280;
}

.user-payment-history-status.status-failed {
  background: #fef2f2;
  color: #dc2626;
}

.user-payment-history-subtitle,
.user-payment-history-code,
.user-payment-history-date {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.user-payment-history-code {
  color: var(--text);
  font-weight: 700;
}

.user-payment-history-admin-note {
  margin: 6px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  font-size: 12px;
  color: #92400e;
}

.user-payment-history-admin-note span {
  font-weight: 800;
}

.user-payment-history-item-amount {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.user-payment-history-item-amount.is-positive {
  color: #059669;
}

.user-payment-history-item-amount.is-negative {
  color: #dc2626;
}

.user-payment-history-item-amount.is-neutral {
  color: var(--text);
}

.user-payment-history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 180px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.user-payment-history-empty.is-error {
  color: #dc2626;
}

.user-payment-history-empty-icon {
  width: 28px;
  height: 28px;
  opacity: 0.45;
}

.user-activity {
  color: var(--muted);
  font-size: 12px;
}

.user-menu-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}

.user-menu-btn:hover {
  background: #f4f6fa;
}

.users-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.user-detail-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 16px;
  position: sticky;
  top: 72px;
}

.user-detail-empty {
  display: grid;
  place-items: center;
  min-height: 240px;
  color: var(--muted);
  text-align: center;
}

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

.user-detail-head h2 {
  margin: 0;
  font-size: 15px;
}

.user-detail-profile {
  display: flex;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.user-detail-avatar {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  background: #eef2ff;
}

.user-detail-avatar .user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-detail-avatar .user-avatar {
  width: 56px;
  height: 56px;
  font-size: 16px;
}

.user-detail-copy {
  display: grid;
  gap: 4px;
}

.user-id-badge {
  display: inline-flex;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f4f6fa;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.user-detail-section {
  padding-top: 14px;
}

.user-detail-section h3 {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.user-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.user-quick-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.user-quick-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.user-plan-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #fbfcfe;
}

.user-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.user-plan-row span {
  color: var(--muted);
}

.user-plan-row span {
  color: var(--muted);
  font-size: 12px;
}

.user-vip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.user-vip-actions .primary-button,
.user-vip-actions .ghost-button {
  flex: 1;
  min-width: 120px;
  justify-content: center;
}

.user-vip-current {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 12px;
  background: #f5f7fb;
}

.user-vip-current span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.user-vip-current strong {
  font-size: 15px;
}

.user-vip-current small {
  color: var(--muted);
  font-size: 12px;
}

.user-vip-modal {
  z-index: 95;
}

.user-detail-link {
  margin-top: 10px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.user-detail-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1280px) {
  .users-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .users-workspace.has-detail {
    grid-template-columns: 1fr;
  }

  .user-detail-panel {
    position: static;
  }
}

@media (max-width: 860px) {
  .users-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .users-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .users-toolbar-filters,
  .users-toolbar-actions {
    width: 100%;
  }
}

/* Content management page — compact mockup layout */
.content-page {
  --content-gap: 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 10px;
}

.content-page-head {
  position: relative;
  z-index: 15;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--content-gap);
  padding-bottom: var(--content-gap);
  background: var(--bg);
  contain: layout style;
  overflow: hidden;
}

.content-page-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: var(--content-gap);
  min-height: 0;
  overflow-anchor: none;
}

.content-page-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  margin-bottom: 0;
}

.content-page-title h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.content-page-title p {
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
}

.content-page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.content-page-actions [data-content-create] {
  min-width: 170px;
  justify-content: center;
}

.content-btn-sm {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 12px;
}

.content-stats-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--content-gap);
  min-height: 0;
  align-content: start;
}

.content-stat-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 84px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.content-stat-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  margin-top: 1px;
}

.content-stat-icon-svg {
  width: 15px;
  height: 15px;
}

.content-stat-card.tone-blue .content-stat-icon { background: #eff6ff; color: #2563eb; }
.content-stat-card.tone-green .content-stat-icon { background: #ecfdf5; color: #059669; }
.content-stat-card.tone-orange .content-stat-icon { background: #fff7ed; color: #ea580c; }
.content-stat-card.tone-violet .content-stat-icon { background: #f5f3ff; color: #8b5cf6; }

.content-stat-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.content-stat-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.content-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  line-height: 1.25;
}

.content-stat-value {
  flex: 0 0 auto;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.content-stat-caption {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  line-height: 1.35;
}

#content-editor-host.content-editor-host {
  display: grid;
  grid-template-rows: 0fr;
  flex: 0 0 auto;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
}

#content-editor-host.content-editor-host.is-open {
  grid-template-rows: 1fr;
  pointer-events: auto;
}

.content-editor-collapse {
  min-height: 0;
  overflow: hidden;
}

.content-editor-host .content-editor-form {
  opacity: 0;
  transition: opacity 0.18s ease;
}

.content-editor-host.is-open .content-editor-form {
  opacity: 1;
}

.content-editor-host.is-closing .content-editor-form {
  opacity: 0;
  transition: opacity 0.12s ease;
}

.content-editor-host--instant,
.content-editor-host--instant.content-editor-host,
.content-editor-host--instant .content-editor-form {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  #content-editor-host.content-editor-host,
  .content-editor-host .content-editor-form {
    transition: none !important;
  }
}

.content-editor-form.panel {
  padding: 0;
  overflow: visible;
}

.content-editor-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  font-size: 12px;
  color: #475569;
}

.content-editor-mode-bar strong {
  color: #0f172a;
}

.content-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.content-editor-toolbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  align-items: end;
  margin-top: 6px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.content-editor-tags {
  padding-right: 16px;
  border-right: 1px solid var(--line);
}

.content-editor-tags input {
  min-height: 36px;
}

.content-editor-toolbar .content-editor-actions {
  padding-left: 16px;
  margin-top: 0;
}

.content-editor-card {
  display: flex;
  flex-direction: column;
  padding: 14px 16px 16px;
  border-right: 1px solid var(--line);
}

.content-editor-card-footer {
  flex-shrink: 0;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.content-editor-card-footer--tags {
  margin-top: auto;
  padding-top: 12px;
}

.content-editor-card-footer--actions {
  margin-top: auto;
  padding-top: 12px;
}

.content-editor-card-footer--tags .content-editor-tags input {
  min-height: 36px;
}

.content-editor-card-footer--actions .content-editor-actions {
  margin-top: 0;
  padding-left: 0;
}

.content-editor-card:last-child {
  border-right: 0;
}

.content-editor-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  color: #111827;
}

.content-editor-body {
  display: grid;
  gap: 8px;
}

.content-editor-body-stretch {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.content-field-grow {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.content-field-grow textarea {
  flex: 0 0 auto;
  min-height: 72px;
  max-height: 140px;
  resize: vertical;
}

.content-editor-footer {
  margin-top: 10px;
  flex-shrink: 0;
}

.content-editor-footer input {
  min-height: 36px;
}

.content-field {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.content-field label {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}

.content-field input:not([type="checkbox"]):not([type="radio"]),
.content-field select,
.content-field textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  outline: none;
}

.content-field textarea {
  min-height: 52px;
  max-height: none;
  resize: vertical;
  line-height: 1.35;
}

.content-field input:not([type="checkbox"]):not([type="radio"]):focus,
.content-field select:focus,
.content-field textarea:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.18);
}

.content-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.content-char-count {
  text-align: right;
  color: var(--muted);
  font-size: 10px;
}

.content-schedule-wrap {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  position: relative;
}

.content-schedule-wrap label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}

.content-datetime-field {
  position: relative;
}

.content-datetime-wrap > label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

.content-vps-select-field.content-datetime-wrap > label,
.content-schedule-wrap .content-datetime-wrap > label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}

.content-datetime-display {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.content-datetime-display:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.content-datetime-display-text {
  color: #64748b;
}

.content-datetime-display:not(:disabled) .content-datetime-display-text {
  color: #111827;
}

.content-datetime-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.content-datetime-panel.content-datetime-panel--modal {
  position: static;
  left: auto;
  right: auto;
  top: auto;
  width: 100%;
  max-width: 320px;
  z-index: auto;
}

body.mavor-datetime-open {
  overflow: hidden;
}

.mavor-datetime-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.mavor-datetime-overlay[hidden] {
  display: none !important;
}

.mavor-datetime-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
}

.mavor-datetime-modal {
  position: relative;
  z-index: 1;
  width: min(100%, 320px);
}

.content-picker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.content-picker-month {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: #111827;
}

.content-picker-nav {
  width: 28px;
  height: 28px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.content-picker-nav:hover {
  background: #f8fafc;
}

.content-picker-weekdays,
.content-picker-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.content-picker-weekdays {
  margin-bottom: 4px;
}

.content-picker-weekdays span {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
}

.content-picker-day {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #111827;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.content-picker-day:hover {
  background: #f1f5f9;
}

.content-picker-day.is-muted {
  color: #cbd5e1;
}

.content-picker-day.is-today {
  box-shadow: inset 0 0 0 1px #cbd5e1;
}

.content-picker-day.is-selected {
  background: #0f172a;
  color: #fff;
}

.content-picker-day.is-selected.is-today {
  box-shadow: none;
}

.content-picker-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eef2f7;
}

.content-picker-time-label {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}

.content-picker-time-fields {
  display: flex;
  align-items: center;
  gap: 6px;
}

.content-picker-time-fields select {
  min-width: 68px;
  min-height: 34px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #111827;
}

.content-picker-time-sep {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.content-datetime-panel-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.content-datetime-panel-actions-compact .content-datetime-apply {
  background: #0f172a;
  color: #fff;
}

.content-datetime-action {
  min-height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
}

.content-media-row,
.content-thumb-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  align-items: stretch;
  width: 100%;
}

.content-media-row--synced {
  column-gap: 8px;
  row-gap: 6px;
  align-items: start;
}

.content-media-row--synced .content-media-panel {
  display: grid;
  gap: 6px;
  align-content: start;
  min-width: 0;
}

.content-media-row--synced .content-media-panel > [class*='content-media-grid-'] {
  grid-column: auto;
  grid-row: auto;
}

.content-media-grid-label-cover {
  grid-column: 1;
  grid-row: 1;
}

.content-media-grid-label-video {
  grid-column: 2;
  grid-row: 1;
}

.content-media-grid-preview-cover {
  grid-column: 1;
  grid-row: 2;
}

.content-media-grid-preview-video {
  grid-column: 2;
  grid-row: 2;
}

.content-media-grid-row-settings-left,
.content-media-grid-row-settings-right {
  grid-row: 3;
  align-self: start;
}

.content-media-grid-row-settings-left {
  grid-column: 1;
}

.content-media-grid-row-settings-right {
  grid-column: 2;
}

.content-media-grid-publish-stack {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.content-media-row--vps .content-media-grid-publish-stack {
  gap: 8px;
}

.content-schedule-wrap--stacked {
  margin-top: 0;
}

.content-media-grid-publish-stack .content-vps-hint {
  margin: 0;
}

.content-media-row--synced .content-vps-select-field label,
.content-media-row--synced .content-media-col-label {
  display: block;
  min-height: 14px;
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7d7f88;
  line-height: 1.2;
}

.content-media-row--synced .content-vps-select-field {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.content-media-row--synced .content-cover-action,
.content-media-row--synced .content-vps-select-field select {
  width: 100%;
  min-height: 32px;
  box-sizing: border-box;
}

.content-media-row--synced .content-media-grid-row-settings-left,
.content-media-row--synced .content-media-grid-row-settings-right,
.content-media-row--synced .content-media-grid-publish-stack .content-vps-selects-row--publish {
  gap: 8px;
}

.content-video-preview,
.content-thumb-preview {
  width: 100%;
  min-height: 128px;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  box-sizing: border-box;
}

.content-video-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
  max-height: min(320px, 42vh);
  background: #0f172a;
}

.content-video-preview video {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(320px, 42vh);
  object-fit: contain;
  object-position: center;
  background: #0f172a;
}

.content-thumb-preview {
  height: 128px;
}

.content-thumb-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #0f172a;
}

.content-media-preview-empty,
.content-thumb-preview-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #94a3b8;
}

.content-media-preview-icon,
.content-thumb-icon {
  width: 22px;
  height: 22px;
}

.content-cover-panel,
.content-video-panel {
  display: grid;
  gap: 6px;
  align-content: start;
  min-width: 0;
}

.content-cover-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.content-cover-queue-section {
  display: grid;
  gap: 4px;
  min-width: 0;
  margin-top: 2px;
}

.content-cover-queue-section[hidden] {
  display: none !important;
}

.content-vps-queue--cover {
  /* ~2 video gọn: item ~60px + gap 8px */
  max-height: calc(2 * 60px + 8px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.content-cover-queue-limit {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
}

.content-cover-queue-hint {
  margin: 0;
  font-size: 10px;
  line-height: 1.3;
  color: #94a3b8;
}

.content-cover-queue-hint[hidden] {
  display: none !important;
}

.content-vps-queue--cover::-webkit-scrollbar {
  width: 6px;
}

.content-vps-queue--cover::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #cbd5e1;
}

.content-vps-queue--cover .content-vps-item {
  padding: 8px;
  flex-shrink: 0;
  cursor: pointer;
}

.content-vps-queue--cover .content-vps-item.is-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb;
  background: #eff6ff;
}

.content-vps-queue--cover .content-vps-item.is-ready.is-selected {
  background: #eff6ff;
}

.content-vps-queue--cover .content-vps-item-meta {
  margin-top: 4px;
  gap: 2px 8px;
}

.content-vps-selects-row--publish {
  margin-top: 0;
}

.content-schedule-wrap--compact {
  margin-top: 0;
}

.content-schedule-wrap--compact .content-vps-select-field--schedule label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7d7f88;
}

.content-schedule-wrap--compact .content-datetime-display {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 11px;
  border-radius: 8px;
}

.content-vps-panel .content-vps-select-field select#content-publish-mode,
.content-vps-panel .content-vps-select-field select#content-visibility {
  width: 100%;
  min-height: 32px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
  color: var(--text);
  font-size: 11px;
  outline: none;
}

.content-cover-action {
  min-height: 34px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
}

.content-cover-action:hover {
  background: #f8fafc;
}

.content-video-dropzone {
  height: 128px;
}

.content-video-loaded {
  display: grid;
  gap: 6px;
}

.content-video-loaded[hidden],
.content-video-dropzone[hidden] {
  display: none !important;
}

.content-media-clear {
  margin-top: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.content-media-clear:hover {
  color: #dc2626;
}

.content-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
}

.content-crop-modal.is-open,
.content-crop-modal:not([hidden]) {
  display: grid;
}

.content-video-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
}

.content-video-preview-modal.is-open,
.content-video-preview-modal:not([hidden]) {
  display: grid;
}

.content-video-preview-dialog {
  width: min(880px, 100%);
  padding: 16px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

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

.content-video-preview-head strong {
  font-size: 14px;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-video-preview-dialog video {
  display: block;
  width: 100%;
  max-height: min(70vh, 520px);
  border-radius: 10px;
  background: #0f172a;
  object-fit: contain;
}

.content-crop-dialog {
  width: min(640px, 100%);
  padding: 16px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

.content-crop-dialog h3 {
  margin: 0;
  font-size: 16px;
}

.content-crop-hint {
  margin: 6px 0 12px;
  font-size: 12px;
  color: #64748b;
}

.content-crop-stage {
  position: relative;
  height: 320px;
  border-radius: 10px;
  overflow: hidden;
  background: #0f172a;
}

.content-crop-stage img {
  position: absolute;
  user-select: none;
  pointer-events: none;
}

.content-crop-box {
  position: absolute;
  top: 0;
  left: 0;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.45);
  cursor: grab;
  touch-action: none;
}

.content-crop-box:active {
  cursor: grabbing;
}

.content-crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.content-dropzone {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  width: 100%;
  height: 128px;
  padding: 10px 8px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #fbfdff;
  text-align: center;
  box-sizing: border-box;
}

.content-dropzone.is-dragover {
  border-color: #2563eb;
  background: #eff6ff;
}

.content-dropzone-icon {
  color: #64748b;
}

.content-dropzone-svg {
  width: 18px;
  height: 18px;
}

.content-dropzone p {
  margin: 0;
  font-size: 10px;
  line-height: 1.25;
  color: #64748b;
}

.content-dropzone small {
  font-size: 9px;
  line-height: 1.2;
  color: #94a3b8;
}

.content-pick-btn {
  min-height: 26px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 10px;
}

.content-editor-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  flex-shrink: 0;
}

.content-editor-actions .content-action-btn,
.content-editor-actions .primary-button,
.content-editor-actions .ghost-button {
  width: 100%;
  min-width: 0;
  margin-top: 0;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.content-editor-actions .ghost-button {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
}

.content-editor-actions .ghost-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.content-editor-actions .primary-button {
  background: #0f172a;
  color: #fff;
}

.content-editor-actions .primary-button:hover:not(:disabled),
.content-editor-actions .ghost-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.content-table-panel {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  margin-top: 4px;
}

.content-table-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.content-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.content-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.content-tab.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.content-table-filters {
  display: flex;
  align-items: center;
  gap: 8px;
}

.content-search-field {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 180px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.content-search-field input {
  flex: 1;
  height: 30px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 11px;
}

.content-filter-select,
.content-sort-select,
.content-pagination select {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
}

.content-table-wrap {
  flex: 0 0 auto;
  min-height: 0;
  overflow: auto;
}

.content-table-wrap .empty-state {
  padding: 28px 20px;
  min-height: 0;
  font-size: 12px;
}

.content-table {
  min-width: 900px;
}

.content-table th,
.content-table td {
  padding: 9px 10px;
  font-size: 12px;
  vertical-align: middle;
}

.content-table thead th {
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  background: #fafbfc;
  border-bottom: 1px solid var(--line);
}

.content-col-check {
  width: 34px;
}

.content-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.content-thumb {
  width: 44px;
  height: 32px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 6px;
  background: #eef2ff;
  display: grid;
  place-items: center;
}

.content-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-thumb-fallback {
  color: #4338ca;
  display: grid;
  place-items: center;
}

.content-thumb-icon,
.content-type-icon {
  width: 14px;
  height: 14px;
}

.content-cell-copy strong {
  display: block;
  font-size: 11px;
  line-height: 1.3;
}

.content-row-error {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.35;
  color: #b54708;
}

.content-load-error {
  color: #b54708;
  text-align: left;
  line-height: 1.45;
}

.content-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 2px;
}

.content-tag {
  display: inline-flex;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 9px;
  font-weight: 700;
}

.content-type-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.content-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.content-pill-published { background: #ecfdf5; color: #059669; }
.content-pill-scheduled { background: #fff7ed; color: #ea580c; }
.content-pill-archived { background: #f5f3ff; color: #7c3aed; }
.content-pill-processing { background: #eff6ff; color: #2563eb; }
.content-pill-failed { background: #fef3f2; color: #d92d20; }

.content-views,
.content-author,
.content-updated {
  color: var(--muted);
  font-size: 11px;
}

.content-row-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.content-action-btn {
  width: 26px;
  height: 26px;
}

.content-menu {
  position: relative;
}

.content-menu summary {
  list-style: none;
  cursor: pointer;
}

.content-menu summary::-webkit-details-marker {
  display: none;
}

.content-menu-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  min-width: 130px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.content-menu-panel button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 6px 8px;
  background: transparent;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.content-menu-panel button:hover {
  background: #f8fafc;
}

.content-pagination {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}

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

.content-page-btn {
  min-width: 30px;
  min-height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 12px;
}

@media (max-width: 1280px) {
  .content-stats-grid:not(.payments-stats-grid) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-editor-grid {
    grid-template-columns: 1fr;
  }

  .content-editor-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .content-editor-card:last-child {
    border-bottom: 0;
  }

  .content-editor-card-footer--tags {
    padding-right: 0;
  }

  .content-editor-card-footer--actions {
    padding-left: 0;
  }
}

@media (max-width: 860px) {
  .content-page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .content-table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .content-table-filters {
    width: 100%;
    flex-wrap: wrap;
  }
}

/* --- Tiện ích (tải link) --- */
.utilities-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.utilities-status-banner {
  margin: 0;
  line-height: 1.55;
}

.utilities-status-banner code {
  font-size: 12px;
}

.utilities-status-banner.is-ok {
  background: #ecfdf5;
  color: #067647;
}

.utilities-status-banner.is-warn {
  background: #fff8e6;
  color: #b54708;
}

.utilities-actions button:disabled,
.utilities-field input:disabled,
.utilities-field select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.utilities-form-body {
  display: grid;
  gap: 14px;
}

.utilities-field {
  display: grid;
  gap: 6px;
}

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

.utilities-field input,
.utilities-field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  background: #fff;
}

.utilities-hint {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}

.utilities-hint.is-warn {
  color: #b45309;
}

.utilities-preview-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fafafa;
}

.utilities-preview-thumb {
  width: 96px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.utilities-preview-card p,
.utilities-preview-card small {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 12px;
}

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

.utilities-table td,
.utilities-table th {
  vertical-align: top;
}

.utilities-error {
  color: #b91c1c;
}

.utilities-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #f3f4f6;
  color: #374151;
}

.utilities-pill-completed {
  background: #dcfce7;
  color: #166534;
}

.utilities-pill-failed {
  background: #fee2e2;
  color: #991b1b;
}

.utilities-pill-downloading,
.utilities-pill-probing,
.utilities-pill-queued {
  background: #dbeafe;
  color: #1d4ed8;
}

.utilities-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.utilities-interactive-panel {
  margin-top: 12px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid #fbbf24;
  background: #fffbeb;
  color: #92400e;
}

.utilities-interactive-panel p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.5;
}

.utilities-interactive-panel ol {
  margin: 10px 0 0 18px;
  padding: 0;
  font-size: 14px;
  line-height: 1.6;
}

.utilities-interactive-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.utilities-interactive-note {
  margin-top: 10px;
  font-size: 13px;
  opacity: 0.85;
}

.banner-table-thumb {
  width: 96px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

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

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.danger-text {
  color: #dc2626;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.banner-sync-note {
  font-size: 12px;
  color: #6b7280;
  margin-right: 8px;
}

.panel-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: #6b7280;
}

.banner-spec-box {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
  line-height: 1.55;
}

.banner-spec-box p {
  margin: 6px 0 0;
}

.banner-live-header,
.banner-list-header {
  align-items: flex-start;
  gap: 16px;
}

.banner-live-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.banner-live-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
}

.banner-live-stat.is-active {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

.banner-live-stat strong {
  font-size: 14px;
}

.banner-app-frame {
  position: relative;
  width: min(100%, 358px);
  aspect-ratio: 358 / 150;
  border-radius: 16px;
  overflow: hidden;
  background: #111827;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

.banner-app-frame.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  color: #6b7280;
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  box-shadow: none;
}

.banner-app-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-app-preview.is-hidden {
  display: none;
}

.banner-app-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0.85) 100%);
  color: #fff;
}

.banner-app-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  font-size: 11px;
  font-weight: 600;
}

.banner-app-copy strong {
  display: block;
  font-size: 18px;
  line-height: 1.2;
}

.banner-app-copy small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.8;
}

.banner-app-cta {
  display: inline-flex;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  color: #111827;
  font-size: 12px;
  font-weight: 700;
}

.banner-live-carousel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.banner-live-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.banner-live-slide {
  display: none;
}

.banner-live-slide.is-active {
  display: block;
}

.banner-live-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 12px;
  color: #6b7280;
}

.banner-live-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.banner-live-dot {
  width: 18px;
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: #d1d5db;
  cursor: pointer;
}

.banner-live-dot.is-active {
  width: 28px;
  background: #111827;
}

.banner-upload-layout {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 358px);
  gap: 20px;
  align-items: start;
}

.banner-image-meta {
  margin: 8px 0 0;
  font-size: 12px;
  color: #059669;
}

.banner-image-meta.is-error {
  color: #dc2626;
}

.banner-preview-label {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
}

.banner-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.banner-filter-tab {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

.banner-filter-tab.is-active {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.banner-runtime-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.banner-runtime-badge.status-live {
  background: #dcfce7;
  color: #166534;
}

.banner-runtime-badge.status-scheduled {
  background: #fef3c7;
  color: #92400e;
}

.banner-runtime-badge.status-expired,
.banner-runtime-badge.status-disabled,
.banner-runtime-badge.status-invalid {
  background: #f3f4f6;
  color: #6b7280;
}

.banner-row-live {
  background: #f0fdf4;
}

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

/* ── Banner admin (redesigned) ── */
.banner-admin {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.banner-admin__hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.banner-admin__hero h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.banner-admin__hero p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.banner-admin__sync {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

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

.banner-admin__stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.banner-admin__stat {
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

.banner-admin__stat-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.banner-admin__stat-value {
  display: block;
  margin-top: 8px;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.banner-admin__stat--live .banner-admin__stat-value {
  color: var(--success);
}

.banner-admin__stat--scheduled .banner-admin__stat-value {
  color: var(--warning);
}

.banner-admin__stat--expired .banner-admin__stat-value {
  color: #6b7280;
}

.banner-admin__stat--disabled .banner-admin__stat-value {
  color: #9ca3af;
}

.banner-admin__panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.banner-admin__panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.banner-admin__panel-head--stack {
  flex-direction: column;
  align-items: stretch;
}

.banner-admin__panel-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.banner-admin__panel-head p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.banner-admin__tabs,
.banner-admin__filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.banner-admin__tab,
.banner-admin__filter-tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.banner-admin__tab.is-active,
.banner-admin__filter-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.banner-admin__tab:active,
.banner-admin__filter-tab:active {
  transform: scale(0.97);
}

.banner-admin__live-body {
  transition: opacity 0.16s ease;
}

.banner-admin__live-body.is-switching {
  opacity: 0.72;
}

.banner-admin__live-strip-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 16px 24px;
}

.banner-admin__phone--empty .banner-admin__phone-screen {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  background: #f9fafb;
}

.banner-admin__phone-notch {
  width: 72px;
  height: 5px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: #374151;
}

.banner-admin__phone-carousel {
  position: relative;
  aspect-ratio: 358 / 150;
  background: #1f2937;
  overflow: hidden;
}

.banner-admin__phone-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.banner-admin__phone-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.banner-admin__phone-slide .banner-admin__phone-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-admin__phone-banner-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #374151, #111827);
}

.banner-admin__phone-slide .banner-admin__phone-banner-overlay {
  position: absolute;
  inset: 0;
}

.banner-admin__phone-dot {
  width: 16px;
  height: 3px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #d1d5db;
  cursor: pointer;
}

.banner-admin__phone-dot.is-active {
  width: 24px;
  background: #111827;
}

.banner-admin__strip-nav {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  font-size: 22px;
  line-height: 1;
  color: #374151;
  cursor: pointer;
}

.banner-admin__live-strip {
  flex: 1;
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.banner-admin__live-card {
  flex: 0 0 220px;
  scroll-snap-align: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fafafa;
}

.banner-admin__live-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.banner-admin__live-rank {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.banner-admin__live-thumb {
  position: relative;
  aspect-ratio: 358 / 150;
  border-radius: 12px;
  overflow: hidden;
  background: #111827;
}

.banner-admin__live-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-admin__live-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}

.banner-admin__live-title {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.3;
}

.banner-admin__live-range {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.banner-admin__link-btn {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.banner-admin__live-empty {
  padding: 32px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.banner-admin__badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.banner-admin__badge--live {
  background: #dcfce7;
  color: #166534;
}

.banner-admin__badge--scheduled {
  background: #fef3c7;
  color: #92400e;
}

.banner-admin__badge--expired,
.banner-admin__badge--disabled,
.banner-admin__badge--invalid {
  background: #f3f4f6;
  color: #6b7280;
}

.banner-admin__editor {
  padding: 24px;
}

.banner-admin__editor-grid {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(280px, 1fr) minmax(220px, 280px);
  gap: 24px;
  align-items: start;
}

.banner-admin__upload-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.banner-admin__upload-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.banner-admin__upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 220px;
  padding: 20px 16px;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  background: #f8fafc;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.banner-admin__upload-zone--compact {
  flex: 1;
  min-width: 0;
  min-height: 84px;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  text-align: left;
}

.banner-admin__upload-row.has-image .banner-admin__upload-zone--compact {
  flex: 1;
}

.banner-admin__upload-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.banner-admin__upload-copy strong {
  font-size: 13px;
  line-height: 1.3;
}

.banner-admin__upload-copy small {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.35;
}

.banner-admin__upload-zone:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.banner-admin__upload-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #e2e8f0;
  font-size: 18px;
}

.banner-admin__upload-zone strong {
  font-size: 14px;
}

.banner-admin__upload-zone p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.banner-admin__upload-zone small {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
}

.banner-admin__upload-meta {
  margin: 8px 0 0;
  font-size: 12px;
  color: #059669;
}

.banner-admin__upload-meta.is-error {
  color: var(--danger);
}

.banner-admin__upload-preview-wrap {
  position: relative;
  flex: 0 0 132px;
  width: 132px;
  aspect-ratio: 358 / 150;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f3f4f6;
}

.banner-admin__upload-preview-wrap.is-hidden {
  display: none;
}

.banner-admin__upload-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-admin__upload-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.banner-admin__upload-remove:hover {
  background: rgba(220, 38, 38, 0.92);
}

.banner-admin__field {
  margin-bottom: 14px;
}

.banner-admin__field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.banner-admin__field input,
.banner-admin__field select,
.banner-admin__field textarea,
.banner-admin__search,
.banner-admin__select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
}

.banner-admin__field textarea {
  min-height: 72px;
  resize: vertical;
}

.banner-admin__field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.banner-admin__field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.banner-admin__field--slot {
  margin-top: 2px;
}

.banner-admin__slot-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.banner-admin__slot-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.banner-admin__slot-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 64px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.banner-admin__slot-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.banner-admin__slot-btn.is-selected {
  border-color: #0f172a;
  background: #0f172a;
  box-shadow: 0 0 0 1px #0f172a;
}

.banner-admin__slot-btn.is-selected:hover {
  background: #1e293b;
  border-color: #1e293b;
}

.banner-admin__slot-btn.is-occupied:not(.is-selected) {
  background: #fafafa;
}

.banner-admin__slot-num {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: #0f172a;
}

.banner-admin__slot-btn.is-selected .banner-admin__slot-num,
.banner-admin__slot-btn.is-selected .banner-admin__slot-state {
  color: #fff;
}

.banner-admin__slot-state {
  max-width: 100%;
  font-size: 10px;
  line-height: 1.25;
  color: var(--muted);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.banner-admin__slot-btn.is-empty .banner-admin__slot-state {
  color: #94a3b8;
}

.banner-admin__slot-hint {
  font-size: 11px;
  color: var(--muted);
}

.banner-admin__datetime-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.banner-admin__datetime-field {
  min-width: 0;
}

.banner-admin__datetime-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.banner-admin__char-count {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}

.banner-admin__toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 14px;
  cursor: pointer;
}

.banner-admin__toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.banner-admin__toggle-ui {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #d1d5db;
  position: relative;
  transition: background 0.2s;
}

.banner-admin__toggle-ui::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.banner-admin__toggle input:checked + .banner-admin__toggle-ui {
  background: var(--success);
}

.banner-admin__toggle input:checked + .banner-admin__toggle-ui::after {
  transform: translateX(20px);
}

.banner-admin__preview-label {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

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

.banner-admin__phone {
  padding: 14px;
  border-radius: 28px;
  background: #111827;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.25);
}

.banner-admin__phone-screen {
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
}

.banner-admin__phone-banner {
  position: relative;
  aspect-ratio: 358 / 150;
  background: #1f2937;
}

.banner-admin__phone-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-admin__phone-banner-img.is-hidden {
  display: none;
}

.banner-admin__phone-banner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.85) 100%);
  color: #fff;
}

.banner-admin__preview-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  font-size: 10px;
  font-weight: 600;
}

.banner-admin__preview-copy strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
}

.banner-admin__preview-copy small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  opacity: 0.85;
}

.banner-admin__preview-copy em {
  display: inline-flex;
  margin-top: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff;
  color: #111827;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
}

.banner-admin__phone-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 10px;
}

.banner-admin__phone-dots span {
  width: 16px;
  height: 3px;
  border-radius: 999px;
  background: #d1d5db;
}

.banner-admin__phone-dots span.is-active {
  width: 24px;
  background: #111827;
}

.banner-admin__form-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.banner-admin__form-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.banner-admin__btn {
  width: auto;
  min-width: 0;
  margin: 0;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.banner-admin__btn--ghost {
  background: #fff;
  border-color: var(--line);
  color: #374151;
}

.banner-admin__btn--ghost:hover {
  background: #f9fafb;
  border-color: #cbd5e1;
}

.banner-admin__btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.banner-admin__btn--primary:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
}

.banner-admin__table-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.banner-admin__search {
  flex: 1;
  min-width: 200px;
}

.banner-admin__select {
  width: auto;
  min-width: 160px;
}

.banner-admin__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.banner-admin__table th,
.banner-admin__table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.banner-admin__table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: #fafafa;
}

.banner-admin__table tr.is-live {
  background: #f0fdf4;
}

.banner-admin__table-thumb {
  width: 88px;
  height: 37px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.banner-admin__table-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #fef3c7;
  font-size: 10px;
  font-weight: 600;
}

.banner-admin__table-badge--default {
  background: #dbeafe;
  color: #1d4ed8;
}

.banner-admin__table td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.banner-admin__row-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}

.banner-admin__icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.banner-admin__action-icon {
  width: 16px;
  height: 16px;
}

.banner-admin__icon-btn:hover,
.banner-admin__icon-btn:focus-visible {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
  transform: translateY(-1px);
  outline: none;
}

.banner-admin__icon-btn.is-danger {
  color: #b42318;
}

.banner-admin__icon-btn.is-danger:hover,
.banner-admin__icon-btn.is-danger:focus-visible {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b42318;
}

.banner-admin__icon-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 40;
  padding: 6px 10px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

.banner-admin__icon-btn[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  z-index: 40;
  width: 8px;
  height: 8px;
  background: #111827;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) rotate(45deg);
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.banner-admin__icon-btn[data-tooltip]:hover::after,
.banner-admin__icon-btn[data-tooltip]:focus-visible::after,
.banner-admin__icon-btn[data-tooltip]:hover::before,
.banner-admin__icon-btn[data-tooltip]:focus-visible::before {
  opacity: 1;
  visibility: visible;
}

.banner-admin__icon-btn[data-tooltip]:hover::after,
.banner-admin__icon-btn[data-tooltip]:focus-visible::after {
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1200px) {
  .banner-admin__stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .banner-admin__editor-grid {
    grid-template-columns: 1fr 1fr;
  }

  .banner-admin__preview-col {
    grid-column: 1 / -1;
    max-width: 320px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .banner-admin__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .banner-admin__editor-grid {
    grid-template-columns: 1fr;
  }

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

  .banner-admin__slot-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .banner-admin__slot-btn {
    min-height: 56px;
    padding: 6px 4px;
  }

  .banner-admin__slot-num {
    font-size: 16px;
  }

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

/* ── Unified admin notifications ── */
body.mavor-notify-open {
  overflow: hidden;
}

.mavor-toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 12000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(420px, calc(100vw - 24px));
  pointer-events: none;
}

.mavor-toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 14px 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: auto;
}

.mavor-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.mavor-toast.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
}

.mavor-toast__icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
}

.mavor-toast--info .mavor-toast__icon {
  background: #eff6ff;
  color: #1d4ed8;
}

.mavor-toast--success .mavor-toast__icon {
  background: #ecfdf3;
  color: #067647;
}

.mavor-toast--warning .mavor-toast__icon {
  background: #fffaeb;
  color: #b54708;
}

.mavor-toast--error .mavor-toast__icon {
  background: #fef3f2;
  color: #d92d20;
}

.mavor-toast__title {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
}

.mavor-toast__message {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #334155;
}

.mavor-toast__close {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.mavor-notify-modal {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.mavor-notify-modal[hidden] {
  display: none !important;
}

.mavor-notify-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
}

.mavor-notify-modal__dialog {
  position: relative;
  width: min(460px, 100%);
  padding: 24px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  text-align: center;
  animation: mavor-notify-in 0.18s ease;
}

@keyframes mavor-notify-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mavor-notify-modal__icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 24px;
  font-weight: 800;
}

.mavor-notify-modal--info .mavor-notify-modal__icon {
  background: #eff6ff;
  color: #1d4ed8;
}

.mavor-notify-modal--success .mavor-notify-modal__icon {
  background: #ecfdf3;
  color: #067647;
}

.mavor-notify-modal--warning .mavor-notify-modal__icon {
  background: #fffaeb;
  color: #b54708;
}

.mavor-notify-modal--error .mavor-notify-modal__icon {
  background: #fef3f2;
  color: #d92d20;
}

.mavor-notify-modal__title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.mavor-notify-modal__message {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #475569;
  white-space: pre-line;
}

.mavor-notify-modal__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.mavor-notify-btn {
  min-width: 112px;
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.mavor-notify-btn--ghost {
  background: #fff;
  border-color: var(--line);
  color: #334155;
}

.mavor-notify-btn--primary {
  background: var(--accent);
  color: #fff;
}

.mavor-notify-btn--danger {
  background: #c0392b;
  color: #fff;
}
