:root {
  --color-bg: #f7f8fa;
  --color-surface: #ffffff;
  --color-surface-soft: #f8fafc;
  --color-surface-hover: #f1f5f9;
  --color-text: #0f172a;
  --color-muted: #64748b;
  --color-subtle: #94a3b8;
  --color-border: #e5e7eb;
  --color-primary: #4f46e5;
  --color-primary-2: #6366f1;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #0ea5e9;
  --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.08);
  --shadow-lift: 0 18px 44px rgba(15, 23, 42, 0.13);
  --radius-card: 12px;
  --radius-control: 10px;
  --sidebar-width: 240px;
  --sidebar-collapsed: 84px;
  --header-height: 72px;
}

[data-theme="dark"] {
  --color-bg: #0b1120;
  --color-surface: #111827;
  --color-surface-soft: #172033;
  --color-surface-hover: #1e293b;
  --color-text: #f8fafc;
  --color-muted: #a5b4c8;
  --color-subtle: #94a3b8;
  --color-border: #253248;
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.26);
  --shadow-lift: 0 20px 52px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: Inter, Arial, "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: var(--color-primary);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  transition: grid-template-columns 180ms ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: rgba(255, 255, 255, 0.92);
  border-right: 1px solid var(--color-border);
  padding: 20px 16px;
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 20;
}

[data-theme="dark"] .sidebar {
  background: rgba(17, 24, 39, 0.92);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, #8b5cf6, var(--color-primary));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.28);
  flex: 0 0 auto;
}

.brand-title {
  font-weight: 800;
  font-size: 16px;
  color: var(--color-text);
  white-space: nowrap;
}

.brand-subtitle {
  color: var(--color-muted);
  font-size: 12px;
  white-space: nowrap;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.nav-tree {
  gap: 8px;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-group-toggle {
  width: 100%;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--color-muted);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.nav-group-toggle:hover,
.nav-group.has-active .nav-group-toggle {
  background: rgba(79, 70, 229, 0.08);
  color: var(--color-primary);
}

.nav-group-main {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.nav-group-main i {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  font-size: 16px;
  flex: 0 0 auto;
}

.nav-group-label {
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  white-space: nowrap;
}

.nav-group-chevron {
  font-size: 13px;
  transition: transform 160ms ease;
}

.nav-group.open .nav-group-chevron {
  transform: rotate(180deg);
}

.nav-group-items {
  display: none;
  gap: 4px;
  padding-left: 10px;
  border-left: 1px solid rgba(100, 116, 139, 0.14);
  margin-left: 19px;
}

.nav-group.open .nav-group-items {
  display: grid;
}

.nav-group-items .nav-button {
  min-height: 40px;
  padding: 9px 10px;
}

.nav-group-items .nav-button i {
  font-size: 17px;
}

.nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: #475569;
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

[data-theme="dark"] .nav-button {
  color: #cbd5e1;
}

.nav-button:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.nav-button.active {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(79, 70, 229, 0.06));
  color: var(--color-primary);
  font-weight: 700;
}

.nav-button i {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  flex: 0 0 auto;
}

.nav-label {
  white-space: nowrap;
}

.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .nav-group-label,
.app-shell.sidebar-collapsed .nav-group-chevron,
.app-shell.sidebar-collapsed .sidebar-plan {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar {
  padding-inline: 14px;
}

.app-shell.sidebar-collapsed .nav-button {
  justify-content: center;
  padding-inline: 8px;
}

.app-shell.sidebar-collapsed .nav-group {
  gap: 3px;
}

.app-shell.sidebar-collapsed .nav-group-toggle {
  justify-content: center;
  min-height: 30px;
  padding: 5px 0;
  color: var(--color-subtle);
  background: transparent;
}

.app-shell.sidebar-collapsed .nav-group-main {
  justify-content: center;
}

.app-shell.sidebar-collapsed .nav-group-items {
  display: grid;
  padding-left: 0;
  margin-left: 0;
  border-left: 0;
}

.sidebar-footer {
  margin-top: auto;
}

.sidebar-plan {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-card);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.main {
  min-width: 0;
}

.topbar {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 28px;
  border-bottom: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.82);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
}

[data-theme="dark"] .topbar {
  background: rgba(17, 24, 39, 0.78);
}

.topbar-title {
  font-size: 17px;
  font-weight: 800;
}

.topbar-subtitle {
  color: var(--color-muted);
  font-size: 12px;
  margin-top: 2px;
}

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

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.user-chip:hover,
.user-chip:focus {
  border-color: rgba(79, 70, 229, 0.32);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.12);
  outline: none;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), #8b5cf6);
  font-weight: 800;
  overflow: hidden;
  flex: 0 0 auto;
}

.user-avatar img,
.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.content {
  padding: 28px;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

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

.eyebrow {
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.section-title {
  margin: 0;
  font-size: 26px;
  font-weight: 850;
  letter-spacing: 0;
}

.section-subtitle {
  color: var(--color-muted);
  margin-top: 6px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

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

.metric-card {
  min-height: 132px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: rgba(79, 70, 229, 0.24);
}

.metric-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 24px;
  flex: 0 0 auto;
}

.metric-primary .metric-icon,
.accent-primary {
  color: var(--color-primary);
  background: rgba(79, 70, 229, 0.12);
}

.metric-success .metric-icon,
.accent-success {
  color: var(--color-success);
  background: rgba(34, 197, 94, 0.12);
}

.metric-warning .metric-icon,
.accent-warning {
  color: var(--color-warning);
  background: rgba(245, 158, 11, 0.14);
}

.metric-danger .metric-icon,
.accent-danger {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.12);
}

.metric-info .metric-icon,
.accent-info {
  color: var(--color-info);
  background: rgba(14, 165, 233, 0.12);
}

.metric-body {
  min-width: 0;
}

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

.metric-value {
  font-size: 31px;
  line-height: 1.15;
  font-weight: 850;
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}

.metric-help {
  color: var(--color-muted);
  font-size: 13px;
  margin-top: 6px;
}

.panel {
  margin-bottom: 18px;
  overflow: hidden;
}

.panel-head {
  min-height: 62px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title {
  font-size: 16px;
  font-weight: 800;
}

.panel-body {
  padding: 18px 20px;
}

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

.panel.has-list-filter {
  overflow: visible;
}

.list-filter,
.table-filter-bar {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  display: grid;
  gap: 10px;
}

.list-filter-main,
.table-filter-bar {
  grid-template-columns: minmax(260px, 1.3fr) repeat(3, minmax(160px, 0.75fr)) minmax(150px, 0.65fr) auto auto;
  align-items: end;
}

.list-filter-main {
  display: grid;
  gap: 10px;
}

.js-list-filter-conditions {
  display: contents;
}

.list-filter-select {
  position: relative;
  display: grid;
  gap: 5px;
  min-width: 0;
}

.list-filter-select > span,
.list-filter-field span {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
}

.list-filter-select select[multiple] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.list-filter-trigger {
  min-height: 42px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  color: var(--color-text);
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.list-filter-trigger:hover,
.list-filter-select.is-open .list-filter-trigger {
  border-color: rgba(79, 70, 229, 0.45);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.10);
}

.list-filter-select.has-value .list-filter-trigger {
  border-color: rgba(79, 70, 229, 0.34);
  background: rgba(79, 70, 229, 0.06);
  color: #4338ca;
}

.list-filter-trigger .js-list-filter-summary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  font-size: 14px;
  font-weight: 800;
}

.list-filter-trigger i {
  flex: 0 0 auto;
  color: var(--color-muted);
  font-size: 13px;
}

.list-filter-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  max-height: 260px;
  overflow: hidden;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
}

.list-filter-select.is-open .list-filter-menu {
  display: grid;
  gap: 8px;
}

.list-filter-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.92);
}

.list-filter-search i {
  color: #94a3b8;
  font-size: 14px;
}

.list-filter-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 700;
}

.list-filter-options {
  display: grid;
  gap: 4px;
  max-height: 198px;
  overflow: auto;
}

.list-filter-choice {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  padding: 7px 8px;
  color: #334155;
  font-size: 14px;
  cursor: pointer;
}

.list-filter-choice:hover {
  background: rgba(79, 70, 229, 0.08);
}

.list-filter-choice.is-hidden,
.list-filter-empty.is-hidden {
  display: none;
}

.list-filter-choice input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: #4f46e5;
}

.list-filter-empty {
  padding: 10px 8px;
  color: var(--color-muted);
  font-size: 13px;
  text-align: center;
}

.list-filter-advanced {
  display: none;
  grid-template-columns: repeat(2, minmax(260px, 1fr)) minmax(220px, 1fr);
  gap: 10px;
  align-items: end;
}

.list-filter.is-open .list-filter-advanced {
  display: grid;
}

.list-filter-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

tr.is-filtered-out {
  display: none !important;
}

#section-keywords .panel,
#section-keywords .table-wrap,
#section-prompts .panel,
#section-prompts .table-wrap {
  overflow: visible;
}

#section-keywords .table-title,
#section-prompts .table-title {
  overflow: visible;
}

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

thead {
  background: var(--color-surface-soft);
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: rgba(79, 70, 229, 0.035);
}

.table-title {
  font-weight: 750;
  color: var(--color-text);
}

.table-subtitle {
  color: var(--color-muted);
  font-size: 12px;
  margin-top: 3px;
}

.table-user-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.table-user-avatar {
  width: 34px;
  height: 34px;
}

.table-pagination {
  min-height: 62px;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--color-surface);
}

.pagination-summary {
  color: var(--color-muted);
  font-size: 13px;
  white-space: nowrap;
}

.pagination-summary strong {
  color: var(--color-text);
  font-weight: 850;
}

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

.pagination-btn,
.pagination-size {
  min-width: 38px;
  height: 38px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.pagination-btn:hover:not(:disabled),
.pagination-size:hover {
  border-color: rgba(79, 70, 229, 0.34);
  background: rgba(79, 70, 229, 0.06);
}

.pagination-btn.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--color-primary), #6366f1);
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.22);
}

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

.pagination-size {
  min-width: 92px;
  padding: 0 10px;
}

@media (max-width: 640px) {
  .list-filter-main,
  .table-filter-bar,
  .list-filter-advanced,
  .list-filter-field {
    grid-template-columns: 1fr;
  }

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

  .pagination-actions {
    justify-content: flex-start;
  }
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-soft::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.badge-success {
  color: #15803d;
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.18);
}

.badge-warning {
  color: #b45309;
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.2);
}

.badge-danger {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.2);
}

.badge-primary {
  color: var(--color-primary);
  background: rgba(79, 70, 229, 0.12);
  border-color: rgba(79, 70, 229, 0.18);
}

.badge-info {
  color: #0369a1;
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.18);
}

.seo-score {
  min-width: 118px;
}

.seo-score-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.seo-bar {
  height: 7px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: 6px;
}

.seo-bar-fill {
  height: 100%;
  border-radius: inherit;
}

.seo-high {
  color: var(--color-success);
}

.seo-high .seo-bar-fill {
  background: linear-gradient(90deg, #16a34a, var(--color-success));
}

.seo-mid {
  color: var(--color-warning);
}

.seo-mid .seo-bar-fill {
  background: linear-gradient(90deg, #d97706, var(--color-warning));
}

.seo-low {
  color: var(--color-danger);
}

.seo-low .seo-bar-fill {
  background: linear-gradient(90deg, #dc2626, var(--color-danger));
}

.btn {
  min-height: 40px;
  border-radius: var(--radius-control);
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  border: 0;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-2));
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.22);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, #4338ca, var(--color-primary));
}

.btn-danger {
  border: 0;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 12px 24px rgba(239, 68, 68, 0.2);
}

.btn-secondary,
.btn-outline-secondary,
.btn-outline-primary {
  border-color: var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
}

.btn-outline-danger {
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.28);
}

.btn-icon {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.logout-button {
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.2);
}

.logout-button:hover,
.logout-button:focus {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 12px 24px rgba(239, 68, 68, 0.18);
}

.form-control,
.form-select {
  min-height: 44px;
  border-radius: var(--radius-control);
  border-color: var(--color-border);
}

.form-control:focus,
.form-select:focus,
.btn:focus,
.nav-button:focus,
.nav-group-toggle:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.14);
  outline: none;
}

.modal-backdrop.show {
  opacity: 0.46;
  backdrop-filter: blur(6px);
}

.modal.fade .modal-dialog {
  transform: translateY(10px) scale(0.96);
  transition: transform 180ms ease, opacity 180ms ease;
}

.modal.show .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-content {
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 14px;
  background: var(--color-surface);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.modal-header {
  min-height: 78px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  align-items: center;
  gap: 14px;
}

.modal-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.modal-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 20px;
  color: var(--color-primary);
  background: rgba(79, 70, 229, 0.12);
}

.modal-icon.danger {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.12);
}

.modal-icon.warning {
  color: #d97706;
  background: rgba(245, 158, 11, 0.14);
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 850;
  color: var(--color-text);
}

.modal-copy {
  margin-top: 3px;
  color: var(--color-muted);
  font-size: 13px;
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  min-height: 74px;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.45), rgba(248, 250, 252, 0.78));
  gap: 10px;
}

[data-theme="dark"] .modal-footer {
  background: rgba(15, 23, 42, 0.45);
}

.btn-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  margin: 0;
  opacity: 0.62;
}

.btn-close:hover {
  background-color: var(--color-surface-hover);
  opacity: 1;
}

.modal .form-label {
  margin-bottom: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

[data-theme="dark"] .modal .form-label {
  color: #dbe4f0;
}

.form-label.required::after {
  content: " *";
  color: var(--color-danger);
}

.modal .form-control,
.modal .form-select {
  min-height: 40px;
  border-radius: 10px;
  background-color: var(--color-surface);
}

.tag-picker {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.tag-picker:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.14);
}

.tag-picker-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid rgba(79, 70, 229, 0.16);
  border-radius: 999px;
  color: var(--color-primary);
  background: rgba(79, 70, 229, 0.09);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.tag-chip-remove {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  color: inherit;
  background: rgba(79, 70, 229, 0.12);
  line-height: 1;
}

.tag-chip-remove:hover,
.tag-chip-remove:focus {
  color: #fff;
  background: var(--color-primary);
}

.tag-picker-input-wrap {
  position: relative;
  flex: 1 1 220px;
  min-width: 190px;
}

.tag-picker-input {
  width: 100%;
  min-height: 28px;
  border: 0;
  outline: 0;
  color: var(--color-text);
  background: transparent;
  font: inherit;
}

.tag-picker-input::placeholder {
  color: var(--color-muted);
}

.tag-picker-menu {
  position: absolute;
  z-index: 1080;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: none;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
  padding: 6px;
}

.tag-picker-menu.show {
  display: block;
}

.tag-picker-option,
.tag-picker-empty {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 9px 10px;
  color: var(--color-text);
  background: transparent;
  text-align: left;
  font-size: 13px;
}

.tag-picker-option:hover,
.tag-picker-option:focus {
  color: var(--color-primary);
  background: rgba(79, 70, 229, 0.09);
  outline: none;
}

.tag-picker-option small,
.tag-picker-empty {
  color: var(--color-muted);
}

.hover-preview {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.hover-preview-trigger {
  cursor: help;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 4px;
}

.hover-preview-card {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 3000;
  width: min(420px, 70vw);
  display: none;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
  white-space: normal;
}

.hover-preview-card small {
  display: block;
  margin-top: 4px;
  color: var(--color-muted);
  font-weight: 500;
}

.hover-preview-card pre {
  margin: 10px 0 0;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.55;
  color: var(--color-text);
}

.hover-preview:hover .hover-preview-card,
.hover-preview:focus-within .hover-preview-card {
  display: block;
}

.site-channel-list {
  display: grid;
  gap: 10px;
}

.site-channel-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 140px 44px;
  gap: 8px;
  align-items: center;
}

.site-channel-name-input,
.site-channel-id-input {
  min-height: 40px;
}

.site-channel-row .btn {
  min-width: 44px;
  min-height: 40px;
  padding-inline: 0;
}

.task-period-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.task-period-row > .form-select {
  width: 128px;
}

.js-task-period-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.period-input {
  display: inline-flex;
  align-items: center;
}

.period-input .form-control {
  width: 76px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.period-input span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: var(--color-surface-soft);
  color: var(--color-muted);
}

.task-cron-input {
  min-width: 260px;
}

.tenant-log-dialog {
  --bs-modal-width: min(1180px, calc(100vw - 48px));
}

.tenant-log-body {
  max-height: min(76vh, 760px);
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(79, 70, 229, 0.035), transparent 220px),
    var(--color-surface);
}

.task-log-shell {
  display: grid;
  gap: 16px;
}

.task-log-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.task-log-search {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
}

.task-log-search i {
  color: var(--color-muted);
}

.task-log-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-text);
  font-weight: 700;
}

.task-log-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-soft);
}

.task-log-filter-btn {
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  background: transparent;
  color: var(--color-muted);
  font-weight: 800;
}

.task-log-filter-btn.active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

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

.task-log-stat {
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.05);
}

.task-log-stat span {
  display: block;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
}

.task-log-stat strong {
  display: block;
  margin-top: 6px;
  color: var(--color-text);
  font-size: 26px;
  line-height: 1;
}

.task-log-stat.is-success strong { color: var(--color-success); }
.task-log-stat.is-running strong { color: var(--color-warning); }
.task-log-stat.is-failed strong { color: var(--color-danger); }

.task-log-list {
  display: grid;
  gap: 12px;
}

.task-log-pager {
  position: sticky;
  bottom: -18px;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  margin-top: 2px;
  padding: 14px 0 0;
  border-top: 1px solid var(--color-border);
  background: linear-gradient(180deg, rgba(255,255,255,0.78), #fff 42%);
  backdrop-filter: blur(10px);
}

.task-log-pager-info {
  color: var(--color-muted);
  font-size: 14px;
}

.task-log-pager-info strong {
  color: var(--color-text);
}

.task-log-pager-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.task-log-page-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
  color: var(--color-text);
  font-weight: 800;
  transition: all .18s ease;
}

.task-log-page-btn:hover:not(:disabled):not(.active) {
  border-color: rgba(99, 91, 255, 0.34);
  color: var(--color-primary);
  box-shadow: 0 10px 22px rgba(99, 91, 255, 0.12);
}

.task-log-page-btn.active {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 12px 24px rgba(99, 91, 255, 0.24);
}

.task-log-page-btn:disabled {
  cursor: not-allowed;
  opacity: .46;
}

.task-log-page-ellipsis {
  min-width: 24px;
  text-align: center;
  color: var(--color-muted);
  font-weight: 800;
}

.task-log-page-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-muted);
  font-size: 14px;
  white-space: nowrap;
}

.task-log-page-size select {
  width: 72px;
  height: 38px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
  color: var(--color-text);
  font-weight: 800;
  padding: 0 10px;
}

.task-log-card {
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.05);
}

.task-log-card.is-success { border-left: 4px solid var(--color-success); }
.task-log-card.is-running { border-left: 4px solid var(--color-warning); }
.task-log-card.is-failed { border-left: 4px solid var(--color-danger); }

.task-log-card-head {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.task-log-state-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.1);
  color: var(--color-primary);
  font-size: 18px;
}

.task-log-card.is-success .task-log-state-icon {
  background: rgba(34, 197, 94, 0.12);
  color: var(--color-success);
}

.task-log-card.is-running .task-log-state-icon {
  background: rgba(245, 158, 11, 0.14);
  color: var(--color-warning);
}

.task-log-card.is-failed .task-log-state-icon {
  background: rgba(239, 68, 68, 0.12);
  color: var(--color-danger);
}

.task-log-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.task-log-title-row strong {
  color: var(--color-text);
  font-size: 16px;
}

.task-log-subline {
  margin-top: 4px;
  color: var(--color-muted);
  font-size: 13px;
}

.task-log-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.task-log-summary {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-soft);
  color: var(--color-text);
  line-height: 1.6;
}

.task-log-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--color-primary);
}

.task-log-card.is-success .task-log-dot { background: var(--color-success); }
.task-log-card.is-running .task-log-dot { background: var(--color-warning); }
.task-log-card.is-failed .task-log-dot { background: var(--color-danger); }

.task-log-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.task-log-meta-cell {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-soft);
}

.task-log-meta-cell span {
  display: block;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
}

.task-log-meta-cell strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text);
  font-size: 13px;
}

.task-log-raw-wrap {
  margin-top: 14px;
}

.task-log-raw {
  margin: 0;
  max-height: 300px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #0f172a;
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.65;
}

.task-log-loading,
.task-log-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed var(--color-border);
  border-radius: 12px;
  color: var(--color-muted);
  background: var(--color-surface-soft);
  font-weight: 800;
}

@media (max-width: 992px) {
  .task-log-toolbar,
  .task-log-card-head {
    grid-template-columns: 1fr;
  }

  .task-log-stats,
  .task-log-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-log-pager {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .task-log-pager-controls {
    justify-content: center;
    flex-wrap: wrap;
  }

  .task-log-page-size {
    justify-content: center;
  }

  .task-log-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 576px) {
  .tenant-log-dialog {
    --bs-modal-width: calc(100vw - 16px);
  }

  .task-log-stats,
  .task-log-meta-grid {
    grid-template-columns: 1fr;
  }

  .task-log-filter-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .site-channel-row {
    grid-template-columns: minmax(0, 1fr) 112px 40px;
    gap: 6px;
  }

  .hover-preview-card {
    left: auto;
    right: 0;
    width: min(340px, 86vw);
  }
}

[data-theme="dark"] .tag-picker {
  background: rgba(15, 23, 42, 0.7);
}

[data-theme="dark"] .tag-picker-menu {
  background: #111827;
}

.password-tool .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.password-tool .btn {
  min-height: 40px;
  border-radius: 0;
  font-weight: 800;
}

.password-tool .btn:last-child {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.form-hint {
  color: var(--color-muted);
  font-size: 12px;
  margin-top: 7px;
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.form-label-row .form-label {
  margin-bottom: 0;
}

.js-polish-prompt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.model-price-note {
  padding: 12px 14px;
  border: 1px solid rgba(79, 70, 229, 0.16);
  border-radius: 10px;
  color: var(--color-muted);
  background: rgba(79, 70, 229, 0.06);
  font-size: 13px;
  line-height: 1.7;
}

.model-price-note strong {
  color: var(--color-text);
}

.schedule-cron-field {
  display: none;
}

.form-control.is-invalid,
.form-select.is-invalid {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.invalid-feedback {
  font-weight: 700;
}

.modal-preview {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface-soft);
  padding: 16px;
  color: var(--color-text);
  white-space: pre-wrap;
}

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

.credential-grid > div {
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface-soft);
  padding: 12px 14px;
}

.credential-grid span {
  display: block;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}

.credential-grid strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface-soft);
}

.profile-avatar-preview {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), #8b5cf6);
  font-size: 28px;
  font-weight: 850;
  box-shadow: 0 12px 26px rgba(79, 70, 229, 0.22);
  flex: 0 0 auto;
}

.profile-avatar-actions {
  min-width: 0;
  flex: 1;
}

.user-customer-field {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
}

.profile-avatar-compact {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.18);
}

.profile-avatar-preview img,
.profile-avatar-compact img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.permission-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
  padding: 14px;
}

.permission-group-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}

.permission-type-block + .permission-type-block {
  margin-top: 12px;
}

.permission-type-title {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  margin-bottom: 8px;
  border-radius: 6px;
  background: rgba(84, 73, 245, 0.1);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.permission-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.permission-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.permission-option span {
  min-width: 0;
}

.permission-option small {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.permission-option input {
  flex: 0 0 auto;
}

.permission-option.is-disabled {
  color: var(--muted);
  background: var(--surface-muted);
}

.delivery-copy-text {
  resize: vertical;
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  line-height: 1.65;
}

.confirm-body {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.confirm-body .confirm-copy {
  color: var(--color-muted);
}

.btn.is-loading {
  pointer-events: none;
  opacity: 0.82;
}

.btn.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin 650ms linear infinite;
}

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

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 18px;
}

.strategy-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.strategy-tab {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  min-height: 40px;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
}

.strategy-tab.active {
  border-color: rgba(79, 70, 229, 0.28);
  background: rgba(79, 70, 229, 0.1);
  color: var(--color-primary);
}

.info-list {
  display: grid;
  gap: 10px;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}

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

.toast-zone {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 3060;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  width: min(540px, calc(100vw - 32px));
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.app-toast {
  display: flex;
  align-items: flex-start;
  width: 100%;
  gap: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--color-text);
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
  pointer-events: auto;
  backdrop-filter: blur(18px);
  animation: toast-pop 0.22s ease-out;
}

.app-toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 12px;
  background: rgba(79, 70, 229, 0.12);
  color: #4f46e5;
  font-size: 18px;
}

.app-toast-message {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
  font-size: 15px;
  line-height: 1.55;
  font-weight: 750;
  word-break: break-word;
}

.app-toast.is-success .app-toast-icon {
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
}

.app-toast.is-warning .app-toast-icon {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.app-toast.is-danger .app-toast-icon {
  background: rgba(239, 68, 68, 0.14);
  color: #dc2626;
}

.clipboard-fallback-input {
  position: fixed;
  left: 50%;
  top: calc(50% + 92px);
  z-index: 3061;
  width: min(520px, calc(100vw - 32px));
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(79, 70, 229, 0.28);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--color-text);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
  transform: translateX(-50%);
}

@keyframes toast-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mono {
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
}

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

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  background:
    radial-gradient(circle at top left, rgba(79, 70, 229, 0.13), transparent 30%),
    linear-gradient(180deg, #ffffff, var(--color-bg));
}

.auth-card {
  width: min(100%, 480px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  box-shadow: var(--shadow-lift);
  padding: 28px;
}

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

.auth-panel {
  display: none;
}

.auth-panel.active {
  display: block;
}

.auth-head h1 {
  margin: 0;
  color: var(--color-text);
  font-size: 26px;
  font-weight: 850;
  letter-spacing: 0;
}

.auth-head p {
  margin: 8px 0 0;
  color: var(--color-muted);
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-link-clean {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--color-primary);
  font-weight: 800;
  padding: 0;
}

.btn-link-clean:hover,
.btn-link-clean:focus {
  color: #4338ca;
  text-decoration: underline;
}

.auth-alert {
  display: none;
  margin-top: 18px;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 750;
}

.auth-alert.show {
  display: block;
}

.auth-alert.success {
  color: #15803d;
  background: rgba(34, 197, 94, 0.13);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.auth-alert.danger {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-alert.info {
  color: #0369a1;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.18);
}

.auth-shell.admin-login {
  place-items: center;
  padding: clamp(28px, 5vw, 72px);
  background:
    linear-gradient(135deg, rgba(240, 253, 250, 0.72), rgba(248, 250, 252, 0.94) 46%, rgba(245, 247, 255, 0.92)),
    repeating-linear-gradient(90deg, rgba(15, 23, 42, 0.025) 0, rgba(15, 23, 42, 0.025) 1px, transparent 1px, transparent 72px),
    repeating-linear-gradient(0deg, rgba(15, 23, 42, 0.022) 0, rgba(15, 23, 42, 0.022) 1px, transparent 1px, transparent 72px);
}

.admin-login .auth-layout {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 28px;
  align-items: stretch;
}

.admin-login .auth-aside,
.admin-login .auth-card {
  min-height: 560px;
}

.admin-login .auth-aside {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 20px;
  padding: clamp(28px, 4vw, 44px);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(236, 253, 245, 0.72)),
    linear-gradient(45deg, rgba(79, 70, 229, 0.08), rgba(20, 184, 166, 0.08));
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.10);
}

.admin-login .auth-aside::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(79, 70, 229, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 184, 166, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(135deg, rgba(0, 0, 0, 0.82), transparent 70%);
  pointer-events: none;
}

.admin-login .auth-aside > * {
  position: relative;
  z-index: 1;
}

.admin-login .auth-aside-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.admin-login .auth-aside-copy {
  max-width: 620px;
}

.admin-login .auth-aside-copy .eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.12);
  color: #0f766e;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
}

.admin-login .auth-aside-copy h1 {
  margin: 18px 0 0;
  max-width: 100%;
  font-size: clamp(34px, 3.4vw, 46px);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.admin-login .auth-aside-copy p {
  margin: 18px 0 0;
  max-width: 520px;
  color: #475569;
  font-size: 16px;
}

.admin-login .auth-aside-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin-login .auth-aside-metrics div {
  min-height: 78px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(12px);
}

.admin-login .auth-aside-metrics strong,
.admin-login .auth-aside-metrics span {
  display: block;
}

.admin-login .auth-aside-metrics strong {
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
}

.admin-login .auth-aside-metrics span {
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
}

.admin-login .auth-card {
  width: 100%;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(30px, 4vw, 42px);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

.admin-login .auth-brand {
  margin-bottom: 34px;
}

.admin-login .brand-mark {
  background: linear-gradient(145deg, #14b8a6, #4f46e5);
}

.admin-login .auth-head h1 {
  font-size: 30px;
}

.admin-login .auth-head p {
  font-size: 15px;
}

.admin-login .auth-form .form-control {
  min-height: 54px;
  background: #f8fafc;
  border-color: #dbe4ee;
}

.admin-login .auth-form .form-control:focus {
  background: #fff;
  border-color: rgba(79, 70, 229, 0.72);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.14);
}

.admin-login .auth-form .btn-primary {
  min-height: 54px;
  border: 0;
  box-shadow: 0 18px 32px rgba(79, 70, 229, 0.24);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

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

@media (max-width: 992px) {
  .admin-login .auth-layout {
    width: min(100%, 520px);
    grid-template-columns: 1fr;
  }

  .admin-login .auth-aside {
    display: none;
  }

  .admin-login .auth-card {
    min-height: auto;
  }

  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

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

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

  .sidebar-nav.nav-tree {
    grid-template-columns: 1fr;
  }

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

  .topbar {
    position: static;
  }
}

@media (max-width: 576px) {
  .auth-shell.admin-login {
    padding: 18px;
  }

  .admin-login .auth-card {
    padding: 24px;
    border-radius: 16px;
  }
}

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

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

  .section-head,
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    height: auto;
    padding: 16px 18px;
  }
}
