/* ========================================
   ICM System - Main Stylesheet
   ======================================== */

/* CSS Variables */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --dark-text: #1e293b;
    --gray-text: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-text);
    line-height: 1.6;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--dark-text);
    color: var(--white);
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    display: block;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-item:hover,
.nav-item.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-section-title {
    padding: 20px 20px 10px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
}

/* Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Cards */
.card {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-success {
    background-color: var(--success-color);
    color: var(--white);
}

.btn-danger {
    background-color: var(--danger-color);
    color: var(--white);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--dark-text);
}

.btn-outline:hover {
    background-color: var(--light-bg);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-text);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder {
    color: var(--gray-text);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: var(--light-bg);
    font-weight: 600;
    color: var(--dark-text);
}

.table tbody tr:hover {
    background-color: var(--light-bg);
}

/* Search Box */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-box .form-control {
    flex: 1;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Login Page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-text);
}

.login-subtitle {
    color: var(--gray-text);
    margin-top: 8px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Notification Badge */
.notification-list {
    list-style: none;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--gray-text);
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-text);
}

.stat-label {
    color: var(--gray-text);
    font-size: 0.875rem;
}

/* Chart Container */
.chart-container {
    height: 300px;
    background-color: var(--light-bg);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-text);
}

/* Action Buttons Group */
.btn-group {
    display: flex;
    gap: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .page-wrapper {
        flex-direction: column;
    }
}

/* ========================================
   Dashboard Report Styles
   ======================================== */

/* レポート情報ヘッダー */
.report-info {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 24px;
    margin-bottom: 20px;
}

.report-info-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.report-info-item:last-child {
    margin-bottom: 0;
}

.report-info-label {
    font-weight: 600;
    min-width: 80px;
}

/* メインレポートコンテナ（2カラム） */
.report-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

/* 左カラム */
.report-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 右カラム */
.report-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 4象限チャートラッパー */
.quadrant-chart-wrapper {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    position: relative;
}

/* 四隅のラベル */
.quadrant-labels {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 60px;
    pointer-events: none;
    z-index: 10;
}

.quadrant-label {
    position: absolute;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
}

.quadrant-label.top-left {
    top: 0;
    left: 0;
}

.quadrant-label.top-right {
    top: 0;
    right: 0;
}

.quadrant-label.bottom-left {
    bottom: 0;
    left: 0;
}

.quadrant-label.bottom-right {
    bottom: 0;
    right: 0;
}

/* 散布図コンテナ */
.quadrant-chart-container {
    width: 100%;
    aspect-ratio: 1;
    margin: 30px 0 10px;
}

/* 凡例 */
.quadrant-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-red {
    background-color: rgba(239, 68, 68, 0.8);
}

.dot-blue {
    background-color: rgba(59, 130, 246, 0.8);
}

.dot-green {
    background-color: rgba(34, 197, 94, 0.8);
}

/* 判定セクション */
.judgment-section {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    border: 2px solid var(--dark-text);
}

.judgment-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.judgment-text {
    font-size: 0.875rem;
    line-height: 1.8;
    color: var(--dark-text);
}

/* メトリクスカード */
.metric-card {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 20px;
}

.metric-title {
    font-size: 1rem;
    font-weight: 600;
    color: #0891b2;
    border-bottom: 2px solid #0891b2;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.metric-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bar-chart-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bar-label {
    font-size: 0.75rem;
    color: var(--dark-text);
}

.bar-container {
    height: 30px;
    width: 100%;
}

/* 説明文ボックス */
.description-box {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 20px;
}

.description-box p {
    font-size: 0.75rem;
    line-height: 1.8;
    color: var(--dark-text);
}

/* 存在感・不安感セクション（修正版） */
.presence-anxiety-section {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 20px;
    border: 1px solid var(--border-color);
}

.line-chart-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.chart-side-label {
    font-size: 0.875rem;
    font-weight: 600;
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 0.3em;
    color: var(--dark-text);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.line-chart-container {
    flex: 1;
    height: 100px;
    border: 1px solid #999;
}

.x-axis-labels {
    display: flex;
    justify-content: space-around;
    padding: 12px 40px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dark-text);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin: 0;
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {
    .report-container {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Sidebar Submenu Styles
   ======================================== */

/* サブメニュー親コンテナ */
.nav-item-with-submenu {
    position: relative;
}

/* 親アイテム（クリック可能） */
.nav-item-parent {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-item-parent:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

/* 矢印アイコン */
.nav-arrow {
    font-size: 0.625rem;
    transition: transform 0.2s ease;
}

.nav-item-with-submenu.open .nav-arrow {
    transform: rotate(90deg);
}

/* サブメニュー（横にポップアップ） */
.nav-submenu {
    display: none;
    position: fixed;  /* absolute → fixed に変更 */
    background-color: #2d3748;
    min-width: 180px;
    border-radius: 0 var(--radius) var(--radius) 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    /* top と left は JavaScript で動的に設定 */
}

.nav-item-with-submenu.open .nav-submenu {
    display: block;
}

/* サブメニューアイテム */
.nav-submenu-item {
    display: block;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-submenu-item:hover,
.nav-submenu-item.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

/* 最初と最後のアイテムの角丸 */
.nav-submenu-item:first-child {
    border-radius: 0 var(--radius) 0 0;
}

.nav-submenu-item:last-child {
    border-radius: 0 0 var(--radius) 0;
}

/* ========================================
   Action Plan Approach Sheet Styles
   ======================================== */

/* 職場アプローチシート全体レイアウト */
.approach-sheet {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.approach-left,
.approach-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* セクションカード */
.approach-section {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

/* セクションタイトル（R, V, P&D, C, A） */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.section-letter {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 40px;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-text);
}

.section-subtitle {
    font-size: 0.875rem;
    color: var(--gray-text);
}

/* ヘッダー情報（所属・人数・氏名） */
.approach-header-info {
    background-color: var(--light-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.header-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-info-label {
    font-size: 0.75rem;
    color: var(--gray-text);
    font-weight: 500;
}

.header-info-value {
    font-size: 0.875rem;
    font-weight: 500;
}

/* 2x2マトリックス（現在の予想） */
.matrix-2x2 {
    width: 200px;
    height: 200px;
    border: 2px solid var(--dark-text);
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    position: relative;
    margin: 20px auto;
}

.matrix-2x2::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid var(--dark-text);
}

.matrix-2x2::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    border-left: 1px solid var(--dark-text);
}

.matrix-quadrant {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.matrix-quadrant:hover {
    background-color: var(--light-bg);
}

.matrix-quadrant.selected {
    background-color: rgba(37, 99, 235, 0.2);
}

.matrix-label-top {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.matrix-label-bottom {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 4px;
}

.matrix-label-left,
.matrix-label-right {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.2em;
}

.matrix-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* テキストエリア */
.approach-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
    line-height: 1.6;
    resize: vertical;
}

.approach-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 応援したい人テーブル */
.support-table {
    width: 100%;
    border-collapse: collapse;
}

.support-table th,
.support-table td {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    text-align: left;
    font-size: 0.875rem;
}

.support-table th {
    background-color: var(--light-bg);
    font-weight: 600;
}

.support-table input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    padding: 4px 0;
}

.support-table input:focus {
    outline: none;
}

/* 矢印図（目指したい職場の形） */
.vision-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px;
}

.vision-box {
    width: 120px;
    height: 80px;
    border: 2px solid var(--dark-text);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.vision-box-label {
    position: absolute;
    top: -20px;
    left: 0;
    font-size: 0.75rem;
    color: var(--gray-text);
}

.vision-arrow-icon {
    font-size: 2rem;
    color: var(--dark-text);
}

/* バランススライダー */
.balance-slider-container {
    padding: 20px;
}

.balance-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 500;
}

.balance-slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, var(--primary-color), var(--warning-color));
    border-radius: 4px;
    outline: none;
}

.balance-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--white);
    border: 2px solid var(--dark-text);
    border-radius: 50%;
    cursor: pointer;
}

/* これまでの取り組み（5段階評価） */
.initiative-list {
    list-style: none;
}

.initiative-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.initiative-item:last-child {
    border-bottom: none;
}

.initiative-number {
    width: 24px;
    height: 24px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.initiative-text {
    flex: 1;
    font-size: 0.875rem;
}

.initiative-rating {
    display: flex;
    gap: 4px;
}

.rating-option {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.rating-option:hover {
    border-color: var(--primary-color);
}

.rating-option.selected {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* Plan & Do / Action テーブル */
.plan-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.plan-table th,
.plan-table td {
    padding: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
    vertical-align: middle;
}

.plan-table th {
    background-color: var(--light-bg);
    font-weight: 600;
}

.plan-table input,
.plan-table select {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 0.75rem;
    padding: 4px;
    text-align: center;
}

.plan-table input:focus,
.plan-table select:focus {
    outline: none;
    background-color: rgba(37, 99, 235, 0.05);
}

.plan-table .col-narrow {
    width: 40px;
}

.plan-table .col-medium {
    width: 60px;
}

.plan-table .col-wide {
    min-width: 150px;
}

/* ========================================
   行追加・削除ボタン
   ======================================== */

/* テーブル下部のアクションエリア */
.table-actions {
    margin-top: 12px;
    text-align: left;
}

/* 行追加ボタン */
.btn-add-row {
    padding: 6px 12px;
    font-size: 0.75rem;
}

/* 行削除ボタン（アイコンボタン） */
.btn-icon {
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-delete-row {
    color: var(--gray-text);
}

.btn-delete-row:hover {
    background-color: var(--danger-color);
    color: var(--white);
}

.delete-icon {
    font-size: 1rem;
    font-weight: bold;
    line-height: 1;
}

/* テーブル内の削除ボタン列 */
.support-table .col-delete,
.plan-table .col-delete {
    width: 50px;
    text-align: center;
}

/* レスポンシブ対応 */
@media (max-width: 1200px) {
    .approach-sheet {
        grid-template-columns: 1fr;
    }
}

/* 取り組み内容の入力フィールド */
.initiative-text-input {
    flex: 1;
    font-size: 0.875rem;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: transparent;
}

.initiative-text-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ========================================
   Action Plan Check Table Styles
   ======================================== */

/* ヘッダー情報 */
.check-header-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.check-header-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.header-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.check-header-right {
    text-align: right;
}

.achievement-box {
    border: 2px solid var(--dark-text);
    padding: 12px 20px;
    border-radius: var(--radius);
}

.achievement-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
}

.achievement-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.achievement-label {
    font-size: 0.875rem;
}

.achievement-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.achievement-value.highlight {
    color: var(--primary-color);
}

.achievement-unit {
    font-size: 0.875rem;
}

/* チェック表ラッパー */
.check-table-wrapper {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
    overflow-x: auto;
}

/* チェック表 */
.check-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    min-width: 1400px;
}

.check-table th,
.check-table td {
    border: 1px solid var(--border-color);
    padding: 6px 8px;
    text-align: center;
    vertical-align: middle;
}

.check-table th {
    background-color: var(--light-bg);
    font-weight: 600;
    white-space: nowrap;
}

/* 列幅の設定 */
.check-table .col-group {
    width: 30px;
    background-color: #e8e8e8;
}

.check-table .col-target {
    width: 60px;
}

.check-table .col-viewpoint {
    width: 40px;
}

.check-table .col-category {
    width: 40px;
}

.check-table .col-action {
    min-width: 200px;
    text-align: left;
}

.check-table .col-effect {
    min-width: 150px;
    text-align: left;
}

.check-table .col-result {
    min-width: 100px;
    text-align: left;
}

.check-table .col-date {
    width: 40px;
    font-size: 0.625rem;
}

.check-table .col-date .day {
    display: block;
    color: var(--gray-text);
}

.check-table .col-subtotal {
    width: 40px;
    background-color: #f0f0f0;
}

/* グループラベル（縦書き） */
.check-table .group-label {
    background-color: #e8e8e8;
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 0.2em;
    font-weight: 600;
    padding: 8px 4px;
}

.vertical-text {
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 0.1em;
}

/* 入力フィールド */
.check-table input[type="text"] {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 0.75rem;
    padding: 2px 4px;
    text-align: left;
}

.check-table input[type="text"]:focus {
    outline: none;
    background-color: rgba(37, 99, 235, 0.05);
}

/* チェック選択（レガシー） */
.check-select {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 0.75rem;
    text-align: center;
    cursor: pointer;
    padding: 2px;
}

.check-select:focus {
    outline: none;
}

/* クリック可能なチェックセル */
.check-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.15s;
    user-select: none;
    background-color: #f0f0f0;
    color: #999;
}

.check-cell[data-value="○"] {
    background-color: #10b981;
    color: white;
}

.check-cell[data-value="×"] {
    background-color: #ef4444;
    color: white;
}

.check-cell[data-value="/"] {
    background-color: #f59e0b;
    color: white;
}

.check-cell:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 削除列 */
.check-table .col-delete {
    width: 40px;
    text-align: center;
}

.check-table .delete-cell {
    text-align: center;
}

/* 小計セル */
.check-table .subtotal {
    font-weight: 600;
    background-color: #f0f0f0;
}

/* 日計行 */
.daily-total-row {
    background-color: var(--light-bg);
}

.daily-total-row td {
    font-weight: 600;
}

.daily-total-label {
    text-align: right !important;
    padding-right: 12px !important;
}

.daily-total {
    font-weight: 600;
}

.grand-total {
    background-color: #e0e0e0;
    font-weight: 700;
}

/* 自動化されたルーティン セクション */
.routine-section {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.routine-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--dark-text);
}

.routine-description {
    font-size: 0.875rem;
    margin-bottom: 20px;
    padding: 12px;
    background-color: var(--light-bg);
    border-radius: var(--radius);
}

.routine-description p {
    margin-bottom: 4px;
}

.routine-description p:last-child {
    margin-bottom: 0;
}

.routine-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.routine-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.routine-card-header {
    background-color: var(--light-bg);
    padding: 8px 12px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.routine-card-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.routine-card-table th,
.routine-card-table td {
    border: 1px solid var(--border-color);
    padding: 8px;
    text-align: center;
}

.routine-card-table th {
    background-color: var(--light-bg);
    font-weight: 600;
}

.routine-card-table input[type="text"] {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 0.75rem;
    padding: 4px;
}

.routine-card-table input[type="text"]:focus {
    outline: none;
    background-color: rgba(37, 99, 235, 0.05);
}

/* レスポンシブ対応 */
@media (max-width: 1400px) {
    .check-table-wrapper {
        padding: 10px;
    }
}

/* ========================================
   Dashboard V2 Styles (Screenshot-matching)
   ======================================== */

/* レポートヘッダー情報 */
.report-header-info {
    margin-bottom: 20px;
}

.report-header-row {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    font-size: 0.9375rem;
}

.report-header-row:last-child {
    margin-bottom: 0;
}

.report-header-label {
    font-weight: 600;
    min-width: 80px;
}

.report-header-value {
    font-weight: 400;
}

/* 4象限チャート - 外枠付き */
.quadrant-chart-wrapper {
    background-color: var(--white);
    padding: 12px;
}

.quadrant-outer-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.quadrant-outer-labels.bottom {
    margin-top: 4px;
    margin-bottom: 8px;
}

.quadrant-outer-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--dark-text);
}

.quadrant-outer-label .label-separator {
    margin: 0 4px;
    color: #999;
}

.quadrant-chart-container {
    border: 2px solid #333;
    aspect-ratio: 1;
    position: relative;
}

.quadrant-legend {
    display: flex;
    justify-content: flex-start;
    gap: 16px;
    padding-top: 8px;
    font-size: 0.8125rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-red {
    background-color: rgba(255, 102, 102, 1);
}

.dot-blue {
    background-color: rgba(102, 153, 255, 1);
}

.dot-green {
    background-color: rgba(102, 204, 102, 1);
}

/* 判定セクション */
.judgment-section {
    background-color: var(--white);
    padding: 16px;
    border: 2px solid var(--dark-text);
}

.judgment-title {
    font-size: 0.9375rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.judgment-text {
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--dark-text);
}

/* ========================================
   メトリクスカード V2（テーブル形式）
   ======================================== */

.metric-card-v2 {
    background-color: var(--white);
    border: 1px solid #999;
}

.metric-header-v2 {
    background-color: #0891b2;
    color: var(--white);
    font-size: 0.9375rem;
    font-weight: 600;
    padding: 6px 12px;
}

.metric-table-v2 {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.metric-table-v2 th,
.metric-table-v2 td {
    border: 1px solid #999;
    padding: 0;
}

.metric-table-v2 thead th {
    background-color: #f5f5f5;
    font-weight: 500;
    height: 24px;
    font-size: 0.6875rem;
}

.metric-label-col {
    width: 55%;
    text-align: left;
}

.metric-scale-col {
    width: 9%;
    text-align: center;
}

.metric-label-cell {
    padding: 8px 10px !important;
    text-align: left;
    font-size: 0.75rem;
    line-height: 1.4;
    vertical-align: middle;
}

.metric-bar-cell {
    padding: 8px 4px !important;
    position: relative;
    background: linear-gradient(to right, 
        transparent 0%, transparent 20%,
        #e0e0e0 20%, #e0e0e0 20.5%,
        transparent 20.5%, transparent 40%,
        #e0e0e0 40%, #e0e0e0 40.5%,
        transparent 40.5%, transparent 60%,
        #e0e0e0 60%, #e0e0e0 60.5%,
        transparent 60.5%, transparent 80%,
        #e0e0e0 80%, #e0e0e0 80.5%,
        transparent 80.5%, transparent 100%
    );
}

.metric-bar {
    height: 18px;
    background-color: rgba(120, 120, 120, 0.7);
    border-radius: 0;
}

.metric-bar-green {
    background-color: rgba(100, 180, 100, 0.8);
}

/* ========================================
   説明文ボックス V2
   ======================================== */

.description-box-v2 {
    background-color: var(--white);
    padding: 12px 14px;
    border: 1px solid #ccc;
}

.description-box-v2 p {
    font-size: 0.6875rem;
    line-height: 1.7;
    color: var(--dark-text);
    margin: 0;
}

/* ========================================
   存在感・不安感チャート V2
   ======================================== */

.presence-anxiety-section-v2 {
    background-color: var(--white);
    border: 1px solid #333;
    padding: 0;
}

.pa-chart-row {
    display: flex;
    align-items: stretch;
}

.pa-side-label {
    width: 28px;
    background-color: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dark-text);
    border-right: 1px solid #333;
}

.pa-side-label span {
    display: block;
    line-height: 1.3;
}

.pa-chart-container {
    flex: 1;
    height: 90px;
    background-color: #c8c8c8;
}

.pa-x-axis-labels {
    display: flex;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
}

.pa-side-label-spacer {
    width: 28px;
    border-right: 1px solid #333;
}

.pa-x-labels-container {
    flex: 1;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--dark-text);
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {
    .report-container {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Dashboard V3 Styles (Final Screenshot-matching)
   ======================================== */

/* メインレポートコンテナ V3 */
.report-container-v3 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

/* 左カラム V3 */
.report-left-v3 {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 右カラム V3 */
.report-right-v3 {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* レポートヘッダー情報 V3（左カラム内） */
.report-header-info-v3 {
    margin-bottom: 4px;
}

/* ========================================
   メトリクスセクション V3（横棒グラフ）
   ======================================== */

.metric-section-v3 {
    background-color: var(--white);
    border: 1px solid #999;
}

.metric-header-v3 {
    background-color: #0891b2;
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 5px 10px;
}

.metric-chart-wrapper {
    border: 1px solid #999;
    border-top: none;
}

.metric-row-v3 {
    display: flex;
    border-bottom: 1px solid #999;
}

.metric-row-v3:last-child {
    border-bottom: none;
}

.metric-label-v3 {
    width: 55%;
    padding: 8px 10px;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--dark-text);
    border-right: 1px solid #999;
    display: flex;
    align-items: center;
}

.metric-graph-v3 {
    width: 45%;
    height: 50px;
    position: relative;
}

.metric-graph-v3 canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ========================================
   説明文ボックス V3
   ======================================== */

.description-box-v3 {
    background-color: var(--white);
    padding: 10px 12px;
}

.description-box-v3 p {
    font-size: 0.6875rem;
    line-height: 1.7;
    color: var(--dark-text);
    margin: 0;
}

/* ========================================
   存在感・不安感チャート V3
   ======================================== */

.presence-anxiety-section-v3 {
    background-color: var(--white);
    border: 2px solid #333;
}

.pa-chart-row-v3 {
    display: flex;
    align-items: stretch;
}

.pa-side-label-v3 {
    width: 32px;
    background-color: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--dark-text);
    border-right: 2px solid #333;
}

.pa-side-label-v3 span {
    display: block;
    line-height: 1.4;
}

.pa-chart-container-v3 {
    flex: 1;
    height: 100px;
    background-color: #c8c8c8;
}

.pa-x-axis-labels-v3 {
    display: flex;
    border-top: 2px solid #333;
    border-bottom: 2px solid #333;
}

.pa-side-label-spacer-v3 {
    width: 32px;
    border-right: 2px solid #333;
}

.pa-x-labels-container-v3 {
    flex: 1;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dark-text);
}

/* レスポンシブ対応 V3 */
@media (max-width: 1024px) {
    .report-container-v3 {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Dashboard V4 Styles (Final)
   ======================================== */

/* メインレポートコンテナ V4 */
.report-container-v4 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: stretch;
}

/* 左カラム V4 */
.report-left-v4 {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 右カラム V4 */
.report-right-v4 {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* レポートヘッダー情報 V4 */
.report-header-info-v4 {
    margin-bottom: 4px;
}

/* ========================================
   ウェルビーイング〜説明文を囲む枠
   ======================================== */

.metrics-bordered-box {
    border: 1px solid #333;
    background-color: var(--white);
}

/* ========================================
   メトリクスセクション V4（テーブル形式）
   ======================================== */

.metric-section-v4 {
    background-color: var(--white);
}

.metric-header-v4 {
    background-color: #666;
    color: var(--white);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 4px 10px;
    display: inline-block;
    margin: 8px 0 0 8px;
}

.metric-table-v4 {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    table-layout: fixed;
}

.metric-table-v4 th,
.metric-table-v4 td {
    border: 1px solid #999;
    padding: 0;
    vertical-align: middle;
}

.metric-label-th {
    width: 55%;
    border-top: none !important;
    border-left: none !important;
}

.metric-scale-th {
    width: 9%;
    text-align: center;
    font-weight: 400;
    font-size: 0.6875rem;
    padding: 2px 0;
    color: #666;
    border-top: none !important;
}

.metric-scale-th:last-child {
    border-right: none !important;
}

.metric-label-td {
    padding: 6px 8px;
    text-align: left;
    font-size: 0.6875rem;
    line-height: 1.4;
    color: var(--dark-text);
    border-left: none !important;
}

.metric-bar-td {
    padding: 6px 4px;
    position: relative;
    border-right: none !important;
}

/* 棒グラフの重ね合わせ */
.bar-wrapper {
    position: relative;
    height: 16px;
    width: 100%;
}

.bar-base {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: rgba(170, 170, 170, 0.8);
    z-index: 1;
}

.bar-actual {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 2;
}

.bar-pink {
    background-color: rgba(220, 180, 180, 0.9);
}

.bar-green {
    background-color: rgba(140, 190, 140, 0.9);
}

/* ========================================
   説明文ボックス V4
   ======================================== */

.description-box-v4 {
    padding: 10px 12px;
    border-top: 1px solid #ccc;
}

.description-box-v4 p {
    font-size: 0.6875rem;
    line-height: 1.7;
    color: var(--dark-text);
    margin: 0;
}

/* ========================================
   存在感・不安感チャート V4
   ======================================== */

.presence-anxiety-section-v4 {
    background-color: var(--white);
    border: 2px solid #333;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pa-chart-row-v4 {
    display: flex;
    align-items: stretch;
    flex: 1;
}

.pa-side-label-v4 {
    width: 32px;
    background-color: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--dark-text);
    border-right: 2px solid #333;
}

.pa-side-label-v4 span {
    display: block;
    line-height: 1.4;
}

.pa-chart-container-v4 {
    flex: 1;
    min-height: 120px;
    background-color: #b8b8b8;
}

.pa-x-axis-labels-v4 {
    display: flex;
    border-top: 2px solid #333;
    border-bottom: 2px solid #333;
    flex-shrink: 0;
}

.pa-side-label-spacer-v4 {
    width: 32px;
    border-right: 2px solid #333;
}

.pa-x-labels-container-v4 {
    flex: 1;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dark-text);
}

/* レスポンシブ対応 V4 */
@media (max-width: 1024px) {
    .report-container-v4 {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Dashboard V5 Styles
   ======================================== */

/* メインレポートコンテナ V5 */
.report-container-v5 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: stretch;
}

/* 左カラム V5 */
.report-left-v5 {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 右カラム V5 - 50/50分割 */
.report-right-v5 {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* レポートヘッダー情報 V5 */
.report-header-info-v5 {
    margin-bottom: 4px;
}

/* ========================================
   メトリクスボーダーボックス V5
   ======================================== */

.metrics-bordered-box-v5 {
    border: 2px solid #333;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* メトリクスセクション V5 */
.metric-section-v5 {
    padding-bottom: 8px;
}

.metric-section-v5:last-of-type {
    border-bottom: none;
}

.metric-header-wrapper-v5 {
    text-align: left;
    margin-bottom: 8px;
}

.metric-header-v5 {
    display: inline-block;
    font-size: 1.3rem;
    font-weight: 600;
    padding: 6px 16px;
    color: var(--white);
    background-color: #808080;
}

/* メトリック行 V5 */
.metric-row-v5 {
    display: flex;
    border-bottom: 1px solid #ddd;
}

.metric-row-v5:last-child {
    border-bottom: none;
}

.metric-label-v5 {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
    padding: 4px 8px;
    font-size: 0.6875rem;
    font-weight: 400;
    background-color: var(--white);
    border-right: 1px solid #ccc;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.metric-chart-v5 {
    flex: 1;
    height: 60px;
    position: relative;
    background-color: var(--white);
}

/* 説明文ボックス V5 */
.description-box-v5 {
    background-color: var(--white);
    padding: 8px 10px;
    flex-shrink: 0;
}

.description-box-v5 p {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--dark-text);
    margin: 0;
}

/* ========================================
   存在感・不安感チャート V5
   ======================================== */

.presence-anxiety-section-v5 {
    background-color: var(--white);
    border: 2px solid #333;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pa-chart-row-v5 {
    display: flex;
    align-items: stretch;
    flex: 1;
}

.pa-side-label-v5 {
    width: 32px;
    background-color: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--dark-text);
    border-right: 2px solid #333;
}

.pa-side-label-v5 span {
    display: block;
    line-height: 1.4;
}

.pa-chart-container-v5 {
    flex: 1;
    min-height: 100px;
    background-color: #b8b8b8;
}

.pa-x-axis-labels-v5 {
    display: flex;
    border-top: 2px solid #333;
    border-bottom: 2px solid #333;
    flex-shrink: 0;
}

.pa-side-label-spacer-v5 {
    width: 32px;
    border-right: 2px solid #333;
}

.pa-x-labels-container-v5 {
    flex: 1;
    display: flex;
    justify-content: space-around;
    padding: 6px 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--dark-text);
}

/* レスポンシブ対応 V5 */
@media (max-width: 1024px) {
    .report-container-v5 {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   期間比較モード - トグルスイッチ
   ======================================== */
.comparison-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 16px;
}

.toggle-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dark-text);
    white-space: nowrap;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* ========================================
   期間比較モード - レイアウト
   ======================================== */
.report-container-comparison {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.comparison-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.comparison-row:last-child {
    margin-bottom: 0;
}

.comparison-col {
    min-width: 0;
}

/* 比較モード用の4象限チャートラッパー（サイズ調整） */
.comparison-chart {
    max-width: 100%;
}

.comparison-chart .quadrant-chart-container {
    max-width: 400px;
    margin: 0 auto;
}

/* レスポンシブ対応 - 比較モード */
@media (max-width: 1280px) {
    .comparison-row {
        grid-template-columns: 1fr;
    }
    
    .comparison-chart .quadrant-chart-container {
        max-width: 350px;
    }
}