/* 基本スタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'メイリオ', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* ログインページ */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

button[type="submit"] {
    width: 100%;
    padding: 6px 12px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

button[type="submit"]:hover {
    background: #2980b9;
}

.error-message {
    background: #e74c3c;
    color: #fff;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

/* アプリレイアウト（サイドバー + メインエリア） */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* サイドバー */
.sidebar {
    width: 150px;
    min-width: 150px;
    background: #2c3e50;
    color: #ecf0f1;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-top {
    padding: 12px 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-site-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #fff;
}

.sidebar-user {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-user-name {
    font-size: 14px;
    font-weight: bold;
    color: #ecf0f1;
}

.sidebar-user-role {
    font-size: 12px;
    color: #95a5a6;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav-item {
    display: block;
    padding: 8px 10px;
    color: #bdc3c7;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar-nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-nav-item.current {
    background-color: #3498db;
    color: #fff;
    font-weight: bold;
}

.sidebar-bottom {
    padding: 10px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

button.sidebar-logout-btn {
    width: 100%;
    padding: 8px 12px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

button.sidebar-logout-btn:hover {
    background: #c0392b;
}

/* メインラッパー（サイドバー右側の全体エリア） */
.main-wrapper {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
}

/* メインコンテンツ */
.main-content {
    margin: 12px auto;
    padding: 0 16px;
}

.main-content h1 {
    margin-bottom: 20px;
    color: #2c3e50;
}

/* ポータルメニュー */
.portal-menu {
    display: grid;
    grid-template-columns: 1fr; /* 一列表示 */
    gap: 20px;
}

/* レスポンシブ対応: モバイルでは縦並び */
@media (max-width: 768px) {
    .portal-menu {
        grid-template-columns: 1fr;
    }
}

/* 人事メニュー領域 */
.hr-menu-section {
    grid-column: 1 / -1;
    background: #f8f9fa;
    border: 2px solid #3498db;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 10px;
}

.hr-menu-title {
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.hr-menu-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* レスポンシブ対応: モバイルでは縦並び */
@media (max-width: 768px) {
    .hr-menu-items {
        grid-template-columns: 1fr;
    }
}

.menu-group {
    display: flex;
    flex-direction: column;
}

.menu-item {
    display: block;
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: #333;
    transition: transform 0.3s, box-shadow 0.3s;
    min-height: 120px;
    flex: 1;
    box-sizing: border-box;
    max-width: 500px; /* カードの最大幅を設定 */
}

.menu-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

/* 人事メニューのカードスタイル */
.menu-item-hr {
    background: #e3f2fd !important; /* 薄い青系の背景色 */
    border-left: 5px solid #2196f3; /* 左側に青いボーダー */
    position: relative;
}

.menu-item-hr::before {
    content: '人事';
    position: absolute;
    top: 10px;
    right: 15px;
    background: #2196f3;
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.menu-item-id {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.menu-item-name {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
}

.menu-item-description {
    font-size: 14px;
    color: #7f8c8d;
}

/* モジュールページ */
.module-container {
    max-width: 100%;
    margin: 6px auto;
    padding: 0 16px;
}

.module-header {
    margin-bottom: 5px;
}

.module-header h1 {
    color: #2c3e50;
    font-size: 1.5em;
    margin-top: 0;
}

.back-link {
    display: inline-block;
    margin-top: 2px;
    color: #3498db;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.module-content {
    background: #fff;
    padding: 5px 20px 20px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* テーブルスタイル */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #2c3e50;
}

.data-table tr:hover {
    background-color: #f5f5f5;
}

/* リンクスタイル */
.name-link {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.name-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

.detail-link {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s;
}

.detail-link:hover {
    color: #2980b9;
    text-decoration: underline;
}