/* ========================================
   中传支付系统 - 后台UI样式 v3
   1:1 对标 shoplus.net (超店后台) 实际样式
   - 字号/字重/颜色完全对标
   ======================================== */

:root {
  /* 主色调 */
  --primary: #0560FD;
  --primary-hover: #0450d4;
  --primary-light: #E6EFFF;
  --primary-dark: #0450d4;

  /* 功能色 (对标 shoplus) */
  --success: #00B96B;
  --success-light: #E8F9F1;
  --warning: #FA8C16;
  --warning-light: #FFF4E6;
  --danger: #F5222D;
  --danger-light: #FFEAEA;
  --info: #0560FD;
  --info-light: #E6EFFF;

  /* 中性色 */
  --bg-page: #F0F2F7;
  --bg-card: #FFFFFF;
  --bg-sidebar: #FAFBFF;
  --bg-sidebar-hover: #F0F2F7;
  --bg-sidebar-active: #E6EFFF;
  --bg-header: #102041;
  --bg-hover: #F5F7FA;
  --bg-table-header: #F2F3F6;

  /* 文字色 - 对标 shoplus */
  --text-primary: #010517;     /* 主文字 */
  --text-secondary: #676974;   /* 次要文字 rgb(103,105,116) */
  --text-tertiary: #8C8C8C;    /* 辅助文字 */
  --text-inverse: #FFFFFF;
  --text-link: #0560FD;

  /* 边框 */
  --border: #E5E6E7;           /* 对标 shoplus 按钮边框 */
  --border-light: #F0F2F7;
  --border-dark: #D9D9D9;

  /* 圆角 */
  --radius-sm: 3px;
  --radius: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-full: 9999px;

  /* 间距 */
  --sidebar-width: 220px;
  --header-height: 60px;
  --menu-item-height: 48px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  font-family: "PingFang SC", "Helvetica Neue", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: 400;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ============ Layout ============ */
.app-layout { display: flex; min-height: 100vh; }

/* ============ Sidebar ============ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: var(--text-primary);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  border-right: 1px solid var(--border-light);
}

.sidebar-brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  background: var(--bg-header);
  letter-spacing: 0.3px;
}

.sidebar-brand .brand-icon {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, #0560FD, #6366f1);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  margin-right: 10px;
  color: #fff;
  font-size: 16px;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.sidebar-menu::-webkit-scrollbar { width: 4px; }
.sidebar-menu::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 4px; }

.menu-item {
  display: flex;
  align-items: center;
  height: var(--menu-item-height);
  padding: 0 12px 0 16px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  text-decoration: none;
}

.menu-item:hover {
  background: var(--bg-sidebar-hover);
  color: var(--primary);
}

.menu-item.active {
  background: var(--bg-sidebar-active);
  color: var(--primary);
  font-weight: 500;
}

.menu-item .menu-icon {
  width: 18px; height: 18px;
  margin-right: 10px;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.menu-item .menu-arrow {
  margin-left: auto;
  font-size: 12px;
  transition: transform 0.2s;
  color: var(--text-tertiary);
}

.menu-item.expanded .menu-arrow { transform: rotate(90deg); }

.menu-sub { display: none; }
.menu-sub.open { display: block; }

.menu-sub .menu-item {
  padding-left: 44px;
  font-size: 13px;
  height: 40px;
}

.menu-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  padding: 0 6px;
  border-radius: 10px;
  min-width: 18px;
  height: 18px;
  text-align: center;
  line-height: 18px;
}

/* ============ Main ============ */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

/* ============ Header (深色) ============ */
.header {
  height: var(--header-height);
  background: var(--bg-header);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-btn {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  font-size: 16px;
  background: transparent;
  border: none;
}

.header-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.header-btn .badge {
  position: absolute;
  top: 4px; right: 4px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-weight: 600;
}

.header-divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.15);
  margin: 0 8px;
}

.header-text {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.header-text:hover { color: #fff; }

.user-menu {
  display: flex;
  align-items: center;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.user-menu:hover { background: rgba(255,255,255,0.1); }

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0560FD, #6366f1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  margin-right: 8px;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-info .name { font-size: 14px; color: #fff; font-weight: 500; }
.user-info .role { font-size: 12px; color: rgba(255,255,255,0.6); }

.content {
  flex: 1;
  padding: 24px;
}

/* ============ Page Header (24px/700) ============ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  min-height: 40px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 14px;
  font-weight: 300;
  color: var(--text-primary);
  margin-top: 4px;
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 400;
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { margin: 0 8px; color: var(--text-tertiary); }

/* ============ Card (扁平 + 10px 圆角) ============ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: none;
  border: none;
  margin-bottom: 16px;
}

.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-body { padding: 20px 16px; }

.card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ============ Stat Cards ============ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: none;
  border: none;
  transition: transform 0.15s;
}

.stat-card:hover { transform: translateY(-2px); }

/* shoplus 统计卡：标签 14px/400，数值 22px/700 */
.stat-card .stat-label {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.stat-card .stat-trend {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}

.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }
.stat-icon.purple { background: var(--info-light); color: var(--info); }

/* ============ Table (对标 shoplus) ============ */
.table-wrapper {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table-toolbar {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.table-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-light);
  padding: 0 16px;
}

.tab {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 48px;
}

.tab:hover { color: var(--primary); }
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 500;
}

/* Tab 计数标记 - 对标 shoplus 12px 白字 蓝底圆角 */
.tab .tab-count {
  background: var(--bg-table-header);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 400;
  padding: 0 7px;
  border-radius: 10px;
  min-width: 18px;
  height: 18px;
  text-align: center;
  line-height: 18px;
}

.tab.active .tab-count {
  background: var(--primary);
  color: #fff;
}

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

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

/* 表头 12px / 700 */
.data-table thead th {
  background: var(--bg-table-header);
  padding: 0 0 0 12px;
  height: 42px;
  text-align: left;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  font-size: 12px;
}

/* 表格内容 14px / 400 */
.data-table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
  font-size: 14px;
  font-weight: 400;
}

.data-table tbody tr {
  transition: background 0.1s;
}

.data-table tbody tr:hover {
  background: #FAFBFF;
}

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

.data-table .row-checkbox {
  width: 40px;
  text-align: center;
}

/* 表格内操作链接 12px */
.data-table .btn-link {
  font-size: 12px;
}

.table-pagination {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
}

.pagination {
  display: flex;
  gap: 4px;
  align-items: center;
}

.pagination button {
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 400;
  padding: 0 8px;
  transition: all 0.15s;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============ Form ============ */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-weight: 400;
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-primary);
  background: #fff;
  transition: all 0.15s;
  font-family: inherit;
  height: 32px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(5, 96, 253, 0.1);
}

.form-input::placeholder { color: var(--text-tertiary); }

.form-textarea { min-height: 80px; resize: vertical; height: auto; padding: 8px 12px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.form-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============ Button (对标 shoplus 32px 高 / 14px/400 / 4px 圆角) ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-primary);
  transition: all 0.15s;
  white-space: nowrap;
  line-height: 1;
  height: 32px;
}

.btn:hover { 
  border-color: var(--primary);
  color: var(--primary);
  background: #fff;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}

.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #00a35e; color: #fff; border-color: #00a35e; }

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #d11f2a; color: #fff; border-color: #d11f2a; }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover { background: var(--bg-hover); color: var(--primary); border-color: transparent; }

.btn-sm { padding: 0 10px; font-size: 12px; height: 28px; }
.btn-lg { padding: 0 22px; font-size: 14px; height: 40px; }
.btn-block { width: 100%; }
.btn-icon { padding: 7px; }

.btn-link {
  background: transparent;
  border: none;
  color: var(--primary);
  padding: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  height: auto;
}

.btn-link:hover { color: var(--primary-hover); text-decoration: underline; }

.btn-group { display: inline-flex; gap: 8px; }

/* ============ Badge / Tag (对标 shoplus) ============ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  font-size: 12px;
  border-radius: var(--radius);
  font-weight: 400;
  line-height: 22px;
  height: 22px;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-default { background: var(--bg-table-header); color: var(--text-secondary); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-purple { background: var(--info-light); color: var(--info); }

.dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: 5px;
}

.dot-success { background: var(--success); }
.dot-warning { background: var(--warning); }
.dot-danger { background: var(--danger); }
.dot-info { background: var(--info); }
.dot-default { background: var(--text-tertiary); }

/* ============ Switch ============ */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.25);
  border-radius: 22px;
  transition: 0.3s;
}

.switch-slider::before {
  content: "";
  position: absolute;
  height: 18px; width: 18px;
  left: 2px; bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }

/* ============ Empty State ============ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

/* ============ Modal ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,0.16);
}

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

.modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }

.modal-body { padding: 20px; overflow-y: auto; flex: 1; }

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ============ Login ============ */
.login-layout {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, #102041 0%, #0560FD 100%);
  position: relative;
  overflow: hidden;
}

/* v8.5: Modern split-screen login layout (emerald theme, inspired by airzqht.cn) */
.login-layout.split {
  background: #fff;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.login-split-wrap {
  display: flex;
  width: 100%;
  max-width: 1440px;
  height: 100vh;
  max-height: 900px;
  overflow: hidden;
  background: #fff;
}
/* Left brand panel */
.login-split-brand {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 60px;
  color: #fff;
  background: linear-gradient(135deg, #0a4d3c 0%, #14785f 30%, #1da87f 60%, #4ad199 100%);
  overflow: hidden;
}
.login-split-brand::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.login-split-brand::after {
  content: '';
  position: absolute;
  bottom: -150px; left: -150px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(29,168,127,0.2) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.login-split-brand > * { position: relative; z-index: 1; }
.brand-top {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: rgba(255,255,255,0.7);
}
.brand-top .brand-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
}
.brand-center { z-index: 1; }
.brand-center .welcome {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 12px;
}
.brand-center .brand-title {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 16px;
}
.brand-center .brand-slogan {
  font-size: 18px;
  line-height: 1.6;
  color: rgba(255,255,255,0.85);
  max-width: 480px;
}
.brand-bottom {
  display: flex;
  gap: 40px;
}
.brand-bottom .stat-item .num {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
}
.brand-bottom .stat-item .label {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
}
/* Right form panel */
.login-split-form-wrap {
  width: 504px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  height: 100%;
  overflow-y: auto;
}
.login-split-form-top {
  padding: 24px 48px 0;
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  font-size: 14px;
}
.login-split-form-top a {
  color: #8F96AE;
  text-decoration: none;
  font-weight: 500;
}
.login-split-form-top a:hover { color: #10b981; }
.login-split-form {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 48px;
}
.login-split-form .login-form-content {
  width: 100%;
  max-width: 420px;
}
.form-title {
  font-size: 30px;
  font-weight: 600;
  color: #262626;
  margin-bottom: 24px;
}
/* Role tabs */
.role-tabs {
  display: flex;
  gap: 32px;
  border-bottom: 1px solid #E5E7EB;
  margin-bottom: 28px;
}
.role-tab {
  padding: 12px 0;
  font-size: 16px;
  font-weight: 500;
  color: #8F96AE;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
  cursor: pointer;
}
.role-tab:hover { color: #10b981; }
.role-tab.active {
  color: #262626;
  border-bottom-color: #10b981;
}
/* Underline-only inputs (matches airzqht style) */
.ul-input-wrap {
  position: relative;
  border-bottom: 1px solid #E5E7EB;
  transition: border-color 0.2s;
  margin-bottom: 20px;
}
.ul-input-wrap:focus-within { border-bottom-color: #10b981; }
.ul-input-wrap label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #8F96AE;
  margin-bottom: 8px;
}
.ul-input {
  width: 100%;
  border: none;
  outline: none;
  padding: 12px 0;
  font-size: 16px;
  color: #262626;
  background: transparent;
  font-family: inherit;
}
.ul-input::placeholder { color: #C5CBD6; font-size: 16px; }
.ul-input.with-prefix { padding-left: 36px; }
.ul-input-prefix {
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #7A8499;
}
.ul-input-icon {
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #8F96AE;
  font-size: 18px;
}
/* Form row (remember me / forgot) */
.ul-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 13px;
  color: #8F96AE;
}
.ul-form-row a {
  color: #10b981;
  text-decoration: none;
  font-weight: 600;
}
.ul-form-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
/* Primary button (emerald) */
.btn-emerald {
  width: 100%;
  height: 46px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-emerald:hover { background: #059669; }
.btn-emerald:disabled {
  background: #C5CBD6;
  cursor: not-allowed;
}
/* Divider with "or" */
.divider-or {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: #8F96AE;
  font-size: 13px;
}
.divider-or::before, .divider-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #E5E7EB;
}
/* Social buttons (optional, kept for parity) */
.btn-social {
  width: 100%;
  height: 46px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  color: #474F5E;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}
.btn-social:hover { border-color: #10b981; color: #10b981; }
.login-split-form-bottom {
  padding: 16px 48px 24px;
  text-align: center;
  font-size: 13px;
  color: #8F96AE;
}
.form-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
  color: #8F96AE;
}
.form-footer a {
  color: #10b981;
  text-decoration: none;
  font-weight: 600;
}
@media (max-width: 1024px) {
  .login-split-brand { display: none; }
  .login-split-form-wrap { width: 100%; max-width: 504px; margin: 0 auto; }
}
@media (max-width: 500px) {
  .login-split-form, .login-split-form-top, .login-split-form-bottom { padding-left: 24px; padding-right: 24px; }
}

.login-card {
  background: #fff;
  border-radius: 10px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  margin: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1;
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-brand .logo {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #0560FD, #6366f1);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  margin-bottom: 12px;
}

.login-brand h1 { font-size: 22px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.login-brand p { font-size: 14px; font-weight: 300; color: var(--text-tertiary); }

.login-tabs {
  display: flex;
  background: var(--bg-page);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 24px;
}

.login-tab {
  flex: 1;
  text-align: center;
  padding: 8px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.15s;
  text-decoration: none;
}

.login-tab.active {
  background: #fff;
  color: var(--primary);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* ============ Alert ============ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 400;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert-info { background: var(--info-light); color: var(--info); }
.alert-success { background: var(--success-light); color: var(--success); }
.alert-warning { background: var(--warning-light); color: var(--warning); }
.alert-danger { background: var(--danger-light); color: var(--danger); }

/* ============ Grid ============ */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
}

/* ============ Helpers ============ */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-tertiary); }
.text-secondary { color: var(--text-secondary); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.font-light { font-weight: 300; }
.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }
.text-2xl { font-size: 24px; }

.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.ml-1 { margin-left: 4px; } .ml-2 { margin-left: 8px; } .ml-3 { margin-left: 12px; }
.mr-1 { margin-right: 4px; } .mr-2 { margin-right: 8px; } .mr-3 { margin-right: 12px; }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.w-full { width: 100%; }
.cursor-pointer { cursor: pointer; }

/* ============ Progress ============ */
.progress {
  height: 6px;
  background: var(--bg-table-header);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s;
}

/* ============ Chart ============ */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 200px;
  padding: 20px;
}

.bar-chart .bar {
  flex: 1;
  background: linear-gradient(180deg, var(--primary) 0%, #6366f1 100%);
  border-radius: 4px 4px 0 0;
  min-height: 20px;
  position: relative;
  transition: opacity 0.2s;
}

.bar-chart .bar:hover { opacity: 0.85; }

.bar-chart .bar::after {
  content: attr(data-value);
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.donut-chart {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: conic-gradient(
    var(--primary) 0% 35%,
    var(--success) 35% 60%,
    var(--warning) 60% 80%,
    var(--info) 80% 95%,
    var(--text-tertiary) 95% 100%
  );
  position: relative;
  margin: 0 auto;
}

.donut-chart::before {
  content: '';
  position: absolute;
  inset: 25%;
  background: #fff;
  border-radius: 50%;
}

.donut-chart .donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-tertiary);
}

.donut-chart .donut-center .donut-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ============ Permission Grid ============ */
.permission-grid {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.permission-section {
  border-bottom: 1px solid var(--border-light);
}

.permission-section:last-child { border-bottom: none; }

.permission-section-header {
  padding: 10px 16px;
  background: var(--bg-table-header);
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.permission-row {
  padding: 8px 16px 8px 40px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  border-top: 1px solid var(--border-light);
}

.permission-row .perm-name {
  flex: 1;
  color: var(--text-primary);
}

.permission-row .perm-tag {
  font-size: 12px;
  padding: 0 8px;
  border-radius: var(--radius);
  background: var(--warning-light);
  color: var(--warning);
  height: 20px;
  line-height: 20px;
}

/* ============ Timeline ============ */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 16px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -21px;
  top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary);
}

.timeline-item.danger::before { border-color: var(--danger); }
.timeline-item.success::before { border-color: var(--success); }
.timeline-item.warning::before { border-color: var(--warning); }

.timeline-time { font-size: 12px; color: var(--text-tertiary); margin-bottom: 4px; }
.timeline-title { font-size: 14px; color: var(--text-primary); font-weight: 500; }
.timeline-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ============ Checkbox ============ */
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  cursor: pointer;
  accent-color: var(--primary);
}

input[type="radio"] {
  accent-color: var(--primary);
  cursor: pointer;
}

select.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23676974' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ============ v11 新增样式 ============ */

/* 侧边栏折叠模式 */
.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .sidebar-brand span:not(.brand-icon) { display: none; }
.sidebar.collapsed .menu-item span:not(.menu-icon) { display: none; }
.sidebar.collapsed .menu-item .menu-icon { margin-right: 0; }
.sidebar.collapsed .menu-badge { display: none; }
.sidebar.collapsed .menu-arrow { display: none; }
.sidebar.collapsed .menu-sub { display: none !important; }
.sidebar.collapsed .menu-item { justify-content: center; padding: 0; }
.main.sidebar-collapsed { margin-left: 64px; }
.main { transition: margin-left 0.3s; }
.sidebar { transition: width 0.3s; }

/* 侧边栏底部搜索框 */
.sidebar-search {
  padding: 8px 16px 12px;
  border-top: 1px solid var(--border-light);
}
.sidebar-search input {
  width: 100%;
  height: 32px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--bg-page);
  color: var(--text-primary);
  outline: none;
  transition: all 0.15s;
}
.sidebar.search-input:focus { border-color: var(--primary); }
.sidebar-search { position: relative; }
.sidebar-search .iconify {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 14px;
}
.sidebar.collapsed .sidebar-search { display: none; }

/* 喇叭下拉面板 */
.bell-dropdown {
  position: absolute;
  top: 50px;
  right: 0;
  width: 360px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  z-index: 200;
  display: none;
  max-height: 480px;
  overflow-y: auto;
}
.bell-dropdown.open { display: block; }
.bell-dropdown-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bell-dropdown-header .title { font-size: 15px; font-weight: 700; }
.bell-dropdown-header .mark-read { font-size: 12px; color: var(--primary); cursor: pointer; }
.bell-dropdown-item {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.15s;
}
.bell-dropdown-item:hover { background: var(--bg-hover); }
.bell-dropdown-item:last-child { border-bottom: none; }
.bell-dropdown-item .item-time { font-size: 11px; color: var(--text-tertiary); margin-bottom: 4px; }
.bell-dropdown-item .item-title { font-size: 13px; font-weight: 500; color: var(--text-primary); margin-bottom: 2px; }
.bell-dropdown-item .item-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.bell-dropdown-item.unread { background: rgba(5,96,253,0.03); }
.bell-dropdown-item.unread::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--primary);
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.bell-dropdown-footer {
  padding: 10px 20px;
  text-align: center;
  border-top: 1px solid var(--border-light);
}
.bell-dropdown-footer a { font-size: 13px; color: var(--primary); text-decoration: none; }

/* 用户下拉菜单 */
.user-dropdown {
  position: absolute;
  top: 50px;
  right: 24px;
  width: 220px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  z-index: 200;
  display: none;
  overflow: hidden;
}
.user-dropdown.open { display: block; }
.user-dropdown-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-dropdown-header .avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0560FD, #6366f1);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
}
.user-dropdown-header .info .name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.user-dropdown-header .info .role { font-size: 12px; color: var(--text-tertiary); }
.user-dropdown-menu { padding: 8px 0; }
.user-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.15s;
}
.user-dropdown-menu a:hover { background: var(--bg-hover); color: var(--primary); }
.user-dropdown-menu a .iconify { font-size: 16px; color: var(--text-tertiary); }
.user-dropdown-menu a:hover .iconify { color: var(--primary); }
.user-dropdown-divider { height: 1px; background: var(--border-light); margin: 4px 0; }
.user-dropdown-menu a.danger { color: var(--danger); }
.user-dropdown-menu a.danger .iconify { color: var(--danger); }

/* 折叠按钮 */
.sidebar-toggle {
  position: absolute;
  top: 18px;
  right: -12px;
  width: 24px; height: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 101;
  font-size: 12px;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.sidebar-toggle:hover { border-color: var(--primary); color: var(--primary); }
.sidebar.collapsed .sidebar-toggle { right: -12px; }
.sidebar-toggle .iconify { transition: transform 0.3s; }
.sidebar.collapsed .sidebar-toggle .iconify { transform: rotate(180deg); }
