/* ============================================================
   身份鉴权网关 — 管理后台 Design Token v1.0
   ============================================================ */

/* ── Brand & Neutral Colors ── */
:root {
  --color-primary: #4F46E5;
  --color-primary-hover: #4338CA;
  --color-primary-active: #3730A3;
  --color-primary-subtle: rgba(79, 70, 229, 0.08);
  --color-primary-light: #EEF2FF;

  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;

  --color-success: #16A34A;
  --color-success-bg: #F0FDF4;
  --color-warning: #D97706;
  --color-warning-bg: #FFFBEB;
  --color-error: #DC2626;
  --color-error-bg: #FEF2F2;
  --color-info: #2563EB;
  --color-info-bg: #EFF6FF;

  --sidebar-bg: #1E293B;
  --sidebar-hover: #334155;
  --sidebar-active: #4F46E5;
  --sidebar-text: #94A3B8;
  --sidebar-text-active: #FFFFFF;
  --sidebar-divider: #334155;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 64px;
}

/* ── Typography ── */
:root {
  --font-display: "Microsoft YaHei", "SimSun", sans-serif;
  --font-body: "Microsoft YaHei", "SimSun", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Consolas", monospace;
}

/* ── Shadows ── */
:root {
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 8px 16px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
}

/* ── Animation ── */
:root {
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --easing-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Semantic Tokens ── */
:root {
  --bg-page: var(--gray-50);
  --bg-surface: #FFFFFF;
  --text-primary: var(--gray-800);
  --text-secondary: var(--gray-500);
  --text-muted: var(--gray-400);
  --text-inverse: #FFFFFF;
  --text-link: var(--color-primary);
  --border-default: var(--gray-200);
  --border-strong: var(--gray-300);
  --border-focus: var(--color-primary);
  --border-error: var(--color-error);

  --table-header-bg: var(--gray-50);
  --table-row-hover: var(--color-primary-light);
  --table-row-selected: rgba(79, 70, 229, 0.06);
  --table-border: var(--gray-200);
}

/* ── Base Styles ── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

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

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  z-index: 40;
  display: flex;
  flex-direction: column;
  transition: width var(--duration-normal) var(--easing-smooth);
  overflow: hidden;
}
.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}
.sidebar-logo {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--sidebar-divider);
}
.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--sidebar-active);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-logo-text {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--duration-normal) var(--easing-smooth);
}
.sidebar.collapsed .sidebar-logo-text {
  opacity: 0;
  width: 0;
}
.sidebar-nav {
  flex: 1;
  padding: 8px 8px 4px;
  overflow-y: auto;
}
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--duration-fast) ease-out, color var(--duration-fast) ease-out;
  margin-bottom: 1px;
}
.sidebar-nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.sidebar-nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
}
.sidebar-nav-item i {
  flex-shrink: 0;
}
.sidebar-nav-label {
  overflow: hidden;
  transition: opacity var(--duration-normal) var(--easing-smooth);
}
.sidebar.collapsed .sidebar-nav-label {
  opacity: 0;
  width: 0;
}
.sidebar-section-title {
  padding: 10px 12px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.sidebar.collapsed .sidebar-section-title {
  opacity: 0;
  height: 0;
  padding: 0;
  overflow: hidden;
}
.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--sidebar-divider);
  flex-shrink: 0;
}

/* ── Topbar ── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--border-default);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  transition: left var(--duration-normal) var(--easing-smooth);
}
.sidebar.collapsed ~ .topbar {
  left: var(--sidebar-collapsed-width);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  transition: margin-left var(--duration-normal) var(--easing-smooth);
  padding: 24px;
}
.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed-width);
}
.content-inner {
  max-width: 1440px;
  margin: 0 auto;
}

/* ── Page Header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--gray-900);
}
.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 36px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background var(--duration-fast) ease-out, box-shadow var(--duration-fast) ease-out, transform var(--duration-fast) ease-out;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active {
  transform: scale(0.98);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
}
.btn-primary:active:not(:disabled) {
  background: var(--color-primary-active);
}
.btn-secondary {
  background: #fff;
  color: var(--gray-700);
  border: 1px solid var(--border-default);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--gray-300);
}
.btn-ghost {
  background: transparent;
  color: var(--gray-600);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--gray-100);
  color: var(--gray-800);
}
.btn-danger {
  background: var(--color-error);
  color: #fff;
}
.btn-danger:hover:not(:disabled) {
  background: #B91C1C;
}
.btn-danger-outline {
  background: #fff;
  color: var(--color-error);
  border: 1px solid var(--color-error);
}
.btn-danger-outline:hover:not(:disabled) {
  background: var(--color-error-bg);
}
.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}
.btn-xs {
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
  border-radius: 6px;
}

/* ── Filter Bar ── */
.filter-bar {
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.filter-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}
.filter-input {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  background: #fff;
  min-width: 160px;
  transition: border-color var(--duration-fast) ease-out, box-shadow var(--duration-fast) ease-out;
}
.filter-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.10);
}
.filter-input::placeholder {
  color: var(--text-muted);
}
.filter-select {
  height: 36px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
  min-width: 120px;
  transition: border-color var(--duration-fast) ease-out, box-shadow var(--duration-fast) ease-out;
}
.filter-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.10);
}

/* ── Table ── */
.table-container {
  background: #fff;
  border: 1px solid var(--table-border);
  border-radius: 10px;
  overflow: hidden;
}
.table-wrapper {
  overflow-x: auto;
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
}
table.data-table th {
  background: var(--table-header-bg);
  padding: 8px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  white-space: nowrap;
  border-bottom: 1px solid var(--table-border);
  user-select: none;
}
table.data-table th.sorted {
  color: var(--color-primary);
}
table.data-table td {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--table-border);
  vertical-align: middle;
  line-height: 1.4;
}
table.data-table tr:last-child td {
  border-bottom: none;
}
table.data-table tbody tr {
  transition: background var(--duration-fast) ease-out;
}
table.data-table tbody tr:hover {
  background: var(--table-row-hover);
}
table.data-table tbody tr.selected {
  background: var(--table-row-selected);
  box-shadow: inset 3px 0 0 var(--color-primary);
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}
.badge-success {
  background: var(--color-success-bg);
  color: var(--color-success);
}
.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}
.badge-error {
  background: var(--color-error-bg);
  color: var(--color-error);
}
.badge-info {
  background: var(--color-info-bg);
  color: var(--color-info);
}
.badge-neutral {
  background: var(--gray-100);
  color: var(--gray-500);
}

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid var(--border-default);
  font-size: 13px;
  color: var(--text-secondary);
}
.pagination-pages {
  display: flex;
  align-items: center;
  gap: 2px;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 4px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--gray-600);
  font-size: 13px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background var(--duration-fast) ease-out, color var(--duration-fast) ease-out;
}
.page-btn:hover {
  background: var(--gray-100);
}
.page-btn.active {
  background: var(--color-primary);
  color: #fff;
}
.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}
.empty-state i {
  color: var(--gray-300);
  margin-bottom: 12px;
}
.empty-state h3 {
  font-size: 16px;
  font-weight: 500;
  color: var(--gray-600);
  margin-bottom: 4px;
}
.empty-state p {
  font-size: 14px;
  color: var(--text-muted);
}

/* ── Overlay & Drawer ── */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-normal) var(--easing-smooth), visibility var(--duration-normal) var(--easing-smooth);
}
.overlay.open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  height: 100vh;
  background: #fff;
  z-index: 60;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--duration-normal) var(--easing-smooth);
}
.drawer.open {
  transform: translateX(0);
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
}
.drawer-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--gray-900);
}
.drawer-close {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  transition: background var(--duration-fast) ease-out, color var(--duration-fast) ease-out;
}
.drawer-close:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}
.drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-default);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-normal) var(--easing-smooth), visibility var(--duration-normal) var(--easing-smooth);
}
.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}
.modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  width: 440px;
  max-width: calc(100vw - 32px);
  transform: scale(0.95);
  transition: transform var(--duration-normal) var(--easing-smooth);
}
.modal-overlay.open .modal {
  transform: scale(1);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}
.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
}
.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  transition: background var(--duration-fast) ease-out, color var(--duration-fast) ease-out;
}
.modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}
.modal-body {
  padding: 16px 24px 24px;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 24px 20px;
}

/* ── Form Fields ── */
.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-label .required {
  color: var(--color-error);
  margin-left: 2px;
}
.form-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  background: #fff;
  transition: border-color var(--duration-fast) ease-out, box-shadow var(--duration-fast) ease-out;
}
.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.10);
}
.form-input:disabled {
  background: var(--gray-50);
  color: var(--text-muted);
  cursor: not-allowed;
}
.form-input::placeholder {
  color: var(--text-muted);
}
.form-input-error {
  border-color: var(--border-error);
}
.form-input-error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.10);
}
.form-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.form-error-text {
  font-size: 12px;
  color: var(--color-error);
  margin-top: 4px;
  display: none;
}
.form-select {
  width: 100%;
  height: 40px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
  transition: border-color var(--duration-fast) ease-out, box-shadow var(--duration-fast) ease-out;
}
.form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.10);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-info {
  font-size: 14px;
  color: var(--gray-700);
  padding: 8px 0;
  font-family: var(--font-mono);
}

/* ── Toast ── */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  padding: 12px 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 300ms var(--easing-smooth), transform 300ms var(--easing-smooth);
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.toast-success {
  background: #F0FDF4;
  color: #16A34A;
  border: 1px solid #BBF7D0;
}
.toast-error {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
}

/* ── Checkbox ── */
.table-checkbox {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--gray-300);
  border-radius: 4px;
  cursor: pointer;
  accent-color: var(--color-primary);
}

/* ── Login Page Specific ── */
.login-card {
  background: var(--bg-surface);
  box-shadow: var(--shadow-xl);
  border-radius: 12px;
  width: 400px;
  padding: 40px 32px;
}

.login-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-primary);
  background: #fff;
  transition: border-color var(--duration-fast) ease-out, box-shadow var(--duration-fast) ease-out;
}
.login-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.login-input::placeholder {
  color: var(--text-muted);
}
.login-input.error {
  border-color: var(--border-error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.10);
}

.login-btn {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--color-primary);
  cursor: pointer;
  transition: background var(--duration-fast) ease-out, transform var(--duration-fast) ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.login-btn:hover:not(:disabled) {
  background: var(--color-primary-hover);
}
.login-btn:active:not(:disabled) {
  background: var(--color-primary-active);
  transform: scale(0.99);
}
.login-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.verify-btn {
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--color-primary);
  border-radius: 8px;
  background: #fff;
  color: var(--color-primary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--duration-fast) ease-out, color var(--duration-fast) ease-out;
  flex-shrink: 0;
}
.verify-btn:hover:not(:disabled) {
  background: var(--color-primary-light);
}
.verify-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Radio Group ── */
.radio-group {
  display: flex;
  gap: 20px;
  padding: 4px 0;
}
.radio-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--gray-700);
  cursor: pointer;
}
.radio-item input[type="radio"] {
  accent-color: var(--color-primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ── Expandable Row (logs) ── */
.row-detail {
  display: none;
  background: var(--gray-50);
}
.row-detail.open {
  display: table-row;
}
.row-detail td {
  padding: 16px 24px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.detail-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.detail-value {
  font-size: 14px;
  color: var(--gray-700);
  font-family: var(--font-mono);
  word-break: break-all;
}
.expand-icon {
  transition: transform var(--duration-fast) var(--easing-smooth);
}
.expand-icon.open {
  transform: rotate(90deg);
}

/* ── KPI Cards (dashboard) ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

.kpi-card {
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: box-shadow var(--duration-fast) ease-out;
}
.kpi-card:hover {
  box-shadow: var(--shadow-md);
}
.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-icon.blue {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.kpi-icon.green {
  background: var(--color-success-bg);
  color: var(--color-success);
}
.kpi-icon.red {
  background: var(--color-error-bg);
  color: var(--color-error);
}
.kpi-icon.amber {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}
.kpi-content {
  flex: 1;
  min-width: 0;
}
.kpi-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.kpi-change {
  font-size: 13px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.kpi-change.up {
  color: var(--color-success);
}
.kpi-change.down {
  color: var(--color-error);
}

/* ── Chart Placeholder ── */
.chart-area {
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}
.chart-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 16px;
}
.chart-placeholder {
  width: 100%;
  height: 240px;
  background: linear-gradient(180deg, var(--gray-50) 0%, #fff 100%);
  border: 1px dashed var(--gray-200);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 8px;
}

/* ── Ranking Cards ── */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 1024px) {
  .bottom-grid { grid-template-columns: 1fr; }
}
.rank-card {
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 20px 24px;
}
.rank-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rank-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
}
.rank-item:last-child {
  border-bottom: none;
}
.rank-number {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  background: var(--gray-100);
  margin-right: 12px;
  flex-shrink: 0;
}
.rank-number.top {
  background: var(--color-primary);
  color: #fff;
}
.rank-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  font-family: var(--font-mono);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-bar-wrap {
  width: 120px;
  height: 6px;
  background: var(--gray-100);
  border-radius: 3px;
  margin: 0 12px;
  flex-shrink: 0;
}
.rank-bar {
  height: 100%;
  border-radius: 3px;
  background: var(--color-primary);
  transition: width var(--duration-slow) var(--easing-smooth);
}
.rank-count {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 40px;
  text-align: right;
}

/* ── Filter Grid (logs) ── */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.filter-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding-top: 18px;
}
