body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f7fa;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px;
}
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.search-bar {
    display: flex;
    margin-bottom: 20px;
}
.search-bar form {
    display: flex;
    width: 100%;
}
.search-bar input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
}
.search-bar button {
    background: #4a6cf7;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0 20px;
    cursor: pointer;
}
.category-navigation {
    display: flex;
    margin-bottom: 20px;
}
.category-list {
    width: 30%;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 10px;
}
.subcategory-list {
    width: 30%;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 10px;
}
.template-list {
    width: 40%;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}
.list-header {
    background: #f8f9fa;
    padding: 10px;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
}
.list-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}
.list-item:hover {
    background: #f5f5f5;
}
.list-item.active {
    background: #e6f7ff;
    border-left: 3px solid #1890ff;
}
.template-preview {
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    background: white;
}
.template-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}
.template-actions button {
    margin-left: 10px;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}
.btn-copy {
    background: #52c41a;
    color: white;
    border: none;
}
.btn-favorite {
    background: white;
    color: #faad14;
    border: 1px solid #faad14;
}
.btn-favorite.active {
    background: #faad14;
    color: white;
    border: 1px solid #faad14;
}
.btn-edit {
    background: #1890ff;
    color: white;
    border: none;
    font-family: inherit;
/*
    font-size: 16px;
*/
}
.btn-delete {
    background: white;
    color: #f5222d;
    border: 1px solid #f5222d;
}
.btn-top-menu {
    width: 120px;
    min-width: 120px;
    gap: 10px;
}
.btn-template-preview {
    width: 145px;
    min-width: 145px;
    gap: 10px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 8px;
}
.badge-favorite {
    background: #fff2e8;
    color: #fa541c;
    border: 1px solid #ffbb96;
}
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    display: none;
    z-index: 1000;
}
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 900;
}
.modal-content {
    background: white;
    margin: 10% auto;
    padding: 20px;
    max-width: 800px; /* 最大幅を設定 */
    width: 90%; /* 画面幅の90%を基本とする */
    border-radius: 8px;
    position: relative;
}

/* モーダルの種類に応じて幅を調整 */
#modal-template .modal-content {
    max-width: 800px;
    margin-top: 5%; /* ここを追加または変更 */
}

#modal-category-management .modal-content {
    max-width: 600px;
    margin-top: 5%; /* ここを追加または変更 */
}

#modal-category-editor .modal-content {
    max-width: 500px;
    margin-top: 5%; /* ここを追加または変更 */
}

#modal-user-management .modal-content {
    max-width: 700px;
    margin-top: 5%; /* ここを追加または変更 */
}

#modal-confirm .modal-content {
    max-width: 400px;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e5e5e5;
}

.modal-footer button {
    min-width: 100px;
    padding: 8px 16px;
}
.modal-close {
    cursor: pointer;
    font-size: 16px;
    background: #fff;
    color: #1890ff;
    border: 2px solid #1890ff;
    font-family: inherit;
    font-size: 16px;
    width: 120px; /* 必要に応じて */
    min-width: 120px;
    box-sizing: border-box;
    transition: background 0.2s, color 0.2s;
}
.modal-close_2 {
    cursor: pointer;
    font-size: 20px;
}
.modal-btn {
    font-size: 16px;
    width: 120px; /* 新規テンプレートモーダルのキャンセルボタンと同じ幅に調整 */
    min-width: 120px; /* 必要に応じて */
}

.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}
.form-group textarea {
    height: 150px;
}
.btn-group {
    display: flex;
    justify-content: flex-end;
    gap: 10px; /* ボタン間の余白を追加 */
}
#new-user-password {
    margin-bottom: 10px;
}
.user-list {
    margin-top: 20px;
    margin-bottom: 20px;
}

.user-list table {
    width: 100%;
    border-collapse: collapse;
}

.user-list th, 
.user-list td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.user-list th {
    background-color: #f5f5f5;
}

.user-list tr:hover {
    background-color: #f9f9f9;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 4px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
}

.toast-info {
    background-color: #2196F3;
}

.toast-success {
    background-color: #4CAF50;
}

.toast-warning {
    background-color: #FFC107;
}

.toast-error {
    background-color: #F44336;
}
.password-change-link {
    text-align: right;
    margin-top: 10px;
    font-size: 0.9em;
}
.password-change-link a {
    color: #0d6efd;
    text-decoration: none;
}
.password-change-link a:hover {
    text-decoration: underline;
}

/* パスワード変更画面のスタイル */
.password-change-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.password-change-container .form-group {
    margin-bottom: 15px;
}
.user-details {
    padding: 10px;
    margin-bottom: 20px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.user-details span {
    margin-right: 15px;
}

.admin-badge {
    background-color: #007bff;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
}

.username {
    font-weight: bold;
}

.last-login {
    color: #666;
}

/* ユーザ管理モーダルのユーザ一覧に縦スクロールを追加 */
#modal-user-management .user-list {
    max-height: 320px; /* 8行分程度の高さ */
    overflow-y: auto;
    margin-bottom: 10px;
}

/* ボタンはスクロール外に表示 */
#modal-user-management #delete-selected-users-btn {
    display: block;
    margin-bottom: 10px;

}

