:root {
    --primary: #2E7D32;
    --primary-light: #E8F5E9;
    --accent: #FF9800;
    --text: #333;
    --bg: #f4f4f9;
    --gray: #9E9E9E;
    --danger: #d32f2f;
    --warning: #F57C00;
    --blue: #1976D2;
    --triangle: #FBC02D; /* 三角ボタン用 */
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0; padding: 0; padding-bottom: 80px;
}
header {
    background: var(--primary); color: white; padding: 15px; position: sticky; top: 0; z-index: 90;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.header-inner { display: flex; justify-content: space-between; align-items: center; max-width: 800px; margin: 0 auto; }
h1 { margin: 0; font-size: 1.2rem; }

/* スタート画面 */
.start-screen-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: white; z-index: 2000;
    display: flex; align-items: center; justify-content: center;
}
.start-screen-content { width: 90%; max-width: 400px; text-align: center; }
.start-screen-content h2 { color: var(--primary); margin-bottom: 10px; }
.start-form-group { margin-bottom: 20px; text-align: left; }
.start-form-group label { display: block; font-weight: bold; margin-bottom: 5px; color: #555; }
.start-form-group select { width: 100%; padding: 12px; font-size: 1.1rem; border: 2px solid #ddd; border-radius: 8px; background: #fff; }
.btn-large { width: 100%; padding: 15px; font-size: 1.1rem; border-radius: 30px; margin-top: 10px; }
.user-info-display { font-size: 0.9rem; display: flex; align-items: center; gap: 10px; }
.btn-logout { background: rgba(0,0,0,0.2); border: none; color: white; padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; cursor: pointer; }

.container { padding: 15px; max-width: 800px; margin: 0 auto; }
.view-section { display: none; }
.view-section.active { display: block; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* 共通パーツ */
.date-nav, .date-nav-month {
    display: flex; justify-content: space-between; align-items: center; background: white;
    padding: 10px 20px; border-radius: 8px; margin-bottom: 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.date-nav button, .date-nav-month button { background: none; border: none; font-size: 1.5rem; color: var(--primary); cursor: pointer; }

/* レッスンカード（共通） */
.lesson-card {
    background: white; border-radius: 10px; padding: 15px; margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); border-left: 5px solid var(--gray); position: relative;
}
.lesson-card.status-open { border-left-color: var(--primary); }
.lesson-card.status-full { border-left-color: var(--gray); background-color: #f9f9f9; }
.lesson-card.status-finished { border-left-color: #555; background-color: #ddd; opacity: 0.7; }

.card-header { display: flex; justify-content: space-between; margin-bottom: 5px; }
.lesson-date-row { font-weight: bold; color: var(--primary); margin-bottom: 4px; font-size: 1.05rem; }
.lesson-time { font-size: 1.2rem; font-weight: bold; color: #333; }

/* 修正: 場所の文字サイズを大きく */
.lesson-location { font-size: 1.15rem; color: #444; margin-left: 8px; font-weight: 500; }

.status-badge { padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; }
.badge-open { background: var(--primary-light); color: var(--primary); }
.badge-full { background: #ccc; color: #555; }
.badge-finished { background: #999; color: white; }

/* 参加ボタン群 */
.action-buttons { display: flex; gap: 10px; margin-top: 15px; border-top: 1px dashed #eee; padding-top: 10px; justify-content: flex-end; }
.btn { padding: 10px 20px; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 0.95rem; display: inline-flex; align-items: center; justify-content: center;}
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-circle { background: white; border: 2px solid var(--primary); color: var(--primary); font-size: 1.2rem; width: 50px; padding: 5px 0; }
.btn-circle.selected { background: var(--primary); color: white; }
.btn-triangle { background: white; border: 2px solid var(--triangle); color: var(--triangle); font-size: 1.2rem; width: 50px; padding: 5px 0; }
.btn-triangle.selected { background: var(--triangle); color: white; }

.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: #ddd; color: #333; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn:disabled { background: #ccc; cursor: not-allowed; border: none; color: #fff;}

/* 管理者リスト */
.weekly-list { background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.weekly-day-header { background: #f5f5f5; padding: 8px 15px; font-weight: bold; font-size: 0.9rem; border-bottom: 1px solid #eee; color: #555; }
.weekly-item { padding: 12px 15px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }

/* 顧客リスト（管理） */
.customer-list-toolbar { display: flex; gap: 10px; margin-bottom: 10px; justify-content: flex-end; }
.customer-list-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; background: white; }
.customer-list-table th, .customer-list-table td { border: 1px solid #eee; padding: 8px 4px; text-align: left; font-size: 0.9rem; }
.customer-list-table th { background: #f5f5f5; cursor: pointer; user-select: none; position: relative;}
.customer-list-table th:hover { background: #e0e0e0; }
.customer-list-table th::after { content: '↕'; font-size: 0.7rem; color: #999; float: right; margin-left: 2px;}
.customer-list-row { cursor: pointer; }
.customer-list-row:active { background-color: #e3f2fd; }

/* 場所管理 */
.location-manager { background: white; padding: 15px; border-radius: 8px; margin-top: 20px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.location-list-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #eee; }

/* マイ履歴 */
.my-res-table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; }
.my-res-table th, .my-res-table td { padding: 10px; border-bottom: 1px solid #eee; font-size: 0.9rem; }
.my-res-table th { background: #f9f9f9; text-align: left; color: #666; font-size: 0.8rem; }

/* メンバーカレンダー */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; background: white; padding: 10px; border-radius: 8px; }
.cal-head { text-align: center; font-size: 0.8rem; font-weight: bold; color: #999; padding-bottom: 5px; }
.cal-cell { aspect-ratio: 1; border: 1px solid #eee; border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; }
.cal-cell.attended { background-color: var(--primary-light); border-color: var(--primary); font-weight: bold; color: var(--primary); }

/* KPI & グラフ */
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
.kpi-card { background: white; padding: 15px 10px; border-radius: 8px; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,0.05); border-bottom: 3px solid var(--primary); }
.kpi-label { font-size: 0.8rem; color: #666; display: block; margin-bottom: 5px; }
.kpi-value { font-size: 1.2rem; font-weight: bold; color: var(--text); }
.chart-container { background: white; padding: 15px; border-radius: 8px; margin-bottom: 20px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

/* モーダル */
.modal-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 200; 
    display: none; align-items: center; justify-content: center; 
}
.modal-content { background: white; padding: 20px; border-radius: 10px; width: 90%; max-width: 450px; max-height: 90vh; overflow-y: auto;}
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 8px; box-sizing: border-box; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; }
.time-range { display: flex; align-items: center; gap: 5px; }
.form-row { display: flex; gap: 10px; }
.half { flex: 1; }

.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; }
.checkbox-label { display: flex; align-items: center; gap: 5px; font-size: 0.9rem; background: #f5f5f5; padding: 5px 10px; border-radius: 15px; cursor: pointer;}

/* ナビゲーション */
.bottom-nav { 
    position: fixed; bottom: 0; left: 0; width: 100%; background: white; border-top: 1px solid #eee; display: flex; height: 60px; z-index: 90; 
}
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #999; cursor: pointer; font-size: 0.75rem; }
.nav-item.active { color: var(--primary); font-weight: bold; }
.nav-item span { font-size: 1.4rem; margin-bottom: 2px; }

/* 通知バッジ */
.notification-badge {
    position: absolute; top: -5px; right: -5px;
    background: var(--danger); color: white;
    font-size: 0.7rem; font-weight: bold;
    width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid white;
}

/* 表示制御 */
.admin-only { display: none !important; }
body.is-admin .admin-only { display: flex !important; }
.member-only { display: none; }
body.is-member .member-only { display: flex; flex-direction: column; }

/* 日別グラフの高さ調整 */
.daily-chart-wrapper { position: relative; width: 100%; height: 300px; }
@media (max-width: 767px) { .daily-chart-wrapper { height: 300px; } }

/* 通知リストのコンテナ */
.inquiry-list { display: flex; flex-direction: column; gap: 15px; padding-bottom: 20px; }

/* 個別の通知ボックス（カード） */
.inquiry-card {
    background: white; border-radius: 10px; padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); border-left: 5px solid var(--danger);
    display: flex; flex-direction: column;
}
.inquiry-header { font-size: 0.9rem; color: #666; margin-bottom: 5px; font-weight: bold; }
.inquiry-user-large { font-size: 1.1rem; font-weight: bold; color: #333; margin-bottom: 5px; }
.inquiry-detail { font-size: 0.95rem; color: #444; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px dashed #eee; }
.inquiry-footer { text-align: right; }