/* Workspace layout; existing feature controls and save behavior remain authoritative. */
.dashboard { --sidebar-width: 252px; --workspace-line: #ffffff0d; }
.dashboard .sidebar { padding: 20px 12px 12px; }
.dashboard .sidebar-brand-row { margin-bottom: 20px; }
.dashboard .sidebar .brand { gap: 8px; font-size: 20px; }
.dashboard .sidebar .brand img { width: 38px; height: 42px; }
.dashboard .sidebar-guild-context { margin: 0 2px 12px; padding: 12px 8px; border-block: 1px solid var(--workspace-line); }
.sidebar-guild-details small { text-transform: uppercase; font-size: 9px; }
.dashboard .sidebar-guild-details strong { font-size: 12px; }
.workspace-nav-filter { box-sizing: border-box; display: flex; align-items: center; gap: 10px; flex: 0 0 36px; height: 36px; min-width: 0; margin: 0 5px 8px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; color: var(--text-muted); background: var(--background); transition: border-color .15s ease; }
.workspace-nav-filter > i { flex: 0 0 auto; font-size: 11px; }
/* The wrapper owns the field surface and focus border, not the nested input. */
.dashboard .sidebar .workspace-nav-filter > input[type="search"],
.dashboard .sidebar .workspace-nav-filter > input[type="search"]:is(:hover, :focus, :focus-visible) { box-sizing: border-box; appearance: none; flex: 1 1 0; min-width: 0; width: 100%; height: 100%; min-height: 0; max-height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; outline: 0; box-shadow: none; background: transparent; color: var(--text-primary); font: inherit; font-size: 12px; line-height: normal; }
.workspace-nav-filter:focus-within { border-color: var(--accent); }
.dashboard .sidebar .nav-section-label { display: block; margin: 18px 0 5px; padding: 0; }
.workspace-group-toggle { width: 100%; min-height: 28px; display: flex; align-items: center; gap: 6px; padding: 0 12px; border: 0; background: none; color: var(--text-muted); text-align: left; cursor: pointer; font: inherit; font-size: 10px; font-weight: 600; }
.workspace-group-toggle > i:first-child { display: none; }
.workspace-group-toggle > .workspace-group-arrow { margin-left: auto; font-size: 8px; transition: transform .18s; }
.workspace-group-collapsed .workspace-group-arrow { transform: rotate(-90deg); }
.workspace-group-toggle:hover { color: var(--text-primary); }
.workspace-group-collapsed > .nav-item { display: none !important; }
.workspace-is-filtering .workspace-group-collapsed > .nav-item:not(.hidden):not(.workspace-filtered-out) { display: grid !important; }
.workspace-filtered-out { display: none !important; }
.workspace-nav-empty { margin: 20px 12px; color: var(--text-muted); font-size: 12px; }
.dashboard .sidebar .nav-item { position: relative; min-height: 37px; padding: 6px 10px; grid-template-columns: 25px minmax(0,1fr) 12px; border-radius: 5px; }
.dashboard .sidebar .nav-item[data-plus-feature] { grid-template-columns: 25px minmax(0,1fr) 14px 12px; }
.dashboard .sidebar .nav-item > span { font-size: 12px; line-height: 1.5; }
.dashboard .sidebar .nav-item > i:first-child { width: 20px; height: 20px; min-height: 0; display: grid; place-items: center; }
.dashboard .sidebar .nav-item > i:first-child { font-size: 12px; }
.dashboard .sidebar .nav-item-arrow { opacity: 0; font-size: 8px; }
.dashboard .sidebar .nav-item.active .nav-item-arrow { opacity: 1; }
.dashboard .sidebar .nav-item.active { background: #326de614; border-color: transparent; }
.dashboard .sidebar .nav-item.active::after { content: ""; position: absolute; inset: 8px auto 8px -3px; width: 3px; border-radius: 2px; background: var(--dashboard-user-accent, var(--accent)); }
.dashboard .sidebar .nav-item.active > i:first-child { background: transparent; border: 0; color: var(--accent-hover); }
.workspace-pinned { padding: 6px 0 10px; border-bottom: 1px solid var(--workspace-line); }
.workspace-pinned[hidden], .workspace-recent[hidden], .workspace-nav-empty[hidden] { display: none; }
.workspace-pinned h2 { margin: 8px 12px; font-size: 10px; color: var(--text-muted); font-weight: 600; }
.workspace-pin-link { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 34px; padding: 6px 12px; border: 0; border-radius: 5px; background: transparent; color: var(--text-secondary); font: inherit; font-size: 11px; text-align: left; cursor: pointer; }
.workspace-pin-link > i { width: 15px; color: var(--accent-hover); }
.workspace-pin-link:hover, .workspace-pin-link.is-active { background: var(--accent-soft); color: var(--text-primary); }
.dashboard .topbar { height: 70px; padding-inline: 28px; gap: 12px; background: var(--background); border-bottom: 1px solid var(--workspace-line); }
.dashboard .topbar-title { flex: 1 1 160px; gap: 10px; }
.dashboard .topbar-title #active-guild-name { font-size: 11px; max-width: 180px; }
.dashboard .topbar-title strong { font-size: 12px; }
.dashboard .topbar-title > i { font-size: 8px; color: var(--text-muted); }
.dashboard .workspace-pin-button { flex: 0 0 32px; width: 32px; min-width: 32px; height: 32px; }
.dashboard .workspace-pin-button[aria-pressed="true"] { color: var(--accent-hover); }
.dashboard .topbar .panel-search-trigger { display: inline-flex; align-items: center; width: 210px; min-height: 34px; border-color: var(--workspace-line); background: var(--background-secondary); font-size: 11px; }
.dashboard .panel-search-trigger kbd { font: inherit; font-size: 9px; padding: 3px 5px; border: 1px solid var(--border); border-radius: 3px; }
.dashboard .topbar .panel-change-status { max-width: 150px; font-size: 9px; }
.dashboard .workspace-scroll { height: calc(100dvh - 70px); background: var(--background); }
.dashboard .view-stack { width: min(1440px,100%); padding: 30px 32px 72px; }
.dashboard .workspace .view-heading { align-items: center; min-height: 68px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--workspace-line); }
.dashboard .workspace .view-heading h1 { margin: 0; font-size: 25px; font-weight: 700; line-height: 1.35; }
.dashboard .view-heading .eyebrow { margin: 0 0 7px; font-size: 10px; }
.dashboard .workspace .view-heading > div > p:not(.eyebrow) { max-width: 720px; font-size: 12px; line-height: 1.7; }
.dashboard .last-sync { font-size: 10px; color: var(--text-muted); }
.dashboard .workspace .overview-status-board { margin: 0; overflow: visible; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.dashboard .workspace .overview-server-banner { padding: 6px 0 24px; gap: 15px; border: 0; background: transparent; }
.dashboard .overview-guild-avatar { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 8px; background: var(--surface); }
.dashboard .overview-guild-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.dashboard .overview-guild-copy > span { font-size: 10px; color: var(--text-muted); }
.dashboard .overview-guild-copy h2 { margin: 5px 0 7px; font-size: 21px; font-weight: 700; }
.dashboard .overview-guild-copy p { font-size: 11px; }
.dashboard .overview-kpi-strip { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--background-secondary); }
.dashboard .workspace .overview-kpi-strip article { display: flex; align-items: flex-start; gap: 14px; padding: 22px; border: 0; border-right: 1px solid var(--border); background: transparent; }
.dashboard .overview-kpi-strip article:last-child { border: 0; }
.dashboard .overview-kpi-strip article > i { margin-top: 3px; width: auto; height: auto; padding: 0; border: 0; background: transparent; color: var(--accent-hover); font-size: 14px; }
.dashboard .overview-kpi-strip article:nth-child(2) > i { color: var(--success); }
.dashboard .overview-kpi-strip article:nth-child(3) > i { color: var(--info); }
.dashboard .overview-kpi-strip article:nth-child(4) > i { color: var(--warning); }
.dashboard .overview-kpi-strip article > div { display: grid; gap: 10px; }
.dashboard .overview-kpi-strip article span { font-size: 11px; color: var(--text-muted); }
.dashboard .workspace .overview-kpi-strip strong { font-size: 24px; font-weight: 600; line-height: 1.2; }
.workspace-recent { display: flex; align-items: center; gap: 20px; padding: 18px 0; margin-bottom: 12px; border-bottom: 1px solid var(--workspace-line); }
.workspace-recent h2 { flex: 0 0 auto; margin: 0; font-size: 10px; color: var(--text-muted); font-weight: 500; }
.workspace-recent > div { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.workspace-recent-link { display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 0; border: 0; background: transparent; font: inherit; font-size: 11px; color: var(--text-secondary); cursor: pointer; }
.workspace-recent-link i { font-size: 10px; color: var(--text-muted); }
.workspace-recent-link:hover, .workspace-recent-link:hover i { color: var(--accent-hover); }
.dashboard .overview-dashboard-grid { grid-template-columns: minmax(0,1fr) 290px; gap: 32px; margin-top: 8px; }
.dashboard .overview-main-column, .dashboard .overview-side-column { min-width: 0; }
.dashboard .overview-side-column { display: grid; grid-template-columns: minmax(0,1fr); grid-auto-rows: max-content; align-content: start; gap: 20px; }
.dashboard .workspace .overview-plan-usage { width: 100%; margin: 0; }
.dashboard .workspace .overview-plan-content { grid-template-columns: 32px minmax(0,1fr); gap: 10px; }
.dashboard .overview-plan-content .state-badge { grid-column: 2; justify-self: start; }
.dashboard .workspace .module-status { display: flex; flex-direction: column; gap: 12px; }
.dashboard .workspace .module-status-main { width: 100%; grid-template-columns: 28px minmax(0,1fr) 10px; padding: 0; gap: 10px; }
.dashboard .workspace .module-status-control { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 12px 0 0; margin-top: auto; border: 0; border-top: 1px solid var(--workspace-line); background: transparent; }
.dashboard .module-status-copy small { font-size: 11px; line-height: 1.6; }
.dashboard .workspace .setup-summary { padding: 20px 0 24px; margin-bottom: 8px; border: 0; border-bottom: 1px solid var(--workspace-line); border-radius: 0; background: transparent; box-shadow: none; }
.dashboard .setup-copy h2 { font-size: 14px; }
.dashboard .setup-copy p { font-size: 11px; line-height: 1.7; }
.dashboard .setup-score { width: 52px; height: 52px; flex-basis: 52px; font-size: 14px; }
.dashboard .workspace .section-heading h2 { font-size: 14px; font-weight: 650; }
.dashboard .workspace .section-heading p { font-size: 11px; line-height: 1.6; color: var(--text-muted); }
.dashboard .workspace .overview-module-heading { align-items: flex-start; flex-wrap: wrap; gap: 14px; padding: 22px 0 18px; }
.dashboard .overview-module-filters { width: auto; padding: 3px; background: var(--background-secondary); border: 1px solid var(--border); border-radius: 6px; }
.dashboard .overview-module-filters button { padding: 7px 9px; font-size: 10px; }
.dashboard .workspace .module-status-grid { gap: 10px; }
.dashboard .workspace .module-status { min-height: 96px; padding: 16px; background: var(--background-secondary); border: 1px solid var(--border); border-radius: 6px; box-shadow: none; transition: border-color .18s,background-color .18s; }
.dashboard .workspace .module-status:hover { background: var(--surface); border-color: var(--border-hover); transform: none; }
.dashboard .module-status strong { font-size: 12px; }
.dashboard .workspace .overview-side-panel { border: 0; border-left: 1px solid var(--workspace-line); padding-left: 24px; background: transparent; border-radius: 0; box-shadow: none; }
.dashboard .overview-plan-accent { display: none; }
.dashboard .workspace .overview-plan-content, .dashboard .workspace .overview-plan-usage { padding-inline: 0; }
.dashboard .workspace .overview-side-heading { padding: 20px 0 14px; }
.dashboard .workspace .overview-quick-actions button { padding: 14px 0; }
.dashboard .workspace .overview-plan-action { padding: 15px 0; background: transparent; color: var(--accent-hover); }
.dashboard .workspace .button { border-radius: 6px; min-height: 38px; font-size: 11px; box-shadow: none; }
body[data-dashboard-accent] .dashboard .workspace .button-primary { background: var(--dashboard-user-accent,var(--accent)); border-color: var(--dashboard-user-accent,var(--accent)); color: white; box-shadow: none; }
body[data-dashboard-accent] .dashboard .workspace .configuration-surface:not(:is(#general-form,#logs-form,#counters-form,#mention-replies-form,#autorole-form)) { padding: 8px 0 24px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.dashboard .workspace .configuration-surface > .settings-disclosure { padding-block: 8px; border-bottom: 1px solid var(--workspace-line); }
.dashboard .workspace .settings-section-body { padding-top: 18px; }
.dashboard .workspace .setting-row { border-color: var(--workspace-line); }
.dashboard .workspace :is(input,textarea,select) { border-radius: 5px; }
.dashboard .workspace :is(.stat-card,.analytics-stat,.report-status-card,.table-wrap,.case-table-surface) { box-shadow: none; }
.dashboard .workspace .view.active { animation: workspace-reveal .2s ease both; }
@keyframes workspace-reveal { from { opacity: .5; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.workspace-group-toggle:focus-visible, .workspace-pin-link:focus-visible, .workspace-recent-link:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
.dashboard.is-collapsed .workspace-nav-filter, .dashboard.is-collapsed .workspace-pinned { display: none; }
.dashboard.is-collapsed .sidebar .nav-item { grid-template-columns: 25px; justify-content: center; padding-inline: 0; }
.dashboard.is-collapsed .workspace-group-collapsed > .nav-item:not(.hidden):not(.workspace-filtered-out) { display: grid !important; }
@media (max-width:1200px) {
  .dashboard .topbar .panel-change-status { display: none; }
  .dashboard .overview-dashboard-grid { grid-template-columns: minmax(0,1fr) 250px; gap: 20px; }
  .dashboard .workspace .overview-kpi-strip article { padding: 18px 14px; }
}
@media (max-width:1000px) {
  .dashboard .overview-dashboard-grid { grid-template-columns: minmax(0,1fr); }
  .dashboard .overview-side-column { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
  .dashboard .workspace .overview-side-panel { border-left: 0; border-top: 1px solid var(--border); padding: 8px 0 0; }
  .dashboard .topbar .panel-search-trigger { width: 38px; padding: 0; justify-content: center; }
  .dashboard .panel-search-trigger > span, .dashboard .panel-search-trigger > kbd { display: none; }
}
@media (max-width:620px) {
  .dashboard .topbar { padding-inline: 12px; gap: 5px; height: 64px; }
  .dashboard .topbar-title { min-width: 0; flex-basis: 0; }
  .dashboard .topbar-title #active-guild-name { max-width: 95px; font-size: 10px; }
  .dashboard .topbar-title strong { font-size: 11px; }
  .dashboard .workspace .workspace-pin-button { display: grid; place-items: center; width: 32px; min-width: 32px; height: 32px; padding: 0; border: 1px solid var(--border); border-radius: 5px; background: transparent; color: var(--text-muted); }
  .dashboard .workspace .workspace-pin-button[aria-pressed="true"] { color: var(--accent-hover); }
  .dashboard .workspace .view-heading:has(.workspace-pin-button) { display: flex; flex-wrap: wrap; }
  .dashboard .workspace .view-heading:has(.workspace-pin-button) > div:first-child { flex: 1; min-width: 0; }
  .dashboard .view-heading:has(.workspace-pin-button) .last-sync { order: 3; max-width: none; flex-basis: 100%; text-align: left; }
  .dashboard .topbar .panel-search-trigger { width: 30px; min-width: 30px; }
  .dashboard .workspace-scroll { height: calc(100dvh - 64px); }
  .dashboard .view-stack { padding: 22px 16px 56px; }
  .dashboard .workspace .view-heading { align-items: flex-start; gap: 12px; }
  .dashboard .workspace .view-heading h1 { font-size: 22px; }
  .dashboard .last-sync { max-width: 100px; text-align: right; font-size: 9px; }
  .dashboard .workspace .overview-server-banner { flex-wrap: wrap; gap: 12px; }
  .dashboard .overview-guild-copy { flex: 1; min-width: 0; }
  .dashboard .overview-guild-copy h2 { font-size: 18px; overflow-wrap: anywhere; }
  .dashboard .overview-server-banner > .button { margin-left: 64px; }
  .dashboard .overview-kpi-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard .workspace .overview-kpi-strip article { padding: 18px 14px; border-bottom: 1px solid var(--border); }
  .dashboard .workspace .overview-kpi-strip article:nth-child(2) { border-right: 0; }
  .dashboard .workspace .overview-kpi-strip article:nth-child(3) { border-bottom: 0; }
  .dashboard .workspace .overview-kpi-strip strong { font-size: 22px; }
  .workspace-recent { align-items: flex-start; flex-direction: column; gap: 10px; }
  .workspace-recent > div { gap: 6px 16px; }
  .dashboard .overview-side-column { grid-template-columns: minmax(0,1fr); }
  .dashboard .workspace .module-status { padding: 12px; }
  .dashboard .overview-module-filters { width: 100%; }
  .dashboard .overview-module-filters button { flex: 1; }
}
@media (prefers-reduced-motion:reduce) { .dashboard .workspace .view.active { animation: none; } .workspace-group-arrow { transition: none; } }
