/* グローバルスタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --text-color: #333;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-color);
}

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

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

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

/* フォームスタイル */
.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: border-color 0.3s;
}

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

/* ボタンスタイル */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

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

.btn-secondary:hover {
    background: #27ae60;
}

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

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

/* アラート */
.alert {
    padding: 12px 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #fadbd8;
    color: #c0392b;
    border: 1px solid #e74c3c;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ダッシュボード */
.dashboard {
    background: var(--light-color);
}

/* ナビゲーション */
.navbar {
    background: white;
    box-shadow: var(--shadow);
    padding: 15px 0;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.navbar-brand {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 20px;
}

.navbar-menu a {
    text-decoration: none;
    color: var(--dark-color);
    padding: 8px 15px;
    border-radius: var(--border-radius);
    transition: all 0.3s;
}

.navbar-menu a:hover {
    background: var(--light-color);
    color: var(--primary-color);
}

/* コンテナ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* カード */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--dark-color);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--light-color);
}

/* テーブル */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--light-color);
    font-weight: 600;
    color: var(--dark-color);
}

.table tr:hover {
    background: #f8f9fa;
}

/* グリッド */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* カレンダー */
.calendar {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

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

.calendar-day {
    aspect-ratio: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.calendar-day:hover {
    background: var(--light-color);
}

.calendar-day.today {
    background: var(--primary-color);
    color: white;
    font-weight: bold;
}

/* バッジ */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

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

.badge-success {
    background: var(--secondary-color);
    color: white;
}

.badge-danger {
    background: var(--danger-color);
    color: white;
}

.badge-warning {
    background: var(--warning-color);
    color: white;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-color);
}

.modal-close:hover {
    color: var(--danger-color);
}

/* ユーティリティ */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        gap: 15px;
    }

    .navbar-menu {
        flex-direction: column;
        width: 100%;
        text-align: center;
    }

    .login-box {
        padding: 30px 20px;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .table {
        font-size: 12px;
    }

    .table th,
    .table td {
        padding: 8px;
    }

    .calendar-grid {
        gap: 2px;
    }

    .calendar-day {
        padding: 5px;
        font-size: 12px;
    }

    .container {
        padding: 20px 10px;
    }
}

@media (max-width: 480px) {
    .login-box h1 {
        font-size: 24px;
    }

    .form-control {
        padding: 10px;
    }

    .btn {
        padding: 10px 20px;
    }
}

/* ローディングスピナー */
.spinner {
    border: 3px solid var(--light-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* シフト表カレンダースタイル */
.calendar-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.calendar-table th {
    background: var(--light-color);
    padding: 10px 5px;
    text-align: center;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.calendar-table td {
    border: 1px solid var(--border-color);
    padding: 5px;
    vertical-align: top;
    height: 100px;
    position: relative;
}

.calendar-table td.other-month {
    background: #f9f9f9;
}

.calendar-table td.today {
    background: #fff3cd;
}

.calendar-table td.sunday {
    background: #ffe6e6;
}

.calendar-table td.saturday {
    background: #e6f3ff;
}

.date-number {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 14px;
}

.shift-item {
    font-size: 11px;
    padding: 2px 4px;
    margin: 2px 0;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: white;
}

.view-toggle {
    margin-bottom: 15px;
}

.view-toggle a {
    padding: 8px 15px;
    margin-right: 10px;
    text-decoration: none;
    border-radius: var(--border-radius);
    background: white;
    border: 1px solid var(--border-color);
    color: var(--dark-color);
}

.view-toggle a.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* シフト希望申請画面 */
.request-row {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.pattern-select {
    display: none;
}

/* 有給管理画面 */
.paid-leave-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.paid-leave-banner h2 {
    margin: 0;
    color: white;
}

.paid-leave-days {
    font-size: 48px;
    font-weight: bold;
    margin-top: 10px;
}

/* 追加ユーティリティクラス */
.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

.float-right {
    float: right;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.p-15 {
    padding: 15px;
}

.p-20 {
    padding: 20px;
}

.p-30 {
    padding: 30px;
}

.font-12 {
    font-size: 12px;
}

.font-14 {
    font-size: 14px;
}

.font-28 {
    font-size: 28px;
}

.font-36 {
    font-size: 36px;
}

.font-48 {
    font-size: 48px;
}

.bold {
    font-weight: bold;
}

.no-margin {
    margin: 0 !important;
}

.color-primary {
    color: var(--primary-color);
}

.color-secondary {
    color: var(--secondary-color);
}

.color-danger {
    color: var(--danger-color);
}

.color-warning {
    color: var(--warning-color);
}

.color-white {
    color: white;
}

.color-gray {
    color: #999;
}

.border-bottom {
    border-bottom: 1px solid var(--border-color);
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 背景色クラス（シフトパターン用） */
.bg-blue {
    background-color: #3498db !important;
    color: white;
}

.bg-green {
    background-color: #2ecc71 !important;
    color: white;
}

.bg-red {
    background-color: #e74c3c !important;
    color: white;
}

.bg-orange {
    background-color: #f39c12 !important;
    color: white;
}

.bg-purple {
    background-color: #9b59b6 !important;
    color: white;
}

.bg-teal {
    background-color: #1abc9c !important;
    color: white;
}

.bg-dark {
    background-color: #34495e !important;
    color: white;
}

.bg-gray {
    background-color: #95a5a6 !important;
    color: white;
}

.bg-dark-orange {
    background-color: #e67e22 !important;
    color: white;
}

.bg-dark-blue {
    background-color: #2980b9 !important;
    color: white;
}

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

.bg-secondary-white {
    background: var(--secondary-color);
    color: white;
}

.bg-danger-white {
    background: var(--danger-color);
    color: white;
}

.bg-warning-white {
    background: var(--warning-color);
    color: white;
}

/* テキストサイズ・色の組み合わせ */
.stat-number {
    font-size: 36px;
    font-weight: bold;
    text-align: center;
    padding: 20px;
}

.stat-number-compact {
    font-size: 36px;
    font-weight: bold;
    text-align: center;
}

.stat-number-large {
    font-size: 48px;
    font-weight: bold;
    margin-top: 10px;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 20px;
}

.info-text-small {
    font-size: 12px;
    color: #666;
}

/* ナビゲーション用 */
.nav-active {
    background: var(--primary-color);
    color: white;
}

/* 曜日の色 */
.day-sunday {
    color: #e74c3c;
}

.day-saturday {
    color: #3498db;
}

/* チェックボックスリスト */
.checkbox-list {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px;
}

.checkbox-item {
    display: block;
    margin-bottom: 10px;
}

/* スクロール可能な領域 */
.scroll-area {
    max-height: 400px;
    overflow-y: auto;
}

/* 非表示フォーム */
.hidden-form {
    display: none;
}

/* 有給バナーのタイトル */
.paid-leave-banner h2 {
    margin: 0;
    color: white;
}

.p-10 {
    padding: 10px;
}

.list-unstyled {
    list-style: none;
    padding: 0;
}

/* リンクスタイル */
.link-dark {
    text-decoration: none;
    color: var(--dark-color);
}

/* リクエスト行 */
.request-row {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

/* パターン選択（初期非表示） */
.pattern-select {
    display: none;
}
