.form-wrap {
    max-width: 960px;
}

.form-note {
    margin: 8px 0 18px;
    color: #666;
    font-size: 13px;
}

.form-card {
    background: #fff;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    margin-bottom: 18px;
    overflow: hidden;
}

.form-card-title {
    background: #f3f6fa;
    border-bottom: 1px solid #d7dde5;
    padding: 10px 14px;
    font-weight: bold;
}

.form-card-body {
    padding: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.form-row label:first-child {
    font-weight: bold;
    color: #333;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="date"],
.form-row input[type="number"],
.form-row select,
.form-row textarea {
    width: 100%;
    max-width: 420px;
    padding: 7px 8px;
    border: 1px solid #c9d1dc;
    border-radius: 4px;
    font-size: 14px;
}

.form-row textarea {
    min-height: 96px;
}

.form-help {
    display: block;
    margin-top: 4px;
    color: #777;
    font-size: 12px;
}

.form-actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-primary {
    background: #1f2937;
    color: #fff;
    border: 1px solid #1f2937;
    border-radius: 4px;
    padding: 8px 18px;
    cursor: pointer;
    font-weight: bold;
}

.btn-secondary {
    display: inline-block;
    background: #fff;
    color: #333;
    border: 1px solid #c9d1dc;
    border-radius: 4px;
    padding: 8px 14px;
    text-decoration: none;
}

.error-box {
    max-width: 960px;
    background: #fff1f2;
    border: 1px solid #fda4af;
    color: #991b1b;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 16px;
}

.error-box p {
    margin: 4px 0;
}

.checkbox-label,
.radio-label {
    font-weight: normal !important;
}

/* 部署ツリー */
.department-tree {
    max-width: 760px;
    border: 1px solid #d7dde5;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.department-parent {
    background: #e8edf5;
    border-top: 1px solid #cbd5e1;
    border-bottom: 1px solid #d7dde5;
    padding: 8px 10px;
    font-weight: bold;
}

.department-parent:first-child {
    border-top: none;
}

.department-child {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 10px;
    align-items: center;
    padding: 8px 10px 8px 32px;
    border-bottom: 1px solid #eef2f7;
}

.department-child:last-child {
    border-bottom: none;
}

.department-child.primary-row {
    background: #fff9df;
}

.department-child.primary-row .department-child-name {
    font-weight: bold;
}

.department-child-name {
    font-weight: normal;
}

.department-code {
    display: block;
    margin-top: 2px;
    margin-left: 18px;
    color: #777;
    font-size: 11px;
    font-family: Consolas, Monaco, monospace;
}

.department-type {
    color: #666;
    font-size: 12px;
    font-family: inherit;
    font-weight: normal;
}

.no-child {
    color: #777;
    padding: 8px 10px 8px 32px;
    font-size: 13px;
}

/* 権限 */
.role-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(140px, 1fr));
    gap: 10px;
    max-width: 720px;
}

.role-list label {
    display: block;
}

/* 小さめ画面対応 */
@media (max-width: 760px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .role-list {
        grid-template-columns: 1fr;
    }

    .department-child {
        grid-template-columns: 1fr;
        padding-left: 18px;
    }
}