/**
 * かうたす - 共通レスポンシブCSS
 * 
 * ブレークポイント:
 * - モバイル: 375px - 767px
 * - タブレット: 768px - 1023px  
 * - PC: 1024px+
 * 
 * タッチ最適化:
 * - 最小タップターゲット: 44x44px
 * - 片手操作対応（モバイル）
 */

/* ======================================
   リセット＆ベース
   ====================================== */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ======================================
   CSS変数 - ブレークポイント
   ====================================== */
:root {
    /* カラーパレット */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #60a5fa;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
    
    /* ブレークポイント */
    --breakpoint-mobile: 767px;
    --breakpoint-tablet: 1023px;
    --breakpoint-desktop: 1024px;
    
    /* タッチ最適化 */
    --touch-target-min: 44px;
    --touch-target-comfortable: 48px;
    
    /* 間隔 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    
    /* サイドバー幅 */
    --sidebar-width-desktop: 260px;
    --sidebar-width-tablet: 200px;
    --sidebar-width-mobile: 280px;
    
    /* モバイルヘッダー高さ */
    --mobile-header-height: 60px;
}

/* ======================================
   レスポンシブユーティリティ
   ====================================== */

/* PC のみ表示 */
.desktop-only {
    display: none !important;
}

@media (min-width: 1024px) {
    .desktop-only {
        display: block !important;
    }
    .desktop-only-flex {
        display: flex !important;
    }
    .desktop-only-inline {
        display: inline !important;
    }
    .desktop-only-inline-flex {
        display: inline-flex !important;
    }
    .desktop-only-grid {
        display: grid !important;
    }
}

/* タブレット のみ表示 */
.tablet-only {
    display: none !important;
}

@media (min-width: 768px) and (max-width: 1023px) {
    .tablet-only {
        display: block !important;
    }
    .tablet-only-flex {
        display: flex !important;
    }
    .tablet-only-inline {
        display: inline !important;
    }
}

/* モバイル のみ表示 */
.mobile-only {
    display: none !important;
}

@media (max-width: 767px) {
    .mobile-only {
        display: block !important;
    }
    .mobile-only-flex {
        display: flex !important;
    }
    .mobile-only-inline {
        display: inline !important;
    }
}

/* PC・タブレット（モバイル非表示） */
.hide-mobile {
    display: block;
}

@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

/* タブレット・モバイル（PC非表示） */
.hide-desktop {
    display: block;
}

@media (min-width: 1024px) {
    .hide-desktop {
        display: none !important;
    }
}

/* ======================================
   モバイルヘッダー＆ハンバーガーメニュー
   ====================================== */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--mobile-header-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(37, 99, 235, 0.15);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    z-index: 150;
    padding: 0 var(--spacing-md);
    align-items: center;
    justify-content: space-between;
}

@media (max-width: 767px) {
    .mobile-header {
        display: flex;
    }
}

/* ハンバーガーメニューボタン */
.mobile-menu-btn {
    display: none;
    width: var(--touch-target-min);
    height: var(--touch-target-min);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mobile-menu-btn:hover,
.mobile-menu-btn:focus {
    transform: scale(1.05);
    outline: none;
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

@media (max-width: 767px) {
    .mobile-menu-btn {
        display: flex;
    }
}

/* モバイルページタイトル */
.mobile-page-title {
    flex: 1;
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 var(--spacing-md);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* モバイルアクションボタン */
.mobile-action-btn {
    width: var(--touch-target-min);
    height: var(--touch-target-min);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mobile-action-btn:hover,
.mobile-action-btn:focus {
    background: rgba(37, 99, 235, 0.1);
    outline: none;
}

/* ======================================
   サイドバー - レスポンシブ
   ====================================== */
.sidebar {
    width: var(--sidebar-width-desktop);
    position: fixed;
    left: 0;
    top: 0;
    min-height: 100vh;
    z-index: 200;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s ease;
}

/* タブレット */
@media (min-width: 768px) and (max-width: 1023px) {
    .sidebar {
        width: var(--sidebar-width-tablet);
        padding: var(--spacing-lg) var(--spacing-sm);
    }
    
    .sidebar-logo-text {
        font-size: 17px;
    }
    
    .sidebar-link {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .sidebar-link i {
        font-size: 15px;
        margin-right: 10px;
    }
}

/* モバイル: スライドイン方式 */
@media (max-width: 767px) {
    .sidebar {
        width: var(--sidebar-width-mobile);
        transform: translateX(-100%);
        border-radius: 0;
        padding-top: var(--spacing-xl);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-link {
        padding: var(--spacing-md) var(--spacing-md);
        font-size: 15px;
        min-height: var(--touch-target-min);
    }
    
    .sidebar-link i {
        width: 28px;
        font-size: 18px;
    }
    
    .sidebar-close-btn {
        display: flex;
    }
}

/* サイドバー閉じるボタン（モバイルのみ） */
.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}

.sidebar-close-btn:hover,
.sidebar-close-btn:focus {
    background: rgba(0, 0, 0, 0.1);
    outline: none;
}

/* オーバーレイ（モバイルメニュー用） */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 190;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 767px) {
    .sidebar-overlay {
        display: block;
    }
}

/* ======================================
   メインコンテンツエリア
   ====================================== */
.main-content {
    margin-left: var(--sidebar-width-desktop);
    min-height: 100vh;
    padding: var(--spacing-lg);
    transition: margin-left 0.3s ease;
}

/* タブレット */
@media (min-width: 768px) and (max-width: 1023px) {
    .main-content {
        margin-left: var(--sidebar-width-tablet);
        padding: var(--spacing-md);
    }
}

/* モバイル */
@media (max-width: 767px) {
    .main-content {
        margin-left: 0;
        padding: var(--spacing-md);
        padding-top: calc(var(--mobile-header-height) + var(--spacing-md));
    }
}

/* ======================================
   ボタン - タッチ最適化
   ====================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
}

/* タブレット */
@media (min-width: 768px) and (max-width: 1023px) {
    .btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* モバイル - タッチ最適化 */
@media (max-width: 767px) {
    .btn {
        min-height: var(--touch-target-min);
        min-width: var(--touch-target-min);
        padding: 12px 16px;
        font-size: 15px;
    }
    
    .btn-sm {
        min-height: 40px;
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .btn-icon {
        width: var(--touch-target-comfortable);
        height: var(--touch-target-comfortable);
        padding: 0;
    }
    
    /* ボタングループは縦並びに */
    .btn-group {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    /* FAB (Floating Action Button) */
    .fab {
        position: fixed;
        bottom: var(--spacing-lg);
        right: var(--spacing-lg);
        width: 56px;
        height: 56px;
        border-radius: 50%;
        box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
        z-index: 100;
    }
}

/* PC: ホバーエフェクト */
@media (min-width: 1024px) {
    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
    }
    
    .btn-primary:active {
        transform: translateY(0);
    }
    
    .btn-secondary:hover {
        background: rgba(37, 99, 235, 0.1);
        border-color: var(--primary);
        color: var(--primary);
    }
    
    .btn-ghost:hover {
        background: rgba(37, 99, 235, 0.1);
        color: var(--primary);
    }
}

/* ======================================
   フォーム要素 - タッチ最適化
   ====================================== */
.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    border: none;
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    font-size: 16px; /* iOS Safari ズーム防止 */
    font-weight: 400;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(240, 253, 244, 0.6);
    color: var(--text-primary);
}

/* モバイル最適化 */
@media (max-width: 767px) {
    .form-input,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"],
    select,
    textarea {
        min-height: var(--touch-target-comfortable);
        font-size: 16px; /* iOS Safari 16px以下でズーム */
        padding: 14px var(--spacing-md);
    }
    
    .form-label {
        font-size: 14px;
        margin-bottom: var(--spacing-sm);
    }
    
    /* チェックボックス/ラジオ */
    input[type="checkbox"],
    input[type="radio"] {
        width: 24px;
        height: 24px;
        min-height: auto;
    }
    
    /* フォームグループ間隔 */
    .form-group {
        margin-bottom: var(--spacing-md);
    }
}

/* ======================================
   カード - レスポンシブ
   ====================================== */
.glass-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-xl);
}

/* モバイル */
@media (max-width: 767px) {
    .glass-card {
        border-radius: var(--radius-lg);
        padding: var(--spacing-md);
    }
}

/* ======================================
   グリッドレイアウト - 3-2-1カラム
   ====================================== */
.responsive-grid {
    display: grid;
    gap: var(--spacing-lg);
}

/* PC: 3カラム */
@media (min-width: 1024px) {
    .responsive-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .responsive-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .responsive-grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* タブレット: 2カラム */
@media (min-width: 768px) and (max-width: 1023px) {
    .responsive-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    .responsive-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .responsive-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* モバイル: 1カラム */
@media (max-width: 767px) {
    .responsive-grid,
    .responsive-grid-2,
    .responsive-grid-4 {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
}

/* ======================================
   テーブル - レスポンシブ
   ====================================== */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 calc(var(--spacing-md) * -1);
    padding: 0 var(--spacing-md);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(37, 99, 235, 0.1);
}

.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    background: rgba(240, 253, 244, 0.5);
    white-space: nowrap;
}

.data-table tbody tr {
    transition: background 0.2s;
}

/* PC: ホバーエフェクト */
@media (min-width: 1024px) {
    .data-table tbody tr:hover {
        background: rgba(37, 99, 235, 0.05);
    }
}

/* モバイル: カード風表示オプション */
@media (max-width: 767px) {
    .data-table th,
    .data-table td {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    /* スタックド表示（オプション） */
    .table-stack-mobile thead {
        display: none;
    }
    
    .table-stack-mobile tbody tr {
        display: block;
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-sm);
        background: rgba(255, 255, 255, 0.8);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
    }
    
    .table-stack-mobile tbody td {
        display: flex;
        justify-content: space-between;
        padding: var(--spacing-xs) 0;
        border: none;
    }
    
    .table-stack-mobile tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 12px;
    }
}

/* ======================================
   モーダル - レスポンシブ
   ====================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transform: scale(0.95) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid rgba(37, 99, 235, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid rgba(37, 99, 235, 0.15);
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
}

/* モバイル: フルスクリーン風 */
@media (max-width: 767px) {
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    
    .modal-content {
        max-width: none;
        max-height: 95vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        transform: translateY(100%);
    }
    
    .modal-overlay.active .modal-content {
        transform: translateY(0);
    }
    
    .modal-header {
        padding: var(--spacing-md);
        position: sticky;
        top: 0;
        background: inherit;
        z-index: 1;
    }
    
    .modal-body {
        padding: var(--spacing-md);
    }
    
    .modal-footer {
        position: sticky;
        bottom: 0;
        background: inherit;
        padding: var(--spacing-md);
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    .modal-close-btn {
        width: var(--touch-target-min);
        height: var(--touch-target-min);
    }
}

/* モーダル閉じるボタン */
.modal-close-btn {
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* ======================================
   ドロップダウン - タッチ最適化
   ====================================== */
.dropdown-item {
    padding: 12px 18px;
    min-height: var(--touch-target-min);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

@media (max-width: 767px) {
    .dropdown-item {
        padding: var(--spacing-md);
        font-size: 15px;
    }
    
    .dropdown-menu {
        max-height: 50vh;
    }
}

/* ======================================
   タブ - タッチ最適化
   ====================================== */
.tab-list {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: var(--spacing-xs);
    padding-bottom: var(--spacing-sm);
}

.tab-list::-webkit-scrollbar {
    display: none;
}

.tab-item {
    flex-shrink: 0;
    padding: 12px 20px;
    border-radius: var(--radius-lg);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    border: none;
    background: transparent;
    color: var(--text-secondary);
}

.tab-item:hover,
.tab-item:focus {
    background: rgba(37, 99, 235, 0.1);
    outline: none;
}

.tab-item.active {
    background: var(--primary);
    color: white;
}

@media (max-width: 767px) {
    .tab-item {
        min-height: var(--touch-target-min);
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* ======================================
   ページネーション - タッチ最適化
   ====================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.pagination-btn {
    min-width: var(--touch-target-min);
    height: var(--touch-target-min);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(37, 99, 235, 0.2);
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled),
.pagination-btn:focus:not(:disabled) {
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--primary);
    outline: none;
}

.pagination-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ======================================
   検索バー - レスポンシブ
   ====================================== */
.search-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: rgba(240, 253, 244, 0.6);
    border-radius: var(--radius-xl);
    padding: 8px 16px;
    transition: all 0.25s;
}

.search-bar:focus-within {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    min-height: 36px;
}

.search-bar input:focus {
    outline: none;
}

.search-bar i {
    color: var(--text-muted);
}

@media (max-width: 767px) {
    .search-bar {
        padding: 6px 14px;
    }
    
    .search-bar input {
        min-height: var(--touch-target-min);
        font-size: 16px;
    }
}

/* ======================================
   リストアイテム - タッチ最適化
   ====================================== */
.list-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    transition: all 0.2s;
    cursor: pointer;
    gap: var(--spacing-md);
}

.list-item:hover {
    background: rgba(37, 99, 235, 0.05);
}

@media (max-width: 767px) {
    .list-item {
        min-height: 60px;
        padding: var(--spacing-md) var(--spacing-sm);
    }
    
    /* タップ領域拡大 */
    .list-item-action {
        min-width: var(--touch-target-min);
        min-height: var(--touch-target-min);
    }
}

/* ======================================
   スクロール - モバイル最適化
   ====================================== */
.scroll-container {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* スクロールスナップ（カード一覧） */
.scroll-snap-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: var(--spacing-md);
}

.scroll-snap-container::-webkit-scrollbar {
    display: none;
}

.scroll-snap-item {
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* ======================================
   スペーシング - レスポンシブ
   ====================================== */
.section {
    margin-bottom: var(--spacing-xl);
}

@media (max-width: 767px) {
    .section {
        margin-bottom: var(--spacing-lg);
    }
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

@media (max-width: 767px) {
    .section-title {
        font-size: 16px;
        margin-bottom: var(--spacing-sm);
    }
}

/* ======================================
   ヘッダー - レスポンシブ
   ====================================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.page-header-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

@media (min-width: 768px) and (max-width: 1023px) {
    .page-header-title {
        font-size: 22px;
    }
}

@media (max-width: 767px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: var(--spacing-md);
    }
    
    .page-header-title {
        font-size: 20px;
        text-align: center;
    }
    
    .page-header-actions {
        display: flex;
        justify-content: center;
        gap: var(--spacing-sm);
        flex-wrap: wrap;
    }
}

/* ======================================
   フィルター・検索エリア - レスポンシブ
   ====================================== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-lg);
}

/* ドロップダウンを含むカードはoverflowをvisibleに */
.glass-card:has(.custom-dropdown),
.glass-card:has(.dropdown-menu) {
    overflow: visible !important;
}

/* フィルターセクション内のドロップダウンが表示されるように */
.custom-dropdown {
    position: relative;
    z-index: 10;
}

.custom-dropdown.open {
    z-index: 100;
}

@media (max-width: 767px) {
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
        margin-bottom: var(--spacing-md);
    }

    .filter-bar > * {
        width: 100%;
    }
}

/* ======================================
   情報密度 - PC最適化
   ====================================== */
@media (min-width: 1024px) {
    /* PC: より多くの情報表示 */
    .compact-text {
        font-size: 13px;
    }
    
    .compact-padding {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    /* ホバーでの追加情報表示 */
    .hover-info {
        position: relative;
    }
    
    .hover-info::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        background: var(--text-primary);
        color: white;
        padding: 6px 12px;
        border-radius: var(--radius-sm);
        font-size: 12px;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: all 0.2s;
        pointer-events: none;
        z-index: 1000;
    }
    
    .hover-info:hover::after {
        opacity: 1;
        visibility: visible;
    }
}

/* ======================================
   キーボードショートカット表示（PCのみ）
   ====================================== */
.kbd {
    display: none;
}

@media (min-width: 1024px) {
    .kbd {
        display: inline-flex;
        padding: 2px 8px;
        background: rgba(0, 0, 0, 0.06);
        border-radius: 4px;
        font-family: monospace;
        font-size: 12px;
        color: var(--text-secondary);
        margin-left: var(--spacing-sm);
    }
}

/* ======================================
   アニメーション - パフォーマンス最適化
   ====================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* モバイルではアニメーション簡略化 */
@media (max-width: 767px) {
    * {
        transition-duration: 0.15s !important;
    }
}

/* ======================================
   セーフエリア（iPhoneノッチ対応）
   ====================================== */
@supports (padding: max(0px)) {
    .main-content {
        padding-left: max(var(--spacing-md), env(safe-area-inset-left));
        padding-right: max(var(--spacing-md), env(safe-area-inset-right));
        padding-bottom: max(var(--spacing-md), env(safe-area-inset-bottom));
    }
    
    .mobile-header {
        padding-left: max(var(--spacing-md), env(safe-area-inset-left));
        padding-right: max(var(--spacing-md), env(safe-area-inset-right));
    }
    
    .modal-footer {
        padding-bottom: max(var(--spacing-md), env(safe-area-inset-bottom));
    }
}

/* ======================================
   プリントスタイル
   ====================================== */
@media print {
    .sidebar,
    .mobile-header,
    .mobile-menu-btn,
    .sidebar-overlay,
    .fab,
    .modal-overlay {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .glass-card {
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* ======================================
   サイドバー ユーザーセクション
   ====================================== */
.sidebar-user-section {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid rgba(37, 99, 235, 0.15);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(37, 99, 235, 0.05);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar i {
    color: white;
    font-size: 18px;
}

.user-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    color: #dc2626;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.sidebar-logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

.sidebar-logout-btn i {
    font-size: 16px;
}

/* タブレット対応 */
@media (min-width: 768px) and (max-width: 1023px) {
    .sidebar-user-info {
        padding: 10px;
    }
    
    .user-avatar {
        width: 36px;
        height: 36px;
    }
    
    .user-avatar i {
        font-size: 16px;
    }
    
    .user-name {
        font-size: 13px;
    }
    
    .user-email {
        font-size: 11px;
    }
    
    .sidebar-logout-btn {
        padding: 10px;
        font-size: 13px;
    }
}

/* モバイル対応 */
@media (max-width: 767px) {
    .sidebar-user-section {
        padding: 12px 16px;
    }
    
    .sidebar-user-info {
        padding: 12px;
    }
    
    .sidebar-logout-btn {
        min-height: 44px;
    }
}

/* ======================================
   ドラッグ可能モーダルのスタイル
   ====================================== */

/* モーダルヘッダーをドラッグハンドルとして視覚的に表現 */
.modal-header.draggable-header {
    position: relative;
    user-select: none; /* テキスト選択を無効化 */
    cursor: move;
}

.modal-header.draggable-header::before {
    content: '⋮⋮';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    color: rgba(37, 99, 235, 0.3);
    letter-spacing: -0.25rem;
    transition: color 0.2s;
}

.modal-header.draggable-header:hover::before {
    color: rgba(37, 99, 235, 0.6);
}

/* ドラッグ中のカーソル */
.modal-header.dragging {
    cursor: grabbing !important;
}

.modal-header.dragging::before {
    color: var(--primary);
}

/* モーダルコンテンツをドラッグ時に少し透明にする */
.modal-content.dragging {
    opacity: 0.95;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

/* モーダルの初期位置を中央に */
.modal-content {
    position: relative;
    transition: transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
}

/* ======================================
   セッション種別カテゴリのスタイル
   ====================================== */

/* カテゴリ統計カード */
.category-stat-card {
    background: white;
    border-left: 4px solid;
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.category-stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* カテゴリフィルタボタン */
.category-filter-btn {
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 9999px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.category-filter-btn:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.category-filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* カテゴリバッジ */
.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
}

/* タスク紐付けモーダル */
.task-link-item {
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.2s;
}

.task-link-item:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.02);
}

.task-link-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: var(--primary);
}

/* カテゴリ選択ドロップダウン */
.category-select-wrapper {
    position: relative;
}

.category-select-wrapper select {
    appearance: none;
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.category-select-wrapper select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.category-select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #9ca3af;
    pointer-events: none;
}

/* カテゴリアイコン */
.category-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* ======================================
   AI機能スタイル
   ====================================== */

/* AIローディングオーバーレイ */
.ai-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.ai-loading-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: 32px 48px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.ai-loading-spinner {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 1.5s ease-in-out infinite;
}

.ai-loading-spinner i {
    color: white;
    font-size: 28px;
}

.ai-loading-message {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 20px rgba(139, 92, 246, 0);
    }
}

/* AI提案タスクカード */
.suggested-task-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: all 0.2s;
}

.suggested-task-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.suggested-task-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    margin-top: 4px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* AI提案バッジ */
.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.badge-success {
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
}

/* AI分析セクションスタイル */
.analysis-section {
    background: rgba(240, 253, 244, 0.5);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
}

.analysis-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* AIボタンスタイル */
.btn-ai {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border: none;
    transition: all 0.3s;
}

.btn-ai:hover {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

.btn-ai:active {
    transform: translateY(0);
}

/* スパークルアイコンアニメーション */
.fa-sparkles {
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* ======================================
   セッション種別（カテゴリ）関連スタイル
   ====================================== */

/* カテゴリ統計カード */
.category-stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    text-align: center;
}

/* カテゴリフィルターボタン */
.category-filter-btn {
    padding: 6px 12px;
    border-radius: var(--radius-md);
    border: 1px solid #e5e7eb;
    background: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.category-filter-btn:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.category-filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ======================================
   タスク紐付けモーダルスタイル
   ====================================== */

/* タスク紐付けアイテム */
.task-link-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.task-link-item:hover {
    background: #f3f4f6;
}

.task-link-item:has(input:checked) {
    background: rgba(37, 99, 235, 0.08);
    border-color: var(--primary);
}

.task-link-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ======================================
   ドラッグ可能モーダルスタイル
   ====================================== */

/* ドラッグハンドル */
.modal-header.draggable-header {
    cursor: move;
    user-select: none;
}

.modal-header.dragging {
    cursor: grabbing;
}

.modal-content.dragging {
    opacity: 0.95;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ======================================
   推奨セッション種別バッジ
   ====================================== */

.preferred-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

/* ======================================
   企業担当者選択コンテナ
   ====================================== */

#companyClientContainer {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* クライアントカードの企業表示 */
.client-card .fa-building {
    margin-right: 0.25rem;
}

/* イベントのクライアント/企業名表示 */
.event-client {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    opacity: 0.85;
}

/* ======================================
   分割ビューモーダル（イベント作成/編集）
   ====================================== */

/* モーダル分割ビューコンテナ */
.modal-split-view {
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-split-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* 左パネル：フォーム */
.modal-form-panel {
    flex: 1;
    min-width: 0;
    padding: var(--spacing-md);
    overflow-y: auto;
    border-right: 1px solid #e5e7eb;
    max-height: calc(90vh - 60px);
}

/* 右パネル：プレビュー */
.modal-preview-panel {
    width: 280px;
    flex-shrink: 0;
    padding: var(--spacing-md);
    background: #f9fafb;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* フォームセクション */
.form-section {
    margin-bottom: var(--spacing-md);
}

.form-section-primary {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    border: 1px solid #e5e7eb;
}

.form-section-colors {
    padding: var(--spacing-sm) 0;
}

/* コンパクトフォームグループ */
.form-group-compact {
    margin-bottom: var(--spacing-sm);
}

.form-row {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    align-items: flex-end;
}

.form-label-compact {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.form-label-compact i {
    font-size: 10px;
    width: 12px;
}

.form-input-compact {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    background: white;
}

.form-input-compact:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* コンパクトトグル */
.toggle-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 0;
}

.toggle-track-compact {
    width: 36px;
    height: 20px;
    background: #d1d5db;
    border-radius: 10px;
    position: relative;
    transition: background 0.2s;
}

.toggle-compact input:checked + .toggle-track-compact {
    background: var(--primary);
}

.toggle-thumb-compact {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-compact input:checked + .toggle-track-compact .toggle-thumb-compact {
    transform: translateX(16px);
}

.toggle-compact input {
    display: none;
}

.toggle-label-compact {
    font-size: 12px;
    color: var(--text-secondary);
}

/* クライアントタブ */
.client-tabs {
    display: flex;
    gap: 4px;
    background: #f3f4f6;
    border-radius: var(--radius-md);
    padding: 3px;
    margin-bottom: var(--spacing-sm);
}

.client-tab {
    flex: 1;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.client-tab:hover {
    background: rgba(255, 255, 255, 0.5);
}

.client-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.client-tab i {
    font-size: 11px;
}

.client-tab-content {
    display: none;
}

.client-tab-content.active {
    display: block;
}

.client-tab-content.hidden {
    display: none;
}

.company-client-select {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-md);
    padding: 8px;
    margin-top: 8px;
    animation: slideDown 0.2s ease-out;
}

/* 折りたたみセクション */
.form-section-collapsible {
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-md);
    background: white;
}

.form-section-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: #f9fafb;
    border-radius: var(--radius-lg);
    transition: all 0.2s;
    list-style: none;
}

.form-section-toggle:hover {
    background: #f3f4f6;
}

.form-section-toggle::-webkit-details-marker {
    display: none;
}

.form-section-toggle .toggle-icon {
    font-size: 10px;
    transition: transform 0.2s;
    color: var(--text-muted);
}

.form-section-collapsible[open] .toggle-icon {
    transform: rotate(90deg);
}

.form-section-content {
    padding: var(--spacing-md);
    border-top: 1px solid #e5e7eb;
}

/* コンパクト色選択 */
.color-options-compact {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.color-option-compact {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    position: relative;
}

.color-option-compact:hover {
    transform: scale(1.15);
}

.color-option-compact.selected {
    border-color: white;
    box-shadow: 0 0 0 2px var(--text-primary), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.color-option-compact.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* コンパクトボタン */
.btn-compact {
    padding: 8px 14px;
    font-size: 13px;
}

.form-actions-compact {
    display: flex;
    gap: 8px;
    padding-top: var(--spacing-md);
    border-top: 1px solid #e5e7eb;
    margin-top: var(--spacing-md);
}

.form-error-compact {
    padding: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    color: #dc2626;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--spacing-sm);
}

/* ======================================
   ミニカレンダー
   ====================================== */

.mini-calendar-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm);
    border: 1px solid #e5e7eb;
}

.mini-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
}

.mini-cal-month {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.mini-cal-nav {
    width: 24px;
    height: 24px;
    border: none;
    background: #f3f4f6;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.mini-cal-nav:hover {
    background: #e5e7eb;
    color: var(--text-primary);
}

.mini-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f3f4f6;
}

.mini-calendar-weekdays span:first-child {
    color: #ef4444;
}

.mini-calendar-weekdays span:last-child {
    color: #3b82f6;
}

.mini-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.mini-cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
    color: var(--text-secondary);
    position: relative;
}

.mini-cal-day:hover {
    background: #f3f4f6;
}

.mini-cal-day.other-month {
    color: #d1d5db;
}

.mini-cal-day.today {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.mini-cal-day.selected {
    background: rgba(37, 99, 235, 0.15);
    color: var(--primary);
    font-weight: 600;
}

.mini-cal-day.has-event::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
}

.mini-cal-day.holiday {
    color: #ef4444;
}

/* ======================================
   当日の予定プレビュー
   ====================================== */

.day-preview-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm);
    border: 1px solid #e5e7eb;
}

.day-preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: var(--spacing-sm);
}

.day-preview-header i {
    color: var(--primary);
}

.day-preview-list {
    max-height: 150px;
    overflow-y: auto;
}

.preview-empty {
    text-align: center;
    padding: var(--spacing-md);
}

.preview-event {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    background: #f9fafb;
    transition: all 0.2s;
}

.preview-event:hover {
    background: #f3f4f6;
}

.preview-event-color {
    width: 4px;
    height: 100%;
    min-height: 24px;
    border-radius: 2px;
    flex-shrink: 0;
}

.preview-event-info {
    flex: 1;
    min-width: 0;
}

.preview-event-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-event-time {
    font-size: 10px;
    color: var(--text-muted);
}

/* ======================================
   新規予定プレビュー
   ====================================== */

.new-event-preview {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(59, 130, 246, 0.05));
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm);
    border: 1px dashed rgba(37, 99, 235, 0.3);
}

.new-event-preview-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--spacing-sm);
}

.new-event-preview-content {
    background: white;
    border-radius: var(--radius-md);
    padding: 10px;
}

.preview-item {
    display: flex;
    gap: 10px;
}

.preview-color {
    width: 4px;
    border-radius: 2px;
    flex-shrink: 0;
}

.preview-details {
    flex: 1;
    min-width: 0;
}

.preview-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.preview-time {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.preview-time i {
    font-size: 10px;
    color: var(--text-muted);
}

.preview-client {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.preview-client i {
    font-size: 10px;
    color: var(--primary);
}

/* モーダルヘッダーのカラーインジケーター */
#modalColorIndicator {
    transition: background-color 0.2s;
}

/* ======================================
   レスポンシブ対応（分割ビューモーダル）
   ====================================== */

@media (max-width: 767px) {
    .modal-split-view {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .modal-split-container {
        flex-direction: column;
    }
    
    .modal-form-panel {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        max-height: 60vh;
    }
    
    .modal-preview-panel {
        width: 100%;
        max-height: 40vh;
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .day-timeline-section {
        flex: 1;
        min-height: 200px;
    }

    .new-event-preview {
        width: 100%;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .modal-split-view {
        max-width: 700px;
    }
    
    .modal-preview-panel {
        width: 240px;
    }
}

/* ======================================
   カレンダーイベント リサイズハンドル
   ====================================== */
.resize-handle-top,
.resize-handle-bottom {
    position: absolute;
    left: 0;
    right: 0;
    height: 8px;
    cursor: ns-resize;
    z-index: 50;
    pointer-events: none;
}

.resize-handle-top {
    top: 0;
}

.resize-handle-bottom {
    bottom: 0;
}

/* ホバー時にリサイズバーを表示 */
.event:hover .resize-handle-top,
.event:hover .resize-handle-bottom {
    background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
}

.event:hover .resize-handle-bottom {
    background: linear-gradient(to top, rgba(255,255,255,0.5), transparent);
}

/* イベント要素 */
.event {
    position: relative;
}

/* ======================================
   サイドバータスクの色分けとドラッグ
   ====================================== */

/* スケジュール済みタスク */
.calendar-task-item.scheduled {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-left: 3px solid #2563eb;
}

.calendar-task-item.scheduled .task-title {
    color: #065f46;
}

/* 未スケジュールタスク */
.calendar-task-item.unscheduled {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 3px solid #f59e0b;
    cursor: grab;
}

.calendar-task-item.unscheduled:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
    transform: translateX(2px);
}

.calendar-task-item.unscheduled .task-title {
    color: #92400e;
}

/* ドラッグ中 */
.calendar-task-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

/* ドラッグハンドル */
.calendar-task-item .drag-handle {
    display: flex;
    align-items: center;
    padding: 0 4px;
    opacity: 0.4;
    transition: opacity 0.15s;
}

.calendar-task-item:hover .drag-handle {
    opacity: 1;
}

/* カレンダーカラムのドロップターゲット */
.day-column.drop-target {
    background-color: rgba(37, 99, 235, 0.05);
}

.day-column.drag-over {
    background-color: rgba(37, 99, 235, 0.15);
    box-shadow: inset 0 0 0 2px #2563eb;
}

/* ======================================
   イベントモーダル タイムラインビュー
   ====================================== */
.day-timeline-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.day-timeline-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.day-timeline-header i {
    color: #2563eb;
}

.event-modal-timeline {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    max-height: 400px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* タイムラインコンテナ */
.event-modal-timeline .timeline-container {
    position: relative;
}

.event-modal-timeline .timeline-hour {
    display: flex;
    min-height: 36px;
    border-bottom: 1px dashed #e5e7eb;
}

.event-modal-timeline .timeline-hour-label {
    width: 40px;
    font-size: 11px;
    color: #9ca3af;
    text-align: right;
    padding-right: 8px;
    flex-shrink: 0;
}

.event-modal-timeline .timeline-hour-content {
    flex: 1;
    position: relative;
    min-height: 36px;
}

.event-modal-timeline .timeline-event {
    position: absolute;
    left: 0;
    right: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    border-left: 3px solid;
    font-size: 11px;
    overflow: hidden;
    z-index: 1;
}

.event-modal-timeline .timeline-event-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-modal-timeline .timeline-event-time {
    font-size: 10px;
    opacity: 0.8;
}

.event-modal-timeline .timeline-now-marker {
    position: absolute;
    left: 40px;
    right: 4px;
    height: 2px;
    background: #ef4444;
    z-index: 10;
}

.event-modal-timeline .timeline-now-marker::before {
    content: "";
    position: absolute;
    left: -4px;
    top: -3px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
}

.event-modal-timeline .preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}
