
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; font-size: 13px; color: var(--text); background: var(--bg); min-height: 100vh; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; outline: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,.28); background-clip: content-box;
  border: 2px solid transparent; border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,.5); background-clip: content-box; }
::-webkit-scrollbar-thumb:active { background: rgba(148,163,184,.62); background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }
html { scrollbar-width: thin; scrollbar-color: rgba(148,163,184,.32) transparent; }
body.light-theme ::-webkit-scrollbar-thumb { background: rgba(15,23,42,.22); background-clip: content-box; }
body.light-theme ::-webkit-scrollbar-thumb:hover { background: rgba(15,23,42,.4); background-clip: content-box; }


.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--bg) 0%, #1a2744 100%); }
.login-card { width: 380px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; padding: 36px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.login-logo { width: 56px; height: 56px; margin: 0 auto 16px; background: linear-gradient(135deg, var(--primary), var(--accent)); border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.login-logo svg { width: 32px; height: 32px; display: block; }
.login-title { text-align: center; font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.login-subtitle { text-align: center; font-size: 12px; color: var(--text-muted); margin-bottom: 28px; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.form-input { width: 100%; padding: 10px 12px; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; color: var(--text); transition: border-color 0.15s; }
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.btn-primary { width: 100%; padding: 11px; background: var(--primary); color: white; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; transition: background 0.15s; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }


.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; backdrop-filter: blur(4px);
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 12px; width: 90%; max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  animation: modalIn 0.2s ease;
  max-height: 90vh; display: flex; flex-direction: column;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-header button {
  background: none; border: none; font-size: 22px; color: var(--text-muted);
  cursor: pointer; padding: 0 4px; line-height: 1; transition: color 0.15s;
}
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}
.modal-footer .btn {
  padding: 8px 18px; border-radius: 6px; font-size: 13px; font-weight: 500;
  cursor: pointer; border: 1px solid var(--border); background: var(--bg-tertiary);
  color: var(--text-secondary); transition: all 0.15s;
}
.modal-footer .btn:hover { background: var(--bg); color: var(--text); }
.modal-footer .btn.primary:disabled { opacity: 0.6; cursor: not-allowed; }
.login-error { position: relative; background: var(--qf-danger-faint); border: 0; color: var(--error); padding: 10px 12px 10px 32px; border-radius: var(--radius-sm); font-size: 12px; margin-bottom: 16px; display: none; }

.login-error::before { content: ''; position: absolute; left: 14px; top: 15px; width: 8px; height: 8px; background: var(--error); }
.login-footer { text-align: center; margin-top: 20px; font-size: 11px; color: var(--text-muted); }


.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-width); background: var(--bg-secondary); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; position: fixed; top: 0; left: 0; bottom: 0; }
.sidebar-header { padding: 20px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.sidebar-logo { width: 32px; height: 32px; background: linear-gradient(135deg, var(--primary), var(--accent)); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-logo svg { width: 18px; height: 18px; display: block; }
.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-secondary); cursor: pointer; transition: background 0.12s, color 0.12s; margin-bottom: 2px; font-size: 13px; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--border); }
.user-info { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: white; flex-shrink: 0; }
.user-detail { flex: 1; min-width: 0; }
.user-email { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-logout { width: 100%; padding: 7px; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; color: var(--text-secondary); transition: all 0.15s; }


.main-content { flex: 1; margin-left: var(--sidebar-width); padding: 24px 28px; min-width: 0; }
.ph-iconbox{width:48px;height:48px;background:linear-gradient(135deg,var(--primary),var(--accent));border-radius:14px;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px rgba(108,143,255,.3);flex:none;}
.ph-lead .page-title{margin:0;font-size:22px;font-weight:700;}
.ph-lead .page-subtitle{margin:4px 0 0;font-size:13px;}
.page-title { font-size: 22px; font-weight: 700; }
.page-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }


.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-change { font-size: 11px; margin-top: 6px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--error); }
.stat-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.stat-icon svg { width: 20px; height: 20px; }


.card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 14px; font-weight: 600; }
.card-body { padding: 20px; }
.chart-container { position: relative; height: 280px; }


.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 16px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); border-bottom: 1px solid var(--border); background: var(--bg-tertiary); }
td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid var(--border-light); }
tr:hover td { background: var(--bg-tertiary); }
.badge.success { background: rgba(16,185,129,0.15); color: var(--success); }
.badge.warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge.error { background: rgba(239,68,68,0.15); color: var(--error); }
.badge.info { background: rgba(108,143,255,0.15); color: var(--primary); }
.badge.muted { background: var(--bg-tertiary); color: var(--text-muted); }


.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-input { padding: 7px 10px; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; color: var(--text); }
.btn-sm { padding: 7px 14px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; transition: all 0.15s; }
.btn-sm.primary { background: var(--primary); color: white; }
.btn-sm.primary:hover { background: var(--primary-hover); }
.btn-sm.secondary { background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text-secondary); }
.btn-sm.secondary:hover { background: var(--bg-hover); color: var(--text); }
.btn-sm.danger { background: rgba(239,68,68,0.1); color: var(--error); }
.btn-sm.danger:hover { background: rgba(239,68,68,0.2); }


.about-editor-toolbar{display:flex;flex-wrap:wrap;gap:4px;padding:6px;margin-bottom:6px;background:var(--bg-tertiary);border:1px solid var(--border);border-radius:8px 8px 0 0;border-bottom:none;}
.about-editor-toolbar button{min-width:30px;height:28px;padding:0 8px;font-size:12px;background:var(--bg-secondary);border:1px solid var(--border);border-radius:6px;color:var(--text-secondary);cursor:pointer;transition:all .15s;display:inline-flex;align-items:center;justify-content:center;}
.about-editor-toolbar button:hover{background:var(--primary);color:var(--text-on-color);border-color:var(--primary);transform:translateY(-1px);}
.about-editor-toolbar .toolbar-sep{width:1px;height:18px;background:var(--border);margin:0 4px;align-self:center;}
.about-editor-toolbar + textarea{border-radius:0 0 8px 8px !important;margin-top:0 !important;}

.config-item { padding: 14px 0; border-bottom: 1px solid var(--border-light); }
.config-item:last-child { border-bottom: none; }
.config-key { font-family: "Consolas", monospace; font-size: 12px; color: var(--accent); margin-bottom: 4px; word-break: break-all; }
.config-desc { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }


.config-item-v2 { transition: background 0.15s; }
.config-item-v2:hover { background: var(--bg-tertiary); }
.config-value-textarea { width: 100%; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; font-size: 12px; color: var(--text); font-family: "Consolas", monospace; resize: vertical; min-height: 50px; transition: border-color 0.15s; }
.config-value-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,143,255,0.1); }
.config-value-textarea::placeholder { color: var(--text-muted); }


.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }


.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }


.page-hero { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.page-hero-left { flex: 1; min-width: 280px; }
.page-hero-title { font-size: 24px; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.page-hero-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.page-hero-icon svg { width: 20px; height: 20px; }
.page-hero-actions { display: flex; gap: 8px; flex-shrink: 0; }


.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }

.stat-card-v2 .stat-icon-v2 { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.stat-card-v2 .stat-icon-v2 svg { width: 20px; height: 20px; }
.stat-card-v2 .stat-value-v2 { font-size: 26px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-card-v2 .stat-label-v2 { font-size: 12px; color: var(--text-muted); margin-top: 4px; }


.filter-bar-v2 { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-chip { padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 500; cursor: pointer; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-secondary); transition: all 0.15s; }
.filter-search { padding: 7px 12px; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 8px; font-size: 12px; color: var(--text); min-width: 200px; }
.filter-search:focus { border-color: var(--primary); outline: none; }


.cell-title { font-weight: 600; font-size: 13px; color: var(--text); margin-bottom: 2px; }
.cell-subtitle { font-size: 11px; color: var(--text-muted); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: white; flex-shrink: 0; }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user-info { min-width: 0; }
.cell-user-name { font-weight: 600; font-size: 13px; }
.cell-user-email { font-size: 11px; color: var(--text-muted); }


.action-group { display: flex; gap: 6px; flex-wrap: wrap; }
.action-btn { padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: 500; cursor: pointer; border: 1px solid var(--border); background: var(--bg-tertiary); color: var(--text-secondary); transition: all 0.12s; display: inline-flex; align-items: center; gap: 4px; }
.action-btn.danger { color: var(--error); border-color: rgba(239,68,68,0.3); }
.action-btn.danger:hover { background: rgba(239,68,68,0.1); border-color: var(--error); }
.action-btn svg { width: 12px; height: 12px; }


.badge-v2 { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 500; }
.badge-v2 .dot { width: 6px; height: 6px; border-radius: 50%; }
.badge-v2.success .dot { background: var(--success); }
.badge-v2.warning .dot { background: var(--warning); }
.badge-v2.error .dot { background: var(--error); }
.badge-v2.info .dot { background: var(--primary); }
.badge-v2.muted .dot { background: var(--text-muted); }


.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.content-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; padding: 20px; transition: all 0.15s; position: relative; overflow: hidden; }
.content-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
.content-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.content-card-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.content-card-icon svg { width: 22px; height: 22px; }
.content-card-title { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.content-card-subtitle { font-size: 12px; color: var(--text-muted); }
.content-card-body { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 14px; }
.content-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--border-light); }
.content-card-stats { display: flex; gap: 16px; }
.content-card-stat { text-align: center; }
.content-card-stat-value { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.content-card-stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }


.profile-header { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; padding: 24px; background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary)); border: 1px solid var(--border); border-radius: 16px; }
.profile-avatar-lg { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; color: white; flex-shrink: 0; box-shadow: 0 4px 16px rgba(108,143,255,0.3); }
.profile-info h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.profile-info p { font-size: 13px; color: var(--text-muted); }
.profile-badges { display: flex; gap: 8px; margin-top: 8px; }
.settings-section { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 16px; overflow: hidden; }
.settings-section-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.settings-section-header h3 { font-size: 14px; font-weight: 600; }
.settings-section-header .section-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.settings-section-header .section-icon svg { width: 15px; height: 15px; }
.settings-section-body { padding: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-row .form-group { margin-bottom: 0; }
.password-strength { height: 4px; border-radius: 2px; background: var(--bg-tertiary); margin-top: 8px; overflow: hidden; }
.password-strength-fill { height: 100%; border-radius: 2px; transition: width 0.3s, background 0.3s; }
.password-hint { font-size: 11px; color: var(--text-muted); margin-top: 6px; }


.empty-state-v2 { text-align: center; padding: 60px 20px; }
.empty-state-v2 .empty-icon-v2 { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; background: var(--bg-tertiary); display: flex; align-items: center; justify-content: center; }
.empty-state-v2 .empty-icon-v2 svg { width: 36px; height: 36px; color: var(--text-muted); }
.empty-state-v2 h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.empty-state-v2 p { font-size: 13px; color: var(--text-muted); max-width: 360px; margin: 0 auto; }


.modal-v2 .modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-v2 .modal-header h3 { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.modal-v2 .modal-body { padding: 24px; max-height: 60vh; overflow-y: auto; }
.modal-v2 .modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }


.modern-search-input {
  display: flex;
  align-items: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 14px;
  transition: all 0.2s;
}
.modern-search-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,143,255,0.1);
  background: var(--bg-secondary);
}
.modern-search-input svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  margin-right: 10px;
  flex-shrink: 0;
}
.modern-search-input input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--text);
  padding: 11px 0;
}
.modern-search-input input::placeholder {
  color: var(--text-muted);
}

.modern-select-wrapper {
  position: relative;
}
.modern-select {
  width: 100%;
  padding: 11px 36px 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-tertiary);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: 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='%2364748B' 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;
}
.modern-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,143,255,0.1);
  background-color: var(--bg-secondary);
}
.modern-select:hover {
  border-color: var(--text-muted);
}

.modern-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}


.config-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(108,143,255,0.12);
  transform: translateY(-2px);
}


.config-value-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-tertiary);
  color: var(--text);
  font-size: 13px;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  outline: none;
  transition: all 0.2s;
}
.config-value-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,143,255,0.1);
  background: var(--bg-secondary);
}
.config-value-input::placeholder {
  color: var(--text-muted);
}

.config-json-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.modern-number-input {
  font-family: inherit;
}

.config-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}
.config-action-btn svg {
  width: 14px;
  height: 14px;
}
.config-action-btn:hover {
  background: var(--bg);
  color: var(--text);
}
.config-action-save {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
}
.config-action-reset:hover {
  color: var(--warning);
  border-color: rgba(245,158,11,0.3);
}
.config-action-delete:hover {
  color: var(--error);
  border-color: rgba(239,68,68,0.3);
}


.config-category-tab:hover:not(.active) {
  background: var(--bg);
  color: var(--text);
}


.dashboard-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-color: var(--primary);
}

.dashboard-quick-btn:hover {
  background: rgba(255,255,255,0.25) !important;
  transform: translateY(-1px);
}


.notification-preview { background: var(--bg-secondary); border-radius: 8px; padding: 14px; margin-top: 12px; border: 1px solid var(--border); }
.notification-preview-title { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.notification-preview-content { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }


.switch-v2 { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch-v2 input { opacity: 0; width: 0; height: 0; }
.switch-v2 .slider { position: absolute; cursor: pointer; inset: 0; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 22px; transition: 0.2s; }
.switch-v2 .slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 2px; bottom: 2px; background: var(--text-muted); border-radius: 50%; transition: 0.2s; }
.switch-v2 input:checked + .slider { background: var(--primary); border-color: var(--primary); }
.switch-v2 input:checked + .slider:before { transform: translateX(18px); background: white; }


.card-v2 {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.card-v2:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  border-color: var(--border-light);
}
.card-v2-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-v2-title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-v2-title .icon {
  width: 18px;
  height: 18px;
  color: var(--primary);
}
.card-v2-body {
  padding: 20px;
}


.table-v2 {
  width: 100%;
  border-collapse: collapse;
}
.table-v2 thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}
.table-v2 tbody td {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.table-v2 tbody tr {
  transition: background 0.12s;
}
.table-v2 tbody tr:hover {
  background: var(--bg-tertiary);
}
.table-v2 tbody tr:last-child td {
  border-bottom: none;
}


.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
.badge-success { background: rgba(16,185,129,0.12); color: var(--success); }
.badge-warning { background: rgba(245,158,11,0.12); color: var(--warning); }
.badge-error { background: rgba(239,68,68,0.12); color: var(--error); }
.badge-info { background: rgba(108,143,255,0.12); color: var(--primary); }
.badge-muted { background: var(--bg-tertiary); color: var(--text-muted); }
.badge-purple { background: rgba(43,92,255,0.12); color: var(--purple); }


.btn-v2 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  transition: all 0.15s;
}
.btn-v2:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border-light);
}
.btn-v2.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.btn-v2.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}
.btn-v2.success {
  background: var(--success);
  border-color: var(--success);
  color: white;
}
.btn-v2.success:hover {
  background: #059669;
}
.btn-v2.danger {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.3);
  color: var(--error);
}
.btn-v2.danger:hover {
  background: rgba(239,68,68,0.2);
}
.btn-v2 svg {
  width: 14px;
  height: 14px;
}


.form-group-v2 {
  margin-bottom: 18px;
}
.form-label-v2 {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-input-v2 {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input-v2:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
textarea.form-input-v2 {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}


.stat-card-v2 {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card-v2:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.stat-card-v2 .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.stat-card-v2 .stat-icon svg {
  width: 22px;
  height: 22px;
}
.stat-card-v2 .stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.stat-card-v2 .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-card-v2 .stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 10px;
}
.stat-trend.up { background: rgba(16,185,129,0.1); color: var(--success); }
.stat-trend.down { background: rgba(239,68,68,0.1); color: var(--error); }


.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  opacity: 0.3;
}
.empty-state .empty-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.empty-state .empty-desc {
  font-size: 12px;
  color: var(--text-muted);
}


.detail-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.detail-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.detail-panel-body {
  padding: 20px;
  max-height: 400px;
  overflow-y: auto;
}
.detail-row {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.detail-row:last-child { border-bottom: none; }
.detail-label {
  width: 120px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-muted);
}
.detail-value {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  word-break: break-all;
}


.reply-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.reply-item {
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  margin-bottom: 10px;
}
.reply-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.reply-content {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}


.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  animation: toastIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}


.search-bar-v2 {
  position: relative;
  margin-bottom: 16px;
}
.search-bar-v2 input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  transition: border-color 0.15s;
}
.search-bar-v2 input:focus {
  outline: none;
  border-color: var(--primary);
}
.search-bar-v2 svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}


.filter-tab {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: all 0.15s;
}


.batch-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: 8px;
  margin-bottom: 16px;
}
.batch-actions .spacer {
  flex: 1;
}


.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}
.data-table tr:hover {
  background: var(--bg-tertiary);
}
.data-table tr.selected {
  background: var(--primary-light);
}


.detail-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.detail-modal {
  background: var(--bg);
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.detail-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.detail-modal-title {
  font-size: 16px;
  font-weight: 600;
}
.detail-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.detail-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}


.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.info-item {
  background: var(--bg-tertiary);
  padding: 10px 12px;
  border-radius: 6px;
}
.info-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.info-value {
  font-size: 13px;
  font-weight: 500;
  word-break: break-all;
}


.content-block {
  background: var(--bg-tertiary);
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.content-block-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.content-block-text {
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}



.timeline {
  position: relative;
}
.timeline-item {
  position: relative;
  margin-bottom: 16px;
}
.timeline-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.timeline-content {
  font-size: 13px;
}


.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}
.checkbox-wrapper input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}


.code-block {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 12px;
  border-radius: 6px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 300px;
  overflow-y: auto;
}


.sidebar-action-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}


.sidebar.collapsed {
  width: 60px !important;
}
.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .nav-section,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .user-detail,
.sidebar.collapsed .btn-logout {
  display: none !important;
}
.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 16px 8px;
  flex-wrap: wrap;
}
.sidebar.collapsed .sidebar-logo {
  margin: 0 auto;
}
.sidebar.collapsed .sidebar-header > div:last-child {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 12px 8px;
}
.sidebar.collapsed .sidebar-footer {
  justify-content: center;
  padding: 12px 8px;
}
.sidebar.collapsed .user-info {
  justify-content: center;
}
.sidebar.collapsed .user-avatar {
  margin: 0;
}


body:has(.sidebar.collapsed) .main-content {
  margin-left: 60px !important;
}


body.light-theme {
  --bg: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-hover: #e2e8f0;
  --text: #1e293b;
  --text-secondary: #475569;
  
  --text-muted: #5C6B80;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --border-strong: #cbd5e1;
  --row-hover: rgba(15,23,42,0.035);
  --primary: var(--qf-primary);   
  --primary-hover: var(--qf-primary-hover);
  --primary-light: var(--qf-primary-soft);
  --accent: var(--qf-accent);
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  
  --ring: 0 0 0 3px var(--primary-light);
  --shadow-1: 0 1px 2px rgba(15,23,42,0.06);
  --shadow-2: 0 8px 24px -8px rgba(15,23,42,0.18);
  --shadow-3: 0 28px 70px -20px rgba(15,23,42,0.32);
  scrollbar-color: rgba(15,23,42,.28) transparent;   
  background: var(--bg);
  color: var(--text);
}
body.light-theme .sidebar {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #e2e8f0;
  --bg-secondary: #1e293b;
  --bg-tertiary: #273449;
  --border: #334155;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  
  --text-muted: #8F9EB2;
}
body.light-theme .card,
body.light-theme .card-v2,
body.light-theme .dashboard-stat-card,
body.light-theme .data-table,
body.light-theme .filter-card,
body.light-theme .config-card,
body.light-theme .stat-card {
  background: var(--bg-secondary);
  border-color: var(--border);
}
body.light-theme .data-table th,
body.light-theme th {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}
body.light-theme .data-table tr:hover,
body.light-theme tr:hover td {
  background: var(--bg-tertiary);
}
body.light-theme .form-input,
body.light-theme .modern-input,
body.light-theme .modern-select,
body.light-theme .inline-input,
body.light-theme .config-value-input,
body.light-theme .config-value-textarea {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
}
body.light-theme .form-input:focus,
body.light-theme .modern-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
body.light-theme .badge-muted,
body.light-theme .badge.muted {
  background: rgba(148,163,184,0.15);
  
  color: var(--text-muted);
}
body.light-theme .config-template-card {
  background: var(--bg-secondary);
  border-color: var(--border);
}
body.light-theme .modal {
  background: var(--bg-secondary);
  color: var(--text);
}
body.light-theme .modal-overlay {
  background: rgba(0,0,0,0.5);
}
body.light-theme .btn-secondary,
body.light-theme .btn-sm.secondary {
  background: var(--bg-tertiary);
  border-color: var(--border);
  color: var(--text-secondary);
}
body.light-theme .btn-secondary:hover,
body.light-theme .btn-sm.secondary:hover {
  background: var(--bg-hover);
  color: var(--text);
}
body.light-theme .nav-item:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}
body.light-theme .login-page {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}
body.light-theme .login-card {
  background: var(--bg-secondary);
  border-color: var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}
body.light-theme .page-header,
body.light-theme .card-header {
  border-color: var(--border);
}
body.light-theme .sidebar-footer,
body.light-theme .sidebar-header {
  border-color: var(--border);
}
body.light-theme .config-item {
  border-color: var(--border-light);
}
body.light-theme .toast {
  background: var(--bg-secondary);
  border-color: var(--border);
  color: var(--text);
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}
body.light-theme .tab-item {
  color: var(--text-secondary);
}
body.light-theme .tab-item.active {
  color: var(--primary);
  border-color: var(--primary);
}
body.light-theme .tab-item:hover {
  color: var(--text);
}


.dashboard-stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;}
@media(max-width:820px){
  .sidebar{transform:translateX(-100%);position:fixed;z-index:1000;transition:transform .2s;}
  .sidebar.open{transform:translateX(0);}
  .main{margin-left:0 !important;}
  .menu-toggle{display:inline-flex !important;}
  .sidebar-overlay{position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:999;}
}
@media(max-width:720px){
  .dashboard-stats-grid{grid-template-columns:repeat(2,1fr);}
  .content-card-grid,.card-grid{grid-template-columns:1fr !important;}
  .table-wrap{overflow-x:auto;}
  .modal-box{width:calc(100vw - 24px) !important;max-height:90vh;overflow-y:auto;}
  .form-row{flex-direction:column;gap:0 !important;}
  .qf-rich-toolbar{flex-wrap:wrap;overflow-x:auto;}
}
@media(max-width:390px){
  .dashboard-stats-grid{grid-template-columns:1fr;}
}
.menu-toggle{display:none;position:fixed;top:10px;left:10px;z-index:1001;}


.upload-dropzone{border:2px dashed var(--border);border-radius:12px;padding:22px;text-align:center;cursor:pointer;transition:all .15s;background:var(--bg);}
.upload-dropzone:hover{border-color:var(--primary);background:var(--primary-light,rgba(108,143,255,.06));}
.upload-dropzone.dragover{border-color:var(--primary);background:rgba(108,143,255,.12);box-shadow:0 0 0 3px rgba(108,143,255,.15);}
.upload-dropzone .dz-icon{width:42px;height:42px;border-radius:10px;margin:0 auto 8px;background:rgba(108,143,255,.1);color:var(--primary);display:flex;align-items:center;justify-content:center;}
.upload-dropzone .dz-text{font-size:13px;color:var(--text);font-weight:500;}
.upload-dropzone .dz-hint{font-size:11px;color:var(--text-muted);margin-top:4px;}
.upload-progress{height:6px;border-radius:3px;background:var(--border);overflow:hidden;margin-top:10px;display:none;}
.upload-progress.active{display:block;}
.upload-progress>div{height:100%;background:var(--primary);transition:width .2s;}
.media-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px;max-height:380px;overflow:auto;padding:4px;}
@media(max-width:480px){.media-grid{grid-template-columns:repeat(2,1fr);}}
.media-item{position:relative;border:1px solid var(--border);border-radius:10px;padding:6px;cursor:pointer;transition:all .12s;background:var(--bg-secondary);}
.media-item:hover{border-color:var(--primary);}
.media-item.media-selected{border-color:var(--primary);box-shadow:0 0 0 2px rgba(108,143,255,.3);}
.media-item .mi-check{position:absolute;top:4px;right:4px;width:18px;height:18px;border-radius:50%;background:var(--primary);color:#fff;display:none;align-items:center;justify-content:center;font-size:11px;}
.media-item.media-selected .mi-check{display:flex;}
.media-item .mi-del{position:absolute;top:4px;left:4px;width:20px;height:20px;border-radius:50%;background:rgba(0,0,0,.55);color:#fff;border:none;display:none;align-items:center;justify-content:center;font-size:11px;cursor:pointer;}
.media-item:hover .mi-del{display:flex;}
.media-item img{width:100%;height:90px;object-fit:cover;border-radius:7px;}
.media-empty{grid-column:1/-1;text-align:center;padding:40px 10px;color:var(--text-muted);}
.media-empty .me-icon{width:56px;height:56px;border-radius:14px;margin:0 auto 10px;background:var(--bg-tertiary);display:flex;align-items:center;justify-content:center;color:var(--text-muted);}
@media(max-width:560px){.modal.modal-v2{max-width:100vw!important;width:100vw!important;max-height:100vh!important;border-radius:0;}}


:root { color-scheme: dark; --text-on-color: #fff; --purple: var(--qf-primary); }  
body.light-theme { color-scheme: light; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) { outline: none; }
button[disabled], button:disabled,
input[disabled], input:disabled,
select[disabled], select:disabled,
textarea[disabled], textarea:disabled,
[aria-disabled="true"] { opacity: .55; cursor: not-allowed !important; }
button[disabled]:hover, button:disabled:hover { transform: none !important; }

td, th, .mono, .num, .badge, .tag, .stat-value, .stat-value-v2, .stat-mini-value,
.content-card-stat-value, .dashboard-stat-card, .qf-kpi-v, .table-v2, .data-table { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}


.modern-btn, .btn-v2, .btn-sm, .qf-btn, .modal-footer .btn {
  border-radius: var(--r-ctl);
}
.modern-btn, .btn-v2, .btn-sm, .action-btn, .config-action-btn, .qf-btn,
.modal-footer .btn, .btn-primary, .btn-logout, .filter-tab, .filter-chip,
.dashboard-quick-btn {
  font-weight: 600;
  letter-spacing: .01em;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}

.modern-btn:focus-visible, .btn-v2:focus-visible, .btn-sm:focus-visible,
.action-btn:focus-visible, .config-action-btn:focus-visible, .qf-btn:focus-visible,
.modal-footer .btn:focus-visible, .btn-logout:focus-visible, .filter-tab:focus-visible,
.filter-chip:focus-visible, .sidebar-action-btn:focus-visible, .menu-toggle:focus-visible,
.nav-item:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
  box-shadow: var(--ring); border-color: var(--primary);
}


.modern-btn { padding: 10px 18px; border-radius: var(--r-ctl); }
.modern-btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--text-on-color); border-color: transparent;
  box-shadow: 0 2px 10px rgba(108,143,255,.28);
}
.modern-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(108,143,255,.36); filter: brightness(1.05); }
.modern-btn-primary:active { transform: translateY(0); filter: none; }
.modern-btn-secondary { background: var(--bg-tertiary); color: var(--text-secondary); border-color: var(--border); }
.modern-btn-secondary:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-strong); }
.modern-btn-secondary:active { background: var(--bg-tertiary); }


.btn-v2, .btn-sm, .qf-btn, .modal-footer .btn, .config-action-btn {
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}
.btn-v2 { border-radius: var(--r-ctl); font-weight: 600; }
.btn-v2:hover, .btn-sm.secondary:hover, .config-action-btn:hover {
  background: var(--bg-hover); color: var(--text); border-color: var(--border-strong);
}
.btn-v2:active { background: var(--bg); }
.btn-v2.primary, .btn-sm.primary {
  background: var(--primary); border-color: var(--primary); color: var(--text-on-color);
}
.btn-v2.primary:hover, .btn-sm.primary:hover {
  background: var(--primary-hover); border-color: var(--primary-hover); color: var(--text-on-color);
}
.btn-v2.success, .btn-sm.success {
  background: rgba(16,185,129,.14); border-color: rgba(16,185,129,.36); color: var(--success);
}
.btn-v2.success:hover, .btn-sm.success:hover {
  background: var(--success); border-color: var(--success); color: var(--text-on-color);
}
.btn-v2.danger, .btn-sm.danger, .action-btn.danger {
  background: rgba(239,68,68,.10); border-color: rgba(239,68,68,.34); color: var(--error);
}
.btn-v2.danger:hover, .btn-sm.danger:hover, .action-btn.danger:hover,
.modal-footer .btn.danger:hover {
  background: var(--error); border-color: var(--error); color: var(--text-on-color);
}
.btn-v2.warning { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.36); color: var(--warning); }
.btn-v2.warning:hover { background: var(--warning); border-color: var(--warning); color: var(--text-on-color); }
.btn-v2.muted, .btn-v2.ghost { background: transparent; border-color: var(--border); color: var(--text-muted); }
.btn-v2.muted:hover, .btn-v2.ghost:hover { background: var(--bg-tertiary); color: var(--text); }
.btn-v2 svg, .action-btn svg, .config-action-btn svg { width: 14px; height: 14px; flex: none; }
.modern-btn svg { width: 16px; height: 16px; flex: none; }


.action-btn { border-radius: 6px; font-weight: 600; }
.action-btn:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-strong); }
.action-btn.primary { background: var(--primary-light); border-color: rgba(108,143,255,.5); color: var(--primary); }
.action-btn.primary:hover { background: var(--primary); border-color: var(--primary); color: var(--text-on-color); }
.action-btn.success { background: rgba(16,185,129,.10); border-color: rgba(16,185,129,.34); color: var(--success); }
.action-btn.success:hover { background: var(--success); border-color: var(--success); color: var(--text-on-color); }
.config-action-btn { border-radius: 6px; }
.config-action-save { background: var(--primary); color: var(--text-on-color); border-color: var(--primary); }
.config-action-save:hover { background: var(--primary-hover); color: var(--text-on-color); box-shadow: 0 2px 10px rgba(108,143,255,.3); }


.modal-footer .btn { padding: 8px 16px; border-radius: var(--r-ctl); font-size: 13px; }
.modal-footer .btn:not(.primary):not(.danger):hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-strong); }
.modal-footer .btn.primary { background: var(--primary); border-color: var(--primary); color: var(--text-on-color); }
.modal-footer .btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-primary {
  width: 100%; padding: 11px; border-radius: var(--r-ctl);
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: var(--text-on-color); font-size: 14px; font-weight: 600;
  box-shadow: 0 4px 14px -4px rgba(108,143,255,.5);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-logout {
  border-radius: var(--r-ctl); padding: 8px; font-size: 12px; font-weight: 600;
  background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text-secondary);
}
.btn-logout:hover { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.5); color: var(--error); }


.form-input, .form-input-v2, .inline-input, .modern-select, .filter-search,
.config-value-input, .config-value-textarea, .qf-in, .qf-json-ta,
.main-content input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):not([type="range"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="reset"]),
.main-content select,
.main-content textarea {
  border-radius: var(--r-ctl);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  height: 36px;
  padding: 0 12px;
  line-height: 20px;
  font-weight: 400;
  box-sizing: border-box;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.main-content textarea {
  height: auto;
  min-height: 72px;
  padding: 8px 12px;
  line-height: 1.6;
}
.form-input-v2:hover, .inline-input:hover, .modern-select:hover, .filter-search:hover,
.config-value-input:hover, .config-value-textarea:hover,
.main-content select:hover { border-color: var(--border-strong); }
.form-input:focus, .form-input-v2:focus, .inline-input:focus, .modern-select:focus,
.filter-search:focus, .config-value-input:focus, .config-value-textarea:focus,
.qf-in:focus, .qf-json-ta:focus,
.main-content input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):not([type="range"]):not([type="hidden"]):focus,
.main-content select:focus, .main-content textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: var(--ring); background: var(--bg-secondary);
}
.form-input::placeholder, .form-input-v2::placeholder, .inline-input::placeholder,
.filter-search::placeholder, .config-value-input::placeholder,
.main-content input::placeholder, .main-content textarea::placeholder { color: var(--text-muted); }

.modern-search-input input, .search-bar-v2 input,
.modern-search-input input:focus, .search-bar-v2 input:focus {
  border: none !important; background: transparent !important; box-shadow: none !important;
}
.modern-search-input { border-radius: var(--r-ctl); }
.modern-search-input:focus-within { box-shadow: var(--ring); border-color: var(--primary); }
.search-bar-v2 input { border-radius: var(--r-ctl); }
.form-label, .form-label-v2, .af-group > label {
  display: block; font-size: 12px; font-weight: 600; letter-spacing: .01em;
  color: var(--text-secondary); margin-bottom: 6px;
}
.form-group, .form-group-v2, .af-group { margin-bottom: 14px; }
.af-hint, .form-hint, .qf-hint, .password-hint, .config-desc, .af-group .af-hint {
  font-size: 11.5px; color: var(--text-muted); line-height: 1.6; margin-top: 5px;
}
.af-input.invalid, .form-input.invalid, .invalid, .qf-in.invalid {
  border-color: var(--error); box-shadow: 0 0 0 1px rgba(239,68,68,.35);
}

input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); cursor: pointer; }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { cursor: not-allowed; }


main table, .data-table, .table-v2, .atable { width: 100%; border-collapse: collapse; }
main th, .data-table th, .data-table thead th, .table-v2 thead th, .atable th {
  text-align: left; padding: 11px 16px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle;
}
main td, .data-table td, .table-v2 tbody td, .atable td {
  padding: 12px 16px; font-size: 13px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light); vertical-align: middle;
}
main tbody tr:last-child > td, .data-table tbody tr:last-child > td,
.table-v2 tbody tr:last-child > td { border-bottom: none; }
main tbody tr, .data-table tbody tr, .table-v2 tbody tr { transition: background var(--dur) var(--ease); }
main tbody tr:hover > td, .data-table tbody tr:hover > td, .table-v2 tbody tr:hover > td {
  background: var(--row-hover);
}
main tbody tr.selected > td, .data-table tbody tr.selected > td { background: var(--primary-light); }

.num, td.num, th.num, main td.num, main th.num,
.data-table td.num, .data-table th.num,
.table-v2 tbody td.num, .table-v2 thead th.num { text-align: right; }
th.num { padding-left: 12px; }

main td:has(> button), main td:has(> a), .data-table td:has(> button) { white-space: nowrap; }

.cell-title, .cell-user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.cell-subtitle, .cell-user-email { font-size: 11.5px; color: var(--text-muted); }

main tbody td[colspan]:only-child, .data-table tbody td[colspan]:only-child {
  text-align: center; color: var(--text-muted); padding: 44px 16px;
  font-size: 13px; background: transparent; border-bottom: none;
}

.data-table + div, .card-v2 > div:last-child[style*="border-top"] { font-variant-numeric: tabular-nums; }


.badge, .badge-v2 {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 600; line-height: 1.5;
  white-space: nowrap; border: 1px solid transparent; vertical-align: middle;
}
.badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex: none;
}
#qfLicCfgCard .badge-muted {
  white-space: normal; min-width: 0; max-width: 100%; overflow-wrap: anywhere;
}
.badge.success, .badge-success { background: rgba(16,185,129,.14); color: var(--success); }
.badge.warning, .badge-warning { background: rgba(245,158,11,.14); color: var(--warning); }
.badge.error, .badge-error, .badge.danger { background: rgba(239,68,68,.14); color: var(--error); }
.badge.info, .badge-info { background: var(--primary-light); color: var(--primary); }
.badge.muted, .badge-muted, .badge-gray { background: var(--bg-tertiary); color: var(--text-muted); }
.badge.purple, .badge-purple { background: rgba(43,92,255,.14); color: var(--purple); }
.badge-v2.success { background: rgba(16,185,129,.14); color: var(--success); }
.badge-v2.warning { background: rgba(245,158,11,.14); color: var(--warning); }
.badge-v2.error { background: rgba(239,68,68,.14); color: var(--error); }
.badge-v2.info { background: var(--primary-light); color: var(--primary); }
.badge-v2.muted { background: var(--bg-tertiary); color: var(--text-muted); }
.badge-v2 .dot { width: 6px; height: 6px; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 6px; border: 1px solid transparent;
  font-size: 11.5px; font-weight: 600; line-height: 1.5; vertical-align: middle;
}
.tag-red { background: rgba(239,68,68,.14); color: var(--error); }
.tag-orange { background: rgba(245,158,11,.14); color: var(--warning); }
.tag-green { background: rgba(16,185,129,.14); color: var(--success); }
.tag-blue { background: var(--primary-light); color: var(--primary); }
.tag-purple { background: rgba(43,92,255,.14); color: var(--purple); }
.tag-gray { background: var(--bg-tertiary); color: var(--text-secondary); }


.card, .card-v2, .stat-card, .stat-card-v2, .content-card, .settings-section,
.detail-panel, .config-card, .filter-card, .profile-header,
.detail-modal, .modal { border-radius: var(--r-card); }

.dashboard-stat-card { border-radius: var(--r-card) !important; }
.card, .card-v2, .content-card, .settings-section, .detail-panel, .config-card,
.stat-card, .stat-card-v2, .filter-card, .dashboard-stat-card {
  background: var(--bg-secondary); border: 1px solid var(--border); box-shadow: var(--shadow-1);
}
.card { margin-bottom: 16px; }
.settings-section { margin-bottom: 16px; }
.dashboard-stat-card:hover, .stat-card-v2:hover, .stat-card:hover, .content-card:hover,
.config-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.card-v2:hover, .settings-section:hover, .detail-panel:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.card-header, .card-v2-header, .settings-section-header, .detail-panel-header {
  padding: 14px 20px; gap: 12px; min-height: 52px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title, .card-v2-title, .settings-section-header h3 { font-size: 14px; font-weight: 600; letter-spacing: .01em; }
.card-body, .card-v2-body, .settings-section-body, .detail-panel-body { padding: 20px; }
.content-card-header { margin-bottom: 14px; }
.content-card-footer { border-top: 1px solid var(--border-light); }
.detail-row { border-bottom: 1px solid var(--border-light); }
.config-item { border-bottom: 1px solid var(--border-light); }

.dashboard-stat-card [style*="font-weight:700"][style*="font-size:2"] { font-size: 26px !important; line-height: 1.16 !important; letter-spacing: -.01em; }
.main-content div[style*="font-size:22px;font-weight:700;line-height:1.1"],
.main-content div[style*="font-size:22px;font-weight:700;color:"] { font-size: 26px !important; line-height: 1.16 !important; letter-spacing: -.01em; }
.dashboard-stat-card, .stat-card, .stat-card-v2, .content-card, .qf-kpi { position: relative; transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }

.qf-kpi { background: var(--bg-secondary); border: 1px solid var(--border); box-shadow: var(--shadow-1); }
.qf-kpi:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.qf-kpi-l { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; letter-spacing: .01em; }
.qf-kpi-v { font-size: 26px; font-weight: 700; line-height: 1.16; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.qf-kpi-s { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

.stat-mini { background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: var(--r-ctl); text-align: center; padding: 12px; }
.stat-mini-value { font-size: 22px; font-weight: 700; margin-bottom: 2px; }
.stat-mini-label { font-size: 11px; color: var(--text-muted); }


.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px; padding-bottom: 0; border-bottom: none;
}
.ph-lead { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ph-iconbox, .page-hero-icon {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  box-shadow: 0 6px 16px -6px rgba(108,143,255,.55);
}
.ph-iconbox svg, .page-hero-icon svg { width: 22px; height: 22px; }
.page-title, .ph-lead .page-title {
  font-size: 21px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; margin: 0;
}
.page-subtitle, .ph-lead .page-subtitle { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; margin: 4px 0 0; }
.page-hero { align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.page-hero-title { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.page-hero-desc { font-size: 12.5px; color: var(--text-muted); }


.sidebar { border-right: 1px solid rgba(148,163,184,.10); }
.sidebar-header { padding: 14px 10px; gap: 8px; }
.sidebar-brand { font-size: 14px; font-weight: 700; line-height: 1.2; min-width: 0; overflow: hidden; }
.sidebar-brand small { display: block; font-size: 10px; font-weight: 500; letter-spacing: .04em; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-header > div:last-child { gap: 2px !important; flex: none; }
.sidebar-action-btn {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  background: rgba(148,163,184,.12); color: var(--text-secondary);
}
.sidebar-action-btn:hover { background: rgba(148,163,184,.26); color: var(--text); }
.sidebar-nav { padding: 10px 8px 16px; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(148,163,184,.22); border-radius: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,.4); }
.nav-section {
  font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-muted); padding: 14px 12px 6px;
}
.nav-item { padding: 8px 12px; gap: 10px; border-radius: var(--r-ctl); font-size: 13px; position: relative; }
.nav-item svg { width: 17px; height: 17px; }
.nav-item:hover { background: rgba(148,163,184,.10); color: var(--text); }
.nav-item.active {
  background: rgba(108,143,255, .16);
  color: var(--text-on-color); font-weight: 600;
}
.nav-item.active svg { color: var(--primary); }
.sidebar-footer { padding: 12px 14px 14px; background: rgba(15,23,42,.35); }
body.light-theme .sidebar-footer { background: rgba(15,23,42,.28); }
.user-info { gap: 10px; margin-bottom: 10px; }
.user-avatar { width: 34px; height: 34px; font-size: 13px; font-weight: 700; border: 2px solid rgba(148,163,184,.28); }
.user-email { font-size: 12px; font-weight: 600; }
.user-role { font-size: 10.5px; color: var(--text-muted); letter-spacing: .02em; }
.sidebar.collapsed .user-avatar { width: 32px; height: 32px; }


.modal-overlay, .detail-modal-overlay, .qf-confirm-mask {
  background: rgba(2,6,23,.66); backdrop-filter: blur(3px); padding: 24px;
  display: flex; align-items: center; justify-content: center;
  overflow-y: auto;               
  overscroll-behavior: contain;
}

.modal, .detail-modal, .modal-box, .qf-confirm, .qf-confirm-box { margin: auto; }
.modal, .detail-modal, .modal-box {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--r-card); box-shadow: var(--shadow-3);
  max-height: 86vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal { width: 100%; max-width: 520px; }
.modal-v2 { max-width: 560px !important; }
.detail-modal { width: 90%; max-width: 800px; }
.modal-header, .modal-v2 .modal-header, .detail-modal-header {
  padding: 15px 20px; flex: none; gap: 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(148,163,184,.055), transparent);
}
.modal-header h3, .detail-modal-title { font-size: 15.5px; font-weight: 600; letter-spacing: .01em; }
.modal-header button {
  width: 30px; height: 30px; padding: 0; border-radius: 7px; font-size: 18px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  color: var(--text-muted); background: transparent; transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.modal-header button:hover { background: var(--bg-hover); color: var(--text); }
.modal-body, .modal-v2 .modal-body, .detail-modal-body {
  padding: 20px; overflow-y: auto; flex: 1; max-height: none; overscroll-behavior: contain;
}
.modal-footer, .modal-v2 .modal-footer, .detail-modal-footer {
  padding: 14px 20px; flex: none; gap: 8px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end;
  background: rgba(15,23,42,.25);
}
body.light-theme .modal-footer, body.light-theme .detail-modal-footer { background: rgba(15,23,42,.03); }

.qf-confirm-box { max-height: calc(100vh - 48px) !important; }

.modal-body > div:last-child[style*="justify-content:flex-end"],
.modal-body > div:last-child[style*="justify-content: flex-end"],
.qf-confirm-box > div:last-child[style*="justify-content:flex-end"],
.qf-confirm-box > div:last-child[style*="justify-content: flex-end"] {
  position: sticky; bottom: 0; z-index: 1;
  background: var(--bg-secondary);
  padding-top: 12px; padding-bottom: 20px;
  margin-top: 16px; margin-bottom: -20px;
  border-top: 1px solid var(--border-light);
}


.toast-container { top: 16px; right: 16px; gap: 10px; z-index: 99999; }
.toast {
  min-width: 240px; max-width: 380px; padding: 11px 16px;
  border-radius: 10px; font-size: 13px; font-weight: 600; letter-spacing: .01em;
  background: var(--bg-secondary); color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
}
.toast.success { border-color: rgba(16,185,129,.55); color: var(--text); }
.toast.error { border-color: rgba(239,68,68,.55); color: var(--text); }
.toast.warning { border-color: rgba(245,158,11,.60); color: var(--text); }
.toast.info { border-color: rgba(108,143,255,.55); color: var(--text); }


.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px 16px; color: var(--text-muted); font-size: 13px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--bg-hover); border-top-color: var(--primary); border-radius: 50%; flex: none; }
.page-loading { min-height: 240px; }
.empty-state, .empty-state-v2, .media-empty {
  text-align: center; color: var(--text-muted); padding: 44px 20px;
}
.empty-state .empty-icon, .empty-state-v2 .empty-icon-v2, .media-empty .me-icon {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; opacity: 1;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--text-muted);
}
.empty-state .empty-icon svg, .empty-state-v2 .empty-icon-v2 svg, .media-empty .me-icon svg { width: 30px; height: 30px; }
.empty-state .empty-title, .empty-state-v2 h3 { font-size: 14.5px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state .empty-desc, .empty-state-v2 p { font-size: 12.5px; color: var(--text-muted); max-width: 420px; margin: 0 auto; line-height: 1.7; }
.skeleton { border-radius: 6px; }


.filter-bar-v2, .toolbar, .batch-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px;
}
.filter-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filter-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600;
  background: var(--bg-tertiary); color: var(--text-secondary);
  border: 1px solid var(--border); cursor: pointer;
}
.filter-tab:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-strong); }
.filter-tab.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); font-weight: 600; }
.filter-chip { padding: 5px 13px; border-radius: var(--r-pill); font-size: 12px; border: 1px solid var(--border); background: var(--bg-tertiary); color: var(--text-secondary); }
.filter-chip:hover { border-color: var(--border-strong); color: var(--text); }
.filter-chip.active { background: var(--primary); border-color: var(--primary); color: var(--text-on-color); }
.batch-actions {
  padding: 10px 14px; border-radius: var(--r-ctl);
  background: var(--primary-light); border: 1px solid rgba(108,143,255,.35); margin-bottom: 14px;
}
.batch-actions .selected-count { font-size: 13px; font-weight: 600; color: var(--primary); }

.dashboard-quick-btn { border-radius: var(--r-ctl); font-weight: 600; }
.qf-rich-toolbar { border-radius: var(--r-ctl); }


.page-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.page > .card-v2 { margin-bottom: 16px; }
.qf-actionbar {
  position: sticky; top: 0; z-index: 6;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 16px;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--r-card); box-shadow: var(--shadow-1);
}
.qf-actionbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.qf-actionbar-state { font-size: 12px; color: var(--text-muted); }
.qf-actionbar-state.on { color: var(--warning); font-weight: 600; }
.qf-drawer { margin-bottom: 16px; }
.qf-drawer[hidden] { display: none; }
.qf-drawer-title { font-size: 12px; color: var(--text-muted); padding: 0 2px 10px; }
.qf-drawer > .card-v2 { margin-bottom: 16px; }
.qf-config-module { margin-bottom: 16px; }
.config-category-tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.qf-config-group { margin-bottom: 16px; }
.qf-config-group-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.qf-config-group-title { font-size: 14px; font-weight: 600; color: var(--text); }
.qf-config-group-count { font-size: 11.5px; color: var(--text-muted); }
.qf-config-group-more { margin-left: auto; }
.qf-config-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.qf-config-name { font-size: 14px; font-weight: 600; color: var(--text); }
.qf-config-key { font-size: 11px; color: var(--text-muted); font-family: 'SF Mono', Monaco, Consolas, monospace; }

.config-card.is-dirty {
  border-color: rgba(108,143,255,.55) !important;
  background: color-mix(in srgb, var(--primary) 7%, var(--bg-secondary)) !important;
  box-shadow: 0 0 0 1px rgba(108,143,255,.22), var(--shadow-1);
}
.modern-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.data-table, .table-v2 { width: 100%; border-collapse: collapse; }
.data-table th, .table-v2 thead th {
  text-align: left; padding: 11px 14px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted);
  background: var(--bg-tertiary); border-bottom: 1px solid var(--border);
}
.data-table td, .table-v2 tbody td {
  padding: 12px 14px; font-size: 13px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light); vertical-align: middle;
}
.data-table tr:hover, .table-v2 tbody tr:hover { background: var(--bg-tertiary); }
.data-table tr:last-child td, .table-v2 tbody tr:last-child td { border-bottom: none; }
.qf-empty { text-align: center; color: var(--text-muted); padding: 40px 20px; }
.qf-empty-title { font-size: 14.5px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.qf-empty-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.7; }

@media (max-width: 1280px) {
  .main-content { padding: 20px 22px; }
  
  .dashboard-stats-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}
@media (max-width: 1100px) {
  .dashboard-stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .card-grid, .content-card-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important; }
  
  .dashboard-charts { grid-template-columns: 1fr !important; }
}
@media (max-width: 1024px) {
  :root { --sidebar-width: 204px; }
  .main-content { padding: 18px; }
  .sidebar-header { padding: 12px 8px; gap: 7px; }
  .sidebar-action-btn { width: 24px; height: 24px; }
  .page-title, .ph-lead .page-title { font-size: 19px; }
  .ph-iconbox, .page-hero-icon { width: 40px; height: 40px; }
  .modal, .modal-v2, .detail-modal { max-width: calc(100vw - 32px); }
  .modal-overlay, .detail-modal-overlay, .qf-confirm-mask { padding: 16px; }
  .qf-confirm-box { max-height: calc(100vh - 32px) !important; }
  .qf-confirm { max-height: calc(100vh - 32px); }
  .grid-2, .form-row, .info-grid, .af-row { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}

.modern-btn-danger {
  background: rgba(239,68,68,.12);
  color: var(--error);
  border-color: rgba(239,68,68,.45);
  font-weight: 600;
}
.modern-btn-danger:hover { background: var(--error); border-color: var(--error); color: var(--text-on-color); }
.modern-btn-danger:disabled { background: rgba(239,68,68,.07); color: rgba(239,68,68,.5); border-color: rgba(239,68,68,.22); }

.action-btn:disabled, .action-btn[aria-disabled="true"] {
  opacity: .55; cursor: not-allowed; color: var(--text-muted); border-color: var(--border);
  background: transparent;
}
.action-btn:disabled:hover { background: transparent; color: var(--text-muted); border-color: var(--border); }
.ak-why { font-size: 10.5px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; white-space: normal; max-width: 190px; }
.ak-revoked td { opacity: .66; }
.ak-check { width: 14px; height: 14px; cursor: pointer; vertical-align: middle; }
.ak-check:disabled { cursor: not-allowed; }

.page-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.8;
  margin: 0 0 14px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: rgba(148,163,184,.06);
  overflow-wrap: anywhere;
}
.page-note b { color: var(--text-secondary); font-weight: 600; }

body.qf-nav-compact .sidebar {
  width: 68px !important;
  min-width: 68px;
  max-width: 68px;
  overflow-x: hidden;
}
body.qf-nav-compact .main-content { margin-left: 68px !important; }
body.qf-nav-compact .sidebar .sidebar-header {
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  gap: 6px;
  padding: 12px 8px !important;
}
body.qf-nav-compact .sidebar .sidebar-header > div:last-child {
  margin: 0 !important;
  flex-direction: column !important;
  gap: 6px !important;
  width: 100% !important;
  align-items: center;
  justify-content: center !important;
}
body.qf-nav-compact .sidebar .sidebar-action-btn { width: 30px !important; height: 30px !important; }
body.qf-nav-compact .sidebar .sidebar-brand,
body.qf-nav-compact .sidebar .nav-item span,
body.qf-nav-compact .sidebar .nav-item kbd,
body.qf-nav-compact .sidebar .nav-item .badge,
body.qf-nav-compact .sidebar .user-detail,
body.qf-nav-compact .sidebar .btn-logout,
body.qf-nav-compact .sidebar .sidebar-footer > a { display: none !important; }
body.qf-nav-compact .sidebar .sidebar-footer { padding: 12px 8px 14px !important; justify-content: center !important; }
body.qf-nav-compact .sidebar .sidebar-nav {
  padding: 10px 6px 16px !important;
  overflow-x: hidden;
  overflow-y: auto;
}
body.qf-nav-compact .sidebar .nav-section {
  display: block !important;
  height: 1px !important;
  min-height: 1px !important;
  max-height: 1px !important;
  padding: 0 !important;
  margin: 10px 12px !important;
  font-size: 0 !important;
  line-height: 0 !important;
  color: transparent !important;
  background: var(--border) !important;
  border-radius: 1px;
  overflow: hidden;
}
body.qf-nav-compact .sidebar .nav-item {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 !important;
  margin: 0 auto 4px !important;
  justify-content: center !important;
  gap: 0 !important;
  font-size: 0;
}
body.qf-nav-compact .sidebar .nav-item svg { width: 19px !important; height: 19px !important; margin: 0 auto; }
body.qf-nav-compact .sidebar .nav-item:hover { background: rgba(148,163,184,.14); }
body.qf-nav-compact .sidebar .nav-item.active {
  background: var(--primary-light) !important;
  color: var(--primary) !important;

}
body.qf-nav-compact .sidebar .nav-item.active svg { color: var(--primary) !important; }
body.qf-nav-compact .sidebar .user-info {
  justify-content: center !important;
  margin-bottom: 8px !important;
  cursor: pointer;
  border-radius: 10px;
}
body.qf-nav-compact .sidebar .user-info:hover { background: rgba(148,163,184,.14); }
body.qf-nav-compact .sidebar .user-avatar {
  width: 42px !important;
  height: 42px !important;
  font-size: 15px !important;
  margin: 0 !important;
}
.qf-nav-usercard {
  margin-top: 8px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-tertiary);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
  text-align: center;
}
.qf-nav-usercard b { display: block; color: var(--text); font-size: 12px; margin-bottom: 2px; }
.qf-nav-usercard span { display: block; color: var(--text-muted); }

.qf-time { white-space: nowrap; font-variant-numeric: tabular-nums; cursor: help; }
.qf-time-rel { color: var(--text-muted); font-size: 11px; }
.qf-time-empty { color: var(--text-muted); cursor: help; }
th.qf-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.qf-sortable:hover { color: var(--text-secondary); }
th.qf-sortable::after { content: '↕'; opacity: .45; margin-left: 5px; font-size: 10px; }
th.qf-sortable[aria-sort="descending"]::after { content: '↓'; opacity: 1; color: var(--primary); }
th.qf-sortable[aria-sort="ascending"]::after { content: '↑'; opacity: 1; color: var(--primary); }
.rf-cat { font-size: 12px; color: var(--text-secondary); display: block; min-width: 0; }
.rf-cat-line { display: flex; align-items: center; gap: 5px; min-width: 0; }
.rf-cat-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rf-cat-raw { display: block; font-size: 11px; color: var(--text-muted); font-family: ui-monospace, Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rf-cat-unknown { color: var(--warning); }
.rf-badge-unknown { font-size: 10px; padding: 1px 6px; border-radius: 999px; border: 1px solid rgba(245,158,11,.5); color: var(--warning); white-space: nowrap; flex: none; }
.rf-stats { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.rf-stat { font-size: 12px; color: var(--text-secondary); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-stat b { color: var(--text); font-variant-numeric: tabular-nums; }
.rf-toolbar-hint { font-size: 11.5px; color: var(--text-muted); padding: 0 16px 10px; }
.qf-plan { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; max-width: 100%; }
.qf-plan-name { font-weight: 600; white-space: nowrap; }
.qf-plan-en { font-size: 10.5px; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 6px; white-space: nowrap; letter-spacing: .02em; }
.qf-plan-none { color: var(--text-muted); }
.qf-plan-ellipsis { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.qf-cell-plan { white-space: nowrap; }
th.qf-col-plan { min-width: 158px; }
td.qf-cell-plan .rf-cat-raw { white-space: nowrap; }
.qf-cell-nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.qf-nowrap { white-space: nowrap; }
.qf-email { display: inline-block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.qf-inline-badge { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

.qf-inp {
  height: 36px !important;
  padding: 0 12px !important;
  border-radius: var(--r-ctl) !important;
  border: 1px solid var(--border) !important;
  background: var(--bg-tertiary) !important;
  color: var(--text) !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 20px !important;
  box-sizing: border-box !important;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease) !important;
}
.qf-inp::placeholder { color: var(--text-muted) !important; }
.qf-inp:focus {
  outline: none !important;
  border-color: var(--primary) !important;
  box-shadow: var(--ring) !important;
  background: var(--bg-secondary) !important;
}
.qf-inp.qf-inp-search { padding: 0 12px 0 36px !important; }
.qf-inp-inwrap {
  height: 36px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.qf-inp-mono {
  font-family: ui-monospace, Consolas, monospace !important;
  font-size: 12px !important;
}
textarea.qf-inp {
  height: auto !important;
  min-height: 72px !important;
  padding: 8px 12px !important;
  line-height: 1.6 !important;
}
.qf-inp[data-qf-invalid="1"] {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .18) !important;
}
.qf-inp-unit { font-size: 12px; color: var(--text-muted); }
.main-content .qfrt-chip {
  height: 26px !important;
  padding: 0 6px !important;
  border-radius: var(--radius-sm) !important;
  font-size: 11px !important;
}

.qf-liccard { padding: 14px 16px; margin-bottom: 16px; }
.qf-liccard-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.qf-liccard-title { font-weight: 700; font-size: 14px; }
.qf-liccard-note { font-size: 11.5px; color: var(--text-muted); line-height: 1.8; margin-bottom: 8px; }
.qf-liccard-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qf-liccard-field { display: flex; align-items: center; gap: 6px; }
.qf-liccard-label { font-size: 12px; color: var(--text-secondary); }
.qf-liccard-ms { font-size: 11.5px; }
.qf-liccard-state { font-size: 11.5px; margin-top: 8px; }
.qf-liccard-problems { color: var(--error); font-size: 11.5px; margin-top: 6px; }
.qf-liccard-result { font-size: 12px; line-height: 1.9; color: var(--text-secondary); margin-top: 8px; }
.qf-liccard-refresh { margin-left: auto; padding: 3px 10px; font-size: 11.5px; }
.qf-liccard-save {
  height: 36px;
  padding: 0 14px;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

   
@media (max-width: 560px) {
  
  .gw-sw { min-width: 0 !important; flex-wrap: wrap; align-items: flex-start; }
  .gw-modes { gap: 10px; }
  .gw-toggles { gap: 10px; }
  
  .card-v2, .card-v2-body, .card-v2-header,
  .content-card, .content-card-body, .content-card-header {
    min-width: 0; max-width: 100%;
    overflow-wrap: anywhere; word-break: break-word;
  }
  
  .gw-fg input, .gw-fg select, .gw-offfield input, .qf-inp, .qf-rich-toolbar input {
    min-width: 0; max-width: 100%;
  }
  
  .filter-tabs { max-width: 100%; min-width: 0; }
}



.data-table td .badge,.data-table td [class*=badge],.qf-badge,.qf-tag,.data-table td .pill{white-space:nowrap!important;flex:none;min-width:fit-content;display:inline-block;}
.data-table td{white-space:normal;}
.data-table td.nowrap-cell,.data-table td .nowrap{white-space:nowrap;}
