/* ===== 共通設定 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #5ba4d4;
    --primary-dark: #4a93c3;
    --secondary: #f8f9fa;
    --accent: #7ec8e8;
    --warning: #a0aec0;
    --danger: #718096;
    --text-dark: #2d3748;
    --text-light: #718096;
    --white: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

body {
    font-family: 'Segoe UI', 'Hiragino Sans', 'Meiryo', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    min-height: 100vh;
    color: var(--text-dark);
}

/* ===== ログインページ ===== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: var(--white);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 24px;
}

.login-box .subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 32px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.error-message {
    background: #fef2f2;
    color: var(--danger);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

/* ===== ダッシュボード ===== */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* サイドバー */
.sidebar {
    width: 260px;
    background: var(--white);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h1 {
    font-size: 20px;
    color: var(--text-dark);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.nav-section {
    padding: 0 16px;
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-light);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding: 0 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.nav-item:hover {
    background: var(--secondary);
}

.nav-item.active {
    background: var(--primary);
    color: var(--white);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    margin-right: 12px;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: var(--text-light);
}

/* メインコンテンツ */
.main-content {
    flex: 1;
    padding: 24px;
    background: #f8f9fa;
    overflow-y: auto;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 24px;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.page-header p {
    color: var(--text-light);
    font-size: 14px;
}

/* 目標セクション */
.goals-section {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.section-header {
    margin-bottom: 16px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
}

/* テーブルスタイル */
.goals-table {
    width: 100%;
    border-collapse: collapse;
}

.goals-table th {
    text-align: left;
    font-size: 11px;
    color: var(--text-light);
    font-weight: 500;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}

.goals-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.goals-table tr:last-child td {
    border-bottom: none;
}

.category-badge {
    font-size: 11px;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.category-badge.crm {
    background: var(--primary);
}

.category-badge.cs {
    background: var(--accent);
}

.goal-name {
    font-weight: 600;
    font-size: 13px;
}

.values {
    font-size: 12px;
    color: var(--text-light);
}

.values .current {
    color: var(--text-dark);
    font-weight: 600;
}

.progress-cell {
    width: 180px;
}

.progress-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-fill.crm {
    background: var(--primary);
}

.progress-fill.cs {
    background: var(--accent);
}

.progress-percent {
    font-size: 14px;
    font-weight: 700;
    min-width: 45px;
    text-align: right;
}

/* 日報ステータス */
.report-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.report-count {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}

.report-label {
    font-size: 13px;
    color: var(--text-light);
}

/* レスポンシブ */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .goals-table th:nth-child(3),
    .goals-table td:nth-child(3) {
        display: none;
    }
    
    .progress-cell {
        width: 120px;
    }
}
/* 残り削減量のヒント表示 */
.remaining-hint {
    font-size: 1rem;
    font-weight: 700;
    color: #e74c3c;
    white-space: nowrap;
    background: #fff5f5;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e74c3c;
}

.hint-cell {
    text-align: center;
    min-width: 180px;
}

.sales-subtext {
    font-size: 0.75rem;
    color: #6a7a8a;
    margin-top: 4px;
    font-weight: 600;
}

/* ダッシュボードの目標テーブル文字サイズ */
.goals-table {
    font-size: 1rem;
}

.goals-table td {
    padding: 16px 12px;
}

.goals-table .goal-name {
    font-size: 1.05rem;
    font-weight: 500;
}

.goals-table .values {
    font-size: 1rem;
}

.goals-table .values .current {
    font-weight: 600;
}
/* ============================
   シフト承認ページ
   ============================ */

/* 月選択 */
.month-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
}

.month-nav-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
}

.month-nav-btn:hover {
    background: var(--primary-dark);
}

.current-month {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color);
}

/* 申請カード一覧 */
.approval-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.approval-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.approval-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.approval-card-header .member-name {
    font-weight: 600;
    font-size: 1.05rem;
}

.approval-card-body {
    padding: 16px;
}

.approval-card-body .info-row {
    display: flex;
    margin-bottom: 8px;
}

.approval-card-body .info-row .label {
    color: var(--text-light);
    width: 80px;
}

.approval-card-body .info-row .value {
    font-weight: 500;
}

.approval-card-footer {
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
    text-align: right;
}

/* ステータスバッジ追加 */
.status-badge.status-rejected {
    background-color: #fee2e2;
    color: #dc2626;
}

/* 空メッセージ */
.empty-message {
    text-align: center;
    padding: 48px;
    color: var(--text-light);
    font-size: 1rem;
}

/* シフト詳細モーダル */
.shift-detail-modal {
    max-width: 700px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.member-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.member-info-row .label {
    color: var(--text-light);
    min-width: 80px;
}

.member-info-row .value {
    font-weight: 500;
}

/* モーダル内カレンダー */
.shift-calendar-view {
    margin-top: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.calendar-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f1f5f9;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.calendar-header-row span {
    padding: 10px 0;
}

.calendar-header-row span:first-child {
    color: #dc2626;
}

.calendar-header-row span:last-child {
    color: #2563eb;
}

.calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-cell {
    border: 1px solid #e2e8f0;
    padding: 8px;
    min-height: 60px;
    font-size: 0.85rem;
    position: relative;
}

.calendar-cell.empty {
    background: #f8fafc;
}

.calendar-cell .cell-day {
    font-weight: 600;
    margin-bottom: 4px;
}

.calendar-cell .cell-type {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

.calendar-cell .cell-comment {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.7rem;
    cursor: help;
}

/* シフト種別の色 */
.calendar-cell.shift-type-work .cell-type {
    background: #dbeafe;
    color: #1e40af;
}

.calendar-cell.shift-type-am_off .cell-type {
    background: #fef3c7;
    color: #92400e;
}

.calendar-cell.shift-type-pm_off .cell-type {
    background: #fef3c7;
    color: #92400e;
}

.calendar-cell.shift-type-paid .cell-type {
    background: #dcfce7;
    color: #166534;
}

.calendar-cell.shift-type-off_request .cell-type {
    background: #fee2e2;
    color: #dc2626;
}

.calendar-cell.shift-type-off_fixed .cell-type {
    background: #f3e8ff;
    color: #7c3aed;
}

/* 却下理由セクション */
.rejection-reason-section {
    margin-top: 20px;
}

.rejection-reason-section label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #dc2626;
}

.rejection-reason-section textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    resize: vertical;
}

.rejection-reason-section textarea:disabled {
    background: #f8fafc;
}

/* モーダルフッター */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
}

.modal-footer.hidden {
    display: none;
}

/* ボタンサイズ追加 */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}
/* サイドバー折りたたみ */
.nav-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}
.nav-group-toggle:hover {
    background: rgba(255,255,255,0.08);
}
.nav-toggle-arrow {
    font-size: 10px;
    color: #8facc4;
}
.nav-group-items {
    overflow: hidden;
}
.nav-child {
    padding-left: 28px !important;
}