/**
 * DWS Dashboard - Light Theme + Sidebar Layout
 * ワークフロー管理ダッシュボード用スタイル
 */
:root {
    --dash-bg: #f5f7fa;
    --dash-surface: #ffffff;
    --dash-surface-hover: #f8fafc;
    --dash-border: #e2e8f0;
    --dash-border-light: #edf2f7;
    --dash-text: #1a202c;
    --dash-text-secondary: #4a5568;
    --dash-text-muted: #a0aec0;
    --dash-primary: #4299e1;
    --dash-primary-light: #ebf8ff;
    --dash-success: #48bb78;
    --dash-success-light: #f0fff4;
    --dash-warning: #ed8936;
    --dash-warning-light: #fffaf0;
    --dash-danger: #e53e3e;
    --dash-info: #805ad5;
    --dash-info-light: #faf5ff;
    --dash-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --dash-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --dash-radius: 12px;
    --dash-radius-sm: 8px;
    --dash-transition: all 0.2s ease;
    --sidebar-w: 240px;
    --sidebar-w-collapsed: 60px;
    --topbar-h: 52px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body.dashboard-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--dash-bg); color: var(--dash-text); line-height: 1.6; min-height: 100vh;
}

/* ═══ Layout ═══ */
.dash-layout { display: flex; min-height: 100vh; overflow-x: hidden; }
.dash-main {
    flex: 1;
    margin-left: var(--sidebar-w);
    transition: margin-left 0.25s ease;
    display: flex;
    flex-direction: column;
    /* ヘッダー固定を安定させるため、ページ全体スクロールに寄せる */
    overflow-y: visible;
    will-change: margin-left;
}
.dash-layout.collapsed .dash-main { margin-left: var(--sidebar-w-collapsed); }

/* 初期描画のチラつき(FOUC)対策
 * head内スクリプトで <html> に dws-sidebar-collapsed を付与するため、
 * dash-layout に collapsed が付く前でも閉状態の見た目を確定させる
 */
html.dws-sidebar-collapsed .dash-main { margin-left: var(--sidebar-w-collapsed); }

/* ═══ Sidebar ═══ */
.dash-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
    background: var(--dash-surface); border-right: 1px solid var(--dash-border);
    display: flex; flex-direction: column; z-index: 60;
    transition: width 0.25s ease;
    overflow-x: hidden;
    will-change: width;
}
.dash-layout.collapsed .dash-sidebar { width: var(--sidebar-w-collapsed); }

/* 初期描画のチラつき(FOUC)対策（dash-layoutにcollapsedが付く前の補完） */
html.dws-sidebar-collapsed .dash-sidebar { width: var(--sidebar-w-collapsed); }

/* 初期描画時の文字チラつき防止（初回だけサイドバー配下のアニメーションを止める） */
html.dws-sidebar-init .dash-sidebar,
html.dws-sidebar-init .dash-sidebar * {
    transition: none !important;
}
/* 折りたたみ時にラベル類をフェードアウトさせ、体感を滑らかにする */
.sidebar-label,
.nav-group-title {
    transition: opacity 0.18s ease, visibility 0.18s ease;

    /* サイドバー縮小中にテキストが折り返して一瞬改行されるのを防ぐ */
    white-space: nowrap;
}
.dash-layout.collapsed .sidebar-label,
.dash-layout.collapsed .nav-group-title {
    opacity: 0;
    visibility: hidden;
}

.sidebar-header {
    height: var(--topbar-h);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding-bottom: 8px; 
}
.sidebar-header::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%); /* 中央基準 */
    width: 80%;
    height: 2px;
    background: var(--dash-border);
}
.dash-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 17px;
    color: var(--dash-text);
    text-decoration: none;

    /* サイドバー縮小中にロゴ文字が折り返して一瞬改行されるのを防ぐ */
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
}
.dash-logo-icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
    background: linear-gradient(135deg, #4299e1, #667eea);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;

    /* ロゴアイコンは縮小しても崩さない */
    flex-shrink: 0;
}
.sidebar-nav { flex: 1; padding: 8px 0; overflow-y: auto; overflow-x: hidden; }
.nav-group { padding: 4px 0; }
.nav-group-title {
    padding: 8px 16px 4px; font-size: 10px; font-weight: 700; letter-spacing: 1px;
    color: var(--dash-text-muted); text-transform: uppercase;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 16px; margin: 1px 8px; border-radius: 8px;
    font-size: 13px; font-weight: 500; color: var(--dash-text-secondary);
    text-decoration: none; transition: var(--dash-transition); white-space: nowrap;
}
.nav-item i { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }
.nav-item:hover { background: var(--dash-bg); color: var(--dash-text); }
.nav-item.active { background: var(--dash-primary-light); color: var(--dash-primary); font-weight: 600; }
.nav-item.filter-active { background: #edf2f7; color: var(--dash-primary); }

.nav-badge {
    margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 10px;
    font-size: 11px; font-weight: 700; text-align: center; line-height: 18px;
}
.nav-badge.blue { background: var(--dash-primary-light); color: var(--dash-primary); }
.nav-badge.orange { background: var(--dash-warning-light); color: #c05621; }
.nav-badge.purple { background: var(--dash-info-light); color: var(--dash-info); }
.nav-badge.gray { background: #f7fafc; color: var(--dash-text-muted); }

/* Sidebar header action */
.sidebar-header-actions { display: flex; align-items: center; gap: 8px; }
.sidebar-collapse-btn {
    width: 36px; height: 36px;
    border: none; border-radius: 8px; background: transparent;
    color: var(--dash-text-muted); cursor: pointer; font-size: 14px;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: inline-flex; align-items: center; justify-content: center;
}
.sidebar-collapse-btn:hover { background: var(--dash-bg); color: var(--dash-text); }
.dash-layout.collapsed .sidebar-collapse-btn i { transform: rotate(180deg); }


/* PC版のTopbar開くボタンをサイドバーの閉じるボタンと同じ見た目に寄せる */
.dash-layout.collapsed .topbar-menu-btn {
    border-radius: 8px;
    background: transparent;
    color: var(--dash-text-muted);
}
.dash-layout.collapsed .topbar-menu-btn:hover {
    background: var(--dash-bg);
    color: var(--dash-text);
}


/* サイドバー下部の折りたたみ領域は廃止（ボタンをヘッダーへ移動） */
.sidebar-footer { display: none; }

/* ═══ Topbar ═══ */
.dash-topbar {
    height: var(--topbar-h); padding: 0 24px;
    background: var(--dash-surface); border-bottom: 2px solid var(--dash-border);
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 80;
}
.dash-topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-menu-btn {
    /* PCは常時DOM上に配置し、表示はopacityで制御してカクつきを抑える */
    display: inline-flex;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--dash-text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.2s cubic-bezier(.2,.8,.2,1),
                transform 0.2s cubic-bezier(.2,.8,.2,1),
                background-color 0.2s ease,
                color 0.2s ease;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;

    /* PCでは通常は非表示（クリック不可）にしておく */
    opacity: 0;
    pointer-events: none;
    transform: translateX(-4px);
}
.topbar-menu-btn:hover { background: var(--dash-bg); color: var(--dash-text); }

/* アイコンはPC/モバイルで切り替える */
.topbar-menu-btn .topbar-icon-open { display: inline-block; }
.topbar-menu-btn .topbar-icon-mobile { display: none; }

/* PCのTopbar側には開閉ボタンを出さない（サイドバー内の開くボタンに寄せる） */
.dash-layout.collapsed .topbar-menu-btn {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-4px);
}

/* 表示/非表示のカクつきを抑える（領域は常に確保する） */
.dash-topbar-left { min-height: var(--topbar-h); }

/* Topbar左側のダミー領域は使わない（不要な余白の原因になるため） */
.dash-topbar-left::before { display: none !important; }
.dash-topbar-left .topbar-menu-btn { margin-left: 0 !important; }

.dash-page-title { font-size: 16px; font-weight: 600; }
.dash-topbar-right { display: flex; align-items: center; gap: 8px; }

/* ═══ Content ═══ */
.dash-content { padding: 24px; flex: 1; }

/* ═══ Buttons ═══ */
.btn-dash {
    padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 500;
    border: none; cursor: pointer; transition: var(--dash-transition);
    display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
.btn-dash.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-dash-primary { background: var(--dash-primary); color: #fff; }
.btn-dash-primary:hover { background: #3182ce; }
.btn-dash-outline {
    background: var(--dash-surface); color: var(--dash-text-secondary);
    border: 1px solid var(--dash-border);
}
.btn-dash-outline:hover { background: var(--dash-bg); }

/* ═══ FAQ List Card ═══ */
.faq-list-card {
    background: var(--dash-surface); border: 1px solid var(--dash-border);
    border-radius: var(--dash-radius); box-shadow: var(--dash-shadow-sm);
    overflow: hidden;
}
.faq-list-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--dash-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.faq-list-title-area { display: flex; align-items: center; gap: 8px; }
.faq-list-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.faq-list-title i { color: var(--dash-text-muted); }
.faq-list-meta { font-size: 12px; color: var(--dash-text-muted); }

/* dashboard.html のサマリカード見出しだけ小さくする（共通ヘッダーへ影響させない） */
.dash-cards-grid .faq-list-title { font-size: 13px; font-weight: 700; }
.dash-cards-grid .faq-list-meta { font-size: 11px; }
.faq-list-actions { display: flex; align-items: center; gap: 8px; }
.faq-search-wrapper { position: relative; }
.faq-search-wrapper i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--dash-text-muted); font-size: 12px; }
.faq-search-input {
    padding: 7px 10px 7px 30px; border: 1px solid var(--dash-border); border-radius: 6px;
    font-size: 13px; width: 200px; background: var(--dash-bg); color: var(--dash-text);
    transition: var(--dash-transition);
}
.faq-search-input:focus { outline: none; border-color: var(--dash-primary); box-shadow: 0 0 0 3px rgba(66,153,225,0.12); }

/* ═══ Table ═══ */
.faq-table { width: 100%; border-collapse: collapse; }
.faq-table thead { background: var(--dash-bg); }
.faq-table th {
    padding: 9px 16px; text-align: left; font-size: 11px; font-weight: 600;
    color: var(--dash-text-muted); text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 1px solid var(--dash-border);
}
.faq-table td {
    padding: 12px 16px; border-bottom: 1px solid var(--dash-border-light);
    font-size: 13px; color: var(--dash-text-secondary); vertical-align: middle;
}
.faq-table tbody tr { transition: var(--dash-transition); cursor: pointer; }
.faq-table tbody tr:hover { background: var(--dash-surface-hover); }
.faq-table tbody tr:last-child td { border-bottom: none; }
.faq-id { font-family: 'SF Mono','Fira Code',monospace; font-size: 11px; color: var(--dash-text-muted); }
.faq-question { font-weight: 500; color: var(--dash-text); max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.faq-score { font-family: 'SF Mono',monospace; font-size: 12px; font-weight: 600; }
.faq-time { font-size: 12px; color: var(--dash-text-muted); white-space: nowrap; }

.faq-table th.sortable { cursor: pointer; user-select: none; }
.faq-table th.sortable:hover { color: var(--dash-primary); }
.sort-icon { font-size: 10px; margin-left: 4px; opacity: 0.4; }
.faq-table th.sorted .sort-icon { opacity: 1; color: var(--dash-primary); }

/* ═══ Status Badge ═══ */
.status-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.status-badge.faq-select { background: var(--dash-primary-light); color: var(--dash-primary); }
.status-badge.faq-register { background: var(--dash-primary-light); color: var(--dash-primary); }
/* DSあり登録待ち: 青系 / DSなし登録待ち: ティール系（他バッジと重複しない固有色） */
.status-badge.faq-register-ds { background: var(--dash-primary-light); color: #2b6cb0; }
.status-badge.faq-register-no-ds { background: #e6fffa; color: #234e52; }
.status-badge.ds-confirm { background: var(--dash-warning-light); color: #c05621; }
.status-badge.ds-register { background: var(--dash-info-light); color: var(--dash-info); }
.status-badge.faq-process { background: #f7fafc; color: var(--dash-text-muted); }
.status-badge.registered { background: var(--dash-success-light); color: #276749; }
.status-badge.error { background: #fff5f5; color: var(--dash-danger); }
.status-badge.discarded { background: #f7fafc; color: var(--dash-text-muted); text-decoration: line-through; }

/* 除外カテゴリバッジ（各カテゴリー別に個別定義、現時点は内容統一） */
.status-badge.excl-no-answer      { background: #edf2f7; color: #4a5568; }
.status-badge.excl-incomplete     { background: #edf2f7; color: #4a5568; }
.status-badge.excl-temporary      { background: #edf2f7; color: #4a5568; }
.status-badge.excl-redirect       { background: #edf2f7; color: #4a5568; }
.status-badge.excl-no-info        { background: #edf2f7; color: #4a5568; }
.status-badge.excl-attachment     { background: #edf2f7; color: #4a5568; }
.status-badge.excl-reverse        { background: #edf2f7; color: #4a5568; }
.status-badge.excl-internal       { background: #edf2f7; color: #4a5568; }
.status-badge.excl-task           { background: #edf2f7; color: #4a5568; }
.status-badge.excl-case-specific  { background: #edf2f7; color: #4a5568; }
.status-badge.excl-other          { background: #edf2f7; color: #4a5568; }

/* ═══ FAQ一覧の絞り込み ═══ */
html:has(.faq-review-list) { scrollbar-gutter: stable; }
.faq-filter-select {
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--dash-border);
    border-radius: 6px;
    background: var(--dash-surface);
    color: var(--dash-text);
    font-size: 0.875rem;
    cursor: pointer;
    min-width: 160px;
}
.faq-filter-select:focus {
    outline: none;
    border-color: var(--dash-primary);
    box-shadow: 0 0 0 3px var(--dash-primary-light);
}

.faq-review-list .faq-list-header,
.faq-review-list .list-toolbar,
.faq-review-list .faq-legacy-filters {
    padding-left: 20px; padding-right: 20px;
}
.faq-review-list { font-family: inherit; }
.faq-review-list .faq-list-title { font-size: 15px; font-weight: 600; line-height: 1.5; }
.faq-review-list .faq-list-meta,
.faq-review-list .faq-date-filter,
.faq-review-list .faq-card-time,
.faq-review-list .filter-tab-count,
.faq-review-list #selectedCount,
.faq-review-list .faq-pagination-info {
    font-family: inherit; font-size: 12px; font-weight: 400; line-height: 1.5;
}
.faq-review-list .filter-tab,
.faq-review-list .sort-btn,
.faq-review-list .sort-label,
.faq-review-list .btn-dash,
.faq-review-list .faq-pagination-btn,
.faq-review-list .faq-completion-menu button,
.faq-review-list .faq-completion-toggle {
    font-family: inherit; font-size: 13px; font-weight: 500; line-height: 1.4;
}
.faq-review-list .faq-page-jump input {
    font-family: inherit; font-size: 13px; font-weight: 400; line-height: 1.4;
}
.faq-review-list .filter-tab.active,
.faq-review-list .sort-btn.active { font-weight: 600; }
.faq-review-list .faq-list-actions {
    flex: 1 1 100%; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0;
}
.faq-review-list .faq-filter-select,
.faq-review-list .faq-search-input {
    height: 34px; min-width: 0; max-width: 100%; font-family: inherit;
    font-size: 13px; font-weight: 400; line-height: 1.4; background: var(--dash-surface);
}
.faq-search-controls { display: flex; align-items: center; gap: 8px; min-width: 0; }
.faq-search-controls .faq-search-wrapper { flex: 1; min-width: 0; }
.faq-review-list .faq-legacy-filters {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    padding-top: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--dash-border-light);
}
.faq-review-list .faq-legacy-filters {
    font-size: 12px; line-height: 1.5; color: var(--dash-text-secondary); overflow-wrap: anywhere;
}
.faq-review-list [hidden] { display: none !important; }
.faq-tab-group { display: inline-flex; position: relative; }
.faq-tab-group .filter-tab { padding-right: 6px; }
.faq-completion-toggle {
    position: relative; width: 24px; border: 0; background: none; cursor: pointer;
    color: var(--dash-text-secondary);
}
.faq-completion-toggle.has-condition { color: var(--dash-primary); }
.faq-completion-toggle.has-condition::after {
    content: ''; position: absolute; width: 4px; height: 4px; border-radius: 50%;
    background: currentColor; right: 3px; top: 8px;
}
.faq-completion-menu {
    position: fixed; inset: auto; margin: 0; min-width: 188px; max-width: calc(100vw - 16px);
    padding: 4px; border: 1px solid var(--dash-border); border-radius: 8px;
    background: var(--dash-surface); color: var(--dash-text); box-shadow: var(--dash-shadow-md);
}
.faq-completion-menu:popover-open { display: grid; }
.faq-completion-menu button {
    padding: 8px 10px; border: 0; border-radius: 4px; background: none; color: inherit;
    text-align: left; cursor: pointer; white-space: normal;
}
.faq-completion-menu button:hover,
.faq-completion-menu button[aria-pressed="true"] {
    background: var(--dash-primary-light); color: var(--dash-primary);
}
.faq-completion-toggle:focus-visible,
.faq-completion-menu button:focus-visible {
    outline: 2px solid var(--dash-primary); outline-offset: -2px;
}
.faq-review-list .faq-search-input:focus {
    box-shadow: 0 0 0 3px var(--dash-primary-light);
}
.faq-review-list .faq-date-filter {
    display: flex; align-items: center; gap: 6px; min-width: 0;
    font-size: 12px; color: var(--dash-text-secondary); white-space: nowrap;
}
.faq-review-list .faq-date-filter input { width: 144px; padding: 0 6px; }
.faq-review-list .list-toolbar { flex-wrap: wrap; gap: 8px; }
.faq-review-list .sort-btn { min-height: 28px; font-family: inherit; line-height: 1.4; }
.faq-clear-conditions {
    padding: 0 10px; min-height: 34px; border: 1px solid var(--dash-border); border-radius: 6px;
    background: var(--dash-surface); font-family: inherit; font-size: 13px; font-weight: 500;
    line-height: 1.4; color: var(--dash-text-secondary); cursor: pointer; white-space: nowrap;
    flex-shrink: 0;
}
.faq-clear-conditions:hover:not(:disabled) { color: var(--dash-primary); background: var(--dash-primary-light); }
.faq-clear-conditions:disabled { color: var(--dash-text-muted); background: var(--dash-bg); cursor: not-allowed; }
.faq-review-list .sort-btn:focus-visible,
.faq-clear-conditions:focus-visible {
    outline: 2px solid var(--dash-primary); outline-offset: 2px;
}
.evaluated-faq-list .faq-filter-error { width: 100%; margin: 0; color: var(--dash-danger); font-size: 12px; }
.evaluated-faq-list .faq-completion-badge { background: var(--dash-bg); color: var(--dash-text-secondary); }

/* ═══ Pagination ═══ */
.faq-pagination {
    padding: 12px 20px; border-top: 1px solid var(--dash-border);
    display: flex; align-items: center; justify-content: space-between;
}
.faq-pagination-info { font-size: 12px; color: var(--dash-text-muted); }
.faq-pagination-btns { display: flex; gap: 4px; }
.faq-pagination-btn {
    padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 500;
    border: 1px solid var(--dash-border); background: var(--dash-surface);
    color: var(--dash-text-secondary); cursor: pointer; transition: var(--dash-transition);
}
.faq-pagination-btn:hover:not(:disabled) { background: var(--dash-bg); }
.faq-pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.faq-pagination-btn.active { background: var(--dash-primary); color: #fff; border-color: var(--dash-primary); }

.faq-page-jump input {
    padding: 6px; border: 1px solid var(--dash-border); border-radius: 6px;
    background: var(--dash-surface); color: var(--dash-text); font-size: 12px;
}
.excluded-review-toolbar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 12px 20px; border-bottom: 1px solid var(--dash-border); font-size: 13px;
}
.excluded-review-toolbar label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.excluded-review-toolbar #selectPage,
.excluded-faq-list .excluded-faq-select {
    width: 14px; height: 14px; margin: 0; accent-color: var(--dash-primary);
}
.excluded-review-toolbar #selectedCount {
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
    color: var(--dash-text-secondary);
}
.excluded-selection-sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.excluded-review-toolbar button:disabled { opacity: 0.4; cursor: not-allowed; }
.status-badge.excluded-required,
.status-badge.excluded-unrequired {
    width: 64px; height: 26px; justify-content: center; padding: 3px 8px;
}
.status-badge.excluded-required { background: #276749; color: #fff; }
.status-badge.excluded-unrequired { background: #c53030; color: #fff; }
.btn-dash.excluded-required-action {
    background: var(--dash-success-light); color: #276749;
}
.btn-dash.excluded-unrequired-action {
    background: #fff5f5; color: var(--dash-danger);
}
.btn-dash.excluded-required-action { border-color: var(--dash-success); }
.btn-dash.excluded-unrequired-action { border-color: var(--dash-danger); }
.btn-dash.excluded-required-action:hover:not(:disabled) { background: #c6f6d5; }
.btn-dash.excluded-unrequired-action:hover:not(:disabled) { background: #fed7d7; }
#requiredChangeModal button:disabled { opacity: 0.4; cursor: not-allowed; }
.excluded-faq-select { cursor: pointer; flex-shrink: 0; accent-color: var(--dash-primary); }
.faq-review-list .faq-pagination { flex-wrap: wrap; gap: 12px; }
.faq-page-jump { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.faq-page-jump label { display: flex; align-items: center; gap: 6px; }
.faq-page-jump input { width: 72px; }

/* ═══ Empty / Skeleton / Toast / Banner ═══ */
.faq-empty { padding: 48px 20px; text-align: center; }
.faq-empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.3; }

/* ═══ Modal (Common) ═══
 *   ダッシュボード配下の各画面で共通利用するモーダル基盤。
 * - 旧 `.modal-overlay` 等の汎用名は競合しやすいため使用しない
 * - 表示/非表示は `.is-open`（または `.active`）で制御する
 * - 各画面固有のサイズ/内容はページCSS側で上書きする
 */
.dash-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 32, 44, 0.6);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5200;
}

.dash-modal-overlay.is-open,
.dash-modal-overlay.active {
  display: flex;
}

.dash-modal {
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: 12px;
  width: min(92vw, 620px);
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--dash-shadow-md);
  display: flex;
  flex-direction: column;
}

.dash-modal.dash-modal-wide {
  width: min(92vw, 920px);
}

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

  /* モーダル本文がスクロールする場合でもヘッダは見えるようにする */
  position: sticky;
  top: 0;
  background: var(--dash-surface);
  z-index: 2;
}

.dash-modal-title {
  font-size: 16px;
  font-weight: 800;
}

.dash-modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--dash-border);
  background: var(--dash-bg);
  border-radius: 8px;
  cursor: pointer;
  color: var(--dash-text-secondary);
}

.dash-modal-close:hover {
  background: var(--dash-surface-hover);
  color: var(--dash-text);
}

.dash-modal-body {
  padding: 14px 16px;
  max-height: calc(90vh - 140px);
  overflow-y: auto;
}

.dash-modal-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--dash-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.faq-empty-title { font-size: 15px; font-weight: 600; color: var(--dash-text-secondary); }
.faq-empty-desc { font-size: 13px; color: var(--dash-text-muted); margin-top: 4px; }

.skeleton { background: linear-gradient(90deg,#edf2f7 25%,#e2e8f0 50%,#edf2f7 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.skeleton-row { display: flex; align-items: center; gap: 16px; padding: 14px 16px; }
.skeleton-cell { height: 14px; border-radius: 4px; }

.dash-toast-container { position: fixed; top: 64px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.dash-toast {
    padding: 10px 16px; border-radius: 8px; font-size: 13px; font-weight: 500;
    box-shadow: var(--dash-shadow-md); transform: translateX(120%); transition: transform 0.3s ease;
    display: flex; align-items: center; gap: 8px; max-width: 340px;
}
.dash-toast.show { transform: translateX(0); }
.dash-toast.success { background: #f0fff4; color: #276749; border: 1px solid #c6f6d5; }
.dash-toast.info { background: #ebf8ff; color: #2a4365; border: 1px solid #bee3f8; }
.dash-toast.error { background: #fff5f5; color: #742a2a; border: 1px solid #fed7d7; }

.info-banner {
    background: #ebf8ff; border: 1px solid #bee3f8; border-radius: var(--dash-radius-sm);
    padding: 12px 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: #2a4365;
}
.info-banner i { font-size: 16px; color: var(--dash-primary); flex-shrink: 0; }

/* ═══ Responsive ═══ */
@media (max-width: 768px) {
    .dash-sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-w);
        /* モバイルでサイドバーをTopbarより前面に表示する */
        z-index: 120;
    }
    .dash-layout.mobile-open .dash-sidebar { transform: translateX(0); }
    .dash-main { margin-left: 0 !important; }

    /* モバイルは従来通りハンバーガーを常時表示（少し濃く・大きめ） */
    .topbar-menu-btn {
        display: inline-flex;
        opacity: 1;
        pointer-events: auto;
        transform: none;
        width: 44px;
        height: 44px;
        color: #6b7280; /* 以前より濃いグレー */
    }
    .topbar-menu-btn .topbar-icon-open { display: none; }
    .topbar-menu-btn .topbar-icon-mobile { display: inline-block; }
    .topbar-menu-btn i { font-size: 18px; }

    /* モバイルでは領域確保のダミーは不要 */
    .dash-topbar-left::before { display: none !important; }
    .dash-topbar-left .topbar-menu-btn { margin-left: 0; }

    .dash-content { padding: 16px; }
    .faq-search-input { width: 140px; }
}

/* PC表示ではTopbarの開くボタンは使わない（サイドバー内のボタンを使用） */
@media (min-width: 769px) {
    .topbar-menu-btn {
        display: none !important;
    }
}

/* ダッシュボードのカード群を2カラムで表示するグリッド */
.dash-cards-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 300px));
    gap: 16px;
    justify-content: start;

    /* 2カラム内のカード高さを揃える */
    align-items: stretch;
}

/* カード自体を縦方向に伸ばし、中身（サマリ）に高さを渡す */
.dash-cards-grid > .faq-list-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ヘッダー以外の領域を伸ばして、左右カード高さを揃える */
.dash-cards-grid > .faq-list-card > .faq-card-list {
    flex: 1 1 auto;
    min-height: 0;
}

@media (max-width: 768px) {
    .dash-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════ Status Hint (FAQ tabs) ═══════ */
.dws-status-hint {
    margin: 10px 16px 0;
    padding: 12px 14px;
    border-radius: var(--dash-radius-sm);

    /* Dashboardテーマに合わせたInfo表現 */
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    color: #2a4365;
}

.dws-status-hint__title {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
}

.dws-status-hint__text {
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-line;
}

@media (max-width: 768px) {
    .dws-status-hint {
        margin: 10px 12px 0;
    }
}

/* ═══ Filter Tabs ═══ */
.filter-tabs {
    display: flex;
    flex-wrap: wrap; /* タブは折り返して表示する */
    gap: 0;
    border-bottom: 1px solid var(--dash-border);
    padding: 0 16px;
    /* overflow-x: hidden; スクロールバー表示を防ぐ */
}
.filter-tab {
    padding: 10px 16px; border: none; background: none;
    font-size: 13px; font-weight: 500; color: var(--dash-text-muted);
    cursor: pointer; transition: var(--dash-transition); white-space: nowrap;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.filter-tab:hover { color: var(--dash-text-secondary); }
.filter-tab.active { color: var(--dash-primary); border-bottom-color: var(--dash-primary); font-weight: 600; }
.filter-tab-count {
    display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 10px;
    font-size: 11px; font-weight: 700; text-align: center; margin-left: 4px;
    background: var(--dash-border-light); color: var(--dash-text-muted);
}
.filter-tab.active .filter-tab-count { background: var(--dash-primary-light); color: var(--dash-primary); }

/* ═══ List Toolbar ═══ */
.list-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 16px; border-bottom: 1px solid var(--dash-border-light);
}
.sort-group { display: flex; align-items: center; gap: 4px; }
.sort-label { font-size: 11px; color: var(--dash-text-muted); margin-right: 4px; }
.sort-btn {
    padding: 4px 10px; border: 1px solid transparent; border-radius: 6px; background: none;
    font-size: 12px; color: var(--dash-text-muted); cursor: pointer; transition: var(--dash-transition);
    display: inline-flex; align-items: center; gap: 3px;
}
.sort-btn:hover { color: var(--dash-text-secondary); background: var(--dash-bg); }
.sort-btn.active { color: var(--dash-primary); font-weight: 600; border-color: var(--dash-border); background: var(--dash-primary-light); }
.sort-btn .sort-icon { font-size: 10px; margin-left: 2px; opacity: 0.6; }

/* ═══ FAQ Card List ═══ */
.faq-card-list { padding: 0; }

/* ═══ Dashboard Summary (knowledge_admin/dashboard.html) ═══ */

/*
 * ダッシュボードのサマリは「ステータス行（可変）」＋「合計行（下固定）」で構成する
 */
.dash-summary.dash-summary-card {
    display: grid;

    /* 上段=可変（一覧）、下段=合計（必ず確保） */
    grid-template-rows: 1fr auto;

    /*
     * - 2カラムでカード高さを揃えるのは「外側のグリッド」で行う
     * - ここで height: 100% を指定すると、親の高さが確定していない場合に
     *   grid の下段（auto）が押し出され overflow: hidden で合計行が見切れることがある
     */
    height: auto;
    min-height: 0;
    overflow: hidden;
}

.dash-summary .dash-summary-list {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.dash-summary .dash-summary-row {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 16px;

    /* aタグでもリンク色に引っ張られないようにする */
    color: var(--dash-text-secondary);
    text-decoration: none;

    border-bottom: 1px solid var(--dash-border-light);
    transition: var(--dash-transition);
    background: transparent;
}

/* 最後のステータス行は、合計セクション側の区切り線に任せる */
.dash-summary .dash-summary-list .dash-summary-row:last-child {
    border-bottom: none;
}

.dash-summary .dash-summary-row:hover {
    background: var(--dash-surface-hover);
    color: var(--dash-text);
}

.dash-summary .dash-summary-label {
    font-size: 12px;
    font-weight: 600;
    color: inherit;
    min-width: 0;
}

.dash-summary .dash-summary-count {
    font-family: 'SF Mono','Fira Code',monospace;

    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.2px;

    color: var(--dash-text);
    min-width: 52px;
    text-align: right;
}

/* 合計セクション側で区切り線を引く（カード内で視覚的に収める） */
.dash-summary .dash-summary-total {
    border-top: 1px solid var(--dash-border);

    /* カード内に収めるため、ページ背景ではなくカード面（白）に合わせる */
    background: var(--dash-surface);
}

.dash-summary .dash-summary-row--total {
    border-bottom: none;
    background: transparent;
}

.dash-summary .dash-summary-row--total .dash-summary-label,
.dash-summary .dash-summary-row--total .dash-summary-count {
    color: var(--dash-text);
}

.faq-card {
    border-bottom: 1px solid var(--dash-border-light);
    transition: var(--dash-transition);
}
.faq-card:last-child { border-bottom: none; }

/* ── カード: 閉じた状態（プレビュー） ── */
.faq-card-preview {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 14px 20px; cursor: pointer; transition: background 0.15s;
}
.faq-card-preview:hover { background: var(--dash-surface-hover); }

.faq-card-expand-icon {
    margin-top: 3px; color: var(--dash-text-muted); font-size: 11px;
    transition: transform 0.2s; flex-shrink: 0; width: 14px; text-align: center;
}
.faq-card.open .faq-card-expand-icon { transform: rotate(90deg); color: var(--dash-primary); }

.faq-card-body { flex: 1; min-width: 0; }
.faq-card-question {
    font-size: 13.5px; font-weight: 600; color: var(--dash-text); line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.faq-card-title-preview {
    font-size: 12px; color: var(--dash-text-muted); margin-top: 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.faq-card-registration,
.faq-detail-registration {
    font-size: 12px; color: var(--dash-text-secondary); margin-top: 4px;
    overflow-wrap: anywhere;
}
.faq-card-registration-note {
    font-size: 12px; color: var(--dash-warning); margin: 4px 0 12px;
    overflow-wrap: anywhere;
}
@media (max-width: 600px) {
    .faq-card[data-status="REGISTERED"] .faq-card-preview { flex-wrap: wrap; }
    .faq-card[data-status="REGISTERED"] .faq-card-meta {
        flex-wrap: wrap; width: 100%; margin-left: 28px;
    }
}

.faq-card-meta {
    display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-top: 2px;
}
.faq-card-score {
    display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
    font-family: 'SF Mono','Fira Code',monospace;
}
.score-bar {
    width: 40px; height: 5px; border-radius: 3px; background: var(--dash-border-light); overflow: hidden;
}
.score-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.faq-card-time { font-size: 11px; color: var(--dash-text-muted); white-space: nowrap; min-width: 60px; text-align: right; }

.faq-review-list .faq-card-preview {
    display: grid; grid-template-columns: 14px minmax(0, 1fr) 320px;
    align-items: center; gap: 10px 14px;
}
.excluded-faq-list .faq-card-preview {
    grid-template-columns: 14px 14px minmax(0, 1fr) 320px;
}
.faq-review-list .faq-card-expand-icon { margin-top: 0; }
.faq-review-list .faq-card-question {
    font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere;
}
.faq-review-list .faq-card-meta {
    display: grid; grid-template-columns: 64px minmax(0, 1fr) 76px;
    gap: 8px; min-width: 0; margin: 0; width: 100%;
}
.faq-review-list .status-badge {
    min-width: 64px; min-height: 26px; height: auto; padding: 3px 8px;
    font-family: inherit; font-size: 11px; font-weight: 600; line-height: 18px;
    justify-content: center; text-align: center; white-space: normal; overflow-wrap: anywhere;
}
.faq-review-list .faq-card-meta > .status-badge:first-child { grid-row: 1; justify-self: start; }
.evaluated-faq-list .faq-card:not([data-status="REGISTERED"]) .faq-card-meta > .status-badge:first-child {
    grid-column: 1 / 3;
}
.faq-review-list .faq-card-classification {
    display: flex; align-items: center; grid-column: 2; grid-row: 1; min-width: 0;
}
.faq-review-list .faq-completion-badge,
.faq-review-list .excluded-faq-category { min-width: 0; max-width: 100%; justify-self: start; }
.faq-review-list .excluded-faq-category {
    grid-column: 2; grid-row: 1; height: 26px; white-space: nowrap;
}
.faq-review-list .excluded-faq-category span { overflow: hidden; text-overflow: ellipsis; }
.faq-review-list .status-badge.excluded-required,
.faq-review-list .status-badge.excluded-unrequired { width: 64px; height: 26px; grid-column: 1; }
.faq-review-list .faq-card-time { grid-column: 3; grid-row: 1; min-width: 0; text-align: left; }

@media (max-width: 1100px) {
    .evaluated-faq-list .faq-card-preview { grid-template-columns: 14px minmax(0, 1fr); }
    .evaluated-faq-list .faq-card-meta { grid-column: 1 / -1; max-width: 320px; }
    .excluded-faq-list .faq-card-preview { grid-template-columns: 14px 14px minmax(0, 1fr); }
    .excluded-faq-list .faq-card-meta { grid-column: 1 / -1; max-width: 320px; }
}
@media (max-width: 600px) {
    .faq-review-list .faq-card-meta {
        grid-column: 1 / -1; grid-template-columns: 64px minmax(0, 1fr) 60px; max-width: none;
    }
    .faq-review-list .faq-card-question { display: block; overflow: visible; -webkit-line-clamp: unset; }
    .faq-review-list .faq-card[data-status="REGISTERED"] .faq-card-meta { margin-left: 0; }
    .faq-review-list .faq-list-actions > * { flex: 1 1 100%; }
    .faq-review-list .faq-filter-select,
    .faq-review-list .faq-search-input { width: 100%; }
    .faq-search-controls .faq-search-wrapper { width: 0; }
    .faq-review-list .faq-date-filter input { flex: 1; width: 0; }
    .faq-review-list .faq-pagination { padding: 12px; }
    .faq-review-list .faq-pagination-btns { flex-wrap: wrap; gap: 2px; }
    .faq-review-list .faq-pagination-btns .faq-pagination-btn {
        min-width: 24px; padding: 5px 4px; white-space: nowrap;
    }
    .excluded-faq-list .faq-page-jump { width: 100%; }
}

/* ── カード: 開いた状態（詳細） ── */
.faq-card-detail {
    padding: 0 20px 16px 48px;
}

.faq-detail-section { margin-bottom: 12px; }
.faq-detail-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--dash-text-muted); margin-bottom: 4px;
}
.faq-detail-text {
    font-size: 13px; color: var(--dash-text-secondary); line-height: 1.7;
    background: var(--dash-bg); border-radius: 8px; padding: 10px 14px;
    white-space: pre-wrap; word-break: break-word; max-height: 200px; overflow-y: auto;
}

.faq-detail-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.faq-detail-tag {
    padding: 2px 8px; border-radius: 4px; font-size: 11px;
    background: var(--dash-border-light); color: var(--dash-text-secondary);
}

.faq-detail-actions {
    display: flex; align-items: center; gap: 8px; padding-top: 8px;
    border-top: 1px solid var(--dash-border-light);
}
.faq-detail-id { font-family: 'SF Mono',monospace; font-size: 11px; color: var(--dash-text-muted); }

/* ── 詳細ロード中 ── */
.faq-detail-loading {
    display: flex; align-items: center; gap: 8px; padding: 16px 0;
    font-size: 12px; color: var(--dash-text-muted);
}
.faq-detail-loading i { animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* ── 統計チャート 系列カラー ──
   Chart.js に渡す色は JS の _getChartColor() が CSS変数から読み取る。
   新しいMetricsTypeを追加したらここにクラスを追加するだけでよい。
   --chart-line: 折れ線・枠線色 (不透明)
   --chart-fill: 塗り面色 (半透明)
*/
.chart-teams-json { --chart-line: #3b82f6; --chart-fill: rgba(59, 130, 246, 0.15); }
.chart-teams-dm   { --chart-line: #f97316; --chart-fill: rgba(249, 115, 22, 0.12); }
.chart-teams-ch   { --chart-line: #10b981; --chart-fill: rgba(16, 185, 129, 0.12); }
.chart-snow       { --chart-line: #8b5cf6; --chart-fill: rgba(139, 92, 246, 0.15); }
.chart-manual     { --chart-line: #64748b; --chart-fill: rgba(100, 116, 139, 0.10); }
.chart-faq        { --chart-line: #22c55e; --chart-fill: rgba(34, 197, 94, 0.18); }
.chart-ds         { --chart-line: #f59e0b; --chart-fill: rgba(245, 158, 11, 0.18); }

/* ═══ Statistics Section ═══ */
.dash-main:has(#statsResults) { min-width: 0; }
#statsResults .stats-chart-card { min-width: 0; }

.stats-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--dash-border);
}

.stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.stats-title-area { display: flex; flex-direction: column; gap: 2px; }
.stats-title {
    font-size: 15px; font-weight: 700; color: var(--dash-text); margin: 0;
    display: flex; align-items: center; gap: 8px;
}
.stats-title i { color: var(--dash-primary); font-size: 14px; }
.stats-subtitle { font-size: 12px; color: var(--dash-text-muted); }

.stats-filter-controls {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: flex-end; gap: 12px;
    max-width: 100%; min-width: 0;
}
.stats-date-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; max-width: 100%; }
.stats-date-field {
    display: flex; flex-direction: column; gap: 4px; min-width: 0;
    font-size: 12px; color: var(--dash-text-secondary);
}
.stats-date-field input {
    width: 144px; max-width: 100%; min-height: 34px; min-width: 0; padding: 4px 6px;
    border: 1px solid var(--dash-border); border-radius: 6px;
    background: var(--dash-surface); color: var(--dash-text); font: inherit;
}
.stats-date-field input:focus-visible,
.stats-date-filter button:focus-visible,
.stats-period-btn:focus-visible { outline: 2px solid var(--dash-primary); outline-offset: 2px; }
.stats-message, .stats-applied-period {
    margin: 0 0 12px; font-size: 12px; color: var(--dash-text-muted);
}
.stats-message-error { color: var(--dash-danger); }

/* 期間トグル */
.stats-period-toggle {
    display: flex; gap: 2px;
    background: var(--dash-bg); border-radius: 8px; padding: 3px;
}
.stats-period-btn {
    padding: 5px 14px; border-radius: 6px; border: none;
    font-size: 12px; font-weight: 600; cursor: pointer;
    transition: all 0.15s;
    background: transparent; color: var(--dash-text-muted);
}
.stats-period-btn:hover { color: var(--dash-text-secondary); }
.stats-period-btn.active {
    background: var(--dash-surface); color: var(--dash-text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* KPI カード */
.stats-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.stats-kpi-card {
    background: var(--dash-surface);
    border: 1px solid var(--dash-border);
    border-radius: var(--dash-radius-sm);
    padding: 14px 16px;
    display: flex; align-items: center; gap: 12px;
    box-shadow: var(--dash-shadow-sm);
}
.stats-kpi-icon {
    width: 36px; height: 36px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0;
}
.stats-kpi-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.stats-kpi-label { font-size: 11px; color: var(--dash-text-muted); font-weight: 600; }
.stats-kpi-value {
    font-size: 22px; font-weight: 800; color: var(--dash-text);
    font-family: 'SF Mono','Fira Code',monospace;
    letter-spacing: -0.5px;
}

/* グラフグリッド */
.stats-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.stats-chart-card {
    background: var(--dash-surface);
    border: 1px solid var(--dash-border);
    border-radius: var(--dash-radius);
    padding: 16px;
    box-shadow: var(--dash-shadow-sm);
}
.stats-chart-card.stats-chart-full {
    grid-column: 1 / -1;
}
.stats-chart-title {
    font-size: 13px; font-weight: 700; color: var(--dash-text);
    margin-bottom: 12px;
    display: flex; align-items: center; gap: 6px;
}
.stats-chart-title i { color: var(--dash-text-muted); font-size: 12px; }
.stats-chart-wrap { position: relative; height: 220px; }
.stats-chart-wrap-wide { height: 200px; }

/* レスポンシブ */
@media (max-width: 768px) {
    .stats-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-charts-grid { grid-template-columns: 1fr; }
    .stats-kpi-value { font-size: 18px; }
    .stats-filter-controls { justify-content: flex-start; }
}
