/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root, [data-theme="classic"] {
  --bg:        #0f1117;
  --bg-grad:   none;
  --bg2:       #181c26;
  --bg3:       #1e2332;
  --border:    #2a3044;
  --border2:   #2a3044;
  --text:      #e2e8f0;
  --text2:     #8892a4;
  --accent:    #6c8ef5;
  --accent-rgb: 108, 142, 245;
  --accent2:   #4ade80;
  --danger:    #f87171;
  --user-bg:   #1e2a45;
  --bot-bg:    #1a2030;
  --radius:    10px;
  --font:      'Segoe UI', system-ui, sans-serif;
}

[data-theme="modern-dark"] {
  --bg:        #0b0d14;
  --bg-grad:   radial-gradient(1200px 800px at 0% -10%, #1a1333 0%, transparent 55%),
               radial-gradient(900px 600px at 100% 0%, #0d2a3f 0%, transparent 55%),
               linear-gradient(180deg, #0b0d14 0%, #0f1320 100%);
  --bg2:       rgba(22, 26, 42, 0.72);
  --bg3:       rgba(30, 35, 54, 0.72);
  --border:    rgba(120, 140, 200, 0.14);
  --border2:   rgba(120, 140, 200, 0.25);
  --text:      #f1f5f9;
  --text2:     #94a3b8;
  --accent:    #7c5cff;
  --accent-rgb: 124, 92, 255;
  --accent2:   #4ade80;
  --danger:    #f87171;
  --accent-grad: linear-gradient(135deg, #7c5cff 0%, #4da6ff 100%);
  --accent-grad-soft: linear-gradient(135deg, rgba(124, 92, 255, 0.18), rgba(77, 166, 255, 0.18));
  --user-bg:   rgba(30, 42, 69, 0.8);
  --bot-bg:    rgba(26, 32, 48, 0.8);
  --radius:    12px;
  --shadow:    0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 0 1px rgba(124, 92, 255, 0.25), 0 8px 32px rgba(124, 92, 255, 0.18);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --font:      'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

[data-theme="modern-light"] {
  /* Muted gray — noticeably darker than white, comfortable for long sessions */
  --bg:        #d4d8e0;
  --bg-grad:   radial-gradient(1200px 800px at 0% -10%, #c9ced8 0%, transparent 55%),
               radial-gradient(900px 600px at 100% 0%, #c4cbd5 0%, transparent 55%),
               linear-gradient(180deg, #d4d8e0 0%, #c8cdd6 100%);
  --bg2:       rgba(226, 231, 238, 0.92);   /* panels a notch brighter than bg */
  --bg3:       rgba(238, 241, 246, 0.96);   /* cards: brightest (hierarchy intact) */
  --border:    rgba(15, 23, 42, 0.10);
  --border2:   rgba(15, 23, 42, 0.18);
  --text:      #1e2430;
  --text2:     #5a6578;
  --accent:    #6d4bff;
  --accent-rgb: 109, 75, 255;
  --accent2:   #0ea371;
  --danger:    #dc2626;
  --accent-grad: linear-gradient(135deg, #6d4bff 0%, #2563eb 100%);
  --accent-grad-soft: linear-gradient(135deg, rgba(109, 75, 255, 0.1), rgba(37, 99, 235, 0.1));
  --user-bg:   #dde5ff;
  --bot-bg:    #f4f6fa;
  --radius:    12px;
  --shadow:    0 4px 18px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 0 1px rgba(109, 75, 255, 0.18), 0 6px 22px rgba(109, 75, 255, 0.12);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --font:      'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html, body { height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; }
[data-theme^="modern"] body {
  background-image: var(--bg-grad);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Login Screen ────────────────────────────────────────────────────────── */
.login-screen {
  display: flex; align-items: center; justify-content: center;
  height: 100vh; background: var(--bg);
}
.login-box {
  display: flex; flex-direction: column; gap: 12px;
  width: 320px; padding: 32px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: 12px;
}
.login-title { font-size: 22px; font-weight: 700; text-align: center; color: var(--text); }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 10px; }
.login-logo {
  width: 116px; height: 116px; margin-bottom: 6px;
  filter: drop-shadow(0 10px 28px rgba(124, 92, 255, 0.45));
  animation: login-logo-breathe 4s ease-in-out infinite;
}
.login-logo svg { width: 100%; height: 100%; display: block; }
.login-title { font-size: 26px !important; letter-spacing: 0.5px; }
.login-subtitle { font-size: 11px; color: var(--text2); letter-spacing: 2px; text-transform: uppercase; }
@keyframes login-logo-breathe {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 10px 28px rgba(124, 92, 255, 0.45)); }
  50%      { transform: scale(1.04); filter: drop-shadow(0 14px 38px rgba(124, 92, 255, 0.6)); }
}

/* Login progress bar */
.login-progress {
  height: 3px; width: 100%;
  background: var(--border);
  border-radius: 3px; overflow: hidden;
  margin-top: 8px;
  opacity: 0; transition: opacity 0.2s;
}
.login-progress.active { opacity: 1; }
.login-progress-fill {
  height: 100%; width: 0%;
  background: var(--accent-grad, linear-gradient(90deg, #7c5cff, #4da6ff));
  transition: width 0.35s cubic-bezier(.25, .9, .3, 1);
  box-shadow: 0 0 10px rgba(124, 92, 255, 0.6);
}
.login-field { position: relative; display: flex; align-items: center; }
.login-field-icon { position: absolute; left: 12px; color: var(--text2); pointer-events: none; }
.login-field input { flex: 1; padding-left: 36px !important; padding-right: 40px !important; }
.login-pw-toggle {
  position: absolute; right: 8px; background: transparent; border: none;
  color: var(--text2); cursor: pointer; padding: 4px; display: flex;
  align-items: center; justify-content: center; border-radius: 4px;
}
.login-pw-toggle:hover { color: var(--text); background: var(--bg3); }
.login-submit { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.login-submit:disabled { cursor: wait; opacity: 0.7; }
.login-spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff;
  border-radius: 50%; animation: login-spin 0.7s linear infinite;
}
@keyframes login-spin { to { transform: rotate(360deg); } }
.login-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; gap: 8px; flex-wrap: wrap;
}
.login-footer-selects { display: flex; gap: 6px; }
.login-version { font-size: 10px; color: var(--text2); letter-spacing: 0.3px; }
.login-box input {
  padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 14px; outline: none;
}
.login-box input:focus { border-color: var(--accent); }
.login-submit { padding: 10px; font-size: 14px; border-radius: 8px; cursor: pointer; }
.login-error { color: var(--danger); font-size: 12px; text-align: center; min-height: 16px; }
.hidden { display: none !important; }

/* ── Settings Modal ──────────────────────────────────────────────────────── */
.settings-section { padding: 12px 0; border-bottom: 1px solid var(--border); }
.settings-section:last-child { border-bottom: none; }
.settings-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.settings-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.settings-input {
  padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 12px; outline: none; flex: 1; min-width: 80px;
}
.settings-input:focus { border-color: var(--accent); }
input[type="date"].settings-input { color-scheme: dark; cursor: pointer; }
input[type="date"].settings-input::-webkit-calendar-picker-indicator { opacity: 0; position: absolute; width: 100%; height: 100%; cursor: pointer; }
input[type="date"].settings-input { position: relative; }
.settings-msg { font-size: 11px; margin-top: 4px; min-height: 14px; }
.settings-msg.ok { color: var(--accent2); }
.settings-msg.err { color: var(--danger); }

.admin-user-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.admin-user-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  background: var(--bg); border-radius: 6px; font-size: 12px;
}
.admin-user-row .u-name { color: var(--text); font-weight: 500; min-width: 60px; }
.admin-user-row .u-username { color: var(--text2); min-width: 60px; }
.admin-user-row .u-role { color: var(--accent); font-size: 11px; min-width: 50px; }
.admin-user-row .u-info { color: var(--text2); font-size: 10px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-row .u-dept { color: var(--accent); font-size: 10px; min-width: 80px; font-weight: 500; }
.admin-user-row .u-company { color: var(--text2); font-size: 10px; min-width: 100px; }
.admin-user-row .u-actions { margin-left: auto; display: flex; gap: 4px; }
.admin-user-row .u-frozen {
  background: var(--danger); color: #fff; font-size: 10px; padding: 1px 6px;
  border-radius: 3px; font-weight: 600;
}
.admin-user-row .u-unfreeze {
  padding: 2px 8px; font-size: 11px; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--accent2); background: transparent; color: var(--accent2);
}
.admin-user-row .u-unfreeze:hover { background: var(--accent2); color: #fff; }
.admin-user-row button {
  padding: 2px 8px; font-size: 11px; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--text2);
}
.admin-user-row button:hover { border-color: var(--accent); color: var(--text); }
.admin-user-row button.btn-danger:hover { border-color: var(--danger); color: var(--danger); }

.admin-log-list { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; margin-top: 6px; }
.admin-log-row {
  display: flex; flex-direction: column; gap: 2px; padding: 6px 8px;
  background: var(--bg); border-radius: 6px; font-size: 12px;
}
.admin-log-main { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-log-ts { color: var(--text2); font-family: monospace; font-size: 11px; min-width: 140px; }
.admin-log-actor { color: var(--text); font-weight: 500; min-width: 90px; }
.admin-log-action { color: var(--accent); min-width: 70px; }
.admin-log-target { color: var(--text2); min-width: 90px; }
.admin-log-ip { color: var(--text2); font-size: 10px; font-family: monospace; margin-left: auto; }
.admin-log-detail { color: var(--text2); font-size: 10px; word-break: break-all; }
.admin-log-detail code { background: transparent; }

.admin-edit-panel {
  margin-top: 10px; padding: 12px; background: var(--bg3); border-radius: 8px;
  border: 1px solid var(--accent); display: flex; flex-direction: column; gap: 4px;
}

/* ── App Layout ───────────────────────────────────────────────────────────── */
#app { display: flex; flex-direction: column; height: 100vh; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.header-user { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.header-user span { font-size: 12px; color: var(--text2); }
.lang-select {
  padding: 3px 6px; border-radius: 5px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text2); font-size: 11px; cursor: pointer; outline: none;
}
.lang-select:hover { border-color: var(--accent); color: var(--text); }

header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  height: 52px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.logo {
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

nav { display: flex; gap: 4px; }

.tab-btn {
  padding: 6px 16px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.tab-btn:hover { background: var(--bg3); color: var(--text); }
.tab-btn.active { background: var(--accent); color: #fff; }

/* ── Panels ───────────────────────────────────────────────────────────────── */
.tab-panel { display: none; flex-direction: column; flex: 1; min-height: 0; }
.tab-panel.active { display: flex; }

/* ── Sub Tab Bar (AI tab 内部) ────────────────────────────────────────────── */
.sub-tab-bar { display: flex; gap: 2px; padding: 4px 12px; background: var(--bg2); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sub-tab-btn {
  padding: 5px 14px; border: none; border-radius: 5px; background: transparent;
  color: var(--text2); cursor: pointer; font-size: 12px; font-weight: 500; transition: all 0.15s;
}
.sub-tab-btn:hover { background: var(--bg3); color: var(--text); }
.sub-tab-btn.active { background: var(--bg3); color: var(--text); border-bottom: 2px solid var(--accent); }

.sub-tab-panel { display: none; flex-direction: column; flex: 1; min-height: 0; }
.sub-tab-panel.active { display: flex; }

/* ── Data Table ──────────────────────────────────────────────────────────── */
.data-table-wrapper { flex: 1; overflow: auto; padding: 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  position: sticky; top: 0; z-index: 2;
  background: var(--bg3); color: var(--text); padding: 6px 10px;
  text-align: left; font-weight: 600; font-size: 11px; white-space: nowrap;
  border-bottom: 2px solid var(--border);
}
.data-table td {
  padding: 4px 10px; border-bottom: 1px solid var(--border);
  color: var(--text2); white-space: nowrap;
}
.data-table tr:hover td { background: var(--bg3); color: var(--text); }
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table td.num .money-main { font-weight: 600; font-variant-numeric: tabular-nums; }
.data-table td.num .money-sub  { font-size: 10px; color: var(--text2); display: block; margin-top: 1px; font-variant-numeric: tabular-nums; }
.dash-card .card-value { font-variant-numeric: tabular-nums; }
.info-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 800; line-height: 1;
  margin-left: 4px; cursor: help; vertical-align: middle;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.info-badge:hover { transform: scale(1.15); transition: transform 0.15s; }

/* Server ping indicator — pill with dot + ms text, sits inline with sub-tab buttons */
.sub-tab-bar { align-items: center; }   /* keep pill vertically centered with buttons */
.ping-pill {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0 10px 0 4px;
  padding: 3px 9px 3px 8px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
  cursor: help; user-select: none;
  border: 1px solid currentColor;
  background: color-mix(in srgb, currentColor 12%, transparent);
  transition: background 0.2s, color 0.2s, box-shadow 0.25s, transform 0.15s;
  flex-shrink: 0;
}
.ping-pill:hover { transform: translateY(-1px); box-shadow: 0 3px 10px color-mix(in srgb, currentColor 30%, transparent); }
.ping-pill .ping-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 25%, transparent),
              0 0 6px currentColor;
  animation: ping-breathe 1.6s ease-in-out infinite;
}
.ping-pill .ping-ms { color: currentColor; line-height: 1; }
.ping-pill.green  { color: #10b981; }
.ping-pill.yellow { color: #d97706; }
.ping-pill.red    { color: #ef4444; }
[data-theme="modern-light"] .ping-pill.yellow { color: #b45309; }
@keyframes ping-breathe {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.25); opacity: 0.78; }
}
/* Browsers without color-mix support fall back to plain border+text colour */
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
  .ping-pill { background: transparent; }
}

/* ── Data Chart ──────────────────────────────────────────────────────────── */
.data-chart { height: 320px; padding: 12px 16px; flex: 1; }
.data-chart canvas { width: 100% !important; height: 100% !important; }

/* ── Data Views ──────────────────────────────────────────────────────────── */
/* ── Task List ────────────────────────────────────────────────────────────── */
.task-list-wrapper { flex: 1; overflow-y: auto; padding: 8px 12px; }
.task-list { display: flex; flex-direction: column; gap: 6px; }
.task-item {
  display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px;
  background: var(--bg3); border-radius: 8px; border: 1px solid var(--border);
}
.task-item.done { opacity: 0.5; }
.task-item.done .task-text { text-decoration: line-through; }
.task-check { width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent2); flex-shrink: 0; margin-top: 2px; }
.task-body { flex: 1; min-width: 0; }
.task-text { font-size: 13px; color: var(--text); word-break: break-word; }
.task-meta { font-size: 10px; color: var(--text2); margin-top: 3px; display: flex; gap: 8px; }
.task-priority { font-size: 10px; padding: 1px 6px; border-radius: 3px; font-weight: 600; }
.task-priority.high { background: var(--danger); color: #fff; }
.task-priority.normal { background: var(--border); color: var(--text2); }
.task-priority.low { background: var(--bg); color: var(--text2); }
.task-deadline {
  font-size: 10px; padding: 1px 6px; border-radius: 3px; font-weight: 600;
  background: var(--bg); color: var(--text2); border: 1px solid var(--border);
}
.task-deadline.today { color: var(--accent); border-color: var(--accent); }
.task-deadline.overdue { background: var(--danger); color: #fff; border-color: var(--danger); }

.task-add-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.task-add-field { display: flex; flex-direction: column; gap: 4px; }
.task-add-field .settings-input { width: 100%; }
.task-add-label { font-size: 11px; color: var(--text2); font-weight: 500; }
.task-add-required { color: var(--danger); }

.task-detail-toggle {
  background: transparent; border: 1px solid var(--border); color: var(--text2);
  padding: 1px 8px; font-size: 10px; border-radius: 4px; cursor: pointer;
}
.task-detail-toggle:hover { border-color: var(--accent); color: var(--text); }
.task-detail { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.task-detail.hidden { display: none; }
.task-detail-text {
  width: 100%; padding: 6px 8px; font-size: 12px; border-radius: 4px;
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  resize: vertical; font-family: inherit;
}
.task-detail-actions { display: flex; align-items: center; gap: 8px; }
.task-detail-save {
  padding: 2px 10px; font-size: 11px; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--accent); background: transparent; color: var(--accent);
}
.task-detail-save:hover { background: var(--accent); color: #fff; }
.task-detail-msg { font-size: 10px; color: var(--text2); }
.task-detail-timeline { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.task-detail-entry {
  padding: 4px 8px; background: var(--bg); border-left: 2px solid var(--accent);
  border-radius: 3px;
}
.task-detail-entry-head { display: flex; gap: 8px; font-size: 10px; color: var(--text2); margin-bottom: 2px; }
.task-detail-entry-ts { font-family: monospace; }
.task-detail-entry-by { font-weight: 600; }
.task-detail-entry-text { font-size: 12px; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.task-detail-empty { font-size: 11px; color: var(--text2); padding: 4px 0; }
.task-completion {
  margin-top: 4px; display: flex; flex-wrap: wrap; gap: 8px;
  font-size: 10px; color: var(--text2);
}
.task-done-badge {
  background: var(--accent2); color: #fff; padding: 1px 6px;
  border-radius: 3px; font-weight: 600;
}
.task-done-note { color: var(--text); }
.task-del {
  background: transparent; border: 1px solid var(--border); color: var(--text2);
  cursor: pointer; font-size: 11px; padding: 4px 12px; border-radius: 4px; flex-shrink: 0;
}
.task-del:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* ── Platform Bar ─────────────────────────────────────────────────────────── */
.platform-bar { display: flex; gap: 6px; align-items: center; padding: 6px 12px; background: var(--bg); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.platform-label { font-size: 11px; color: var(--text2); font-weight: 600; }
.platform-btn {
  padding: 6px 18px; border-radius: 6px; border: 1px solid var(--border);
  background: transparent; color: var(--text2); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.15s; min-width: 140px; justify-content: center;
}
.platform-btn:hover:not(.disabled) { border-color: var(--accent); color: var(--text); }
.platform-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.platform-btn.disabled { opacity: 0.35; cursor: not-allowed; }

.company-bar {
  display: flex; gap: 6px; align-items: center;
  padding: 6px 12px; background: var(--bg2);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.company-btn {
  padding: 4px 18px; border-radius: 6px; border: 1px solid var(--border);
  background: transparent; color: var(--text2); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.company-btn:hover:not(.disabled) { border-color: var(--accent); color: var(--text); }
.company-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
[data-theme^="modern"] .company-btn.active { background: var(--accent-grad); border-color: transparent; }

.dept-bar {
  display: flex; gap: 6px; align-items: center;
  padding: 6px 12px; background: var(--bg2);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.dept-btn {
  padding: 4px 14px; border-radius: 6px; border: 1px solid var(--border);
  background: transparent; color: var(--text2); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.dept-btn:hover { border-color: var(--accent); color: var(--text); }
.dept-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
[data-theme^="modern"] .dept-btn.active { background: var(--accent-grad); border-color: transparent; }
/* sub-tabs hidden when not in active dept */
.data-sub-btn.hidden-by-dept { display: none !important; }

.brand-group {
  border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px;
  display: flex; flex-direction: column; gap: 4px; background: var(--bg2);
}
.brand-group-title { font-size: 11px; color: var(--accent); font-weight: 600; margin-bottom: 2px; }
.brand-chk-label {
  display: flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; padding-left: 8px;
}

.lb-link {
  color: var(--accent); cursor: pointer; text-decoration: none;
  border-bottom: 1px dashed transparent; transition: border-color 0.15s, color 0.15s;
}
.lb-link:hover { color: var(--text); border-bottom-color: var(--accent); }

/* Mask a regular text input visually like a password field — without triggering
   browser save-password prompts. Works in Chrome/Edge/Safari. Firefox shows plain text. */
.pw-mask {
  -webkit-text-security: disc;
  -moz-text-security: disc;
  text-security: disc;
  letter-spacing: 0.15em;
}

.data-sub-btn { padding: 5px 14px; border: none; border-radius: 5px; background: transparent; color: var(--text2); cursor: pointer; font-size: 12px; font-weight: 500; transition: all 0.15s; }
.data-sub-btn:hover { background: var(--bg3); color: var(--text); }
.data-sub-btn.active { background: var(--bg3); color: var(--text); border-bottom: 2px solid var(--accent); }

.data-view { display: none; flex-direction: column; flex: 1; min-height: 0; }
.data-view.active { display: flex; }

.dash-toolbar { display: flex; gap: 6px; align-items: center; padding: 8px 12px; flex-shrink: 0; flex-wrap: wrap; }

.dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; padding: 12px; }
.dash-card {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; display: flex; flex-direction: column; gap: 4px;
}
.dash-card .card-label { font-size: 11px; color: var(--text2); font-weight: 500; }
.dash-card .card-value { font-size: 22px; font-weight: 700; color: var(--text); }
.dash-card .card-value.green { color: var(--accent2); }
.dash-card .card-value.red { color: var(--danger); }
.dash-card .card-value.blue { color: var(--accent); }
.dash-card .card-value.purple { color: #c084fc; }
.dash-card .card-sub { font-size: 11px; font-weight: 500; margin-top: 2px; }
.dash-card .card-sub.green { color: var(--accent2); }
.dash-card .card-sub.red { color: var(--danger); }

.pager-btn { padding: 3px 10px; font-size: 11px; border-radius: 4px; border: 1px solid var(--border); background: transparent; color: var(--text2); cursor: pointer; }
.pager-btn:hover { border-color: var(--accent); color: var(--text); }
.pager-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pager-info { font-size: 11px; color: var(--text2); }

.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-title { font-size: 12px; color: var(--text2); }

select {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 13px;
  cursor: pointer;
  outline: none;
}
select:focus { border-color: var(--accent); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  margin-left: auto;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }

.session-badge {
  font-size: 11px;
  color: var(--text2);
  background: var(--bg3);
  border-radius: 4px;
  padding: 3px 8px;
  font-family: monospace;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Search Bar ──────────────────────────────────────────────────────────── */
.search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text2);
  transition: all 0.15s;
}
.search-toggle:hover { background: var(--bg3); color: var(--text); }

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.search-input {
  flex: 1;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  outline: none;
}
.search-input:focus { border-color: var(--accent); }
.search-count { font-size: 11px; color: var(--text2); min-width: 40px; text-align: center; }
.search-close {
  background: transparent;
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 6px;
  border-radius: 4px;
}
.search-close:hover { background: var(--bg3); color: var(--text); }

/* ── Messages Wrapper (for scroll-to-bottom positioning) ─────────────────── */
.messages-wrapper {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ── Messages ─────────────────────────────────────────────────────────────── */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 82%;
  animation: msgIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.message.user { align-self: flex-end; }
.message.assistant, .message.openclaw, .message.cc { align-self: flex-start; }

.msg-role {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.message.user .msg-role { text-align: right; color: var(--accent); justify-content: flex-end; }
.message.openclaw .msg-role { color: var(--accent2); }
.message.cc .msg-role { color: #c084fc; }

.msg-time {
  font-size: 10px;
  font-weight: 400;
  color: var(--text2);
  opacity: 0.6;
}

.msg-bubble {
  padding: 10px 14px;
  border-radius: var(--radius);
  line-height: 1.6;
  word-break: break-word;
  font-size: 14px;
  position: relative;
}
.message.user .msg-bubble { background: var(--user-bg); border-bottom-right-radius: 3px; }
.message.assistant .msg-bubble,
.message.openclaw .msg-bubble,
.message.cc .msg-bubble { background: var(--bot-bg); border-bottom-left-radius: 3px; border: 1px solid var(--border); }

.msg-bubble img {
  max-width: 320px;
  border-radius: 6px;
  margin: 6px 0;
  display: block;
  cursor: pointer;
  transition: opacity 0.15s;
}
.msg-bubble img:hover { opacity: 0.85; }

/* ── Message Actions (hover) ──────────────────────────────────────────────── */
.msg-actions {
  position: absolute;
  top: -4px;
  right: 8px;
  display: none;
  gap: 2px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 10;
}
.message.user .msg-actions { right: auto; left: 8px; }
.message:hover .msg-actions { display: flex; }
.msg-actions button {
  background: transparent;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  transition: all 0.1s;
}
.msg-actions button:hover { background: var(--bg3); color: var(--text); }
.msg-actions .act-del:hover { color: var(--danger); }

/* ── Markdown Content in Messages ─────────────────────────────────────────── */
.msg-bubble .text-content { display: block; }
.msg-bubble .text-content p { margin: 0 0 8px 0; }
.msg-bubble .text-content p:last-child { margin-bottom: 0; }
.msg-bubble .text-content h1,
.msg-bubble .text-content h2,
.msg-bubble .text-content h3,
.msg-bubble .text-content h4 { margin: 12px 0 6px 0; font-size: 15px; color: var(--text); }
.msg-bubble .text-content h1 { font-size: 18px; }
.msg-bubble .text-content h2 { font-size: 16px; }

.msg-bubble .text-content ul,
.msg-bubble .text-content ol { margin: 4px 0 8px 20px; }
.msg-bubble .text-content li { margin: 2px 0; }

.msg-bubble .text-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 6px 0;
  padding: 4px 12px;
  color: var(--text2);
  background: rgba(108, 142, 245, 0.05);
  border-radius: 0 4px 4px 0;
}

.msg-bubble .text-content table {
  border-collapse: collapse;
  margin: 8px 0;
  width: 100%;
  font-size: 13px;
}
.msg-bubble .text-content th,
.msg-bubble .text-content td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
}
.msg-bubble .text-content th { background: var(--bg3); font-weight: 600; }

.msg-bubble .text-content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.msg-bubble .text-content a:hover { border-bottom-color: var(--accent); }

.msg-bubble .text-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 12px 0;
}

.msg-bubble .text-content del { color: var(--text2); }

/* ── Code Blocks with Copy Button ─────────────────────────────────────────── */
.msg-bubble .text-content code {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 5px;
  font-family: 'Consolas', monospace;
  font-size: 13px;
}

.code-block-wrapper {
  position: relative;
  margin: 8px 0;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #161b22;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 4px 12px;
  font-size: 11px;
  color: var(--text2);
}

.code-copy-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  transition: all 0.15s;
}
.code-copy-btn:hover { border-color: var(--accent); color: var(--text); }
.code-copy-btn.copied { color: var(--accent2); border-color: var(--accent2); }

.msg-bubble .text-content pre {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  overflow-x: auto;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}
.code-block-wrapper pre {
  border-radius: 0 0 6px 6px;
  border-top: none;
}
.msg-bubble .text-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
}

/* ── Typing Indicator ─────────────────────────────────────────────────────── */
.typing-indicator { display: flex; gap: 4px; padding: 4px 0; }
.typing-indicator span {
  width: 6px; height: 6px;
  background: var(--text2);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%,80%,100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

/* ── Group Target Bar ─────────────────────────────────────────────────────── */
.group-target-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.group-target-label { font-size: 11px; color: var(--text2); font-weight: 600; }
.group-target-btn {
  font-size: 11px; padding: 3px 10px; border-radius: 12px;
  border: 1px solid var(--border); background: transparent; color: var(--text2);
  cursor: pointer; transition: all 0.15s;
}
.group-target-btn:hover { border-color: var(--accent); color: var(--text); }
.group-target-btn.active[data-target="all"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.group-target-btn.active[data-target="cc"] { background: #c084fc; color: #fff; border-color: #c084fc; }
.group-target-btn.active[data-target="oc"] { background: var(--accent2); color: #0f1117; border-color: var(--accent2); }

/* ── Input Area ───────────────────────────────────────────────────────────── */
.input-area {
  padding: 12px 16px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Drag-over state */
.input-area.drag-over {
  background: rgba(108, 142, 245, 0.08);
  border-top-color: var(--accent);
}

.image-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px 10px;
  background: var(--bg3);
  border-radius: 6px;
  border: 1px solid var(--border);
  position: relative;
}
.image-preview img { height: 48px; border-radius: 4px; }
.remove-img {
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px; height: 20px;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hidden { display: none !important; }

.input-row { display: flex; gap: 8px; align-items: flex-end; }

.upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
  transition: all 0.15s;
  user-select: none;
  color: var(--text2);
}
.upload-btn:hover { border-color: var(--accent); color: var(--accent); }

textarea {
  flex: 1;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: var(--font);
  font-size: 14px;
  resize: none;
  outline: none;
  line-height: 1.5;
  max-height: 200px;
  overflow-y: auto;
  transition: border-color 0.15s;
}
textarea:focus { border-color: var(--accent); }
textarea::placeholder { color: var(--text2); }

.btn-send {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}
.btn-send:hover { opacity: 0.85; transform: scale(1.05); }
.btn-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-send:active:not(:disabled) { transform: scale(0.92); }

/* ── Scroll to Bottom Button ──────────────────────────────────────────────── */
.scroll-bottom-btn {
  position: absolute;
  bottom: 16px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: all 0.2s;
  z-index: 5;
}
.scroll-bottom-btn:hover { background: var(--bg3); color: var(--text); border-color: var(--accent); }

/* ── Lightbox ─────────────────────────────────────────────────────────────── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  cursor: pointer;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
  cursor: default;
}
.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  font-size: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ── Scripts ──────────────────────────────────────────────────────────────── */
.scripts-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 0;
}

.scripts-list {
  width: 260px;
  flex-shrink: 0;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.script-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
  position: relative;
}
.script-item:hover { background: var(--bg3); border-color: var(--border); }
.script-item.running { border-color: var(--accent); background: var(--bg3); }
.script-item.selected { border-color: var(--accent); background: var(--bg3); }

.script-type {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.script-type.py { background: #1a3a2a; color: #4ade80; }
.script-type.ps1 { background: #1a2a3a; color: #6c8ef5; }
.script-type.bat { background: #2a1a1a; color: #f87171; }
.script-type.sh { background: #2a2a1a; color: #fbbf24; }

.script-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.scripts-output-panel { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.script-name-bar {
  padding: 8px 16px 2px;
  font-size: 12px;
  color: var(--text2);
  min-height: 24px;
  display: flex;
  align-items: center;
}

.scripts-output {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  font-family: 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  color: #a8d5a2;
  background: #0a0e14;
}

.scripts-empty { color: var(--text2); font-size: 13px; padding: 12px; font-family: var(--font); }
.output-error { color: var(--danger); }
.output-done { color: var(--text2); border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; }
.output-separator { color: var(--text2); border-top: 1px dashed var(--border); margin-top: 12px; padding-top: 8px; font-family: var(--font); font-size: 11px; }

/* Script item actions */
.script-actions { display: none; gap: 4px; margin-left: auto; flex-shrink: 0; }
.script-item:hover .script-actions { display: flex; }
.script-actions button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.script-actions button:hover { border-color: var(--accent); color: var(--text); }
.script-actions .btn-del:hover { border-color: var(--danger); color: var(--danger); }

/* Script toolbar */
.script-toolbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.script-args-row {
  display: flex;
  gap: 8px;
  padding: 6px 16px 8px;
  align-items: center;
}
.script-args-input {
  flex: 1;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 13px;
  font-family: 'Consolas', monospace;
  outline: none;
}
.script-args-input:focus { border-color: var(--accent); }
.script-args-input::placeholder { color: var(--text2); }

/* Stop button */
.btn-stop {
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.btn-stop:hover { opacity: 0.85; }

/* New button */
.btn-new { color: var(--accent2) !important; border-color: var(--accent2) !important; }
.btn-new:hover { background: rgba(74, 222, 128, 0.1) !important; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 700px;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 15px;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text2);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.modal-close:hover { background: var(--bg3); color: var(--text); }
.modal-body {
  padding: 16px 20px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-field { display: flex; flex-direction: column; gap: 6px; }
.modal-field label { font-size: 12px; color: var(--text2); font-weight: 600; }
.modal-field input {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 13px;
  font-family: 'Consolas', monospace;
  outline: none;
}
.modal-field input:focus { border-color: var(--accent); }
.modal-field textarea {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: 'Consolas', monospace;
  resize: vertical;
  outline: none;
  line-height: 1.5;
  min-height: 300px;
  tab-size: 4;
}
.modal-field textarea:focus { border-color: var(--accent); }
.modal-footer {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

/* ── Claude Code Terminal ─────────────────────────────────────────────────── */
#tab-claude-code { padding: 0; overflow: hidden; }

#claude-code-terminal {
  flex: 1;
  min-height: 0;
  padding: 8px;
  background: #0d1117;
  overflow: hidden;
}

/* Override xterm defaults to match dark theme */
#claude-code-terminal .xterm { height: 100%; }
#claude-code-terminal .xterm-viewport { background-color: #0d1117 !important; }

/* ── Search highlight ─────────────────────────────────────────────────────── */
.search-highlight {
  background: rgba(250, 204, 21, 0.3);
  border-radius: 2px;
  padding: 0 1px;
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text2); }

/* ══════════════════════════════════════════════════════════════════════════
   Theme Polish — only active for data-theme="modern-dark" / "modern-light"
   (Classic theme remains untouched.)
   ══════════════════════════════════════════════════════════════════════════ */
[data-theme^="modern"] header {
  background: var(--bg2);
  backdrop-filter: saturate(1.2) blur(14px);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(var(--accent-rgb), 0.08), var(--shadow-inset);
  position: relative;
}
[data-theme^="modern"] header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.35), transparent);
  pointer-events: none;
}
[data-theme^="modern"] .logo {
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; font-size: 17px; font-weight: 800;
}
[data-theme^="modern"] .tab-btn { padding: 7px 18px; border-radius: 10px; transition: all 0.2s cubic-bezier(.2,.9,.25,1); }
[data-theme^="modern"] .tab-btn:hover { background: var(--accent-grad-soft); color: var(--text); }
[data-theme^="modern"] .tab-btn.active {
  background: var(--accent-grad); color: #fff;
  box-shadow: 0 6px 18px rgba(var(--accent-rgb), 0.35), var(--shadow-inset);
}
[data-theme^="modern"] .sub-tab-bar { background: var(--bg2); backdrop-filter: blur(10px); }
[data-theme^="modern"] .sub-tab-btn, [data-theme^="modern"] .data-sub-btn { border-radius: 8px; transition: all 0.18s; position: relative; }
[data-theme^="modern"] .sub-tab-btn:hover, [data-theme^="modern"] .data-sub-btn:hover { background: var(--accent-grad-soft); color: var(--text); }
[data-theme^="modern"] .sub-tab-btn.active, [data-theme^="modern"] .data-sub-btn.active { background: var(--bg3); color: var(--text); border-bottom: none; box-shadow: var(--shadow-inset); }
[data-theme^="modern"] .sub-tab-btn.active::after, [data-theme^="modern"] .data-sub-btn.active::after {
  content: ""; position: absolute; left: 15%; right: 15%; bottom: -1px; height: 2px;
  background: var(--accent-grad); border-radius: 2px;
}
[data-theme^="modern"] .btn-ghost { border-radius: 8px; transition: all 0.18s; border: 1px solid var(--border2); }
[data-theme^="modern"] .btn-ghost:hover {
  background: var(--accent-grad-soft); border-color: transparent;
  box-shadow: var(--shadow-glow); color: var(--text);
}
[data-theme^="modern"] .btn-send {
  background: var(--accent-grad) !important; color: #fff !important;
  border: none; border-radius: 10px;
  box-shadow: 0 6px 18px rgba(var(--accent-rgb), 0.32), var(--shadow-inset);
  transition: transform 0.12s, box-shadow 0.2s, opacity 0.2s;
}
[data-theme^="modern"] .btn-send:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.45), var(--shadow-inset);
  opacity: 1;
}
[data-theme^="modern"] .btn-send:active:not(:disabled) { transform: translateY(0) scale(0.98); }

[data-theme^="modern"] .login-screen { background: transparent; }
[data-theme^="modern"] .login-box {
  background: var(--bg2); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid var(--border2); border-radius: 18px;
  padding: 36px 32px; gap: 14px;
  box-shadow: var(--shadow-glow), var(--shadow);
}
[data-theme^="modern"] .login-title {
  font-size: 22px; background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
[data-theme^="modern"] .login-box input { border-radius: 10px; border: 1px solid var(--border2); background: var(--bg); padding: 11px 14px; transition: border-color 0.15s, box-shadow 0.15s; }
[data-theme^="modern"] .login-box input:focus { border-color: transparent; box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.45); }
[data-theme^="modern"] .login-submit { background: var(--accent-grad); color: #fff; border: none; box-shadow: 0 6px 18px rgba(var(--accent-rgb), 0.35); transition: transform 0.12s, box-shadow 0.2s; }
[data-theme^="modern"] .login-submit:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(var(--accent-rgb), 0.5); }

[data-theme^="modern"] .dash-card,
[data-theme^="modern"] .task-item,
[data-theme^="modern"] .admin-log-row,
[data-theme^="modern"] .admin-user-row,
[data-theme^="modern"] .admin-edit-panel {
  background: var(--bg3); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-inset); transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}
[data-theme^="modern"] .dash-card:hover,
[data-theme^="modern"] .task-item:hover {
  border-color: var(--border2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22), var(--shadow-inset);
  transform: translateY(-1px);
}
[data-theme^="modern"] .dash-card .card-value {
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
[data-theme^="modern"] .dash-card .card-value.green { background: linear-gradient(135deg, #4ade80, #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-theme^="modern"] .dash-card .card-value.red   { background: linear-gradient(135deg, #f87171, #fb923c); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-theme^="modern"] .dash-card .card-value.purple{ background: linear-gradient(135deg, #c084fc, #f472b6); -webkit-background-clip: text; background-clip: text; color: transparent; }

[data-theme^="modern"] .task-item { padding: 12px 14px; gap: 10px; }
[data-theme^="modern"] .task-item.done { opacity: 0.6; }
[data-theme^="modern"] .task-priority.high { background: linear-gradient(135deg, #f87171, #fb923c); color: #fff; box-shadow: 0 2px 6px rgba(248, 113, 113, 0.3); }
[data-theme^="modern"] .task-priority.normal { background: var(--accent-grad-soft); color: var(--text); }
[data-theme^="modern"] .task-priority.low { background: transparent; color: var(--text2); border: 1px solid var(--border2); }
[data-theme^="modern"] .task-deadline.today { background: var(--accent-grad-soft); color: var(--text); border-color: transparent; box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.35); }
[data-theme^="modern"] .task-deadline.overdue { background: linear-gradient(135deg, #ef4444, #f97316); color: #fff; border-color: transparent; box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35); }
[data-theme^="modern"] .task-done-badge { background: linear-gradient(135deg, #10b981, #22d3ee); }
[data-theme^="modern"] .task-detail-entry {
  background: var(--bg2);
  border-left: 3px solid transparent;
  border-image: var(--accent-grad) 1; border-image-slice: 1;
  padding: 6px 10px; border-radius: 0 6px 6px 0;
}

[data-theme^="modern"] .settings-input { border-radius: 8px; border: 1px solid var(--border2); background: var(--bg2); transition: border-color 0.15s, box-shadow 0.15s; }
[data-theme^="modern"] .settings-input:focus { border-color: transparent; box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.4); }

[data-theme^="modern"] .modal { background: var(--bg2); backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3); border: 1px solid var(--border2); border-radius: 16px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), var(--shadow-inset); }
[data-theme^="modern"] .modal-header { border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--accent-grad-soft), transparent); border-radius: 16px 16px 0 0; }
[data-theme^="modern"] .platform-btn.active, [data-theme^="modern"] .pager-btn.active { background: var(--accent-grad); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.32); }

[data-theme^="modern"] ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.5), rgba(var(--accent-rgb), 0.2));
  border-radius: 8px; border: 2px solid transparent; background-clip: padding-box;
}
[data-theme^="modern"] ::-webkit-scrollbar-thumb:hover { background: var(--accent-grad); background-clip: padding-box; border: 2px solid transparent; }
[data-theme^="modern"] ::selection { background: rgba(var(--accent-rgb), 0.35); color: var(--text); }
[data-theme^="modern"] .panel-title { color: var(--text); opacity: 0.85; font-weight: 600; }

/* ── PM (admin-to-admin private messaging) ─────────────────────────────────── */
.pm-header-slot {
  display: flex; align-items: center; gap: 6px;
  margin-left: auto; margin-right: 16px;
}
.pm-admin-select {
  padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border2);
  background: var(--bg); color: var(--text); font-size: 12px;
  cursor: pointer; outline: none; min-width: 160px;
}
.pm-admin-select:hover { border-color: var(--accent); }
.pm-admin-select option { color: var(--text); background: var(--bg); }
.pm-unread-total {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
}
[data-theme^="modern"] .pm-unread-total { background: linear-gradient(135deg, #ef4444, #f97316); box-shadow: 0 2px 6px rgba(239,68,68,0.4); }
.self-check-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 5px; margin-left: 4px;
  border-radius: 8px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; vertical-align: middle;
}
.sc-status-ok { color: var(--success, #22c55e); font-weight: 600; }
.sc-status-warn { color: var(--danger, #ef4444); font-weight: 600; }
.sc-card {
  flex: 1 1 140px; min-width: 140px; background: var(--bg2);
  border: 1px solid var(--border2); border-radius: 10px; padding: 12px;
}
.sc-card-label { font-size: 11px; color: var(--text2); margin-bottom: 4px; }
.sc-card-value { font-size: 18px; font-weight: 700; color: var(--text); }
.sc-card.warn { border-color: var(--danger); }
.sc-card.warn .sc-card-value { color: var(--danger); }
.intel-list { display: flex; flex-direction: column; gap: 10px; }
.intel-card {
  display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px;
  background: var(--bg2); border: 1px solid var(--border2);
}
.intel-card.dismissed { opacity: 0.45; }
.intel-score {
  flex: 0 0 44px; height: 44px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #6b7280, #4b5563);
}
.intel-score.s-high { background: linear-gradient(135deg, #ef4444, #dc2626); }
.intel-score.s-mid { background: linear-gradient(135deg, #f59e0b, #d97706); }
.intel-score.s-low { background: linear-gradient(135deg, #6b7280, #4b5563); }
.intel-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.intel-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.intel-meta { font-size: 11px; color: var(--text2); }
.intel-meta .intel-cat {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  background: var(--bg3); margin-right: 6px; font-weight: 600;
}
.intel-why { font-size: 12px; color: var(--text); margin-top: 2px; }
.intel-action { font-size: 12px; color: var(--accent, #3b82f6); margin-top: 2px; }
.intel-actions { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.intel-actions .btn-ghost { padding: 3px 10px; font-size: 11px; white-space: nowrap; }

.pm-window {
  position: fixed; top: 60px; right: 24px;
  width: 380px; height: 520px; max-height: 80vh;
  background: var(--bg2); border: 1px solid var(--border2); border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.45);
  display: flex; flex-direction: column; z-index: 1500;
  overflow: hidden;
}
[data-theme^="modern"] .pm-window {
  backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3);
  box-shadow: var(--shadow-glow), 0 24px 56px rgba(0,0,0,0.5);
}
.pm-window.hidden { display: none; }
.pm-window-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text);
  background: linear-gradient(180deg, var(--accent-grad-soft, var(--bg3)), transparent);
}
.pm-messages {
  flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
  background: var(--bg);
}
.pm-msg { display: flex; flex-direction: column; max-width: 78%; gap: 2px; }
.pm-msg.out { align-self: flex-end; align-items: flex-end; }
.pm-msg.in { align-self: flex-start; align-items: flex-start; }
.pm-msg-body {
  padding: 7px 11px; border-radius: 12px; font-size: 13px;
  word-break: break-word; white-space: pre-wrap;
}
.pm-msg.out .pm-msg-body { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.pm-msg.in .pm-msg-body { background: var(--bg3); color: var(--text); border-bottom-left-radius: 4px; }
[data-theme^="modern"] .pm-msg.out .pm-msg-body { background: var(--accent-grad); box-shadow: 0 3px 10px rgba(var(--accent-rgb), 0.3); }
.pm-msg-meta { font-size: 10px; color: var(--text2); padding: 0 4px; display: flex; align-items: center; gap: 6px; }
.pm-msg-status { font-size: 10px; }
.pm-msg-status.read { color: var(--accent2); }
.pm-msg-status.unread { color: var(--text2); opacity: 0.8; }
.pm-empty { color: var(--text2); font-size: 12px; text-align: center; padding: 20px 0; }
.pm-input-area {
  display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border);
  background: var(--bg2);
}
.pm-input-area textarea {
  flex: 1; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-family: inherit; font-size: 13px;
  resize: none; outline: none;
}
.pm-input-area textarea:focus { border-color: var(--accent); }
.pm-tools { display: flex; flex-direction: column; gap: 4px; align-self: flex-end; }
.pm-tool-btn {
  width: 30px; height: 30px; border: 1px solid var(--border); background: var(--bg);
  border-radius: 6px; cursor: pointer; font-size: 16px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.pm-tool-btn:hover { border-color: var(--accent); }
.pm-emoji-panel {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px;
  padding: 8px; background: var(--bg3); border-top: 1px solid var(--border);
  max-height: 180px; overflow-y: auto;
}
.pm-emoji-panel.hidden { display: none; }
.pm-emoji-btn {
  font-size: 20px; padding: 4px; border: none; background: transparent;
  cursor: pointer; border-radius: 4px; line-height: 1;
}
.pm-emoji-btn:hover { background: var(--bg); }
.pm-img {
  max-width: 100%; max-height: 240px; border-radius: 8px; cursor: zoom-in;
  display: block; margin-top: 2px;
}
.pm-msg.out .pm-img { align-self: flex-end; }
.pm-uploading {
  font-size: 11px; color: var(--text2); padding: 4px 8px;
  font-style: italic;
}

/* Theme selector (always visible, styled neutrally so it works in all themes) */
.theme-select {
  padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text2); font-size: 11px;
  cursor: pointer; outline: none;
}
.theme-select:hover { border-color: var(--accent); color: var(--text); }

.vpn-badge { display:inline-block; background:#d14; color:#fff; font-size:9px; padding:1px 5px; border-radius:3px; margin-left:4px; letter-spacing:0.5px; }


/* ── SEO tab ─────────────────────────────────────────────────────────────── */
.seo-date-picker {
  background: var(--bg2); color: var(--text); border: 1px solid var(--border);
  border-radius: 4px; padding: 4px 8px; font-size: 13px;
}
.seo-status { font-size: 12px; color: var(--text2); margin-left: auto; }
.seo-content { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.seo-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 6px; padding: 12px 14px;
}
.seo-card h3 {
  margin: 0 0 8px 0; font-size: 14px; color: var(--accent); font-weight: 600;
}
.seo-body {
  margin: 0; padding: 0; font-family: inherit; font-size: 13px;
  white-space: pre-wrap; color: var(--text); line-height: 1.5;
}
.seo-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.seo-table th, .seo-table td {
  padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--border);
}
.seo-table th {
  background: var(--bg3, var(--bg)); color: var(--text2); font-weight: 600;
}
.seo-table tr:hover { background: var(--bg3, rgba(255,255,255,0.03)); }
.seo-raw {
  margin: 12px; padding: 12px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; font-size: 11px; max-height: 50vh; overflow: auto;
  white-space: pre-wrap; color: var(--text2);
}
#dv-seo, #dv-aieo { overflow-y: auto; }

/* SEO: structured renderer */
.seo-card-primary { border-left: 3px solid var(--accent); }
.seo-stat-row { display: flex; justify-content: space-between; padding: 4px 0; align-items: center; gap: 12px; }
.seo-stat-label { color: var(--text2); font-size: 12px; }
.seo-stat-val { font-size: 13px; }
.seo-bullets { margin: 6px 0 0 0; padding-left: 20px; font-size: 12px; line-height: 1.7; color: var(--text); }
.seo-bullets li code { background: var(--bg); padding: 1px 5px; border-radius: 3px; font-size: 11px; }

/* ── GSC Search Analytics 看板 ── */
.gsc-panel { padding: 12px; display: flex; flex-direction: column; gap: 14px; }
.gsc-hero { background: linear-gradient(135deg, rgba(74,158,255,0.14), rgba(74,158,255,0.04)); border: 1px solid rgba(74,158,255,0.28); border-radius: 10px; padding: 18px 20px; text-align: center; }
.gsc-hero-eyebrow { font-size: 12px; color: var(--text2); letter-spacing: 0.4px; }
.gsc-hero-number { font-size: 48px; font-weight: 700; color: #4a9eff; line-height: 1.1; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.gsc-hero-sub { font-size: 13px; color: var(--text); }
.gsc-hero-compare { margin-top: 6px; font-size: 12px; }
.gsc-hero-delta.up { color: #39c26a; font-weight: 600; }
.gsc-hero-delta.down { color: #e35d6a; font-weight: 600; }
.gsc-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.gsc-kpi-card { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.gsc-kpi-label { font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.6px; }
.gsc-kpi-value { font-size: 24px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.gsc-kpi-delta { font-size: 11px; color: var(--text2); min-height: 14px; }
.gsc-kpi-delta.up { color: #39c26a; font-weight: 600; }
.gsc-kpi-delta.down { color: #e35d6a; font-weight: 600; }
.gsc-kpi-hint { font-size: 10px; color: var(--text2); opacity: 0.7; margin-top: auto; }
.gsc-trend { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
.gsc-trend-title { font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 4px; }
.gsc-trend-body { width: 100%; height: 80px; }
.gsc-trend-body svg { width: 100%; height: 100%; }
.gsc-top { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
.gsc-top-title { font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 6px; }
.gsc-queries-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.gsc-queries-table th { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--border); color: var(--text2); font-weight: 500; }
.gsc-queries-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); }
.gsc-queries-table tr:last-child td { border-bottom: none; }
.gsc-queries-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.gsc-warming { background: rgba(74,158,255,0.06); border: 1px dashed rgba(74,158,255,0.4); border-radius: 10px; padding: 26px 20px; text-align: center; }
.gsc-warming-icon { font-size: 32px; margin-bottom: 8px; }
.gsc-warming-title { font-size: 15px; color: var(--text); font-weight: 600; margin-bottom: 4px; }
.gsc-warming-sub { font-size: 12px; color: var(--text2); line-height: 1.5; }
@media (max-width: 720px) {
  .gsc-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .gsc-hero-number { font-size: 36px; }
}

/* Platform brand logos */
.platform-logo { height: 22px; width: 60px; vertical-align: middle; margin-right: 6px; object-fit: contain; }
.platform-btn { display: inline-flex; align-items: center; }

/* Transaction Queue */
.tq-status-badge { display:inline-block; padding:2px 8px; border-radius:4px; font-size:11px; font-weight:700; letter-spacing:0.5px; }
.tq-act-btn { padding:3px 10px; border-radius:4px; border:none; font-size:11px; font-weight:600; cursor:pointer; margin:0 2px; transition:all 0.15s; }
.tq-accept { background:#3b82f622; color:#3b82f6; border:1px solid #3b82f644; }
.tq-accept:hover { background:#3b82f6; color:#fff; }
.tq-reject { background:#ef444422; color:#ef4444; border:1px solid #ef444444; }
.tq-reject:hover { background:#ef4444; color:#fff; }
.tq-process { background:#8b5cf622; color:#8b5cf6; border:1px solid #8b5cf644; }
.tq-process:hover { background:#8b5cf6; color:#fff; }
.tq-complete { background:#4ade8022; color:#4ade80; border:1px solid #4ade8044; }
.tq-complete:hover { background:#4ade80; color:#000; }

/* Links styled as buttons for right-click support */
a.platform-btn, a.data-sub-btn, a.dept-btn {
  text-decoration: none; display: inline-flex; align-items: center; user-select: none;
}
a.platform-btn:visited, a.data-sub-btn:visited, a.dept-btn:visited { color: inherit; }

/* Transaction Detail Modal */
#tq-detail-body table td { vertical-align: top; }
#tq-detail-body { line-height: 1.5; }



/* Cash In / Cash Out — EG-inspired clean buttons */
.tq-top-btn {
  padding: 14px 36px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
}
.tq-btn-cashin {
  border: 2px solid #22c55e;
  color: #22c55e;
}
.tq-btn-cashin:hover {
  background: #22c55e;
  color: #fff;
  box-shadow: 0 0 20px rgba(34,197,94,0.3);
}
.tq-btn-cashout {
  border: 2px solid #ef4444;
  color: #ef4444;
}
.tq-btn-cashout:hover {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 0 20px rgba(239,68,68,0.3);
}
.tq-top-btn:active {
  transform: scale(0.97);
}

/* Verify button */
.tq-verify { background:#06b6d422; color:#06b6d4; border:1px solid #06b6d444; }
.tq-verify:hover { background:#06b6d4; color:#fff; }

/* ── AIEO sub-view ──────────────────────────────────────────────────────── */
.aieo-tabs { display:flex; gap:.5rem; margin:.75rem 0 1rem; border-bottom:1px solid var(--border); padding-bottom:.5rem; }
.aieo-tab { background:transparent; border:1px solid var(--border); color:var(--text2); padding:.4rem .9rem; border-radius:.4rem; cursor:pointer; font-size:.9rem; }
.aieo-tab:hover { color:var(--text); border-color:var(--accent); }
.aieo-tab.active { background:var(--accent); color:#0b1220; border-color:var(--accent); font-weight:700; }
.aieo-pane.hidden { display:none; }
.aieo-card { background:var(--panel); border:1px solid var(--border); border-radius:.6rem; padding:1rem 1.1rem; margin-bottom:.9rem; }
.aieo-card-head { display:flex; justify-content:space-between; align-items:baseline; flex-wrap:wrap; gap:.5rem; margin-bottom:.6rem; }
.aieo-card-title { font-size:1rem; font-weight:700; color:var(--text); }
.aieo-card-meta { font-size:.85rem; color:var(--text2); }
.aieo-grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:1rem; margin-top:.5rem; }
@media (max-width:720px) { .aieo-grid-2 { grid-template-columns:1fr; } }
.aieo-sub { font-size:.85rem; font-weight:700; color:var(--text); margin:.8rem 0 .3rem; text-transform:uppercase; letter-spacing:.05em; }
.aieo-ul, .aieo-ol { margin:.3rem 0 .6rem 1.2rem; color:var(--text2); font-size:.9rem; }
.aieo-ul li, .aieo-ol li { margin:.2rem 0; }
.aieo-meta { font-size:.85rem; color:var(--text2); margin-top:.5rem; }
.aieo-chips { display:flex; flex-wrap:wrap; gap:.35rem; margin-top:.3rem; }
.aieo-chip { background:var(--bg2, rgba(255,255,255,.04)); border:1px solid var(--border); color:var(--text2); font-size:.8rem; padding:.2rem .55rem; border-radius:.3rem; }
.aieo-scores { display:flex; gap:1.2rem; margin-top:.5rem; }
.aieo-score { background:var(--bg2, rgba(255,255,255,.03)); border:1px solid var(--border); border-radius:.5rem; padding:.6rem 1rem; text-align:center; min-width:80px; }
.aieo-score-v { font-size:1.6rem; font-weight:800; color:var(--accent); }
.aieo-score-b { font-size:.8rem; color:var(--text2); margin-top:.2rem; }
.aieo-table { width:100%; border-collapse:collapse; margin:.3rem 0; font-size:.88rem; }
.aieo-table th { background:var(--bg2, rgba(255,255,255,.03)); color:var(--text2); text-align:left; font-weight:700; padding:.45rem .6rem; font-size:.8rem; text-transform:uppercase; letter-spacing:.04em; border-bottom:1px solid var(--border); }
.aieo-table td { padding:.45rem .6rem; border-bottom:1px solid var(--border); color:var(--text); }
.aieo-ok { color:#10b981; font-weight:700; }
.aieo-bad { color:#ef4444; font-weight:700; }
.aieo-pill { display:inline-block; padding:.15rem .55rem; border-radius:1rem; font-size:.75rem; font-weight:700; text-transform:uppercase; }
.pill-ok { background:rgba(16,185,129,.18); color:#10b981; }
.pill-warn { background:rgba(245,158,11,.18); color:#f59e0b; }
.pill-bad { background:rgba(239,68,68,.18); color:#ef4444; }
.pill-muted { background:rgba(255,255,255,.08); color:var(--text2); }
.aieo-form-row { display:flex; flex-wrap:wrap; gap:1rem; margin:.5rem 0; align-items:center; font-size:.9rem; color:var(--text2); }
.aieo-form-row input[type="date"], .aieo-form-row input[type="text"] { background:var(--bg2, rgba(255,255,255,.03)); border:1px solid var(--border); color:var(--text); padding:.35rem .6rem; border-radius:.3rem; }
.aieo-cit-matrix td:first-child { font-size:.85rem; color:var(--text); max-width:280px; }
.aieo-engine-cell { display:inline-flex; align-items:center; gap:.35rem; cursor:pointer; font-size:.8rem; }


/* ── SEO Hero Summary + Three Pillars (2026-04-22) ───────────────────────── */
.seo-hero-summary {
  padding: 14px 18px; margin: 0 12px 10px; border-radius: 8px;
  background: linear-gradient(90deg, rgba(247,197,72,0.10), rgba(74,158,255,0.06));
  border: 1px solid rgba(247,197,72,0.28);
}
.seo-hero-summary.hidden { display: none; }
.seo-hero-inner {
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center;
  font-size: 13px; line-height: 1.6; color: var(--text);
}
.seo-hero-kpi strong { color: var(--gold); font-size: 16px; margin: 0 4px; font-variant-numeric: tabular-nums; }
.seo-hero-sep { color: var(--text2); opacity: 0.4; font-size: 12px; }
.seo-hero-delta.up { color: #39c26a; font-weight: 600; font-size: 12px; }
.seo-hero-delta.down { color: #e35d6a; font-weight: 600; font-size: 12px; }
.seo-hero-status { font-weight: 600; padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.seo-hero-status.ok { background: rgba(57,194,106,0.14); color: #5fd989; border: 1px solid rgba(57,194,106,0.3); }
.seo-hero-status.alert { background: rgba(227,93,106,0.14); color: #ff8a95; border: 1px solid rgba(227,93,106,0.3); }

.seo-pillars {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin: 0 12px 14px;
}
.seo-pillars.hidden { display: none; }
.seo-pillar {
  padding: 12px 14px; border-radius: 8px;
  background: var(--bg2); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
}
.seo-pillar-label { font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.seo-pillar-big { font-size: 24px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.2; }
.seo-pillar-big .seo-pillar-small { font-size: 14px; font-weight: 500; }
.seo-pillar-sub { font-size: 11px; color: var(--text2); line-height: 1.4; }
.seo-pillar-green { border-left: 3px solid #39c26a; }
.seo-pillar-yellow { border-left: 3px solid #f7c548; }
.seo-pillar-red { border-left: 3px solid #e35d6a; }

@media (max-width: 640px) {
  .seo-pillars { grid-template-columns: 1fr; }
  .seo-hero-inner { font-size: 12px; }
}

/* AIEO site switcher (Demo Mates / PokieMates) — added 2026-04-23 */
.aieo-sites {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
  flex-wrap: wrap;
}
.aieo-sites-label {
  font-size: 12px;
  color: var(--text2, #888);
  margin-right: 4px;
}
.aieo-site-chip {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border, #ddd);
  border-radius: 16px;
  background: var(--bg-subtle, transparent);
  color: var(--text2, #666);
  cursor: pointer;
  transition: all 0.15s;
}
.aieo-site-chip:hover {
  border-color: var(--accent, #4a90e2);
  color: var(--accent, #4a90e2);
}
.aieo-site-chip.active {
  background: var(--accent, #4a90e2);
  border-color: var(--accent, #4a90e2);
  color: #fff;
}


/* SEO 看板 v1.2 — 7 日对比表格 */
.seo-7d-delta-wrap { margin-top: 16px; padding: 12px 14px; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06); border-radius: 8px; }
.seo-7d-delta-wrap.hidden { display: none; }
.seo-7d-delta-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.seo-7d-delta-note { font-size: 12px; color: var(--text2); padding: 8px 10px; margin-bottom: 10px; background: rgba(247,197,72,.08); border-left: 3px solid #f7c548; border-radius: 4px; line-height: 1.5; }
.seo-7d-delta-note.hidden { display: none; }
.seo-7d-delta-body { overflow-x: auto; }
.seo-7d-delta-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.seo-7d-delta-table th { text-align: left; padding: 6px 10px; color: var(--text2); font-weight: 600; border-bottom: 1px solid rgba(255,255,255,0.08); }
.seo-7d-delta-table td { padding: 6px 10px; color: var(--text); border-bottom: 1px solid rgba(255,255,255,0.04); }
.seo-7d-delta-table tr:last-child td { border-bottom: 0; }
.seo-7d-delta-table .seo-7d-date { color: var(--text2); white-space: nowrap; }
.seo-7d-delta-arrow { font-size: 10.5px; margin-left: 4px; font-weight: 700; }
.seo-7d-delta-arrow.up { color: #39c26a; }
.seo-7d-delta-arrow.down { color: #e35d6a; }


/* SEO 看板 v1.4 — 智能 hint */
.seo-mid-gap-note { margin-top: 8px; padding: 8px 11px; background: rgba(96,165,250,0.08); border-left: 3px solid #60a5fa; border-radius: 4px; font-size: 12px; color: var(--text); line-height: 1.5; }


/* AIEO hero (2026-04-27) */
.aieo-hero { margin: 1rem 0; }
.aieo-hero-card {
  background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(59,130,246,0.06));
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.aieo-hero-row { display: flex; gap: 10px; align-items: flex-start; }
.aieo-hero-icon { font-size: 18px; flex-shrink: 0; line-height: 1.4; }
.aieo-hero-text { flex: 1; line-height: 1.55; font-size: 13px; color: var(--text); }
.aieo-up { color: #10b981; font-weight: 700; }
.aieo-down { color: #ef4444; font-weight: 700; }


/* KYC mismatch highlight (P4 KYC v1 2026-04-27) */
.kyc-mismatch { color: #ef4444 !important; font-weight: 700; }


/* === Phase 3 mobile responsive 2026-04-29 === */

@media (max-width: 768px) {
  /* Touch-friendly buttons (Apple HIG min 44pt) */
  .btn-ghost, .data-sub-btn, .bs-adm-tab,
  button.bsa-anomaly-resolve,
  button.btn-send {
    min-height: 38px;
    padding: 8px 12px;
  }

  /* Top nav data-sub-btn: horizontal scroll instead of wrapping */
  .nav-sub-row, [data-sub-btn-row], .data-sub-btn-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-sub-row::-webkit-scrollbar { display: none; }
  .data-sub-btn { flex-shrink: 0; white-space: nowrap; font-size: 13px; }

  /* BS Admin sub-tabs: horizontal scroll */
  .bs-adm-tab-row, #dv-bs-admin > div:first-child {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .bs-adm-tab-row::-webkit-scrollbar,
  #dv-bs-admin > div:first-child::-webkit-scrollbar { display: none; }
  .bs-adm-tab { flex-shrink: 0; white-space: nowrap; font-size: 12px; }

  /* Modals: full-screen on mobile */
  .modal {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
    top: 0;
    left: 0;
    transform: none;
    position: fixed;
  }
  .modal-overlay { padding: 0 !important; }
  .modal-body { padding: 12px; max-height: calc(100vh - 110px); overflow-y: auto; }
  .modal-footer { padding: 10px 12px; }

  /* CMD+K overlay full-screen */
  #cmdk-overlay {
    padding-top: 0 !important;
    align-items: stretch !important;
  }
  #cmdk-overlay > div {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    border-radius: 0 !important;
  }
  #cmdk-results { max-height: calc(100vh - 110px) !important; }

  /* Tables: scroll horizontal instead of broken layout */
  .bsa-table, table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .bsa-table th, .bsa-table td, table th, table td {
    padding: 8px 10px;
    font-size: 12px;
  }

  /* Hide noisy elements: chat empty icon big on mobile is wasted */
  .bsa-chat-empty-icon { font-size: 32px; }

  /* Login page tighter on mobile */
  .login-card { width: 92vw; max-width: 92vw; padding: 18px; }

  /* Topnav padding tighter */
  .topnav { padding: 6px 10px; }
  .topnav-avatar img { width: 32px; height: 32px; }

  /* Drawer covers more screen width */
  .drawer { width: 88vw; max-width: 88vw; }

  /* Today page cards: 1 column */
  [data-bsa-jump] { width: 100%; }
}

@media (max-width: 480px) {
  /* Even tighter — phone portrait */
  .data-sub-btn { font-size: 12px; padding: 6px 10px; }
  .bs-adm-tab { font-size: 11px; padding: 7px 9px; }
  .modal-body { padding: 10px; }
  .topnav-avatar img { width: 28px; height: 28px; }
  /* Hide non-essential nav buttons (kept accessible via cmd+K) */
  .data-sub-btn[data-view="charts"],
  .data-sub-btn[data-view="scheduler"],
  .data-sub-btn[data-view="security"],
  .data-sub-btn[data-view="affiliates"] { display: none; }
}

/* Always: ensure cmdk overlay click works even on mobile (overlay is fixed) */
#cmdk-overlay { -webkit-tap-highlight-color: transparent; }

/* === end Phase 3 mobile responsive === */


/* ── dv-transactions toolbar group layout (2026-04-29) ── */
.tx-toolbar { gap: 12px !important; align-items: flex-end !important; padding: 12px !important; }
.tx-toolbar .tx-fld {
  display: flex; flex-direction: column; gap: 3px;
}
.tx-toolbar .tx-fld label {
  font-size: 10px; color: var(--text2, #9ca3af);
  letter-spacing: 0.5px; text-transform: uppercase; font-weight: 600;
}
.tx-toolbar .tx-fld .settings-input {
  width: 140px; height: 34px;
}
.tx-toolbar .tx-fld:has(input[type="date"]) {
  flex-direction: row; align-items: center; gap: 4px;
  flex-wrap: wrap;
}
.tx-toolbar .tx-fld:has(input[type="date"]) label { width: 100%; flex-basis: 100%; }
.tx-toolbar .tx-fld:has(input[type="date"]) .settings-input { width: 130px; }
.tx-toolbar .tx-fld-sep { color: var(--text2,#9ca3af); font-size: 12px; }
.tx-toolbar .tx-status-select { width: 160px !important; font-weight: 600; }
.tx-toolbar-spacer { flex: 1 1 auto; }
@media (max-width: 900px) {
  .tx-toolbar { flex-wrap: wrap; }
  .tx-toolbar .tx-fld { flex: 1 1 auto; min-width: 130px; }
  .tx-toolbar-spacer { display: none; }
}


/* User list action buttons — Deposit / Withdraw (2026-04-29) */
.u-act-btn {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 4px 11px; font-size: 11px; font-weight: 700;
  border-radius: 6px; border: 1px solid transparent;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
  margin-right: 3px;
}
.u-act-deposit {
  background: linear-gradient(135deg, rgba(74,222,128,0.18), rgba(16,185,129,0.12));
  color: #4ade80; border-color: rgba(74,222,128,0.4);
}
.u-act-deposit:hover {
  background: linear-gradient(135deg, rgba(74,222,128,0.32), rgba(16,185,129,0.22));
  transform: translateY(-1px); box-shadow: 0 2px 8px rgba(74,222,128,0.25);
}
.u-act-withdraw {
  background: linear-gradient(135deg, rgba(239,68,68,0.18), rgba(220,38,38,0.12));
  color: #ef4444; border-color: rgba(239,68,68,0.4);
}
.u-act-withdraw:hover {
  background: linear-gradient(135deg, rgba(239,68,68,0.32), rgba(220,38,38,0.22));
  transform: translateY(-1px); box-shadow: 0 2px 8px rgba(239,68,68,0.25);
}

/* Detail / Edit / Delete buttons — same u-act-btn size as Deposit/Withdraw */
.u-act-detail {
  background: rgba(99,102,241,0.18); color: #818cf8;
  border-color: rgba(99,102,241,0.4);
}
.u-act-detail:hover {
  background: rgba(99,102,241,0.32); transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}
.u-act-edit {
  background: rgba(245,158,11,0.18); color: #fbbf24;
  border-color: rgba(245,158,11,0.4);
}
.u-act-edit:hover {
  background: rgba(245,158,11,0.32); transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(245,158,11,0.25);
}
.u-act-delete {
  background: rgba(239,68,68,0.18); color: #ef4444;
  border-color: rgba(239,68,68,0.5);
}
.u-act-delete:hover {
  background: rgba(239,68,68,0.32); transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(239,68,68,0.3);
}


/* ── tq-modal redesign (2026-04-29) ── */
.tq-modal-card { background: var(--surface); border:1px solid var(--border); }
.tq-modal-header {
  padding: 18px 22px; color:#fff; position:relative;
  background: linear-gradient(135deg,#10b981 0%,#059669 100%);
}
.tq-modal-header.tq-h-deposit {
  background: linear-gradient(135deg,#10b981 0%,#059669 100%);
}
.tq-modal-header.tq-h-withdraw {
  background: linear-gradient(135deg,#ef4444 0%,#b91c1c 100%);
}
.tq-modal-header.tq-h-bonus {
  background: linear-gradient(135deg,#a855f7 0%,#7c3aed 100%);
}
.tq-h-title { font-size: 18px; font-weight: 800; letter-spacing: 0.5px; }
.tq-h-sub { font-size: 11px; opacity: 0.9; margin-top: 2px; }
.tq-modal-x {
  background: rgba(255,255,255,0.15); border: none; color: #fff;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  font-size: 16px; line-height: 1; transition: background 0.15s;
}
.tq-modal-x:hover { background: rgba(255,255,255,0.3); }

.tq-userpill {
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(135deg,rgba(99,102,241,0.08),rgba(99,102,241,0.03));
  border: 1px solid rgba(99,102,241,0.3); border-radius: 10px; padding: 10px 14px;
}
.tq-userpill-label { font-size: 9px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.6px; }
.tq-userpill-name { font-size: 14px; font-weight: 700; color: var(--text); margin-top: 2px; }
.tq-userpill-id { font-size: 13px; font-family: monospace; color: var(--accent); margin-top: 2px; }

.tq-amt-label { font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600; }
.tq-amt-input {
  width: 100%; max-width: 280px; margin-top: 8px;
  font-size: 32px !important; font-weight: 800; text-align: center;
  letter-spacing: 1.5px; padding: 14px 12px !important;
  background: rgba(0,0,0,0.3) !important; border: 2px solid var(--border) !important;
  border-radius: 12px !important; color: var(--gold,#fbbf24) !important;
  font-family: 'Oswald', 'Impact', system-ui, sans-serif !important;
}
.tq-amt-input:focus {
  border-color: var(--gold,#fbbf24) !important;
  box-shadow: 0 0 0 3px rgba(251,191,36,0.15) !important;
  outline: none;
}

.tq-quick-row {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 12px;
}
.tq-quick-amt {
  padding: 8px 4px; font-size: 12px; font-weight: 700;
  background: rgba(251,191,36,0.12); color: var(--gold,#fbbf24);
  border: 1px solid rgba(251,191,36,0.4); border-radius: 8px;
  cursor: pointer; transition: all 0.15s;
}
.tq-quick-amt:hover {
  background: rgba(251,191,36,0.28); transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(251,191,36,0.25);
}

.tq-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.tq-fld-lbl {
  display: block; font-size: 10px; color: var(--text2);
  text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600;
  margin-bottom: 4px;
}

.tq-submit-btn {
  background: linear-gradient(135deg,var(--gold,#fbbf24),#d97706);
  border: none; color: #000;
}
.tq-submit-btn:hover {
  filter: brightness(1.1); transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(251,191,36,0.3);
}

@media (max-width: 480px) {
  .tq-grid2 { grid-template-columns: 1fr; }
  .tq-quick-row { grid-template-columns: repeat(3, 1fr); }
}


/* ── User Detail modal redesign (2026-04-29) — fintech 风 ── */
.ud-modal-card {
  background: var(--surface);
  border: 1px solid rgba(99,102,241,0.3);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.ud-hero {
  position: relative; padding: 22px 28px;
  background: linear-gradient(135deg,#6366f1 0%,#8b5cf6 50%,#fbbf24 100%);
  background-size: 200% auto; animation: ud-flow 8s linear infinite;
  color: #fff; overflow: hidden;
}
@keyframes ud-flow { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
.ud-hero-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at top right, rgba(255,255,255,0.18), transparent 50%);
  pointer-events: none;
}
.ud-hero-content {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; align-items: center;
}
.ud-hero-eyebrow {
  font-size: 10px; text-transform: uppercase; letter-spacing: 2.5px;
  opacity: 0.85; font-weight: 600;
}
.ud-hero-title {
  font-size: 26px; font-weight: 900; letter-spacing: 0.5px; margin-top: 4px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.ud-close {
  background: rgba(255,255,255,0.18); border: none; color: #fff;
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  font-size: 18px; line-height: 1; transition: all 0.15s;
}
.ud-close:hover {
  background: rgba(255,255,255,0.35); transform: scale(1.08);
}

.ud-body { padding: 22px 28px; max-height: 75vh; overflow-y: auto; }
.ud-section-label {
  font-size: 12px; font-weight: 700; color: var(--gold,#fbbf24);
  text-transform: uppercase; letter-spacing: 1.2px;
  margin-bottom: 10px; padding-bottom: 6px;
  border-bottom: 1px solid rgba(251,191,36,0.2);
}

.ud-stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.ud-stats-grid .dash-card {
  background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(99,102,241,0.02)) !important;
  border: 1px solid rgba(99,102,241,0.18) !important;
  border-radius: 10px !important;
  padding: 12px 14px !important;
  transition: all 0.15s;
}
.ud-stats-grid .dash-card:hover {
  border-color: rgba(99,102,241,0.4) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(99,102,241,0.15);
}
.ud-stats-grid .card-label {
  font-size: 10px !important; color: var(--text-dim,#9ca3af) !important;
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
}
.ud-stats-grid .card-value {
  font-size: 18px !important; font-weight: 800 !important;
  margin-top: 4px; display: block;
}

.ud-tablewrap {
  background: rgba(0,0,0,0.2); border: 1px solid var(--border);
  border-radius: 10px; max-height: 260px; overflow: auto;
}
.ud-table { font-size: 12px; width: 100%; }
.ud-table thead th {
  background: rgba(99,102,241,0.08); color: var(--text-dim,#9ca3af);
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 10px 12px; position: sticky; top: 0; z-index: 1;
}
.ud-table tbody td { padding: 9px 12px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.ud-table tbody tr:hover { background: rgba(99,102,241,0.05); }

@media (max-width: 640px) {
  .ud-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .ud-hero-title { font-size: 20px; }
  .ud-body { padding: 16px 18px; }
}

/* ── Account Settings v2 (2026-04-29) — labeled inputs, user cards, compact logs ── */
.set2-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 14px; }
.set2-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.set2-label { font-size: 11px; font-weight: 600; color: var(--text2); letter-spacing: 0.3px; text-transform: uppercase; }
.set2-actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.set2-actions .btn-send { padding: 8px 18px; font-size: 12px; }

/* Password input wrapper with eye toggle */
.set2-pw-wrap { position: relative; display: flex; }
.set2-pw-wrap .settings-input { padding-right: 36px; }
.set2-pw-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; cursor: pointer;
  font-size: 14px; color: var(--text2); padding: 4px 8px; border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.set2-pw-eye:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.set2-pw-strength {
  margin-top: 6px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden;
}
.set2-pw-strength > span {
  display: block; height: 100%; width: 0; transition: width 0.2s, background 0.2s; background: var(--danger);
}
.set2-pw-strength[data-level="1"] > span { width: 25%; background: #ef4444; }
.set2-pw-strength[data-level="2"] > span { width: 50%; background: #f59e0b; }
.set2-pw-strength[data-level="3"] > span { width: 75%; background: #6366f1; }
.set2-pw-strength[data-level="4"] > span { width: 100%; background: #10b981; }
.set2-pw-hint { font-size: 10px; color: var(--text2); margin-top: 4px; }

/* User card grid */
.au-card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px; max-height: 420px; overflow-y: auto; padding-right: 2px;
}
.au-card {
  position: relative; padding: 12px 14px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.au-card:hover {
  border-color: var(--accent); transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.au-card.au-card-self { border-color: var(--accent2); }
.au-card.au-card-frozen { opacity: 0.65; }
.au-card-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.au-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px; letter-spacing: 0.5px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
}
.au-avatar.r-0 { background: linear-gradient(135deg, #ef4444, #dc2626); } /* Developer */
.au-avatar.r-1 { background: linear-gradient(135deg, #f59e0b, #d97706); } /* Master */
.au-avatar.r-2 { background: linear-gradient(135deg, #6366f1, #4f46e5); } /* Major */
.au-avatar.r-3 { background: linear-gradient(135deg, #06b6d4, #0891b2); } /* Minor */
.au-avatar.r-4 { background: linear-gradient(135deg, #10b981, #059669); } /* Senior */
.au-avatar.r-5 { background: linear-gradient(135deg, #94a3b8, #64748b); } /* Junior */
.au-card-name-wrap { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.au-name { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-username { font-size: 11px; color: var(--text2); font-family: ui-monospace, monospace; }
.au-role-pill {
  align-self: flex-start; padding: 3px 9px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
  white-space: nowrap;
}
.au-role-pill.r-0 { background: rgba(239,68,68,0.16); color: #ef4444; }
.au-role-pill.r-1 { background: rgba(245,158,11,0.16); color: #f59e0b; }
.au-role-pill.r-2 { background: rgba(99,102,241,0.16); color: #818cf8; }
.au-role-pill.r-3 { background: rgba(6,182,212,0.16); color: #22d3ee; }
.au-role-pill.r-4 { background: rgba(16,185,129,0.16); color: #10b981; }
.au-role-pill.r-5 { background: rgba(148,163,184,0.16); color: #94a3b8; }
.au-meta { font-size: 11px; color: var(--text2); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.au-meta-row { display: flex; gap: 6px; align-items: center; min-width: 0; }
.au-meta-row > span:not(.au-icon) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-icon { color: var(--text2); opacity: 0.6; flex-shrink: 0; width: 14px; text-align: center; }
.au-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.au-chip {
  font-size: 10px; padding: 2px 8px; border-radius: 999px;
  background: rgba(99,102,241,0.13); color: #818cf8; font-weight: 500;
}
.au-chip.au-chip-co { background: rgba(168,85,247,0.13); color: #c084fc; }
.au-chip.au-chip-brand { background: rgba(16,185,129,0.13); color: #34d399; }
.au-chip-empty { color: var(--text2); font-size: 10px; font-style: italic; }
.au-self-badge {
  font-size: 9px; padding: 2px 6px; border-radius: 4px;
  background: rgba(16,185,129,0.18); color: #10b981; font-weight: 700;
  letter-spacing: 0.3px; margin-left: 4px;
}
.au-frozen-badge {
  font-size: 9px; padding: 2px 6px; border-radius: 4px;
  background: rgba(239,68,68,0.18); color: #ef4444; font-weight: 700;
  letter-spacing: 0.3px;
}
.au-last-login { font-size: 10px; color: var(--text2); display: flex; align-items: center; gap: 4px; }
.au-last-login.au-online { color: #10b981; font-weight: 600; }
.au-last-login.au-online::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #10b981; }
.au-card-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding-top: 8px; border-top: 1px solid var(--border);
  opacity: 0.55; transition: opacity 0.15s;
}
.au-card:hover .au-card-actions { opacity: 1; }
.au-card-actions button {
  padding: 4px 10px; font-size: 11px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--text2);
  transition: all 0.12s;
}
.au-card-actions button:hover { border-color: var(--accent); color: var(--text); background: rgba(99,102,241,0.08); }
.au-card-actions button.btn-danger:hover { border-color: var(--danger); color: var(--danger); background: rgba(239,68,68,0.08); }
.au-card-actions button.au-unfreeze { border-color: var(--accent2); color: var(--accent2); }
.au-card-actions button.au-unfreeze:hover { background: var(--accent2); color: #fff; }

/* Add-user card (dashed) */
.au-add-card {
  border: 2px dashed var(--border); background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; min-height: 130px; flex-direction: column; gap: 6px;
  color: var(--text2); transition: all 0.15s;
}
.au-add-card:hover { border-color: var(--accent); color: var(--accent); transform: none; box-shadow: none; }
.au-add-icon { font-size: 28px; line-height: 1; }
.au-add-label { font-size: 12px; font-weight: 600; }

/* Form panel (new-user / edit-user) */
.au-form-panel {
  margin-top: 12px; padding: 16px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px;
  display: flex; flex-direction: column; gap: 10px;
}
.au-form-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.au-form-block { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.au-chip-checks { display: flex; flex-wrap: wrap; gap: 10px; }
.au-brand-wrap { display: flex; flex-direction: column; gap: 8px; width: 100%; }

/* Compact log v2 */
.alog2-list { display: flex; flex-direction: column; gap: 2px; max-height: 360px; overflow-y: auto; margin-top: 6px; padding-right: 2px; }
.alog2-day { font-size: 10px; font-weight: 700; color: var(--text2); letter-spacing: 0.5px; text-transform: uppercase; padding: 8px 4px 4px; position: sticky; top: 0; background: var(--surface, var(--bg)); z-index: 1; }
.alog2-row {
  display: grid;
  grid-template-columns: 60px 110px 1fr 70px 16px;
  align-items: center; gap: 10px; padding: 6px 10px;
  background: var(--bg); border-radius: 6px; font-size: 12px;
  cursor: pointer; transition: background 0.12s;
  border: 1px solid transparent;
}
.alog2-row:hover { background: rgba(99,102,241,0.06); border-color: var(--border); }
.alog2-row.alog2-fail { border-left: 3px solid var(--danger); padding-left: 8px; }
.alog2-row.alog2-expanded { background: rgba(99,102,241,0.06); border-color: var(--border); }
.alog2-time { color: var(--text2); font-family: ui-monospace, monospace; font-size: 11px; }
.alog2-actor { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alog2-body { display: flex; gap: 6px; align-items: center; min-width: 0; }
.alog2-action {
  font-size: 10px; padding: 2px 8px; border-radius: 999px;
  background: rgba(99,102,241,0.13); color: #818cf8; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
}
.alog2-target { font-size: 11px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alog2-status { font-size: 10px; padding: 2px 8px; border-radius: 999px; font-weight: 700; text-align: center; }
.alog2-status.ok { background: rgba(16,185,129,0.13); color: #10b981; }
.alog2-status.err { background: rgba(239,68,68,0.13); color: #ef4444; }
.alog2-arrow { color: var(--text2); font-size: 10px; transition: transform 0.15s; text-align: center; }
.alog2-row.alog2-expanded .alog2-arrow { transform: rotate(90deg); }
.alog2-detail {
  padding: 10px 14px 12px; font-size: 11px; color: var(--text2);
  background: var(--bg); border-radius: 0 0 6px 6px;
  border: 1px solid var(--border); border-top: none; margin-top: -2px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 14px;
}
.alog2-detail dt { color: var(--text2); font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 1px; }
.alog2-detail dd { color: var(--text); font-family: ui-monospace, monospace; font-size: 11px; word-break: break-all; margin: 0 0 4px; }
.alog2-detail-json { grid-column: 1 / -1; }
.alog2-detail-json dd { color: var(--text2); white-space: pre-wrap; }

@media (max-width: 720px) {
  .set2-grid { grid-template-columns: 1fr; }
  .alog2-row { grid-template-columns: 60px 1fr 60px 16px; }
  .alog2-actor { display: none; }
}

/* ── Account Settings v3 (2026-04-29) — left-nav shell, tabbed content ── */
.set3-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  min-height: 540px;
  max-height: calc(90vh - 60px);
}
.set3-nav {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 10px 14px 4px;
  border-right: 1px solid var(--border);
  background: rgba(0,0,0,0.12);
}
.set3-nav-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border: none; background: transparent;
  color: var(--text2); font-size: 13px; font-weight: 500;
  cursor: pointer; text-align: left; border-radius: 8px;
  transition: background 0.12s, color 0.12s;
  font-family: inherit;
}
.set3-nav-btn:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.set3-nav-btn.active {
  background: rgba(99,102,241,0.13); color: var(--accent);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}
.set3-nav-icon { font-size: 16px; line-height: 1; flex-shrink: 0; width: 20px; text-align: center; }
.set3-nav-label { flex: 1; min-width: 0; }
.set3-nav-badge {
  font-size: 10px; padding: 1px 7px; border-radius: 999px;
  background: rgba(255,255,255,0.06); color: var(--text2); font-weight: 600;
}
.set3-content {
  padding: 22px 28px;
  overflow-y: auto;
  min-width: 0;
  display: flex; flex-direction: column; gap: 22px;
}
.set3-pane { display: none; }
.set3-pane.active { display: flex; flex-direction: column; gap: 22px; animation: set3-fade 0.18s ease; }
@keyframes set3-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.set3-pane-head { display: flex; align-items: baseline; gap: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.set3-pane-title { font-size: 16px; font-weight: 700; color: var(--text); margin: 0; }
.set3-pane-hint { font-size: 11px; color: var(--text2); }
.set3-pane > .settings-section {
  border-bottom: none; padding: 0;
}
.set3-pane > .settings-section:not(:first-child) { padding-top: 6px; border-top: 1px solid var(--border); padding-top: 18px; }

/* Logs sub-tab segmented inside Logs pane */
.set3-segmented {
  display: inline-flex; padding: 3px;
  background: rgba(0,0,0,0.18); border: 1px solid var(--border); border-radius: 8px;
}
.set3-seg-btn {
  padding: 6px 16px; border: none; background: transparent;
  color: var(--text2); font-size: 12px; font-weight: 600; cursor: pointer;
  border-radius: 6px; transition: all 0.12s;
  font-family: inherit;
}
.set3-seg-btn.active { background: var(--accent); color: #fff; }
.set3-seg-btn:not(.active):hover { color: var(--text); }

/* Bigger user grid now that we have 800+px width */
.set3-pane .au-card-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); max-height: none; }

@media (max-width: 760px) {
  .set3-shell { grid-template-columns: 1fr; min-height: 0; }
  .set3-nav {
    flex-direction: row; gap: 6px; padding: 10px 12px;
    border-right: none; border-bottom: 1px solid var(--border);
    overflow-x: auto; white-space: nowrap;
  }
  .set3-nav-btn { flex-shrink: 0; padding: 8px 12px; font-size: 12px; }
  .set3-nav-btn.active { box-shadow: inset 0 -3px 0 var(--accent); }
  .set3-nav-label { display: none; }
  .set3-nav-icon { width: auto; }
  .set3-nav-btn.active .set3-nav-label { display: inline; }
  .set3-content { padding: 16px; }
}

/* ── v3.1 Humanize touches (2026-04-29) ────────────────────────────────────── */
/* Profile hero */
.set3-profile-hero {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px; background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.25); border-radius: 12px;
}
.set3-profile-avatar {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 22px; letter-spacing: 0.5px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  box-shadow: 0 6px 18px rgba(99,102,241,0.35);
}
.set3-profile-avatar.r-0 { background: linear-gradient(135deg, #ef4444, #dc2626); }
.set3-profile-avatar.r-1 { background: linear-gradient(135deg, #f59e0b, #d97706); }
.set3-profile-avatar.r-2 { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.set3-profile-avatar.r-3 { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.set3-profile-avatar.r-4 { background: linear-gradient(135deg, #10b981, #059669); }
.set3-profile-avatar.r-5 { background: linear-gradient(135deg, #94a3b8, #64748b); }
.set3-profile-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.set3-profile-name { font-size: 18px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set3-profile-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Required / optional markers */
.set2-required { color: var(--danger); font-weight: 700; margin-left: 2px; }
.set2-optional {
  font-size: 9px; color: var(--text2); font-weight: 400;
  text-transform: none; letter-spacing: 0; padding: 1px 6px;
  background: rgba(255,255,255,0.04); border-radius: 4px; margin-left: 4px;
}

/* Dirty indicator on save row */
.set2-dirty {
  font-size: 11px; color: #f59e0b; font-weight: 600;
  padding: 3px 10px; background: rgba(245,158,11,0.13);
  border-radius: 999px; animation: set3-pulse 1.4s ease-in-out infinite;
}
@keyframes set3-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
.btn-send.set2-dirty-btn::after {
  content: " ●"; color: #fbbf24; font-size: 14px;
}

/* Password rule checklist (replaces strength bar) */
.set2-pw-list {
  list-style: none; padding: 0; margin: 8px 0 0;
  display: flex; flex-direction: column; gap: 4px;
}
.set2-pw-list li {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--text2);
  transition: color 0.15s;
}
.set2-pw-list li .pw-rule-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  font-size: 11px; font-weight: 700;
  background: rgba(148,163,184,0.18); color: var(--text2);
  flex-shrink: 0; transition: all 0.18s;
}
.set2-pw-list li.pw-pass { color: #10b981; font-weight: 500; }
.set2-pw-list li.pw-pass .pw-rule-mark {
  background: #10b981; color: #fff;
}
.set2-pw-list li.pw-pass .pw-rule-mark::before { content: "✓"; }
.set2-pw-list li:not(.pw-pass) .pw-rule-mark::before { content: ""; }

/* Empty state for log lists */
.alog2-empty {
  padding: 36px 14px; text-align: center;
  color: var(--text2); font-size: 12px;
  border: 1px dashed var(--border); border-radius: 10px;
  background: rgba(0,0,0,0.08);
  margin-top: 8px;
}
.alog2-empty-icon { font-size: 28px; opacity: 0.6; margin-bottom: 8px; line-height: 1; }
.alog2-empty-title { font-size: 13px; color: var(--text); font-weight: 600; margin-bottom: 4px; }

/* Role pill tooltip (uses native title attribute, but boost visibility on hover) */
.au-role-pill[title] { cursor: help; }

/* === Mobile (≤768px): unlock body scroll trapped by html/body overflow:hidden === */
@media (max-width: 768px) {
  html, body {
    overflow: auto !important;
    height: auto !important;
    min-height: 100%;
    -webkit-overflow-scrolling: touch;
  }
  /* Wide data tables: allow horizontal scroll */
  .data-table-wrapper,
  .table-wrap,
  table {
    overflow-x: auto !important;
    max-width: 100% !important;
    -webkit-overflow-scrolling: touch;
  }
  /* Fixed-height internal scroll containers: relax to natural flow */
  .task-list-wrapper,
  .admin-user-list,
  .admin-log-list,
  .task-detail-timeline {
    max-height: none !important;
    overflow: visible !important;
  }
  /* Nav rows: allow horizontal scroll instead of wrapping into multiple lines */
  nav,
  .top-nav,
  .tab-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }
}

/* === Mobile: company/dept/platform bars horizontal scroll === */
@media (max-width: 768px) {
  .company-bar,
  .dept-bar,
  .platform-bar {
    overflow-x: auto !important;
    overflow-y: hidden;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .company-bar::-webkit-scrollbar,
  .dept-bar::-webkit-scrollbar,
  .platform-bar::-webkit-scrollbar { height: 3px; }
  .company-btn,
  .dept-btn,
  .platform-btn {
    flex-shrink: 0 !important;
    white-space: nowrap;
  }
  /* Sticky labels eat space — hide on mobile */
  .platform-label { display: none; }
}

/* ========================================================
   Settings v3.2 — D+C+A: defaults inheritance, templates,
   live permission matrix
   ======================================================== */

.au-form-sub {
  display: inline-block;
  margin-left: 10px;
  font-size: 11px;
  font-weight: 400;
  color: var(--text2);
  text-transform: none;
  letter-spacing: 0;
}

/* Template bar (C) */
.au-template-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(255,184,0,0.06), rgba(255,184,0,0.02));
  border: 1px solid rgba(255,184,0,0.20);
  border-radius: 10px;
}
.au-template-icon { font-size: 16px; }
.au-template-select {
  flex: 1;
  max-width: 380px;
  padding: 7px 10px;
  font-size: 13px;
}
.au-template-reset {
  padding: 7px 12px;
  font-size: 12px;
  white-space: nowrap;
}

/* per-company group toggle btn */
.au-group-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10px;
  cursor: pointer;
  margin-left: 8px;
  transition: all .15s;
}
.au-group-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255,184,0,0.06);
}

/* Permission Matrix (A) */
.au-perm-matrix {
  margin-top: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(70,140,255,0.05), rgba(70,140,255,0.01));
  border: 1px solid rgba(70,140,255,0.18);
  border-radius: 12px;
}
.au-perm-head {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}
.au-perm-sub {
  display: inline-block;
  margin-left: 8px;
  font-size: 10px;
  font-weight: 400;
  color: var(--text2);
  letter-spacing: 0;
}
.au-perm-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
}
@media (max-width: 720px) {
  .au-perm-body { grid-template-columns: 1fr; }
}
.au-perm-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.au-perm-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text2);
  font-weight: 600;
}
.au-perm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.au-perm-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(70,140,255,0.12);
  color: #6fb0ff;
  border: 1px solid rgba(70,140,255,0.22);
}
.au-perm-chip.empty {
  background: rgba(255,80,80,0.08);
  color: #ff8080;
  border-color: rgba(255,80,80,0.20);
}
.au-perm-chip.co-demogroup-co  { background: rgba(255,184,0,0.12); color: #ffc94d; border-color: rgba(255,184,0,0.25); }
.au-perm-chip.co-inb-co    { background: rgba(180,120,255,0.12); color: #c89bff; border-color: rgba(180,120,255,0.25); }
.au-perm-chip.co-boleh-co  { background: rgba(80,200,140,0.12); color: #7adba8; border-color: rgba(80,200,140,0.25); }

.au-perm-cap-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.au-perm-cap-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
}
.au-perm-cap-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}
.au-perm-cap-icon.yes { background: rgba(80,200,140,0.18); color: #7adba8; }
.au-perm-cap-icon.no  { background: rgba(255,80,80,0.12); color: #ff8080; }
.au-perm-cap-row.no .au-perm-cap-text { color: var(--text2); text-decoration: line-through; opacity: 0.6; }

.au-perm-tab-hint {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.18);
  border-radius: 8px;
  font-size: 11px;
  color: var(--text2);
  line-height: 1.5;
  grid-column: 1 / -1;
}
.au-perm-tab-hint b { color: var(--accent); font-weight: 600; }

/* ============================================================
   v3.3 — Wave 1 P2 quick wins (2026-05-02)
   ============================================================ */

/* #3 btn-send fix — was fixed 36×36 forcing text to wrap vertically */
.btn-send {
  width: auto;
  min-width: 36px;
  padding: 0 14px;
  white-space: nowrap;
  gap: 6px;
}
.btn-send.icon-only,
button.btn-send:has(svg:only-child) {
  width: 36px;
  padding: 0;
}
/* fallback for browsers w/o :has — apply to known icon-only buttons */
#claude-send, #cc-send, #group-send, #openclaw-send {
  width: 36px;
  padding: 0;
}

/* #11 brand logo uniform sizing */
.platform-btn img,
.platform-btn .platform-logo,
.platform-btn svg {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.platform-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}

/* #13 modal X (uses literal text "X") — restyle as proper close icon */
.modal-close {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text2);
  width: 28px;
  height: 28px;
  font-size: 18px;
  line-height: 1;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
}
.modal-close:hover {
  border-color: var(--border);
  background: rgba(255,80,80,0.08);
  color: #ff7a7a;
}
/* Render ASCII X glyph as a real ✕ via pseudo */
.modal-close { font-size: 0; }
.modal-close::before {
  content: "\2715";  /* ✕ */
  font-size: 18px;
  font-weight: 600;
}

/* #8 Empty state component — replaces bare "No X" text */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty-state-icon {
  font-size: 36px;
  opacity: 0.55;
}
.empty-state-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 4px 0 0;
}
.empty-state-msg {
  font-size: 12px;
  max-width: 360px;
  line-height: 1.5;
}
.empty-state-cta {
  margin-top: 10px;
  padding: 8px 18px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.empty-state-cta:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

/* #10 ping-pill — hide for non-dev (role > 0) */
body[data-role-num]:not([data-role-num="0"]) #ping-indicator {
  display: none !important;
}

/* #9 User menu — collapse lang/theme/settings/logout into dropdown */
.header-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}
#user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: 999px;
  transition: all .15s;
  font-size: 13px;
}
#user-menu-trigger:hover { border-color: var(--border); background: rgba(255,255,255,0.04); }
#user-menu-trigger .um-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 12px;
}
#user-menu-trigger .um-caret {
  font-size: 10px;
  opacity: 0.6;
}
#user-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--surface, #1f2937);
  border: 1px solid var(--border, #374151);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  padding: 8px;
  z-index: 9999;
  display: none;
}
#user-menu-dropdown.open { display: block; }
.um-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.um-row:hover { background: rgba(255,255,255,0.06); }
.um-row .um-icon { font-size: 16px; width: 20px; text-align: center; }
.um-divider { height: 1px; background: var(--border); margin: 6px 4px; }
.um-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text2);
  padding: 4px 12px;
}
.um-select-wrap {
  padding: 4px 12px;
}
.um-select-wrap select {
  width: 100%;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
}
/* When dropdown active, hide the originals (they live inside dropdown now) */
.header-user.dropdown-mode > #lang-select,
.header-user.dropdown-mode > #theme-select,
.header-user.dropdown-mode > #settings-btn,
.header-user.dropdown-mode > #logout-btn,
.header-user.dropdown-mode > #header-username { display: none !important; }

/* #16 top-nav — hide Scripts / 系统体检 / 情报 from non-admin */
body[data-role-num]:not([data-role-num="0"]):not([data-role-num="1"]) .tab-btn[data-tab="scripts"],
body[data-role-num="2"] .tab-btn[data-tab="scripts"],
body[data-role-num="3"] .tab-btn[data-tab="scripts"],
body[data-role-num="4"] .tab-btn[data-tab="scripts"],
body[data-role-num="5"] .tab-btn[data-tab="scripts"] {
  display: none !important;
}

/* #12 跨品牌视图 row — relocate the floating button to be inline */
.cross-brand-view-row {
  padding: 0 !important;
  min-height: 0 !important;
  background: transparent !important;
  border: none !important;
}
.cross-brand-view-row .leaderboard-btn {
  position: absolute;
  top: 4px;
  right: 8px;
  z-index: 5;
}

/* #2 Welcome modal — first-visit-only behavior */
.onboarding-overlay.dismissed,
#onboarding-overlay.dismissed,
.welcome-modal.dismissed,
[class*="onboard"][hidden] { display: none !important; }


/* ============================================================
   v3.4 — Wave 2 Mobile responsive (2026-05-02)
   ============================================================ */

/* Container max width — never overflow viewport */
html, body { max-width: 100vw; overflow-x: hidden; }
.app-container, .main-container, .root-container { max-width: 100vw; }

/* Mobile breakpoint */
@media (max-width: 760px) {
  /* Header — compact */
  header {
    flex-wrap: wrap;
    padding: 8px 10px !important;
    gap: 6px !important;
  }
  .logo {
    font-size: 14px !important;
    flex: 0 1 auto;
  }
  header > nav {
    order: 99;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    gap: 4px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  header > nav .tab-btn {
    flex-shrink: 0;
    font-size: 12px !important;
    padding: 6px 10px !important;
  }
  /* pm-header-slot -> hide on mobile (replaced by user menu drawer) */
  #pm-header-slot { display: none !important; }
  .header-user { margin-left: auto; }
  #user-menu-trigger { padding: 2px 6px 2px 2px !important; }
  #user-menu-trigger .um-name { display: none; }
  #header-bell { margin-right: 4px !important; }

  /* Tab bars — make horizontally scrollable instead of wrapping */
  .company-bar, .platform-bar, .dept-bar, .data-sub-bar, .sub-tab-bar {
    overflow-x: auto !important;
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    padding: 6px 8px !important;
    gap: 4px !important;
    scrollbar-width: thin;
  }
  .company-bar::-webkit-scrollbar,
  .platform-bar::-webkit-scrollbar,
  .dept-bar::-webkit-scrollbar,
  .data-sub-bar::-webkit-scrollbar { height: 2px; }
  .company-btn, .platform-btn, .dept-btn, .data-sub-btn {
    flex-shrink: 0 !important;
    font-size: 12px !important;
    padding: 5px 10px !important;
    min-height: 28px !important;
  }
  .company-bar > span, .platform-bar > span, .dept-bar > span,
  .company-bar::before, .platform-bar::before, .dept-bar::before {
    display: none !important;  /* hide "公司:" / "品牌:" / "部门:" labels on mobile */
  }
  .cross-brand-view-row { display: none !important; }

  /* Settings modal full-screen on mobile */
  .modal-overlay > .modal {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  .set3-shell { flex-direction: column !important; height: 100% !important; }
  .set3-nav {
    flex-direction: row !important;
    overflow-x: auto !important;
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 6px !important;
    gap: 4px !important;
  }
  .set3-nav-btn {
    flex-shrink: 0 !important;
    flex-direction: row !important;
    padding: 6px 10px !important;
  }
  .set3-nav-label { display: inline !important; font-size: 12px !important; }
  .set3-content { padding: 12px !important; max-height: calc(100vh - 60px) !important; overflow-y: auto !important; }

  /* Tables — horizontal scroll wrapper */
  table { display: block; overflow-x: auto; white-space: nowrap; }

  /* Form fields full width */
  .set2-grid { grid-template-columns: 1fr !important; }

  /* KPI cards stack */
  #dv-dashboard > div, .dash-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .dash-kpi-card, .kpi-card {
    padding: 12px !important;
    font-size: 12px !important;
  }

  /* Chat sidebars full width */
  .sidebar, .chat-list-sidebar { width: 100% !important; max-width: none !important; }

  /* Hide obviously dev-only elements on mobile to declutter */
  #ping-indicator, #self-check-tab-btn, #intel-tab-btn { display: none !important; }
}

/* Tablet (760-1024) */
@media (min-width: 761px) and (max-width: 1024px) {
  .company-bar, .platform-bar, .dept-bar, .data-sub-bar {
    flex-wrap: wrap !important;
  }
  .set3-shell { gap: 0 !important; }
  .set3-nav { width: 180px !important; }
}

/* ============================================================
   v3.5 — Wave 3 Dashboard health strip + critical alerts (additive)
   ============================================================ */
.dash-w3-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}
.dash-w3-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}
@media (max-width: 760px) { .dash-w3-row { grid-template-columns: 1fr; } }

.dash-w3-card {
  background: linear-gradient(135deg, rgba(70,140,255,0.04), rgba(70,140,255,0.01));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.dash-w3-card.alerts {
  background: linear-gradient(135deg, rgba(255,80,80,0.06), rgba(255,80,80,0.02));
  border-color: rgba(255,80,80,0.20);
}
.dash-w3-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text2);
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dash-w3-title .count {
  background: var(--accent);
  color: white;
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: auto;
}
.dash-w3-title .count.zero { background: rgba(80,200,140,0.28); color: #7adba8; }
.dash-w3-title .count.high { background: #ef4444; }

/* Brand health lights grid */
.dash-brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.dash-brand-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.18);
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
  border: 1px solid transparent;
}
.dash-brand-tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.dash-brand-light {
  width: 8px; height: 8px; border-radius: 50%;
  background: #7adba8; box-shadow: 0 0 8px rgba(122,219,168,0.4);
  flex-shrink: 0;
}
.dash-brand-light.warn { background: #fbbf24; box-shadow: 0 0 8px rgba(251,191,36,0.4); }
.dash-brand-light.bad  { background: #ef4444; box-shadow: 0 0 8px rgba(239,68,68,0.4); }
.dash-brand-light.unknown { background: #6b7280; box-shadow: none; }
.dash-brand-name {
  font-size: 12px; font-weight: 600; color: var(--text); flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-brand-meta { font-size: 10px; color: var(--text2); }

/* Critical alerts list */
.dash-alert-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.dash-alert-item {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 8px 10px;
  background: rgba(0,0,0,0.18);
  border-left: 3px solid #ef4444;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.4;
}
.dash-alert-item.warn { border-left-color: #fbbf24; }
.dash-alert-item.info { border-left-color: var(--accent); }
.dash-alert-item .ai-time { color: var(--text2); font-size: 10px; flex-shrink: 0; }
.dash-alert-item .ai-msg { color: var(--text); }
.dash-alert-empty {
  text-align: center; padding: 20px;
  color: var(--text2); font-size: 12px;
}

/* ============================================================
   v3.6 — P3-B Sidebar (2026-05-02)
   Coexists with old top-tab UI; toggle via #wl-sidebar-toggle
   ============================================================ */
:root { --wl-sb-w: 240px; }

#wl-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--wl-sb-w);
  background: linear-gradient(180deg, #0f1729 0%, #0a1020 100%);
  border-right: 1px solid var(--border, #1f2937);
  z-index: 80;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 4px 0 20px rgba(0,0,0,0.3);
}
body.sidebar-mode #wl-sidebar { display: flex; }

/* Push main content right when sidebar active */
@media (min-width: 761px) {
  body.sidebar-mode > .app-container,
  body.sidebar-mode > .container,
  body.sidebar-mode > main,
  body.sidebar-mode header,
  body.sidebar-mode .tab-panel,
  body.sidebar-mode .modal-overlay {
    margin-left: var(--wl-sb-w);
    transition: margin-left .2s;
  }
  body.sidebar-mode #wl-sidebar-mobile-toggle { display: none; }
  /* Hide top company/brand/dept/sub-tab bars in sidebar mode */
  body.sidebar-mode .company-bar,
  body.sidebar-mode .platform-bar,
  body.sidebar-mode .dept-bar,
  body.sidebar-mode .data-sub-bar { display: none !important; }
  /* Header narrows */
  body.sidebar-mode header > nav { display: none; }
  body.sidebar-mode header .logo { display: none; }
  /* Show "侧边栏" hide button in header (it's actually the close in sidebar) */
}

/* Sidebar head */
.wl-sb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
}
.wl-sb-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text2);
  text-transform: uppercase;
}
.wl-sb-toggle {
  font-size: 11px;
  padding: 4px 10px;
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
}
.wl-sb-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* Brand picker */
.wl-sb-brand-pick {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.wl-sb-pick-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text2);
  margin-bottom: 6px;
}
.wl-sb-brand-select {
  width: 100%;
  padding: 8px 10px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border .15s;
}
.wl-sb-brand-select:hover { border-color: var(--accent); }

/* Nav */
.wl-sb-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  scrollbar-width: thin;
}
.wl-sb-nav::-webkit-scrollbar { width: 4px; }
.wl-sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

.wl-sb-section {
  padding: 4px 0;
}
.wl-sb-section + .wl-sb-section { border-top: 1px solid rgba(255,255,255,0.04); margin-top: 4px; padding-top: 8px; }
.wl-sb-section-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text2);
  padding: 4px 16px;
  font-weight: 700;
  opacity: 0.6;
}

.wl-sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: all .12s;
  border-left: 3px solid transparent;
  position: relative;
}
.wl-sb-item:hover {
  background: rgba(99,102,241,0.10);
  color: white;
}
.wl-sb-item.active {
  background: linear-gradient(90deg, rgba(99,102,241,0.18), transparent);
  color: white;
  border-left-color: var(--accent, #6366f1);
}
.wl-sb-item .wl-sb-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.wl-sb-item.bs-admin-item { color: #10b981; font-weight: 600; }
.wl-sb-item.bs-admin-item.active { color: #34d399; border-left-color: #10b981; background: linear-gradient(90deg, rgba(16,185,129,0.18), transparent); }

/* Footer */
.wl-sb-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--text2);
  text-align: center;
  opacity: 0.6;
}

/* Mobile drawer */
.wl-sb-mobile-toggle {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 90;
  width: 36px;
  height: 36px;
  background: var(--surface, #1f2937);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  border-radius: 8px;
  cursor: pointer;
  display: none;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
@media (max-width: 760px) {
  body.sidebar-mode #wl-sidebar {
    transform: translateX(-100%);
    transition: transform .25s;
    width: 80vw;
    max-width: 320px;
  }
  body.sidebar-mode.wl-sb-open #wl-sidebar { transform: translateX(0); display: flex; }
  body.sidebar-mode .wl-sb-mobile-toggle { display: inline-flex; align-items: center; justify-content: center; }
  body.sidebar-mode header { padding-left: 56px !important; }
  /* Mobile content does NOT shift (drawer overlays) */
  body.sidebar-mode > .app-container,
  body.sidebar-mode > main,
  body.sidebar-mode header,
  body.sidebar-mode .tab-panel { margin-left: 0 !important; }
  /* Backdrop */
  body.sidebar-mode.wl-sb-open::after {
    content: "";
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 70;
  }
}

/* When sidebar mode OFF, show no-op (mobile-toggle hidden, header back to normal) */
body:not(.sidebar-mode) #wl-sidebar-mobile-toggle { display: none !important; }

/* P3-B sidebar — additional class names to hide */
@media (min-width: 761px) {
  body.sidebar-mode .sub-tab-bar,
  body.sidebar-mode .cross-brand-view-row,
  body.sidebar-mode .ai-sub-tab-bar { display: none !important; }
}
@media (max-width: 760px) {
  body.sidebar-mode .sub-tab-bar,
  body.sidebar-mode .cross-brand-view-row { display: none !important; }
}

/* P3-B sidebar — override global nav flex-direction */
nav.wl-sb-nav {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
}
.wl-sb-section { display: block; }
.wl-sb-item { display: flex !important; }
.wl-sb-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   v3.7 — #2 Cross-company KPI strip + #7 brand tile KPIs
   ============================================================ */
.dash-w3-agg-card {
  background: linear-gradient(135deg, rgba(124,92,255,0.08), rgba(77,166,255,0.04));
  border: 1px solid rgba(124,92,255,0.20);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 12px;
}
.dash-w3-agg-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.dash-w3-agg-title {
  font-size: 13px; font-weight: 700; color: var(--text);
  letter-spacing: 0.3px;
}
.dash-w3-agg-meta {
  font-size: 10px; color: var(--text2);
  margin-left: auto;
}
.dash-w3-agg-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
@media (max-width: 1024px) { .dash-w3-agg-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px)  { .dash-w3-agg-grid { grid-template-columns: repeat(2, 1fr); } }
.dash-w3-kpi {
  display: flex; flex-direction: column; gap: 2px;
  padding-left: 10px;
  border-left: 2px solid rgba(255,255,255,0.06);
}
.dash-w3-kpi-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text2); font-weight: 600;
}
.dash-w3-kpi-val {
  font-size: 18px; font-weight: 800; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.dash-w3-kpi-val.green { color: #4ade80; }
.dash-w3-kpi-val.red { color: #f87171; }
.dash-w3-kpi-val.blue { color: #60a5fa; }
.dash-w3-kpi-sub {
  font-size: 10px; color: var(--text2);
}

/* Brand tile w/ KPI rows */
.dash-brand-tile {
  flex-direction: column;
  align-items: stretch;
  padding: 10px 12px 8px;
}
.dash-brand-tile-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.dash-brand-name {
  font-size: 13px; font-weight: 700; color: var(--text);
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-brand-kpis {
  display: flex; flex-direction: column; gap: 2px;
}
.bh-kpi-line {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.bh-kpi-k {
  color: var(--text2); font-weight: 600;
  width: 26px; text-align: right;
}
.bh-kpi-v {
  color: var(--text); font-weight: 700;
}
.bh-kpi-v.green { color: #4ade80; }
.bh-kpi-v.red { color: #f87171; }
.bh-kpi-cnt {
  color: var(--text2); font-size: 10px;
}

/* ============================================================
   v3.8 — #6 Bell notification center polish
   ============================================================ */
.bell-fam-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px 4px;
  font-size: 9px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text2);
  font-weight: 700;
  background: rgba(255,255,255,0.02);
  border-top: 1px solid var(--border);
}
.bell-fam-head:first-child { border-top: 0; }
.bell-fam-label { opacity: 0.7; }
.bell-fam-count {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}
.bell-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background .12s;
}
.bell-item:hover { background: color-mix(in srgb, var(--bell-color, var(--accent)) 12%, transparent); }
.bell-item-icon { font-size: 16px; width: 22px; text-align: center; }
.bell-item-label { flex: 1; font-size: 12px; color: var(--text); }
.bell-item-count {
  color: white; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 9px;
}
.bell-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.bell-foot-link {
  font-size: 11px; color: var(--accent);
  text-decoration: none; font-weight: 600;
}
.bell-foot-link:hover { text-decoration: underline; }

/* ============================================================
   v3.9 — #9 Saved filter bar
   ============================================================ */
.saved-filter-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin: 0 0 10px;
  background: linear-gradient(135deg, rgba(255,184,0,0.06), rgba(255,184,0,0.02));
  border: 1px solid rgba(255,184,0,0.18);
  border-radius: 8px;
  font-size: 11px;
}
.sf-label { color: var(--text2); font-weight: 600; }
.sf-select {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  min-width: 140px;
}
.sf-save, .sf-del {
  padding: 3px 10px !important;
  font-size: 11px !important;
}
.sf-del { color: #f87171 !important; }
/* ============================================================
   Platfound UI/UX Phase 1 (P0) — Mz 2026-05-07
   Density · Table polish · Button hierarchy · Sub-tab wrap
   Append-only at end of style.css; nothing above is touched.
   ============================================================ */

/* ─── 1) Information density: more breathing room ──────────── */

/* Card-like containers (BS Admin content area, sub-tab dashboards) */
#bs-adm-content,
.bsa-card,
.tq-detail-grid,
[data-view] > div:first-child {
  /* gentle padding bump where content was crammed against borders */
}

/* BS Admin sub-tab row: wrap to 2 lines instead of squishing */
#dv-bs-admin > div:first-child,
.bs-adm-tab-row {
  flex-wrap: wrap !important;
  gap: 6px;
  padding: 6px 0;
  row-gap: 8px;
}
.bs-adm-tab {
  flex-shrink: 0 !important;
  font-size: 12px;
  padding: 8px 12px !important;
  border-radius: 8px !important;
  transition: background 0.15s, color 0.15s, transform 0.08s;
}
.bs-adm-tab:hover { transform: translateY(-1px); }
.bs-adm-tab.active {
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.5),
              0 4px 16px rgba(251, 191, 36, 0.15);
}

/* Section headers inside views: visible breathing room */
[data-view] h2, [data-view] h3,
#dv-bs-admin h2, #dv-bs-admin h3 {
  margin-top: 18px;
  margin-bottom: 10px;
}

/* ─── 2) Tables: hover + zebra stripes + readable rows ─────── */

.bsa-table,
table.bsa-table,
#bs-adm-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  font-size: 13px;
}

.bsa-table thead th,
#bs-adm-content table thead th {
  background: rgba(251, 191, 36, 0.06);
  color: var(--text);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border2);
  text-align: left;
  white-space: nowrap;
}
.bsa-table thead th.num,
#bs-adm-content table thead th.num { text-align: right; }

.bsa-table tbody td,
#bs-adm-content table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(120, 140, 200, 0.07);
  color: var(--text);
  font-size: 13px;
  vertical-align: middle;
}
.bsa-table tbody td.num,
#bs-adm-content table tbody td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Zebra: subtle odd-row tint */
.bsa-table tbody tr:nth-child(odd) td,
#bs-adm-content table tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.014);
}

/* Hover: gold wash + cursor */
.bsa-table tbody tr:hover td,
#bs-adm-content table tbody tr:hover td {
  background: rgba(251, 191, 36, 0.07);
  cursor: default;
}

/* Last row: no border to avoid double-border with container */
.bsa-table tbody tr:last-child td,
#bs-adm-content table tbody tr:last-child td {
  border-bottom: none;
}

/* Empty row: stays subtle */
.bsa-table tbody tr td[colspan]:only-child {
  text-align: center;
  color: var(--text2);
  padding: 24px 14px;
  font-style: italic;
}

/* ─── 3) Button hierarchy: primary > secondary > danger ────── */

/* Primary action — bigger, gold gradient, prominent */
.btn-gold,
button.btn-gold {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #0b0d14;
  border: none;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.15s, filter 0.15s;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.18);
  white-space: nowrap;
}
.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(251, 191, 36, 0.32);
  filter: brightness(1.08);
}
.btn-gold:active { transform: translateY(0); }
.btn-gold:disabled {
  filter: grayscale(0.6) brightness(0.7);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Secondary — ghost, subtle */
.btn-ghost,
button.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1px solid var(--border2);
  font-weight: 500;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(251, 191, 36, 0.4);
  color: var(--text);
}

/* Row-action buttons (Edit/Del inside table rows): smaller, muted */
.tq-act-btn {
  padding: 5px 11px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border: 1px solid transparent !important;
  transition: all 0.15s;
}

/* Edit (default in tables) — blue tint, not as loud */
button.tq-act-btn:not(.tq-reject):not(.tq-process):not(.tq-complete):not(.tq-accept) {
  background: rgba(59, 130, 246, 0.1) !important;
  color: #60a5fa !important;
  border-color: rgba(59, 130, 246, 0.25) !important;
}
button.tq-act-btn:not(.tq-reject):not(.tq-process):not(.tq-complete):not(.tq-accept):hover {
  background: rgba(59, 130, 246, 0.18) !important;
  border-color: rgba(59, 130, 246, 0.5) !important;
}

/* Danger (Del/Reject) — small, red but not screaming */
.tq-reject {
  background: rgba(239, 68, 68, 0.08) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
}
.tq-reject:hover {
  background: rgba(239, 68, 68, 0.18) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
}

/* ─── 4) Form inputs: consistent + better focus ──────────── */

.bsa-input,
input.bsa-input,
#bs-adm-content input[type=text],
#bs-adm-content input[type=number],
#bs-adm-content input[type=email],
#bs-adm-content select,
#bs-adm-content textarea {
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bsa-input:focus,
#bs-adm-content input:focus,
#bs-adm-content select:focus,
#bs-adm-content textarea:focus {
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
}

/* ─── 5) Section spacing in BS Admin views ──────────────── */

#bs-adm-content > div + div { margin-top: 14px; }
#bs-adm-content > .bsa-card,
#bs-adm-content > div[style*="background"]:not([style*="display:flex"]) {
  /* leave inline-styled cards alone, just bump margin so they breathe */
  margin-bottom: 14px;
}

/* Sub-tab content has consistent inner padding */
#bs-adm-content {
  padding-top: 4px;
}

/* ─── 6) Table action cell: align right, stay tight ──────── */
.bsa-table td:last-child {
  text-align: right;
  white-space: nowrap;
}
.bsa-table td:last-child .tq-act-btn { margin-left: 4px; }

/* ─── 7) Tweak existing pill badges for status legibility ─── */
.tq-status-badge {
  padding: 3px 10px !important;
  font-size: 10px !important;
  border-radius: 12px !important;
}
/* ============================================================
   Platfound UI/UX Phase 2 (P1) — Mz 2026-05-07
   Toast system · Loading/Skeleton · Sidebar active polish
   Append-only at end of style.css.
   ============================================================ */

/* ─── Sidebar active state: gold treatment ────────────────── */
/* Override earlier purple --accent left border with gold so the
   active item visibly anchors the sidebar (Mz fintech-gold theme). */
.wl-sb-item {
  border-left-width: 4px !important;
  padding-left: 14px !important;
}
.wl-sb-item.active {
  background: linear-gradient(90deg, rgba(251,191,36,0.16), rgba(251,191,36,0.02) 80%, transparent) !important;
  color: #fff !important;
  border-left-color: #fbbf24 !important;
  font-weight: 700 !important;
  box-shadow: inset 0 0 0 1px rgba(251,191,36,0.08);
}
.wl-sb-item.active .wl-sb-icon {
  filter: drop-shadow(0 0 4px rgba(251,191,36,0.5));
}
.wl-sb-item:hover:not(.active) {
  background: rgba(251,191,36,0.06) !important;
  border-left-color: rgba(251,191,36,0.35) !important;
}

/* Demo Casino zone keeps green accent for active (already differentiated) */
.wl-sb-item.bs-admin-item.active {
  background: linear-gradient(90deg, rgba(16,185,129,0.20), rgba(16,185,129,0.02) 80%, transparent) !important;
  border-left-color: #10b981 !important;
}
.wl-sb-item.bs-admin-item.active .wl-sb-icon {
  filter: drop-shadow(0 0 4px rgba(16,185,129,0.5));
}

/* ─── Toast notifications ─────────────────────────────────── */
#wl-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 420px;
}
.wl-toast {
  pointer-events: auto;
  background: rgba(15, 17, 23, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border2);
  border-left-width: 4px;
  border-radius: 10px;
  padding: 12px 16px 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 280px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.5);
  animation: wlToastIn 0.28s cubic-bezier(0.16,1,0.3,1);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  position: relative;
}
.wl-toast.wl-toast-leaving {
  animation: wlToastOut 0.22s ease-in forwards;
}
.wl-toast-icon {
  font-size: 16px;
  margin-top: 1px;
  flex-shrink: 0;
}
.wl-toast-body { flex: 1; min-width: 0; word-break: break-word; }
.wl-toast-title { font-weight: 700; margin-bottom: 2px; }
.wl-toast-close {
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text2);
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  margin-left: 4px;
  flex-shrink: 0;
}
.wl-toast-close:hover { color: var(--text); }

.wl-toast-success { border-left-color: #10b981; }
.wl-toast-success .wl-toast-icon { color: #10b981; }
.wl-toast-error   { border-left-color: #ef4444; }
.wl-toast-error   .wl-toast-icon { color: #ef4444; }
.wl-toast-warn    { border-left-color: #fbbf24; }
.wl-toast-warn    .wl-toast-icon { color: #fbbf24; }
.wl-toast-info    { border-left-color: #60a5fa; }
.wl-toast-info    .wl-toast-icon { color: #60a5fa; }

@keyframes wlToastIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes wlToastOut {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}

/* ─── Loading: spinner + skeleton ─────────────────────────── */

/* Reusable spinner (use inside any container) */
.wl-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(251,191,36,0.18);
  border-top-color: #fbbf24;
  border-radius: 50%;
  animation: wlSpin 0.7s linear infinite;
  vertical-align: middle;
}
.wl-spinner-lg { width: 28px; height: 28px; border-width: 3px; }

@keyframes wlSpin {
  to { transform: rotate(360deg); }
}

/* Loading wrapper used by JS replacement of <div>Loading...</div> */
.wl-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  color: var(--text2);
  font-size: 13px;
}
.wl-loading-text {
  letter-spacing: 0.5px;
  animation: wlPulse 1.6s ease-in-out infinite;
}
@keyframes wlPulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

/* Skeleton placeholder rows — replace empty Loading with shape preview */
.wl-skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.025) 0%,
    rgba(255,255,255,0.06) 50%,
    rgba(255,255,255,0.025) 100%
  );
  background-size: 200% 100%;
  animation: wlSkeleton 1.4s ease-in-out infinite;
  border-radius: 6px;
  display: block;
}
@keyframes wlSkeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.wl-skeleton-row {
  height: 12px;
  margin: 8px 0;
  width: 100%;
}
.wl-skeleton-row.short { width: 60%; }
.wl-skeleton-row.tall  { height: 32px; }

/* Empty state (better than "No data") */
.wl-empty {
  text-align: center;
  padding: 36px 20px;
  color: var(--text2);
}
.wl-empty-icon {
  font-size: 38px;
  margin-bottom: 10px;
  opacity: 0.45;
  display: block;
}
.wl-empty-title {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px;
}
.wl-empty-hint {
  font-size: 11px;
  color: var(--text2);
  line-height: 1.6;
}

/* Button spinner wrapper for inline-loading buttons */
.btn-gold.wl-btn-loading,
.btn-ghost.wl-btn-loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
}
.btn-gold.wl-btn-loading::after,
.btn-ghost.wl-btn-loading::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: wlSpin 0.65s linear infinite;
  margin-left: 8px;
  vertical-align: -2px;
}
/* ============================================================
   Platfound UI/UX Phase 3 — Mz 2026-05-07
   Type scale tokens · Empty-state polish · Mobile drawer polish
   Append-only at end of style.css.
   ============================================================ */

/* ─── Type scale design tokens ────────────────────────────── */
:root {
  --fs-xs:   10px;   /* badges, hints, tiny meta */
  --fs-sm:   12px;   /* secondary text, meta rows */
  --fs-base: 13px;   /* body, table cells, inputs */
  --fs-md:   14px;   /* sidebar, sub-nav active */
  --fs-lg:   16px;   /* sub-section headers */
  --fs-xl:   20px;   /* card titles */
  --fs-xxl:  28px;   /* page headers / KPI numbers */

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.32);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);

  --gold: #fbbf24;
  --gold-2: #f59e0b;
  --gold-grad: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

/* ─── Empty state polish (existing legacy classes) ────────── */
.muted,
.alog2-empty-title,
.scripts-empty,
.wl-empty-title {
  color: var(--text2);
  font-size: var(--fs-base);
}
.alog2-empty-title { font-weight: 600; color: var(--text); }

/* Make ad-hoc "暂无..." inline messages feel less terminal */
[class*="-empty"]:not(.wl-empty),
.muted {
  letter-spacing: 0.2px;
}
.muted + small,
.alog2-empty-title + .alog2-empty-hint {
  display: block;
  margin-top: 4px;
  color: var(--text2);
  font-size: var(--fs-xs);
}

/* ─── Universal table wrapper (horizontal scroll fallback) ─ */
/* Wrap any .bsa-table or .alog2-table that overflows on small screens */
@media (max-width: 768px) {
  .bsa-table,
  table.bsa-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .bsa-table thead,
  .bsa-table tbody {
    display: table;
    width: 100%;
    min-width: 580px;  /* force horizontal scroll if narrower */
  }
  /* Sticky first column on small screens for tables with id col */
  .bsa-table th:first-child,
  .bsa-table td:first-child {
    position: sticky;
    left: 0;
    background: var(--bg2);
    z-index: 1;
  }
  .bsa-table tbody tr:hover td:first-child {
    background: rgba(251,191,36,0.10);  /* keep hover visible on sticky col */
  }
}

/* ─── Mobile drawer polish ────────────────────────────────── */
@media (max-width: 760px) {
  /* Sidebar drawer: gold left edge highlight when open */
  body.sidebar-mode.wl-sb-open #wl-sidebar {
    box-shadow: 4px 0 30px rgba(0,0,0,0.6),
                inset 4px 0 0 var(--gold);
  }
  /* Backdrop: deeper + smoother */
  body.sidebar-mode.wl-sb-open::after {
    background: rgba(0,0,0,0.62);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: opacity 0.2s;
    cursor: pointer;
  }
  /* Mobile toggle button: more visible */
  body.sidebar-mode .wl-sb-mobile-toggle,
  #wl-sidebar-mobile-toggle {
    background: rgba(251,191,36,0.12) !important;
    border: 1px solid rgba(251,191,36,0.3) !important;
    color: var(--gold) !important;
    width: 40px;
    height: 40px;
    font-size: 22px !important;
  }
  body.sidebar-mode .wl-sb-mobile-toggle:hover,
  #wl-sidebar-mobile-toggle:hover {
    background: rgba(251,191,36,0.22) !important;
  }

  /* BS Admin: sub-tabs scroll horizontally on mobile, but show fade hint at edges */
  .bs-adm-tab-row,
  #dv-bs-admin > div:first-child {
    position: relative;
    -webkit-mask-image: linear-gradient(90deg, black 0, black calc(100% - 24px), transparent 100%);
            mask-image: linear-gradient(90deg, black 0, black calc(100% - 24px), transparent 100%);
  }

  /* Modal: more breathing room on mobile */
  .modal {
    padding-bottom: env(safe-area-inset-bottom, 16px);
  }

  /* Toast container: full-width on mobile */
  #wl-toast-container {
    top: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
  }
  .wl-toast { min-width: 0; }
}

/* ─── Fix oversized chips/buttons on touch devices ────────── */
@media (hover: none) {
  .wl-sb-item:hover { transform: none; }
  .bs-adm-tab:hover { transform: none; }
  .btn-gold:hover { transform: none; }
}

/* ─── Sub-section headers within views: consistent ────────── */
.wl-section-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text);
  margin: 18px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.wl-kpi-num {
  font-size: var(--fs-xxl);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  color: var(--gold);
}
.wl-kpi-label {
  font-size: var(--fs-xs);
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

/* ─── Better disabled states ──────────────────────────────── */
button:disabled,
.btn-gold:disabled,
.btn-ghost:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ─── Consistent focus ring across all interactive elements ─ */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.wl-sb-item:focus-visible,
.bs-adm-tab:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ============================================================
   Platfound UI — kill BS Admin sub-tab duplication (Mz 2026-05-07)
   Sidebar zone now owns BS Admin nav; top sub-tab row hidden on
   desktop (sidebar mode). Kept on mobile as backup nav.
   ============================================================ */
@media (min-width: 761px) {
  body.sidebar-mode .bs-adm-tab-row,
  body.sidebar-mode #dv-bs-admin > div:first-child:has(.bs-adm-tab) {
    display: none !important;
  }
}

/* ============================================================
   Sidebar collapsible groups (Mz 2026-05-07 #5)
   ============================================================ */
.wl-sb-group { margin-bottom: 4px; }
.wl-sb-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  user-select: none;
  border-radius: 6px;
  letter-spacing: 0.3px;
  transition: background 0.12s, color 0.12s;
}
.wl-sb-group-header:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}
.wl-sb-group-caret {
  display: inline-block;
  width: 10px;
  font-size: 10px;
  transition: transform 0.18s;
}
.wl-sb-group[data-collapsed="true"] .wl-sb-group-items { display: none; }
.wl-sb-group[data-collapsed="true"] .wl-sb-group-caret { transform: rotate(-90deg); }
.wl-sb-group-items > .wl-sb-item {
  padding-left: 28px !important;
}
/* BS Admin tab bar reorg (2026-05-09) — categories + wrap */

/* Category top row */
.bsa-cat-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px !important;
}
.bsa-cat {
  flex: 1;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(20,24,38,0.96), rgba(13,16,28,0.98));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: all .15s ease;
}
.bsa-cat:hover {
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.9);
}
.bsa-cat.active {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border-color: #fbbf24;
  color: #000;
  font-weight: 800;
  box-shadow: 0 3px 12px rgba(251,191,36,0.35);
}

/* Sub-tab bar — wrap allowed */
.bsa-tab-bar {
  display: flex !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
  padding-bottom: 8px !important;
}

/* Each sub-tab: more compact */
.bsa-tab-bar .bs-adm-tab,
.bs-adm-tab {
  flex: 0 0 auto;
  padding: 7px 12px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: 8px !important;
  color: rgba(255,255,255,0.65) !important;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.bs-adm-tab:hover {
  background: rgba(251,191,36,0.08) !important;
  color: #fbbf24 !important;
  border-color: rgba(251,191,36,0.3) !important;
}
.bs-adm-tab.active {
  background: rgba(251,191,36,0.15) !important;
  color: #fbbf24 !important;
  border-color: #fbbf24 !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(251,191,36,0.2);
}

/* Hide tabs not in active category */
.bs-adm-tab[data-bsa-cat] { display: none !important; }
.bsa-cat-row[data-active="ops"]     ~ .bsa-tab-bar .bs-adm-tab[data-bsa-cat="ops"],
.bsa-cat-row[data-active="promo"]   ~ .bsa-tab-bar .bs-adm-tab[data-bsa-cat="promo"],
.bsa-cat-row[data-active="players"] ~ .bsa-tab-bar .bs-adm-tab[data-bsa-cat="players"],
.bsa-cat-row[data-active="system"]  ~ .bsa-tab-bar .bs-adm-tab[data-bsa-cat="system"] {
  display: inline-flex !important;
}
/* default: ops visible (no data-active set yet) */
.bsa-cat-row:not([data-active]) ~ .bsa-tab-bar .bs-adm-tab[data-bsa-cat="ops"] {
  display: inline-flex !important;
}
/* container styled inline */ }

.wl-scope-pill {
  flex: 1;
  padding: 7px 10px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255,255,255,0.55);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.wl-scope-pill:hover {
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.85);
}
.wl-scope-pill.active {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #000;
  border-color: #fbbf24;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(251,191,36,0.35);
}

/* Hide dev-only items unless dev mode on */
/* Scope filtering — driven by body[data-wl-scope] */

/* Mode: democasino — hide all items NOT democasino-specific (everything without data-platform=democasino in sidebar items) */
body[data-wl-scope="boleh"] .wl-sb-item:not([data-platform="democasino"]) { display: none !important; }
body[data-wl-scope="boleh"] .dept-btn:not([data-dept="livechat"]) { opacity: 0.4; }

/* Mode: OPS (上游) — hide Demo Casino items entirely */
body[data-wl-scope="ops"] .wl-sb-item[data-platform="democasino"] { display: none !important; }
body[data-wl-scope="ops"] .dept-btn[data-dept="livechat"] { display: none !important; }
body[data-wl-scope="ops"] .data-sub-btn[data-company="boleh-co"] { display: none !important; }

/* Mode: ALL — default, no hiding */

/* Section dividers in sidebar — labels above groups */
.wl-sb-zone-header {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: rgba(251,191,36,0.5);
  text-transform: uppercase;
  padding: 10px 16px 4px;
  border-top: 1px solid rgba(255,255,255,0.04);
  margin-top: 4px;
}
/* Hide BS Admin top tab-bar + cat-row (sidebar is sole nav) */
#dv-bs-admin .bsa-cat-row,
#dv-bs-admin .bsa-tab-bar {
  display: none !important;
}
/* BSA chat fill height (2026-05-09) — kill empty box below */
#dv-bs-admin .bsa-chat-wrap {
  height: calc(100vh - 220px) !important;
  min-height: 480px !important;
}
#dv-bs-admin .bsa-chat-list,
#dv-bs-admin .bsa-chat-detail {
  max-height: none !important;
  height: 100% !important;
  overflow-y: auto !important;
}
#dv-bs-admin .bsa-chat-detail {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
#dv-bs-admin .bsa-chat-msgs,
#dv-bs-admin #bsa-chat-msg-list {
  flex: 1 !important;
  overflow-y: auto !important;
  min-height: 0 !important;
}
#dv-bs-admin .bsa-chat-reply-area {
  flex-shrink: 0 !important;
}
/* Compact bs-adm-content padding so chat reaches edges */
#bs-adm-content {
  padding-bottom: 0 !important;
}

/* === P0 #3 fix 2026-05-09: hide duplicate top sub-tab-bar (sidebar wl-sb-item is source of truth) === */
.data-sub-btn { display: none !important; }
/* The .sub-tab-bar row that ONLY contains data-sub-btn becomes empty;
   collapse its padding so it doesn't leave whitespace. ping-indicator stays. */
.sub-tab-bar { gap: 4px !important; padding-bottom: 4px !important; }
.sub-tab-bar:has(.data-sub-btn:not(.sub-tab-btn)):not(:has(.sub-tab-btn)) {
  /* if a sub-tab-bar has only data-sub-btn (now hidden), collapse it */
  padding: 0 !important;
  border: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
}


/* === P1 #1 fix 2026-05-09: distinguish sidebar menu-count from alerts === */
.wl-sb-group-header span:last-child { font-weight: 500; }
/* Wrap the trailing "(N)" in muted style — these are menu counts, not alerts */
.wl-sb-group-header { color: var(--text); font-weight: 600; }

/* P1 #4 stronger: ensure badges with empty text don't show */
.self-check-badge:empty { display: none !important; }

/* === P1 #5 fix 2026-05-09: Make Accept/Complete primary, smaller secondary === */
.tq-act-btn { 
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 5px 11px !important;
  border-radius: 5px !important;
  margin: 0 2px !important;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
  cursor: pointer;
  min-height: 28px;
}
.tq-act-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.25); }
/* Primary actions (Accept / Complete) larger + filled bg */
.tq-act-btn.tq-accept,
.tq-act-btn.tq-complete {
  background: linear-gradient(180deg, #10b981, #059669) !important;
  color: #ffffff !important;
  border: 0 !important;
  padding: 6px 16px !important;
  min-width: 76px;
  font-size: 13px !important;
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 2px 4px rgba(5,150,105,0.3);
}
/* Reject = secondary outline */
.tq-act-btn.tq-reject {
  background: transparent !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239,68,68,0.5) !important;
  padding: 5px 12px !important;
}
.tq-act-btn.tq-reject:hover {
  background: rgba(239,68,68,0.10) !important;
  border-color: #ef4444 !important;
}
/* View / AI / repush / check stay as compact icons */
.tq-act-btn:not(.tq-accept):not(.tq-complete):not(.tq-reject) {
  width: 28px !important;
  padding: 0 !important;
  min-width: 28px;
}

/* === P1 #7 fix 2026-05-09: better empty table state visuals === */
/* When row contains only one empty-state td (colspan), upgrade styling */
tbody tr td[colspan][style*="text-align:center"] {
  padding: 36px 20px !important;
  color: rgba(148,163,184,0.7) !important;
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.02em;
}
/* Subtle dashed border above to separate from header */
tbody tr td[colspan][style*="text-align:center"]::before {
  content: "📋";
  display: block;
  font-size: 28px;
  margin-bottom: 8px;
  opacity: 0.4;
  font-style: normal;
  filter: grayscale(0.5);
}
/* If td contains "loading" / "loadFailed" / 加载, override the icon */
tbody tr td[colspan][style*="color:var(--danger)"]::before {
  content: "⚠";
  color: #ef4444;
  opacity: 0.6;
}

/* === P2 #4 fix 2026-05-09: mono font for numbers (RM amounts, IDs, dates) === */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap');
.num,
.card-value,
.tq-amt, .tq-id,
td.num, td[class*="num"],
.dash-card .card-value,
.pg-pool-card span:last-child {
  font-family: 'JetBrains Mono', 'Geist Mono', ui-monospace, SF Mono, Menlo, monospace !important;
  font-feature-settings: 'tnum' on, 'lnum' on;  /* tabular numerals */
  letter-spacing: -0.01em;
}
/* Card label keeps sans for readability */
.dash-card .card-label, .card-label {
  font-family: inherit !important;
}

/* === P2 #3 fix 2026-05-09: compact top nav (reduce vertical space ~50%) === */
/* Hide redundant 品牌: / 部门: labels */
.platform-label { display: none !important; }

/* Compact platform/dept bars */
.platform-bar, .dept-bar, .company-bar {
  padding: 3px 12px !important;
  gap: 4px !important;
  min-height: 0;
}

/* Compact buttons: smaller, no min-width */
.platform-btn {
  padding: 3px 10px !important;
  font-size: 11px !important;
  min-width: auto !important;
  border-radius: 4px !important;
  letter-spacing: 0.02em;
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
}
.platform-btn .platform-logo { width: 14px !important; height: 14px !important; }
.platform-btn:not(.active) .platform-logo { opacity: 0.6; }

.dept-btn, .company-btn {
  padding: 3px 10px !important;
  font-size: 11px !important;
  border-radius: 4px !important;
}

/* Active state: subtle gold accent instead of full bg fill (less visual noise) */
.platform-btn.active {
  background: rgba(251,191,36,0.15) !important;
  color: #fbbf24 !important;
  border-color: rgba(251,191,36,0.4) !important;
  box-shadow: 0 0 0 1px rgba(251,191,36,0.2);
}
.dept-btn.active, .company-btn.active {
  background: rgba(99,102,241,0.18) !important;
  color: #a5b4fc !important;
  border-color: rgba(99,102,241,0.4) !important;
}

/* Wrap on narrow viewports — but try to fit in 1 row on desktop */
.platform-bar { flex-wrap: wrap; row-gap: 3px; }

/* Subtle visual divider between bars (single border instead of double) */
.dept-bar { border-top: 0 !important; }

/* === P3 #1 fix 2026-05-09: skeleton shimmer for loading states === */
@keyframes wl-shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}
/* td that's a loading placeholder (centered text) gets shimmer */
tbody tr td[colspan][style*="text-align:center"][style*="color:var(--text2)"]::after {
  content: "";
  display: block;
  height: 14px;
  margin: 8px auto 4px;
  width: 60%;
  background: linear-gradient(90deg, transparent 0%, rgba(99,102,241,0.20) 25%, rgba(99,102,241,0.10) 50%, rgba(99,102,241,0.20) 75%, transparent 100%);
  background-size: 1000px 100%;
  animation: wl-shimmer 1.6s linear infinite;
  border-radius: 4px;
}
/* Skeleton class - explicit shimmer wrapper */
.wl-skel {
  background: linear-gradient(90deg, rgba(148,163,184,0.06) 0%, rgba(148,163,184,0.18) 50%, rgba(148,163,184,0.06) 100%);
  background-size: 200% 100%;
  animation: wl-shimmer 1.4s linear infinite;
  border-radius: 4px;
  color: transparent !important;
}

/* === Search trigger button next to PM dropdown 2026-05-09 === */
.cmdk-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.30);
  border-radius: 6px;
  color: #a5b4fc;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: all 0.15s;
  margin-right: 6px;
}
.cmdk-trigger:hover {
  background: rgba(99,102,241,0.18);
  border-color: rgba(99,102,241,0.55);
  color: #fff;
}
.cmdk-trigger-icon { font-size: 14px; line-height: 1; }
.cmdk-trigger-text { color: inherit; }
.cmdk-trigger-kbd {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  background: rgba(99,102,241,0.18);
  color: #a5b4fc;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: .04em;
  margin-left: 2px;
}
@media (max-width: 700px) {
  .cmdk-trigger-text, .cmdk-trigger-kbd { display: none; }
}

/* === F + G fix 2026-05-09: stronger sidebar active + tooltips === */
/* Sidebar item active state — strong gold left bar + bold */
a.wl-sb-item.active,
a.wl-sb-item.is-active,
a.wl-sb-item[aria-current="page"] {
  background: linear-gradient(90deg, rgba(251,191,36,0.18) 0%, rgba(251,191,36,0.06) 100%) !important;
  color: #fbbf24 !important;
  font-weight: 600 !important;
  border-left: 3px solid #fbbf24 !important;
  padding-left: calc(12px - 3px) !important;
  position: relative;
}
a.wl-sb-item.active .wl-sb-icon,
a.wl-sb-item.is-active .wl-sb-icon {
  filter: drop-shadow(0 0 4px rgba(251,191,36,0.45));
}
a.wl-sb-item:hover { color: #fde68a !important; }

/* G: rich tooltips for icon-only buttons (use [title] attribute as base) */
[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #f1f5f9;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid #334155;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  z-index: 9999;
  pointer-events: none;
  letter-spacing: 0.02em;
  animation: tipFade 0.15s ease-out;
}
[title]:hover::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 0px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #0f172a;
  z-index: 9999;
  pointer-events: none;
}
@keyframes tipFade { from {opacity:0;transform:translateX(-50%) translateY(2px);} to {opacity:1;transform:translateX(-50%) translateY(0);} }
/* Only show tooltips on small/icon buttons + bell items + tq-act-btn icons */
.tq-act-btn[title]:hover::after,
.tq-act-btn[title]:hover::before,
button[title][class*="icon"]:hover::after,
button[title][class*="icon"]:hover::before,
.bell-item[title]:hover::after,
.bell-item[title]:hover::before,
button[title^="刷新"]:hover::after, button[title^="刷新"]:hover::before,
button[title="View"]:hover::after, button[title="View"]:hover::before,
button[title="Edit"]:hover::after, button[title="Edit"]:hover::before,
button[title^="Repush"]:hover::after, button[title^="Repush"]:hover::before,
button[title^="Check"]:hover::after, button[title^="Check"]:hover::before,
button[title^="AI"]:hover::after, button[title^="AI"]:hover::before {
  display: block;
}
/* Don't apply to inputs / link-text / things with already visible labels */
input[title]:hover::after, a[title][href]:hover::after,
.wl-sb-item[title]:hover::after, .platform-btn[title]:hover::after,
.dept-btn[title]:hover::after, .data-sub-btn[title]:hover::after,
[title=""]:hover::after { display: none !important; }
.tq-act-btn, .bell-item { position: relative; }

/* ── Commission Reconciliation Toolbar (Mz 2026-05-10) ──────────────────── */
.commission-range {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 8px;
  background: linear-gradient(135deg, rgba(99,102,241,0.10), rgba(139,92,246,0.06));
  border: 1px solid rgba(99,102,241,0.25);
}
.commission-range::before {
  content: "📅"; font-size: 13px; opacity: 0.85;
}
.commission-range input[type="date"].settings-input {
  flex: 0 0 auto; min-width: 0; width: 130px;
  padding: 5px 8px; font-size: 12px;
  background: rgba(15,23,42,0.6); border: 1px solid rgba(99,102,241,0.30);
  border-radius: 6px; color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.3px;
}
.commission-range input[type="date"].settings-input:hover {
  border-color: rgba(139,92,246,0.6); background: rgba(15,23,42,0.85);
}
.commission-range input[type="date"].settings-input:focus {
  border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,0.2);
}
.commission-range .arrow {
  color: #6366f1; font-size: 14px; font-weight: bold; padding: 0 2px;
}

.commission-presets { display: inline-flex; gap: 4px; margin-left: 6px; }
.commission-presets .btn-ghost[data-vc-preset],
.commission-presets .btn-ghost[data-pgc-preset] {
  padding: 5px 12px; font-size: 11px; border-radius: 14px;
  background: rgba(99,102,241,0.08); color: #c7d2fe;
  border: 1px solid rgba(99,102,241,0.2);
  transition: all 0.15s ease;
}
.commission-presets .btn-ghost[data-vc-preset]:hover,
.commission-presets .btn-ghost[data-pgc-preset]:hover {
  background: rgba(99,102,241,0.22); color: #fff; border-color: #6366f1;
  transform: translateY(-1px);
}
.commission-presets .btn-ghost[data-vc-preset].active,
.commission-presets .btn-ghost[data-pgc-preset].active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
  border-color: transparent; box-shadow: 0 2px 8px rgba(99,102,241,0.4);
}

#vc-refresh, #pgc-refresh {
  padding: 5px 14px !important; font-size: 12px !important;
  background: rgba(16,185,129,0.15) !important; color: #4ade80 !important;
  border: 1px solid rgba(16,185,129,0.3) !important; border-radius: 6px !important;
  margin-left: 4px;
}
#vc-refresh:hover, #pgc-refresh:hover {
  background: rgba(16,185,129,0.28) !important; color: #fff !important;
}

/* ── Team Members Toolbar (Mz 2026-05-10 全面升级) ─────────────────── */
.au-toolbar {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(99,102,241,0.05), rgba(139,92,246,0.03));
  border: 1px solid rgba(99,102,241,0.18);
}
.au-search-wrap {
  position: relative; display: flex; align-items: center;
  background: rgba(15,23,42,0.6); border: 1px solid rgba(99,102,241,0.25);
  border-radius: 8px; padding: 0 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.au-search-wrap:focus-within { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,0.2); }
.au-search-icon { font-size: 13px; opacity: 0.65; padding: 0 4px; }
.au-search-input {
  flex: 1; padding: 9px 8px; background: transparent; border: none; outline: none;
  color: #e2e8f0; font-size: 13px;
}
.au-search-input::placeholder { color: #64748b; font-size: 12px; }
.au-search-clear {
  background: transparent; border: none; color: #64748b; font-size: 18px; cursor: pointer;
  width: 24px; height: 24px; line-height: 1; border-radius: 50%; transition: all 0.15s;
}
.au-search-clear:hover { background: rgba(239,68,68,0.18); color: #f87171; }
.au-search-input:placeholder-shown ~ .au-search-clear { visibility: hidden; }

.au-filter-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.au-filter-label {
  font-size: 11px; color: #94a3b8; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.au-filter-select {
  padding: 5px 10px; padding-right: 24px; border-radius: 6px;
  background: rgba(15,23,42,0.7); color: #e2e8f0;
  border: 1px solid rgba(99,102,241,0.20); font-size: 12px; outline: none;
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns=http://www.w3.org/2000/svg width=10 height=6 viewBox=0 0 10 6><path fill=%2394a3b8 d=M0 0l5 6 5-6z/></svg>");
  background-repeat: no-repeat; background-position: right 8px center;
  transition: border-color 0.15s, background-color 0.15s;
}
.au-filter-select:hover { border-color: rgba(139,92,246,0.6); background-color: rgba(15,23,42,0.95); }
.au-filter-select:focus { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,0.2); }
.au-filter-result {
  margin-left: auto; font-size: 11px; color: #94a3b8; font-style: italic;
}


/* ── Password strength meter + eye toggle (Mz 2026-05-10) ──────── */
.au-pw-wrap { position: relative; display: flex; align-items: center; }
.au-pw-wrap .settings-input { padding-right: 36px; }
.au-pw-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; cursor: pointer; font-size: 14px;
  color: #94a3b8; padding: 4px 8px; border-radius: 4px; opacity: 0.6;
  transition: opacity 0.15s, background 0.15s;
}
.au-pw-eye:hover { opacity: 1; background: rgba(99,102,241,0.15); color: #c7d2fe; }
.au-pw-strength {
  margin-top: 6px; display: flex; flex-direction: column; gap: 4px;
}
.au-pw-bar {
  height: 4px; background: rgba(15,23,42,0.6); border-radius: 2px; overflow: hidden;
}
.au-pw-bar-fill {
  height: 100%; width: 0%; transition: width 0.25s ease, background 0.25s;
  background: #ef4444; border-radius: 2px;
}
.au-pw-bar-fill.s1 { width: 25%; background: #ef4444; }
.au-pw-bar-fill.s2 { width: 50%; background: #f97316; }
.au-pw-bar-fill.s3 { width: 75%; background: #eab308; }
.au-pw-bar-fill.s4 { width: 100%; background: #10b981; }
.au-pw-msg { font-size: 10px; color: #94a3b8; }
.au-pw-msg.s1 { color: #f87171; }
.au-pw-msg.s2 { color: #fb923c; }
.au-pw-msg.s3 { color: #facc15; }
.au-pw-msg.s4 { color: #4ade80; }

/* ── Confirm modal for destructive actions ──────────────────────── */
.au-confirm-overlay {
  position: fixed; inset: 0; background: rgba(2,6,23,0.78); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
  animation: au-fade-in 0.18s ease;
}
@keyframes au-fade-in { from { opacity: 0; } to { opacity: 1; } }
.au-confirm-modal {
  background: linear-gradient(180deg, #1e1b4b, #0f172a);
  border: 1px solid rgba(239,68,68,0.4); border-radius: 12px;
  padding: 22px 26px; width: 420px; max-width: 90vw;
  box-shadow: 0 20px 60px rgba(239,68,68,0.2);
}
.au-confirm-title { font-size: 16px; font-weight: 700; color: #f87171; margin-bottom: 8px; }
.au-confirm-body { font-size: 13px; color: #cbd5e1; line-height: 1.6; margin-bottom: 14px; }
.au-confirm-body strong { color: #fbbf24; font-family: ui-monospace, SFMono-Regular, monospace; }
.au-confirm-body code {
  background: rgba(15,23,42,0.7); padding: 2px 6px; border-radius: 3px;
  color: #fbbf24; font-size: 12px;
}
.au-confirm-input {
  width: 100%; padding: 8px 12px; border-radius: 6px;
  background: rgba(15,23,42,0.7); border: 1px solid rgba(239,68,68,0.3);
  color: #e2e8f0; font-size: 13px; font-family: ui-monospace, SFMono-Regular, monospace;
  outline: none; margin-bottom: 14px;
}
.au-confirm-input:focus { border-color: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,0.2); }
.au-confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }
.au-confirm-actions button {
  padding: 7px 16px; border-radius: 6px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; transition: all 0.15s;
}
.au-confirm-cancel { background: rgba(100,116,139,0.2); color: #cbd5e1; border-color: rgba(100,116,139,0.3); }
.au-confirm-cancel:hover { background: rgba(100,116,139,0.35); }
.au-confirm-ok {
  background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff;
  box-shadow: 0 2px 8px rgba(239,68,68,0.3);
}
.au-confirm-ok:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.au-confirm-ok:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(239,68,68,0.4); }


/* ── Security pane overview cards (Mz 2026-05-10) ─────────────── */
.sec-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px;
}
.sec-card {
  background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(139,92,246,0.04));
  border: 1px solid rgba(99,102,241,0.2); border-radius: 10px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 8px;
}
.sec-card-head { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.sec-card-icon { font-size: 16px; }
.sec-card-title { font-size: 13px; color: #c7d2fe; }
.sec-card-body { font-size: 12px; color: #cbd5e1; line-height: 1.6; }
.sec-card-body.sec-loading { color: #64748b; font-style: italic; }
.sec-card-body strong { color: #fbbf24; }
.sec-card-row { display: flex; justify-content: space-between; gap: 8px; }
.sec-card-row .sec-key { color: #94a3b8; font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; }
.sec-card-row .sec-val { color: #e2e8f0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }

.sec-pwd-warn { color: #fb923c; }
.sec-pwd-bad  { color: #f87171; }
.sec-pwd-ok   { color: #4ade80; }

.sec-history {
  border: 1px solid rgba(99,102,241,0.18); border-radius: 8px; overflow: hidden;
}
.sec-history.sec-loading { padding: 14px; text-align: center; color: #64748b; font-style: italic; font-size: 12px; }
.sec-history table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sec-history th {
  background: rgba(99,102,241,0.10); color: #c7d2fe; font-weight: 600;
  padding: 8px 12px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px;
}
.sec-history td {
  padding: 8px 12px; color: #cbd5e1;
  border-top: 1px solid rgba(99,102,241,0.10);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.sec-history tbody tr:hover { background: rgba(99,102,241,0.06); }
.sec-history-flag { display: inline-block; margin-right: 4px; }
.sec-history-anomaly { color: #fb923c; }


/* ── Profile completion + copy buttons (Phase 4 Mz 2026-05-10) ─── */
.set3-profile-completion { margin-top: 10px; max-width: 420px; }
.set3-pc-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: #94a3b8; margin-bottom: 5px;
}
.set3-pc-label strong { color: #fbbf24; font-size: 13px; }
.set3-pc-missing { color: #fb923c; font-style: italic; font-size: 10px; }
.set3-pc-bar {
  height: 5px; background: rgba(15,23,42,0.6); border-radius: 3px; overflow: hidden;
}
.set3-pc-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #ef4444, #f97316, #eab308, #10b981);
  background-size: 400% 100%; transition: width 0.3s, background-position 0.3s;
}
.set3-pc-fill[data-pct="20"]  { background-position:   0% 0; }
.set3-pc-fill[data-pct="40"]  { background-position:  33% 0; }
.set3-pc-fill[data-pct="60"]  { background-position:  66% 0; }
.set3-pc-fill[data-pct="80"]  { background-position:  85% 0; }
.set3-pc-fill[data-pct="100"] { background-position: 100% 0; }

.set3-profile-recent {
  margin-top: 10px; padding: 6px 10px; border-radius: 6px;
  background: rgba(99,102,241,0.06); border-left: 2px solid rgba(99,102,241,0.5);
  font-size: 11px; color: #cbd5e1; display: flex; align-items: center; gap: 6px;
}
.set3-pr-icon { font-size: 12px; }

.set2-input-with-action { position: relative; display: flex; align-items: center; }
.set2-input-with-action .settings-input { padding-right: 36px; flex: 1; }
.set2-copy-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: rgba(99,102,241,0.10); border: 1px solid rgba(99,102,241,0.20);
  width: 26px; height: 26px; border-radius: 5px; cursor: pointer;
  color: #c7d2fe; font-size: 14px; padding: 0; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s ease;
}
.set2-copy-btn:hover { background: rgba(99,102,241,0.25); transform: translateY(-50%) scale(1.05); }
.set2-copy-btn.copied {
  background: rgba(16,185,129,0.25); border-color: rgba(16,185,129,0.5); color: #4ade80;
}
.set2-copy-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.set2-copy-icon { font-family: ui-sans-serif, system-ui; }
