/* ═══ Admin Console v2 — Design System ═══ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

/* §55（2026-08-09）：KP 字体（fervojo/kreadon/andada）的 @font-face
   已从 admin.css 删除（admin.html 不再展示字体预览）
   字体预览统一在 v11.html 顶栏「管理」弹窗的「字体」Tab，由 ui-admin.js
   的 _ensureKpFontFace 动态注入到 document.head（同样绝对路径 /apps/kp/fonts/...） */

:root {
  --bg: #0c0e14;
  --bg2: #111319;
  --card: #161922;
  --surface: #161922;
  --surface2: #1c1f2b;
  --border: #232636;
  --border2: #2c3044;
  --text: #e8eaf0;
  --text2: #9498ab;
  --muted: #9498ab;
  --text3: #5d6178;
  --accent: #4f8cff;
  --accent2: #3d6fd4;
  --green: #34d399;
  --red: #f87171;
  --yellow: #fbbf24;
  --orange: #fb923c;
  --sidebar-bg: var(--bg2);
  --sidebar-w: 220px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 13px;
  line-height: 1.5;
}

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

/* ═══ Sidebar ═══ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  padding: 0;
}
.sidebar-brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-brand-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, #7c5cff 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: #fff;
  box-shadow: 0 2px 8px rgba(79,140,255,0.25);
}
.sidebar-brand-text { font-size: 13px; font-weight: 600; }
.sidebar-brand-sub { font-size: 10px; color: var(--text3); margin-top: 1px; }
.sidebar-section { padding: 14px 10px 6px; }
.sidebar-section-label {
  font-size: 10px; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0 8px; margin-bottom: 4px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 7px;
  cursor: pointer; color: var(--text2);
  font-size: 12.5px; font-weight: 450;
  transition: all 0.12s ease; margin-bottom: 1px;
  position: relative;
  border-left: none;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.nav-item.active { color: #fff; background: rgba(79,140,255,0.12); border-left-color: transparent; }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 50%;
  transform: translateY(-50%); width: 3px; height: 16px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-item .badge {
  margin-left: auto; font-size: 10px; padding: 1px 6px;
  border-radius: 10px; background: rgba(251,191,36,0.15);
  color: var(--yellow); font-weight: 600; font-variant-numeric: tabular-nums;
}
.sidebar-footer {
  margin-top: auto; padding: 14px 18px;
  border-top: 1px solid var(--border);
}
.sidebar-user { display: flex; align-items: center; gap: 8px; }
.sidebar-avatar {
  width: 28px; height: 28px; border-radius: 7px;
  background: linear-gradient(135deg, var(--green) 0%, #059669 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}
.sidebar-user-name { font-size: 12px; font-weight: 500; }
.sidebar-user-role { font-size: 10px; color: var(--text3); }

/* ═══ Main ═══ */
.main {
  flex: 1; margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
}

/* ═══ Topbar ═══ */
.topbar {
  height: 52px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 28px;
  gap: 16px; flex-shrink: 0; background: var(--bg);
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.topbar-sep { width: 1px; height: 20px; background: var(--border); }
.topbar-breadcrumb { font-size: 12px; color: var(--text3); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar-btn {
  padding: 5px 12px; border-radius: 6px; font-size: 11.5px;
  font-weight: 500; cursor: pointer; border: 1px solid var(--border);
  background: transparent; color: var(--text2);
  transition: all 0.12s; display: flex; align-items: center; gap: 5px;
  font-family: inherit;
}
.topbar-btn:hover { border-color: var(--border2); color: var(--text); }
.topbar-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.topbar-btn.primary:hover { background: var(--accent2); }
.topbar-btn.danger { color: var(--red); border-color: rgba(248,113,113,0.3); }

/* ═══ Content ═══ */
.content { flex: 1; padding: 24px 28px; overflow-y: auto; max-width: none; }
.panel { display: none; }
.panel.active { display: block; }
.panel-title { font-size: 1.1rem; margin-bottom: 20px; }

/* ═══ Stat Cards ═══ */
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px;
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: var(--border);
}
.stat-card.accent::after { background: var(--accent); }
.stat-card.green::after { background: var(--green); }
.stat-card.yellow::after { background: var(--yellow); }
.stat-card.orange::after { background: var(--orange); }
.stat-card .label {
  font-size: 11px; color: var(--text3); text-transform: uppercase;
  letter-spacing: 0.06em; font-weight: 500; margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.stat-card .label i { font-size: 13px; }
.stat-card .value {
  font-size: 26px; font-weight: 700; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.stat-card .value.ok { color: var(--green); }
.stat-card .value.err { color: var(--red); }
.stat-card .sub { font-size: 11px; color: var(--text3); margin-top: 6px; }
.stat-trend {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 600; padding: 2px 6px;
  border-radius: 4px; margin-top: 6px;
}
.stat-trend.up { background: rgba(52,211,153,0.1); color: var(--green); }
.stat-trend.down { background: rgba(248,113,113,0.1); color: var(--red); }

/* ═══ Cards ═══ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 0; margin-bottom: 16px; overflow: hidden;
}
.card h4 {
  font-size: 12.5px; font-weight: 600; padding: 14px 18px;
  border-bottom: 1px solid var(--border); margin: 0;
  display: flex; align-items: center; gap: 7px;
}
.card h4 i { font-size: 14px; color: var(--text3); }
.card > .btn-group,
.card > .toggle-row,
.card > .field,
.card > .setting-item,
.card > .fields-grid,
.card > p,
.card > .asset-filter,
.card > .stat-grid { padding: 0 18px; }
.card > p { margin-top: 12px; }
.card > .btn-group { padding-top: 14px; padding-bottom: 14px; }
.card > .btn-group:last-child { margin-bottom: 0; }

/* ═══ Dashboard layout ═══ */
.dash-grid { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
.quick-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; padding: 16px 18px; }
.quick-item {
  padding: 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg2); cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; gap: 10px;
}
.quick-item:hover { border-color: var(--border2); background: var(--surface2); }
.quick-icon {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.quick-icon.sync { background: rgba(79,140,255,0.1); color: var(--accent); }
.quick-icon.backup { background: rgba(52,211,153,0.1); color: var(--green); }
.quick-icon.news { background: rgba(251,191,36,0.1); color: var(--yellow); }
.quick-label { font-size: 12px; font-weight: 500; }
.quick-desc { font-size: 10.5px; color: var(--text3); margin-top: 1px; }

/* Activity */
.activity-list { display: flex; flex-direction: column; padding: 8px 18px 16px; }
.activity-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.activity-dot.blue { background: var(--accent); }
.activity-dot.green { background: var(--green); }
.activity-dot.yellow { background: var(--yellow); }
.activity-dot.red { background: var(--red); }
.activity-text { font-size: 12px; flex: 1; }
.activity-text strong { font-weight: 600; }
.activity-time { font-size: 10.5px; color: var(--text3); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Status */
.status-list { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; }
.status-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 7px;
  background: var(--bg2); border: 1px solid var(--border);
}
.status-indicator { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-indicator.on { background: var(--green); box-shadow: 0 0 6px rgba(52,211,153,0.4); }
.status-indicator.off { background: var(--text3); }
.status-indicator.warn { background: var(--yellow); box-shadow: 0 0 6px rgba(251,191,36,0.4); }
.status-name { font-size: 12px; font-weight: 500; flex: 1; }
.status-val { font-size: 11px; color: var(--text3); font-variant-numeric: tabular-nums; }

/* Storage bars */
.storage-section { padding: 16px 18px; }
.storage-item { margin-bottom: 12px; }
.storage-item:last-child { margin-bottom: 0; }
.storage-label { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 4px; }
.storage-label span:first-child { color: var(--text2); }
.storage-label span:last-child { font-family: 'DM Sans', monospace; color: var(--text3); }
.storage-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.storage-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }

/* ═══ Tables ═══ */
.bk-table, .asset-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.bk-table th, .asset-table th {
  text-align: left; padding: 10px 14px; font-size: 10.5px;
  color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 600; border-bottom: 1px solid var(--border); background: var(--bg2);
}
.bk-table td, .asset-table td {
  padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle;
}
.bk-table tr:last-child td, .asset-table tr:last-child td { border-bottom: none; }
.bk-table tr:hover td, .asset-table tr:hover td { background: rgba(255,255,255,0.015); }
.bk-empty { text-align: center; padding: 32px 0; color: var(--text3); }

/* ═══ Buttons ═══ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 7px; font-size: 12.5px;
  cursor: pointer; border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
  transition: all 0.12s; font-family: inherit;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 11.5px; }
.btn-danger { background: transparent; border: 1px solid var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ═══ Forms ═══ */
.field { margin-bottom: 12px; }
.field label {
  font-size: 11px; color: var(--text3); display: block;
  margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.03em;
  font-weight: 600;
}
.field input, .field select, .field textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 7px; padding: 9px 12px; color: var(--text);
  font-size: 12.5px; font-family: inherit; transition: border-color 0.12s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
}
.field textarea { resize: vertical; }

/* ═══ Toggles & switches ═══ */
.toggle-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.toggle-label { font-size: 12.5px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.toggle-label input { width: auto; accent-color: var(--accent); }
.toggle-hint { font-size: 11px; color: var(--text3); }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border2); border-radius: 20px; transition: 0.2s;
}
.slider:before {
  content: ""; position: absolute; height: 14px; width: 14px;
  left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.2s;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider:before { transform: translateX(16px); }

/* ═══ Settings tabs → horizontal nav ═══ */
.settings-tabs {
  display: flex; flex-direction: row; gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 0;
}
.settings-tab {
  padding: 7px 14px; border: none; background: transparent;
  color: var(--text2); font-size: 12px; cursor: pointer;
  border-radius: 7px;
  transition: all 0.12s;
  display: flex; align-items: center; gap: 6px;
  font-family: inherit; white-space: nowrap;
}
.settings-tab:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.settings-tab.active {
  color: var(--text); background: var(--surface2);
  font-weight: 500;
}
.settings-tab i { font-size: 14px; width: 16px; text-align: center; }
.settings-tab-content { display: none; }
.settings-tab-content.active { display: block; animation: fadeIn 0.2s ease; }
.settings-layout { display: flex; flex-direction: column; gap: 16px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Setting rows */
.setting-item { padding: 8px 0; }
.setting-hint { font-size: 11px; color: var(--text3); display: block; margin-top: 4px; }
.section-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ═══ Users ═══ */
.user-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px; border-bottom: 1px solid var(--border); }
.user-row:last-child { border-bottom: none; }
.user-info { display: flex; align-items: center; gap: 10px; }
.user-name { font-size: 12.5px; font-weight: 500; }
.user-meta { font-size: 11px; color: var(--text3); }
.user-actions { display: flex; gap: 6px; }

/* ═══ App grid ═══ */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, 100px); gap: 20px; margin-top: 0; justify-content: center; padding: 20px 18px; }
.app-icon { position: relative; display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: transform 0.15s; user-select: none; }
.app-icon:hover { transform: translateY(-2px); }
.app-icon:active { transform: scale(0.95); }
.app-icon-img {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  background: linear-gradient(135deg, #2a3448 0%, #1a2233 100%);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: box-shadow 0.2s;
}
.app-icon:hover .app-icon-img { box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
.app-icon-label { margin-top: 8px; font-size: 11.5px; color: var(--text2); text-align: center; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-icon-actions { display: flex; gap: 4px; margin-top: 4px; }
.app-icon-actions a { font-size: 10px; color: var(--text3); text-decoration: none; padding: 2px 6px; border-radius: 4px; transition: all 0.15s; }
.app-icon-actions a:hover { background: var(--accent); color: #fff; }
.app-icon-del {
  position: absolute; top: -4px; right: 8px; width: 20px; height: 20px;
  border-radius: 50%; background: #ff4d4f; color: #fff; border: 2px solid var(--card);
  font-size: 0.65rem; font-weight: 700; line-height: 16px; text-align: center;
  cursor: pointer; opacity: 0; transform: scale(0.5); transition: all 0.18s ease;
  z-index: 2; display: flex; align-items: center; justify-content: center;
}
.app-icon:hover .app-icon-del { opacity: 1; transform: scale(1); }
.app-icon-del:hover { background: #e8393b; transform: scale(1.15) !important; }
.app-icon-add .app-icon-img {
  background: transparent; border: 1.5px dashed var(--border2);
  box-shadow: none; font-size: 20px; color: var(--text3); transition: all 0.2s;
}
.app-icon-add:hover .app-icon-img { border-color: var(--accent); color: var(--accent); }
.app-icon-add .app-icon-label { color: var(--text3); }

/* App card toggle switches */
.app-toggles { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; width: 100%; }
.app-toggle { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--text3); cursor: pointer; justify-content: center; padding: 2px 0; transition: color 0.15s; }
.app-toggle:hover { color: var(--text); }
.app-toggle-switch { position: relative; width: 24px; height: 14px; flex-shrink: 0; }
.app-toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.app-toggle-track { position: absolute; inset: 0; background: var(--border2); border-radius: 7px; transition: background 0.2s; }
.app-toggle-track::after { content: ''; position: absolute; left: 2px; top: 2px; width: 10px; height: 10px; background: #888; border-radius: 50%; transition: all 0.2s; }
.app-toggle-switch input:checked + .app-toggle-track { background: var(--accent); }
.app-toggle-switch input:checked + .app-toggle-track::after { left: 12px; background: #fff; }
.app-visit-btn { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; color: var(--text3); text-decoration: none; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border); transition: all 0.15s; margin-top: 4px; }
.app-visit-btn:hover { color: #fff; background: var(--accent); border-color: var(--accent); }

/* ═══ Modals ═══ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 2000; backdrop-filter: blur(4px); }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; width: 90%; max-width: 400px; }
.modal h3 { font-size: 14px; margin-bottom: 16px; font-weight: 600; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.modal-btn { padding: 8px 16px; border-radius: 7px; font-size: 12.5px; cursor: pointer; border: none; font-family: inherit; transition: all 0.12s; }
.modal-btn.primary { background: var(--accent); color: #fff; }
.modal-btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.app-modal-overlay { position: fixed; inset: 0; background: rgba(8,12,20,0.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 9999; animation: appModalIn 0.2s ease; }
@keyframes appModalIn { from { opacity: 0; } to { opacity: 1; } }
.app-modal { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; width: 380px; max-width: 90vw; box-shadow: 0 20px 60px rgba(0,0,0,0.4); animation: appModalSlide 0.25s ease; }
@keyframes appModalSlide { from { transform: translateY(20px) scale(0.96); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.app-modal h3 { margin: 0 0 18px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.app-modal .field { margin-bottom: 14px; }
.app-modal .modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ═══ Toast ═══ */
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 16px; font-size: 12.5px; z-index: 1000; animation: slideIn 0.2s ease; box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ═══ Role & Title badges ═══ */
.role-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 5px; font-size: 11px;
  font-weight: 500; cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.role-badge:hover { filter: brightness(1.2); }
.role-badge.empty { background: rgba(139,143,163,0.1); color: var(--text3); border: 1px dashed var(--border); }
.custom-title {
  display: inline-flex; align-items: center;
  padding: 1px 6px; border-radius: 3px; font-size: 10px;
  font-weight: 500; white-space: nowrap; line-height: 1.4;
  vertical-align: middle;
  background: rgba(251,191,36,0.12); color: var(--yellow);
  border: 1px solid rgba(251,191,36,0.25); transition: all 0.2s;
}
@keyframes title-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
@keyframes title-shimmer { 0% { background-position: -200% center; } 100% { background-position: 200% center; } }
@keyframes title-glow { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.3); } }
.custom-title.title-anim-pulse { animation: title-pulse 2s ease-in-out infinite; }
.custom-title.title-anim-shimmer { background-size: 200% auto; animation: title-shimmer 3s linear infinite; }
.custom-title.title-anim-glow { animation: title-glow 2s ease-in-out infinite; }

/* ═══ Assets ═══ */
.asset-filter { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; padding: 14px 18px 0; }
.asset-filter .af-tab { padding: 4px 10px; border-radius: 5px; font-size: 11px; cursor: pointer; background: transparent; border: 1px solid var(--border); color: var(--text3); transition: all 0.15s; }
.asset-filter .af-tab:hover { color: var(--text); border-color: var(--accent); }
.asset-filter .af-tab.active { background: rgba(79,140,255,0.15); color: var(--accent); border-color: rgba(79,140,255,0.4); }
.asset-pagination { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 16px 0 8px; flex-wrap: wrap; }
.asset-page-btn { min-width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text3); cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; transition: all 0.15s; padding: 0 8px; }
.asset-page-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.asset-page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.asset-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.asset-page-ellipsis { color: var(--text3); font-size: 11px; padding: 0 4px; }
.asset-page-info { font-size: 11px; color: var(--text3); margin: 0 8px; }
.asset-page-size { display: flex; align-items: center; gap: 6px; margin-left: 12px; font-size: 11px; color: var(--text3); }
.asset-page-size select { height: 30px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 11px; padding: 0 6px; cursor: pointer; outline: none; }
.logo-cell { display: flex; align-items: center; gap: 6px; position: relative; }
.logo-thumb { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); background: rgba(255,255,255,0.03); }
.logo-thumb.placeholder { opacity: 0.3; }
.logo-actions { display: flex; gap: 3px; opacity: 0; transition: opacity 0.15s; }
.logo-cell:hover .logo-actions { opacity: 1; }
.logo-btn { width: 24px; height: 24px; border-radius: 4px; border: 1px solid var(--border); background: var(--bg); color: var(--text3); cursor: pointer; font-size: 11px; display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.logo-btn:hover { border-color: var(--accent); color: var(--accent); }
.logo-btn.del:hover { border-color: var(--red); color: var(--red); }
.logo-btn.rm-asset { background: rgba(248,81,73,0.15); border-color: rgba(248,81,73,0.4); color: #f85149; font-weight: 700; }
.logo-btn.rm-asset:hover { background: #f85149; border-color: #f85149; color: #fff; }
.cat-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10.5px; font-weight: 500; }
.cat-badge.us { background: rgba(79,140,255,0.12); color: var(--accent); }
.cat-badge.crypto { background: rgba(251,191,36,0.12); color: var(--yellow); }
.cat-badge.commodity { background: rgba(251,191,36,0.12); color: #d4a844; }
.cat-badge.a_stock { background: rgba(248,113,113,0.12); color: #f87171; }
.cat-badge.hk { background: rgba(52,211,153,0.12); color: var(--green); }
.cat-badge.other { background: rgba(148,152,171,0.12); color: var(--text3); }
.user-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 5px; font-size: 11px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); cursor: pointer; transition: all 0.15s; margin: 2px; }
.user-chip:hover { border-color: var(--accent); background: rgba(79,140,255,0.06); }
.user-chip .review-badge { font-size: 10px; background: rgba(79,140,255,0.2); color: var(--accent); padding: 1px 5px; border-radius: 3px; }
.user-count { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 24px; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; background: rgba(79,140,255,0.12); color: var(--accent); cursor: pointer; transition: all 0.15s; border: 1px solid transparent; }
.user-count:hover { border-color: var(--accent); background: rgba(79,140,255,0.2); }
.asset-name { font-weight: 500; font-size: 12.5px; }

/* ═══ Backup source badges ═══ */
.bk-source { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10.5px; }
.bk-source.local { background: rgba(79,140,255,0.15); color: var(--accent); }
.bk-source.webdav { background: rgba(52,211,153,0.15); color: var(--green); }
.bk-source.both { background: rgba(251,191,36,0.15); color: var(--yellow); }

/* ═══ License ═══ */
.lk-issue-form { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 10px; align-items: end; margin-bottom: 16px; }
.lk-issue-form .field { margin-bottom: 0; }
.lk-key { font-family: 'DM Sans', monospace; font-size: 12px; letter-spacing: 0.06em; }
.lk-status { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10.5px; font-weight: 500; }
.lk-status.available { background: rgba(79,140,255,0.12); color: var(--accent); }
.lk-status.active { background: rgba(52,211,153,0.12); color: var(--green); }
.lk-status.disabled { background: rgba(248,113,113,0.12); color: var(--red); }
.lk-mode { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10.5px; }
.lk-mode.duration { background: rgba(251,191,36,0.12); color: var(--yellow); }
.lk-mode.lifetime { background: rgba(52,211,153,0.12); color: var(--green); }
.lk-remaining { font-size: 11px; color: var(--text3); }
.lk-remaining.warn { color: var(--yellow); }
.lk-remaining.expired { color: var(--red); }

/* ═══ Role management ═══ */
.role-dropdown { position: absolute; top: 100%; left: 0; z-index: 100; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px; min-width: 180px; box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.role-dropdown-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 5px; cursor: pointer; font-size: 12px; color: var(--text); transition: background 0.1s; border: none; background: none; width: 100%; text-align: left; }
.role-dropdown-item:hover { background: rgba(79,140,255,0.1); }
.role-dropdown-item .role-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.role-cell { position: relative; }
.role-form { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin-bottom: 16px; }
.role-form h4 { font-size: 13px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.role-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.role-form-grid .field-full { grid-column: 1 / -1; }
.role-perms { display: flex; flex-wrap: wrap; gap: 8px; }
.role-perm-check { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text); cursor: pointer; padding: 4px 10px; border-radius: 5px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); transition: all 0.15s; }
.role-perm-check:hover { border-color: var(--accent); }
.role-perm-check input { width: auto; accent-color: var(--accent); }
.role-perm-check.checked { background: rgba(79,140,255,0.1); border-color: rgba(79,140,255,0.3); }
.builtin-badge { display: inline-block; padding: 2px 6px; border-radius: 3px; font-size: 10px; background: rgba(79,140,255,0.12); color: var(--accent); font-weight: 500; }
.color-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; }
.role-color-field { display: flex; align-items: center; gap: 8px; }
.role-color-field input[type="color"] { width: 36px; height: 30px; border: 1px solid var(--border); border-radius: 5px; background: var(--bg); cursor: pointer; padding: 2px; }

/* ═══ Emoji / Icon pickers ═══ */
.emoji-field { display: flex; align-items: center; gap: 10px; }
.emoji-preview { width: 48px; height: 48px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; cursor: pointer; transition: all 0.15s; flex-shrink: 0; }
.emoji-preview:hover { border-color: var(--accent); transform: scale(1.08); }
.emoji-picker-wrap { position: relative; flex: 1; }
.emoji-picker-wrap input { cursor: pointer; }
.emoji-grid { display: none; position: absolute; top: 42px; left: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px; width: 280px; z-index: 10; box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.emoji-grid.open { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.emoji-grid button { width: 34px; height: 34px; border: none; background: transparent; border-radius: 6px; font-size: 1.3rem; cursor: pointer; transition: background 0.1s; }
.emoji-grid button:hover { background: var(--bg); }
.icon-picker-field { display: flex; align-items: center; gap: 10px; }
.icon-preview { width: 48px; height: 48px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: var(--text); cursor: pointer; transition: all 0.15s; flex-shrink: 0; }
.icon-preview:hover { border-color: var(--accent); transform: scale(1.08); }
.icon-picker-wrap { position: relative; flex: 1; }
.icon-picker-wrap input { cursor: pointer; }
.icon-grid { display: none; position: absolute; top: 42px; left: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px; width: 360px; max-height: 420px; overflow-y: auto; z-index: 10; box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.icon-grid.open { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.icon-grid-item { width: 42px; height: 42px; border: none; background: transparent; border-radius: 6px; font-size: 1.3rem; color: var(--text); cursor: pointer; transition: all 0.15s; display: flex; align-items: center; justify-content: center; }
.icon-grid-item:hover { background: var(--accent); color: #fff; transform: scale(1.1); }

/* ═══ Outline Management ═══ */
.ol-stats-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.ol-stat-card { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; text-align: center; }
.ol-stat-val { font-size: 1.2rem; font-weight: 700; }
.ol-stat-label { font-size: 10px; color: var(--text3); margin-top: 2px; }
.ol-list { display: flex; flex-direction: column; gap: 6px; }
.ol-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  transition: all .15s; position: relative;
}
.ol-item:hover { border-color: var(--border2); }
.ol-item.inactive { opacity: .45; }
.ol-item.editing { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ol-item.drag-over { border-top: 2px solid var(--accent); }
.ol-drag { color: var(--text3); font-size: 14px; cursor: grab; flex-shrink: 0; padding: 2px; }
.ol-drag:hover { color: var(--text2); }
.ol-drag:active { cursor: grabbing; }
.ol-icon-box { width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; background: rgba(79,140,255,.1); }
.ol-body { flex: 1; min-width: 0; }
.ol-title { font-size: 12px; font-weight: 500; color: var(--text); }
.ol-desc { font-size: 11px; color: var(--text3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ol-meta { display: flex; gap: 8px; flex-shrink: 0; }
.ol-badge { font-size: 10px; padding: 2px 7px; border-radius: 10px; background: rgba(255,255,255,.04); color: var(--text3); display: inline-flex; align-items: center; gap: 3px; }
.ol-badge .g { color: var(--green); }
.ol-badge .o { color: var(--orange); }
.ol-actions { display: flex; gap: 2px; flex-shrink: 0; opacity: 0; transition: opacity .15s; }
.ol-item:hover .ol-actions { opacity: 1; }
.ol-item.editing .ol-actions { opacity: 1; }
.ol-act-btn { width: 26px; height: 26px; border: none; border-radius: 5px; background: transparent; color: var(--text3); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; transition: all .12s; }
.ol-act-btn:hover { background: rgba(255,255,255,.06); color: var(--text); }
.ol-act-btn.danger:hover { background: rgba(248,113,113,.12); color: var(--red); }
.ol-act-btn.active { color: var(--accent); }
.ol-toggle { position: relative; width: 32px; height: 18px; flex-shrink: 0; }
.ol-toggle input { display: none; }
.ol-toggle-track { position: absolute; inset: 0; border-radius: 9px; background: var(--border); transition: background .2s; cursor: pointer; }
.ol-toggle-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; }
.ol-toggle input:checked + .ol-toggle-track { background: var(--accent); }
.ol-toggle input:checked + .ol-toggle-track::after { transform: translateX(14px); }
.ol-editor { background: var(--bg); border: 1px solid var(--accent); border-radius: 8px; padding: 16px; display: none; flex-direction: column; gap: 12px; box-shadow: 0 0 0 1px var(--accent); }
.ol-editor.visible { display: flex; }
.ol-editor-header { display: flex; align-items: center; justify-content: space-between; }
.ol-editor-title { font-size: 12px; font-weight: 600; color: var(--accent); display: flex; align-items: center; gap: 5px; }
.ol-editor-row { display: flex; gap: 10px; align-items: flex-start; }
.ol-editor-group { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.ol-editor-group.icon-grp { flex: 0 0 68px; }
.ol-editor-label { font-size: 10px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.ol-editor-input { background: var(--surface); border: 1px solid var(--border); border-radius: 5px; color: var(--text); font-size: 12px; padding: 7px 9px; outline: none; font-family: inherit; transition: border-color .15s; width: 100%; }
.ol-editor-input:focus { border-color: var(--accent); }
.ol-editor-input.icon-inp { text-align: center; font-size: 18px; padding: 5px; }
textarea.ol-editor-input { resize: vertical; min-height: 52px; line-height: 1.5; }
.ol-editor-footer { display: flex; justify-content: flex-end; gap: 6px; padding-top: 2px; }
.ol-add-btn { border: 1.5px dashed var(--border); border-radius: 8px; padding: 12px; display: flex; align-items: center; justify-content: center; gap: 5px; color: var(--text3); font-size: 11px; cursor: pointer; transition: all .15s; background: transparent; width: 100%; }
.ol-add-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(79,140,255,.04); }
.fields-grid { display: grid; gap: 12px; }

/* ═══ Logo progress ═══ */
.logo-progress-bar { height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.logo-progress-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.3s ease; min-width: 0; }
.logo-progress-text { font-size: 11px; color: var(--text3); font-variant-numeric: tabular-nums; }
#logoRefreshProgress.done .logo-progress-fill { background: var(--green); }
#logoRefreshProgress.done .logo-progress-text { color: var(--green); }

/* ═══ Spin ═══ */
.ri-spin { animation: riSpin 0.8s linear infinite; }
@keyframes riSpin { to { transform: rotate(360deg); } }

/* ═══ Title modal buttons ═══ */
.title-grad-btn, .title-bg-btn, .title-radius-btn, .title-size-btn, .title-anim-btn {
  padding: 5px 10px; border-radius: 5px; font-size: 11px;
  cursor: pointer; border: 1px solid var(--border);
  background: transparent; color: var(--text2); transition: all 0.12s;
  font-family: inherit;
}
.title-grad-btn:hover, .title-bg-btn:hover, .title-radius-btn:hover, .title-size-btn:hover, .title-anim-btn:hover {
  border-color: var(--accent); color: var(--text);
}
.title-grad-btn.active, .title-bg-btn.active, .title-radius-btn.active, .title-size-btn.active, .title-anim-btn.active {
  background: rgba(79,140,255,0.15); color: var(--accent); border-color: rgba(79,140,255,0.4);
}

/* ═══ Asset detail ═══ */
.asset-detail-user { padding: 10px 0; border-bottom: 1px solid var(--border); }
.asset-detail-user:last-child { border-bottom: none; }
.asset-detail-user .adu-name { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.asset-detail-user .adu-meta { font-size: 11px; color: var(--text3); line-height: 1.5; }

/* ═══ Footer (unused, kept for compat) ═══ */
.footer { text-align: center; padding: 20px 16px 14px; color: var(--text3); font-size: 10px; letter-spacing: 0.06em; opacity: 0.6; border-top: 1px solid var(--border); }

/* ═══ Responsive ═══ */
@media (max-width: 768px) {
  .sidebar { position: static; width: 100%; flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar-brand { display: none; }
  .sidebar-section { display: flex; gap: 2px; padding: 6px; }
  .sidebar-section-label { display: none; }
  .nav-item { white-space: nowrap; padding: 8px 12px; }
  .nav-item.active::before { display: none; }
  .nav-item.active { border-bottom: 2px solid var(--accent); }
  .sidebar-footer { display: none; }
  .main { margin-left: 0; }
  .content { padding: 18px 16px; }
  .topbar { padding: 0 16px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .settings-layout { flex-direction: column; }
  .settings-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .quick-grid { grid-template-columns: 1fr; }
  .lk-issue-form { grid-template-columns: 1fr 1fr; }
}
